From 7738baf3022bf03926287f56ac5b7c4e315e6134 Mon Sep 17 00:00:00 2001 From: Brian Weaver <weaver.299@osu.edu> Date: Tue, 12 Nov 2019 10:33:44 -0500 Subject: [PATCH 1/3] Sort the site list alphabetically when deploying --- scripts/tmux-parallel-push.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/tmux-parallel-push.sh b/scripts/tmux-parallel-push.sh index ecdf4135a5..e2f8901f38 100755 --- a/scripts/tmux-parallel-push.sh +++ b/scripts/tmux-parallel-push.sh @@ -38,7 +38,7 @@ mkdir $LOG_DIR; echo "LOG_DIR: $LOG_DIR"; -terminus org:site:list ohio-state-arts-and-sciences --upstream=b9baf7af-eb2c-4db5-81e6-32d3d9042572 --tag=D8 --fields=name --format=string > $LOG_DIR/site_list.txt; +terminus org:site:list ohio-state-arts-and-sciences --upstream=b9baf7af-eb2c-4db5-81e6-32d3d9042572 --tag=D8 --fields=name --format=string | sort | tee $LOG_DIR/site_list.txt; parallel --delay 0.1 --tmuxpane --fg -a $LOG_DIR/site_list.txt "scripts/deploy-site-env.sh {}.$ENV $DEPLOY_MSG 2>&1 | tee $LOG_DIR/{}.log"; -- GitLab From e373580c3d308de26945148abbffad8da8f44e3e Mon Sep 17 00:00:00 2001 From: Brian Weaver <weaver.299@osu.edu> Date: Wed, 4 Dec 2019 15:10:21 -0500 Subject: [PATCH 2/3] Explicitly clear cache after deploy --- scripts/deploy-site-env.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/deploy-site-env.sh b/scripts/deploy-site-env.sh index 1e62b52e80..eba099861c 100755 --- a/scripts/deploy-site-env.sh +++ b/scripts/deploy-site-env.sh @@ -57,6 +57,8 @@ terminus site:upstream:clear-cache $SITE_NAME; terminus upstream:updates:list $SITE_NAME.$ENV; terminus upstream:updates:apply $SITE_NAME.$ENV --updatedb; + terminus remote:drush $SITE_NAME.$ENV cr; + terminus env:clear-cache $SITE_NAME.$ENV; else if [[ -z $1 ]]; then while [[ -z $DEPLOY_MSG ]]; do @@ -67,5 +69,7 @@ else DEPLOY_MSG=$@; fi - terminus env:deploy $SITE_NAME.$ENV --updatedb --cc --note="$DEPLOY_MSG"; + terminus env:deploy $SITE_NAME.$ENV --updatedb --note="$DEPLOY_MSG"; + terminus remote:drush $SITE_NAME.$ENV cr; + terminus env:clear-cache $SITE_NAME.$ENV; fi -- GitLab From f1dcad4ec037de27820e22debc4982246d98db79 Mon Sep 17 00:00:00 2001 From: Brian Weaver <weaver.299@osu.edu> Date: Wed, 4 Dec 2019 15:13:40 -0500 Subject: [PATCH 3/3] SECURITY Update: simplesamlphp library (and drupal module) --- composer.json | 8 +- composer.lock | 237 +- vendor/bin/export-plural-rules.php | 1 - vendor/composer/autoload_classmap.php | 67 + vendor/composer/autoload_static.php | 67 + vendor/composer/installed.json | 261 +- vendor/gettext/gettext/CHANGELOG.md | 172 + vendor/gettext/gettext/LICENSE | 2 +- vendor/gettext/gettext/README.md | 194 +- vendor/gettext/gettext/composer.json | 21 +- vendor/gettext/gettext/src/BaseTranslator.php | 26 +- .../gettext/gettext/src/Extractors/Blade.php | 16 +- vendor/gettext/gettext/src/Extractors/Csv.php | 53 + .../gettext/src/Extractors/CsvDictionary.php | 38 +- .../gettext/src/Extractors/Extractor.php | 30 +- .../src/Extractors/ExtractorInterface.php | 19 +- .../Extractors/ExtractorMultiInterface.php | 28 + vendor/gettext/gettext/src/Extractors/Jed.php | 54 +- .../gettext/gettext/src/Extractors/JsCode.php | 71 +- .../gettext/gettext/src/Extractors/Json.php | 26 + .../gettext/src/Extractors/JsonDictionary.php | 17 +- vendor/gettext/gettext/src/Extractors/Mo.php | 45 +- .../gettext/src/Extractors/PhpArray.php | 71 +- .../gettext/src/Extractors/PhpCode.php | 189 +- vendor/gettext/gettext/src/Extractors/Po.php | 102 +- .../gettext/gettext/src/Extractors/Twig.php | 64 +- .../gettext/gettext/src/Extractors/VueJs.php | 423 + .../gettext/gettext/src/Extractors/Xliff.php | 86 + .../gettext/gettext/src/Extractors/Yaml.php | 27 + .../gettext/src/Extractors/YamlDictionary.php | 23 +- vendor/gettext/gettext/src/Generators/Csv.php | 56 + .../gettext/src/Generators/CsvDictionary.php | 34 +- .../gettext/src/Generators/Generator.php | 13 +- .../src/Generators/GeneratorInterface.php | 6 +- vendor/gettext/gettext/src/Generators/Jed.php | 54 +- .../gettext/gettext/src/Generators/Json.php | 26 + .../gettext/src/Generators/JsonDictionary.php | 30 +- vendor/gettext/gettext/src/Generators/Mo.php | 58 +- .../gettext/src/Generators/PhpArray.php | 66 +- vendor/gettext/gettext/src/Generators/Po.php | 51 +- .../gettext/gettext/src/Generators/Xliff.php | 122 + .../gettext/gettext/src/Generators/Yaml.php | 32 + .../gettext/src/Generators/YamlDictionary.php | 41 +- vendor/gettext/gettext/src/Merge.php | 221 + vendor/gettext/gettext/src/Translation.php | 268 +- vendor/gettext/gettext/src/Translations.php | 319 +- vendor/gettext/gettext/src/Translator.php | 97 +- .../gettext/src/TranslatorInterface.php | 12 + vendor/gettext/gettext/src/Utils/CsvTrait.php | 56 + .../gettext/src/Utils/DictionaryTrait.php | 59 + .../gettext/src/Utils/FunctionsScanner.php | 207 +- .../src/Utils/HeadersExtractorTrait.php | 67 + .../src/Utils/HeadersGeneratorTrait.php | 29 + .../gettext/src/Utils/JsFunctionsScanner.php | 134 +- .../src/Utils/MultidimensionalArrayTrait.php | 100 + .../gettext/src/Utils/ParsedComment.php | 140 + .../gettext/src/Utils/ParsedFunction.php | 40 +- .../gettext/src/Utils/PhpFunctionsScanner.php | 94 +- .../gettext/src/translator_functions.php | 109 +- vendor/gettext/languages/UNICODE-LICENSE.txt | 80 +- .../gettext/languages/bin/export-plural-rules | 287 +- .../languages/bin/export-plural-rules.bat | 9 +- .../languages/bin/export-plural-rules.php | 234 - vendor/gettext/languages/composer.json | 96 +- vendor/gettext/languages/src/Category.php | 46 +- vendor/gettext/languages/src/CldrData.php | 261 +- .../gettext/languages/src/Exporter/Docs.php | 45 +- .../languages/src/Exporter/Exporter.php | 69 +- .../gettext/languages/src/Exporter/Html.php | 68 +- .../gettext/languages/src/Exporter/Json.php | 24 +- vendor/gettext/languages/src/Exporter/Php.php | 42 +- vendor/gettext/languages/src/Exporter/Po.php | 28 +- .../languages/src/Exporter/Prettyjson.php | 23 +- vendor/gettext/languages/src/Exporter/Xml.php | 22 +- .../languages/src/FormulaConverter.php | 70 +- vendor/gettext/languages/src/Language.php | 188 +- vendor/gettext/languages/src/autoloader.php | 3 +- .../src/cldr-data/main/en-US/languages.json | 11 +- .../src/cldr-data/main/en-US/scripts.json | 9 +- .../src/cldr-data/main/en-US/territories.json | 17 +- .../src/cldr-data/supplemental/plurals.json | 45 +- .../twig-configurable-i18n/.codecov.yml | 11 + .../twig-configurable-i18n/.php_cs.dist | 14 + .../twig-configurable-i18n/.travis.yml | 32 + .../bin/check-syntax.sh | 15 + .../twig-configurable-i18n/composer.json | 6 +- .../twig-configurable-i18n/phpunit.xml | 19 + .../twig-configurable-i18n/psalm.xml | 30 + .../src/Twig/Environment.php | 11 +- .../src/Twig/Extensions/Extension/I18n.php | 77 +- .../src/Twig/Extensions/Node/Trans.php | 14 +- .../src/Twig/Extensions/TokenParser/Trans.php | 16 +- .../tests/bootstrap.php | 4 + vendor/psr/log/Psr/Log/LoggerInterface.php | 2 + vendor/psr/log/Psr/Log/LoggerTrait.php | 2 + vendor/psr/log/Psr/Log/NullLogger.php | 2 + .../log/Psr/Log/Test/LoggerInterfaceTest.php | 4 +- vendor/psr/log/Psr/Log/Test/TestLogger.php | 1 + vendor/psr/log/README.md | 6 + vendor/psr/log/composer.json | 2 +- vendor/robrichards/xmlseclibs/CHANGELOG.txt | 29 + vendor/robrichards/xmlseclibs/LICENSE | 2 +- vendor/robrichards/xmlseclibs/README.md | 2 +- vendor/robrichards/xmlseclibs/composer.json | 6 +- .../xmlseclibs/src/Utils/XPath.php | 44 + .../robrichards/xmlseclibs/src/XMLSecEnc.php | 7 +- .../xmlseclibs/src/XMLSecurityDSig.php | 32 +- .../xmlseclibs/src/XMLSecurityKey.php | 16 +- vendor/robrichards/xmlseclibs/xmlseclibs.php | 7 +- vendor/simplesamlphp/saml2/composer.json | 16 +- vendor/simplesamlphp/saml2/phpunit.xml | 26 + vendor/simplesamlphp/saml2/psalm.xml | 36 + .../saml2/src/SAML2/ArtifactResolve.php | 13 +- .../saml2/src/SAML2/ArtifactResponse.php | 20 +- .../saml2/src/SAML2/Assertion.php | 344 +- .../saml2/src/SAML2/Assertion/Decrypter.php | 13 + .../saml2/src/SAML2/Assertion/Processor.php | 20 +- .../src/SAML2/Assertion/ProcessorBuilder.php | 31 + .../Transformer/DecodeBase64Transformer.php | 14 +- .../NameIdDecryptionTransformer.php | 22 + .../Transformer/TransformerChain.php | 15 +- .../AssertionConstraintValidator.php | 5 + .../Validation/AssertionValidator.php | 11 + .../ConstraintValidator/NotBefore.php | 7 +- .../ConstraintValidator/NotOnOrAfter.php | 7 +- .../SessionNotOnOrAfter.php | 7 +- .../ConstraintValidator/SpIsValidAudience.php | 15 +- .../SubjectConfirmationMethod.php | 5 + .../SubjectConfirmationNotBefore.php | 7 +- .../SubjectConfirmationNotOnOrAfter.php | 7 +- .../SubjectConfirmationRecipientMatches.php | 13 +- .../SubjectConfirmationResponseToMatches.php | 22 +- .../src/SAML2/Assertion/Validation/Result.php | 6 +- ...SubjectConfirmationConstraintValidator.php | 5 + .../SubjectConfirmationValidator.php | 17 + .../saml2/src/SAML2/AttributeQuery.php | 18 +- .../saml2/src/SAML2/AuthnRequest.php | 206 +- .../simplesamlphp/saml2/src/SAML2/Binding.php | 30 +- .../src/SAML2/Certificate/Fingerprint.php | 5 +- .../Certificate/FingerprintCollection.php | 3 +- .../SAML2/Certificate/FingerprintLoader.php | 3 +- .../saml2/src/SAML2/Certificate/Key.php | 63 +- .../src/SAML2/Certificate/KeyCollection.php | 3 +- .../saml2/src/SAML2/Certificate/KeyLoader.php | 24 +- .../src/SAML2/Certificate/PrivateKey.php | 16 +- .../SAML2/Certificate/PrivateKeyLoader.php | 19 +- .../saml2/src/SAML2/Certificate/X509.php | 15 +- .../src/SAML2/Compat/AbstractContainer.php | 11 +- .../src/SAML2/Compat/ContainerSingleton.php | 7 +- .../saml2/src/SAML2/Compat/MockContainer.php | 12 +- .../saml2/src/SAML2/Compat/Ssp/Container.php | 28 +- .../saml2/src/SAML2/Compat/Ssp/Logger.php | 99 +- .../src/SAML2/Configuration/ArrayAdapter.php | 11 + .../Configuration/CertificateProvider.php | 3 + .../Configuration/DecryptionProvider.php | 3 + .../src/SAML2/Configuration/Destination.php | 6 + .../SAML2/Configuration/IdentityProvider.php | 38 +- .../Configuration/IdentityProviderAware.php | 4 + .../src/SAML2/Configuration/PrivateKey.php | 56 +- .../src/SAML2/Configuration/Queryable.php | 1 + .../SAML2/Configuration/ServiceProvider.php | 37 +- .../Configuration/ServiceProviderAware.php | 4 + .../Configuration/SimpleSAMLConverter.php | 61 +- .../saml2/src/SAML2/Constants.php | 14 +- .../saml2/src/SAML2/DOMDocumentFactory.php | 9 +- .../saml2/src/SAML2/EncryptedAssertion.php | 11 +- .../Exception/UnparseableXmlException.php | 12 +- .../saml2/src/SAML2/HTTPArtifact.php | 50 +- .../saml2/src/SAML2/HTTPPost.php | 3 +- .../saml2/src/SAML2/HTTPRedirect.php | 51 +- .../saml2/src/SAML2/LogoutRequest.php | 97 +- .../simplesamlphp/saml2/src/SAML2/Message.php | 122 +- .../saml2/src/SAML2/Response.php | 9 +- .../Exception/PreconditionNotMetException.php | 4 + .../saml2/src/SAML2/Response/Processor.php | 15 +- .../Validation/ConstraintValidator.php | 5 + .../DestinationMatches.php | 10 + .../ConstraintValidator/IsSuccessful.php | 14 +- .../Validation/PreconditionValidator.php | 5 + .../src/SAML2/Response/Validation/Result.php | 7 +- .../SAML2/Response/Validation/Validator.php | 10 + vendor/simplesamlphp/saml2/src/SAML2/SOAP.php | 17 +- .../saml2/src/SAML2/SOAPClient.php | 62 +- .../Signature/AbstractChainedValidator.php | 9 +- .../src/SAML2/Signature/ChainedValidator.php | 2 +- .../SAML2/Signature/FingerprintValidator.php | 14 +- .../SAML2/Signature/PublicKeyValidator.php | 9 + .../saml2/src/SAML2/Signature/Validator.php | 16 +- .../src/SAML2/Signature/ValidatorChain.php | 8 +- .../saml2/src/SAML2/SignedElement.php | 8 +- .../saml2/src/SAML2/SignedElementHelper.php | 44 +- .../saml2/src/SAML2/StatusResponse.php | 18 +- .../saml2/src/SAML2/SubjectQuery.php | 13 +- .../src/SAML2/Utilities/ArrayCollection.php | 74 +- .../saml2/src/SAML2/Utilities/Certificate.php | 2 + .../saml2/src/SAML2/Utilities/Collection.php | 14 +- .../simplesamlphp/saml2/src/SAML2/Utils.php | 150 +- .../saml2/src/SAML2/XML/Chunk.php | 82 +- .../saml2/src/SAML2/XML/alg/DigestMethod.php | 30 +- .../saml2/src/SAML2/XML/alg/SigningMethod.php | 92 +- .../saml2/src/SAML2/XML/ds/KeyInfo.php | 80 +- .../saml2/src/SAML2/XML/ds/KeyName.php | 29 +- .../src/SAML2/XML/ds/X509Certificate.php | 32 +- .../saml2/src/SAML2/XML/ds/X509Data.php | 49 +- .../saml2/src/SAML2/XML/ecp/Response.php | 55 +- .../XML/md/AdditionalMetadataLocation.php | 59 +- .../SAML2/XML/md/AffiliationDescriptor.php | 236 +- .../XML/md/AttributeAuthorityDescriptor.php | 188 +- .../XML/md/AttributeConsumingService.php | 161 +- .../SAML2/XML/md/AuthnAuthorityDescriptor.php | 118 +- .../saml2/src/SAML2/XML/md/ContactPerson.php | 304 +- .../saml2/src/SAML2/XML/md/EndpointType.php | 137 +- .../src/SAML2/XML/md/EntitiesDescriptor.php | 204 +- .../src/SAML2/XML/md/EntityDescriptor.php | 358 +- .../saml2/src/SAML2/XML/md/Extensions.php | 28 +- .../src/SAML2/XML/md/IDPSSODescriptor.php | 222 +- .../src/SAML2/XML/md/IndexedEndpointType.php | 65 +- .../saml2/src/SAML2/XML/md/KeyDescriptor.php | 100 +- .../saml2/src/SAML2/XML/md/Organization.php | 153 +- .../saml2/src/SAML2/XML/md/PDPDescriptor.php | 118 +- .../src/SAML2/XML/md/RequestedAttribute.php | 33 +- .../saml2/src/SAML2/XML/md/RoleDescriptor.php | 321 +- .../src/SAML2/XML/md/SPSSODescriptor.php | 147 +- .../src/SAML2/XML/md/SSODescriptorType.php | 157 +- .../SAML2/XML/md/UnknownRoleDescriptor.php | 2 + .../src/SAML2/XML/mdattr/EntityAttributes.php | 44 +- .../src/SAML2/XML/mdrpi/PublicationInfo.php | 120 +- .../src/SAML2/XML/mdrpi/RegistrationInfo.php | 93 +- .../saml2/src/SAML2/XML/mdui/DiscoHints.php | 143 +- .../saml2/src/SAML2/XML/mdui/Keywords.php | 79 +- .../saml2/src/SAML2/XML/mdui/Logo.php | 120 +- .../saml2/src/SAML2/XML/mdui/UIInfo.php | 260 +- .../saml2/src/SAML2/XML/saml/Attribute.php | 134 +- .../src/SAML2/XML/saml/AttributeValue.php | 68 +- .../saml2/src/SAML2/XML/saml/BaseIDType.php | 69 +- .../saml2/src/SAML2/XML/saml/Issuer.php | 98 +- .../saml2/src/SAML2/XML/saml/NameID.php | 1 - .../saml2/src/SAML2/XML/saml/NameIDType.php | 108 +- .../SAML2/XML/saml/SubjectConfirmation.php | 89 +- .../XML/saml/SubjectConfirmationData.php | 199 +- .../saml2/src/SAML2/XML/samlp/Extensions.php | 4 +- .../saml2/src/SAML2/XML/shibmd/Scope.php | 59 +- vendor/simplesamlphp/saml2/src/_autoload.php | 5 +- .../.github/ISSUE_TEMPLATE/bug_report.md | 26 + .../.github/ISSUE_TEMPLATE/feature_request.md | 17 + .../simplesamlphp/simplesamlphp/.php_cs.dist | 19 + .../simplesamlphp/CONTRIBUTING.md | 166 +- vendor/simplesamlphp/simplesamlphp/TESTING.md | 14 +- .../attributemap/addurnprefix.php | 4 +- .../attributemap/deprecatedSchacNS.php | 4 +- .../attributemap/facebook2name.php | 4 +- .../simplesamlphp/attributemap/feide-oid.php | 4 +- .../attributemap/linkedin2name.php | 4 +- .../attributemap/myspace2name.php | 16 - .../simplesamlphp/attributemap/name2claim.php | 4 +- .../simplesamlphp/attributemap/name2oid.php | 4 +- .../simplesamlphp/attributemap/name2urn.php | 6 +- .../simplesamlphp/attributemap/newSchacNS.php | 4 +- .../simplesamlphp/attributemap/oid-feide.php | 4 +- .../simplesamlphp/attributemap/oid2name.php | 4 +- .../simplesamlphp/attributemap/oid2urn.php | 4 +- .../attributemap/openid2name.php | 4 +- .../attributemap/removeurnprefix.php | 4 +- .../simplesamlphp/attributemap/test.php | 4 +- .../attributemap/twitter2name.php | 4 +- .../simplesamlphp/attributemap/urn2name.php | 6 +- .../simplesamlphp/attributemap/urn2oid.php | 4 +- .../attributemap/windowslive2name.php | 4 +- .../simplesamlphp/bin/build-release.sh | 34 +- .../simplesamlphp/bin/check-syntax.sh | 0 .../simplesamlphp/bin/importPdoMetadata.php | 6 +- .../simplesamlphp/bin/initMDSPdo.php | 4 +- .../simplesamlphp/bin/memcacheSync.php | 80 +- .../simplesamlphp/simplesamlphp/bin/pwgen.php | 25 +- .../simplesamlphp/simplesamlphp/composer.json | 34 +- .../simplesamlphp/simplesamlphp/composer.lock | 1322 ++- .../simplesamlphp/config-templates/acl.php | 108 +- .../config-templates/authmemcookie.php | 126 +- .../config-templates/authsources.php | 269 +- .../simplesamlphp/config-templates/config.php | 328 +- .../dictionaries/admin.translation.json | 3 +- .../dictionaries/attributes.definition.json | 6 + .../dictionaries/attributes.translation.json | 203 +- .../dictionaries/disco.translation.json | 36 +- .../dictionaries/errors.translation.json | 318 +- .../dictionaries/general.translation.json | 30 +- .../dictionaries/login.definition.json | 129 +- .../dictionaries/login.translation.json | 118 +- .../dictionaries/logout.translation.json | 96 +- .../dictionaries/status.definition.json | 6 + .../dictionaries/status.translation.json | 60 +- .../simplesamlphp/simplesamlphp/docs/index.md | 3 +- .../docs/simplesamlphp-advancedfeatures.md | 11 +- .../docs/simplesamlphp-artifact-idp.md | 26 +- .../docs/simplesamlphp-artifact-sp.md | 6 +- .../docs/simplesamlphp-authproc.md | 50 +- .../docs/simplesamlphp-authsource.md | 20 +- .../docs/simplesamlphp-automated_metadata.md | 62 +- .../docs/simplesamlphp-changelog.md | 297 +- .../docs/simplesamlphp-customauth.md | 95 +- .../docs/simplesamlphp-database.md | 26 +- .../docs/simplesamlphp-ecp-idp.md | 74 + .../docs/simplesamlphp-errorhandling.md | 94 +- .../docs/simplesamlphp-googleapps.md | 30 +- .../docs/simplesamlphp-hok-idp.md | 12 +- .../docs/simplesamlphp-hok-sp.md | 4 +- .../docs/simplesamlphp-idp-more.md | 9 +- .../simplesamlphp/docs/simplesamlphp-idp.md | 67 +- .../docs/simplesamlphp-install-repo.md | 33 +- .../docs/simplesamlphp-install.md | 449 +- .../docs/simplesamlphp-maintenance.md | 54 +- .../docs/simplesamlphp-metadata-endpoints.md | 24 +- ...esamlphp-metadata-extensions-attributes.md | 36 +- .../simplesamlphp-metadata-extensions-rpi.md | 50 +- .../simplesamlphp-metadata-extensions-ui.md | 176 +- ...implesamlphp-metadata-pdostoragehandler.md | 8 +- .../docs/simplesamlphp-modules.md | 20 +- .../docs/simplesamlphp-nostate.md | 2 +- .../simplesamlphp-reference-idp-hosted.md | 95 +- .../simplesamlphp-reference-idp-remote.md | 40 +- .../docs/simplesamlphp-reference-sp-remote.md | 30 +- .../docs/simplesamlphp-scoping.md | 4 +- .../docs/simplesamlphp-sp-api.md | 26 +- .../docs/simplesamlphp-sp-migration.md | 286 - .../simplesamlphp/docs/simplesamlphp-sp.md | 40 +- .../docs/simplesamlphp-theming.md | 23 +- .../docs/simplesamlphp-upgrade-notes-1.15.md | 24 +- .../docs/simplesamlphp-upgrade-notes-1.16.md | 25 + .../docs/simplesamlphp-upgrade-notes-1.17.md | 49 + .../simplesamlphp/extra/simplesamlphp.spec | 2 +- .../SimpleSAML/Auth/AuthenticationFactory.php | 37 + .../lib/SimpleSAML/Auth/Default.php | 235 +- .../lib/SimpleSAML/Auth/LDAP.php | 340 +- .../lib/SimpleSAML/Auth/ProcessingChain.php | 704 +- .../lib/SimpleSAML/Auth/ProcessingFilter.php | 80 +- .../lib/SimpleSAML/Auth/Simple.php | 128 +- .../lib/SimpleSAML/Auth/Source.php | 210 +- .../lib/SimpleSAML/Auth/SourceFactory.php | 13 + .../lib/SimpleSAML/Auth/State.php | 115 +- .../lib/SimpleSAML/Auth/TimeLimitedToken.php | 2 +- .../lib/SimpleSAML/AuthMemCookie.php | 27 +- .../SimpleSAML/Bindings/Shib13/Artifact.php | 69 +- .../SimpleSAML/Bindings/Shib13/HTTPPost.php | 33 +- .../lib/SimpleSAML/Configuration.php | 375 +- .../simplesamlphp/lib/SimpleSAML/Database.php | 70 +- .../lib/SimpleSAML/Error/Assertion.php | 147 +- .../lib/SimpleSAML/Error/AuthSource.php | 104 +- .../lib/SimpleSAML/Error/BadRequest.php | 65 +- .../{BadUserInnput.php => BadUserInput.php} | 10 +- .../lib/SimpleSAML/Error/CannotSetCookie.php | 9 +- .../SimpleSAML/Error/ConfigurationError.php | 11 +- .../Error/CriticalConfigurationError.php | 17 +- .../lib/SimpleSAML/Error/Error.php | 79 +- .../lib/SimpleSAML/Error/ErrorCodes.php | 25 +- .../lib/SimpleSAML/Error/Exception.php | 90 +- .../SimpleSAML/Error/InvalidCredential.php | 10 +- .../lib/SimpleSAML/Error/MetadataNotFound.php | 34 +- .../lib/SimpleSAML/Error/NoPassive.php | 8 +- .../lib/SimpleSAML/Error/NoState.php | 22 +- .../lib/SimpleSAML/Error/NotFound.php | 96 +- .../SimpleSAML/Error/ProxyCountExceeded.php | 8 +- .../Error/UnserializableException.php | 86 +- .../lib/SimpleSAML/Error/User.php | 11 +- .../lib/SimpleSAML/Error/UserAborted.php | 23 +- .../lib/SimpleSAML/Error/UserNotFound.php | 9 +- .../lib/SimpleSAML/HTTP/Router.php | 127 + .../lib/SimpleSAML/HTTP/RunnableResponse.php | 69 + .../simplesamlphp/lib/SimpleSAML/IdP.php | 186 +- .../SimpleSAML/IdP/IFrameLogoutHandler.php | 61 +- .../SimpleSAML/IdP/LogoutHandlerInterface.php | 12 +- .../IdP/TraditionalLogoutHandler.php | 35 +- .../lib/SimpleSAML/Locale/Language.php | 42 +- .../lib/SimpleSAML/Locale/Localization.php | 69 +- .../lib/SimpleSAML/Locale/Translate.php | 148 +- .../simplesamlphp/lib/SimpleSAML/Logger.php | 75 +- .../Logger/ErrorLogLoggingHandler.php | 13 +- .../SimpleSAML/Logger/FileLoggingHandler.php | 14 +- .../Logger/LoggingHandlerInterface.php | 6 +- .../Logger/StandardErrorLoggingHandler.php | 2 +- .../Logger/SyslogLoggingHandler.php | 6 +- .../simplesamlphp/lib/SimpleSAML/Memcache.php | 125 +- .../Metadata/MetaDataStorageHandler.php | 97 +- .../MetaDataStorageHandlerFlatFile.php | 44 +- .../Metadata/MetaDataStorageHandlerPdo.php | 146 +- .../MetaDataStorageHandlerSerialize.php | 62 +- .../Metadata/MetaDataStorageHandlerXML.php | 39 +- .../Metadata/MetaDataStorageSource.php | 181 +- .../lib/SimpleSAML/Metadata/SAMLBuilder.php | 377 +- .../lib/SimpleSAML/Metadata/SAMLParser.php | 457 +- .../lib/SimpleSAML/Metadata/Signer.php | 87 +- .../lib/SimpleSAML/Metadata/Sources/MDQ.php | 65 +- .../simplesamlphp/lib/SimpleSAML/Module.php | 358 +- .../SimpleSAML/Module/ControllerResolver.php | 196 + .../simplesamlphp/lib/SimpleSAML/Session.php | 366 +- .../lib/SimpleSAML/SessionHandler.php | 40 +- .../lib/SimpleSAML/SessionHandlerCookie.php | 10 +- .../lib/SimpleSAML/SessionHandlerPHP.php | 163 +- .../lib/SimpleSAML/SessionHandlerStore.php | 12 +- .../simplesamlphp/lib/SimpleSAML/Stats.php | 28 +- .../lib/SimpleSAML/Stats/Output.php | 9 +- .../simplesamlphp/lib/SimpleSAML/Store.php | 20 +- .../lib/SimpleSAML/Store/Memcache.php | 22 +- .../lib/SimpleSAML/Store/Redis.php | 36 +- .../lib/SimpleSAML/Store/SQL.php | 120 +- .../lib/SimpleSAML/Utilities.php | 115 +- .../lib/SimpleSAML/Utils/Arrays.php | 8 +- .../lib/SimpleSAML/Utils/Attributes.php | 16 +- .../lib/SimpleSAML/Utils/Auth.php | 33 +- .../lib/SimpleSAML/Utils/Config.php | 14 +- .../lib/SimpleSAML/Utils/Config/Metadata.php | 49 +- .../lib/SimpleSAML/Utils/Crypto.php | 137 +- .../lib/SimpleSAML/Utils/HTTP.php | 253 +- .../lib/SimpleSAML/Utils/HttpAdapter.php | 211 + .../lib/SimpleSAML/Utils/Net.php | 4 +- .../lib/SimpleSAML/Utils/Random.php | 4 +- .../lib/SimpleSAML/Utils/System.php | 46 +- .../lib/SimpleSAML/Utils/Time.php | 9 +- .../lib/SimpleSAML/Utils/XML.php | 45 +- .../lib/SimpleSAML/XHTML/EMail.php | 142 +- .../lib/SimpleSAML/XHTML/IdPDisco.php | 106 +- .../lib/SimpleSAML/XHTML/Template.php | 273 +- .../XHTML/TemplateControllerInterface.php | 3 +- .../lib/SimpleSAML/XHTML/TemplateLoader.php | 72 + .../lib/SimpleSAML/XML/Errors.php | 19 +- .../lib/SimpleSAML/XML/Parser.php | 12 +- .../SimpleSAML/XML/Shib13/AuthnRequest.php | 15 +- .../SimpleSAML/XML/Shib13/AuthnResponse.php | 135 +- .../lib/SimpleSAML/XML/Signer.php | 102 +- .../lib/SimpleSAML/XML/Validator.php | 92 +- .../simplesamlphp/lib/_autoload.php | 3 +- .../simplesamlphp/lib/_autoload_modules.php | 113 +- .../locales/af/LC_MESSAGES/messages.po | 12 + .../locales/ar/LC_MESSAGES/messages.po | 10 + .../locales/cs/LC_MESSAGES/messages.po | 9 + .../locales/da/LC_MESSAGES/messages.po | 11 + .../locales/de/LC_MESSAGES/messages.po | 16 +- .../locales/el/LC_MESSAGES/messages.po | 11 + .../locales/en/LC_MESSAGES/messages.po | 13 + .../locales/es/LC_MESSAGES/messages.po | 12 + .../locales/et/LC_MESSAGES/messages.po | 11 + .../locales/eu/LC_MESSAGES/messages.po | 12 + .../locales/fi/LC_MESSAGES/messages.po | 11 + .../locales/fr/LC_MESSAGES/messages.po | 10 + .../locales/he/LC_MESSAGES/messages.po | 10 + .../locales/hr/LC_MESSAGES/messages.po | 12 + .../locales/hu/LC_MESSAGES/messages.po | 11 + .../locales/id/LC_MESSAGES/messages.po | 9 + .../locales/it/LC_MESSAGES/messages.po | 12 + .../locales/ja/LC_MESSAGES/messages.po | 7 + .../locales/lt/LC_MESSAGES/messages.po | 12 + .../locales/lv/LC_MESSAGES/messages.po | 10 + .../locales/nb/LC_MESSAGES/messages.po | 11 + .../locales/nl/LC_MESSAGES/messages.po | 14 + .../locales/nn/LC_MESSAGES/messages.po | 11 + vendor/simplesamlphp/simplesamlphp/locales/no | 1 + .../locales/pl/LC_MESSAGES/messages.po | 11 + .../locales/pt-br/LC_MESSAGES/messages.po | 12 + .../locales/pt/LC_MESSAGES/messages.po | 11 + .../locales/ro/LC_MESSAGES/messages.po | 12 + .../locales/ru/LC_MESSAGES/messages.po | 12 + .../locales/sl/LC_MESSAGES/messages.po | 11 + .../locales/sr/LC_MESSAGES/messages.po | 12 + .../locales/sv/LC_MESSAGES/messages.po | 11 + .../locales/tr/LC_MESSAGES/messages.po | 12 + .../locales/xh/LC_MESSAGES/messages.po | 684 ++ .../locales/zh-tw/LC_MESSAGES/messages.po | 9 + .../locales/zh/LC_MESSAGES/messages.po | 7 + .../locales/zu/LC_MESSAGES/messages.po | 689 ++ .../metadata-templates/adfs-idp-hosted.php | 20 +- .../metadata-templates/adfs-sp-remote.php | 20 +- .../metadata-templates/saml20-idp-hosted.php | 98 +- .../metadata-templates/saml20-idp-remote.php | 4 +- .../metadata-templates/saml20-sp-remote.php | 38 +- .../metadata-templates/shib13-idp-hosted.php | 33 +- .../metadata-templates/shib13-idp-remote.php | 8 +- .../metadata-templates/shib13-sp-hosted.php | 6 +- .../metadata-templates/shib13-sp-remote.php | 11 +- .../metadata-templates/wsfed-idp-remote.php | 8 +- .../metadata-templates/wsfed-sp-hosted.php | 6 +- .../modules/adfs/lib/IdP/ADFS.php | 289 +- .../XML/fed/{Const.php => Constants.php} | 8 +- .../adfs/lib/SAML2/XML/fed/Endpoint.php | 14 +- .../XML/fed/SecurityTokenServiceType.php | 50 +- .../lib/SAML2/XML/fed/TokenTypesOffered.php | 14 +- .../modules/adfs/lib/XMLSecurityDSig.php | 32 - .../modules/adfs/templates/postResponse.twig | 16 + .../adfs/www/assets/js/postResponse.js | 3 + .../modules/adfs/www/idp/metadata.php | 88 +- .../modules/adfs/www/idp/prp.php | 17 +- .../modules/admin/default-enable | 0 .../modules/admin/lib/ConfigController.php | 410 + .../admin/lib/FederationController.php | 374 + .../simplesamlphp/modules/admin/lib/Menu.php | 90 + .../modules/admin/lib/TestController.php | 247 + .../simplesamlphp/modules/admin/routes.yaml | 15 + .../admin/templates/authsource_list.twig | 12 + .../modules/admin/templates/config.twig | 69 + .../modules/admin/templates/diagnostics.twig | 17 + .../modules/admin/templates/federation.twig | 163 + .../admin/templates/includes/menu.twig | 15 + .../modules/admin/templates/status.twig | 35 + .../dictionaries/X509warning.definition.json | 2 +- .../dictionaries/X509warning.translation.json | 10 +- .../modules/authX509/docs/authX509.md | 6 +- .../lib/Auth/Process/ExpiryWarning.php | 28 +- .../authX509/lib/Auth/Source/X509userCert.php | 66 +- .../locales/da/LC_MESSAGES/authX509.po | 8 +- .../locales/el/LC_MESSAGES/authX509.po | 8 +- .../locales/en/LC_MESSAGES/authX509.po | 10 +- .../locales/es/LC_MESSAGES/authX509.po | 10 +- .../locales/nb/LC_MESSAGES/authX509.po | 8 +- .../locales/nl/LC_MESSAGES/authX509.po | 10 +- .../modules/authX509/templates/X509error.php | 41 +- .../modules/authX509/templates/X509error.twig | 19 + .../authX509/templates/X509warning.php | 22 +- .../authX509/templates/X509warning.twig | 24 + .../modules/authX509/www/expirywarning.php | 18 +- .../lib/Auth/Process/OTP2YubiPrefix.php | 52 +- .../authYubiKey/lib/Auth/Source/YubiKey.php | 338 +- .../modules/authYubiKey/libextinc/Yubico.php | 279 +- .../authYubiKey/templates/yubikeylogin.php | 44 +- .../authYubiKey/templates/yubikeylogin.twig | 31 + .../authYubiKey/www/assets/css/yubikey.css | 7 + .../authYubiKey/www/assets/js/autofocus.js | 1 + .../authYubiKey/www/resources/logo.jpg | 2 +- .../modules/authYubiKey/www/yubikeylogin.php | 38 +- .../authcrypt/lib/Auth/Source/Hash.php | 36 +- .../authcrypt/lib/Auth/Source/Htpasswd.php | 53 +- .../authfacebook/extlibinc/base_facebook.php | 2592 ++--- .../authfacebook/lib/Auth/Source/Facebook.php | 281 +- .../modules/authfacebook/lib/Facebook.php | 278 +- .../modules/authfacebook/www/linkback.php | 49 +- .../authlinkedin/docs/oauthlinkedin.md | 26 - .../authlinkedin/lib/Auth/Source/LinkedIn.php | 182 - .../modules/authlinkedin/www/linkback.php | 31 - .../modules/authmyspace/docs/oauthmyspace.md | 25 - .../authmyspace/lib/Auth/Source/MySpace.php | 137 - .../modules/authmyspace/www/linkback.php | 42 - .../dictionaries/Authorize.translation.json | 8 +- .../modules/authorize/docs/authorize.md | 88 +- .../authorize/lib/Auth/Process/Authorize.php | 273 +- .../locales/xh/LC_MESSAGES/authorize.po | 24 + .../locales/zu/LC_MESSAGES/authorize.po | 24 + .../authorize/templates/authorize_403.php | 21 +- .../authorize/templates/authorize_403.twig | 15 + .../modules/authorize/www/authorize_403.php | 16 +- .../authtwitter/lib/Auth/Source/Twitter.php | 272 +- .../modules/authtwitter/www/linkback.php | 45 +- .../authwindowslive/docs/windowsliveid.md | 6 +- .../lib/Auth/Source/LiveID.php | 92 +- .../modules/authwindowslive/www/linkback.php | 23 +- .../modules/cas/lib/Auth/Source/CAS.php | 465 +- .../modules/cas/www/linkback.php | 20 +- .../config-templates/module_casserver.php | 21 - .../modules/casserver/default-disable | 3 - .../modules/casserver/www/cas.php | 34 - .../modules/casserver/www/login.php | 55 - .../modules/casserver/www/proxy.php | 53 - .../modules/casserver/www/serviceValidate.php | 99 - .../modules/casserver/www/tickets.php | 41 - .../modules/casserver/www/validate.php | 3 - .../cdc/config-templates/module_cdc.php | 38 +- .../modules/cdc/lib/Auth/Process/CDC.php | 127 +- .../simplesamlphp/modules/cdc/lib/Client.php | 98 +- .../simplesamlphp/modules/cdc/lib/Server.php | 821 +- .../simplesamlphp/modules/cdc/www/resume.php | 17 +- .../simplesamlphp/modules/cdc/www/server.php | 2 +- .../{authlinkedin => consent}/default-disable | 0 .../modules/consent/default-enable | 3 - .../dictionaries/consent.definition.json | 132 +- .../modules/consent/dictionaries/consent.php | 753 +- .../dictionaries/consent.translation.json | 1565 +-- .../modules/consent/docs/consent.md | 50 +- .../consent/lib/Auth/Process/Consent.php | 172 +- .../consent/lib/Consent/Store/Cookie.php | 125 +- .../consent/lib/Consent/Store/Database.php | 306 +- .../modules/consent/lib/Logout.php | 9 +- .../modules/consent/lib/Store.php | 32 +- .../consent/locales/xh/LC_MESSAGES/consent.po | 82 + .../consent/locales/zu/LC_MESSAGES/consent.po | 84 + .../modules/consent/templates/consentform.php | 213 +- .../consent/templates/consentform.twig | 38 + .../consent/templates/logout_completed.php | 4 +- .../consent/templates/logout_completed.twig | 7 + .../modules/consent/templates/noconsent.php | 26 +- .../modules/consent/templates/noconsent.twig | 16 + .../www/{style.css => assets/consent.css} | 19 + .../consent/www/assets/css/consent.css | 54 + .../modules/consent/www/getconsent.php | 232 +- .../modules/consent/www/logout.php | 12 +- .../modules/consent/www/logout_completed.php | 4 +- .../modules/consent/www/noconsent.php | 44 +- .../config-templates/module_consentAdmin.php | 37 +- .../dictionaries/consentadmin.definition.json | 8 +- .../consentadmin.translation.json | 37 +- .../modules/consentAdmin/docs/consentAdmin.md | 4 +- .../consentAdmin/hooks/hook_configpage.php | 15 + .../consentAdmin/hooks/hook_frontpage.php | 17 +- .../locales/ar/LC_MESSAGES/consentAdmin.po | 3 - .../locales/cs/LC_MESSAGES/consentAdmin.po | 3 - .../locales/da/LC_MESSAGES/consentAdmin.po | 3 - .../locales/de/LC_MESSAGES/consentAdmin.po | 3 - .../locales/el/LC_MESSAGES/consentAdmin.po | 3 - .../locales/en/LC_MESSAGES/consentAdmin.po | 6 +- .../locales/es/LC_MESSAGES/consentAdmin.po | 5 +- .../locales/et/LC_MESSAGES/consentAdmin.po | 3 - .../locales/eu/LC_MESSAGES/consentAdmin.po | 3 - .../locales/fr/LC_MESSAGES/consentAdmin.po | 3 - .../locales/he/LC_MESSAGES/consentAdmin.po | 3 - .../locales/hr/LC_MESSAGES/consentAdmin.po | 3 - .../locales/hu/LC_MESSAGES/consentAdmin.po | 3 - .../locales/id/LC_MESSAGES/consentAdmin.po | 3 - .../locales/it/LC_MESSAGES/consentAdmin.po | 3 - .../locales/ja/LC_MESSAGES/consentAdmin.po | 3 - .../locales/lt/LC_MESSAGES/consentAdmin.po | 3 - .../locales/lv/LC_MESSAGES/consentAdmin.po | 3 - .../locales/nb/LC_MESSAGES/consentAdmin.po | 5 +- .../locales/nl/LC_MESSAGES/consentAdmin.po | 5 +- .../locales/nn/LC_MESSAGES/consentAdmin.po | 5 +- .../locales/pt/LC_MESSAGES/consentAdmin.po | 3 - .../locales/ro/LC_MESSAGES/consentAdmin.po | 3 - .../locales/ru/LC_MESSAGES/consentAdmin.po | 3 - .../locales/sl/LC_MESSAGES/consentAdmin.po | 3 - .../locales/sr/LC_MESSAGES/consentAdmin.po | 3 - .../locales/sv/LC_MESSAGES/consentAdmin.po | 3 - .../locales/zh-tw/LC_MESSAGES/consentAdmin.po | 3 - .../locales/zh/LC_MESSAGES/consentAdmin.po | 3 - .../consentAdmin/templates/consentadmin.php | 116 +- .../consentAdmin/templates/consentadmin.twig | 82 + .../templates/consentadminajax.php | 4 +- .../templates/consentadminajax.twig | 3 + .../www/assets/css/consentAdmin.css | 39 + .../www/assets/js/consentAdmin.js | 79 + .../modules/consentAdmin/www/consentAdmin.php | 157 +- .../www/includes/consentSimpleAjax.js | 70 - .../dictionaries/cardinality.definition.json | 14 + .../dictionaries/cardinality.translation.json | 34 + .../dictionaries/frontpage.definition.json | 18 +- .../dictionaries/frontpage.translation.json | 139 +- .../dictionaries/no_cookie.translation.json | 12 +- .../dictionaries/no_metadata.translation.json | 20 +- .../dictionaries/no_state.definition.json | 6 + .../dictionaries/no_state.translation.json | 54 +- .../core/docs/authproc_attributelimit.md | 35 + .../modules/core/docs/authproc_cardinality.md | 49 + .../core/docs/authproc_cardinalitysingle.md | 88 + .../core/docs/authproc_languageadaptor.md | 2 +- .../modules/core/docs/authproc_php.md | 17 +- .../core/docs/authproc_scopefromattribute.md | 4 +- .../docs/authproc_statisticswithattribute.md | 3 + .../modules/core/hooks/hook_frontpage.php | 47 +- .../modules/core/hooks/hook_sanitycheck.php | 80 +- .../simplesamlphp/modules/core/lib/ACL.php | 589 +- .../core/lib/Auth/Process/AttributeAdd.php | 128 +- .../core/lib/Auth/Process/AttributeAlter.php | 109 +- .../core/lib/Auth/Process/AttributeCopy.php | 99 +- .../core/lib/Auth/Process/AttributeLimit.php | 248 +- .../core/lib/Auth/Process/AttributeMap.php | 57 +- .../core/lib/Auth/Process/AttributeRealm.php | 33 +- .../lib/Auth/Process/AttributeValueMap.php | 48 +- .../core/lib/Auth/Process/Cardinality.php | 194 + .../lib/Auth/Process/CardinalitySingle.php | 124 + .../lib/Auth/Process/ExtendIdPSession.php | 89 +- .../core/lib/Auth/Process/GenerateGroups.php | 266 +- .../core/lib/Auth/Process/LanguageAdaptor.php | 114 +- .../modules/core/lib/Auth/Process/PHP.php | 26 +- .../core/lib/Auth/Process/ScopeAttribute.php | 196 +- .../lib/Auth/Process/ScopeFromAttribute.php | 125 +- .../Auth/Process/StatisticsWithAttribute.php | 181 +- .../core/lib/Auth/Process/TargetedID.php | 280 +- .../lib/Auth/Process/WarnShortSSOInterval.php | 87 +- .../core/lib/Auth/Source/AdminPassword.php | 97 +- .../modules/core/lib/Auth/UserPassBase.php | 477 +- .../modules/core/lib/Auth/UserPassOrgBase.php | 576 +- .../modules/core/lib/Controller.php | 174 + .../modules/core/lib/Stats/Output/File.php | 175 +- .../modules/core/lib/Stats/Output/Log.php | 67 +- .../core/lib/Storage/SQLPermanentStorage.php | 403 +- .../core/locales/ar/LC_MESSAGES/core.po | 8 +- .../core/locales/cs/LC_MESSAGES/core.po | 8 +- .../core/locales/da/LC_MESSAGES/core.po | 8 +- .../core/locales/de/LC_MESSAGES/core.po | 8 +- .../core/locales/el/LC_MESSAGES/core.po | 8 +- .../core/locales/en/LC_MESSAGES/core.po | 36 + .../core/locales/eu/LC_MESSAGES/core.po | 8 +- .../core/locales/fr/LC_MESSAGES/core.po | 8 +- .../core/locales/he/LC_MESSAGES/core.po | 8 +- .../core/locales/hr/LC_MESSAGES/core.po | 8 +- .../core/locales/hu/LC_MESSAGES/core.po | 8 +- .../core/locales/id/LC_MESSAGES/core.po | 8 +- .../core/locales/it/LC_MESSAGES/core.po | 8 +- .../core/locales/ja/LC_MESSAGES/core.po | 8 +- .../core/locales/lb/LC_MESSAGES/core.po | 8 +- .../core/locales/lt/LC_MESSAGES/core.po | 8 +- .../core/locales/lv/LC_MESSAGES/core.po | 8 +- .../core/locales/nb/LC_MESSAGES/core.po | 8 +- .../core/locales/nl/LC_MESSAGES/core.po | 16 +- .../core/locales/nn/LC_MESSAGES/core.po | 8 +- .../core/locales/pt/LC_MESSAGES/core.po | 8 +- .../core/locales/sl/LC_MESSAGES/core.po | 8 +- .../core/locales/sr/LC_MESSAGES/core.po | 8 +- .../core/locales/sv/LC_MESSAGES/core.po | 8 +- .../core/locales/xh/LC_MESSAGES/core.po | 97 + .../core/locales/zh/LC_MESSAGES/core.po | 8 +- .../core/locales/zu/LC_MESSAGES/core.po | 98 + .../simplesamlphp/modules/core/routes.yaml | 9 + .../core/templates/_frontpage_menu.twig | 31 + .../core/templates/authsource_list.tpl.php | 3 +- .../modules/core/templates/base.twig | 31 +- .../core/templates/cardinality_error.tpl.php | 36 + .../core/templates/frontpage_auth.tpl.php | 30 +- .../core/templates/frontpage_auth.twig | 18 + .../core/templates/frontpage_config.tpl.php | 109 +- .../core/templates/frontpage_config.twig | 56 + .../templates/frontpage_federation.tpl.php | 35 +- .../core/templates/frontpage_federation.twig | 84 + .../core/templates/frontpage_welcome.tpl.php | 29 +- .../core/templates/frontpage_welcome.twig | 15 + .../modules/core/templates/login.twig | 24 + .../modules/core/templates/loginuserpass.php | 116 +- .../modules/core/templates/loginuserpass.twig | 126 + .../core/templates/logout-iframe-wrapper.php | 8 +- .../core/templates/logout-iframe-wrapper.twig | 16 + .../modules/core/templates/logout-iframe.php | 87 +- .../modules/core/templates/no_cookie.tpl.php | 2 +- .../modules/core/templates/no_cookie.twig | 13 + .../core/templates/no_metadata.tpl.php | 11 +- .../modules/core/templates/no_metadata.twig | 7 + .../modules/core/templates/no_state.tpl.php | 25 +- .../modules/core/templates/no_state.twig | 14 + .../core/templates/short_sso_interval.php | 21 +- .../core/templates/short_sso_interval.twig | 16 + .../core/templates/show_metadata.tpl.php | 2 +- .../modules/core/templates/show_metadata.twig | 18 + .../modules/core/www/as_login.php | 12 +- .../modules/core/www/as_logout.php | 4 +- .../core/www/assets/js/loginuserpass.js | 7 + .../modules/core/www/authenticate.php | 24 +- .../modules/core/www/cardinality_error.php | 29 + .../modules/core/www/cleardiscochoices.php | 36 +- .../modules/core/www/frontpage_auth.php | 71 +- .../modules/core/www/frontpage_config.php | 280 +- .../modules/core/www/frontpage_federation.php | 229 +- .../modules/core/www/frontpage_welcome.php | 79 +- .../core/www/idp/logout-iframe-done.php | 22 +- .../core/www/idp/logout-iframe-post.php | 20 +- .../modules/core/www/idp/logout-iframe.js | 16 +- .../modules/core/www/idp/logout-iframe.php | 52 +- .../modules/core/www/idp/resumelogout.php | 6 +- .../modules/core/www/login-admin.php | 7 +- .../modules/core/www/loginuserpass.php | 129 +- .../modules/core/www/loginuserpassorg.php | 163 +- .../modules/core/www/no_cookie.php | 9 +- .../modules/core/www/postredirect.php | 48 +- .../modules/core/www/short_sso_interval.php | 22 +- .../modules/core/www/show_metadata.php | 19 +- .../simplesamlphp/modules/cron/bin/cron.php | 8 +- .../cron/config-templates/module_cron.php | 16 +- .../cron/dictionaries/cron.definition.json | 3 + .../cron/dictionaries/cron.translation.json | 5 + .../modules/cron/hooks/hook_configpage.php | 15 + .../modules/cron/hooks/hook_cron.php | 18 +- .../modules/cron/hooks/hook_frontpage.php | 16 +- .../simplesamlphp/modules/cron/lib/Cron.php | 16 +- .../cron/locales/en/LC_MESSAGES/cron.po | 5 + .../cron/locales/es/LC_MESSAGES/cron.po | 5 + .../cron/locales/nb/LC_MESSAGES/cron.po | 5 + .../cron/locales/nn/LC_MESSAGES/cron.po | 5 + .../cron/templates/croninfo-result.php | 20 +- .../cron/templates/croninfo-result.twig | 30 + .../modules/cron/templates/croninfo.tpl.php | 42 +- .../modules/cron/templates/croninfo.twig | 29 + .../modules/cron/www/assets/css/cron.css | 3 + .../simplesamlphp/modules/cron/www/cron.php | 61 +- .../modules/cron/www/croninfo.php | 44 +- .../config-templates/module_discopower.php | 75 +- .../dictionaries/tabs.definition.json | 3 + .../dictionaries/tabs.translation.json | 39 +- .../modules/discopower/lib/PowerIdPDisco.php | 184 +- .../locales/af/LC_MESSAGES/discopower.po | 8 +- .../locales/xh/LC_MESSAGES/discopower.po | 49 + .../locales/zu/LC_MESSAGES/discopower.po | 40 + .../discopower/templates/disco.tpl.php | 253 +- .../modules/discopower/templates/disco.twig | 57 + .../discopower/www/assets/css/disco.css | 107 + .../www/assets/js/jquery.livesearch.js | 43 + .../discopower/www/assets/js/quicksilver.js | 102 + .../discopower/www/assets/js/suggest.js | 25 + .../modules/discopower/www/disco.php | 19 +- .../discopower/www/js/jquery.livesearch.js | 37 - .../modules/discopower/www/js/quicksilver.js | 95 - .../modules/discopower/www/js/suggest.js | 23 - .../modules/discopower/www/style.css | 76 - .../www/attributeserver.php | 84 +- .../lib/Auth/Process/RedirectTest.php | 38 +- .../exampleauth/lib/Auth/Source/External.php | 500 +- .../exampleauth/lib/Auth/Source/Static.php | 57 - .../lib/Auth/Source/StaticSource.php | 55 + .../exampleauth/lib/Auth/Source/UserPass.php | 155 +- .../modules/exampleauth/www/authpage.php | 90 +- .../modules/exampleauth/www/redirecttest.php | 8 +- .../modules/exampleauth/www/resume.php | 5 +- .../dictionaries/expwarning.translation.json | 44 +- .../lib/Auth/Process/ExpiryDate.php | 270 +- .../locales/xh/LC_MESSAGES/expirycheck.po | 51 + .../locales/zu/LC_MESSAGES/expirycheck.po | 57 + .../expirycheck/templates/about2expire.php | 70 +- .../expirycheck/templates/about2expire.twig | 13 + .../modules/expirycheck/templates/expired.php | 19 +- .../expirycheck/templates/expired.twig | 9 + .../modules/expirycheck/www/about2expire.php | 59 +- .../modules/expirycheck/www/expired.php | 10 +- .../simplesamlphp/modules/ldap/docs/ldap.md | 6 + .../lib/Auth/Process/AttributeAddFromLDAP.php | 39 +- .../Auth/Process/AttributeAddUsersGroups.php | 287 +- .../ldap/lib/Auth/Process/BaseFilter.php | 102 +- .../modules/ldap/lib/Auth/Source/LDAP.php | 21 +- .../ldap/lib/Auth/Source/LDAPMulti.php | 51 +- .../modules/ldap/lib/ConfigHelper.php | 114 +- .../dictionaries/memcachestat.definition.json | 78 +- .../memcachestat.translation.json | 5 + .../memcacheMonitor/hooks/hook_configpage.php | 15 + .../memcacheMonitor/hooks/hook_frontpage.php | 18 +- .../hooks/hook_sanitycheck.php | 46 +- .../locales/en/LC_MESSAGES/memcacheMonitor.po | 38 + .../locales/es/LC_MESSAGES/memcacheMonitor.po | 5 + .../locales/nb/LC_MESSAGES/memcacheMonitor.po | 5 + .../locales/nn/LC_MESSAGES/memcacheMonitor.po | 5 + .../templates/memcachestat.tpl.php | 82 +- .../templates/memcachestat.twig | 38 + .../www/assets/css/memcacheMonitor.css | 20 + .../memcacheMonitor/www/memcachestat.php | 294 +- .../modules/metarefresh/bin/metarefresh.php | 257 +- .../config-templates/config-metarefresh.php | 166 +- .../dictionaries/metarefresh.definition.json | 12 + .../dictionaries/metarefresh.translation.json | 9 + .../modules/metarefresh/hooks/hook_cron.php | 218 +- .../metarefresh/hooks/hook_frontpage.php | 15 +- .../modules/metarefresh/lib/ARP.php | 227 +- .../modules/metarefresh/lib/MetaLoader.php | 984 +- .../locales/en/LC_MESSAGES/metarefresh.po | 25 + .../metarefresh/templates/fetch.tpl.php | 21 +- .../modules/metarefresh/templates/fetch.twig | 18 + .../modules/metarefresh/www/fetch.php | 168 +- .../dictionaries/multiauth.translation.json | 8 +- .../modules/multiauth/docs/multiauth.md | 24 + .../multiauth/lib/Auth/Source/MultiAuth.php | 479 +- .../locales/xh/LC_MESSAGES/multiauth.po | 24 + .../locales/zu/LC_MESSAGES/multiauth.po | 24 + .../multiauth/templates/selectsource.php | 31 +- .../multiauth/templates/selectsource.twig | 23 + .../modules/multiauth/www/selectsource.php | 78 +- .../modules/negotiate/docs/negotiate.md | 167 +- .../negotiate/lib/Auth/Source/Negotiate.php | 166 +- .../locales/af/LC_MESSAGES/negotiate.po | 4 +- .../locales/ar/LC_MESSAGES/negotiate.po | 8 +- .../locales/cs/LC_MESSAGES/negotiate.po | 8 +- .../locales/da/LC_MESSAGES/negotiate.po | 12 +- .../locales/de/LC_MESSAGES/negotiate.po | 12 +- .../locales/en/LC_MESSAGES/negotiate.po | 12 +- .../locales/es/LC_MESSAGES/negotiate.po | 12 +- .../locales/et/LC_MESSAGES/negotiate.po | 12 +- .../locales/eu/LC_MESSAGES/negotiate.po | 12 +- .../locales/fr/LC_MESSAGES/negotiate.po | 12 +- .../locales/hr/LC_MESSAGES/negotiate.po | 12 +- .../locales/id/LC_MESSAGES/negotiate.po | 12 +- .../locales/it/LC_MESSAGES/negotiate.po | 12 +- .../locales/lt/LC_MESSAGES/negotiate.po | 12 +- .../locales/nb/LC_MESSAGES/negotiate.po | 12 +- .../locales/nl/LC_MESSAGES/negotiate.po | 12 +- .../locales/nn/LC_MESSAGES/negotiate.po | 12 +- .../locales/ro/LC_MESSAGES/negotiate.po | 12 +- .../locales/ru/LC_MESSAGES/negotiate.po | 12 +- .../locales/sr/LC_MESSAGES/negotiate.po | 12 +- .../locales/sv/LC_MESSAGES/negotiate.po | 12 +- .../locales/zh-tw/LC_MESSAGES/negotiate.po | 12 +- .../locales/zh/LC_MESSAGES/negotiate.po | 6 +- .../modules/negotiate/templates/disable.php | 2 +- .../modules/negotiate/templates/disable.twig | 9 + .../modules/negotiate/templates/enable.php | 2 +- .../modules/negotiate/templates/enable.twig | 9 + .../modules/negotiate/templates/redirect.php | 11 + .../modules/negotiate/templates/redirect.twig | 11 + .../negotiate/www/assets/js/redirect.js | 3 + .../modules/negotiate/www/backend.php | 9 +- .../modules/negotiate/www/disable.php | 25 +- .../modules/negotiate/www/enable.php | 23 +- .../modules/negotiate/www/retry.php | 30 +- .../simplesamlphp/modules/oauth/bin/demo.php | 63 - .../oauth/config-template/module_oauth.php | 38 +- .../modules/oauth/hooks/hook_cron.php | 46 +- .../modules/oauth/hooks/hook_frontpage.php | 17 +- .../modules/oauth/lib/Consumer.php | 324 +- .../modules/oauth/lib/OAuthServer.php | 21 +- .../modules/oauth/lib/OAuthStore.php | 339 +- .../modules/oauth/lib/Registry.php | 264 +- .../modules/oauth/libextinc/OAuth.php | 396 +- .../modules/oauth/templates/authorized.php | 19 - .../modules/oauth/templates/consent.php | 18 - .../oauth/templates/registry.edit.tpl.php | 21 +- .../oauth/templates/registry.edit.twig | 18 + .../modules/oauth/templates/registry.list.php | 76 +- .../oauth/templates/registry.list.twig | 58 + .../oauth/templates/registry.saved.php | 11 +- .../oauth/templates/registry.saved.twig | 9 + .../modules/oauth/www/assets/css/oauth.css | 84 + .../modules/oauth/www/assets/js/oauth.js | 3 + .../modules/oauth/www/getUserInfo.php | 15 +- .../modules/oauth/www/registry.edit.php | 75 +- .../modules/oauth/www/registry.php | 65 +- .../modules/oauth/www/resources/style.css | 37 - .../portal/config-templates/module_portal.php | 16 +- .../modules/portal/hooks/hook_htmlinject.php | 72 +- .../modules/portal/lib/Portal.php | 145 +- .../dictionaries/warning.translation.json | 2 +- .../lib/Auth/Process/Warning.php | 53 +- .../locales/nl/LC_MESSAGES/preprodwarning.po | 4 +- .../preprodwarning/templates/warning.php | 32 +- .../preprodwarning/templates/warning.twig | 18 + .../preprodwarning/www/showwarning.php | 22 +- .../modules/radius/docs/radius.md | 22 +- .../modules/radius/lib/Auth/Source/Radius.php | 127 +- .../riak/config-templates/module_riak.php | 20 +- .../modules/riak/hooks/hook_cron.php | 44 +- .../modules/riak/lib/Store/Store.php | 164 +- .../saml/dictionaries/proxy.translation.json | 8 +- .../docs/authproc_authncontextclassref.md | 14 + .../modules/saml/docs/keyrollover.md | 2 +- .../simplesamlphp/modules/saml/docs/sp.md | 57 +- .../saml/hooks/hook_metadata_hosted.php | 54 +- .../saml/lib/Auth/Process/AttributeNameID.php | 20 +- .../lib/Auth/Process/AuthnContextClassRef.php | 13 +- .../Process/ExpectedAuthnContextClassRef.php | 25 +- .../saml/lib/Auth/Process/FilterScopes.php | 14 +- .../saml/lib/Auth/Process/NameIDAttribute.php | 42 +- .../lib/Auth/Process/PersistentNameID.php | 24 +- .../Process/PersistentNameID2TargetedID.php | 13 +- .../lib/Auth/Process/SQLPersistentNameID.php | 44 +- .../saml/lib/Auth/Process/TransientNameID.php | 9 +- .../modules/saml/lib/Auth/Source/SP.php | 1943 ++-- .../modules/saml/lib/BaseNameIDGenerator.php | 219 +- .../simplesamlphp/modules/saml/lib/Error.php | 377 +- .../modules/saml/lib/Error/NoAuthnContext.php | 7 +- .../modules/saml/lib/Error/NoAvailableIDP.php | 7 +- .../modules/saml/lib/Error/NoPassive.php | 7 +- .../modules/saml/lib/Error/NoSupportedIDP.php | 7 +- .../saml/lib/Error/ProxyCountExceeded.php | 7 +- .../modules/saml/lib/IdP/SAML1.php | 372 +- .../modules/saml/lib/IdP/SAML2.php | 740 +- .../modules/saml/lib/IdP/SQLNameID.php | 351 +- .../modules/saml/lib/Message.php | 410 +- .../modules/saml/lib/SP/LogoutStore.php | 724 +- .../saml/locales/xh/LC_MESSAGES/saml.po | 25 + .../saml/locales/zu/LC_MESSAGES/saml.po | 25 + .../saml/templates/proxy/invalid_session.php | 6 +- .../saml/templates/proxy/invalid_session.twig | 12 + .../sp/wrong_authncontextclassref.twig | 7 + .../simplesamlphp/modules/saml/www/disco.php | 2 +- .../modules/saml/www/idp/certs.php | 35 +- .../saml/www/proxy/invalid_session.php | 26 +- .../modules/saml/www/sp/discoresp.php | 18 +- .../modules/saml/www/sp/metadata.php | 101 +- .../modules/saml/www/sp/saml1-acs.php | 78 +- .../modules/saml/www/sp/saml2-acs.php | 92 +- .../modules/saml/www/sp/saml2-logout.php | 195 +- .../www/sp/wrong_authncontextclassref.php | 4 +- .../config-templates/config-sanitycheck.php | 8 +- .../dictionaries/strings.definition.json | 5 + .../dictionaries/strings.translation.json | 7 + .../sanitycheck/hooks/hook_configpage.php | 14 + .../modules/sanitycheck/hooks/hook_cron.php | 26 +- .../sanitycheck/hooks/hook_frontpage.php | 12 +- .../sanitycheck/hooks/hook_moduleinfo.php | 16 +- .../sanitycheck/hooks/hook_sanitycheck.php | 6 +- .../locales/en/LC_MESSAGES/sanitycheck.po | 11 + .../locales/es/LC_MESSAGES/sanitycheck.po | 11 + .../locales/it/LC_MESSAGES/sanitycheck.po | 6 + .../locales/nb/LC_MESSAGES/sanitycheck.po | 11 + .../locales/nl/LC_MESSAGES/sanitycheck.po | 11 + .../locales/nn/LC_MESSAGES/sanitycheck.po | 11 + .../sanitycheck/templates/check.tpl.php | 54 +- .../modules/sanitycheck/templates/check.twig | 49 +- .../modules/sanitycheck/www/index.php | 15 +- .../smartattributes/docs/smartattributes.md | 3 +- .../lib/Auth/Process/SmartID.php | 236 +- .../lib/Auth/Process/SmartName.php | 148 +- .../{authmyspace => sqlauth}/default-disable | 0 .../modules/sqlauth/default-enable | 3 - .../modules/sqlauth/lib/Auth/Source/SQL.php | 368 +- .../modules/statistics/bin/loganalyzer.php | 29 +- .../modules/statistics/bin/logcleaner.php | 20 +- .../config-templates/module_statistics.php | 196 +- .../dictionaries/statistics.definition.json | 8 + .../dictionaries/statistics.translation.json | 12 + .../statistics/hooks/hook_configpage.php | 18 + .../modules/statistics/hooks/hook_cron.php | 26 +- .../statistics/hooks/hook_frontpage.php | 20 +- .../statistics/hooks/hook_sanitycheck.php | 27 +- .../modules/statistics/lib/AccessCheck.php | 39 +- .../modules/statistics/lib/Aggregator.php | 120 +- .../modules/statistics/lib/DateHandler.php | 14 +- .../statistics/lib/DateHandlerMonth.php | 14 +- .../statistics/lib/Graph/GoogleCharts.php | 117 +- .../modules/statistics/lib/LogCleaner.php | 76 +- .../modules/statistics/lib/LogParser.php | 68 +- .../modules/statistics/lib/RatioDataset.php | 19 +- .../modules/statistics/lib/Ruleset.php | 32 +- .../modules/statistics/lib/StatDataset.php | 63 +- .../lib/Statistics/FieldPresentation/Base.php | 8 +- .../Statistics/FieldPresentation/Entity.php | 10 +- .../lib/Statistics/Rulesets/BaseRule.php | 41 +- .../lib/Statistics/Rulesets/Ratio.php | 23 +- .../locales/en/LC_MESSAGES/statistics.po | 11 + .../locales/es/LC_MESSAGES/statistics.po | 11 + .../locales/nb/LC_MESSAGES/statistics.po | 11 + .../locales/nn/LC_MESSAGES/statistics.po | 11 + .../statistics/templates/statistics.tpl.php | 284 +- .../statistics/templates/statistics.twig | 226 + .../statistics/templates/statmeta.tpl.php | 22 +- .../statistics/templates/statmeta.twig | 39 + .../{style.css => assets/css/statistics.css} | 44 +- .../statistics/www/assets/js/statistics.js | 8 + .../modules/statistics/www/javascript.js | 4 - .../modules/statistics/www/showstats.php | 155 +- .../modules/statistics/www/statmeta.php | 11 +- .../simplesamlphp/package-lock.json | 9083 +++++++++++++++++ .../simplesamlphp/simplesamlphp/package.json | 35 + .../simplesamlphp/simplesamlphp/phpunit.xml | 35 + vendor/simplesamlphp/simplesamlphp/psalm.xml | 2 + .../oasis-sstc-saml-schema-assertion-1.1.xsd | 2 +- .../oasis-sstc-saml-schema-protocol-1.1.xsd | 2 +- .../schemas/saml-schema-assertion-2.0.xsd | 4 +- .../schemas/saml-schema-metadata-2.0.xsd | 6 +- .../schemas/saml-schema-protocol-2.0.xsd | 2 +- .../simplesamlphp/schemas/xenc-schema.xsd | 146 + .../simplesamlphp/schemas/xml.xsd | 287 + .../schemas/xmldsig-core-schema.xsd | 318 + .../simplesamlphp/src/css/default-rtl.css | 174 + .../simplesamlphp/src/css/default.scss | 859 ++ .../simplesamlphp/src/js/bundle.js | 53 + .../simplesamlphp/src/js/style.js | 1 + .../templates/IFrameLogoutHandler.tpl.php | 16 + .../templates/IFrameLogoutHandler.twig | 16 + .../simplesamlphp/templates/_footer.twig | 19 +- .../simplesamlphp/templates/_header.twig | 99 +- .../simplesamlphp/templates/_table.twig | 24 + .../templates/attributequery.php | 38 +- .../simplesamlphp/templates/auth_status.twig | 82 + .../simplesamlphp/templates/base.twig | 89 +- .../simplesamlphp/templates/error.php | 2 +- .../simplesamlphp/templates/error.twig | 58 + .../simplesamlphp/templates/errorreport.php | 8 +- .../simplesamlphp/templates/errorreport.twig | 8 + .../simplesamlphp/templates/hostnames.php | 2 +- .../simplesamlphp/templates/hostnames.twig | 20 + .../templates/includes/attributes.php | 36 +- .../templates/includes/expander.twig | 11 + .../templates/includes/footer.php | 29 +- .../templates/includes/header-embed.php | 27 +- .../templates/includes/header.php | 305 +- .../simplesamlphp/templates/index.twig | 10 +- .../templates/login-ldapmulti.php | 126 +- .../simplesamlphp/templates/login.php | 121 +- .../simplesamlphp/templates/logout.php | 14 +- .../simplesamlphp/templates/logout.twig | 12 + .../templates/metadata-converter.php | 4 +- .../templates/metadata-converter.twig | 50 + .../simplesamlphp/templates/metadata.php | 12 +- .../simplesamlphp/templates/metadata.twig | 54 + .../simplesamlphp/templates/post.php | 33 +- .../simplesamlphp/templates/sandbox.twig | 11 - .../templates/selectidp-dropdown.php | 24 +- .../templates/selectidp-dropdown.twig | 31 + .../templates/selectidp-links.php | 53 +- .../templates/selectidp-links.twig | 45 + .../simplesamlphp/templates/status.php | 58 +- .../simplesamlphp/webpack.config.js | 95 + .../simplesamlphp/www/_include.php | 74 +- .../simplesamlphp/www/admin/hostnames.php | 36 +- .../simplesamlphp/www/admin/index.php | 20 +- .../www/admin/metadata-converter.php | 18 +- .../simplesamlphp/www/admin/phpinfo.php | 2 +- .../simplesamlphp/www/admin/sandbox.php | 18 +- .../simplesamlphp/www/assets/css/.gitkeep | 0 .../www/assets/css/src/default-rtl.css | 174 + .../simplesamlphp/www/assets/fonts/.gitkeep | 0 .../simplesamlphp/www/assets/js/.gitkeep | 0 .../simplesamlphp/www/authmemcookie.php | 24 +- .../simplesamlphp/www/errorreport.php | 39 +- .../simplesamlphp/simplesamlphp/www/index.php | 6 + .../simplesamlphp/www/logout.php | 4 +- .../simplesamlphp/www/module.php | 168 +- .../www/resources/clipboard.min.js | 6 +- .../www/resources/default-rtl.css | 38 +- .../simplesamlphp/www/resources/default.css | 475 +- .../simplesamlphp/www/resources/post.js | 4 +- .../simplesamlphp/www/resources/script.js | 37 +- .../simplesamlphp/www/resources/slo.css | 77 +- .../saml2/idp/ArtifactResolutionService.php | 17 +- .../www/saml2/idp/SSOService.php | 16 +- .../www/saml2/idp/SingleLogoutService.php | 15 +- .../simplesamlphp/www/saml2/idp/initSLO.php | 11 +- .../simplesamlphp/www/saml2/idp/metadata.php | 93 +- .../www/shib13/idp/SSOService.php | 14 +- .../simplesamlphp/www/shib13/idp/metadata.php | 53 +- vendor/symfony/polyfill-ctype/composer.json | 2 +- .../lib/Twig/Extensions/Extension/Date.php | 6 + .../lib/Twig/Extensions/Extension/Intl.php | 2 +- vendor/twig/twig/.gitattributes | 2 + vendor/twig/twig/.gitignore | 1 + vendor/twig/twig/.php_cs.dist | 2 + vendor/twig/twig/.travis.yml | 10 +- vendor/twig/twig/CHANGELOG | 13 + vendor/twig/twig/README.rst | 9 + vendor/twig/twig/composer.json | 11 +- vendor/twig/twig/doc/advanced.rst | 8 +- vendor/twig/twig/doc/advanced_legacy.rst | 23 +- vendor/twig/twig/doc/filters/batch.rst | 1 + vendor/twig/twig/doc/filters/date.rst | 2 +- vendor/twig/twig/doc/filters/date_modify.rst | 2 +- vendor/twig/twig/doc/filters/map.rst | 3 +- .../twig/twig/doc/filters/number_format.rst | 2 +- vendor/twig/twig/doc/filters/reduce.rst | 1 - vendor/twig/twig/doc/internals.rst | 2 +- vendor/twig/twig/doc/intro.rst | 2 +- vendor/twig/twig/doc/recipes.rst | 8 +- vendor/twig/twig/doc/tags/extends.rst | 4 +- vendor/twig/twig/doc/tags/include.rst | 2 +- vendor/twig/twig/doc/tags/macro.rst | 6 +- vendor/twig/twig/doc/templates.rst | 2 +- vendor/twig/twig/ext/twig/php_twig.h | 2 +- vendor/twig/twig/phpunit.xml.dist | 33 - .../twig/twig/src/Cache/FilesystemCache.php | 4 +- vendor/twig/twig/src/Environment.php | 8 +- .../twig/twig/src/Extension/CoreExtension.php | 6 +- vendor/twig/twig/src/Lexer.php | 2 +- .../Expression/NullCoalesceExpression.php | 14 +- vendor/twig/twig/src/Template.php | 4 +- .../twig/test/Twig/Tests/AutoloaderTest.php | 24 - .../test/Twig/Tests/Cache/FilesystemTest.php | 195 - .../twig/test/Twig/Tests/CompilerTest.php | 36 - .../Twig/Tests/ContainerRuntimeLoaderTest.php | 42 - .../test/Twig/Tests/CustomExtensionTest.php | 96 - .../twig/test/Twig/Tests/EnvironmentTest.php | 677 -- .../twig/twig/test/Twig/Tests/ErrorTest.php | 232 - .../test/Twig/Tests/ExpressionParserTest.php | 387 - .../test/Twig/Tests/Extension/CoreTest.php | 371 - .../test/Twig/Tests/Extension/SandboxTest.php | 364 - .../Twig/Tests/FactoryRuntimeLoaderTest.php | 34 - .../twig/test/Twig/Tests/FileCachingTest.php | 66 - .../FileExtensionEscapingStrategyTest.php | 53 - .../twig/test/Twig/Tests/FilesystemHelper.php | 30 - .../Twig/Tests/Fixtures/autoescape/block.test | 21 - .../Twig/Tests/Fixtures/autoescape/name.test | 22 - .../test/Twig/Tests/Fixtures/errors/base.html | 1 - .../Twig/Tests/Fixtures/errors/index.html | 7 - .../Tests/Fixtures/errors/leak-output.php | 31 - .../child_contents_outside_blocks.test | 15 - .../exception_in_extension_extends.test | 12 - .../exception_in_extension_include.test | 12 - ...ltiline_array_with_undefined_variable.test | 18 - ...e_array_with_undefined_variable_again.test | 18 - ...line_function_with_undefined_variable.test | 12 - ...tiline_function_with_unknown_argument.test | 9 - ...multiline_tag_with_undefined_variable.test | 12 - .../strict_comparison_operator.test | 6 - .../syntax_error_in_reused_template.test | 10 - .../Fixtures/exceptions/unclosed_tag.test | 20 - .../Fixtures/exceptions/undefined_parent.test | 10 - .../undefined_template_in_child_template.test | 15 - .../Fixtures/exceptions/undefined_trait.test | 9 - .../Tests/Fixtures/expressions/_self.test | 8 - .../Tests/Fixtures/expressions/array.test | 61 - .../Fixtures/expressions/array_call.test | 14 - .../Tests/Fixtures/expressions/binary.test | 46 - .../Tests/Fixtures/expressions/bitwise.test | 14 - .../call_argument_defined_twice.test | 8 - .../call_positional_arg_after_named_arg.test | 8 - .../Fixtures/expressions/comparison.test | 14 - .../Fixtures/expressions/divisibleby.test | 17 - .../Tests/Fixtures/expressions/dotdot.test | 20 - .../Tests/Fixtures/expressions/ends_with.test | 26 - .../Tests/Fixtures/expressions/floats.test | 16 - .../Tests/Fixtures/expressions/grouping.test | 8 - .../Tests/Fixtures/expressions/literals.test | 22 - .../Fixtures/expressions/magic_call.test | 27 - .../Tests/Fixtures/expressions/matches.test | 12 - .../Fixtures/expressions/method_call.test | 28 - .../expressions/negative_numbers.test | 18 - .../Fixtures/expressions/not_arrow_fn.test | 8 - .../expressions/operators_as_variables.test | 16 - .../Tests/Fixtures/expressions/postfix.test | 22 - .../Tests/Fixtures/expressions/power.test | 20 - .../Tests/Fixtures/expressions/sameas.test | 21 - .../Fixtures/expressions/starts_with.test | 27 - .../string_operator_as_var_assignment.test | 18 - .../Tests/Fixtures/expressions/strings.test | 10 - .../expressions/ternary_operator.test | 18 - .../expressions/ternary_operator_noelse.test | 10 - .../expressions/ternary_operator_nothen.test | 10 - .../two_word_operators_as_variables.test | 8 - .../Tests/Fixtures/expressions/unary.test | 12 - .../expressions/unary_macro_arguments.test | 22 - .../expressions/unary_precedence.test | 14 - .../test/Twig/Tests/Fixtures/filters/abs.test | 30 - .../Twig/Tests/Fixtures/filters/batch.test | 31 - .../Tests/Fixtures/filters/batch_float.test | 29 - .../filters/batch_with_empty_fill.test | 37 - .../filters/batch_with_exact_elements.test | 33 - .../Fixtures/filters/batch_with_fill.test | 37 - .../Fixtures/filters/batch_with_keys.test | 10 - .../filters/batch_with_more_elements.test | 23 - .../filters/batch_with_zero_elements.test | 10 - .../Fixtures/filters/convert_encoding.test | 10 - .../Twig/Tests/Fixtures/filters/date.test | 90 - .../Fixtures/filters/date_default_format.test | 14 - .../filters/date_default_format_interval.test | 16 - .../Fixtures/filters/date_immutable.test | 37 - .../Tests/Fixtures/filters/date_interval.test | 19 - .../Tests/Fixtures/filters/date_modify.test | 14 - .../Fixtures/filters/date_namedargs.test | 13 - .../Twig/Tests/Fixtures/filters/default.test | 150 - .../Fixtures/filters/dynamic_filter.test | 10 - .../Twig/Tests/Fixtures/filters/escape.test | 8 - .../Fixtures/filters/escape_html_attr.test | 8 - .../Fixtures/filters/escape_javascript.test | 8 - .../filters/escape_non_supported_charset.test | 8 - .../Twig/Tests/Fixtures/filters/filter.test | 46 - .../Tests/Fixtures/filters/filter_php_55.test | 23 - .../Tests/Fixtures/filters/filter_php_56.test | 27 - .../Twig/Tests/Fixtures/filters/first.test | 17 - .../Tests/Fixtures/filters/force_escape.test | 18 - .../Twig/Tests/Fixtures/filters/format.test | 8 - .../Twig/Tests/Fixtures/filters/join.test | 38 - .../Tests/Fixtures/filters/json_encode.test | 12 - .../Twig/Tests/Fixtures/filters/last.test | 17 - .../Twig/Tests/Fixtures/filters/length.test | 40 - .../Tests/Fixtures/filters/length_utf8.test | 12 - .../test/Twig/Tests/Fixtures/filters/map.test | 41 - .../Twig/Tests/Fixtures/filters/merge.test | 25 - .../Twig/Tests/Fixtures/filters/nl2br.test | 14 - .../Tests/Fixtures/filters/number_format.test | 18 - .../filters/number_format_default.test | 21 - .../Twig/Tests/Fixtures/filters/reduce.test | 14 - .../Twig/Tests/Fixtures/filters/replace.test | 12 - .../Fixtures/filters/replace_invalid_arg.test | 8 - .../Twig/Tests/Fixtures/filters/reverse.test | 18 - .../Twig/Tests/Fixtures/filters/round.test | 22 - .../Twig/Tests/Fixtures/filters/slice.test | 54 - .../Twig/Tests/Fixtures/filters/sort.test | 12 - .../Tests/Fixtures/filters/spaceless.test | 8 - .../Tests/Fixtures/filters/special_chars.test | 8 - .../Twig/Tests/Fixtures/filters/split.test | 20 - .../Tests/Fixtures/filters/split_utf8.test | 24 - .../Tests/Fixtures/filters/static_calls.test | 10 - .../Twig/Tests/Fixtures/filters/trim.test | 24 - .../Tests/Fixtures/filters/urlencode.test | 16 - .../filters/urlencode_deprecated.test | 16 - .../Tests/Fixtures/functions/attribute.test | 18 - .../Twig/Tests/Fixtures/functions/block.test | 12 - .../functions/block_with_template.test | 22 - .../functions/block_without_name.test | 12 - .../Tests/Fixtures/functions/constant.test | 10 - .../Twig/Tests/Fixtures/functions/cycle.test | 16 - .../Twig/Tests/Fixtures/functions/date.test | 27 - .../Fixtures/functions/date_namedargs.test | 11 - .../Twig/Tests/Fixtures/functions/dump.test | 16 - .../Tests/Fixtures/functions/dump_array.test | 19 - .../Fixtures/functions/dynamic_function.test | 10 - .../functions/include/assignment.test | 13 - .../functions/include/autoescaping.test | 10 - .../Fixtures/functions/include/basic.test | 17 - .../functions/include/expression.test | 17 - .../functions/include/ignore_missing.test | 10 - .../include/ignore_missing_exists.test | 11 - .../include/include_missing_extends.test | 13 - .../Fixtures/functions/include/missing.test | 8 - .../functions/include/missing_nested.test | 16 - .../Fixtures/functions/include/sandbox.test | 13 - .../functions/include/sandbox_disabling.test | 16 - .../sandbox_disabling_ignore_missing.test | 13 - .../functions/include/template_instance.test | 10 - .../functions/include/templates_as_array.test | 12 - .../functions/include/with_context.test | 16 - .../functions/include/with_variables.test | 12 - .../include_template_from_string.test | 11 - .../Tests/Fixtures/functions/magic_call.test | 8 - .../Fixtures/functions/magic_call53.test | 12 - .../Twig/Tests/Fixtures/functions/max.test | 12 - .../Twig/Tests/Fixtures/functions/min.test | 12 - .../Twig/Tests/Fixtures/functions/range.test | 8 - .../recursive_block_with_inheritance.test | 21 - .../Twig/Tests/Fixtures/functions/source.test | 17 - .../Fixtures/functions/special_chars.test | 8 - .../Fixtures/functions/static_calls.test | 10 - .../functions/template_from_string.test | 15 - .../functions/template_from_string_error.test | 8 - .../Tests/Fixtures/macros/default_values.test | 16 - .../Tests/Fixtures/macros/nested_calls.test | 18 - .../Fixtures/macros/reserved_variables.test | 14 - .../Twig/Tests/Fixtures/macros/simple.test | 22 - .../Twig/Tests/Fixtures/macros/varargs.test | 21 - .../Fixtures/macros/varargs_argument.test | 7 - .../Tests/Fixtures/macros/with_filters.test | 14 - .../regression/block_names_unicity.test | 19 - .../regression/combined_debug_info.test | 15 - .../Fixtures/regression/empty_token.test | 8 - .../Tests/Fixtures/regression/issue_1143.test | 23 - .../Fixtures/regression/multi_word_tests.test | 10 - .../regression/simple_xml_element.test | 19 - .../regression/strings_like_numbers.test | 8 - .../Twig/Tests/Fixtures/tags/apply/basic.test | 10 - .../Fixtures/tags/apply/json_encode.test | 8 - .../Tests/Fixtures/tags/apply/multiple.test | 10 - .../Tests/Fixtures/tags/apply/nested.test | 16 - .../Twig/Tests/Fixtures/tags/apply/scope.test | 15 - .../Fixtures/tags/apply/with_for_tag.test | 13 - .../Fixtures/tags/apply/with_if_tag.test | 29 - .../Tests/Fixtures/tags/autoescape/basic.test | 26 - .../Fixtures/tags/autoescape/blocks.test | 12 - .../tags/autoescape/double_escaping.test | 10 - .../Fixtures/tags/autoescape/functions.test | 83 - .../Fixtures/tags/autoescape/literal.test | 87 - .../Fixtures/tags/autoescape/nested.test | 26 - .../Fixtures/tags/autoescape/objects.test | 26 - .../Tests/Fixtures/tags/autoescape/raw.test | 10 - .../tags/autoescape/strategy.legacy.test | 11 - .../Fixtures/tags/autoescape/strategy.test | 11 - .../Tests/Fixtures/tags/autoescape/type.test | 69 - .../tags/autoescape/with_filters.test | 131 - .../autoescape/with_filters_arguments.test | 23 - .../autoescape/with_pre_escape_filters.test | 68 - .../with_preserves_safety_filters.test | 50 - .../Twig/Tests/Fixtures/tags/block/basic.test | 11 - .../tags/block/block_unique_name.test | 11 - .../Fixtures/tags/block/special_chars.test | 10 - .../tags/deprecated/block.legacy.test | 20 - .../tags/deprecated/macro.legacy.test | 21 - .../tags/deprecated/template.legacy.test | 12 - .../Twig/Tests/Fixtures/tags/embed/basic.test | 35 - .../tags/embed/complex_dynamic_parent.test | 35 - .../Fixtures/tags/embed/dynamic_parent.test | 35 - .../Tests/Fixtures/tags/embed/error_line.test | 16 - .../Tests/Fixtures/tags/embed/multiple.test | 50 - .../Tests/Fixtures/tags/embed/nested.test | 42 - .../Fixtures/tags/embed/with_extends.test | 60 - .../Tests/Fixtures/tags/filter/basic.test | 10 - .../Fixtures/tags/filter/json_encode.test | 8 - .../Tests/Fixtures/tags/filter/multiple.test | 10 - .../Tests/Fixtures/tags/filter/nested.test | 16 - .../Tests/Fixtures/tags/filter/scope.test | 11 - .../Fixtures/tags/filter/with_for_tag.test | 13 - .../Fixtures/tags/filter/with_if_tag.test | 29 - .../Tests/Fixtures/tags/for/condition.test | 14 - .../Twig/Tests/Fixtures/tags/for/context.test | 18 - .../Twig/Tests/Fixtures/tags/for/else.test | 23 - .../Fixtures/tags/for/inner_variables.test | 17 - .../Twig/Tests/Fixtures/tags/for/keys.test | 11 - .../Fixtures/tags/for/keys_and_values.test | 11 - .../Tests/Fixtures/tags/for/loop_context.test | 19 - .../Fixtures/tags/for/loop_context_local.test | 10 - .../Fixtures/tags/for/loop_not_defined.test | 10 - .../tags/for/loop_not_defined_cond.test | 9 - .../Tests/Fixtures/tags/for/nested_else.test | 17 - .../Twig/Tests/Fixtures/tags/for/objects.test | 43 - .../Fixtures/tags/for/objects_countable.test | 47 - .../Tests/Fixtures/tags/for/recursive.test | 18 - .../Twig/Tests/Fixtures/tags/for/values.test | 11 - .../test/Twig/Tests/Fixtures/tags/from.test | 14 - .../Twig/Tests/Fixtures/tags/if/basic.test | 22 - .../Tests/Fixtures/tags/if/expression.test | 22 - .../Tests/Fixtures/tags/include/basic.test | 16 - .../Fixtures/tags/include/expression.test | 16 - .../Fixtures/tags/include/ignore_missing.test | 10 - .../tags/include/ignore_missing_exists.test | 11 - .../tags/include/include_missing_extends.test | 13 - .../Tests/Fixtures/tags/include/missing.test | 8 - .../Fixtures/tags/include/missing_nested.test | 16 - .../Tests/Fixtures/tags/include/only.test | 20 - .../tags/include/template_instance.test | 10 - .../tags/include/templates_as_array.test | 12 - .../Fixtures/tags/include/with_variables.test | 14 - .../Fixtures/tags/inheritance/basic.test | 14 - .../Fixtures/tags/inheritance/block_expr.test | 30 - .../tags/inheritance/block_expr2.test | 32 - .../tags/inheritance/conditional.test | 14 - .../Fixtures/tags/inheritance/dynamic.test | 14 - .../Fixtures/tags/inheritance/empty.test | 10 - .../tags/inheritance/extends_as_array.test | 12 - .../extends_as_array_with_empty_name.test | 12 - .../extends_as_array_with_null_name.test | 12 - .../tags/inheritance/extends_in_block.test | 10 - .../tags/inheritance/extends_in_macro.test | 10 - .../Fixtures/tags/inheritance/multiple.test | 12 - .../tags/inheritance/multiple_dynamic.test | 22 - .../tags/inheritance/nested_blocks.test | 22 - .../nested_blocks_parent_only.test | 15 - .../tags/inheritance/nested_inheritance.test | 16 - .../Fixtures/tags/inheritance/parent.test | 12 - .../parent_as_template_wrapper.test | 12 - .../tags/inheritance/parent_change.test | 16 - .../tags/inheritance/parent_isolation.test | 20 - .../tags/inheritance/parent_nested.test | 28 - .../inheritance/parent_without_extends.test | 8 - .../parent_without_extends_but_traits.test | 14 - .../tags/inheritance/template_instance.test | 14 - .../Tests/Fixtures/tags/inheritance/use.test | 44 - .../Twig/Tests/Fixtures/tags/macro/basic.test | 17 - .../Fixtures/tags/macro/endmacro_name.test | 16 - .../Tests/Fixtures/tags/macro/external.test | 17 - .../Twig/Tests/Fixtures/tags/macro/from.test | 18 - .../tags/macro/from_in_block_is_local.test | 18 - .../tags/macro/from_local_override.test | 28 - .../tags/macro/from_macro_in_a_macro.test | 18 - .../tags/macro/from_nested_blocks.test | 18 - .../from_nested_blocks_with_global_macro.test | 18 - .../tags/macro/from_syntax_error.test | 8 - .../tags/macro/from_with_reserved_name.test | 8 - .../Tests/Fixtures/tags/macro/global.test | 14 - .../tags/macro/import_and_blocks.test | 36 - .../macro/import_from_string_template.test | 10 - .../tags/macro/import_in_block_is_local.test | 18 - .../tags/macro/import_local_override.test | 28 - .../tags/macro/import_macro_in_a_macro.test | 18 - .../macro/import_nested_blocks.legacy.test | 18 - ...ested_blocks_with_global_macro.legacy.test | 18 - .../tags/macro/import_self_parent.test | 23 - .../tags/macro/import_syntax_error.test | 10 - .../tags/macro/import_with_reserved_name.test | 10 - .../Fixtures/tags/macro/reserved_name.test | 10 - .../Fixtures/tags/macro/self_import.test | 17 - .../Fixtures/tags/macro/special_chars.test | 14 - .../Fixtures/tags/macro/super_globals.test | 14 - .../Tests/Fixtures/tags/raw/basic.legacy.test | 10 - .../tags/raw/mixed_usage_with_raw.legacy.test | 10 - .../tags/raw/whitespace_control.legacy.test | 56 - .../Tests/Fixtures/tags/sandbox/array.test | 16 - .../Fixtures/tags/sandbox/not_valid1.test | 11 - .../Fixtures/tags/sandbox/not_valid2.test | 14 - .../Tests/Fixtures/tags/sandbox/simple.test | 22 - .../Twig/Tests/Fixtures/tags/set/basic.test | 20 - .../Fixtures/tags/set/capture-empty.test | 9 - .../Twig/Tests/Fixtures/tags/set/capture.test | 10 - .../Fixtures/tags/set/capture_scope.test | 10 - .../Tests/Fixtures/tags/set/expression.test | 12 - .../Tests/Fixtures/tags/set/inheritance.test | 24 - .../tags/set/inheritance_overriding.test | 24 - .../Tests/Fixtures/tags/set/mutating.test | 17 - .../Tests/Fixtures/tags/spaceless/simple.test | 12 - .../Tests/Fixtures/tags/special_chars.test | 8 - .../Twig/Tests/Fixtures/tags/use/aliases.test | 12 - .../Twig/Tests/Fixtures/tags/use/basic.test | 12 - .../Twig/Tests/Fixtures/tags/use/deep.test | 22 - .../Tests/Fixtures/tags/use/deep_empty.test | 10 - .../Tests/Fixtures/tags/use/inheritance.test | 25 - .../Tests/Fixtures/tags/use/inheritance2.test | 24 - .../Tests/Fixtures/tags/use/multiple.test | 21 - .../Fixtures/tags/use/multiple_aliases.test | 23 - .../Tests/Fixtures/tags/use/parent_block.test | 24 - .../Fixtures/tags/use/parent_block2.test | 24 - .../Fixtures/tags/use/parent_block3.test | 38 - .../Fixtures/tags/use/use_with_parent.test | 24 - .../Tests/Fixtures/tags/verbatim/basic.test | 10 - .../tags/verbatim/mixed_usage_with_raw.test | 10 - .../tags/verbatim/whitespace_control.test | 56 - .../Twig/Tests/Fixtures/tags/with/basic.test | 13 - .../Tests/Fixtures/tags/with/expression.test | 10 - .../Tests/Fixtures/tags/with/globals.test | 10 - .../Tests/Fixtures/tags/with/iterable.test | 10 - .../Twig/Tests/Fixtures/tags/with/nested.test | 15 - .../Fixtures/tags/with/with_no_hash.test | 10 - .../Tests/Fixtures/tags/with/with_only.test | 10 - .../test/Twig/Tests/Fixtures/tests/array.test | 24 - .../Twig/Tests/Fixtures/tests/constant.test | 14 - .../Twig/Tests/Fixtures/tests/defined.test | 129 - .../Fixtures/tests/defined_for_attribute.test | 35 - .../Fixtures/tests/defined_for_blocks.test | 38 - .../defined_for_blocks_with_template.test | 17 - .../Fixtures/tests/defined_for_constants.test | 14 - .../tests/defined_on_complex_expr.test | 8 - .../Tests/Fixtures/tests/dynamic_test.test | 14 - .../test/Twig/Tests/Fixtures/tests/empty.test | 42 - .../test/Twig/Tests/Fixtures/tests/even.test | 14 - .../test/Twig/Tests/Fixtures/tests/in.test | 118 - .../Tests/Fixtures/tests/in_with_objects.test | 19 - .../Twig/Tests/Fixtures/tests/iterable.test | 19 - .../Tests/Fixtures/tests/null_coalesce.test | 30 - .../test/Twig/Tests/Fixtures/tests/odd.test | 10 - .../Tests/Fixtures/whitespace/trim_block.test | 68 - .../whitespace/trim_delimiter_as_strings.test | 10 - .../Tests/Fixtures/whitespace/trim_left.test | 32 - .../Fixtures/whitespace/trim_line_left.test | 33 - .../Fixtures/whitespace/trim_line_right.test | 32 - .../Tests/Fixtures/whitespace/trim_right.test | 28 - .../twig/test/Twig/Tests/IntegrationTest.php | 384 - .../autoescape/filename.legacy.test | 18 - .../functions/undefined_block.legacy.test | 12 - .../Tests/LegacyFixtures/test.legacy.test | 8 - .../test/Twig/Tests/LegacyIntegrationTest.php | 57 - .../twig/twig/test/Twig/Tests/LexerTest.php | 379 - .../twig/test/Twig/Tests/Loader/ArrayTest.php | 139 - .../twig/test/Twig/Tests/Loader/ChainTest.php | 132 - .../test/Twig/Tests/Loader/FilesystemTest.php | 245 - .../array_inheritance_empty_parent.html.twig | 3 - ...y_inheritance_nonexistent_parent.html.twig | 3 - .../array_inheritance_null_parent.html.twig | 3 - .../array_inheritance_valid_parent.html.twig | 3 - .../Fixtures/inheritance/parent.html.twig | 1 - .../inheritance/spare_parent.html.twig | 1 - .../Tests/Loader/Fixtures/named/index.html | 1 - .../Loader/Fixtures/named_bis/index.html | 1 - .../Loader/Fixtures/named_final/index.html | 1 - .../Fixtures/named_quater/named_absolute.html | 1 - .../Loader/Fixtures/named_ter/index.html | 1 - .../Tests/Loader/Fixtures/normal/index.html | 1 - .../Loader/Fixtures/normal_bis/index.html | 1 - .../Loader/Fixtures/normal_final/index.html | 1 - .../Loader/Fixtures/normal_ter/index.html | 1 - .../Loader/Fixtures/phar/phar-sample.phar | 293 - .../Fixtures/themes/theme1/blocks.html.twig | 3 - .../Fixtures/themes/theme2/blocks.html.twig | 3 - .../test/Twig/Tests/NativeExtensionTest.php | 39 - .../test/Twig/Tests/Node/AutoEscapeTest.php | 37 - .../Twig/Tests/Node/BlockReferenceTest.php | 34 - .../twig/test/Twig/Tests/Node/BlockTest.php | 43 - .../test/Twig/Tests/Node/DeprecatedTest.php | 80 - .../twig/twig/test/Twig/Tests/Node/DoTest.php | 36 - .../Twig/Tests/Node/Expression/ArrayTest.php | 41 - .../Tests/Node/Expression/AssignNameTest.php | 32 - .../Tests/Node/Expression/Binary/AddTest.php | 38 - .../Tests/Node/Expression/Binary/AndTest.php | 38 - .../Node/Expression/Binary/ConcatTest.php | 38 - .../Tests/Node/Expression/Binary/DivTest.php | 38 - .../Node/Expression/Binary/FloorDivTest.php | 38 - .../Tests/Node/Expression/Binary/ModTest.php | 38 - .../Tests/Node/Expression/Binary/MulTest.php | 38 - .../Tests/Node/Expression/Binary/OrTest.php | 38 - .../Tests/Node/Expression/Binary/SubTest.php | 38 - .../Twig/Tests/Node/Expression/CallTest.php | 145 - .../Tests/Node/Expression/ConditionalTest.php | 42 - .../Tests/Node/Expression/ConstantTest.php | 33 - .../Twig/Tests/Node/Expression/FilterTest.php | 161 - .../Tests/Node/Expression/FunctionTest.php | 117 - .../Tests/Node/Expression/GetAttrTest.php | 57 - .../Twig/Tests/Node/Expression/NameTest.php | 47 - .../Node/Expression/NullCoalesceTest.php | 36 - .../Node/Expression/PHP53/FilterInclude.php | 6 - .../Node/Expression/PHP53/FunctionInclude.php | 6 - .../Node/Expression/PHP53/TestInclude.php | 6 - .../Twig/Tests/Node/Expression/ParentTest.php | 31 - .../Twig/Tests/Node/Expression/TestTest.php | 90 - .../Tests/Node/Expression/Unary/NegTest.php | 36 - .../Tests/Node/Expression/Unary/NotTest.php | 35 - .../Tests/Node/Expression/Unary/PosTest.php | 35 - .../twig/test/Twig/Tests/Node/ForTest.php | 199 - .../twig/twig/test/Twig/Tests/Node/IfTest.php | 95 - .../twig/test/Twig/Tests/Node/ImportTest.php | 45 - .../twig/test/Twig/Tests/Node/IncludeTest.php | 93 - .../twig/test/Twig/Tests/Node/MacroTest.php | 81 - .../twig/test/Twig/Tests/Node/ModuleTest.php | 268 - .../twig/test/Twig/Tests/Node/PrintTest.php | 33 - .../twig/test/Twig/Tests/Node/SandboxTest.php | 47 - .../twig/test/Twig/Tests/Node/SetTest.php | 78 - .../test/Twig/Tests/Node/SpacelessTest.php | 42 - .../twig/test/Twig/Tests/Node/TextTest.php | 31 - .../test/Twig/Tests/NodeTraverserTest.php | 47 - .../Twig/Tests/NodeVisitor/OptimizerTest.php | 129 - .../twig/twig/test/Twig/Tests/ParserTest.php | 217 - .../Tests/Profiler/Dumper/AbstractTest.php | 105 - .../Tests/Profiler/Dumper/BlackfireTest.php | 34 - .../Twig/Tests/Profiler/Dumper/HtmlTest.php | 32 - .../Twig/Tests/Profiler/Dumper/TextTest.php | 32 - .../test/Twig/Tests/Profiler/ProfileTest.php | 112 - .../twig/test/Twig/Tests/TemplateTest.php | 812 -- .../test/Twig/Tests/TemplateWrapperTest.php | 68 - .../twig/test/Twig/Tests/TokenStreamTest.php | 85 - .../Tests/Util/DeprecationCollectorTest.php | 46 - .../twig/test/Twig/Tests/escapingTest.php | 325 - web/modules/simplesamlphp_auth/composer.json | 3 +- .../simplesamlphp_auth.api.php | 2 +- .../simplesamlphp_auth.info.yml | 10 +- .../simplesamlphp_auth.install | 11 +- .../simplesamlphp_auth.module | 49 +- .../simplesamlphp_auth.routing.yml | 2 +- .../simplesamlphp_auth.services.yml | 8 +- .../SimplesamlExternalauthSubscriber.php | 17 +- .../EventSubscriber/SimplesamlSubscriber.php | 26 +- .../src/Form/BasicSettingsForm.php | 2 +- .../Plugin/Block/SimplesamlphpAuthBlock.php | 1 + .../src/Service/SimplesamlphpAuthManager.php | 185 +- .../src/Service/SimplesamlphpDrupalAuth.php | 56 +- .../simplesamlphp_auth_test.info.yml | 8 +- .../src/SimplesamlphpAuthTestManager.php | 20 +- .../src/Functional}/SimplesamlphpAuthTest.php | 43 +- .../Service/SimplesamlphpAuthManagerTest.php | 165 +- .../Service/SimplesamlphpDrupalAuthTest.php | 73 +- 1596 files changed, 60223 insertions(+), 44969 deletions(-) delete mode 120000 vendor/bin/export-plural-rules.php create mode 100644 vendor/gettext/gettext/CHANGELOG.md create mode 100644 vendor/gettext/gettext/src/Extractors/Csv.php create mode 100644 vendor/gettext/gettext/src/Extractors/ExtractorMultiInterface.php create mode 100644 vendor/gettext/gettext/src/Extractors/Json.php create mode 100644 vendor/gettext/gettext/src/Extractors/VueJs.php create mode 100644 vendor/gettext/gettext/src/Extractors/Xliff.php create mode 100644 vendor/gettext/gettext/src/Extractors/Yaml.php create mode 100644 vendor/gettext/gettext/src/Generators/Csv.php create mode 100644 vendor/gettext/gettext/src/Generators/Json.php create mode 100644 vendor/gettext/gettext/src/Generators/Xliff.php create mode 100644 vendor/gettext/gettext/src/Generators/Yaml.php create mode 100644 vendor/gettext/gettext/src/Merge.php create mode 100644 vendor/gettext/gettext/src/Utils/CsvTrait.php create mode 100644 vendor/gettext/gettext/src/Utils/DictionaryTrait.php create mode 100644 vendor/gettext/gettext/src/Utils/HeadersExtractorTrait.php create mode 100644 vendor/gettext/gettext/src/Utils/HeadersGeneratorTrait.php create mode 100644 vendor/gettext/gettext/src/Utils/MultidimensionalArrayTrait.php create mode 100644 vendor/gettext/gettext/src/Utils/ParsedComment.php mode change 100644 => 100755 vendor/gettext/gettext/src/translator_functions.php delete mode 100755 vendor/gettext/languages/bin/export-plural-rules.php create mode 100644 vendor/jaimeperez/twig-configurable-i18n/.codecov.yml create mode 100644 vendor/jaimeperez/twig-configurable-i18n/.php_cs.dist create mode 100644 vendor/jaimeperez/twig-configurable-i18n/.travis.yml create mode 100755 vendor/jaimeperez/twig-configurable-i18n/bin/check-syntax.sh create mode 100644 vendor/jaimeperez/twig-configurable-i18n/phpunit.xml create mode 100644 vendor/jaimeperez/twig-configurable-i18n/psalm.xml create mode 100644 vendor/jaimeperez/twig-configurable-i18n/tests/bootstrap.php create mode 100644 vendor/robrichards/xmlseclibs/src/Utils/XPath.php create mode 100644 vendor/simplesamlphp/saml2/phpunit.xml create mode 100644 vendor/simplesamlphp/saml2/psalm.xml create mode 100644 vendor/simplesamlphp/simplesamlphp/.github/ISSUE_TEMPLATE/bug_report.md create mode 100644 vendor/simplesamlphp/simplesamlphp/.github/ISSUE_TEMPLATE/feature_request.md create mode 100644 vendor/simplesamlphp/simplesamlphp/.php_cs.dist delete mode 100644 vendor/simplesamlphp/simplesamlphp/attributemap/myspace2name.php mode change 100644 => 100755 vendor/simplesamlphp/simplesamlphp/bin/check-syntax.sh create mode 100644 vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-ecp-idp.md delete mode 100644 vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-sp-migration.md create mode 100644 vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-upgrade-notes-1.16.md create mode 100644 vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-upgrade-notes-1.17.md create mode 100644 vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Auth/AuthenticationFactory.php create mode 100644 vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Auth/SourceFactory.php rename vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Error/{BadUserInnput.php => BadUserInput.php} (66%) create mode 100644 vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/HTTP/Router.php create mode 100644 vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/HTTP/RunnableResponse.php create mode 100644 vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Module/ControllerResolver.php create mode 100644 vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Utils/HttpAdapter.php create mode 100644 vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/XHTML/TemplateLoader.php create mode 120000 vendor/simplesamlphp/simplesamlphp/locales/no create mode 100644 vendor/simplesamlphp/simplesamlphp/locales/xh/LC_MESSAGES/messages.po create mode 100644 vendor/simplesamlphp/simplesamlphp/locales/zu/LC_MESSAGES/messages.po rename vendor/simplesamlphp/simplesamlphp/modules/adfs/lib/SAML2/XML/fed/{Const.php => Constants.php} (61%) delete mode 100644 vendor/simplesamlphp/simplesamlphp/modules/adfs/lib/XMLSecurityDSig.php create mode 100644 vendor/simplesamlphp/simplesamlphp/modules/adfs/templates/postResponse.twig create mode 100644 vendor/simplesamlphp/simplesamlphp/modules/adfs/www/assets/js/postResponse.js create mode 100644 vendor/simplesamlphp/simplesamlphp/modules/admin/default-enable create mode 100644 vendor/simplesamlphp/simplesamlphp/modules/admin/lib/ConfigController.php create mode 100644 vendor/simplesamlphp/simplesamlphp/modules/admin/lib/FederationController.php create mode 100644 vendor/simplesamlphp/simplesamlphp/modules/admin/lib/Menu.php create mode 100644 vendor/simplesamlphp/simplesamlphp/modules/admin/lib/TestController.php create mode 100644 vendor/simplesamlphp/simplesamlphp/modules/admin/routes.yaml create mode 100644 vendor/simplesamlphp/simplesamlphp/modules/admin/templates/authsource_list.twig create mode 100644 vendor/simplesamlphp/simplesamlphp/modules/admin/templates/config.twig create mode 100644 vendor/simplesamlphp/simplesamlphp/modules/admin/templates/diagnostics.twig create mode 100644 vendor/simplesamlphp/simplesamlphp/modules/admin/templates/federation.twig create mode 100644 vendor/simplesamlphp/simplesamlphp/modules/admin/templates/includes/menu.twig create mode 100644 vendor/simplesamlphp/simplesamlphp/modules/admin/templates/status.twig create mode 100644 vendor/simplesamlphp/simplesamlphp/modules/authX509/templates/X509error.twig create mode 100644 vendor/simplesamlphp/simplesamlphp/modules/authX509/templates/X509warning.twig create mode 100644 vendor/simplesamlphp/simplesamlphp/modules/authYubiKey/templates/yubikeylogin.twig create mode 100644 vendor/simplesamlphp/simplesamlphp/modules/authYubiKey/www/assets/css/yubikey.css create mode 100644 vendor/simplesamlphp/simplesamlphp/modules/authYubiKey/www/assets/js/autofocus.js delete mode 100644 vendor/simplesamlphp/simplesamlphp/modules/authlinkedin/docs/oauthlinkedin.md delete mode 100644 vendor/simplesamlphp/simplesamlphp/modules/authlinkedin/lib/Auth/Source/LinkedIn.php delete mode 100644 vendor/simplesamlphp/simplesamlphp/modules/authlinkedin/www/linkback.php delete mode 100644 vendor/simplesamlphp/simplesamlphp/modules/authmyspace/docs/oauthmyspace.md delete mode 100644 vendor/simplesamlphp/simplesamlphp/modules/authmyspace/lib/Auth/Source/MySpace.php delete mode 100644 vendor/simplesamlphp/simplesamlphp/modules/authmyspace/www/linkback.php create mode 100644 vendor/simplesamlphp/simplesamlphp/modules/authorize/locales/xh/LC_MESSAGES/authorize.po create mode 100644 vendor/simplesamlphp/simplesamlphp/modules/authorize/locales/zu/LC_MESSAGES/authorize.po create mode 100644 vendor/simplesamlphp/simplesamlphp/modules/authorize/templates/authorize_403.twig delete mode 100644 vendor/simplesamlphp/simplesamlphp/modules/casserver/config-templates/module_casserver.php delete mode 100644 vendor/simplesamlphp/simplesamlphp/modules/casserver/default-disable delete mode 100644 vendor/simplesamlphp/simplesamlphp/modules/casserver/www/cas.php delete mode 100644 vendor/simplesamlphp/simplesamlphp/modules/casserver/www/login.php delete mode 100644 vendor/simplesamlphp/simplesamlphp/modules/casserver/www/proxy.php delete mode 100644 vendor/simplesamlphp/simplesamlphp/modules/casserver/www/serviceValidate.php delete mode 100644 vendor/simplesamlphp/simplesamlphp/modules/casserver/www/tickets.php delete mode 100644 vendor/simplesamlphp/simplesamlphp/modules/casserver/www/validate.php rename vendor/simplesamlphp/simplesamlphp/modules/{authlinkedin => consent}/default-disable (100%) delete mode 100644 vendor/simplesamlphp/simplesamlphp/modules/consent/default-enable create mode 100644 vendor/simplesamlphp/simplesamlphp/modules/consent/locales/xh/LC_MESSAGES/consent.po create mode 100644 vendor/simplesamlphp/simplesamlphp/modules/consent/locales/zu/LC_MESSAGES/consent.po create mode 100644 vendor/simplesamlphp/simplesamlphp/modules/consent/templates/consentform.twig create mode 100644 vendor/simplesamlphp/simplesamlphp/modules/consent/templates/logout_completed.twig create mode 100644 vendor/simplesamlphp/simplesamlphp/modules/consent/templates/noconsent.twig rename vendor/simplesamlphp/simplesamlphp/modules/consent/www/{style.css => assets/consent.css} (72%) create mode 100644 vendor/simplesamlphp/simplesamlphp/modules/consent/www/assets/css/consent.css create mode 100644 vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/hooks/hook_configpage.php create mode 100644 vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/templates/consentadmin.twig create mode 100644 vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/templates/consentadminajax.twig create mode 100644 vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/www/assets/css/consentAdmin.css create mode 100644 vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/www/assets/js/consentAdmin.js delete mode 100644 vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/www/includes/consentSimpleAjax.js create mode 100644 vendor/simplesamlphp/simplesamlphp/modules/core/dictionaries/cardinality.definition.json create mode 100644 vendor/simplesamlphp/simplesamlphp/modules/core/dictionaries/cardinality.translation.json create mode 100644 vendor/simplesamlphp/simplesamlphp/modules/core/docs/authproc_cardinality.md create mode 100644 vendor/simplesamlphp/simplesamlphp/modules/core/docs/authproc_cardinalitysingle.md create mode 100644 vendor/simplesamlphp/simplesamlphp/modules/core/lib/Auth/Process/Cardinality.php create mode 100644 vendor/simplesamlphp/simplesamlphp/modules/core/lib/Auth/Process/CardinalitySingle.php create mode 100644 vendor/simplesamlphp/simplesamlphp/modules/core/lib/Controller.php create mode 100644 vendor/simplesamlphp/simplesamlphp/modules/core/locales/xh/LC_MESSAGES/core.po create mode 100644 vendor/simplesamlphp/simplesamlphp/modules/core/locales/zu/LC_MESSAGES/core.po create mode 100644 vendor/simplesamlphp/simplesamlphp/modules/core/routes.yaml create mode 100644 vendor/simplesamlphp/simplesamlphp/modules/core/templates/_frontpage_menu.twig create mode 100644 vendor/simplesamlphp/simplesamlphp/modules/core/templates/cardinality_error.tpl.php create mode 100644 vendor/simplesamlphp/simplesamlphp/modules/core/templates/frontpage_auth.twig create mode 100644 vendor/simplesamlphp/simplesamlphp/modules/core/templates/frontpage_config.twig create mode 100644 vendor/simplesamlphp/simplesamlphp/modules/core/templates/frontpage_federation.twig create mode 100644 vendor/simplesamlphp/simplesamlphp/modules/core/templates/frontpage_welcome.twig create mode 100644 vendor/simplesamlphp/simplesamlphp/modules/core/templates/login.twig create mode 100644 vendor/simplesamlphp/simplesamlphp/modules/core/templates/loginuserpass.twig create mode 100644 vendor/simplesamlphp/simplesamlphp/modules/core/templates/logout-iframe-wrapper.twig create mode 100644 vendor/simplesamlphp/simplesamlphp/modules/core/templates/no_cookie.twig create mode 100644 vendor/simplesamlphp/simplesamlphp/modules/core/templates/no_metadata.twig create mode 100644 vendor/simplesamlphp/simplesamlphp/modules/core/templates/no_state.twig create mode 100644 vendor/simplesamlphp/simplesamlphp/modules/core/templates/short_sso_interval.twig create mode 100644 vendor/simplesamlphp/simplesamlphp/modules/core/templates/show_metadata.twig create mode 100644 vendor/simplesamlphp/simplesamlphp/modules/core/www/assets/js/loginuserpass.js create mode 100644 vendor/simplesamlphp/simplesamlphp/modules/core/www/cardinality_error.php mode change 100644 => 100755 vendor/simplesamlphp/simplesamlphp/modules/cron/bin/cron.php create mode 100644 vendor/simplesamlphp/simplesamlphp/modules/cron/hooks/hook_configpage.php create mode 100644 vendor/simplesamlphp/simplesamlphp/modules/cron/templates/croninfo-result.twig create mode 100644 vendor/simplesamlphp/simplesamlphp/modules/cron/templates/croninfo.twig create mode 100644 vendor/simplesamlphp/simplesamlphp/modules/cron/www/assets/css/cron.css create mode 100644 vendor/simplesamlphp/simplesamlphp/modules/discopower/locales/xh/LC_MESSAGES/discopower.po create mode 100644 vendor/simplesamlphp/simplesamlphp/modules/discopower/locales/zu/LC_MESSAGES/discopower.po create mode 100644 vendor/simplesamlphp/simplesamlphp/modules/discopower/templates/disco.twig create mode 100644 vendor/simplesamlphp/simplesamlphp/modules/discopower/www/assets/css/disco.css create mode 100644 vendor/simplesamlphp/simplesamlphp/modules/discopower/www/assets/js/jquery.livesearch.js create mode 100644 vendor/simplesamlphp/simplesamlphp/modules/discopower/www/assets/js/quicksilver.js create mode 100644 vendor/simplesamlphp/simplesamlphp/modules/discopower/www/assets/js/suggest.js delete mode 100644 vendor/simplesamlphp/simplesamlphp/modules/discopower/www/js/jquery.livesearch.js delete mode 100644 vendor/simplesamlphp/simplesamlphp/modules/discopower/www/js/quicksilver.js delete mode 100644 vendor/simplesamlphp/simplesamlphp/modules/discopower/www/js/suggest.js delete mode 100644 vendor/simplesamlphp/simplesamlphp/modules/discopower/www/style.css delete mode 100644 vendor/simplesamlphp/simplesamlphp/modules/exampleauth/lib/Auth/Source/Static.php create mode 100644 vendor/simplesamlphp/simplesamlphp/modules/exampleauth/lib/Auth/Source/StaticSource.php create mode 100644 vendor/simplesamlphp/simplesamlphp/modules/expirycheck/locales/xh/LC_MESSAGES/expirycheck.po create mode 100644 vendor/simplesamlphp/simplesamlphp/modules/expirycheck/locales/zu/LC_MESSAGES/expirycheck.po create mode 100644 vendor/simplesamlphp/simplesamlphp/modules/expirycheck/templates/about2expire.twig create mode 100644 vendor/simplesamlphp/simplesamlphp/modules/expirycheck/templates/expired.twig create mode 100644 vendor/simplesamlphp/simplesamlphp/modules/memcacheMonitor/hooks/hook_configpage.php create mode 100644 vendor/simplesamlphp/simplesamlphp/modules/memcacheMonitor/templates/memcachestat.twig create mode 100644 vendor/simplesamlphp/simplesamlphp/modules/memcacheMonitor/www/assets/css/memcacheMonitor.css create mode 100644 vendor/simplesamlphp/simplesamlphp/modules/metarefresh/dictionaries/metarefresh.definition.json create mode 100644 vendor/simplesamlphp/simplesamlphp/modules/metarefresh/dictionaries/metarefresh.translation.json create mode 100644 vendor/simplesamlphp/simplesamlphp/modules/metarefresh/locales/en/LC_MESSAGES/metarefresh.po create mode 100644 vendor/simplesamlphp/simplesamlphp/modules/metarefresh/templates/fetch.twig create mode 100644 vendor/simplesamlphp/simplesamlphp/modules/multiauth/locales/xh/LC_MESSAGES/multiauth.po create mode 100644 vendor/simplesamlphp/simplesamlphp/modules/multiauth/locales/zu/LC_MESSAGES/multiauth.po create mode 100644 vendor/simplesamlphp/simplesamlphp/modules/multiauth/templates/selectsource.twig create mode 100644 vendor/simplesamlphp/simplesamlphp/modules/negotiate/templates/disable.twig create mode 100644 vendor/simplesamlphp/simplesamlphp/modules/negotiate/templates/enable.twig create mode 100644 vendor/simplesamlphp/simplesamlphp/modules/negotiate/templates/redirect.php create mode 100644 vendor/simplesamlphp/simplesamlphp/modules/negotiate/templates/redirect.twig create mode 100644 vendor/simplesamlphp/simplesamlphp/modules/negotiate/www/assets/js/redirect.js delete mode 100755 vendor/simplesamlphp/simplesamlphp/modules/oauth/bin/demo.php delete mode 100644 vendor/simplesamlphp/simplesamlphp/modules/oauth/templates/authorized.php delete mode 100644 vendor/simplesamlphp/simplesamlphp/modules/oauth/templates/consent.php create mode 100644 vendor/simplesamlphp/simplesamlphp/modules/oauth/templates/registry.edit.twig create mode 100644 vendor/simplesamlphp/simplesamlphp/modules/oauth/templates/registry.list.twig create mode 100644 vendor/simplesamlphp/simplesamlphp/modules/oauth/templates/registry.saved.twig create mode 100644 vendor/simplesamlphp/simplesamlphp/modules/oauth/www/assets/css/oauth.css create mode 100644 vendor/simplesamlphp/simplesamlphp/modules/oauth/www/assets/js/oauth.js delete mode 100644 vendor/simplesamlphp/simplesamlphp/modules/oauth/www/resources/style.css create mode 100644 vendor/simplesamlphp/simplesamlphp/modules/preprodwarning/templates/warning.twig create mode 100644 vendor/simplesamlphp/simplesamlphp/modules/saml/docs/authproc_authncontextclassref.md create mode 100644 vendor/simplesamlphp/simplesamlphp/modules/saml/locales/xh/LC_MESSAGES/saml.po create mode 100644 vendor/simplesamlphp/simplesamlphp/modules/saml/locales/zu/LC_MESSAGES/saml.po create mode 100644 vendor/simplesamlphp/simplesamlphp/modules/saml/templates/proxy/invalid_session.twig create mode 100644 vendor/simplesamlphp/simplesamlphp/modules/saml/templates/sp/wrong_authncontextclassref.twig create mode 100644 vendor/simplesamlphp/simplesamlphp/modules/sanitycheck/dictionaries/strings.definition.json create mode 100644 vendor/simplesamlphp/simplesamlphp/modules/sanitycheck/dictionaries/strings.translation.json create mode 100644 vendor/simplesamlphp/simplesamlphp/modules/sanitycheck/hooks/hook_configpage.php create mode 100644 vendor/simplesamlphp/simplesamlphp/modules/sanitycheck/locales/en/LC_MESSAGES/sanitycheck.po create mode 100644 vendor/simplesamlphp/simplesamlphp/modules/sanitycheck/locales/es/LC_MESSAGES/sanitycheck.po create mode 100644 vendor/simplesamlphp/simplesamlphp/modules/sanitycheck/locales/it/LC_MESSAGES/sanitycheck.po create mode 100644 vendor/simplesamlphp/simplesamlphp/modules/sanitycheck/locales/nb/LC_MESSAGES/sanitycheck.po create mode 100644 vendor/simplesamlphp/simplesamlphp/modules/sanitycheck/locales/nl/LC_MESSAGES/sanitycheck.po create mode 100644 vendor/simplesamlphp/simplesamlphp/modules/sanitycheck/locales/nn/LC_MESSAGES/sanitycheck.po rename vendor/simplesamlphp/simplesamlphp/modules/{authmyspace => sqlauth}/default-disable (100%) delete mode 100644 vendor/simplesamlphp/simplesamlphp/modules/sqlauth/default-enable create mode 100644 vendor/simplesamlphp/simplesamlphp/modules/statistics/dictionaries/statistics.definition.json create mode 100644 vendor/simplesamlphp/simplesamlphp/modules/statistics/dictionaries/statistics.translation.json create mode 100644 vendor/simplesamlphp/simplesamlphp/modules/statistics/hooks/hook_configpage.php create mode 100644 vendor/simplesamlphp/simplesamlphp/modules/statistics/locales/en/LC_MESSAGES/statistics.po create mode 100644 vendor/simplesamlphp/simplesamlphp/modules/statistics/locales/es/LC_MESSAGES/statistics.po create mode 100644 vendor/simplesamlphp/simplesamlphp/modules/statistics/locales/nb/LC_MESSAGES/statistics.po create mode 100644 vendor/simplesamlphp/simplesamlphp/modules/statistics/locales/nn/LC_MESSAGES/statistics.po create mode 100644 vendor/simplesamlphp/simplesamlphp/modules/statistics/templates/statistics.twig create mode 100644 vendor/simplesamlphp/simplesamlphp/modules/statistics/templates/statmeta.twig rename vendor/simplesamlphp/simplesamlphp/modules/statistics/www/{style.css => assets/css/statistics.css} (70%) create mode 100644 vendor/simplesamlphp/simplesamlphp/modules/statistics/www/assets/js/statistics.js delete mode 100644 vendor/simplesamlphp/simplesamlphp/modules/statistics/www/javascript.js create mode 100644 vendor/simplesamlphp/simplesamlphp/package-lock.json create mode 100644 vendor/simplesamlphp/simplesamlphp/package.json create mode 100644 vendor/simplesamlphp/simplesamlphp/phpunit.xml create mode 100644 vendor/simplesamlphp/simplesamlphp/schemas/xenc-schema.xsd create mode 100644 vendor/simplesamlphp/simplesamlphp/schemas/xml.xsd create mode 100644 vendor/simplesamlphp/simplesamlphp/schemas/xmldsig-core-schema.xsd create mode 100644 vendor/simplesamlphp/simplesamlphp/src/css/default-rtl.css create mode 100644 vendor/simplesamlphp/simplesamlphp/src/css/default.scss create mode 100644 vendor/simplesamlphp/simplesamlphp/src/js/bundle.js create mode 100644 vendor/simplesamlphp/simplesamlphp/src/js/style.js create mode 100644 vendor/simplesamlphp/simplesamlphp/templates/IFrameLogoutHandler.tpl.php create mode 100644 vendor/simplesamlphp/simplesamlphp/templates/IFrameLogoutHandler.twig create mode 100644 vendor/simplesamlphp/simplesamlphp/templates/_table.twig create mode 100644 vendor/simplesamlphp/simplesamlphp/templates/auth_status.twig create mode 100644 vendor/simplesamlphp/simplesamlphp/templates/error.twig create mode 100644 vendor/simplesamlphp/simplesamlphp/templates/errorreport.twig create mode 100644 vendor/simplesamlphp/simplesamlphp/templates/hostnames.twig create mode 100644 vendor/simplesamlphp/simplesamlphp/templates/includes/expander.twig create mode 100644 vendor/simplesamlphp/simplesamlphp/templates/logout.twig create mode 100644 vendor/simplesamlphp/simplesamlphp/templates/metadata-converter.twig create mode 100644 vendor/simplesamlphp/simplesamlphp/templates/metadata.twig create mode 100644 vendor/simplesamlphp/simplesamlphp/templates/selectidp-dropdown.twig create mode 100644 vendor/simplesamlphp/simplesamlphp/templates/selectidp-links.twig create mode 100644 vendor/simplesamlphp/simplesamlphp/webpack.config.js create mode 100644 vendor/simplesamlphp/simplesamlphp/www/assets/css/.gitkeep create mode 100644 vendor/simplesamlphp/simplesamlphp/www/assets/css/src/default-rtl.css create mode 100644 vendor/simplesamlphp/simplesamlphp/www/assets/fonts/.gitkeep create mode 100644 vendor/simplesamlphp/simplesamlphp/www/assets/js/.gitkeep create mode 100644 vendor/twig/twig/.gitattributes delete mode 100644 vendor/twig/twig/phpunit.xml.dist delete mode 100644 vendor/twig/twig/test/Twig/Tests/AutoloaderTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/Cache/FilesystemTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/CompilerTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/ContainerRuntimeLoaderTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/CustomExtensionTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/EnvironmentTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/ErrorTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/ExpressionParserTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/Extension/CoreTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/Extension/SandboxTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/FactoryRuntimeLoaderTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/FileCachingTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/FileExtensionEscapingStrategyTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/FilesystemHelper.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/autoescape/block.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/autoescape/name.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/errors/base.html delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/errors/index.html delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/errors/leak-output.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/child_contents_outside_blocks.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/exception_in_extension_extends.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/exception_in_extension_include.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/multiline_array_with_undefined_variable.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/multiline_array_with_undefined_variable_again.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/multiline_function_with_undefined_variable.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/multiline_function_with_unknown_argument.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/multiline_tag_with_undefined_variable.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/strict_comparison_operator.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/syntax_error_in_reused_template.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/unclosed_tag.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/undefined_parent.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/undefined_template_in_child_template.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/undefined_trait.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/_self.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/array.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/array_call.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/binary.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/bitwise.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/call_argument_defined_twice.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/call_positional_arg_after_named_arg.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/comparison.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/divisibleby.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/dotdot.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/ends_with.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/floats.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/grouping.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/literals.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/magic_call.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/matches.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/method_call.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/negative_numbers.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/not_arrow_fn.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/operators_as_variables.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/postfix.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/power.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/sameas.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/starts_with.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/string_operator_as_var_assignment.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/strings.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/ternary_operator.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/ternary_operator_noelse.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/ternary_operator_nothen.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/two_word_operators_as_variables.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/unary.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/unary_macro_arguments.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/unary_precedence.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/filters/abs.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/filters/batch.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/filters/batch_float.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/filters/batch_with_empty_fill.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/filters/batch_with_exact_elements.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/filters/batch_with_fill.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/filters/batch_with_keys.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/filters/batch_with_more_elements.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/filters/batch_with_zero_elements.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/filters/convert_encoding.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date_default_format.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date_default_format_interval.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date_immutable.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date_interval.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date_modify.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date_namedargs.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/filters/default.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/filters/dynamic_filter.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/filters/escape.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/filters/escape_html_attr.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/filters/escape_javascript.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/filters/escape_non_supported_charset.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/filters/filter.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/filters/filter_php_55.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/filters/filter_php_56.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/filters/first.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/filters/force_escape.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/filters/format.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/filters/join.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/filters/json_encode.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/filters/last.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/filters/length.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/filters/length_utf8.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/filters/map.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/filters/merge.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/filters/nl2br.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/filters/number_format.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/filters/number_format_default.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/filters/reduce.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/filters/replace.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/filters/replace_invalid_arg.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/filters/reverse.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/filters/round.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/filters/slice.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/filters/sort.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/filters/spaceless.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/filters/special_chars.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/filters/split.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/filters/split_utf8.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/filters/static_calls.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/filters/trim.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/filters/urlencode.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/filters/urlencode_deprecated.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/functions/attribute.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/functions/block.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/functions/block_with_template.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/functions/block_without_name.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/functions/constant.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/functions/cycle.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/functions/date.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/functions/date_namedargs.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/functions/dump.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/functions/dump_array.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/functions/dynamic_function.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/assignment.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/autoescaping.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/basic.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/expression.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/ignore_missing.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/ignore_missing_exists.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/include_missing_extends.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/missing.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/missing_nested.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/sandbox.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/sandbox_disabling.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/sandbox_disabling_ignore_missing.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/template_instance.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/templates_as_array.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/with_context.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/with_variables.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include_template_from_string.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/functions/magic_call.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/functions/magic_call53.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/functions/max.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/functions/min.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/functions/range.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/functions/recursive_block_with_inheritance.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/functions/source.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/functions/special_chars.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/functions/static_calls.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/functions/template_from_string.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/functions/template_from_string_error.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/macros/default_values.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/macros/nested_calls.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/macros/reserved_variables.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/macros/simple.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/macros/varargs.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/macros/varargs_argument.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/macros/with_filters.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/regression/block_names_unicity.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/regression/combined_debug_info.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/regression/empty_token.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/regression/issue_1143.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/regression/multi_word_tests.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/regression/simple_xml_element.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/regression/strings_like_numbers.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/apply/basic.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/apply/json_encode.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/apply/multiple.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/apply/nested.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/apply/scope.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/apply/with_for_tag.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/apply/with_if_tag.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/basic.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/blocks.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/double_escaping.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/functions.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/literal.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/nested.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/objects.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/raw.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/strategy.legacy.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/strategy.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/type.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/with_filters.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/with_filters_arguments.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/with_pre_escape_filters.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/with_preserves_safety_filters.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/block/basic.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/block/block_unique_name.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/block/special_chars.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/deprecated/block.legacy.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/deprecated/macro.legacy.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/deprecated/template.legacy.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/embed/basic.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/embed/complex_dynamic_parent.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/embed/dynamic_parent.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/embed/error_line.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/embed/multiple.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/embed/nested.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/embed/with_extends.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/filter/basic.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/filter/json_encode.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/filter/multiple.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/filter/nested.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/filter/scope.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/filter/with_for_tag.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/filter/with_if_tag.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/condition.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/context.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/else.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/inner_variables.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/keys.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/keys_and_values.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/loop_context.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/loop_context_local.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/loop_not_defined.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/loop_not_defined_cond.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/nested_else.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/objects.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/objects_countable.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/recursive.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/values.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/from.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/if/basic.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/if/expression.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/basic.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/expression.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/ignore_missing.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/ignore_missing_exists.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/include_missing_extends.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/missing.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/missing_nested.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/only.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/template_instance.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/templates_as_array.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/with_variables.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/basic.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/block_expr.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/block_expr2.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/conditional.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/dynamic.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/empty.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/extends_as_array.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/extends_as_array_with_empty_name.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/extends_as_array_with_null_name.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/extends_in_block.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/extends_in_macro.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/multiple.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/multiple_dynamic.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/nested_blocks.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/nested_blocks_parent_only.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/nested_inheritance.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent_as_template_wrapper.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent_change.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent_isolation.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent_nested.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent_without_extends.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent_without_extends_but_traits.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/template_instance.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/use.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/basic.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/endmacro_name.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/external.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/from.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/from_in_block_is_local.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/from_local_override.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/from_macro_in_a_macro.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/from_nested_blocks.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/from_nested_blocks_with_global_macro.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/from_syntax_error.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/from_with_reserved_name.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/global.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/import_and_blocks.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/import_from_string_template.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/import_in_block_is_local.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/import_local_override.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/import_macro_in_a_macro.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/import_nested_blocks.legacy.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/import_nested_blocks_with_global_macro.legacy.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/import_self_parent.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/import_syntax_error.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/import_with_reserved_name.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/reserved_name.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/self_import.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/special_chars.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/super_globals.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/raw/basic.legacy.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/raw/mixed_usage_with_raw.legacy.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/raw/whitespace_control.legacy.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/sandbox/array.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/sandbox/not_valid1.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/sandbox/not_valid2.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/sandbox/simple.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/set/basic.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/set/capture-empty.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/set/capture.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/set/capture_scope.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/set/expression.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/set/inheritance.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/set/inheritance_overriding.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/set/mutating.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/spaceless/simple.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/special_chars.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/aliases.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/basic.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/deep.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/deep_empty.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/inheritance.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/inheritance2.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/multiple.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/multiple_aliases.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/parent_block.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/parent_block2.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/parent_block3.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/use_with_parent.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/verbatim/basic.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/verbatim/mixed_usage_with_raw.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/verbatim/whitespace_control.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/with/basic.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/with/expression.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/with/globals.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/with/iterable.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/with/nested.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/with/with_no_hash.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tags/with/with_only.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tests/array.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tests/constant.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tests/defined.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tests/defined_for_attribute.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tests/defined_for_blocks.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tests/defined_for_blocks_with_template.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tests/defined_for_constants.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tests/defined_on_complex_expr.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tests/dynamic_test.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tests/empty.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tests/even.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tests/in.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tests/in_with_objects.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tests/iterable.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tests/null_coalesce.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/tests/odd.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/whitespace/trim_block.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/whitespace/trim_delimiter_as_strings.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/whitespace/trim_left.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/whitespace/trim_line_left.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/whitespace/trim_line_right.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/Fixtures/whitespace/trim_right.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/IntegrationTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/LegacyFixtures/autoescape/filename.legacy.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/LegacyFixtures/functions/undefined_block.legacy.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/LegacyFixtures/test.legacy.test delete mode 100644 vendor/twig/twig/test/Twig/Tests/LegacyIntegrationTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/LexerTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/Loader/ArrayTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/Loader/ChainTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/Loader/FilesystemTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/inheritance/array_inheritance_empty_parent.html.twig delete mode 100644 vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/inheritance/array_inheritance_nonexistent_parent.html.twig delete mode 100644 vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/inheritance/array_inheritance_null_parent.html.twig delete mode 100644 vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/inheritance/array_inheritance_valid_parent.html.twig delete mode 100644 vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/inheritance/parent.html.twig delete mode 100644 vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/inheritance/spare_parent.html.twig delete mode 100644 vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/named/index.html delete mode 100644 vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/named_bis/index.html delete mode 100644 vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/named_final/index.html delete mode 100644 vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/named_quater/named_absolute.html delete mode 100644 vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/named_ter/index.html delete mode 100644 vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/normal/index.html delete mode 100644 vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/normal_bis/index.html delete mode 100644 vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/normal_final/index.html delete mode 100644 vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/normal_ter/index.html delete mode 100644 vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/phar/phar-sample.phar delete mode 100644 vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/themes/theme1/blocks.html.twig delete mode 100644 vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/themes/theme2/blocks.html.twig delete mode 100644 vendor/twig/twig/test/Twig/Tests/NativeExtensionTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/Node/AutoEscapeTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/Node/BlockReferenceTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/Node/BlockTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/Node/DeprecatedTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/Node/DoTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/Node/Expression/ArrayTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/Node/Expression/AssignNameTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/AddTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/AndTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/ConcatTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/DivTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/FloorDivTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/ModTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/MulTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/OrTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/SubTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/Node/Expression/CallTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/Node/Expression/ConditionalTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/Node/Expression/ConstantTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/Node/Expression/FilterTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/Node/Expression/FunctionTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/Node/Expression/GetAttrTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/Node/Expression/NameTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/Node/Expression/NullCoalesceTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/Node/Expression/PHP53/FilterInclude.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/Node/Expression/PHP53/FunctionInclude.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/Node/Expression/PHP53/TestInclude.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/Node/Expression/ParentTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/Node/Expression/TestTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/Node/Expression/Unary/NegTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/Node/Expression/Unary/NotTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/Node/Expression/Unary/PosTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/Node/ForTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/Node/IfTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/Node/ImportTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/Node/IncludeTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/Node/MacroTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/Node/ModuleTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/Node/PrintTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/Node/SandboxTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/Node/SetTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/Node/SpacelessTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/Node/TextTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/NodeTraverserTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/NodeVisitor/OptimizerTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/ParserTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/Profiler/Dumper/AbstractTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/Profiler/Dumper/BlackfireTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/Profiler/Dumper/HtmlTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/Profiler/Dumper/TextTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/Profiler/ProfileTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/TemplateTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/TemplateWrapperTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/TokenStreamTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/Util/DeprecationCollectorTest.php delete mode 100644 vendor/twig/twig/test/Twig/Tests/escapingTest.php rename web/modules/simplesamlphp_auth/{src/Tests => tests/src/Functional}/SimplesamlphpAuthTest.php (62%) diff --git a/composer.json b/composer.json index c94dd72cb6..df80da6527 100644 --- a/composer.json +++ b/composer.json @@ -165,7 +165,7 @@ "drupal/simple_gmap": "^1.4", "drupal/simple_megamenu": "1.0-beta3", "drupal/simple_sitemap": "^3.0", - "drupal/simplesamlphp_auth": "3.0", + "drupal/simplesamlphp_auth": "3.1", "drupal/smtp": "1.x-dev#84f789cbba894290cf82ed2558c8a4e7e24f3c89", "drupal/social_media": "^1.3", "drupal/social_media_links": "^2.6", @@ -227,7 +227,11 @@ "rm -rf web/modules/smtp/.git" ], "post-update-cmd": [ - "DrupalProject\\composer\\ScriptHandler::createRequiredFiles" + "rm -rf vendor/simplesamlphp/simplesamlphp/config", + "cp -r config/simplesamlphp/config vendor/simplesamlphp/simplesamlphp/config", + "rm -f web/simplesaml", + "ln -s ../vendor/simplesamlphp/simplesamlphp/www web/simplesaml", + "DrupalProject\\composer\\ScriptHandler::createRequiredFiles" ], "post-create-project-cmd": [ "@drupal-scaffold", diff --git a/composer.lock b/composer.lock index 120c652723..1d7a5edcf4 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "a26cc72fa20f0fa78b5e232ce682cfb6", + "content-hash": "f63252d2b5f8bcacdc2152608f35e1e1", "packages": [ { "name": "alchemy/zippy", @@ -1279,6 +1279,7 @@ ], "description": "Promoting the interoperability of container objects (DIC, SL, etc.)", "homepage": "https://github.com/container-interop/container-interop", + "abandoned": "psr/container", "time": "2017-02-14T19:40:03+00:00" }, { @@ -7217,22 +7218,22 @@ }, { "name": "drupal/simplesamlphp_auth", - "version": "3.0.0", + "version": "3.1.0", "source": { "type": "git", "url": "https://git.drupalcode.org/project/simplesamlphp_auth.git", - "reference": "8.x-3.0" + "reference": "8.x-3.1" }, "dist": { "type": "zip", - "url": "https://ftp.drupal.org/files/projects/simplesamlphp_auth-8.x-3.0.zip", - "reference": "8.x-3.0", - "shasum": "2ee230173df2128edb5d72953222d229dabf27e7" + "url": "https://ftp.drupal.org/files/projects/simplesamlphp_auth-8.x-3.1.zip", + "reference": "8.x-3.1", + "shasum": "db464b1a4716ad21e7f2ec141640691b8d040d59" }, "require": { "drupal/core": "*", - "drupal/externalauth": "*", - "simplesamlphp/simplesamlphp": "~1.15" + "drupal/externalauth": "^1.1", + "simplesamlphp/simplesamlphp": "~1.17.2" }, "type": "drupal-module", "extra": { @@ -7240,8 +7241,8 @@ "dev-3.x": "3.x-dev" }, "drupal": { - "version": "8.x-3.0", - "datestamp": "1521252787", + "version": "8.x-3.1", + "datestamp": "1565118485", "security-coverage": { "status": "covered", "message": "Covered by Drupal's security advisory policy" @@ -7253,6 +7254,10 @@ "GPL-2.0+" ], "authors": [ + { + "name": "Berdir", + "homepage": "https://www.drupal.org/user/214652" + }, { "name": "colan", "homepage": "https://www.drupal.org/user/58704" @@ -7277,7 +7282,7 @@ "description": "Allows users to authenticate to a remote SAML identity provider (IdP) via a locally configured SimpleSAMLphp service point (SP).", "homepage": "https://www.drupal.org/project/simplesamlphp_auth", "support": { - "source": "http://cgit.drupalcode.org/simplesamlphp_auth" + "source": "https://git.drupalcode.org/project/simplesamlphp_auth" } }, { @@ -8870,27 +8875,29 @@ }, { "name": "gettext/gettext", - "version": "v3.6.1", + "version": "v4.8.2", "source": { "type": "git", - "url": "https://github.com/oscarotero/Gettext.git", - "reference": "cd3be64443551e3a693117c4bccbe53e36282456" + "url": "https://github.com/php-gettext/Gettext.git", + "reference": "e474f872f2c8636cf53fd283ec4ce1218f3d236a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/oscarotero/Gettext/zipball/cd3be64443551e3a693117c4bccbe53e36282456", - "reference": "cd3be64443551e3a693117c4bccbe53e36282456", + "url": "https://api.github.com/repos/php-gettext/Gettext/zipball/e474f872f2c8636cf53fd283ec4ce1218f3d236a", + "reference": "e474f872f2c8636cf53fd283ec4ce1218f3d236a", "shasum": "" }, "require": { - "gettext/languages": "2.*", - "php": ">=5.3.0" + "gettext/languages": "^2.3", + "php": ">=5.4.0" }, "require-dev": { "illuminate/view": "*", + "phpunit/phpunit": "^4.8|^5.7|^6.5", + "squizlabs/php_codesniffer": "^3.0", "symfony/yaml": "~2", "twig/extensions": "*", - "twig/twig": "*" + "twig/twig": "^1.31|^2.0" }, "suggest": { "illuminate/view": "Is necessary if you want to use the Blade extractor", @@ -8926,31 +8933,31 @@ "po", "translation" ], - "time": "2016-08-01T18:09:57+00:00" + "time": "2019-12-02T10:21:14+00:00" }, { "name": "gettext/languages", - "version": "2.4.0", + "version": "2.6.0", "source": { "type": "git", - "url": "https://github.com/mlocati/cldr-to-gettext-plural-rules.git", - "reference": "1b74377bd0c4cd87e8d72b948f5d8867e23505a5" + "url": "https://github.com/php-gettext/Languages.git", + "reference": "38ea0482f649e0802e475f0ed19fa993bcb7a618" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/mlocati/cldr-to-gettext-plural-rules/zipball/1b74377bd0c4cd87e8d72b948f5d8867e23505a5", - "reference": "1b74377bd0c4cd87e8d72b948f5d8867e23505a5", + "url": "https://api.github.com/repos/php-gettext/Languages/zipball/38ea0482f649e0802e475f0ed19fa993bcb7a618", + "reference": "38ea0482f649e0802e475f0ed19fa993bcb7a618", "shasum": "" }, "require": { "php": ">=5.3" }, "require-dev": { - "phpunit/phpunit": "^4" + "friendsofphp/php-cs-fixer": "^2.16.0", + "phpunit/phpunit": "^4.8 || ^5.7 || ^6.5 || ^7.5 || ^8.4" }, "bin": [ - "bin/export-plural-rules", - "bin/export-plural-rules.php" + "bin/export-plural-rules" ], "type": "library", "autoload": { @@ -8970,7 +8977,7 @@ } ], "description": "gettext languages with plural rules", - "homepage": "https://github.com/mlocati/cldr-to-gettext-plural-rules", + "homepage": "https://github.com/php-gettext/Languages", "keywords": [ "cldr", "i18n", @@ -8987,7 +8994,7 @@ "translations", "unicode" ], - "time": "2018-06-21T15:58:36+00:00" + "time": "2019-11-13T10:30:21+00:00" }, { "name": "grasmash/expander", @@ -9323,20 +9330,24 @@ }, { "name": "jaimeperez/twig-configurable-i18n", - "version": "v1.2", + "version": "v2.1", "source": { "type": "git", "url": "https://github.com/jaimeperez/twig-configurable-i18n.git", - "reference": "75d4926fd102c9e62219ad7f94a6136d2f2ccd93" + "reference": "38a22aaa6b31efdc0d76d58f5934dea3ebac8556" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/jaimeperez/twig-configurable-i18n/zipball/75d4926fd102c9e62219ad7f94a6136d2f2ccd93", - "reference": "75d4926fd102c9e62219ad7f94a6136d2f2ccd93", + "url": "https://api.github.com/repos/jaimeperez/twig-configurable-i18n/zipball/38a22aaa6b31efdc0d76d58f5934dea3ebac8556", + "reference": "38a22aaa6b31efdc0d76d58f5934dea3ebac8556", "shasum": "" }, "require": { - "twig/extensions": "^1.3" + "twig/extensions": "^1.5" + }, + "require-dev": { + "phpunit/phpunit": "~4.8.36", + "twig/twig": "^1.37 || ^2.7" }, "type": "project", "autoload": { @@ -9364,7 +9375,7 @@ "twig" ], "abandoned": "simplesamlphp/twig-configurable-i18n", - "time": "2016-10-03T12:34:15+00:00" + "time": "2019-06-07T11:03:28+00:00" }, { "name": "jakub-onderka/php-console-color", @@ -10201,16 +10212,16 @@ }, { "name": "psr/log", - "version": "1.1.0", + "version": "1.1.2", "source": { "type": "git", "url": "https://github.com/php-fig/log.git", - "reference": "6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd" + "reference": "446d54b4cb6bf489fc9d75f55843658e6f25d801" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd", - "reference": "6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd", + "url": "https://api.github.com/repos/php-fig/log/zipball/446d54b4cb6bf489fc9d75f55843658e6f25d801", + "reference": "446d54b4cb6bf489fc9d75f55843658e6f25d801", "shasum": "" }, "require": { @@ -10219,7 +10230,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "1.1.x-dev" } }, "autoload": { @@ -10244,7 +10255,7 @@ "psr", "psr-3" ], - "time": "2018-11-20T15:27:04+00:00" + "time": "2019-11-01T11:05:21+00:00" }, { "name": "psy/psysh", @@ -10362,24 +10373,22 @@ }, { "name": "robrichards/xmlseclibs", - "version": "3.0.1", + "version": "3.0.4", "source": { "type": "git", "url": "https://github.com/robrichards/xmlseclibs.git", - "reference": "d937712f70f93a584eb0299ccd87dc6374003781" + "reference": "0a53d3c3aa87564910cae4ed01416441d3ae0db5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/robrichards/xmlseclibs/zipball/d937712f70f93a584eb0299ccd87dc6374003781", - "reference": "d937712f70f93a584eb0299ccd87dc6374003781", + "url": "https://api.github.com/repos/robrichards/xmlseclibs/zipball/0a53d3c3aa87564910cae4ed01416441d3ae0db5", + "reference": "0a53d3c3aa87564910cae4ed01416441d3ae0db5", "shasum": "" }, "require": { + "ext-openssl": "*", "php": ">= 5.4" }, - "suggest": { - "ext-openssl": "OpenSSL extension" - }, "type": "library", "autoload": { "psr-4": { @@ -10398,7 +10407,7 @@ "xml", "xmldsig" ], - "time": "2017-08-31T09:27:07+00:00" + "time": "2019-11-05T11:44:22+00:00" }, { "name": "rvtraveller/qs-composer-installer", @@ -10440,16 +10449,16 @@ }, { "name": "simplesamlphp/saml2", - "version": "v3.1.6", + "version": "v3.4.2", "source": { "type": "git", "url": "https://github.com/simplesamlphp/saml2.git", - "reference": "d809ffbe2aa7260a0b3e72bf5be8cd6de0325d7c" + "reference": "3806d276edb066c60aa3d748ffd0681d92ffbda7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/simplesamlphp/saml2/zipball/d809ffbe2aa7260a0b3e72bf5be8cd6de0325d7c", - "reference": "d809ffbe2aa7260a0b3e72bf5be8cd6de0325d7c", + "url": "https://api.github.com/repos/simplesamlphp/saml2/zipball/3806d276edb066c60aa3d748ffd0681d92ffbda7", + "reference": "3806d276edb066c60aa3d748ffd0681d92ffbda7", "shasum": "" }, "require": { @@ -10458,15 +10467,17 @@ "ext-zlib": "*", "php": ">=5.4", "psr/log": "~1.0", - "robrichards/xmlseclibs": "^3.0" + "robrichards/xmlseclibs": "^3.0.4", + "webmozart/assert": "^1.4" }, "require-dev": { "mockery/mockery": "~0.9", - "phpmd/phpmd": "~1.5", - "phpunit/phpunit": "~4", - "sebastian/phpcpd": "~1.4", - "sensiolabs/security-checker": "~1.1", - "squizlabs/php_codesniffer": "~1.4" + "phpmd/phpmd": "~2.6", + "phpunit/phpunit": "~5.7", + "sebastian/phpcpd": "~2.0", + "sensiolabs/security-checker": "~4.1", + "simplesamlphp/simplesamlphp-test-framework": "0.0.11", + "squizlabs/php_codesniffer": "~3.2" }, "type": "library", "extra": { @@ -10493,20 +10504,20 @@ } ], "description": "SAML2 PHP library from SimpleSAMLphp", - "time": "2018-05-04T12:03:18+00:00" + "time": "2019-11-06T10:00:32+00:00" }, { "name": "simplesamlphp/simplesamlphp", - "version": "v1.15.4", + "version": "v1.17.8", "source": { "type": "git", "url": "https://github.com/simplesamlphp/simplesamlphp.git", - "reference": "c770d0cd392ba8d8b12ac6214dcabd818d7cca32" + "reference": "295937ae8672278cad73ec2c78af3749426263de" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/simplesamlphp/simplesamlphp/zipball/c770d0cd392ba8d8b12ac6214dcabd818d7cca32", - "reference": "c770d0cd392ba8d8b12ac6214dcabd818d7cca32", + "url": "https://api.github.com/repos/simplesamlphp/simplesamlphp/zipball/295937ae8672278cad73ec2c78af3749426263de", + "reference": "295937ae8672278cad73ec2c78af3749426263de", "shasum": "" }, "require": { @@ -10519,19 +10530,35 @@ "ext-pcre": "*", "ext-spl": "*", "ext-zlib": "*", - "gettext/gettext": "^3.5", - "jaimeperez/twig-configurable-i18n": "^1.2", - "php": ">=5.4", - "robrichards/xmlseclibs": "~3.0", - "simplesamlphp/saml2": "~3.1.4", - "twig/twig": "~1.0", + "gettext/gettext": "^4.6", + "jaimeperez/twig-configurable-i18n": "^2.0", + "php": ">=5.5", + "robrichards/xmlseclibs": "^3.0.4", + "simplesamlphp/saml2": "^3.3", + "symfony/config": "^3.4 || ^4.0", + "symfony/dependency-injection": "^3.4 || ^4.0", + "symfony/http-foundation": "^3.4 || ^4.0", + "symfony/http-kernel": "^3.4 || ^4.0", + "symfony/routing": "^3.4 || ^4.0", + "symfony/yaml": "^3.4 || ^4.0", + "twig/twig": "~1.0 || ~2.0", "whitehat101/apr1-md5": "~1.0" }, "require-dev": { - "ext-pdo_sqlite": "*", + "ext-curl": "*", "mikey179/vfsstream": "~1.6", "phpunit/phpunit": "~4.8" }, + "suggest": { + "ext-curl": "Needed in order to check for updates automatically", + "ext-ldap": "Needed if an LDAP backend is used", + "ext-memcache": "Needed if a Memcache server is used to store session information", + "ext-mysql": "Needed if a MySQL backend is used, either for authentication or to store session information", + "ext-pdo": "Needed if a database backend is used, either for authentication or to store session information", + "ext-pgsql": "Needed if a PostgreSQL backend is used, either for authentication or to store session information", + "ext-radius": "Needed if a Radius backend is used", + "predis/predis": "Needed if a Redis server is used to store session information" + }, "type": "project", "autoload": { "psr-4": { @@ -10546,14 +10573,14 @@ "LGPL-2.1-or-later" ], "authors": [ - { - "name": "Olav Morken", - "email": "olav.morken@uninett.no" - }, { "name": "Andreas Åkre Solberg", "email": "andreas.solberg@uninett.no" }, + { + "name": "Olav Morken", + "email": "olav.morken@uninett.no" + }, { "name": "Jaime Perez", "email": "jaime.perez@uninett.no" @@ -10569,7 +10596,7 @@ "sp", "ws-federation" ], - "time": "2018-03-02T15:02:24+00:00" + "time": "2019-11-20T08:26:08+00:00" }, { "name": "stack/builder", @@ -11460,16 +11487,16 @@ }, { "name": "symfony/polyfill-ctype", - "version": "v1.11.0", + "version": "v1.13.1", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "82ebae02209c21113908c229e9883c419720738a" + "reference": "f8f0b461be3385e56d6de3dbb5a0df24c0c275e3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/82ebae02209c21113908c229e9883c419720738a", - "reference": "82ebae02209c21113908c229e9883c419720738a", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/f8f0b461be3385e56d6de3dbb5a0df24c0c275e3", + "reference": "f8f0b461be3385e56d6de3dbb5a0df24c0c275e3", "shasum": "" }, "require": { @@ -11481,7 +11508,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.11-dev" + "dev-master": "1.13-dev" } }, "autoload": { @@ -11498,12 +11525,12 @@ ], "authors": [ { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" }, { - "name": "Gert de Pagter", - "email": "backendtea@gmail.com" + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], "description": "Symfony polyfill for ctype functions", @@ -11514,7 +11541,7 @@ "polyfill", "portable" ], - "time": "2019-02-06T07:57:58+00:00" + "time": "2019-11-27T13:56:44+00:00" }, { "name": "symfony/polyfill-iconv", @@ -12245,16 +12272,16 @@ }, { "name": "twig/extensions", - "version": "v1.5.2", + "version": "v1.5.4", "source": { "type": "git", "url": "https://github.com/twigphp/Twig-extensions.git", - "reference": "2c1a86526d0044065220d1b51ac08348bea5ca82" + "reference": "57873c8b0c1be51caa47df2cdb824490beb16202" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig-extensions/zipball/2c1a86526d0044065220d1b51ac08348bea5ca82", - "reference": "2c1a86526d0044065220d1b51ac08348bea5ca82", + "url": "https://api.github.com/repos/twigphp/Twig-extensions/zipball/57873c8b0c1be51caa47df2cdb824490beb16202", + "reference": "57873c8b0c1be51caa47df2cdb824490beb16202", "shasum": "" }, "require": { @@ -12296,30 +12323,30 @@ "i18n", "text" ], - "time": "2018-05-22T13:26:07+00:00" + "time": "2018-12-05T18:34:18+00:00" }, { "name": "twig/twig", - "version": "v1.42.2", + "version": "v1.42.4", "source": { "type": "git", "url": "https://github.com/twigphp/Twig.git", - "reference": "21707d6ebd05476854805e4f91b836531941bcd4" + "reference": "e587180584c3d2d6cb864a0454e777bb6dcb6152" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/21707d6ebd05476854805e4f91b836531941bcd4", - "reference": "21707d6ebd05476854805e4f91b836531941bcd4", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/e587180584c3d2d6cb864a0454e777bb6dcb6152", + "reference": "e587180584c3d2d6cb864a0454e777bb6dcb6152", "shasum": "" }, "require": { - "php": ">=5.4.0", + "php": ">=5.5.0", "symfony/polyfill-ctype": "^1.8" }, "require-dev": { "psr/container": "^1.0", - "symfony/debug": "^2.7", - "symfony/phpunit-bridge": "^3.4.19|^4.1.8|^5.0" + "symfony/debug": "^3.4|^4.2", + "symfony/phpunit-bridge": "^4.4@dev|^5.0" }, "type": "library", "extra": { @@ -12346,15 +12373,15 @@ "homepage": "http://fabien.potencier.org", "role": "Lead Developer" }, - { - "name": "Armin Ronacher", - "email": "armin.ronacher@active-4.com", - "role": "Project Founder" - }, { "name": "Twig Team", "homepage": "https://twig.symfony.com/contributors", "role": "Contributors" + }, + { + "name": "Armin Ronacher", + "email": "armin.ronacher@active-4.com", + "role": "Project Founder" } ], "description": "Twig, the flexible, fast, and secure template language for PHP", @@ -12362,7 +12389,7 @@ "keywords": [ "templating" ], - "time": "2019-06-18T15:35:16+00:00" + "time": "2019-11-11T16:49:32+00:00" }, { "name": "typo3/phar-stream-wrapper", diff --git a/vendor/bin/export-plural-rules.php b/vendor/bin/export-plural-rules.php deleted file mode 120000 index 0e5652e9bd..0000000000 --- a/vendor/bin/export-plural-rules.php +++ /dev/null @@ -1 +0,0 @@ -../gettext/languages/bin/export-plural-rules.php \ No newline at end of file diff --git a/vendor/composer/autoload_classmap.php b/vendor/composer/autoload_classmap.php index aef3c6ec2f..1abde09dee 100644 --- a/vendor/composer/autoload_classmap.php +++ b/vendor/composer/autoload_classmap.php @@ -3055,26 +3055,36 @@ 'Error' => $vendorDir . '/symfony/polyfill-php70/Resources/stubs/Error.php', 'Gettext\\BaseTranslator' => $vendorDir . '/gettext/gettext/src/BaseTranslator.php', 'Gettext\\Extractors\\Blade' => $vendorDir . '/gettext/gettext/src/Extractors/Blade.php', + 'Gettext\\Extractors\\Csv' => $vendorDir . '/gettext/gettext/src/Extractors/Csv.php', 'Gettext\\Extractors\\CsvDictionary' => $vendorDir . '/gettext/gettext/src/Extractors/CsvDictionary.php', 'Gettext\\Extractors\\Extractor' => $vendorDir . '/gettext/gettext/src/Extractors/Extractor.php', 'Gettext\\Extractors\\ExtractorInterface' => $vendorDir . '/gettext/gettext/src/Extractors/ExtractorInterface.php', + 'Gettext\\Extractors\\ExtractorMultiInterface' => $vendorDir . '/gettext/gettext/src/Extractors/ExtractorMultiInterface.php', 'Gettext\\Extractors\\Jed' => $vendorDir . '/gettext/gettext/src/Extractors/Jed.php', 'Gettext\\Extractors\\JsCode' => $vendorDir . '/gettext/gettext/src/Extractors/JsCode.php', + 'Gettext\\Extractors\\Json' => $vendorDir . '/gettext/gettext/src/Extractors/Json.php', 'Gettext\\Extractors\\JsonDictionary' => $vendorDir . '/gettext/gettext/src/Extractors/JsonDictionary.php', 'Gettext\\Extractors\\Mo' => $vendorDir . '/gettext/gettext/src/Extractors/Mo.php', 'Gettext\\Extractors\\PhpArray' => $vendorDir . '/gettext/gettext/src/Extractors/PhpArray.php', 'Gettext\\Extractors\\PhpCode' => $vendorDir . '/gettext/gettext/src/Extractors/PhpCode.php', 'Gettext\\Extractors\\Po' => $vendorDir . '/gettext/gettext/src/Extractors/Po.php', 'Gettext\\Extractors\\Twig' => $vendorDir . '/gettext/gettext/src/Extractors/Twig.php', + 'Gettext\\Extractors\\VueJs' => $vendorDir . '/gettext/gettext/src/Extractors/VueJs.php', + 'Gettext\\Extractors\\Xliff' => $vendorDir . '/gettext/gettext/src/Extractors/Xliff.php', + 'Gettext\\Extractors\\Yaml' => $vendorDir . '/gettext/gettext/src/Extractors/Yaml.php', 'Gettext\\Extractors\\YamlDictionary' => $vendorDir . '/gettext/gettext/src/Extractors/YamlDictionary.php', + 'Gettext\\Generators\\Csv' => $vendorDir . '/gettext/gettext/src/Generators/Csv.php', 'Gettext\\Generators\\CsvDictionary' => $vendorDir . '/gettext/gettext/src/Generators/CsvDictionary.php', 'Gettext\\Generators\\Generator' => $vendorDir . '/gettext/gettext/src/Generators/Generator.php', 'Gettext\\Generators\\GeneratorInterface' => $vendorDir . '/gettext/gettext/src/Generators/GeneratorInterface.php', 'Gettext\\Generators\\Jed' => $vendorDir . '/gettext/gettext/src/Generators/Jed.php', + 'Gettext\\Generators\\Json' => $vendorDir . '/gettext/gettext/src/Generators/Json.php', 'Gettext\\Generators\\JsonDictionary' => $vendorDir . '/gettext/gettext/src/Generators/JsonDictionary.php', 'Gettext\\Generators\\Mo' => $vendorDir . '/gettext/gettext/src/Generators/Mo.php', 'Gettext\\Generators\\PhpArray' => $vendorDir . '/gettext/gettext/src/Generators/PhpArray.php', 'Gettext\\Generators\\Po' => $vendorDir . '/gettext/gettext/src/Generators/Po.php', + 'Gettext\\Generators\\Xliff' => $vendorDir . '/gettext/gettext/src/Generators/Xliff.php', + 'Gettext\\Generators\\Yaml' => $vendorDir . '/gettext/gettext/src/Generators/Yaml.php', 'Gettext\\Generators\\YamlDictionary' => $vendorDir . '/gettext/gettext/src/Generators/YamlDictionary.php', 'Gettext\\GettextTranslator' => $vendorDir . '/gettext/gettext/src/GettextTranslator.php', 'Gettext\\Languages\\Category' => $vendorDir . '/gettext/languages/src/Category.php', @@ -3089,12 +3099,19 @@ 'Gettext\\Languages\\Exporter\\Xml' => $vendorDir . '/gettext/languages/src/Exporter/Xml.php', 'Gettext\\Languages\\FormulaConverter' => $vendorDir . '/gettext/languages/src/FormulaConverter.php', 'Gettext\\Languages\\Language' => $vendorDir . '/gettext/languages/src/Language.php', + 'Gettext\\Merge' => $vendorDir . '/gettext/gettext/src/Merge.php', 'Gettext\\Translation' => $vendorDir . '/gettext/gettext/src/Translation.php', 'Gettext\\Translations' => $vendorDir . '/gettext/gettext/src/Translations.php', 'Gettext\\Translator' => $vendorDir . '/gettext/gettext/src/Translator.php', 'Gettext\\TranslatorInterface' => $vendorDir . '/gettext/gettext/src/TranslatorInterface.php', + 'Gettext\\Utils\\CsvTrait' => $vendorDir . '/gettext/gettext/src/Utils/CsvTrait.php', + 'Gettext\\Utils\\DictionaryTrait' => $vendorDir . '/gettext/gettext/src/Utils/DictionaryTrait.php', 'Gettext\\Utils\\FunctionsScanner' => $vendorDir . '/gettext/gettext/src/Utils/FunctionsScanner.php', + 'Gettext\\Utils\\HeadersExtractorTrait' => $vendorDir . '/gettext/gettext/src/Utils/HeadersExtractorTrait.php', + 'Gettext\\Utils\\HeadersGeneratorTrait' => $vendorDir . '/gettext/gettext/src/Utils/HeadersGeneratorTrait.php', 'Gettext\\Utils\\JsFunctionsScanner' => $vendorDir . '/gettext/gettext/src/Utils/JsFunctionsScanner.php', + 'Gettext\\Utils\\MultidimensionalArrayTrait' => $vendorDir . '/gettext/gettext/src/Utils/MultidimensionalArrayTrait.php', + 'Gettext\\Utils\\ParsedComment' => $vendorDir . '/gettext/gettext/src/Utils/ParsedComment.php', 'Gettext\\Utils\\ParsedFunction' => $vendorDir . '/gettext/gettext/src/Utils/ParsedFunction.php', 'Gettext\\Utils\\PhpFunctionsScanner' => $vendorDir . '/gettext/gettext/src/Utils/PhpFunctionsScanner.php', 'Gettext\\Utils\\StringReader' => $vendorDir . '/gettext/gettext/src/Utils/StringReader.php', @@ -3624,6 +3641,7 @@ 'Psy\\VersionUpdater\\GitHubChecker' => $vendorDir . '/psy/psysh/src/VersionUpdater/GitHubChecker.php', 'Psy\\VersionUpdater\\IntervalChecker' => $vendorDir . '/psy/psysh/src/VersionUpdater/IntervalChecker.php', 'Psy\\VersionUpdater\\NoopChecker' => $vendorDir . '/psy/psysh/src/VersionUpdater/NoopChecker.php', + 'RobRichards\\XMLSecLibs\\Utils\\XPath' => $vendorDir . '/robrichards/xmlseclibs/src/Utils/XPath.php', 'RobRichards\\XMLSecLibs\\XMLSecEnc' => $vendorDir . '/robrichards/xmlseclibs/src/XMLSecEnc.php', 'RobRichards\\XMLSecLibs\\XMLSecurityDSig' => $vendorDir . '/robrichards/xmlseclibs/src/XMLSecurityDSig.php', 'RobRichards\\XMLSecLibs\\XMLSecurityKey' => $vendorDir . '/robrichards/xmlseclibs/src/XMLSecurityKey.php', @@ -3955,15 +3973,44 @@ 'SAML2\\XML\\shibmd\\Scope' => $vendorDir . '/simplesamlphp/saml2/src/SAML2/XML/shibmd/Scope.php', 'SelfUpdate\\SelfUpdateCommand' => $vendorDir . '/consolidation/self-update/src/SelfUpdateCommand.php', 'SessionUpdateTimestampHandlerInterface' => $vendorDir . '/symfony/polyfill-php70/Resources/stubs/SessionUpdateTimestampHandlerInterface.php', + 'SimpleSAML\\AuthMemCookie' => $vendorDir . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/AuthMemCookie.php', + 'SimpleSAML\\Auth\\AuthenticationFactory' => $vendorDir . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Auth/AuthenticationFactory.php', + 'SimpleSAML\\Auth\\DefaultAuth' => $vendorDir . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Auth/Default.php', + 'SimpleSAML\\Auth\\LDAP' => $vendorDir . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Auth/LDAP.php', + 'SimpleSAML\\Auth\\ProcessingChain' => $vendorDir . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Auth/ProcessingChain.php', + 'SimpleSAML\\Auth\\ProcessingFilter' => $vendorDir . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Auth/ProcessingFilter.php', 'SimpleSAML\\Auth\\Simple' => $vendorDir . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Auth/Simple.php', + 'SimpleSAML\\Auth\\Source' => $vendorDir . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Auth/Source.php', + 'SimpleSAML\\Auth\\SourceFactory' => $vendorDir . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Auth/SourceFactory.php', + 'SimpleSAML\\Auth\\State' => $vendorDir . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Auth/State.php', 'SimpleSAML\\Auth\\TimeLimitedToken' => $vendorDir . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Auth/TimeLimitedToken.php', 'SimpleSAML\\Bindings\\Shib13\\Artifact' => $vendorDir . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Bindings/Shib13/Artifact.php', 'SimpleSAML\\Bindings\\Shib13\\HTTPPost' => $vendorDir . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Bindings/Shib13/HTTPPost.php', + 'SimpleSAML\\Configuration' => $vendorDir . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Configuration.php', 'SimpleSAML\\Database' => $vendorDir . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Database.php', + 'SimpleSAML\\Error\\Assertion' => $vendorDir . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Error/Assertion.php', + 'SimpleSAML\\Error\\AuthSource' => $vendorDir . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Error/AuthSource.php', + 'SimpleSAML\\Error\\BadRequest' => $vendorDir . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Error/BadRequest.php', + 'SimpleSAML\\Error\\BadUserInput' => $vendorDir . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Error/BadUserInput.php', 'SimpleSAML\\Error\\CannotSetCookie' => $vendorDir . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Error/CannotSetCookie.php', 'SimpleSAML\\Error\\ConfigurationError' => $vendorDir . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Error/ConfigurationError.php', 'SimpleSAML\\Error\\CriticalConfigurationError' => $vendorDir . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Error/CriticalConfigurationError.php', + 'SimpleSAML\\Error\\Error' => $vendorDir . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Error/Error.php', 'SimpleSAML\\Error\\ErrorCodes' => $vendorDir . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Error/ErrorCodes.php', + 'SimpleSAML\\Error\\Exception' => $vendorDir . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Error/Exception.php', + 'SimpleSAML\\Error\\InvalidCredential' => $vendorDir . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Error/InvalidCredential.php', + 'SimpleSAML\\Error\\MetadataNotFound' => $vendorDir . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Error/MetadataNotFound.php', + 'SimpleSAML\\Error\\NoPassive' => $vendorDir . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Error/NoPassive.php', + 'SimpleSAML\\Error\\NoState' => $vendorDir . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Error/NoState.php', + 'SimpleSAML\\Error\\NotFound' => $vendorDir . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Error/NotFound.php', + 'SimpleSAML\\Error\\ProxyCountExceeded' => $vendorDir . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Error/ProxyCountExceeded.php', + 'SimpleSAML\\Error\\UnserializableException' => $vendorDir . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Error/UnserializableException.php', + 'SimpleSAML\\Error\\User' => $vendorDir . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Error/User.php', + 'SimpleSAML\\Error\\UserAborted' => $vendorDir . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Error/UserAborted.php', + 'SimpleSAML\\Error\\UserNotFound' => $vendorDir . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Error/UserNotFound.php', + 'SimpleSAML\\HTTP\\Router' => $vendorDir . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/HTTP/Router.php', + 'SimpleSAML\\HTTP\\RunnableResponse' => $vendorDir . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/HTTP/RunnableResponse.php', + 'SimpleSAML\\IdP' => $vendorDir . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/IdP.php', 'SimpleSAML\\IdP\\IFrameLogoutHandler' => $vendorDir . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/IdP/IFrameLogoutHandler.php', 'SimpleSAML\\IdP\\LogoutHandlerInterface' => $vendorDir . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/IdP/LogoutHandlerInterface.php', 'SimpleSAML\\IdP\\TraditionalLogoutHandler' => $vendorDir . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/IdP/TraditionalLogoutHandler.php', @@ -3976,16 +4023,31 @@ 'SimpleSAML\\Logger\\LoggingHandlerInterface' => $vendorDir . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Logger/LoggingHandlerInterface.php', 'SimpleSAML\\Logger\\StandardErrorLoggingHandler' => $vendorDir . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Logger/StandardErrorLoggingHandler.php', 'SimpleSAML\\Logger\\SyslogLoggingHandler' => $vendorDir . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Logger/SyslogLoggingHandler.php', + 'SimpleSAML\\Memcache' => $vendorDir . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Memcache.php', + 'SimpleSAML\\Metadata\\MetaDataStorageHandler' => $vendorDir . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Metadata/MetaDataStorageHandler.php', + 'SimpleSAML\\Metadata\\MetaDataStorageHandlerFlatFile' => $vendorDir . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Metadata/MetaDataStorageHandlerFlatFile.php', + 'SimpleSAML\\Metadata\\MetaDataStorageHandlerPdo' => $vendorDir . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Metadata/MetaDataStorageHandlerPdo.php', + 'SimpleSAML\\Metadata\\MetaDataStorageHandlerSerialize' => $vendorDir . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Metadata/MetaDataStorageHandlerSerialize.php', + 'SimpleSAML\\Metadata\\MetaDataStorageHandlerXML' => $vendorDir . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Metadata/MetaDataStorageHandlerXML.php', + 'SimpleSAML\\Metadata\\MetaDataStorageSource' => $vendorDir . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Metadata/MetaDataStorageSource.php', + 'SimpleSAML\\Metadata\\SAMLBuilder' => $vendorDir . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Metadata/SAMLBuilder.php', + 'SimpleSAML\\Metadata\\SAMLParser' => $vendorDir . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Metadata/SAMLParser.php', + 'SimpleSAML\\Metadata\\Signer' => $vendorDir . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Metadata/Signer.php', 'SimpleSAML\\Metadata\\Sources\\MDQ' => $vendorDir . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Metadata/Sources/MDQ.php', 'SimpleSAML\\Module' => $vendorDir . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Module.php', + 'SimpleSAML\\Module\\ControllerResolver' => $vendorDir . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Module/ControllerResolver.php', + 'SimpleSAML\\Session' => $vendorDir . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Session.php', 'SimpleSAML\\SessionHandler' => $vendorDir . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/SessionHandler.php', 'SimpleSAML\\SessionHandlerCookie' => $vendorDir . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/SessionHandlerCookie.php', 'SimpleSAML\\SessionHandlerPHP' => $vendorDir . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/SessionHandlerPHP.php', 'SimpleSAML\\SessionHandlerStore' => $vendorDir . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/SessionHandlerStore.php', + 'SimpleSAML\\Stats' => $vendorDir . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Stats.php', + 'SimpleSAML\\Stats\\Output' => $vendorDir . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Stats/Output.php', 'SimpleSAML\\Store' => $vendorDir . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Store.php', 'SimpleSAML\\Store\\Memcache' => $vendorDir . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Store/Memcache.php', 'SimpleSAML\\Store\\Redis' => $vendorDir . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Store/Redis.php', 'SimpleSAML\\Store\\SQL' => $vendorDir . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Store/SQL.php', + 'SimpleSAML\\Utilities' => $vendorDir . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Utilities.php', 'SimpleSAML\\Utils\\Arrays' => $vendorDir . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Utils/Arrays.php', 'SimpleSAML\\Utils\\Attributes' => $vendorDir . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Utils/Attributes.php', 'SimpleSAML\\Utils\\Auth' => $vendorDir . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Utils/Auth.php', @@ -3994,12 +4056,17 @@ 'SimpleSAML\\Utils\\Config\\Metadata' => $vendorDir . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Utils/Config/Metadata.php', 'SimpleSAML\\Utils\\Crypto' => $vendorDir . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Utils/Crypto.php', 'SimpleSAML\\Utils\\HTTP' => $vendorDir . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Utils/HTTP.php', + 'SimpleSAML\\Utils\\HttpAdapter' => $vendorDir . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Utils/HttpAdapter.php', 'SimpleSAML\\Utils\\Net' => $vendorDir . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Utils/Net.php', 'SimpleSAML\\Utils\\Random' => $vendorDir . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Utils/Random.php', 'SimpleSAML\\Utils\\System' => $vendorDir . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Utils/System.php', 'SimpleSAML\\Utils\\Time' => $vendorDir . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Utils/Time.php', 'SimpleSAML\\Utils\\XML' => $vendorDir . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Utils/XML.php', + 'SimpleSAML\\XHTML\\EMail' => $vendorDir . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/XHTML/EMail.php', + 'SimpleSAML\\XHTML\\IdPDisco' => $vendorDir . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/XHTML/IdPDisco.php', + 'SimpleSAML\\XHTML\\Template' => $vendorDir . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/XHTML/Template.php', 'SimpleSAML\\XHTML\\TemplateControllerInterface' => $vendorDir . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/XHTML/TemplateControllerInterface.php', + 'SimpleSAML\\XHTML\\TemplateLoader' => $vendorDir . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/XHTML/TemplateLoader.php', 'SimpleSAML\\XML\\Errors' => $vendorDir . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/XML/Errors.php', 'SimpleSAML\\XML\\Parser' => $vendorDir . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/XML/Parser.php', 'SimpleSAML\\XML\\Shib13\\AuthnRequest' => $vendorDir . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/XML/Shib13/AuthnRequest.php', diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php index f778fecf9a..6e1a6a9424 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -3705,26 +3705,36 @@ class ComposerStaticInit5c689ffcd54b9e495ed983fdce09b530 'Error' => __DIR__ . '/..' . '/symfony/polyfill-php70/Resources/stubs/Error.php', 'Gettext\\BaseTranslator' => __DIR__ . '/..' . '/gettext/gettext/src/BaseTranslator.php', 'Gettext\\Extractors\\Blade' => __DIR__ . '/..' . '/gettext/gettext/src/Extractors/Blade.php', + 'Gettext\\Extractors\\Csv' => __DIR__ . '/..' . '/gettext/gettext/src/Extractors/Csv.php', 'Gettext\\Extractors\\CsvDictionary' => __DIR__ . '/..' . '/gettext/gettext/src/Extractors/CsvDictionary.php', 'Gettext\\Extractors\\Extractor' => __DIR__ . '/..' . '/gettext/gettext/src/Extractors/Extractor.php', 'Gettext\\Extractors\\ExtractorInterface' => __DIR__ . '/..' . '/gettext/gettext/src/Extractors/ExtractorInterface.php', + 'Gettext\\Extractors\\ExtractorMultiInterface' => __DIR__ . '/..' . '/gettext/gettext/src/Extractors/ExtractorMultiInterface.php', 'Gettext\\Extractors\\Jed' => __DIR__ . '/..' . '/gettext/gettext/src/Extractors/Jed.php', 'Gettext\\Extractors\\JsCode' => __DIR__ . '/..' . '/gettext/gettext/src/Extractors/JsCode.php', + 'Gettext\\Extractors\\Json' => __DIR__ . '/..' . '/gettext/gettext/src/Extractors/Json.php', 'Gettext\\Extractors\\JsonDictionary' => __DIR__ . '/..' . '/gettext/gettext/src/Extractors/JsonDictionary.php', 'Gettext\\Extractors\\Mo' => __DIR__ . '/..' . '/gettext/gettext/src/Extractors/Mo.php', 'Gettext\\Extractors\\PhpArray' => __DIR__ . '/..' . '/gettext/gettext/src/Extractors/PhpArray.php', 'Gettext\\Extractors\\PhpCode' => __DIR__ . '/..' . '/gettext/gettext/src/Extractors/PhpCode.php', 'Gettext\\Extractors\\Po' => __DIR__ . '/..' . '/gettext/gettext/src/Extractors/Po.php', 'Gettext\\Extractors\\Twig' => __DIR__ . '/..' . '/gettext/gettext/src/Extractors/Twig.php', + 'Gettext\\Extractors\\VueJs' => __DIR__ . '/..' . '/gettext/gettext/src/Extractors/VueJs.php', + 'Gettext\\Extractors\\Xliff' => __DIR__ . '/..' . '/gettext/gettext/src/Extractors/Xliff.php', + 'Gettext\\Extractors\\Yaml' => __DIR__ . '/..' . '/gettext/gettext/src/Extractors/Yaml.php', 'Gettext\\Extractors\\YamlDictionary' => __DIR__ . '/..' . '/gettext/gettext/src/Extractors/YamlDictionary.php', + 'Gettext\\Generators\\Csv' => __DIR__ . '/..' . '/gettext/gettext/src/Generators/Csv.php', 'Gettext\\Generators\\CsvDictionary' => __DIR__ . '/..' . '/gettext/gettext/src/Generators/CsvDictionary.php', 'Gettext\\Generators\\Generator' => __DIR__ . '/..' . '/gettext/gettext/src/Generators/Generator.php', 'Gettext\\Generators\\GeneratorInterface' => __DIR__ . '/..' . '/gettext/gettext/src/Generators/GeneratorInterface.php', 'Gettext\\Generators\\Jed' => __DIR__ . '/..' . '/gettext/gettext/src/Generators/Jed.php', + 'Gettext\\Generators\\Json' => __DIR__ . '/..' . '/gettext/gettext/src/Generators/Json.php', 'Gettext\\Generators\\JsonDictionary' => __DIR__ . '/..' . '/gettext/gettext/src/Generators/JsonDictionary.php', 'Gettext\\Generators\\Mo' => __DIR__ . '/..' . '/gettext/gettext/src/Generators/Mo.php', 'Gettext\\Generators\\PhpArray' => __DIR__ . '/..' . '/gettext/gettext/src/Generators/PhpArray.php', 'Gettext\\Generators\\Po' => __DIR__ . '/..' . '/gettext/gettext/src/Generators/Po.php', + 'Gettext\\Generators\\Xliff' => __DIR__ . '/..' . '/gettext/gettext/src/Generators/Xliff.php', + 'Gettext\\Generators\\Yaml' => __DIR__ . '/..' . '/gettext/gettext/src/Generators/Yaml.php', 'Gettext\\Generators\\YamlDictionary' => __DIR__ . '/..' . '/gettext/gettext/src/Generators/YamlDictionary.php', 'Gettext\\GettextTranslator' => __DIR__ . '/..' . '/gettext/gettext/src/GettextTranslator.php', 'Gettext\\Languages\\Category' => __DIR__ . '/..' . '/gettext/languages/src/Category.php', @@ -3739,12 +3749,19 @@ class ComposerStaticInit5c689ffcd54b9e495ed983fdce09b530 'Gettext\\Languages\\Exporter\\Xml' => __DIR__ . '/..' . '/gettext/languages/src/Exporter/Xml.php', 'Gettext\\Languages\\FormulaConverter' => __DIR__ . '/..' . '/gettext/languages/src/FormulaConverter.php', 'Gettext\\Languages\\Language' => __DIR__ . '/..' . '/gettext/languages/src/Language.php', + 'Gettext\\Merge' => __DIR__ . '/..' . '/gettext/gettext/src/Merge.php', 'Gettext\\Translation' => __DIR__ . '/..' . '/gettext/gettext/src/Translation.php', 'Gettext\\Translations' => __DIR__ . '/..' . '/gettext/gettext/src/Translations.php', 'Gettext\\Translator' => __DIR__ . '/..' . '/gettext/gettext/src/Translator.php', 'Gettext\\TranslatorInterface' => __DIR__ . '/..' . '/gettext/gettext/src/TranslatorInterface.php', + 'Gettext\\Utils\\CsvTrait' => __DIR__ . '/..' . '/gettext/gettext/src/Utils/CsvTrait.php', + 'Gettext\\Utils\\DictionaryTrait' => __DIR__ . '/..' . '/gettext/gettext/src/Utils/DictionaryTrait.php', 'Gettext\\Utils\\FunctionsScanner' => __DIR__ . '/..' . '/gettext/gettext/src/Utils/FunctionsScanner.php', + 'Gettext\\Utils\\HeadersExtractorTrait' => __DIR__ . '/..' . '/gettext/gettext/src/Utils/HeadersExtractorTrait.php', + 'Gettext\\Utils\\HeadersGeneratorTrait' => __DIR__ . '/..' . '/gettext/gettext/src/Utils/HeadersGeneratorTrait.php', 'Gettext\\Utils\\JsFunctionsScanner' => __DIR__ . '/..' . '/gettext/gettext/src/Utils/JsFunctionsScanner.php', + 'Gettext\\Utils\\MultidimensionalArrayTrait' => __DIR__ . '/..' . '/gettext/gettext/src/Utils/MultidimensionalArrayTrait.php', + 'Gettext\\Utils\\ParsedComment' => __DIR__ . '/..' . '/gettext/gettext/src/Utils/ParsedComment.php', 'Gettext\\Utils\\ParsedFunction' => __DIR__ . '/..' . '/gettext/gettext/src/Utils/ParsedFunction.php', 'Gettext\\Utils\\PhpFunctionsScanner' => __DIR__ . '/..' . '/gettext/gettext/src/Utils/PhpFunctionsScanner.php', 'Gettext\\Utils\\StringReader' => __DIR__ . '/..' . '/gettext/gettext/src/Utils/StringReader.php', @@ -4274,6 +4291,7 @@ class ComposerStaticInit5c689ffcd54b9e495ed983fdce09b530 'Psy\\VersionUpdater\\GitHubChecker' => __DIR__ . '/..' . '/psy/psysh/src/VersionUpdater/GitHubChecker.php', 'Psy\\VersionUpdater\\IntervalChecker' => __DIR__ . '/..' . '/psy/psysh/src/VersionUpdater/IntervalChecker.php', 'Psy\\VersionUpdater\\NoopChecker' => __DIR__ . '/..' . '/psy/psysh/src/VersionUpdater/NoopChecker.php', + 'RobRichards\\XMLSecLibs\\Utils\\XPath' => __DIR__ . '/..' . '/robrichards/xmlseclibs/src/Utils/XPath.php', 'RobRichards\\XMLSecLibs\\XMLSecEnc' => __DIR__ . '/..' . '/robrichards/xmlseclibs/src/XMLSecEnc.php', 'RobRichards\\XMLSecLibs\\XMLSecurityDSig' => __DIR__ . '/..' . '/robrichards/xmlseclibs/src/XMLSecurityDSig.php', 'RobRichards\\XMLSecLibs\\XMLSecurityKey' => __DIR__ . '/..' . '/robrichards/xmlseclibs/src/XMLSecurityKey.php', @@ -4605,15 +4623,44 @@ class ComposerStaticInit5c689ffcd54b9e495ed983fdce09b530 'SAML2\\XML\\shibmd\\Scope' => __DIR__ . '/..' . '/simplesamlphp/saml2/src/SAML2/XML/shibmd/Scope.php', 'SelfUpdate\\SelfUpdateCommand' => __DIR__ . '/..' . '/consolidation/self-update/src/SelfUpdateCommand.php', 'SessionUpdateTimestampHandlerInterface' => __DIR__ . '/..' . '/symfony/polyfill-php70/Resources/stubs/SessionUpdateTimestampHandlerInterface.php', + 'SimpleSAML\\AuthMemCookie' => __DIR__ . '/..' . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/AuthMemCookie.php', + 'SimpleSAML\\Auth\\AuthenticationFactory' => __DIR__ . '/..' . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Auth/AuthenticationFactory.php', + 'SimpleSAML\\Auth\\DefaultAuth' => __DIR__ . '/..' . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Auth/Default.php', + 'SimpleSAML\\Auth\\LDAP' => __DIR__ . '/..' . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Auth/LDAP.php', + 'SimpleSAML\\Auth\\ProcessingChain' => __DIR__ . '/..' . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Auth/ProcessingChain.php', + 'SimpleSAML\\Auth\\ProcessingFilter' => __DIR__ . '/..' . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Auth/ProcessingFilter.php', 'SimpleSAML\\Auth\\Simple' => __DIR__ . '/..' . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Auth/Simple.php', + 'SimpleSAML\\Auth\\Source' => __DIR__ . '/..' . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Auth/Source.php', + 'SimpleSAML\\Auth\\SourceFactory' => __DIR__ . '/..' . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Auth/SourceFactory.php', + 'SimpleSAML\\Auth\\State' => __DIR__ . '/..' . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Auth/State.php', 'SimpleSAML\\Auth\\TimeLimitedToken' => __DIR__ . '/..' . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Auth/TimeLimitedToken.php', 'SimpleSAML\\Bindings\\Shib13\\Artifact' => __DIR__ . '/..' . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Bindings/Shib13/Artifact.php', 'SimpleSAML\\Bindings\\Shib13\\HTTPPost' => __DIR__ . '/..' . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Bindings/Shib13/HTTPPost.php', + 'SimpleSAML\\Configuration' => __DIR__ . '/..' . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Configuration.php', 'SimpleSAML\\Database' => __DIR__ . '/..' . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Database.php', + 'SimpleSAML\\Error\\Assertion' => __DIR__ . '/..' . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Error/Assertion.php', + 'SimpleSAML\\Error\\AuthSource' => __DIR__ . '/..' . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Error/AuthSource.php', + 'SimpleSAML\\Error\\BadRequest' => __DIR__ . '/..' . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Error/BadRequest.php', + 'SimpleSAML\\Error\\BadUserInput' => __DIR__ . '/..' . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Error/BadUserInput.php', 'SimpleSAML\\Error\\CannotSetCookie' => __DIR__ . '/..' . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Error/CannotSetCookie.php', 'SimpleSAML\\Error\\ConfigurationError' => __DIR__ . '/..' . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Error/ConfigurationError.php', 'SimpleSAML\\Error\\CriticalConfigurationError' => __DIR__ . '/..' . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Error/CriticalConfigurationError.php', + 'SimpleSAML\\Error\\Error' => __DIR__ . '/..' . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Error/Error.php', 'SimpleSAML\\Error\\ErrorCodes' => __DIR__ . '/..' . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Error/ErrorCodes.php', + 'SimpleSAML\\Error\\Exception' => __DIR__ . '/..' . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Error/Exception.php', + 'SimpleSAML\\Error\\InvalidCredential' => __DIR__ . '/..' . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Error/InvalidCredential.php', + 'SimpleSAML\\Error\\MetadataNotFound' => __DIR__ . '/..' . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Error/MetadataNotFound.php', + 'SimpleSAML\\Error\\NoPassive' => __DIR__ . '/..' . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Error/NoPassive.php', + 'SimpleSAML\\Error\\NoState' => __DIR__ . '/..' . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Error/NoState.php', + 'SimpleSAML\\Error\\NotFound' => __DIR__ . '/..' . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Error/NotFound.php', + 'SimpleSAML\\Error\\ProxyCountExceeded' => __DIR__ . '/..' . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Error/ProxyCountExceeded.php', + 'SimpleSAML\\Error\\UnserializableException' => __DIR__ . '/..' . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Error/UnserializableException.php', + 'SimpleSAML\\Error\\User' => __DIR__ . '/..' . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Error/User.php', + 'SimpleSAML\\Error\\UserAborted' => __DIR__ . '/..' . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Error/UserAborted.php', + 'SimpleSAML\\Error\\UserNotFound' => __DIR__ . '/..' . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Error/UserNotFound.php', + 'SimpleSAML\\HTTP\\Router' => __DIR__ . '/..' . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/HTTP/Router.php', + 'SimpleSAML\\HTTP\\RunnableResponse' => __DIR__ . '/..' . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/HTTP/RunnableResponse.php', + 'SimpleSAML\\IdP' => __DIR__ . '/..' . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/IdP.php', 'SimpleSAML\\IdP\\IFrameLogoutHandler' => __DIR__ . '/..' . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/IdP/IFrameLogoutHandler.php', 'SimpleSAML\\IdP\\LogoutHandlerInterface' => __DIR__ . '/..' . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/IdP/LogoutHandlerInterface.php', 'SimpleSAML\\IdP\\TraditionalLogoutHandler' => __DIR__ . '/..' . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/IdP/TraditionalLogoutHandler.php', @@ -4626,16 +4673,31 @@ class ComposerStaticInit5c689ffcd54b9e495ed983fdce09b530 'SimpleSAML\\Logger\\LoggingHandlerInterface' => __DIR__ . '/..' . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Logger/LoggingHandlerInterface.php', 'SimpleSAML\\Logger\\StandardErrorLoggingHandler' => __DIR__ . '/..' . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Logger/StandardErrorLoggingHandler.php', 'SimpleSAML\\Logger\\SyslogLoggingHandler' => __DIR__ . '/..' . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Logger/SyslogLoggingHandler.php', + 'SimpleSAML\\Memcache' => __DIR__ . '/..' . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Memcache.php', + 'SimpleSAML\\Metadata\\MetaDataStorageHandler' => __DIR__ . '/..' . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Metadata/MetaDataStorageHandler.php', + 'SimpleSAML\\Metadata\\MetaDataStorageHandlerFlatFile' => __DIR__ . '/..' . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Metadata/MetaDataStorageHandlerFlatFile.php', + 'SimpleSAML\\Metadata\\MetaDataStorageHandlerPdo' => __DIR__ . '/..' . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Metadata/MetaDataStorageHandlerPdo.php', + 'SimpleSAML\\Metadata\\MetaDataStorageHandlerSerialize' => __DIR__ . '/..' . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Metadata/MetaDataStorageHandlerSerialize.php', + 'SimpleSAML\\Metadata\\MetaDataStorageHandlerXML' => __DIR__ . '/..' . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Metadata/MetaDataStorageHandlerXML.php', + 'SimpleSAML\\Metadata\\MetaDataStorageSource' => __DIR__ . '/..' . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Metadata/MetaDataStorageSource.php', + 'SimpleSAML\\Metadata\\SAMLBuilder' => __DIR__ . '/..' . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Metadata/SAMLBuilder.php', + 'SimpleSAML\\Metadata\\SAMLParser' => __DIR__ . '/..' . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Metadata/SAMLParser.php', + 'SimpleSAML\\Metadata\\Signer' => __DIR__ . '/..' . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Metadata/Signer.php', 'SimpleSAML\\Metadata\\Sources\\MDQ' => __DIR__ . '/..' . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Metadata/Sources/MDQ.php', 'SimpleSAML\\Module' => __DIR__ . '/..' . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Module.php', + 'SimpleSAML\\Module\\ControllerResolver' => __DIR__ . '/..' . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Module/ControllerResolver.php', + 'SimpleSAML\\Session' => __DIR__ . '/..' . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Session.php', 'SimpleSAML\\SessionHandler' => __DIR__ . '/..' . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/SessionHandler.php', 'SimpleSAML\\SessionHandlerCookie' => __DIR__ . '/..' . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/SessionHandlerCookie.php', 'SimpleSAML\\SessionHandlerPHP' => __DIR__ . '/..' . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/SessionHandlerPHP.php', 'SimpleSAML\\SessionHandlerStore' => __DIR__ . '/..' . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/SessionHandlerStore.php', + 'SimpleSAML\\Stats' => __DIR__ . '/..' . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Stats.php', + 'SimpleSAML\\Stats\\Output' => __DIR__ . '/..' . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Stats/Output.php', 'SimpleSAML\\Store' => __DIR__ . '/..' . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Store.php', 'SimpleSAML\\Store\\Memcache' => __DIR__ . '/..' . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Store/Memcache.php', 'SimpleSAML\\Store\\Redis' => __DIR__ . '/..' . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Store/Redis.php', 'SimpleSAML\\Store\\SQL' => __DIR__ . '/..' . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Store/SQL.php', + 'SimpleSAML\\Utilities' => __DIR__ . '/..' . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Utilities.php', 'SimpleSAML\\Utils\\Arrays' => __DIR__ . '/..' . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Utils/Arrays.php', 'SimpleSAML\\Utils\\Attributes' => __DIR__ . '/..' . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Utils/Attributes.php', 'SimpleSAML\\Utils\\Auth' => __DIR__ . '/..' . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Utils/Auth.php', @@ -4644,12 +4706,17 @@ class ComposerStaticInit5c689ffcd54b9e495ed983fdce09b530 'SimpleSAML\\Utils\\Config\\Metadata' => __DIR__ . '/..' . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Utils/Config/Metadata.php', 'SimpleSAML\\Utils\\Crypto' => __DIR__ . '/..' . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Utils/Crypto.php', 'SimpleSAML\\Utils\\HTTP' => __DIR__ . '/..' . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Utils/HTTP.php', + 'SimpleSAML\\Utils\\HttpAdapter' => __DIR__ . '/..' . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Utils/HttpAdapter.php', 'SimpleSAML\\Utils\\Net' => __DIR__ . '/..' . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Utils/Net.php', 'SimpleSAML\\Utils\\Random' => __DIR__ . '/..' . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Utils/Random.php', 'SimpleSAML\\Utils\\System' => __DIR__ . '/..' . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Utils/System.php', 'SimpleSAML\\Utils\\Time' => __DIR__ . '/..' . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Utils/Time.php', 'SimpleSAML\\Utils\\XML' => __DIR__ . '/..' . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/Utils/XML.php', + 'SimpleSAML\\XHTML\\EMail' => __DIR__ . '/..' . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/XHTML/EMail.php', + 'SimpleSAML\\XHTML\\IdPDisco' => __DIR__ . '/..' . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/XHTML/IdPDisco.php', + 'SimpleSAML\\XHTML\\Template' => __DIR__ . '/..' . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/XHTML/Template.php', 'SimpleSAML\\XHTML\\TemplateControllerInterface' => __DIR__ . '/..' . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/XHTML/TemplateControllerInterface.php', + 'SimpleSAML\\XHTML\\TemplateLoader' => __DIR__ . '/..' . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/XHTML/TemplateLoader.php', 'SimpleSAML\\XML\\Errors' => __DIR__ . '/..' . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/XML/Errors.php', 'SimpleSAML\\XML\\Parser' => __DIR__ . '/..' . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/XML/Parser.php', 'SimpleSAML\\XML\\Shib13\\AuthnRequest' => __DIR__ . '/..' . '/simplesamlphp/simplesamlphp/lib/SimpleSAML/XML/Shib13/AuthnRequest.php', diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index c3eac2a119..0a8b45f3c0 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -1312,7 +1312,8 @@ "MIT" ], "description": "Promoting the interoperability of container objects (DIC, SL, etc.)", - "homepage": "https://github.com/container-interop/container-interop" + "homepage": "https://github.com/container-interop/container-interop", + "abandoned": "psr/container" }, { "name": "cweagans/composer-patches", @@ -7443,23 +7444,23 @@ }, { "name": "drupal/simplesamlphp_auth", - "version": "3.0.0", - "version_normalized": "3.0.0.0", + "version": "3.1.0", + "version_normalized": "3.1.0.0", "source": { "type": "git", "url": "https://git.drupalcode.org/project/simplesamlphp_auth.git", - "reference": "8.x-3.0" + "reference": "8.x-3.1" }, "dist": { "type": "zip", - "url": "https://ftp.drupal.org/files/projects/simplesamlphp_auth-8.x-3.0.zip", - "reference": "8.x-3.0", - "shasum": "2ee230173df2128edb5d72953222d229dabf27e7" + "url": "https://ftp.drupal.org/files/projects/simplesamlphp_auth-8.x-3.1.zip", + "reference": "8.x-3.1", + "shasum": "db464b1a4716ad21e7f2ec141640691b8d040d59" }, "require": { "drupal/core": "*", - "drupal/externalauth": "*", - "simplesamlphp/simplesamlphp": "~1.15" + "drupal/externalauth": "^1.1", + "simplesamlphp/simplesamlphp": "~1.17.2" }, "type": "drupal-module", "extra": { @@ -7467,8 +7468,8 @@ "dev-3.x": "3.x-dev" }, "drupal": { - "version": "8.x-3.0", - "datestamp": "1521252787", + "version": "8.x-3.1", + "datestamp": "1565118485", "security-coverage": { "status": "covered", "message": "Covered by Drupal's security advisory policy" @@ -7481,6 +7482,10 @@ "GPL-2.0+" ], "authors": [ + { + "name": "Berdir", + "homepage": "https://www.drupal.org/user/214652" + }, { "name": "colan", "homepage": "https://www.drupal.org/user/58704" @@ -7505,7 +7510,7 @@ "description": "Allows users to authenticate to a remote SAML identity provider (IdP) via a locally configured SimpleSAMLphp service point (SP).", "homepage": "https://www.drupal.org/project/simplesamlphp_auth", "support": { - "source": "http://cgit.drupalcode.org/simplesamlphp_auth" + "source": "https://git.drupalcode.org/project/simplesamlphp_auth" } }, { @@ -9152,28 +9157,30 @@ }, { "name": "gettext/gettext", - "version": "v3.6.1", - "version_normalized": "3.6.1.0", + "version": "v4.8.2", + "version_normalized": "4.8.2.0", "source": { "type": "git", - "url": "https://github.com/oscarotero/Gettext.git", - "reference": "cd3be64443551e3a693117c4bccbe53e36282456" + "url": "https://github.com/php-gettext/Gettext.git", + "reference": "e474f872f2c8636cf53fd283ec4ce1218f3d236a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/oscarotero/Gettext/zipball/cd3be64443551e3a693117c4bccbe53e36282456", - "reference": "cd3be64443551e3a693117c4bccbe53e36282456", + "url": "https://api.github.com/repos/php-gettext/Gettext/zipball/e474f872f2c8636cf53fd283ec4ce1218f3d236a", + "reference": "e474f872f2c8636cf53fd283ec4ce1218f3d236a", "shasum": "" }, "require": { - "gettext/languages": "2.*", - "php": ">=5.3.0" + "gettext/languages": "^2.3", + "php": ">=5.4.0" }, "require-dev": { "illuminate/view": "*", + "phpunit/phpunit": "^4.8|^5.7|^6.5", + "squizlabs/php_codesniffer": "^3.0", "symfony/yaml": "~2", "twig/extensions": "*", - "twig/twig": "*" + "twig/twig": "^1.31|^2.0" }, "suggest": { "illuminate/view": "Is necessary if you want to use the Blade extractor", @@ -9181,7 +9188,7 @@ "twig/extensions": "Is necessary if you want to use the Twig extractor", "twig/twig": "Is necessary if you want to use the Twig extractor" }, - "time": "2016-08-01T18:09:57+00:00", + "time": "2019-12-02T10:21:14+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -9214,29 +9221,29 @@ }, { "name": "gettext/languages", - "version": "2.4.0", - "version_normalized": "2.4.0.0", + "version": "2.6.0", + "version_normalized": "2.6.0.0", "source": { "type": "git", - "url": "https://github.com/mlocati/cldr-to-gettext-plural-rules.git", - "reference": "1b74377bd0c4cd87e8d72b948f5d8867e23505a5" + "url": "https://github.com/php-gettext/Languages.git", + "reference": "38ea0482f649e0802e475f0ed19fa993bcb7a618" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/mlocati/cldr-to-gettext-plural-rules/zipball/1b74377bd0c4cd87e8d72b948f5d8867e23505a5", - "reference": "1b74377bd0c4cd87e8d72b948f5d8867e23505a5", + "url": "https://api.github.com/repos/php-gettext/Languages/zipball/38ea0482f649e0802e475f0ed19fa993bcb7a618", + "reference": "38ea0482f649e0802e475f0ed19fa993bcb7a618", "shasum": "" }, "require": { "php": ">=5.3" }, "require-dev": { - "phpunit/phpunit": "^4" + "friendsofphp/php-cs-fixer": "^2.16.0", + "phpunit/phpunit": "^4.8 || ^5.7 || ^6.5 || ^7.5 || ^8.4" }, - "time": "2018-06-21T15:58:36+00:00", + "time": "2019-11-13T10:30:21+00:00", "bin": [ - "bin/export-plural-rules", - "bin/export-plural-rules.php" + "bin/export-plural-rules" ], "type": "library", "installation-source": "dist", @@ -9257,7 +9264,7 @@ } ], "description": "gettext languages with plural rules", - "homepage": "https://github.com/mlocati/cldr-to-gettext-plural-rules", + "homepage": "https://github.com/php-gettext/Languages", "keywords": [ "cldr", "i18n", @@ -9621,23 +9628,27 @@ }, { "name": "jaimeperez/twig-configurable-i18n", - "version": "v1.2", - "version_normalized": "1.2.0.0", + "version": "v2.1", + "version_normalized": "2.1.0.0", "source": { "type": "git", "url": "https://github.com/jaimeperez/twig-configurable-i18n.git", - "reference": "75d4926fd102c9e62219ad7f94a6136d2f2ccd93" + "reference": "38a22aaa6b31efdc0d76d58f5934dea3ebac8556" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/jaimeperez/twig-configurable-i18n/zipball/75d4926fd102c9e62219ad7f94a6136d2f2ccd93", - "reference": "75d4926fd102c9e62219ad7f94a6136d2f2ccd93", + "url": "https://api.github.com/repos/jaimeperez/twig-configurable-i18n/zipball/38a22aaa6b31efdc0d76d58f5934dea3ebac8556", + "reference": "38a22aaa6b31efdc0d76d58f5934dea3ebac8556", "shasum": "" }, "require": { - "twig/extensions": "^1.3" + "twig/extensions": "^1.5" + }, + "require-dev": { + "phpunit/phpunit": "~4.8.36", + "twig/twig": "^1.37 || ^2.7" }, - "time": "2016-10-03T12:34:15+00:00", + "time": "2019-06-07T11:03:28+00:00", "type": "project", "installation-source": "dist", "autoload": { @@ -10535,27 +10546,27 @@ }, { "name": "psr/log", - "version": "1.1.0", - "version_normalized": "1.1.0.0", + "version": "1.1.2", + "version_normalized": "1.1.2.0", "source": { "type": "git", "url": "https://github.com/php-fig/log.git", - "reference": "6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd" + "reference": "446d54b4cb6bf489fc9d75f55843658e6f25d801" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd", - "reference": "6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd", + "url": "https://api.github.com/repos/php-fig/log/zipball/446d54b4cb6bf489fc9d75f55843658e6f25d801", + "reference": "446d54b4cb6bf489fc9d75f55843658e6f25d801", "shasum": "" }, "require": { "php": ">=5.3.0" }, - "time": "2018-11-20T15:27:04+00:00", + "time": "2019-11-01T11:05:21+00:00", "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "1.1.x-dev" } }, "installation-source": "dist", @@ -10702,26 +10713,24 @@ }, { "name": "robrichards/xmlseclibs", - "version": "3.0.1", - "version_normalized": "3.0.1.0", + "version": "3.0.4", + "version_normalized": "3.0.4.0", "source": { "type": "git", "url": "https://github.com/robrichards/xmlseclibs.git", - "reference": "d937712f70f93a584eb0299ccd87dc6374003781" + "reference": "0a53d3c3aa87564910cae4ed01416441d3ae0db5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/robrichards/xmlseclibs/zipball/d937712f70f93a584eb0299ccd87dc6374003781", - "reference": "d937712f70f93a584eb0299ccd87dc6374003781", + "url": "https://api.github.com/repos/robrichards/xmlseclibs/zipball/0a53d3c3aa87564910cae4ed01416441d3ae0db5", + "reference": "0a53d3c3aa87564910cae4ed01416441d3ae0db5", "shasum": "" }, "require": { + "ext-openssl": "*", "php": ">= 5.4" }, - "suggest": { - "ext-openssl": "OpenSSL extension" - }, - "time": "2017-08-31T09:27:07+00:00", + "time": "2019-11-05T11:44:22+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -10784,17 +10793,17 @@ }, { "name": "simplesamlphp/saml2", - "version": "v3.1.6", - "version_normalized": "3.1.6.0", + "version": "v3.4.2", + "version_normalized": "3.4.2.0", "source": { "type": "git", "url": "https://github.com/simplesamlphp/saml2.git", - "reference": "d809ffbe2aa7260a0b3e72bf5be8cd6de0325d7c" + "reference": "3806d276edb066c60aa3d748ffd0681d92ffbda7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/simplesamlphp/saml2/zipball/d809ffbe2aa7260a0b3e72bf5be8cd6de0325d7c", - "reference": "d809ffbe2aa7260a0b3e72bf5be8cd6de0325d7c", + "url": "https://api.github.com/repos/simplesamlphp/saml2/zipball/3806d276edb066c60aa3d748ffd0681d92ffbda7", + "reference": "3806d276edb066c60aa3d748ffd0681d92ffbda7", "shasum": "" }, "require": { @@ -10803,17 +10812,19 @@ "ext-zlib": "*", "php": ">=5.4", "psr/log": "~1.0", - "robrichards/xmlseclibs": "^3.0" + "robrichards/xmlseclibs": "^3.0.4", + "webmozart/assert": "^1.4" }, "require-dev": { "mockery/mockery": "~0.9", - "phpmd/phpmd": "~1.5", - "phpunit/phpunit": "~4", - "sebastian/phpcpd": "~1.4", - "sensiolabs/security-checker": "~1.1", - "squizlabs/php_codesniffer": "~1.4" - }, - "time": "2018-05-04T12:03:18+00:00", + "phpmd/phpmd": "~2.6", + "phpunit/phpunit": "~5.7", + "sebastian/phpcpd": "~2.0", + "sensiolabs/security-checker": "~4.1", + "simplesamlphp/simplesamlphp-test-framework": "0.0.11", + "squizlabs/php_codesniffer": "~3.2" + }, + "time": "2019-11-06T10:00:32+00:00", "type": "library", "extra": { "branch-alias": { @@ -10843,17 +10854,17 @@ }, { "name": "simplesamlphp/simplesamlphp", - "version": "v1.15.4", - "version_normalized": "1.15.4.0", + "version": "v1.17.8", + "version_normalized": "1.17.8.0", "source": { "type": "git", "url": "https://github.com/simplesamlphp/simplesamlphp.git", - "reference": "c770d0cd392ba8d8b12ac6214dcabd818d7cca32" + "reference": "295937ae8672278cad73ec2c78af3749426263de" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/simplesamlphp/simplesamlphp/zipball/c770d0cd392ba8d8b12ac6214dcabd818d7cca32", - "reference": "c770d0cd392ba8d8b12ac6214dcabd818d7cca32", + "url": "https://api.github.com/repos/simplesamlphp/simplesamlphp/zipball/295937ae8672278cad73ec2c78af3749426263de", + "reference": "295937ae8672278cad73ec2c78af3749426263de", "shasum": "" }, "require": { @@ -10866,20 +10877,36 @@ "ext-pcre": "*", "ext-spl": "*", "ext-zlib": "*", - "gettext/gettext": "^3.5", - "jaimeperez/twig-configurable-i18n": "^1.2", - "php": ">=5.4", - "robrichards/xmlseclibs": "~3.0", - "simplesamlphp/saml2": "~3.1.4", - "twig/twig": "~1.0", + "gettext/gettext": "^4.6", + "jaimeperez/twig-configurable-i18n": "^2.0", + "php": ">=5.5", + "robrichards/xmlseclibs": "^3.0.4", + "simplesamlphp/saml2": "^3.3", + "symfony/config": "^3.4 || ^4.0", + "symfony/dependency-injection": "^3.4 || ^4.0", + "symfony/http-foundation": "^3.4 || ^4.0", + "symfony/http-kernel": "^3.4 || ^4.0", + "symfony/routing": "^3.4 || ^4.0", + "symfony/yaml": "^3.4 || ^4.0", + "twig/twig": "~1.0 || ~2.0", "whitehat101/apr1-md5": "~1.0" }, "require-dev": { - "ext-pdo_sqlite": "*", + "ext-curl": "*", "mikey179/vfsstream": "~1.6", "phpunit/phpunit": "~4.8" }, - "time": "2018-03-02T15:02:24+00:00", + "suggest": { + "ext-curl": "Needed in order to check for updates automatically", + "ext-ldap": "Needed if an LDAP backend is used", + "ext-memcache": "Needed if a Memcache server is used to store session information", + "ext-mysql": "Needed if a MySQL backend is used, either for authentication or to store session information", + "ext-pdo": "Needed if a database backend is used, either for authentication or to store session information", + "ext-pgsql": "Needed if a PostgreSQL backend is used, either for authentication or to store session information", + "ext-radius": "Needed if a Radius backend is used", + "predis/predis": "Needed if a Redis server is used to store session information" + }, + "time": "2019-11-20T08:26:08+00:00", "type": "project", "installation-source": "dist", "autoload": { @@ -10895,14 +10922,14 @@ "LGPL-2.1-or-later" ], "authors": [ - { - "name": "Olav Morken", - "email": "olav.morken@uninett.no" - }, { "name": "Andreas Åkre Solberg", "email": "andreas.solberg@uninett.no" }, + { + "name": "Olav Morken", + "email": "olav.morken@uninett.no" + }, { "name": "Jaime Perez", "email": "jaime.perez@uninett.no" @@ -11838,17 +11865,17 @@ }, { "name": "symfony/polyfill-ctype", - "version": "v1.11.0", - "version_normalized": "1.11.0.0", + "version": "v1.13.1", + "version_normalized": "1.13.1.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "82ebae02209c21113908c229e9883c419720738a" + "reference": "f8f0b461be3385e56d6de3dbb5a0df24c0c275e3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/82ebae02209c21113908c229e9883c419720738a", - "reference": "82ebae02209c21113908c229e9883c419720738a", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/f8f0b461be3385e56d6de3dbb5a0df24c0c275e3", + "reference": "f8f0b461be3385e56d6de3dbb5a0df24c0c275e3", "shasum": "" }, "require": { @@ -11857,11 +11884,11 @@ "suggest": { "ext-ctype": "For best performance" }, - "time": "2019-02-06T07:57:58+00:00", + "time": "2019-11-27T13:56:44+00:00", "type": "library", "extra": { "branch-alias": { - "dev-master": "1.11-dev" + "dev-master": "1.13-dev" } }, "installation-source": "dist", @@ -11879,12 +11906,12 @@ ], "authors": [ { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" }, { - "name": "Gert de Pagter", - "email": "backendtea@gmail.com" + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], "description": "Symfony polyfill for ctype functions", @@ -12647,17 +12674,17 @@ }, { "name": "twig/extensions", - "version": "v1.5.2", - "version_normalized": "1.5.2.0", + "version": "v1.5.4", + "version_normalized": "1.5.4.0", "source": { "type": "git", "url": "https://github.com/twigphp/Twig-extensions.git", - "reference": "2c1a86526d0044065220d1b51ac08348bea5ca82" + "reference": "57873c8b0c1be51caa47df2cdb824490beb16202" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig-extensions/zipball/2c1a86526d0044065220d1b51ac08348bea5ca82", - "reference": "2c1a86526d0044065220d1b51ac08348bea5ca82", + "url": "https://api.github.com/repos/twigphp/Twig-extensions/zipball/57873c8b0c1be51caa47df2cdb824490beb16202", + "reference": "57873c8b0c1be51caa47df2cdb824490beb16202", "shasum": "" }, "require": { @@ -12670,7 +12697,7 @@ "suggest": { "symfony/translation": "Allow the time_diff output to be translated" }, - "time": "2018-05-22T13:26:07+00:00", + "time": "2018-12-05T18:34:18+00:00", "type": "library", "extra": { "branch-alias": { @@ -12704,29 +12731,29 @@ }, { "name": "twig/twig", - "version": "v1.42.2", - "version_normalized": "1.42.2.0", + "version": "v1.42.4", + "version_normalized": "1.42.4.0", "source": { "type": "git", "url": "https://github.com/twigphp/Twig.git", - "reference": "21707d6ebd05476854805e4f91b836531941bcd4" + "reference": "e587180584c3d2d6cb864a0454e777bb6dcb6152" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/21707d6ebd05476854805e4f91b836531941bcd4", - "reference": "21707d6ebd05476854805e4f91b836531941bcd4", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/e587180584c3d2d6cb864a0454e777bb6dcb6152", + "reference": "e587180584c3d2d6cb864a0454e777bb6dcb6152", "shasum": "" }, "require": { - "php": ">=5.4.0", + "php": ">=5.5.0", "symfony/polyfill-ctype": "^1.8" }, "require-dev": { "psr/container": "^1.0", - "symfony/debug": "^2.7", - "symfony/phpunit-bridge": "^3.4.19|^4.1.8|^5.0" + "symfony/debug": "^3.4|^4.2", + "symfony/phpunit-bridge": "^4.4@dev|^5.0" }, - "time": "2019-06-18T15:35:16+00:00", + "time": "2019-11-11T16:49:32+00:00", "type": "library", "extra": { "branch-alias": { @@ -12753,15 +12780,15 @@ "homepage": "http://fabien.potencier.org", "role": "Lead Developer" }, - { - "name": "Armin Ronacher", - "email": "armin.ronacher@active-4.com", - "role": "Project Founder" - }, { "name": "Twig Team", "homepage": "https://twig.symfony.com/contributors", "role": "Contributors" + }, + { + "name": "Armin Ronacher", + "email": "armin.ronacher@active-4.com", + "role": "Project Founder" } ], "description": "Twig, the flexible, fast, and secure template language for PHP", diff --git a/vendor/gettext/gettext/CHANGELOG.md b/vendor/gettext/gettext/CHANGELOG.md new file mode 100644 index 0000000000..d270cd8193 --- /dev/null +++ b/vendor/gettext/gettext/CHANGELOG.md @@ -0,0 +1,172 @@ +# Change Log + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](http://keepachangelog.com/) +and this project adheres to [Semantic Versioning](http://semver.org/). + +Previous releases are documented in [github releases](https://github.com/oscarotero/Gettext/releases) + +## [4.8.2] - 2019-12-02 +### Fixed +- UTF-8 handling for VueJs extractor [#242] + +## [4.8.1] - 2019-11-15 +### Fixed +- Php error when scanning for a single domain but other string found [#238] + +## [4.8.0] - 2019-11-04 +### Changed +- Many `private` properties and methods were changed to `protected` in order to improve the extensibility [#231] + +### Fixed +- PHP 7.4 support [#230] + +## [4.7.0] - 2019-10-07 +### Added +- Support for UnitID in Xliff [#221] [#224] [#225] +- Support for scan multiple domains at the same time [#223] + +### Fixed +- New lines in windows [#218] [#226] + +## [4.6.3] - 2019-07-15 +### Added +- Some VueJs extraction improvements and additions [#205], [#213] + +### Fixed +- Multiline extractions in jsCode [#200] +- Support for js template literals [#214] +- Fixed tabs in PHP comments [#215] + +## [4.6.2] - 2019-01-12 +### Added +- New option `facade` in blade extractor to use a facade instead create a blade compiler [#197], [#198] + +### Fixed +- Added php-7.3 to travis +- Added VueJS extractor method docblocks for IDEs [#191] + +## [4.6.1] - 2018-08-27 +### Fixed +- VueJS DOM parsing [#188] +- Javascript parser was unable to extract some functions [#187] + +## [4.6.0] - 2018-06-26 +### Added +- New extractor for VueJs [#178] + +### Fixed +- Do not include empty translations containing the headers in the translator [#182] +- Test enhancement [#177] + +## [4.5.0] - 2018-04-23 +### Added +- Support for disabled translations + +### Fixed +- Added php-7.2 to travis +- Fixed po tests on bigendian [#159] +- Improved comment estraction [#166] +- Fixed incorrect docs to dn__ function [#170] +- Ignored phpcs.xml file on export [#168] +- Improved `@method` docs in `Translations` [#175] + +## [4.4.4] - 2018-02-21 +### Fixed +- Changed the comment extraction to be compatible with gettext behaviour: the comment must be placed in the line preceding the function [#161] + +### Security +- Validate eval input from plural forms [#156] + +## [4.4.3] - 2017-08-09 +### Fixed +- Handle `NULL` arguments on extract entries in php. For example `dn__(null, 'singular', 'plural')`. +- Fixed the `PhpCode` and `JsCode` extractors that didn't extract `dn__` and `dngettext` entries [#155]. +- Fixed the `PhpCode` and `JsCode` extractors that didn't extract `dnpgettext` correctly. + +## [4.4.2] - 2017-07-27 +### Fixed +- Clone the translations in `Translations::mergeWith` to prevent that the translation is referenced in both places. [#152] +- Fixed escaped quotes in the javascript extractor [#154] + +## [4.4.1] - 2017-05-20 +### Fixed +- Fixed a bug where the options was not passed correctly to the merging Translations object [#147] +- Unified the plural behaviours between PHP gettext and Translator when the plural translation is unknown [#148] +- Removed the deprecated function `create_function()` and use `eval()` instead + +## [4.4.0] - 2017-05-10 +### Added +- New option `noLocation` to po generator, to omit the references [#143] +- New options `delimiter`, `enclosure` and `escape_char` to Csv and CsvDictionary extractors and generators [#145] +- Added the missing `dn__()` function [#146] + +### Fixed +- Improved the code style including php_codesniffer in development + +## 4.3.0 - 2017-03-04 +### Added +- Added support for named placeholders (using `strtr`). For example: + ```php + __('Hello :name', [':name' => 'World']); + ``` +- Added support for Twig v2 +- New function `BaseTranslator::includeFunctions()` to include the functions file without register any translator + +### Fixed +- Fixed a bug related with the javascript source extraction with single quotes + +[#143]: https://github.com/oscarotero/Gettext/issues/143 +[#145]: https://github.com/oscarotero/Gettext/issues/145 +[#146]: https://github.com/oscarotero/Gettext/issues/146 +[#147]: https://github.com/oscarotero/Gettext/issues/147 +[#148]: https://github.com/oscarotero/Gettext/issues/148 +[#152]: https://github.com/oscarotero/Gettext/issues/152 +[#154]: https://github.com/oscarotero/Gettext/issues/154 +[#155]: https://github.com/oscarotero/Gettext/issues/155 +[#156]: https://github.com/oscarotero/Gettext/issues/156 +[#159]: https://github.com/oscarotero/Gettext/issues/159 +[#161]: https://github.com/oscarotero/Gettext/issues/161 +[#166]: https://github.com/oscarotero/Gettext/issues/166 +[#168]: https://github.com/oscarotero/Gettext/issues/168 +[#170]: https://github.com/oscarotero/Gettext/issues/170 +[#175]: https://github.com/oscarotero/Gettext/issues/175 +[#177]: https://github.com/oscarotero/Gettext/issues/177 +[#178]: https://github.com/oscarotero/Gettext/issues/178 +[#182]: https://github.com/oscarotero/Gettext/issues/182 +[#187]: https://github.com/oscarotero/Gettext/issues/187 +[#188]: https://github.com/oscarotero/Gettext/issues/188 +[#191]: https://github.com/oscarotero/Gettext/issues/191 +[#197]: https://github.com/oscarotero/Gettext/issues/197 +[#198]: https://github.com/oscarotero/Gettext/issues/198 +[#200]: https://github.com/oscarotero/Gettext/issues/200 +[#205]: https://github.com/oscarotero/Gettext/issues/205 +[#213]: https://github.com/oscarotero/Gettext/issues/213 +[#214]: https://github.com/oscarotero/Gettext/issues/214 +[#215]: https://github.com/oscarotero/Gettext/issues/215 +[#218]: https://github.com/oscarotero/Gettext/issues/218 +[#221]: https://github.com/oscarotero/Gettext/issues/221 +[#223]: https://github.com/oscarotero/Gettext/issues/223 +[#224]: https://github.com/oscarotero/Gettext/issues/224 +[#225]: https://github.com/oscarotero/Gettext/issues/225 +[#226]: https://github.com/oscarotero/Gettext/issues/226 +[#230]: https://github.com/oscarotero/Gettext/issues/230 +[#231]: https://github.com/oscarotero/Gettext/issues/231 +[#238]: https://github.com/oscarotero/Gettext/issues/238 +[#242]: https://github.com/oscarotero/Gettext/issues/242 + +[4.8.2]: https://github.com/oscarotero/Gettext/compare/v4.8.1...v4.8.2 +[4.8.1]: https://github.com/oscarotero/Gettext/compare/v4.8.0...v4.8.1 +[4.8.0]: https://github.com/oscarotero/Gettext/compare/v4.7.0...v4.8.0 +[4.7.0]: https://github.com/oscarotero/Gettext/compare/v4.6.3...v4.7.0 +[4.6.3]: https://github.com/oscarotero/Gettext/compare/v4.6.2...v4.6.3 +[4.6.2]: https://github.com/oscarotero/Gettext/compare/v4.6.1...v4.6.2 +[4.6.1]: https://github.com/oscarotero/Gettext/compare/v4.6.0...v4.6.1 +[4.6.0]: https://github.com/oscarotero/Gettext/compare/v4.5.0...v4.6.0 +[4.5.0]: https://github.com/oscarotero/Gettext/compare/v4.4.4...v4.5.0 +[4.4.4]: https://github.com/oscarotero/Gettext/compare/v4.4.3...v4.4.4 +[4.4.3]: https://github.com/oscarotero/Gettext/compare/v4.4.2...v4.4.3 +[4.4.2]: https://github.com/oscarotero/Gettext/compare/v4.4.1...v4.4.2 +[4.4.1]: https://github.com/oscarotero/Gettext/compare/v4.4.0...v4.4.1 +[4.4.0]: https://github.com/oscarotero/Gettext/compare/v4.3.0...v4.4.0 diff --git a/vendor/gettext/gettext/LICENSE b/vendor/gettext/gettext/LICENSE index 40a9fc910d..2385321a10 100644 --- a/vendor/gettext/gettext/LICENSE +++ b/vendor/gettext/gettext/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2014 Oscar Otero Marzoa +Copyright (c) 2017 Oscar Otero Marzoa Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/vendor/gettext/gettext/README.md b/vendor/gettext/gettext/README.md index 854d0d74c4..4911afba9c 100644 --- a/vendor/gettext/gettext/README.md +++ b/vendor/gettext/gettext/README.md @@ -3,7 +3,6 @@ Gettext [](https://travis-ci.org/oscarotero/Gettext) [](https://scrutinizer-ci.com/g/oscarotero/Gettext/?branch=master) -[](https://www.versioneye.com/php/gettext:gettext/references) [](https://packagist.org/packages/gettext/gettext) [](https://packagist.org/packages/gettext/gettext) [](https://packagist.org/packages/gettext/gettext) @@ -13,7 +12,7 @@ Gettext Created by Oscar Otero <http://oscarotero.com> <oom@oscarotero.com> (MIT License) -Gettext is a PHP (5.3) library to import/export/edit gettext from PO, MO, PHP, JS files, etc. +Gettext is a PHP (>=5.4) library to import/export/edit gettext from PO, MO, PHP, JS files, etc. ## Installation @@ -81,8 +80,6 @@ echo $t->gettext('apple'); // "Mazá" $t->register(); echo __('apple'); // "Mazá" - -__e('apple'); // "Mazá" ``` To use this translations with the gettext extension: @@ -107,12 +104,17 @@ echo gettext('apple'); // "Mazá" $t->register(); echo __('apple'); // "Mazá" + +//And use sprintf/strtr placeholders +echo __('Hello %s', 'world'); //Hello world +echo __('Hello {name}', ['{name}' => 'world']); //Hello world ``` The benefits of using the functions provided by this library (`__()` instead `_()` or `gettext()`) are: -* You are using the same functions, no matter whether the translations are provided by gettext extension or any other method -* You can use variables easier because you have sprintf functionality. For example: `__('Hello %s', 'world')` instead `sprintf(_('Hello %s'), 'world')`. +* You are using the same functions, no matter whether the translations are provided by gettext extension or any other method. +* You can use variables easier because `sprintf` functionality is included. For example: `__('Hello %s', 'world')` instead `sprintf(_('Hello %s'), 'world')`. +* You can also use named placeholders if the second argument is an array. For example: `__('Hello %name%', ['%name%' => 'world'])` instead of `strtr(_('Hello %name%'), ['%name%' => 'world'])`. ## Translation @@ -146,10 +148,10 @@ $translations = new Gettext\Translations(); $translations[] = new Gettext\Translation('comments', 'One comment', '%s comments'); //Or using the "insert" method -$insertedTranslation = $translations->insert('comments', 'One comments', '%s comments'); +$insertedTranslation = $translations->insert('comments', 'One comment', '%s comments'); //Find a specific translation -$translation = $translations->find('comments', 'One comments'); +$translation = $translations->find('comments', 'One comment'); //Edit headers, domain, etc $translations->setHeader('Last-Translator', 'Oscar Otero'); @@ -158,31 +160,49 @@ $translations->setDomain('my-blog'); ## Extractors -The extrators are classes that extract the gettext values from any source and return a `Gettext\Translations` instance with them. For example, to scan a .po file: +The extrators allows to fetch gettext values from any source. For example, to scan a .po file: ```php +$translations = new Gettext\Translations(); + //From a file -$translations = Gettext\Extractors\Po::fromFile('locales/en.po'); +Gettext\Extractors\Po::fromFile('locales/en.po', $translations); //From a string -$string = file_get_contents('locales/en.po'); -$translations = Gettext\Extractors\Po::fromString($string); +$string = file_get_contents('locales2/en.po'); +Gettext\Extractors\Po::fromString($string, $translations); ``` -The available extractors are the following: +The better way to use extractors is using the magic methods of `Gettext\Translations`: + +```php +//Create a Translations instance using a po file +$translations = Gettext\Translations::fromPoFile('locales/en.po'); -* `Gettext\Extractors\Po` - Gets the strings from PO -* `Gettext\Extractors\Mo` - Gets the strings from MO -* `Gettext\Extractors\PhpCode` - To scan a php file looking for all gettext functions (see `translator_functions.php`) -* `Gettext\Extractors\JsCode` - To scan a javascript file looking for all gettext functions (the same than PhpCode but for javascript) -* `Gettext\Extractors\PhpArray` - To get the translations from a php file that returns an array -* `Gettext\Extractors\Jed` - To scan a json file compatible with the [Jed library](http://slexaxton.github.com/Jed/) -* `Gettext\Extractors\Blade` - To scan a Blade template (For laravel users. Thanks [@eusonlito](https://github.com/eusonlito)) -* `Gettext\Extractors\Twig` - To scan a Twig template (Thanks [@exnor](https://github.com/exnor)) -* `Gettext\Extractors\JsonDictionary` - To get translations from a plain json file with the format `{"original": "translation"}` -* `Gettext\Extractors\YamlDictionary` - To get translations from a plain yaml file with the format `"original": translation` -* `Gettext\Extractors\CsvDictionary` - Gets the strings from plain CSV with the format `"original", "translation"` +//Add more messages from other files +$translations->addFromPoFile('locales2/en.po'); +``` + +The available extractors are the following: +Name | Description | Example +---- | ----------- | -------- +**Blade** | Scans a Blade template (For laravel users). | [example](https://github.com/oscarotero/Gettext/blob/master/tests/assets/blade/input.php) +**Csv** | Gets the messages from csv. | [example](https://github.com/oscarotero/Gettext/blob/master/tests/assets/po/Csv.csv) +**CsvDictionary** | Gets the messages from csv (without plurals and context). | [example](https://github.com/oscarotero/Gettext/blob/master/tests/assets/po/CsvDictionary.csv) +**Jed** | Gets the messages from a json compatible with [Jed](http://slexaxton.github.com/Jed/). | [example](https://github.com/oscarotero/Gettext/blob/master/tests/assets/po/Jed.json) +**JsCode** | Scans javascript code looking for all gettext functions (the same than PhpCode but for javascript). You can use [the javascript gettext-translator library](https://github.com/oscarotero/gettext-translator) | [example](https://github.com/oscarotero/Gettext/blob/master/tests/assets/jscode/input.js) +**Json** | Gets the messages from json compatible with [gettext-translator](https://github.com/oscarotero/gettext-translator). | [example](https://github.com/oscarotero/Gettext/blob/master/tests/assets/po/Json.json) +**JsonDictionary** | Gets the messages from a json (without plurals and context). | [example](https://github.com/oscarotero/Gettext/blob/master/tests/assets/po/JsonDictionary.json) +**Mo** | Gets the messages from MO. | [example](https://github.com/oscarotero/Gettext/blob/master/tests/assets/po/Mo.mo) +**PhpArray** | Gets the messages from a php file that returns an array. | [example](https://github.com/oscarotero/Gettext/blob/master/tests/assets/po/PhpArray.php) +**PhpCode** | Scans php code looking for all gettext functions (see `translator_functions.php`). | [example](https://github.com/oscarotero/Gettext/blob/master/tests/assets/phpcode/input.php) +**Po** | Gets the messages from PO. | [example](https://github.com/oscarotero/Gettext/blob/master/tests/assets/po/Po.po) +**Twig** | To scan a Twig template. | [example](https://github.com/oscarotero/Gettext/blob/master/tests/assets/twig/input.php) +**Xliff** | Gets the messages from [xliff (2.0)](http://docs.oasis-open.org/xliff/xliff-core/v2.0/os/xliff-core-v2.0-os.html). | [example](https://github.com/oscarotero/Gettext/blob/master/tests/assets/po/Xliff.xlf) +**Yaml** | Gets the messages from yaml. | [example](https://github.com/oscarotero/Gettext/blob/master/tests/assets/po/Yaml.yml) +**YamlDictionary** | Gets the messages from a yaml (without plurals and context). | [example](https://github.com/oscarotero/Gettext/blob/master/tests/assets/po/YamlDictionary.yml) +**VueJs** | Gets the messages from a VueJs template. | [example](https://github.com/oscarotero/Gettext/blob/master/tests/assets/vuejs/input.vue) ## Generators @@ -194,35 +214,38 @@ Gettext\Generators\Po::toFile($translations, 'locales/en.po'); //Return as a string $content = Gettext\Generators\Po::toString($translations); -$string = file_put_contents('locales/en.po', $content); +file_put_contents('locales/en.po', $content); ``` -The available generators are: - -* `Gettext\Generators\Mo` - Exports to Mo format -* `Gettext\Generators\Po` - Exports to Po format -* `Gettext\Generators\PhpArray` - Exports to php code that returns an array with all values -* `Gettext\Generators\Jed` - Exports to json format compatible with [Jed library](http://slexaxton.github.com/Jed/) -* `Gettext\Generators\JsonDictionary` - Export to plain json with the format `{"original": "translation"}` (thanks, [@gator92](https://github.com/Gator92)) -* `Gettext\Generators\YamlDictionary` - Export to plain yaml with the format `"original": translation` (thanks, [@sourcerer-mike](https://github.com/sourcerer-mike)) -* `Gettext\Generators\CsvDictionary` - Exports to CSV format with the format `"original","translation"` (thanks, [@sourcerer-mike](https://github.com/sourcerer-mike)) - -To ease the work with generators and extractors you can use the magic methods availables in `Gettext\Translations` that import and export the translations in all these formats: +Like extractors, the better way to use generators is using the magic methods of `Gettext\Translations`: ```php -use Gettext\Translations; - -//Import the translations from a .po file -$translations = Translations::fromPoFile('locales/en.po'); +//Extract messages from a php code file +$translations = Gettext\Translations::fromPhpCodeFile('templates/index.php'); -//Add more translations from another .po file -$translations->addFromPoFile('locales/more-en.po'); +//Export to a po file +$translations->toPoFile('locales/en.po'); -//Export to .mo -$translations->toMoFile('locales/en.mo'); +//Export to a po string +$content = $translations->toPoString(); +file_put_contents('locales/en.po', $content); ``` -To import translations, the methods are static and named `from + [Extractor] + [File/String]`, for example `fromPhpArrayFile` or `fromJsCodeString`. To export or add more translations use the methods named `addFrom + [Generator] + [File/String]` (to add) or `to + [Generator] + [File/String]` (to export) for example `addFromPhpCodeFile`, `toPhpArrayFile` or `toPoString`. +The available generators are the following: + +Name | Description | Example +---- | ----------- | -------- +**Csv** | Exports to csv. | [example](https://github.com/oscarotero/Gettext/blob/master/tests/assets/po/Csv.csv) +**CsvDictionary** | Exports to csv (without plurals and context). | [example](https://github.com/oscarotero/Gettext/blob/master/tests/assets/po/CsvDictionary.csv) +**Json** | Exports to json, compatible with [gettext-translator](https://github.com/oscarotero/gettext-translator). | [example](https://github.com/oscarotero/Gettext/blob/master/tests/assets/po/Json.json) +**JsonDictionary** | Exports to json (without plurals and context). | [example](https://github.com/oscarotero/Gettext/blob/master/tests/assets/po/JsonDictionary.json) +**Mo** | Exports to Mo. | [example](https://github.com/oscarotero/Gettext/blob/master/tests/assets/po/Mo.mo) +**PhpArray** | Exports to php code that returns an array. | [example](https://github.com/oscarotero/Gettext/blob/master/tests/assets/po/PhpArray.php) +**Po** | Exports to Po. | [example](https://github.com/oscarotero/Gettext/blob/master/tests/assets/po/Po.po) +**Jed** | Exports to json format compatible with [Jed](http://slexaxton.github.com/Jed/). | [example](https://github.com/oscarotero/Gettext/blob/master/tests/assets/po/Jed.json) +**Xliff** | Exports to [xliff (2.0)](http://docs.oasis-open.org/xliff/xliff-core/v2.0/os/xliff-core-v2.0-os.html). | [example](https://github.com/oscarotero/Gettext/blob/master/tests/assets/po/Xliff.xlf) +**Yaml** | Exports to yaml. | [example](https://github.com/oscarotero/Gettext/blob/master/tests/assets/po/Yaml.yml) +**YamlDictionary** | Exports to yaml (without plurals and context). | [example](https://github.com/oscarotero/Gettext/blob/master/tests/assets/po/YamlDictionary.yml) ## Translator @@ -281,8 +304,6 @@ To ease the use of translations in your php templates, you can use the provided $t->register(); echo __('apple'); // it's the same than $t->gettext('apple'); - -__e('apple'); // it's the same than echo $t->gettext('apple'); ``` You can scan the php files containing these functions and extract the values with the PhpCode extractor: @@ -291,13 +312,13 @@ You can scan the php files containing these functions and extract the values wit <!-- index.php --> <html> <body> - <?php echo __('Hello world'); ?> + <?= __('Hello world'); ?> </body> </html> ``` -# Merge translations +## Merge translations To work with different translations you may want merge them in an unique file. There are two ways to do this: @@ -326,48 +347,79 @@ $translations1->mergeWith($translations2); //Now translations1 has all values ``` -The second argument of `mergeWith` defines how the merge will be done. You can pass one or various of the following predefined constants: - -* MERGE_ADD: Adds the translations from translations2 to translations1 if they not exists -* MERGE_REMOVE: Removes the translations in translations1 if they are not in translations2 -* MERGE_OVERRIDE: Overrides the translations in translations1 if they are in translations2 -* MERGE_HEADERS: Merges the headers from translations2 to translations 1 -* MERGE_REFERENCES: Merges the references from translations2 to translations1 -* MERGE_COMMENTS: Merges the comments from translations2 to translations1 -* MERGE_LANGUAGE: Applies the language and plural forms of translations2 to translation1 -* MERGE_PLURAL: Translations with the same id but one with plurals and other singular will be merged +The second argument of `mergeWith` defines how the merge will be done. Use the `Gettext\Merge` constants to configure the merging: + +Constant | Description +--------- | ----------- +`Merge::ADD` | Adds the translations from `$translations2` that are missing +`Merge::REMOVE` | Removes the translations missing in `$translations2` +`Merge::HEADERS_ADD` | Adds the headers from `$translations2` that are missing +`Merge::HEADERS_REMOVE` | Removes the headers missing in `$translations2` +`Merge::HEADERS_OVERRIDE` | Overrides the headers with the values of `$translations2` +`Merge::LANGUAGE_OVERRIDE` | Set the language defined in `$translations2` +`Merge::DOMAIN_OVERRIDE` | Set the domain defined in `$translations2` +`Merge::TRANSLATION_OVERRIDE` | Override the translation and plural translations with the value of `$translation2` +`Merge::COMMENTS_OURS` | Use only the comments of `$translation1` +`Merge::COMMENTS_THEIRS` | Use only the comments of `$translation2` +`Merge::EXTRACTED_COMMENTS_OURS` | Use only the extracted comments of `$translation1` +`Merge::EXTRACTED_COMMENTS_THEIRS` | Use only the extracted comments of `$translation2` +`Merge::FLAGS_OURS` | Use only the flags of `$translation1` +`Merge::FLAGS_THEIRS` | Use only the flags of `$translation2` +`Merge::REFERENCES_OURS` | Use only the references of `$translation1` +`Merge::REFERENCES_THEIRS` | Use only the references of `$translation2` Example: ```php use Gettext\Translations; +use Gettext\Merge; //Scan the php code to find the latest gettext translations -$translations = Translations::fromPhpCodeFile('my-templates.php'); +$phpTranslations = Translations::fromPhpCodeFile('my-templates.php'); //Get the translations of the code that are stored in a po file $poTranslations = Translations::fromPoFile('locale.po'); -//Apply the translations from the po file to the translations, and merges header and comments but not references and without add or remove translations: -$translations->mergeWith($poTranslations, Translations::MERGE_HEADERS | Translations::MERGE_COMMENTS); +//Merge the translations from the po file using the references from `$phpTranslations`: +$translations->mergeWith($poTranslations, Merge::REFERENCES_OURS); //Now save a po file with the result $translations->toPoFile('locale.po'); ``` -Note, if the second argument is not defined, the default is `self::MERGE_ADD | self::MERGE_HEADERS | self::MERGE_COMMENTS | self::MERGE_REFERENCES | self::MERGE_PLURAL` +Note, if the second argument is not defined, the default value is `Merge::DEFAULTS` that's equivalent to `Merge::ADD | Merge::HEADERS_ADD`. ## Use from CLI There's a Robo task to use this library from the command line interface: https://github.com/oscarotero/GettextRobo +## Use in the browser + +If you want to use your translations in the browser, there's a javascript translator: https://github.com/oscarotero/gettext-translator + +## Third party packages + +Twig integration: + +* [jaimeperez/twig-configurable-i18n](https://packagist.org/packages/jaimeperez/twig-configurable-i18n) +* [cemerson/translator-twig-extension](https://packagist.org/packages/cemerson/translator-twig-extension) + +Framework integration: + +* [Laravel 5](https://packagist.org/packages/eusonlito/laravel-gettext) +* [CakePHP 3](https://packagist.org/packages/k1low/po) +* [Symfony 2](https://packagist.org/packages/mablae/gettext-bundle) + +[add your package](https://github.com/oscarotero/Gettext/issues/new) + ## Contributors -* [@oscarotero](https://github.com/oscarotero) (Creator and maintainer) -* [@mlocati](https://github.com/mlocati) (Mo generator/extractor, languages, etc) -* [@esnoeijs](https://github.com/esnoeijs) (plural parser) -* [@leom](https://github.com/leom) (Jed fixes) -* [@eusonlito](https://github.com/eusonlito) (Blade extractor) -* [@exnor](https://github.com/exnor) (Twig extractor) -* [@vvh-empora](https://github.com/vvh-empora) (fixes) -* [and many more...](https://github.com/oscarotero/Gettext/graphs/contributors) +Thanks to all [contributors](https://github.com/oscarotero/Gettext/graphs/contributors) specially to [@mlocati](https://github.com/mlocati). + +## Donations + +If this library is useful for you, consider to donate to the author. + +[Buy me a beer :beer:](https://www.paypal.me/oscarotero) + +Thanks in advance! diff --git a/vendor/gettext/gettext/composer.json b/vendor/gettext/gettext/composer.json index f99a77e15f..24b5083d6a 100644 --- a/vendor/gettext/gettext/composer.json +++ b/vendor/gettext/gettext/composer.json @@ -18,14 +18,16 @@ "issues": "https://github.com/oscarotero/Gettext/issues" }, "require": { - "php": ">=5.3.0", - "gettext/languages": "2.*" + "php": ">=5.4.0", + "gettext/languages": "^2.3" }, "require-dev": { "illuminate/view": "*", - "twig/twig": "*", + "twig/twig": "^1.31|^2.0", "twig/extensions": "*", - "symfony/yaml": "~2" + "symfony/yaml": "~2", + "phpunit/phpunit": "^4.8|^5.7|^6.5", + "squizlabs/php_codesniffer": "^3.0" }, "suggest": { "illuminate/view": "Is necessary if you want to use the Blade extractor", @@ -37,5 +39,16 @@ "psr-4": { "Gettext\\": "src" } + }, + "autoload-dev": { + "psr-4": { + "Gettext\\Tests\\": "tests" + } + }, + "scripts": { + "test": [ + "phpunit", + "phpcs" + ] } } diff --git a/vendor/gettext/gettext/src/BaseTranslator.php b/vendor/gettext/gettext/src/BaseTranslator.php index 0cd9a53e38..c52038fe05 100644 --- a/vendor/gettext/gettext/src/BaseTranslator.php +++ b/vendor/gettext/gettext/src/BaseTranslator.php @@ -8,15 +8,11 @@ abstract class BaseTranslator implements TranslatorInterface public static $current; /** - * Set a translation instance as global, to use it with the gettext functions. - * - * @param TranslatorInterface $translator + * @see TranslatorInterface */ - public static function initGettextFunctions(TranslatorInterface $translator) + public function noop($original) { - self::$current = $translator; - - include_once __DIR__.'/translator_functions.php'; + return $original; } /** @@ -24,6 +20,20 @@ public static function initGettextFunctions(TranslatorInterface $translator) */ public function register() { - self::initGettextFunctions($this); + $previous = static::$current; + + static::$current = $this; + + static::includeFunctions(); + + return $previous; + } + + /** + * Include the gettext functions + */ + public static function includeFunctions() + { + include_once __DIR__.'/translator_functions.php'; } } diff --git a/vendor/gettext/gettext/src/Extractors/Blade.php b/vendor/gettext/gettext/src/Extractors/Blade.php index b7351bdebf..3c8c9da031 100644 --- a/vendor/gettext/gettext/src/Extractors/Blade.php +++ b/vendor/gettext/gettext/src/Extractors/Blade.php @@ -11,17 +11,19 @@ */ class Blade extends Extractor implements ExtractorInterface { - public static $cachePath; - /** * {@inheritdoc} */ - public static function fromString($string, Translations $translations = null, $file = '') + public static function fromString($string, Translations $translations, array $options = []) { - $cachePath = empty(static::$cachePath) ? sys_get_temp_dir() : static::$cachePath; - $bladeCompiler = new BladeCompiler(new Filesystem(), $cachePath); - $string = $bladeCompiler->compileString($string); + if (empty($options['facade'])) { + $cachePath = empty($options['cachePath']) ? sys_get_temp_dir() : $options['cachePath']; + $bladeCompiler = new BladeCompiler(new Filesystem(), $cachePath); + $string = $bladeCompiler->compileString($string); + } else { + $string = $options['facade']::compileString($string); + } - return PhpCode::fromString($string, $translations, $file); + PhpCode::fromString($string, $translations, $options); } } diff --git a/vendor/gettext/gettext/src/Extractors/Csv.php b/vendor/gettext/gettext/src/Extractors/Csv.php new file mode 100644 index 0000000000..fba3a987ed --- /dev/null +++ b/vendor/gettext/gettext/src/Extractors/Csv.php @@ -0,0 +1,53 @@ +<?php + +namespace Gettext\Extractors; + +use Gettext\Translations; +use Gettext\Utils\HeadersExtractorTrait; +use Gettext\Utils\CsvTrait; + +/** + * Class to get gettext strings from csv. + */ +class Csv extends Extractor implements ExtractorInterface +{ + use HeadersExtractorTrait; + use CsvTrait; + + public static $options = [ + 'delimiter' => ",", + 'enclosure' => '"', + 'escape_char' => "\\" + ]; + + /** + * {@inheritdoc} + */ + public static function fromString($string, Translations $translations, array $options = []) + { + $options += static::$options; + $handle = fopen('php://memory', 'w'); + + fputs($handle, $string); + rewind($handle); + + while ($row = static::fgetcsv($handle, $options)) { + $context = array_shift($row); + $original = array_shift($row); + + if ($context === '' && $original === '') { + static::extractHeaders(array_shift($row), $translations); + continue; + } + + $translation = $translations->insert($context, $original); + + if (!empty($row)) { + $translation->setTranslation(array_shift($row)); + $translation->setPluralTranslations($row); + } + } + + fclose($handle); + } +} diff --git a/vendor/gettext/gettext/src/Extractors/CsvDictionary.php b/vendor/gettext/gettext/src/Extractors/CsvDictionary.php index 75a9e7876f..807357cbf7 100644 --- a/vendor/gettext/gettext/src/Extractors/CsvDictionary.php +++ b/vendor/gettext/gettext/src/Extractors/CsvDictionary.php @@ -3,39 +3,45 @@ namespace Gettext\Extractors; use Gettext\Translations; +use Gettext\Utils\HeadersExtractorTrait; +use Gettext\Utils\CsvTrait; /** - * Class to get gettext strings from plain json. + * Class to get gettext strings from csv. */ class CsvDictionary extends Extractor implements ExtractorInterface { + use HeadersExtractorTrait; + use CsvTrait; + + public static $options = [ + 'delimiter' => ",", + 'enclosure' => '"', + 'escape_char' => "\\" + ]; + /** * {@inheritdoc} */ - public static function fromString($string, Translations $translations = null, $file = '') + public static function fromString($string, Translations $translations, array $options = []) { - if ($translations === null) { - $translations = new Translations(); - } - + $options += static::$options; $handle = fopen('php://memory', 'w'); fputs($handle, $string); rewind($handle); - $entries = array(); - while ($row = fgetcsv($handle)) { - $entries[$row[0]] = $row[1]; - } + while ($row = static::fgetcsv($handle, $options)) { + list($original, $translation) = $row + ['', '']; - fclose($handle); - - if ($entries) { - foreach ($entries as $original => $translation) { - $translations->insert(null, $original)->setTranslation($translation); + if ($original === '') { + static::extractHeaders($translation, $translations); + continue; } + + $translations->insert(null, $original)->setTranslation($translation); } - return $translations; + fclose($handle); } } diff --git a/vendor/gettext/gettext/src/Extractors/Extractor.php b/vendor/gettext/gettext/src/Extractors/Extractor.php index eaa6787d93..59974aac14 100644 --- a/vendor/gettext/gettext/src/Extractors/Extractor.php +++ b/vendor/gettext/gettext/src/Extractors/Extractor.php @@ -6,27 +6,17 @@ use InvalidArgumentException; use Gettext\Translations; -abstract class Extractor +abstract class Extractor implements ExtractorInterface { /** - * Extract the translations from a file. - * - * @param array|string $file A path of a file or files - * @param null|Translations $translations The translations instance to append the new translations. - * - * @return Translations + * {@inheritdoc} */ - public static function fromFile($file, Translations $translations = null) + public static function fromFile($file, Translations $translations, array $options = []) { - if ($translations === null) { - $translations = new Translations(); + foreach (static::getFiles($file) as $file) { + $options['file'] = $file; + static::fromString(static::readFile($file), $translations, $options); } - - foreach (self::getFiles($file) as $file) { - static::fromString(self::readFile($file), $translations, $file); - } - - return $translations; } /** @@ -51,20 +41,20 @@ protected static function getFiles($file) throw new InvalidArgumentException("'$file' is not a readable file"); } - return array($file); + return [$file]; } if (is_array($file)) { - $files = array(); + $files = []; foreach ($file as $f) { - $files = array_merge($files, self::getFiles($f)); + $files = array_merge($files, static::getFiles($f)); } return $files; } - throw new InvalidArgumentException('The first argumet must be string or array'); + throw new InvalidArgumentException('The first argument must be string or array'); } /** diff --git a/vendor/gettext/gettext/src/Extractors/ExtractorInterface.php b/vendor/gettext/gettext/src/Extractors/ExtractorInterface.php index 9c62d45ff7..ca4427682c 100644 --- a/vendor/gettext/gettext/src/Extractors/ExtractorInterface.php +++ b/vendor/gettext/gettext/src/Extractors/ExtractorInterface.php @@ -9,21 +9,18 @@ interface ExtractorInterface /** * Extract the translations from a file. * - * @param array|string $file A path of a file or files - * @param null|Translations $translations The translations instance to append the new translations. - * - * @return Translations + * @param array|string $file A path of a file or files + * @param Translations $translations The translations instance to append the new translations. + * @param array $options */ - public static function fromFile($file, Translations $translations = null); + public static function fromFile($file, Translations $translations, array $options = []); /** * Parses a string and append the translations found in the Translations instance. * - * @param string $string - * @param Translations|null $translations - * @param string $file The file path to insert the reference - * - * @return Translations + * @param string $string + * @param Translations $translations + * @param array $options */ - public static function fromString($string, Translations $translations = null, $file = ''); + public static function fromString($string, Translations $translations, array $options = []); } diff --git a/vendor/gettext/gettext/src/Extractors/ExtractorMultiInterface.php b/vendor/gettext/gettext/src/Extractors/ExtractorMultiInterface.php new file mode 100644 index 0000000000..7dbabc210c --- /dev/null +++ b/vendor/gettext/gettext/src/Extractors/ExtractorMultiInterface.php @@ -0,0 +1,28 @@ +<?php + +namespace Gettext\Extractors; + +use Gettext\Translations; + +interface ExtractorMultiInterface +{ + /** + * Parses a string and append the translations found in the Translations instance. + * Allows scanning for multiple domains at a time (each Translation has to have a different domain) + * + * @param string $string + * @param Translations[] $translations + * @param array $options + */ + public static function fromStringMultiple($string, array $translations, array $options = []); + + /** + * Parses a string and append the translations found in the Translations instance. + * Allows scanning for multiple domains at a time (each Translation has to have a different domain) + * + * @param $file + * @param Translations[] $translations + * @param array $options + */ + public static function fromFileMultiple($file, array $translations, array $options = []); +} diff --git a/vendor/gettext/gettext/src/Extractors/Jed.php b/vendor/gettext/gettext/src/Extractors/Jed.php index 1786b29fa8..4f1b36bdfd 100644 --- a/vendor/gettext/gettext/src/Extractors/Jed.php +++ b/vendor/gettext/gettext/src/Extractors/Jed.php @@ -7,43 +7,49 @@ /** * Class to get gettext strings from json files. */ -class Jed extends PhpArray implements ExtractorInterface +class Jed extends Extractor implements ExtractorInterface { /** * {@inheritdoc} */ - public static function fromString($string, Translations $translations = null, $file = '') + public static function fromString($string, Translations $translations, array $options = []) { - if ($translations === null) { - $translations = new Translations(); - } - - $content = json_decode($string, true); - - PhpArray::handleArray($content, $translations); - - return $translations; + static::extract(json_decode($string, true), $translations); } /** - * Extract and insert a new translation. - * + * Handle an array of translations and append to the Translations instance. + * + * @param array $content * @param Translations $translations - * @param string $key - * @param string $message */ - protected static function insertTranslation(Translations $translations, $key, $message) + public static function extract(array $content, Translations $translations) { + $messages = current($content); + $headers = isset($messages['']) ? $messages[''] : null; + unset($messages['']); + + if (!empty($headers['domain'])) { + $translations->setDomain($headers['domain']); + } + + if (!empty($headers['lang'])) { + $translations->setLanguage($headers['lang']); + } + + if (!empty($headers['plural-forms'])) { + $translations->setHeader(Translations::HEADER_PLURAL, $headers['plural-forms']); + } + $context_glue = '\u0004'; - $key = explode($context_glue, $key); - $context = isset($key[1]) ? array_shift($key) : ''; - $original = array_shift($key); - $translation = array_shift($message); - $plural_translation = array_shift($message); + foreach ($messages as $key => $translation) { + $key = explode($context_glue, $key); + $context = isset($key[1]) ? array_shift($key) : ''; - $entry = $translations->insert($context, $original); - $entry->setTranslation($translation); - $entry->setPluralTranslation($plural_translation); + $translations->insert($context, array_shift($key)) + ->setTranslation(array_shift($translation)) + ->setPluralTranslations($translation); + } } } diff --git a/vendor/gettext/gettext/src/Extractors/JsCode.php b/vendor/gettext/gettext/src/Extractors/JsCode.php index 557d842fa9..0a88d4fa37 100644 --- a/vendor/gettext/gettext/src/Extractors/JsCode.php +++ b/vendor/gettext/gettext/src/Extractors/JsCode.php @@ -2,30 +2,73 @@ namespace Gettext\Extractors; +use Exception; use Gettext\Translations; -use Gettext\Utils\JsFunctionsScanner; +use Gettext\Utils\FunctionsScanner; /** * Class to get gettext strings from javascript files. */ -class JsCode extends Extractor implements ExtractorInterface +class JsCode extends Extractor implements ExtractorInterface, ExtractorMultiInterface { - public static $functions = array( - '__' => '__', - 'n__' => 'n__', - 'p__' => 'p__', - ); + public static $options = [ + 'constants' => [], + + 'functions' => [ + 'gettext' => 'gettext', + '__' => 'gettext', + 'ngettext' => 'ngettext', + 'n__' => 'ngettext', + 'pgettext' => 'pgettext', + 'p__' => 'pgettext', + 'dgettext' => 'dgettext', + 'd__' => 'dgettext', + 'dngettext' => 'dngettext', + 'dn__' => 'dngettext', + 'dpgettext' => 'dpgettext', + 'dp__' => 'dpgettext', + 'npgettext' => 'npgettext', + 'np__' => 'npgettext', + 'dnpgettext' => 'dnpgettext', + 'dnp__' => 'dnpgettext', + 'noop' => 'noop', + 'noop__' => 'noop', + ], + ]; + + protected static $functionsScannerClass = 'Gettext\Utils\JsFunctionsScanner'; /** - * {@inheritdoc} + * @inheritdoc + * @throws Exception */ - public static function fromString($string, Translations $translations = null, $file = '') + public static function fromString($string, Translations $translations, array $options = []) { - if ($translations === null) { - $translations = new Translations(); - } + static::fromStringMultiple($string, [$translations], $options); + } + + /** + * @inheritDoc + * @throws Exception + */ + public static function fromStringMultiple($string, array $translations, array $options = []) + { + $options += static::$options; + + /** @var FunctionsScanner $functions */ + $functions = new static::$functionsScannerClass($string); + $functions->saveGettextFunctions($translations, $options); + } - $functions = new JsFunctionsScanner($string); - $functions->saveGettextFunctions(self::$functions, $translations, $file); + /** + * @inheritDoc + * @throws Exception + */ + public static function fromFileMultiple($file, array $translations, array $options = []) + { + foreach (static::getFiles($file) as $file) { + $options['file'] = $file; + static::fromStringMultiple(static::readFile($file), $translations, $options); + } } } diff --git a/vendor/gettext/gettext/src/Extractors/Json.php b/vendor/gettext/gettext/src/Extractors/Json.php new file mode 100644 index 0000000000..3aaea291c8 --- /dev/null +++ b/vendor/gettext/gettext/src/Extractors/Json.php @@ -0,0 +1,26 @@ +<?php + +namespace Gettext\Extractors; + +use Gettext\Translations; +use Gettext\Utils\MultidimensionalArrayTrait; + +/** + * Class to get gettext strings from json. + */ +class Json extends Extractor implements ExtractorInterface +{ + use MultidimensionalArrayTrait; + + /** + * {@inheritdoc} + */ + public static function fromString($string, Translations $translations, array $options = []) + { + $messages = json_decode($string, true); + + if (is_array($messages)) { + static::fromArray($messages, $translations); + } + } +} diff --git a/vendor/gettext/gettext/src/Extractors/JsonDictionary.php b/vendor/gettext/gettext/src/Extractors/JsonDictionary.php index 0a45c12222..42ee3d8d96 100644 --- a/vendor/gettext/gettext/src/Extractors/JsonDictionary.php +++ b/vendor/gettext/gettext/src/Extractors/JsonDictionary.php @@ -3,27 +3,24 @@ namespace Gettext\Extractors; use Gettext\Translations; +use Gettext\Utils\DictionaryTrait; /** * Class to get gettext strings from plain json. */ class JsonDictionary extends Extractor implements ExtractorInterface { + use DictionaryTrait; + /** * {@inheritdoc} */ - public static function fromString($string, Translations $translations = null, $file = '') + public static function fromString($string, Translations $translations, array $options = []) { - if ($translations === null) { - $translations = new Translations(); - } + $messages = json_decode($string, true); - if (($entries = json_decode($string, true))) { - foreach ($entries as $original => $translation) { - $translations->insert(null, $original)->setTranslation($translation); - } + if (is_array($messages)) { + static::fromArray($messages, $translations); } - - return $translations; } } diff --git a/vendor/gettext/gettext/src/Extractors/Mo.php b/vendor/gettext/gettext/src/Extractors/Mo.php index 785c996e06..0f5846d8a4 100644 --- a/vendor/gettext/gettext/src/Extractors/Mo.php +++ b/vendor/gettext/gettext/src/Extractors/Mo.php @@ -15,37 +15,36 @@ class Mo extends Extractor implements ExtractorInterface const MAGIC2 = -569244523; const MAGIC3 = 2500072158; + protected static $stringReaderClass = 'Gettext\Utils\StringReader'; + /** * {@inheritdoc} */ - public static function fromString($string, Translations $translations = null, $file = '') + public static function fromString($string, Translations $translations, array $options = []) { - if ($translations === null) { - $translations = new Translations(); - } - - $stream = new StringReader($string); - $magic = self::readInt($stream, 'V'); + /** @var StringReader $stream */ + $stream = new static::$stringReaderClass($string); + $magic = static::readInt($stream, 'V'); - if (($magic === self::MAGIC1) || ($magic === self::MAGIC3)) { //to make sure it works for 64-bit platforms + if (($magic === static::MAGIC1) || ($magic === static::MAGIC3)) { //to make sure it works for 64-bit platforms $byteOrder = 'V'; //low endian - } elseif ($magic === (self::MAGIC2 & 0xFFFFFFFF)) { + } elseif ($magic === (static::MAGIC2 & 0xFFFFFFFF)) { $byteOrder = 'N'; //big endian } else { throw new Exception('Not MO file'); } - self::readInt($stream, $byteOrder); + static::readInt($stream, $byteOrder); - $total = self::readInt($stream, $byteOrder); //total string count - $originals = self::readInt($stream, $byteOrder); //offset of original table - $tran = self::readInt($stream, $byteOrder); //offset of translation table + $total = static::readInt($stream, $byteOrder); //total string count + $originals = static::readInt($stream, $byteOrder); //offset of original table + $tran = static::readInt($stream, $byteOrder); //offset of translation table $stream->seekto($originals); - $table_originals = self::readIntArray($stream, $byteOrder, $total * 2); + $table_originals = static::readIntArray($stream, $byteOrder, $total * 2); $stream->seekto($tran); - $table_translations = self::readIntArray($stream, $byteOrder, $total * 2); + $table_translations = static::readIntArray($stream, $byteOrder, $total * 2); for ($i = 0; $i < $total; ++$i) { $next = $i * 2; @@ -99,23 +98,17 @@ public static function fromString($string, Translations $translations = null, $f continue; } - foreach (explode("\x00", $translated) as $pluralIndex => $pluralValue) { - if ($pluralIndex === 0) { - $translation->setTranslation($pluralValue); - } else { - $translation->setPluralTranslation($pluralValue, $pluralIndex - 1); - } - } + $v = explode("\x00", $translated); + $translation->setTranslation(array_shift($v)); + $translation->setPluralTranslations($v); } - - return $translations; } /** * @param StringReader $stream * @param string $byteOrder */ - private static function readInt(StringReader $stream, $byteOrder) + protected static function readInt(StringReader $stream, $byteOrder) { if (($read = $stream->read(4)) === false) { return false; @@ -131,7 +124,7 @@ private static function readInt(StringReader $stream, $byteOrder) * @param string $byteOrder * @param int $count */ - private static function readIntArray(StringReader $stream, $byteOrder, $count) + protected static function readIntArray(StringReader $stream, $byteOrder, $count) { return unpack($byteOrder.$count, $stream->read(4 * $count)); } diff --git a/vendor/gettext/gettext/src/Extractors/PhpArray.php b/vendor/gettext/gettext/src/Extractors/PhpArray.php index 5d8450616a..3e4b2627f3 100644 --- a/vendor/gettext/gettext/src/Extractors/PhpArray.php +++ b/vendor/gettext/gettext/src/Extractors/PhpArray.php @@ -2,85 +2,32 @@ namespace Gettext\Extractors; -use Exception; +use BadMethodCallException; use Gettext\Translations; +use Gettext\Utils\MultidimensionalArrayTrait; /** * Class to get gettext strings from php files returning arrays. */ class PhpArray extends Extractor implements ExtractorInterface { - /** - * Extract the translations from a file. - * - * @param array|string $file A path of a file or files - * @param null|Translations $translations The translations instance to append the new translations. - * - * @return Translations - */ - public static function fromFile($file, Translations $translations = null) - { - if ($translations === null) { - $translations = new Translations(); - } - - foreach (self::getFiles($file) as $file) { - self::handleArray(include($file), $translations); - } - - return $translations; - } + use MultidimensionalArrayTrait; /** * {@inheritdoc} */ - public static function fromString($string, Translations $translations = null, $file = '') - { - throw new Exception('PhpArray::fromString() cannot be called. Use PhpArray::fromFile()'); - } - - /** - * Handle an array of translations and append to the Translations instance. - * - * @param array $content - * @param Translations $translations - */ - public static function handleArray(array $content, Translations $translations) + public static function fromFile($file, Translations $translations, array $options = []) { - $content = current($content); - - $translations_info = isset($content['']) ? $content[''] : null; - unset($content['']); - - if (isset($translations_info['domain'])) { - $translations->setDomain($translations_info['domain']); - } - - foreach ($content as $key => $message) { - static::insertTranslation($translations, $key, $message); + foreach (static::getFiles($file) as $file) { + static::fromArray(include($file), $translations); } } /** - * Extract and insert a new translation. - * - * @param Translations $translations - * @param string $key - * @param string $message + * {@inheritdoc} */ - protected static function insertTranslation(Translations $translations, $key, $message) + public static function fromString($string, Translations $translations, array $options = []) { - $context_glue = '\u0004'; - $key = explode($context_glue, $key); - - $context = isset($key[1]) ? array_shift($key) : ''; - $original = array_shift($key); - $plural = array_shift($message); - $translation = array_shift($message); - $plural_translation = array_shift($message); - - $entry = $translations->insert($context, $original, $plural); - $entry->setTranslation($translation); - $entry->setPluralTranslation($plural_translation); + throw new BadMethodCallException('PhpArray::fromString() cannot be called. Use PhpArray::fromFile()'); } } diff --git a/vendor/gettext/gettext/src/Extractors/PhpCode.php b/vendor/gettext/gettext/src/Extractors/PhpCode.php index d5daf7f961..045f7fa943 100644 --- a/vendor/gettext/gettext/src/Extractors/PhpCode.php +++ b/vendor/gettext/gettext/src/Extractors/PhpCode.php @@ -2,66 +2,87 @@ namespace Gettext\Extractors; +use Exception; use Gettext\Translations; -use Gettext\Utils\PhpFunctionsScanner; +use Gettext\Utils\FunctionsScanner; /** * Class to get gettext strings from php files returning arrays. */ -class PhpCode extends Extractor implements ExtractorInterface +class PhpCode extends Extractor implements ExtractorInterface, ExtractorMultiInterface { - public static $functions = array( - 'gettext' => '__', - '__' => '__', - '__e' => '__', - 'ngettext' => 'n__', - 'n__' => 'n__', - 'n__e' => 'n__', - 'pgettext' => 'p__', - 'p__' => 'p__', - 'p__e' => 'p__', - 'dgettext' => 'd__', - 'd__' => 'd__', - 'd__e' => 'd__', - 'dpgettext' => 'dp__', - 'dp__' => 'dp__', - 'dp__e' => 'dp__', - 'npgettext' => 'np__', - 'np__' => 'np__', - 'np__e' => 'np__', - 'dnpgettext' => 'dnp__', - 'dnp__' => 'dnp__', - 'dnp__e' => 'dnp__', - ); + public static $options = [ + // - false: to not extract comments + // - empty string: to extract all comments + // - non-empty string: to extract comments that start with that string + // - array with strings to extract comments format. + 'extractComments' => false, + + 'constants' => [], + + 'functions' => [ + 'gettext' => 'gettext', + '__' => 'gettext', + 'ngettext' => 'ngettext', + 'n__' => 'ngettext', + 'pgettext' => 'pgettext', + 'p__' => 'pgettext', + 'dgettext' => 'dgettext', + 'd__' => 'dgettext', + 'dngettext' => 'dngettext', + 'dn__' => 'dngettext', + 'dpgettext' => 'dpgettext', + 'dp__' => 'dpgettext', + 'npgettext' => 'npgettext', + 'np__' => 'npgettext', + 'dnpgettext' => 'dnpgettext', + 'dnp__' => 'dnpgettext', + 'noop' => 'noop', + 'noop__' => 'noop', + ], + ]; + + protected static $functionsScannerClass = 'Gettext\Utils\PhpFunctionsScanner'; /** - * Set to: - * - false to not extract comments - * - empty string to extract all comments - * - non-empty string to extract comments that start with that string. - * - * @var string|false + * {@inheritdoc} + * @throws Exception */ - public static $extractComments = false; + public static function fromString($string, Translations $translations, array $options = []) + { + static::fromStringMultiple($string, [$translations], $options); + } /** - * {@inheritdoc} + * @inheritDoc + * @throws Exception */ - public static function fromString($string, Translations $translations = null, $file = '') + public static function fromStringMultiple($string, array $translations, array $options = []) { - if ($translations === null) { - $translations = new Translations(); - } + $options += static::$options; + + /** @var FunctionsScanner $functions */ + $functions = new static::$functionsScannerClass($string); - $functions = new PhpFunctionsScanner($string); - if (self::$extractComments !== false) { - $functions->enableCommentsExtraction(self::$extractComments); + if ($options['extractComments'] !== false) { + $functions->enableCommentsExtraction($options['extractComments']); } - $functions->saveGettextFunctions(self::$functions, $translations, $file); - return $translations; + $functions->saveGettextFunctions($translations, $options); } + /** + * @inheritDoc + */ + public static function fromFileMultiple($file, array $translations, array $options = []) + { + foreach (static::getFiles($file) as $file) { + $options['file'] = $file; + static::fromStringMultiple(static::readFile($file), $translations, $options); + } + } + + /** * Decodes a T_CONSTANT_ENCAPSED_STRING string. * @@ -76,43 +97,51 @@ public static function convertString($value) } if ($value[0] === "'") { - return strtr(substr($value, 1, -1), array('\\\\' => '\\', '\\\'' => '\'')); + return strtr(substr($value, 1, -1), ['\\\\' => '\\', '\\\'' => '\'']); } $value = substr($value, 1, -1); - return preg_replace_callback('/\\\(n|r|t|v|e|f|\$|"|\\\|x[0-9A-Fa-f]{1,2}|u{[0-9a-f]{1,6}}|[0-7]{1,3})/', function ($match) { - switch ($match[1][0]) { - case 'n': - return "\n"; - case 'r': - return "\r"; - case 't': - return "\t"; - case 'v': - return "\v"; - case 'e': - return "\e"; - case 'f': - return "\f"; - case '$': - return '$'; - case '"': - return '"'; - case '\\': - return '\\'; - case 'x': - return chr(hexdec(substr($match[0], 1))); - case 'u': - return self::unicodeChar(hexdec(substr($match[0], 1))); - default: - return chr(octdec($match[0])); - } - }, $value); + return preg_replace_callback( + '/\\\(n|r|t|v|e|f|\$|"|\\\|x[0-9A-Fa-f]{1,2}|u{[0-9a-f]{1,6}}|[0-7]{1,3})/', + function ($match) { + switch ($match[1][0]) { + case 'n': + return "\n"; + case 'r': + return "\r"; + case 't': + return "\t"; + case 'v': + return "\v"; + case 'e': + return "\e"; + case 'f': + return "\f"; + case '$': + return '$'; + case '"': + return '"'; + case '\\': + return '\\'; + case 'x': + return chr(hexdec(substr($match[1], 1))); + case 'u': + return static::unicodeChar(hexdec(substr($match[1], 1))); + default: + return chr(octdec($match[1])); + } + }, + $value + ); } - //http://php.net/manual/en/function.chr.php#118804 - private static function unicodeChar($dec) + /** + * @param $dec + * @return string|null + * @see http://php.net/manual/en/function.chr.php#118804 + */ + protected static function unicodeChar($dec) { if ($dec < 0x80) { return chr($dec); @@ -120,20 +149,22 @@ private static function unicodeChar($dec) if ($dec < 0x0800) { return chr(0xC0 + ($dec >> 6)) - .chr(0x80 + ($dec & 0x3f)); + . chr(0x80 + ($dec & 0x3f)); } if ($dec < 0x010000) { return chr(0xE0 + ($dec >> 12)) - .chr(0x80 + (($dec >> 6) & 0x3f)) - .chr(0x80 + ($dec & 0x3f)); + . chr(0x80 + (($dec >> 6) & 0x3f)) + . chr(0x80 + ($dec & 0x3f)); } if ($dec < 0x200000) { return chr(0xF0 + ($dec >> 18)) - .chr(0x80 + (($dec >> 12) & 0x3f)) - .chr(0x80 + (($dec >> 6) & 0x3f)) - .chr(0x80 + ($dec & 0x3f)); + . chr(0x80 + (($dec >> 12) & 0x3f)) + . chr(0x80 + (($dec >> 6) & 0x3f)) + . chr(0x80 + ($dec & 0x3f)); } + + return null; } } diff --git a/vendor/gettext/gettext/src/Extractors/Po.php b/vendor/gettext/gettext/src/Extractors/Po.php index f902444f8d..a5ee56b88e 100644 --- a/vendor/gettext/gettext/src/Extractors/Po.php +++ b/vendor/gettext/gettext/src/Extractors/Po.php @@ -4,41 +4,39 @@ use Gettext\Translations; use Gettext\Translation; +use Gettext\Utils\HeadersExtractorTrait; /** * Class to get gettext strings from php files returning arrays. */ class Po extends Extractor implements ExtractorInterface { + use HeadersExtractorTrait; + /** * Parses a .po file and append the translations found in the Translations instance. * * {@inheritdoc} */ - public static function fromString($string, Translations $translations = null, $file = '') + public static function fromString($string, Translations $translations, array $options = []) { - if ($translations === null) { - $translations = new Translations(); - } - $lines = explode("\n", $string); $i = 0; - $translation = new Translation('', ''); + $translation = $translations->createNewTranslation('', ''); for ($n = count($lines); $i < $n; ++$i) { $line = trim($lines[$i]); - - $line = self::fixMultiLines($line, $lines, $i); + $line = static::fixMultiLines($line, $lines, $i); if ($line === '') { if ($translation->is('', '')) { - self::parseHeaders($translation->getTranslation(), $translations); + static::extractHeaders($translation->getTranslation(), $translations); } elseif ($translation->hasOriginal()) { $translations[] = $translation; } - $translation = new Translation('', ''); + $translation = $translations->createNewTranslation('', ''); continue; } @@ -46,6 +44,14 @@ public static function fromString($string, Translations $translations = null, $f $key = $splitLine[0]; $data = isset($splitLine[1]) ? $splitLine[1] : ''; + if ($key === '#~') { + $translation->setDisabled(true); + + $splitLine = preg_split('/\s+/', $data, 2); + $key = $splitLine[0]; + $data = isset($splitLine[1]) ? $splitLine[1] : ''; + } + switch ($key) { case '#': $translation->addComment($data); @@ -74,58 +80,66 @@ public static function fromString($string, Translations $translations = null, $f break; case 'msgctxt': - $translation = $translation->getClone(self::convertString($data)); + $translation = $translation->getClone(static::convertString($data)); $append = 'Context'; break; case 'msgid': - $translation = $translation->getClone(null, self::convertString($data)); + $translation = $translation->getClone(null, static::convertString($data)); $append = 'Original'; break; case 'msgid_plural': - $translation->setPlural(self::convertString($data)); + $translation->setPlural(static::convertString($data)); $append = 'Plural'; break; case 'msgstr': case 'msgstr[0]': - $translation->setTranslation(self::convertString($data)); + $translation->setTranslation(static::convertString($data)); $append = 'Translation'; break; case 'msgstr[1]': - $translation->setPluralTranslation(self::convertString($data), 0); + $translation->setPluralTranslations([static::convertString($data)]); $append = 'PluralTranslation'; break; default: if (strpos($key, 'msgstr[') === 0) { - $translation->setPluralTranslation(self::convertString($data), intval(substr($key, 7, -1)) - 1); + $p = $translation->getPluralTranslations(); + $p[] = static::convertString($data); + + $translation->setPluralTranslations($p); $append = 'PluralTranslation'; break; } if (isset($append)) { if ($append === 'Context') { - $translation = $translation->getClone($translation->getContext()."\n".self::convertString($data)); + $translation = $translation->getClone($translation->getContext() + ."\n" + .static::convertString($data)); break; } if ($append === 'Original') { - $translation = $translation->getClone(null, $translation->getOriginal()."\n".self::convertString($data)); + $translation = $translation->getClone(null, $translation->getOriginal() + ."\n" + .static::convertString($data)); break; } if ($append === 'PluralTranslation') { - $key = count($translation->getPluralTranslation()) - 1; - $translation->setPluralTranslation($translation->getPluralTranslation($key)."\n".self::convertString($data), $key); + $p = $translation->getPluralTranslations(); + $p[] = array_pop($p)."\n".static::convertString($data); + $translation->setPluralTranslations($p); break; } $getMethod = 'get'.$append; $setMethod = 'set'.$append; - $translation->$setMethod($translation->$getMethod()."\n".self::convertString($data)); + $translation->$setMethod($translation->$getMethod()."\n".static::convertString($data)); } break; } @@ -134,46 +148,6 @@ public static function fromString($string, Translations $translations = null, $f if ($translation->hasOriginal() && !in_array($translation, iterator_to_array($translations))) { $translations[] = $translation; } - - return $translations; - } - - /** - * Checks if it is a header definition line. Useful for distguishing between header definitions - * and possible continuations of a header entry. - * - * @param string $line Line to parse - * - * @return bool - */ - private static function isHeaderDefinition($line) - { - return (bool) preg_match('/^[\w-]+:/', $line); - } - - /** - * Parse the po headers. - * - * @param string $headers - * @param Translations $translations - */ - private static function parseHeaders($headers, Translations $translations) - { - $headers = explode("\n", $headers); - $currentHeader = null; - - foreach ($headers as $line) { - $line = self::convertString($line); - - if (self::isHeaderDefinition($line)) { - $header = array_map('trim', explode(':', $line, 2)); - $currentHeader = $header[0]; - $translations->setHeader($currentHeader, $header[1]); - } else { - $entry = $translations->getHeader($currentHeader); - $translations->setHeader($currentHeader, $entry.$line); - } - } } /** @@ -185,7 +159,7 @@ private static function parseHeaders($headers, Translations $translations) * * @return string */ - private static function fixMultiLines($line, array $lines, &$i) + protected static function fixMultiLines($line, array $lines, &$i) { for ($j = $i, $t = count($lines); $j < $t; ++$j) { if (substr($line, -1, 1) == '"' @@ -221,7 +195,7 @@ public static function convertString($value) return strtr( $value, - array( + [ '\\\\' => '\\', '\\a' => "\x07", '\\b' => "\x08", @@ -231,7 +205,7 @@ public static function convertString($value) '\\f' => "\x0c", '\\r' => "\r", '\\"' => '"', - ) + ] ); } } diff --git a/vendor/gettext/gettext/src/Extractors/Twig.php b/vendor/gettext/gettext/src/Extractors/Twig.php index baab879853..2060d082b4 100644 --- a/vendor/gettext/gettext/src/Extractors/Twig.php +++ b/vendor/gettext/gettext/src/Extractors/Twig.php @@ -3,73 +3,43 @@ namespace Gettext\Extractors; use Gettext\Translations; -use Twig_Loader_String; +use Twig_Loader_Array; use Twig_Environment; +use Twig_Source; +use Twig_Extensions_Extension_I18n; /** * Class to get gettext strings from twig files returning arrays. */ class Twig extends Extractor implements ExtractorInterface { - /** - * Twig instance. - * - * @var Twig_Environment - */ - protected static $twig; + public static $options = [ + 'extractComments' => 'notes:', + 'twig' => null, + ]; /** * {@inheritdoc} */ - public static function fromString($string, Translations $translations = null, $file = '') + public static function fromString($string, Translations $translations, array $options = []) { - self::addExtension('Twig_Extensions_Extension_I18n'); - - $string = self::$twig->compileSource($string); + $options += static::$options; - // add default global php gettext functions - PhpCode::$functions['gettext'] = '__'; - PhpCode::$functions['ngettext'] = '__'; - PhpCode::$functions['_'] = '__'; + $twig = $options['twig'] ?: static::createTwig(); - return PhpCode::fromString($string, $translations, $file); + PhpCode::fromString($twig->compileSource(new Twig_Source($string, '')), $translations, $options); } /** - * Initialise Twig if it isn't already, and add a given Twig extension. - * This must be called before calling fromString(). - * - * @param mixed $extension Already initialised extension to add - */ - public static function addExtension($extension) - { - // initialise twig - if (!isset(self::$twig)) { - $twigCompiler = new Twig_Loader_String(); - - self::$twig = new Twig_Environment($twigCompiler); - } - - if (!self::checkHasExtensionByClassName($extension)) { - self::$twig->addExtension(new $extension()); - } - } - - /** - * Checks if a given Twig extension is already registered or not. - * - * @param string Name of Twig extension to check + * Returns a Twig instance. * - * @return bool Whether it has been registered already or not + * @return Twig_Environment */ - protected static function checkHasExtensionByClassName($className) + protected static function createTwig() { - foreach (self::$twig->getExtensions() as $extension) { - if ($className == get_class($extension)) { - return true; - } - } + $twig = new Twig_Environment(new Twig_Loader_Array(['' => ''])); + $twig->addExtension(new Twig_Extensions_Extension_I18n()); - return false; + return static::$options['twig'] = $twig; } } diff --git a/vendor/gettext/gettext/src/Extractors/VueJs.php b/vendor/gettext/gettext/src/Extractors/VueJs.php new file mode 100644 index 0000000000..0d29f45628 --- /dev/null +++ b/vendor/gettext/gettext/src/Extractors/VueJs.php @@ -0,0 +1,423 @@ +<?php +/** @noinspection PhpComposerExtensionStubsInspection */ + +namespace Gettext\Extractors; + +use DOMAttr; +use DOMDocument; +use DOMElement; +use DOMNode; +use Exception; +use Gettext\Translations; +use Gettext\Utils\FunctionsScanner; + +/** + * Class to get gettext strings from VueJS template files. + */ +class VueJs extends Extractor implements ExtractorInterface, ExtractorMultiInterface +{ + public static $options = [ + 'constants' => [], + + 'functions' => [ + 'gettext' => 'gettext', + '__' => 'gettext', + 'ngettext' => 'ngettext', + 'n__' => 'ngettext', + 'pgettext' => 'pgettext', + 'p__' => 'pgettext', + 'dgettext' => 'dgettext', + 'd__' => 'dgettext', + 'dngettext' => 'dngettext', + 'dn__' => 'dngettext', + 'dpgettext' => 'dpgettext', + 'dp__' => 'dpgettext', + 'npgettext' => 'npgettext', + 'np__' => 'npgettext', + 'dnpgettext' => 'dnpgettext', + 'dnp__' => 'dnpgettext', + 'noop' => 'noop', + 'noop__' => 'noop', + ], + ]; + + protected static $functionsScannerClass = 'Gettext\Utils\JsFunctionsScanner'; + + /** + * @inheritDoc + * @throws Exception + */ + public static function fromFileMultiple($file, array $translations, array $options = []) + { + foreach (static::getFiles($file) as $file) { + $options['file'] = $file; + static::fromStringMultiple(static::readFile($file), $translations, $options); + } + } + + /** + * @inheritdoc + * @throws Exception + */ + public static function fromString($string, Translations $translations, array $options = []) + { + static::fromStringMultiple($string, [$translations], $options); + } + + /** + * @inheritDoc + * @throws Exception + */ + public static function fromStringMultiple($string, array $translations, array $options = []) + { + $options += static::$options; + $options += [ + // HTML attribute prefixes we parse as JS which could contain translations (are JS expressions) + 'attributePrefixes' => [ + ':', + 'v-bind:', + 'v-on:', + 'v-text', + ], + // HTML Tags to parse + 'tagNames' => [ + 'translate', + ], + // HTML tags to parse when attribute exists + 'tagAttributes' => [ + 'v-translate', + ], + // Comments + 'commentAttributes' => [ + 'translate-comment', + ], + 'contextAttributes' => [ + 'translate-context', + ], + // Attribute with plural content + 'pluralAttributes' => [ + 'translate-plural', + ], + ]; + + // Ok, this is the weirdest hack, but let me explain: + // On Linux (Mac is fine), when converting HTML to DOM, new lines get trimmed after the first tag. + // So if there are new lines between <template> and next element, they are lost + // So we insert a "." which is a text node, and it will prevent that newlines are stripped between elements. + // Same thing happens between template and script tag. + $string = str_replace('<template>', '<template>.', $string); + $string = str_replace('</template>', '</template>.', $string); + + // Normalize newlines + $string = str_replace(["\r\n", "\n\r", "\r"], "\n", $string); + + // VueJS files are valid HTML files, we will operate with the DOM here + $dom = static::convertHtmlToDom($string); + + $script = static::extractScriptTag($string); + + // Parse the script part as a regular JS code + if ($script) { + $scriptLineNumber = $dom->getElementsByTagName('script')->item(0)->getLineNo(); + static::getScriptTranslationsFromString( + $script, + $translations, + $options, + $scriptLineNumber - 1 + ); + } + + // Template part is parsed separately, all variables will be extracted + // and handled as a regular JS code + $template = $dom->getElementsByTagName('template')->item(0); + if ($template) { + static::getTemplateTranslations( + $template, + $translations, + $options, + $template->getLineNo() - 1 + ); + } + } + + /** + * Extracts script tag contents using regex instead of DOM operations. + * If we parse using DOM, some contents may change, for example, tags within strings will be stripped + * + * @param $string + * @return bool|string + */ + protected static function extractScriptTag($string) + { + if (preg_match('#<\s*?script\b[^>]*>(.*?)</script\b[^>]*>#s', $string, $matches)) { + return $matches[1]; + } + + return ''; + } + + /** + * @param string $html + * @return DOMDocument + */ + protected static function convertHtmlToDom($html) + { + $dom = new DOMDocument; + + libxml_use_internal_errors(true); + + // Prepend xml encoding so DOMDocument document handles UTF8 correctly. + // Assuming that vue template files will not have any xml encoding tags, because duplicate tags may be ignored. + $dom->loadHTML('<?xml encoding="utf-8"?>' . $html); + + libxml_clear_errors(); + + return $dom; + } + + /** + * Extract translations from script part + * + * @param string $scriptContents Only script tag contents, not the whole template + * @param Translations|Translations[] $translations One or multiple domain Translation objects + * @param array $options + * @param int $lineOffset Number of lines the script is offset in the vue template file + * @throws Exception + */ + protected static function getScriptTranslationsFromString( + $scriptContents, + $translations, + array $options = [], + $lineOffset = 0 + ) { + /** @var FunctionsScanner $functions */ + $functions = new static::$functionsScannerClass($scriptContents); + $options['lineOffset'] = $lineOffset; + $functions->saveGettextFunctions($translations, $options); + } + + /** + * Parse template to extract all translations (element content and dynamic element attributes) + * + * @param DOMNode $dom + * @param Translations|Translations[] $translations One or multiple domain Translation objects + * @param array $options + * @param int $lineOffset Line number where the template part starts in the vue file + * @throws Exception + */ + protected static function getTemplateTranslations( + DOMNode $dom, + $translations, + array $options, + $lineOffset = 0 + ) { + // Build a JS string from all template attribute expressions + $fakeAttributeJs = static::getTemplateAttributeFakeJs($options, $dom); + + // 1 line offset is necessary because parent template element was ignored when converting to DOM + static::getScriptTranslationsFromString($fakeAttributeJs, $translations, $options, $lineOffset); + + // Build a JS string from template element content expressions + $fakeTemplateJs = static::getTemplateFakeJs($dom); + static::getScriptTranslationsFromString($fakeTemplateJs, $translations, $options, $lineOffset); + + static::getTagTranslations($options, $dom, $translations); + } + + /** + * @param array $options + * @param DOMNode $dom + * @param Translations|Translations[] $translations + */ + protected static function getTagTranslations(array $options, DOMNode $dom, $translations) + { + // Since tag scanning does not support domains, we always use the first translation given + $translations = is_array($translations) ? reset($translations) : $translations; + + $children = $dom->childNodes; + for ($i = 0; $i < $children->length; $i++) { + $node = $children->item($i); + + if (!($node instanceof DOMElement)) { + continue; + } + + $translatable = false; + + if (in_array($node->tagName, $options['tagNames'], true)) { + $translatable = true; + } + + $attrList = $node->attributes; + $context = null; + $plural = ""; + $comment = null; + + for ($j = 0; $j < $attrList->length; $j++) { + /** @var DOMAttr $domAttr */ + $domAttr = $attrList->item($j); + // Check if this is a dynamic vue attribute + if (in_array($domAttr->name, $options['tagAttributes'])) { + $translatable = true; + } + if (in_array($domAttr->name, $options['contextAttributes'])) { + $context = $domAttr->value; + } + if (in_array($domAttr->name, $options['pluralAttributes'])) { + $plural = $domAttr->value; + } + if (in_array($domAttr->name, $options['commentAttributes'])) { + $comment = $domAttr->value; + } + } + + if ($translatable) { + $translation = $translations->insert($context, trim($node->textContent), $plural); + $translation->addReference($options['file'], $node->getLineNo()); + if ($comment) { + $translation->addExtractedComment($comment); + } + } + + if ($node->hasChildNodes()) { + static::getTagTranslations($options, $node, $translations); + } + } + } + + /** + * Extract JS expressions from element attribute bindings (excluding text within elements) + * For example: <span :title="__('extract this')"> skip element content </span> + * + * @param array $options + * @param DOMNode $dom + * @return string JS code + */ + protected static function getTemplateAttributeFakeJs(array $options, DOMNode $dom) + { + $expressionsByLine = static::getVueAttributeExpressions($options['attributePrefixes'], $dom); + + if (empty($expressionsByLine)) { + return ''; + } + + $maxLines = max(array_keys($expressionsByLine)); + $fakeJs = ''; + + for ($line = 1; $line <= $maxLines; $line++) { + if (isset($expressionsByLine[$line])) { + $fakeJs .= implode("; ", $expressionsByLine[$line]); + } + $fakeJs .= "\n"; + } + + return $fakeJs; + } + + /** + * Loop DOM element recursively and parse out all dynamic vue attributes which are basically JS expressions + * + * @param array $attributePrefixes List of attribute prefixes we parse as JS (may contain translations) + * @param DOMNode $dom + * @param array $expressionByLine [lineNumber => [jsExpression, ..], ..] + * @return array [lineNumber => [jsExpression, ..], ..] + */ + protected static function getVueAttributeExpressions( + array $attributePrefixes, + DOMNode $dom, + array &$expressionByLine = [] + ) { + $children = $dom->childNodes; + + for ($i = 0; $i < $children->length; $i++) { + $node = $children->item($i); + + if (!($node instanceof DOMElement)) { + continue; + } + $attrList = $node->attributes; + + for ($j = 0; $j < $attrList->length; $j++) { + /** @var DOMAttr $domAttr */ + $domAttr = $attrList->item($j); + + // Check if this is a dynamic vue attribute + if (static::isAttributeMatching($domAttr->name, $attributePrefixes)) { + $line = $domAttr->getLineNo(); + $expressionByLine += [$line => []]; + $expressionByLine[$line][] = $domAttr->value; + } + } + + if ($node->hasChildNodes()) { + $expressionByLine = static::getVueAttributeExpressions($attributePrefixes, $node, $expressionByLine); + } + } + + return $expressionByLine; + } + + /** + * Check if this attribute name should be parsed for translations + * + * @param string $attributeName + * @param string[] $attributePrefixes + * @return bool + */ + protected static function isAttributeMatching($attributeName, $attributePrefixes) + { + foreach ($attributePrefixes as $prefix) { + if (strpos($attributeName, $prefix) === 0) { + return true; + } + } + return false; + } + + /** + * Extract JS expressions from within template elements (excluding attributes) + * For example: <span :title="skip attributes"> {{__("extract element content")}} </span> + * + * @param DOMNode $dom + * @return string JS code + */ + protected static function getTemplateFakeJs(DOMNode $dom) + { + $fakeJs = ''; + $lines = explode("\n", $dom->textContent); + + // Build a fake JS file from template by extracting JS expressions within each template line + foreach ($lines as $line) { + $expressionMatched = static::parseOneTemplateLine($line); + + $fakeJs .= implode("; ", $expressionMatched) . "\n"; + } + + return $fakeJs; + } + + /** + * Match JS expressions in a template line + * + * @param string $line + * @return string[] + */ + protected static function parseOneTemplateLine($line) + { + $line = trim($line); + + if (!$line) { + return []; + } + + $regex = '#\{\{(.*?)\}\}#'; + + preg_match_all($regex, $line, $matches); + + $matched = array_map(function ($v) { + return trim($v, '\'"{}'); + }, $matches[1]); + + return $matched; + } +} diff --git a/vendor/gettext/gettext/src/Extractors/Xliff.php b/vendor/gettext/gettext/src/Extractors/Xliff.php new file mode 100644 index 0000000000..06ea1aacbf --- /dev/null +++ b/vendor/gettext/gettext/src/Extractors/Xliff.php @@ -0,0 +1,86 @@ +<?php + +namespace Gettext\Extractors; + +use Gettext\Translations; +use Gettext\Translation; +use SimpleXMLElement; + +/** + * Class to get gettext strings from xliff format. + */ +class Xliff extends Extractor implements ExtractorInterface +{ + + public static $options = [ + 'unitid_as_id' => false + ]; + + /** + * {@inheritdoc} + */ + public static function fromString($string, Translations $translations, array $options = []) + { + $options += static::$options; + + $xml = new SimpleXMLElement($string, null, false); + + foreach ($xml->file as $file) { + if (isset($file->notes)) { + foreach ($file->notes->note as $note) { + $translations->setHeader($note['id'], (string) $note); + } + } + + foreach ($file->unit as $unit) { + foreach ($unit->segment as $segment) { + $targets = []; + + foreach ($segment->target as $target) { + $targets[] = (string) $target; + } + + $translation = $translations->createNewTranslation(null, (string) $segment->source); + if (isset($unit['id'])) { + $unitId = (string) $unit['id']; + $translation->addComment("XLIFF_UNIT_ID: $unitId"); + if ($options['unitid_as_id']) { + $translation->setId($unitId); + } + } + $translation->setTranslation(array_shift($targets)); + $translation->setPluralTranslations($targets); + + if (isset($unit->notes)) { + foreach ($unit->notes->note as $note) { + switch ($note['category']) { + case 'context': + $translation = $translation->getClone((string) $note); + break; + + case 'extracted-comment': + $translation->addExtractedComment((string) $note); + break; + + case 'flag': + $translation->addFlag((string) $note); + break; + + case 'reference': + $ref = explode(':', (string) $note, 2); + $translation->addReference($ref[0], isset($ref[1]) ? $ref[1] : null); + break; + + default: + $translation->addComment((string) $note); + break; + } + } + } + + $translations[] = $translation; + } + } + } + } +} diff --git a/vendor/gettext/gettext/src/Extractors/Yaml.php b/vendor/gettext/gettext/src/Extractors/Yaml.php new file mode 100644 index 0000000000..9060eaf3cb --- /dev/null +++ b/vendor/gettext/gettext/src/Extractors/Yaml.php @@ -0,0 +1,27 @@ +<?php + +namespace Gettext\Extractors; + +use Gettext\Translations; +use Gettext\Utils\MultidimensionalArrayTrait; +use Symfony\Component\Yaml\Yaml as YamlParser; + +/** + * Class to get gettext strings from yaml. + */ +class Yaml extends Extractor implements ExtractorInterface +{ + use MultidimensionalArrayTrait; + + /** + * {@inheritdoc} + */ + public static function fromString($string, Translations $translations, array $options = []) + { + $messages = YamlParser::parse($string); + + if (is_array($messages)) { + static::fromArray($messages, $translations); + } + } +} diff --git a/vendor/gettext/gettext/src/Extractors/YamlDictionary.php b/vendor/gettext/gettext/src/Extractors/YamlDictionary.php index 541278f98d..bfba649cc8 100644 --- a/vendor/gettext/gettext/src/Extractors/YamlDictionary.php +++ b/vendor/gettext/gettext/src/Extractors/YamlDictionary.php @@ -3,30 +3,25 @@ namespace Gettext\Extractors; use Gettext\Translations; -use Symfony\Component\Yaml\Parser; +use Gettext\Utils\DictionaryTrait; +use Symfony\Component\Yaml\Yaml as YamlParser; /** - * Class to get gettext strings from plain json. + * Class to get gettext strings from yaml. */ class YamlDictionary extends Extractor implements ExtractorInterface { + use DictionaryTrait; + /** * {@inheritdoc} */ - public static function fromString($string, Translations $translations = null, $file = '') + public static function fromString($string, Translations $translations, array $options = []) { - if ($translations === null) { - $translations = new Translations(); - } + $messages = YamlParser::parse($string); - $yml = new Parser(); - - if (($entries = $yml->parse($string))) { - foreach ($entries as $original => $translation) { - $translations->insert(null, $original)->setTranslation($translation); - } + if (is_array($messages)) { + static::fromArray($messages, $translations); } - - return $translations; } } diff --git a/vendor/gettext/gettext/src/Generators/Csv.php b/vendor/gettext/gettext/src/Generators/Csv.php new file mode 100644 index 0000000000..6190c63a81 --- /dev/null +++ b/vendor/gettext/gettext/src/Generators/Csv.php @@ -0,0 +1,56 @@ +<?php + +namespace Gettext\Generators; + +use Gettext\Translations; +use Gettext\Utils\HeadersGeneratorTrait; +use Gettext\Utils\CsvTrait; + +/** + * Class to export translations to csv. + */ +class Csv extends Generator implements GeneratorInterface +{ + use HeadersGeneratorTrait; + use CsvTrait; + + public static $options = [ + 'includeHeaders' => false, + 'delimiter' => ",", + 'enclosure' => '"', + 'escape_char' => "\\" + ]; + + /** + * {@parentDoc}. + */ + public static function toString(Translations $translations, array $options = []) + { + $options += static::$options; + $handle = fopen('php://memory', 'w'); + + if ($options['includeHeaders']) { + static::fputcsv($handle, ['', '', static::generateHeaders($translations)], $options); + } + + foreach ($translations as $translation) { + if ($translation->isDisabled()) { + continue; + } + + $line = [$translation->getContext(), $translation->getOriginal(), $translation->getTranslation()]; + + if ($translation->hasPluralTranslations(true)) { + $line = array_merge($line, $translation->getPluralTranslations()); + } + + static::fputcsv($handle, $line, $options); + } + + rewind($handle); + $csv = stream_get_contents($handle); + fclose($handle); + + return $csv; + } +} diff --git a/vendor/gettext/gettext/src/Generators/CsvDictionary.php b/vendor/gettext/gettext/src/Generators/CsvDictionary.php index 646f3357df..7c424803b3 100644 --- a/vendor/gettext/gettext/src/Generators/CsvDictionary.php +++ b/vendor/gettext/gettext/src/Generators/CsvDictionary.php @@ -3,37 +3,35 @@ namespace Gettext\Generators; use Gettext\Translations; +use Gettext\Utils\DictionaryTrait; +use Gettext\Utils\CsvTrait; class CsvDictionary extends Generator implements GeneratorInterface { + use DictionaryTrait; + use CsvTrait; + + public static $options = [ + 'includeHeaders' => false, + 'delimiter' => ",", + 'enclosure' => '"', + 'escape_char' => "\\" + ]; + /** * {@parentDoc}. */ - public static function toString(Translations $translations) + public static function toString(Translations $translations, array $options = []) { - $array = PhpArray::toArray($translations); - - //for a simple json translation dictionary, one domain is supported - $values = current($array); - - // remove meta / header data - if (array_key_exists('', $values)) { - unset($values['']); - } - + $options += static::$options; $handle = fopen('php://memory', 'w'); - //map to a simple csv dictionary (no plurals) - foreach ($values as $original => $translated) { - if (!isset($translated[1])) { - $translated[1] = ''; - } - fputcsv($handle, array($original, $translated[1])); + foreach (static::toArray($translations, $options['includeHeaders']) as $original => $translation) { + static::fputcsv($handle, [$original, $translation], $options); } rewind($handle); $csv = stream_get_contents($handle); - fclose($handle); return $csv; diff --git a/vendor/gettext/gettext/src/Generators/Generator.php b/vendor/gettext/gettext/src/Generators/Generator.php index cede3fc649..431450fcec 100644 --- a/vendor/gettext/gettext/src/Generators/Generator.php +++ b/vendor/gettext/gettext/src/Generators/Generator.php @@ -4,19 +4,14 @@ use Gettext\Translations; -abstract class Generator +abstract class Generator implements GeneratorInterface { /** - * Saves the translations in a file. - * - * @param Translations $translations - * @param string $file - * - * @return bool + * {@inheritdoc} */ - public static function toFile(Translations $translations, $file) + public static function toFile(Translations $translations, $file, array $options = []) { - $content = static::toString($translations); + $content = static::toString($translations, $options); if (file_put_contents($file, $content) === false) { return false; diff --git a/vendor/gettext/gettext/src/Generators/GeneratorInterface.php b/vendor/gettext/gettext/src/Generators/GeneratorInterface.php index 321471a344..db7f1a9bb6 100644 --- a/vendor/gettext/gettext/src/Generators/GeneratorInterface.php +++ b/vendor/gettext/gettext/src/Generators/GeneratorInterface.php @@ -11,17 +11,19 @@ interface GeneratorInterface * * @param Translations $translations * @param string $file + * @param array $options * * @return bool */ - public static function toFile(Translations $translations, $file); + public static function toFile(Translations $translations, $file, array $options = []); /** * Generates a string with the translations ready to save in a file. * * @param Translations $translations + * @param array $options * * @return string */ - public static function toString(Translations $translations); + public static function toString(Translations $translations, array $options = []); } diff --git a/vendor/gettext/gettext/src/Generators/Jed.php b/vendor/gettext/gettext/src/Generators/Jed.php index 050b7cf7e4..32c28e9a9b 100644 --- a/vendor/gettext/gettext/src/Generators/Jed.php +++ b/vendor/gettext/gettext/src/Generators/Jed.php @@ -4,37 +4,63 @@ use Gettext\Translations; -class Jed extends PhpArray implements GeneratorInterface +class Jed extends Generator implements GeneratorInterface { + public static $options = [ + 'json' => 0, + ]; + /** * {@parentDoc}. */ - public static function toString(Translations $translations) + public static function toString(Translations $translations, array $options = []) { - $array = static::toArray($translations); + $domain = $translations->getDomain() ?: 'messages'; + $options += static::$options; - return json_encode($array); + return json_encode([ + $domain => [ + '' => [ + 'domain' => $domain, + 'lang' => $translations->getLanguage() ?: 'en', + 'plural-forms' => $translations->getHeader('Plural-Forms') ?: 'nplurals=2; plural=(n != 1);', + ], + ] + static::buildMessages($translations), + ], $options['json']); } /** - * {@parentdoc}. + * Generates an array with all translations. + * + * @param Translations $translations + * + * @return array */ - protected static function buildArray(Translations $translations) + protected static function buildMessages(Translations $translations) { - $array = array(); - - $context_glue = "\004"; + $pluralForm = $translations->getPluralForms(); + $pluralSize = is_array($pluralForm) ? ($pluralForm[0] - 1) : null; + $messages = []; + $context_glue = '\u0004'; foreach ($translations as $translation) { - $key = ($translation->hasContext() ? $translation->getContext().$context_glue : '').$translation->getOriginal(); + if ($translation->isDisabled()) { + continue; + } - if ($translation->hasPluralTranslation()) { - $array[$key] = array_merge(array($translation->getTranslation()), $translation->getPluralTranslation()); + $key = ($translation->hasContext() ? $translation->getContext().$context_glue : '') + .$translation->getOriginal(); + + if ($translation->hasPluralTranslations(true)) { + $message = $translation->getPluralTranslations($pluralSize); + array_unshift($message, $translation->getTranslation()); } else { - $array[$key] = array($translation->getTranslation()); + $message = [$translation->getTranslation()]; } + + $messages[$key] = $message; } - return $array; + return $messages; } } diff --git a/vendor/gettext/gettext/src/Generators/Json.php b/vendor/gettext/gettext/src/Generators/Json.php new file mode 100644 index 0000000000..32fd750a8c --- /dev/null +++ b/vendor/gettext/gettext/src/Generators/Json.php @@ -0,0 +1,26 @@ +<?php + +namespace Gettext\Generators; + +use Gettext\Translations; +use Gettext\Utils\MultidimensionalArrayTrait; + +class Json extends Generator implements GeneratorInterface +{ + use MultidimensionalArrayTrait; + + public static $options = [ + 'json' => 0, + 'includeHeaders' => false, + ]; + + /** + * {@inheritdoc} + */ + public static function toString(Translations $translations, array $options = []) + { + $options += static::$options; + + return json_encode(static::toArray($translations, $options['includeHeaders'], true), $options['json']); + } +} diff --git a/vendor/gettext/gettext/src/Generators/JsonDictionary.php b/vendor/gettext/gettext/src/Generators/JsonDictionary.php index c9efe6562b..8d57337bd7 100644 --- a/vendor/gettext/gettext/src/Generators/JsonDictionary.php +++ b/vendor/gettext/gettext/src/Generators/JsonDictionary.php @@ -3,34 +3,24 @@ namespace Gettext\Generators; use Gettext\Translations; +use Gettext\Utils\DictionaryTrait; class JsonDictionary extends Generator implements GeneratorInterface { - public static $options = 0; + use DictionaryTrait; + + public static $options = [ + 'json' => 0, + 'includeHeaders' => false, + ]; /** * {@parentDoc}. */ - public static function toString(Translations $translations) + public static function toString(Translations $translations, array $options = []) { - $array = PhpArray::toArray($translations); - - //for a simple json translation dictionary, one domain is supported - $values = current($array); - - // remove meta / header data - if (array_key_exists('', $values)) { - unset($values['']); - } + $options += static::$options; - //map to a simple json dictionary (no plurals) - return json_encode( - array_filter( - array_map(function ($val) { - return isset($val[1]) ? $val[1] : null; - }, $values) - ), - self::$options - ); + return json_encode(static::toArray($translations, $options['includeHeaders']), $options['json']); } } diff --git a/vendor/gettext/gettext/src/Generators/Mo.php b/vendor/gettext/gettext/src/Generators/Mo.php index 49dcc7bb83..92f43e71a3 100644 --- a/vendor/gettext/gettext/src/Generators/Mo.php +++ b/vendor/gettext/gettext/src/Generators/Mo.php @@ -3,29 +3,30 @@ namespace Gettext\Generators; use Gettext\Translations; +use Gettext\Utils\HeadersGeneratorTrait; class Mo extends Generator implements GeneratorInterface { - public static $includeEmptyTranslations = false; + use HeadersGeneratorTrait; + + public static $options = [ + 'includeHeaders' => true, + ]; /** * {@parentDoc}. */ - public static function toString(Translations $translations) + public static function toString(Translations $translations, array $options = []) { - $array = array(); - $headers = ''; - - foreach ($translations->getHeaders() as $headerName => $headerValue) { - $headers .= "$headerName: $headerValue\n"; - } + $options += static::$options; + $messages = []; - if ($headers !== '') { - $array[''] = $headers; + if ($options['includeHeaders']) { + $messages[''] = static::generateHeaders($translations); } foreach ($translations as $translation) { - if (!$translation->hasTranslation() && !static::$includeEmptyTranslations) { + if (!$translation->hasTranslation() || $translation->isDisabled()) { continue; } @@ -35,35 +36,42 @@ public static function toString(Translations $translations) $originalString = $translation->getOriginal(); } - $array[$originalString] = $translation; + $messages[$originalString] = $translation; } - ksort($array); - $numEntries = count($array); + ksort($messages); + $numEntries = count($messages); $originalsTable = ''; $translationsTable = ''; - $originalsIndex = array(); - $translationsIndex = array(); + $originalsIndex = []; + $translationsIndex = []; + $pluralForm = $translations->getPluralForms(); + $pluralSize = is_array($pluralForm) ? ($pluralForm[0] - 1) : null; - foreach ($array as $originalString => $translation) { + foreach ($messages as $originalString => $translation) { if (is_string($translation)) { // Headers $translationString = $translation; } else { /* @var $translation \Gettext\Translation */ - if ($translation->hasPlural()) { + if ($translation->hasPlural() && $translation->hasPluralTranslations(true)) { $originalString .= "\x00".$translation->getPlural(); - } - $translationString = $translation->getTranslation(); - - if ($translation->hasPluralTranslation()) { - $translationString .= "\x00".implode("\x00", $translation->getPluralTranslation()); + $translationString = $translation->getTranslation(); + $translationString .= "\x00".implode("\x00", $translation->getPluralTranslations($pluralSize)); + } else { + $translationString = $translation->getTranslation(); } } - $originalsIndex[] = array('relativeOffset' => strlen($originalsTable), 'length' => strlen($originalString)); + $originalsIndex[] = [ + 'relativeOffset' => strlen($originalsTable), + 'length' => strlen($originalString) + ]; $originalsTable .= $originalString."\x00"; - $translationsIndex[] = array('relativeOffset' => strlen($translationsTable), 'length' => strlen($translationString)); + $translationsIndex[] = [ + 'relativeOffset' => strlen($translationsTable), + 'length' => strlen($translationString) + ]; $translationsTable .= $translationString."\x00"; } diff --git a/vendor/gettext/gettext/src/Generators/PhpArray.php b/vendor/gettext/gettext/src/Generators/PhpArray.php index 1ecda54906..3c91a44775 100644 --- a/vendor/gettext/gettext/src/Generators/PhpArray.php +++ b/vendor/gettext/gettext/src/Generators/PhpArray.php @@ -3,76 +3,38 @@ namespace Gettext\Generators; use Gettext\Translations; +use Gettext\Utils\MultidimensionalArrayTrait; class PhpArray extends Generator implements GeneratorInterface { + use MultidimensionalArrayTrait; + + public static $options = [ + 'includeHeaders' => true, + ]; + /** * {@inheritdoc} */ - public static function toString(Translations $translations) + public static function toString(Translations $translations, array $options = []) { - $array = self::toArray($translations); + $array = static::generate($translations, $options); - return '<?php return '.var_export($array, true).'; ?>'; + return '<?php return '.var_export($array, true).';'; } /** * Generates an array with the translations. * * @param Translations $translations + * @param array $options * * @return array */ - public static function toArray(Translations $translations) + public static function generate(Translations $translations, array $options = []) { - $array = static::buildArray($translations); - - $domain = $translations->getDomain() ?: 'messages'; - $lang = $translations->getLanguage() ?: 'en'; - - $fullArray = array( - $domain => array( - '' => array( - 'domain' => $domain, - 'lang' => $lang, - 'plural-forms' => 'nplurals=2; plural=(n != 1);', - ), - ), - ); - - if ($translations->getHeader('Plural-Forms') !== null) { - $fullArray[$domain]['']['plural-forms'] = $translations->getHeader('Plural-Forms'); - } - - $fullArray[$domain] = array_merge($fullArray[$domain], $array); - - return $fullArray; - } - - /** - * Generates an array with all translations. - * - * @param Translations $translations - * - * @return array - */ - protected static function buildArray(Translations $translations) - { - $array = array(); - - $context_glue = "\004"; - - foreach ($translations as $translation) { - $key = ($translation->hasContext() ? $translation->getContext().$context_glue : '').$translation->getOriginal(); - $entry = array($translation->getPlural(), $translation->getTranslation()); - - if ($translation->hasPluralTranslation()) { - $entry = array_merge($entry, $translation->getPluralTranslation()); - } - - $array[$key] = $entry; - } + $options += static::$options; - return $array; + return static::toArray($translations, $options['includeHeaders'], true); } } diff --git a/vendor/gettext/gettext/src/Generators/Po.php b/vendor/gettext/gettext/src/Generators/Po.php index f369f41c90..48ee5eea8a 100644 --- a/vendor/gettext/gettext/src/Generators/Po.php +++ b/vendor/gettext/gettext/src/Generators/Po.php @@ -6,18 +6,23 @@ class Po extends Generator implements GeneratorInterface { + public static $options = [ + 'noLocation' => false, + ]; + /** * {@parentDoc}. */ - public static function toString(Translations $translations) + public static function toString(Translations $translations, array $options = []) { - $lines = array('msgid ""', 'msgstr ""'); + $options += static::$options; - $headers = $translations->getHeaders(); - $headers['PO-Revision-Date'] = date('c'); + $pluralForm = $translations->getPluralForms(); + $pluralSize = is_array($pluralForm) ? ($pluralForm[0] - 1) : null; + $lines = ['msgid ""', 'msgstr ""']; - foreach ($headers as $name => $value) { - $lines[] = '"'.$name.': '.$value.'\\n"'; + foreach ($translations->getHeaders() as $name => $value) { + $lines[] = sprintf('"%s: %s\\n"', $name, $value); } $lines[] = ''; @@ -36,7 +41,7 @@ public static function toString(Translations $translations) } } - if ($translation->hasReferences()) { + if (!$options['noLocation'] && $translation->hasReferences()) { foreach ($translation->getReferences() as $reference) { $lines[] = '#: '.$reference[0].(!is_null($reference[1]) ? ':'.$reference[1] : null); } @@ -46,20 +51,23 @@ public static function toString(Translations $translations) $lines[] = '#, '.implode(',', $translation->getFlags()); } + $prefix = $translation->isDisabled() ? '#~ ' : ''; + if ($translation->hasContext()) { - $lines[] = 'msgctxt '.self::convertString($translation->getContext()); + $lines[] = $prefix.'msgctxt '.static::convertString($translation->getContext()); } - self::addLines($lines, 'msgid', $translation->getOriginal()); + static::addLines($lines, $prefix.'msgid', $translation->getOriginal()); + if ($translation->hasPlural()) { - self::addLines($lines, 'msgid_plural', $translation->getPlural()); - self::addLines($lines, 'msgstr[0]', $translation->getTranslation()); + static::addLines($lines, $prefix.'msgid_plural', $translation->getPlural()); + static::addLines($lines, $prefix.'msgstr[0]', $translation->getTranslation()); - foreach ($translation->getPluralTranslation() as $k => $v) { - self::addLines($lines, 'msgstr['.($k + 1).']', $v); + foreach ($translation->getPluralTranslations($pluralSize) as $k => $v) { + static::addLines($lines, $prefix.'msgstr['.($k + 1).']', $v); } } else { - self::addLines($lines, 'msgstr', $translation->getTranslation()); + static::addLines($lines, $prefix.'msgstr', $translation->getTranslation()); } $lines[] = ''; @@ -75,16 +83,16 @@ public static function toString(Translations $translations) * * @return string */ - private static function multilineQuote($string) + protected static function multilineQuote($string) { $lines = explode("\n", $string); $last = count($lines) - 1; foreach ($lines as $k => $line) { if ($k === $last) { - $lines[$k] = self::convertString($line); + $lines[$k] = static::convertString($line); } else { - $lines[$k] = self::convertString($line."\n"); + $lines[$k] = static::convertString($line."\n"); } } @@ -98,9 +106,9 @@ private static function multilineQuote($string) * @param string $name * @param string $value */ - private static function addLines(array &$lines, $name, $value) + protected static function addLines(array &$lines, $name, $value) { - $newLines = self::multilineQuote($value); + $newLines = static::multilineQuote($value); if (count($newLines) === 1) { $lines[] = $name.' '.$newLines[0]; @@ -124,13 +132,14 @@ public static function convertString($value) { return '"'.strtr( $value, - array( + [ "\x00" => '', '\\' => '\\\\', "\t" => '\t', + "\r" => '\r', "\n" => '\n', '"' => '\\"', - ) + ] ).'"'; } } diff --git a/vendor/gettext/gettext/src/Generators/Xliff.php b/vendor/gettext/gettext/src/Generators/Xliff.php new file mode 100644 index 0000000000..1e21f12625 --- /dev/null +++ b/vendor/gettext/gettext/src/Generators/Xliff.php @@ -0,0 +1,122 @@ +<?php + +namespace Gettext\Generators; + +use Gettext\Translation; +use Gettext\Translations; +use DOMDocument; + +class Xliff extends Generator implements GeneratorInterface +{ + const UNIT_ID_REGEXP = '/^XLIFF_UNIT_ID: (.*)$/'; + + /** + * {@inheritdoc} + */ + public static function toString(Translations $translations, array $options = []) + { + $dom = new DOMDocument('1.0', 'utf-8'); + $dom->formatOutput = true; + $xliff = $dom->appendChild($dom->createElement('xliff')); + $xliff->setAttribute('xmlns', 'urn:oasis:names:tc:xliff:document:2.0'); + $xliff->setAttribute('version', '2.0'); + $xliff->setAttribute('srcLang', $translations->getLanguage()); + $xliff->setAttribute('trgLang', $translations->getLanguage()); + $file = $xliff->appendChild($dom->createElement('file')); + $file->setAttribute('id', $translations->getDomain().'.'.$translations->getLanguage()); + + //Save headers as notes + $notes = $dom->createElement('notes'); + + foreach ($translations->getHeaders() as $name => $value) { + $notes->appendChild(static::createTextNode($dom, 'note', $value))->setAttribute('id', $name); + } + + if ($notes->hasChildNodes()) { + $file->appendChild($notes); + } + + foreach ($translations as $translation) { + //Find an XLIFF unit ID, if one is available; otherwise generate + $unitId = static::getUnitID($translation)?:md5($translation->getContext().$translation->getOriginal()); + + $unit = $dom->createElement('unit'); + $unit->setAttribute('id', $unitId); + + //Save comments as notes + $notes = $dom->createElement('notes'); + + $notes->appendChild(static::createTextNode($dom, 'note', $translation->getContext())) + ->setAttribute('category', 'context'); + + foreach ($translation->getComments() as $comment) { + //Skip XLIFF unit ID comments. + if (preg_match(static::UNIT_ID_REGEXP, $comment)) { + continue; + } + + $notes->appendChild(static::createTextNode($dom, 'note', $comment)) + ->setAttribute('category', 'comment'); + } + + foreach ($translation->getExtractedComments() as $comment) { + $notes->appendChild(static::createTextNode($dom, 'note', $comment)) + ->setAttribute('category', 'extracted-comment'); + } + + foreach ($translation->getFlags() as $flag) { + $notes->appendChild(static::createTextNode($dom, 'note', $flag)) + ->setAttribute('category', 'flag'); + } + + foreach ($translation->getReferences() as $reference) { + $notes->appendChild(static::createTextNode($dom, 'note', $reference[0].':'.$reference[1])) + ->setAttribute('category', 'reference'); + } + + $unit->appendChild($notes); + + $segment = $unit->appendChild($dom->createElement('segment')); + $segment->appendChild(static::createTextNode($dom, 'source', $translation->getOriginal())); + $segment->appendChild(static::createTextNode($dom, 'target', $translation->getTranslation())); + + foreach ($translation->getPluralTranslations() as $plural) { + if ($plural !== '') { + $segment->appendChild(static::createTextNode($dom, 'target', $plural)); + } + } + + $file->appendChild($unit); + } + + return $dom->saveXML(); + } + + protected static function createTextNode(DOMDocument $dom, $name, $string) + { + $node = $dom->createElement($name); + $text = (preg_match('/[&<>]/', $string) === 1) + ? $dom->createCDATASection($string) + : $dom->createTextNode($string); + $node->appendChild($text); + + return $node; + } + + /** + * Gets the translation's unit ID, if one is available. + * + * @param Translation $translation + * + * @return string|null + */ + public static function getUnitID(Translation $translation) + { + foreach ($translation->getComments() as $comment) { + if (preg_match(static::UNIT_ID_REGEXP, $comment, $matches)) { + return $matches[1]; + } + } + return null; + } +} diff --git a/vendor/gettext/gettext/src/Generators/Yaml.php b/vendor/gettext/gettext/src/Generators/Yaml.php new file mode 100644 index 0000000000..82f5b551de --- /dev/null +++ b/vendor/gettext/gettext/src/Generators/Yaml.php @@ -0,0 +1,32 @@ +<?php + +namespace Gettext\Generators; + +use Gettext\Translations; +use Gettext\Utils\MultidimensionalArrayTrait; +use Symfony\Component\Yaml\Yaml as YamlDumper; + +class Yaml extends Generator implements GeneratorInterface +{ + use MultidimensionalArrayTrait; + + public static $options = [ + 'includeHeaders' => false, + 'indent' => 2, + 'inline' => 4, + ]; + + /** + * {@inheritdoc} + */ + public static function toString(Translations $translations, array $options = []) + { + $options += static::$options; + + return YamlDumper::dump( + static::toArray($translations, $options['includeHeaders']), + $options['inline'], + $options['indent'] + ); + } +} diff --git a/vendor/gettext/gettext/src/Generators/YamlDictionary.php b/vendor/gettext/gettext/src/Generators/YamlDictionary.php index 43e26cf208..1670e0b8a5 100644 --- a/vendor/gettext/gettext/src/Generators/YamlDictionary.php +++ b/vendor/gettext/gettext/src/Generators/YamlDictionary.php @@ -3,37 +3,30 @@ namespace Gettext\Generators; use Gettext\Translations; -use Symfony\Component\Yaml\Dumper; +use Gettext\Utils\DictionaryTrait; +use Symfony\Component\Yaml\Yaml as YamlDumper; class YamlDictionary extends Generator implements GeneratorInterface { + use DictionaryTrait; + + public static $options = [ + 'includeHeaders' => false, + 'indent' => 2, + 'inline' => 3, + ]; + /** - * {@parentDoc}. + * {@inheritdoc} */ - public static function toString(Translations $translations) + public static function toString(Translations $translations, array $options = []) { - $array = PhpArray::toArray($translations); - - //for a simple json translation dictionary, one domain is supported - $values = current($array); + $options += static::$options; - // remove meta / header data - if (array_key_exists('', $values)) { - unset($values['']); - } - - //map to a simple yml dictionary (no plurals) - $yml = new Dumper(); - $output = $yml->dump( - array_map( - function ($val) { - return isset($val[1]) ? $val[1] : null; - }, - $values - ), - 1 + return YamlDumper::dump( + static::toArray($translations, $options['includeHeaders']), + $options['inline'], + $options['indent'] ); - - return $output; } } diff --git a/vendor/gettext/gettext/src/Merge.php b/vendor/gettext/gettext/src/Merge.php new file mode 100644 index 0000000000..43a309bb34 --- /dev/null +++ b/vendor/gettext/gettext/src/Merge.php @@ -0,0 +1,221 @@ +<?php + +namespace Gettext; + +/** + * Static class with merge contants. + */ +final class Merge +{ + const ADD = 1; + const REMOVE = 2; + + const HEADERS_ADD = 4; + const HEADERS_REMOVE = 8; + const HEADERS_OVERRIDE = 16; + + const LANGUAGE_OVERRIDE = 32; + const DOMAIN_OVERRIDE = 64; + const TRANSLATION_OVERRIDE = 128; + + const COMMENTS_OURS = 256; + const COMMENTS_THEIRS = 512; + + const EXTRACTED_COMMENTS_OURS = 1024; + const EXTRACTED_COMMENTS_THEIRS = 2048; + + const FLAGS_OURS = 4096; + const FLAGS_THEIRS = 8192; + + const REFERENCES_OURS = 16384; + const REFERENCES_THEIRS = 32768; + + const DEFAULTS = 5; //1 + 4 + + /** + * Merge the flags of two translations. + * + * @param Translation $from + * @param Translation $to + * @param int $options + */ + public static function mergeFlags(Translation $from, Translation $to, $options = self::DEFAULTS) + { + if ($options & self::FLAGS_THEIRS) { + $to->deleteFlags(); + } + + if (!($options & self::FLAGS_OURS)) { + foreach ($from->getFlags() as $flag) { + $to->addFlag($flag); + } + } + } + + /** + * Merge the extracted comments of two translations. + * + * @param Translation $from + * @param Translation $to + * @param int $options + */ + public static function mergeExtractedComments(Translation $from, Translation $to, $options = self::DEFAULTS) + { + if ($options & self::EXTRACTED_COMMENTS_THEIRS) { + $to->deleteExtractedComments(); + } + + if (!($options & self::EXTRACTED_COMMENTS_OURS)) { + foreach ($from->getExtractedComments() as $comment) { + $to->addExtractedComment($comment); + } + } + } + + /** + * Merge the comments of two translations. + * + * @param Translation $from + * @param Translation $to + * @param int $options + */ + public static function mergeComments(Translation $from, Translation $to, $options = self::DEFAULTS) + { + if ($options & self::COMMENTS_THEIRS) { + $to->deleteComments(); + } + + if (!($options & self::COMMENTS_OURS)) { + foreach ($from->getComments() as $comment) { + $to->addComment($comment); + } + } + } + + /** + * Merge the references of two translations. + * + * @param Translation $from + * @param Translation $to + * @param int $options + */ + public static function mergeReferences(Translation $from, Translation $to, $options = self::DEFAULTS) + { + if ($options & self::REFERENCES_THEIRS) { + $to->deleteReferences(); + } + + if (!($options & self::REFERENCES_OURS)) { + foreach ($from->getReferences() as $reference) { + $to->addReference($reference[0], $reference[1]); + } + } + } + + /** + * Merge the translations of two translations. + * + * @param Translation $from + * @param Translation $to + * @param int $options + */ + public static function mergeTranslation(Translation $from, Translation $to, $options = self::DEFAULTS) + { + $override = (boolean) ($options & self::TRANSLATION_OVERRIDE); + + if (!$to->hasTranslation() || ($from->hasTranslation() && $override)) { + $to->setTranslation($from->getTranslation()); + } + + if (!$to->hasPlural() || ($from->hasPlural() && $override)) { + $to->setPlural($from->getPlural()); + } + + if (!$to->hasPluralTranslations() || ($from->hasPluralTranslations() && $override)) { + $to->setPluralTranslations($from->getPluralTranslations()); + } + } + + /** + * Merge the translations of two translations. + * + * @param Translations $from + * @param Translations $to + * @param int $options + */ + public static function mergeTranslations(Translations $from, Translations $to, $options = self::DEFAULTS) + { + if ($options & self::REMOVE) { + $filtered = []; + + foreach ($to as $entry) { + if ($from->find($entry)) { + $filtered[$entry->getId()] = $entry; + } + } + + $to->exchangeArray($filtered); + } + + foreach ($from as $entry) { + if (($existing = $to->find($entry))) { + $existing->mergeWith($entry, $options); + } elseif ($options & self::ADD) { + $to[] = $entry->getClone(); + } + } + } + + /** + * Merge the headers of two translations. + * + * @param Translations $from + * @param Translations $to + * @param int $options + */ + public static function mergeHeaders(Translations $from, Translations $to, $options = self::DEFAULTS) + { + if ($options & self::HEADERS_REMOVE) { + foreach (array_keys($to->getHeaders()) as $name) { + if ($from->getHeader($name) === null) { + $to->deleteHeader($name); + } + } + } + + foreach ($from->getHeaders() as $name => $value) { + $current = $to->getHeader($name); + + if (empty($current)) { + if ($options & self::HEADERS_ADD) { + $to->setHeader($name, $value); + } + continue; + } + + if (empty($value)) { + continue; + } + + switch ($name) { + case Translations::HEADER_LANGUAGE: + case Translations::HEADER_PLURAL: + if ($options & self::LANGUAGE_OVERRIDE) { + $to->setHeader($name, $value); + } + break; + + case Translations::HEADER_DOMAIN: + if ($options & self::DOMAIN_OVERRIDE) { + $to->setHeader($name, $value); + } + break; + + default: + if ($options & self::HEADERS_OVERRIDE) { + $to->setHeader($name, $value); + } + } + } + } +} diff --git a/vendor/gettext/gettext/src/Translation.php b/vendor/gettext/gettext/src/Translation.php index f01dc0e369..56fe920688 100644 --- a/vendor/gettext/gettext/src/Translation.php +++ b/vendor/gettext/gettext/src/Translation.php @@ -7,16 +7,17 @@ */ class Translation { + protected $id; protected $context; protected $original; protected $translation = ''; protected $plural; - protected $pluralTranslation = array(); - protected $references = array(); - protected $comments = array(); - protected $extractedComments = array(); - protected $flags = array(); - protected $translationCount; + protected $pluralTranslation = []; + protected $references = []; + protected $comments = []; + protected $extractedComments = []; + protected $flags = []; + protected $disabled = false; /** * Generates the id of a translation (context + glue + original). @@ -31,6 +32,21 @@ public static function generateId($context, $original) return "{$context}\004{$original}"; } + /** + * Create a new instance of a Translation object. + * + * This is a factory method that will work even when Translation is extended. + * + * @param string $context The context of the translation + * @param string $original The original string + * @param string $plural The original plural string + * @return static New Translation instance + */ + public static function create($context, $original, $plural = '') + { + return new static($context, $original, $plural); + } + /** * Construct. * @@ -51,6 +67,8 @@ public function __construct($context, $original, $plural = '') * * @param null|string $context Optional new context * @param null|string $original Optional new original + * + * @return Translation */ public function getClone($context = null, $original = null) { @@ -67,6 +85,19 @@ public function getClone($context = null, $original = null) return $new; } + /** + * Sets the id of this translation. + * @warning The use of this function to set a custom ID will prevent + * Translations::find from matching this translation. + * + * @param string $id + */ + public function setId($id) + { + $this->id = $id; + } + + /** * Returns the id of this translation. * @@ -74,7 +105,10 @@ public function getClone($context = null, $original = null) */ public function getId() { - return static::generateId($this->context, $this->original); + if ($this->id === null) { + return static::generateId($this->context, $this->original); + } + return $this->id; } /** @@ -90,6 +124,30 @@ public function is($context, $original = '') return (($this->context === $context) && ($this->original === $original)) ? true : false; } + /** + * Enable or disable the translation + * + * @param bool $disabled + * + * @return self + */ + public function setDisabled($disabled) + { + $this->disabled = (bool) $disabled; + + return $this; + } + + /** + * Returns whether the translation is disabled + * + * @return bool + */ + public function isDisabled() + { + return $this->disabled; + } + /** * Gets the original string. * @@ -114,10 +172,14 @@ public function hasOriginal() * Sets the translation string. * * @param string $translation + * + * @return self */ public function setTranslation($translation) { $this->translation = (string) $translation; + + return $this; } /** @@ -144,12 +206,14 @@ public function hasTranslation() * Sets the plural translation string. * * @param string $plural + * + * @return self */ public function setPlural($plural) { $this->plural = (string) $plural; - $this->normalizeTranslationCount(); + return $this; } /** @@ -175,95 +239,69 @@ public function hasPlural() /** * Set a new plural translation. * - * @param string $plural The plural string to add - * @param int $key The key of the plural translation. + * @param array $plural + * + * @return self */ - public function setPluralTranslation($plural, $key = 0) + public function setPluralTranslations(array $plural) { - $this->pluralTranslation[$key] = $plural; - $this->normalizeTranslationCount(); + $this->pluralTranslation = $plural; + + return $this; } /** - * Gets one or all plural translations. + * Gets all plural translations. * - * @param int|null $key The key to return. If is null, return all translations + * @param int $size * - * @return string|array + * @return array */ - public function getPluralTranslation($key = null) + public function getPluralTranslations($size = null) { - if ($key === null) { + if ($size === null) { return $this->pluralTranslation; } - return isset($this->pluralTranslation[$key]) ? (string) $this->pluralTranslation[$key] : ''; - } + $current = count($this->pluralTranslation); - /** - * Checks if there are any plural translation. - * - * @return bool - */ - public function hasPluralTranslation() - { - return implode('', $this->pluralTranslation) !== ''; - } + if ($size > $current) { + return $this->pluralTranslation + array_fill(0, $size, ''); + } - /** - * Removes all plural translations. - */ - public function deletePluralTranslation() - { - $this->pluralTranslation = array(); + if ($size < $current) { + return array_slice($this->pluralTranslation, 0, $size); + } - $this->normalizeTranslationCount(); + return $this->pluralTranslation; } /** - * Set the number of singular + plural translations allowed. + * Checks if there are any plural translation. * - * @param int $count + * @param bool $checkContent + * + * @return bool */ - public function setTranslationCount($count) + public function hasPluralTranslations($checkContent = false) { - $this->translationCount = is_null($count) ? null : intval($count); + if ($checkContent) { + return implode('', $this->pluralTranslation) !== ''; + } - $this->normalizeTranslationCount(); + return !empty($this->pluralTranslation); } /** - * Returns the number of singular + plural translations - * Returns null if this Translation is not a plural one. + * Removes all plural translations. * - * @return int|null + * @return self */ - public function getTranslationCount() - { - return $this->hasPlural() ? $this->translationCount : null; - } - - /** - * Normalizes the translation count. - */ - protected function normalizeTranslationCount() + public function deletePluralTranslation() { - if ($this->translationCount === null) { - return; - } + $this->pluralTranslation = []; - if ($this->hasPlural()) { - $allowed = $this->translationCount - 1; - $current = count($this->pluralTranslation); - - if ($allowed > $current) { - $this->pluralTranslation = $this->pluralTranslation + array_fill(0, $allowed, ''); - } elseif ($current > $allowed) { - $this->pluralTranslation = array_slice($this->pluralTranslation, 0, $allowed); - } - } else { - $this->pluralTranslation = array(); - } + return $this; } /** @@ -291,11 +329,15 @@ public function hasContext() * * @param string $filename The file path where the translation has been found * @param null|int $line The line number where the translation has been found + * + * @return self */ public function addReference($filename, $line = null) { $key = "{$filename}:{$line}"; - $this->references[$key] = array($filename, $line); + $this->references[$key] = [$filename, $line]; + + return $this; } /** @@ -320,20 +362,30 @@ public function getReferences() /** * Removes all references. + * + * @return self */ public function deleteReferences() { - $this->references = array(); + $this->references = []; + + return $this; } /** * Adds a new comment for this translation. * * @param string $comment + * + * @return self */ public function addComment($comment) { - $this->comments[] = $comment; + if (!in_array($comment, $this->comments, true)) { + $this->comments[] = $comment; + } + + return $this; } /** @@ -358,20 +410,30 @@ public function getComments() /** * Removes all comments. + * + * @return self */ public function deleteComments() { - $this->comments = array(); + $this->comments = []; + + return $this; } /** * Adds a new extracted comment for this translation. * * @param string $comment + * + * @return self */ public function addExtractedComment($comment) { - $this->extractedComments[] = $comment; + if (!in_array($comment, $this->extractedComments, true)) { + $this->extractedComments[] = $comment; + } + + return $this; } /** @@ -396,20 +458,30 @@ public function getExtractedComments() /** * Removes all extracted comments. + * + * @return self */ public function deleteExtractedComments() { - $this->extractedComments = array(); + $this->extractedComments = []; + + return $this; } /** - * Adds a new flat for this translation. + * Adds a new flag for this translation. * * @param string $flag + * + * @return self */ public function addFlag($flag) { - $this->flags[] = $flag; + if (!in_array($flag, $this->flags, true)) { + $this->flags[] = $flag; + } + + return $this; } /** @@ -434,46 +506,32 @@ public function getFlags() /** * Removes all flags. + * + * @return self */ public function deleteFlags() { - $this->flags = array(); + $this->flags = []; + + return $this; } /** * Merges this translation with other translation. * * @param Translation $translation The translation to merge with - * @param int|null $method One or various Translations::MERGE_* constants to define how to merge the translations + * @param int $options + * + * @return self */ - public function mergeWith(Translation $translation, $method = null) + public function mergeWith(Translation $translation, $options = Merge::DEFAULTS) { - if ($method === null) { - $method = Translations::$mergeDefault; - } - - if (!$this->hasTranslation() || ($translation->hasTranslation() && ($method & Translations::MERGE_OVERRIDE))) { - $this->setTranslation($translation->getTranslation()); - } - - if (($method & Translations::MERGE_PLURAL) && !$this->hasPlural()) { - $this->setPlural($translation->getPlural()); - } - - if ($this->hasPlural() && !$this->hasPluralTranslation() && $translation->hasPluralTranslation()) { - $this->pluralTranslation = $translation->getPluralTranslation(); - } + Merge::mergeTranslation($translation, $this, $options); + Merge::mergeReferences($translation, $this, $options); + Merge::mergeComments($translation, $this, $options); + Merge::mergeExtractedComments($translation, $this, $options); + Merge::mergeFlags($translation, $this, $options); - if ($method & Translations::MERGE_REFERENCES) { - foreach ($translation->getReferences() as $reference) { - $this->addReference($reference[0], $reference[1]); - } - } - - if ($method & Translations::MERGE_COMMENTS) { - $this->comments = array_values(array_unique(array_merge($translation->getComments(), $this->comments))); - $this->extractedComments = array_values(array_unique(array_merge($translation->getExtractedComments(), $this->extractedComments))); - $this->flags = array_values(array_unique(array_merge($translation->getFlags(), $this->flags))); - } + return $this; } } diff --git a/vendor/gettext/gettext/src/Translations.php b/vendor/gettext/gettext/src/Translations.php index 947bcac59f..ccf842818d 100644 --- a/vendor/gettext/gettext/src/Translations.php +++ b/vendor/gettext/gettext/src/Translations.php @@ -4,36 +4,107 @@ use Gettext\Languages\Language; use BadMethodCallException; +use InvalidArgumentException; +use ArrayObject; /** * Class to manage a collection of translations. + * + * @method static $this fromBladeFile(string $filename, array $options = []) + * @method static $this fromBladeString(string $string, array $options = []) + * @method $this addFromBladeFile(string $filename, array $options = []) + * @method $this addFromBladeString(string $string, array $options = []) + * @method static $this fromCsvFile(string $filename, array $options = []) + * @method static $this fromCsvString(string $string, array $options = []) + * @method $this addFromCsvFile(string $filename, array $options = []) + * @method $this addFromCsvString(string $string, array $options = []) + * @method bool toCsvFile(string $filename, array $options = []) + * @method string toCsvString(array $options = []) + * @method static $this fromCsvDictionaryFile(string $filename, array $options = []) + * @method static $this fromCsvDictionaryString(string $string, array $options = []) + * @method $this addFromCsvDictionaryFile(string $filename, array $options = []) + * @method $this addFromCsvDictionaryString(string $string, array $options = []) + * @method bool toCsvDictionaryFile(string $filename, array $options = []) + * @method string toCsvDictionaryString(array $options = []) + * @method static $this fromJedFile(string $filename, array $options = []) + * @method static $this fromJedString(string $string, array $options = []) + * @method $this addFromJedFile(string $filename, array $options = []) + * @method $this addFromJedString(string $string, array $options = []) + * @method bool toJedFile(string $filename, array $options = []) + * @method string toJedString(array $options = []) + * @method static $this fromJsCodeFile(string $filename, array $options = []) + * @method static $this fromJsCodeString(string $string, array $options = []) + * @method $this addFromJsCodeFile(string $filename, array $options = []) + * @method $this addFromJsCodeString(string $string, array $options = []) + * @method static $this fromJsonFile(string $filename, array $options = []) + * @method static $this fromJsonString(string $string, array $options = []) + * @method $this addFromJsonFile(string $filename, array $options = []) + * @method $this addFromJsonString(string $string, array $options = []) + * @method bool toJsonFile(string $filename, array $options = []) + * @method string toJsonString(array $options = []) + * @method static $this fromJsonDictionaryFile(string $filename, array $options = []) + * @method static $this fromJsonDictionaryString(string $string, array $options = []) + * @method $this addFromJsonDictionaryFile(string $filename, array $options = []) + * @method $this addFromJsonDictionaryString(string $string, array $options = []) + * @method bool toJsonDictionaryFile(string $filename, array $options = []) + * @method string toJsonDictionaryString(array $options = []) + * @method static $this fromMoFile(string $filename, array $options = []) + * @method static $this fromMoString(string $string, array $options = []) + * @method $this addFromMoFile(string $filename, array $options = []) + * @method $this addFromMoString(string $string, array $options = []) + * @method bool toMoFile(string $filename, array $options = []) + * @method string toMoString(array $options = []) + * @method static $this fromPhpArrayFile(string $filename, array $options = []) + * @method static $this fromPhpArrayString(string $string, array $options = []) + * @method $this addFromPhpArrayFile(string $filename, array $options = []) + * @method $this addFromPhpArrayString(string $string, array $options = []) + * @method bool toPhpArrayFile(string $filename, array $options = []) + * @method string toPhpArrayString(array $options = []) + * @method static $this fromPhpCodeFile(string $filename, array $options = []) + * @method static $this fromPhpCodeString(string $string, array $options = []) + * @method $this addFromPhpCodeFile(string $filename, array $options = []) + * @method $this addFromPhpCodeString(string $string, array $options = []) + * @method static $this fromPoFile(string $filename, array $options = []) + * @method static $this fromPoString(string $string, array $options = []) + * @method $this addFromPoFile(string $filename, array $options = []) + * @method $this addFromPoString(string $string, array $options = []) + * @method bool toPoFile(string $filename, array $options = []) + * @method string toPoString(array $options = []) + * @method static $this fromTwigFile(string $filename, array $options = []) + * @method static $this fromTwigString(string $string, array $options = []) + * @method $this addFromTwigFile(string $filename, array $options = []) + * @method $this addFromTwigString(string $string, array $options = []) + * @method static $this fromVueJsFile(string $filename, array $options = []) + * @method static $this fromVueJsString(string $filename, array $options = []) + * @method $this addFromVueJsFile(string $filename, array $options = []) + * @method $this addFromVueJsString(string $filename, array $options = []) + * @method static $this fromXliffFile(string $filename, array $options = []) + * @method static $this fromXliffString(string $string, array $options = []) + * @method $this addFromXliffFile(string $filename, array $options = []) + * @method $this addFromXliffString(string $string, array $options = []) + * @method bool toXliffFile(string $filename, array $options = []) + * @method string toXliffString(array $options = []) + * @method static $this fromYamlFile(string $filename, array $options = []) + * @method static $this fromYamlString(string $string, array $options = []) + * @method $this addFromYamlFile(string $filename, array $options = []) + * @method $this addFromYamlString(string $string, array $options = []) + * @method bool toYamlFile(string $filename, array $options = []) + * @method string toYamlString(array $options = []) + * @method static $this fromYamlDictionaryFile(string $filename, array $options = []) + * @method static $this fromYamlDictionaryString(string $string, array $options = []) + * @method $this addFromYamlDictionaryFile(string $filename, array $options = []) + * @method $this addFromYamlDictionaryString(string $string, array $options = []) + * @method bool toYamlDictionaryFile(string $filename, array $options = []) + * @method string toYamlDictionaryString(array $options = []) */ -class Translations extends \ArrayObject +class Translations extends ArrayObject { - const MERGE_ADD = 1; - const MERGE_REMOVE = 2; - const MERGE_HEADERS = 4; - const MERGE_REFERENCES = 8; - const MERGE_COMMENTS = 16; - const MERGE_LANGUAGE = 32; - const MERGE_PLURAL = 64; - const MERGE_OVERRIDE = 128; - const HEADER_LANGUAGE = 'Language'; const HEADER_PLURAL = 'Plural-Forms'; const HEADER_DOMAIN = 'X-Domain'; - public static $mergeDefault = 93; // self::MERGE_ADD | self::MERGE_HEADERS | self::MERGE_COMMENTS | self::MERGE_REFERENCES | self::MERGE_PLURAL - - private $headers; - private $translationCount; - - /** - * @see \ArrayObject::__construct() - */ - public function __construct($input = array(), $flags = 0, $iterator_class = 'ArrayIterator') - { - $this->headers = array( + public static $options = [ + 'defaultHeaders' => [ 'Project-Id-Version' => '', 'Report-Msgid-Bugs-To' => '', 'Last-Translator' => '', @@ -41,16 +112,43 @@ public function __construct($input = array(), $flags = 0, $iterator_class = 'Arr 'MIME-Version' => '1.0', 'Content-Type' => 'text/plain; charset=UTF-8', 'Content-Transfer-Encoding' => '8bit', - 'POT-Creation-Date' => date('c'), - 'PO-Revision-Date' => date('c'), - ); + ], + 'headersSorting' => false, + 'defaultDateHeaders' => [ + 'POT-Creation-Date', + 'PO-Revision-Date', + ], + ]; + + protected $headers; + + protected $translationClass; + + /** + * @see ArrayObject::__construct() + */ + public function __construct( + $input = [], + $flags = 0, + $iterator_class = 'ArrayIterator', + $translationClass = 'Gettext\Translation' + ) { + $this->headers = static::$options['defaultHeaders']; + + foreach (static::$options['defaultDateHeaders'] as $header) { + $this->headers[$header] = date('c'); + } + $this->headers[self::HEADER_LANGUAGE] = ''; + + $this->translationClass = $translationClass; + parent::__construct($input, $flags, $iterator_class); } /** * Magic method to create new instances using extractors - * For example: Translations::fromMoFile($filename);. + * For example: Translations::fromMoFile($filename, $options);. * * @return Translations */ @@ -60,13 +158,13 @@ public static function __callStatic($name, $arguments) throw new BadMethodCallException("The method $name does not exists"); } - return call_user_func_array('Gettext\\Extractors\\'.$matches[1].'::from'.$matches[2], $arguments); + return call_user_func_array([new static(), 'add'.ucfirst($name)], $arguments); } /** * Magic method to import/export the translations to a specific format - * For example: $translations->toMoFile($filename); - * For example: $translations->addFromMoFile($filename);. + * For example: $translations->toMoFile($filename, $options); + * For example: $translations->addFromMoFile($filename, $options);. * * @return self|bool */ @@ -77,16 +175,20 @@ public function __call($name, $arguments) } if ($matches[1] === 'addFrom') { - $arguments[] = $this; + $extractor = 'Gettext\\Extractors\\'.$matches[2].'::from'.$matches[3]; + $source = array_shift($arguments); + $options = array_shift($arguments) ?: []; - call_user_func_array('Gettext\\Extractors\\'.$matches[2].'::from'.$matches[3], $arguments); + call_user_func($extractor, $source, $this, $options); return $this; } + $generator = 'Gettext\\Generators\\'.$matches[2].'::to'.$matches[3]; + array_unshift($arguments, $this); - return call_user_func_array('Gettext\\Generators\\'.$matches[2].'::to'.$matches[3], $arguments); + return call_user_func_array($generator, $arguments); } /** @@ -94,7 +196,7 @@ public function __call($name, $arguments) */ public function __clone() { - $array = array(); + $array = []; foreach ($this as $key => $translation) { $array[$key] = clone $translation; @@ -116,20 +218,19 @@ public function __clone() public function offsetSet($index, $value) { if (!($value instanceof Translation)) { - throw new \InvalidArgumentException('Only instances of Gettext\\Translation must be added to a Gettext\\Translations'); + throw new InvalidArgumentException( + 'Only instances of Gettext\\Translation must be added to a Gettext\\Translations' + ); } $id = $value->getId(); if ($this->offsetExists($id)) { $this[$id]->mergeWith($value); - $this[$id]->setTranslationCount($this->translationCount); return $this[$id]; } - $value->setTranslationCount($this->translationCount); - parent::offsetSet($id, $value); return $value; @@ -140,10 +241,17 @@ public function offsetSet($index, $value) * * @param int $count * @param string $rule + * + * @return self */ public function setPluralForms($count, $rule) { + if (preg_match('/[a-z]/i', str_replace('n', '', $rule))) { + throw new \InvalidArgumentException('Invalid Plural form: ' . $rule); + } $this->setHeader(self::HEADER_PLURAL, "nplurals={$count}; plural={$rule};"); + + return $this; } /** @@ -155,8 +263,10 @@ public function getPluralForms() { $header = $this->getHeader(self::HEADER_PLURAL); - if (!empty($header) && preg_match('/^nplurals\s*=\s*(\d+)\s*;\s*plural\s*=\s*([^;]+)\s*;$/', $header, $matches)) { - return array(intval($matches[1]), $matches[2]); + if (!empty($header) + && preg_match('/^nplurals\s*=\s*(\d+)\s*;\s*plural\s*=\s*([^;]+)\s*;$/', $header, $matches) + ) { + return [intval($matches[1]), $matches[2]]; } } @@ -165,23 +275,15 @@ public function getPluralForms() * * @param string $name * @param string $value + * + * @return self */ public function setHeader($name, $value) { $name = trim($name); $this->headers[$name] = trim($value); - if ($name === self::HEADER_PLURAL) { - if ($forms = $this->getPluralForms()) { - $this->translationCount = $forms[0]; - - foreach ($this as $t) { - $t->setTranslationCount($this->translationCount); - } - } else { - $this->translationCount = null; - } - } + return $this; } /** @@ -197,31 +299,43 @@ public function getHeader($name) } /** - * Returns all header for this translations. + * Returns all header for this translations (in alphabetic order). * * @return array */ public function getHeaders() { + if (static::$options['headersSorting']) { + ksort($this->headers); + } + return $this->headers; } /** * Removes all headers. + * + * @return self */ public function deleteHeaders() { - $this->headers = array(); + $this->headers = []; + + return $this; } /** * Removes one header. * * @param string $name + * + * @return self */ public function deleteHeader($name) { unset($this->headers[$name]); + + return $this; } /** @@ -239,19 +353,19 @@ public function getLanguage() * * @param string $language * - * @return bool Returns true if the plural rules has been updated, false if $language hasn't been recognized + * @throws InvalidArgumentException if the language hasn't been recognized + * + * @return self */ public function setLanguage($language) { $this->setHeader(self::HEADER_LANGUAGE, trim($language)); if (($info = Language::getById($language))) { - $this->setPluralForms(count($info->categories), $info->formula); - - return true; + return $this->setPluralForms(count($info->categories), $info->formula); } - return false; + throw new InvalidArgumentException(sprintf('The language "%s" is not valid', $language)); } /** @@ -270,10 +384,14 @@ public function hasLanguage() * Set a new domain for this translations. * * @param string $domain + * + * @return self */ public function setDomain($domain) { $this->setHeader(self::HEADER_DOMAIN, trim($domain)); + + return $this; } /** @@ -303,6 +421,7 @@ public function hasDomain() * * @param string|Translation $context The context of the translation or a translation instance * @param string $original The original string + * @warning Translations with custom identifiers (e.g. XLIFF unit IDs) cannot be found using this function. * * @return Translation|false */ @@ -317,6 +436,22 @@ public function find($context, $original = '') return $this->offsetExists($id) ? $this[$id] : false; } + /** + * Count all elements translated + * + * @return integer + */ + public function countTranslated() + { + $c = 0; + foreach ($this as $v) { + if ($v->hasTranslation()) { + $c++; + } + } + return $c; + } + /** * Creates and insert/merges a new translation. * @@ -328,66 +463,36 @@ public function find($context, $original = '') */ public function insert($context, $original, $plural = '') { - return $this->offsetSet(null, new Translation($context, $original, $plural)); + return $this->offsetSet(null, $this->createNewTranslation($context, $original, $plural)); } /** * Merges this translations with other translations. * * @param Translations $translations The translations instance to merge with - * @param int|null $method One or various Translations::MERGE_* constants to define how to merge the translations + * @param int $options + * + * @return self */ - public function mergeWith(Translations $translations, $method = null) + public function mergeWith(Translations $translations, $options = Merge::DEFAULTS) { - if ($method === null) { - $method = self::$mergeDefault; - } - - if ($method & self::MERGE_HEADERS) { - foreach ($translations->getHeaders() as $name => $value) { - if (!$this->getHeader($name)) { - $this->setHeader($name, $value); - } - } - } - - $add = (boolean) ($method & self::MERGE_ADD); + Merge::mergeHeaders($translations, $this, $options); + Merge::mergeTranslations($translations, $this, $options); - foreach ($translations as $entry) { - if (($existing = $this->find($entry))) { - $existing->mergeWith($entry, $method); - } elseif ($add) { - $this[] = clone $entry; - } - } - - if ($method & self::MERGE_REMOVE) { - $filtered = array(); - - foreach ($this as $entry) { - if ($translations->find($entry)) { - $filtered[] = $entry; - } - } - - $this->exchangeArray($filtered); - } - - if ($method & self::MERGE_LANGUAGE) { - $language = $translations->getLanguage(); - $pluralForm = $translations->getPluralForms(); - - if (!$pluralForm) { - if (!empty($language)) { - $this->setLanguage($language); - } - } else { - if (!empty($language)) { - $this->setHeader(self::HEADER_LANGUAGE, $language); - } + return $this; + } - $this->setPluralForms($pluralForm[0], $pluralForm[1]); - } - } + /** + * Create a new instance of a Translation object. + * + * @param string $context The context of the translation + * @param string $original The original string + * @param string $plural The original plural string + * @return Translation New Translation instance + */ + public function createNewTranslation($context, $original, $plural = '') + { + $class = $this->translationClass; + return $class::create($context, $original, $plural); } } diff --git a/vendor/gettext/gettext/src/Translator.php b/vendor/gettext/gettext/src/Translator.php index 245b227d27..49b18e95be 100644 --- a/vendor/gettext/gettext/src/Translator.php +++ b/vendor/gettext/gettext/src/Translator.php @@ -6,31 +6,44 @@ class Translator extends BaseTranslator implements TranslatorInterface { - private $domain; - private $dictionary = array(); - private $context_glue = "\004"; - private $plurals = array(); + protected $domain; + protected $dictionary = []; + protected $plurals = []; /** * Loads translation from a Translations instance, a file on an array. * * @param Translations|string|array $translations * - * @return self + * @return static */ public function loadTranslations($translations) { if (is_object($translations) && $translations instanceof Translations) { - $translations = PhpArray::toArray($translations); + $translations = PhpArray::generate($translations, ['includeHeaders' => false]); } elseif (is_string($translations) && is_file($translations)) { $translations = include $translations; } elseif (!is_array($translations)) { - throw new \InvalidArgumentException('Invalid Translator: only arrays, files or instance of Translations are allowed'); + throw new \InvalidArgumentException( + 'Invalid Translator: only arrays, files or instance of Translations are allowed' + ); } - foreach ($translations as $translation) { - $this->addTranslations($translation); - } + $this->addTranslations($translations); + + return $this; + } + + /** + * Set the default domain. + * + * @param string $domain + * + * @return static + */ + public function defaultDomain($domain) + { + $this->domain = $domain; return $this; } @@ -104,8 +117,8 @@ public function dpgettext($domain, $context, $original) { $translation = $this->getTranslation($domain, $context, $original); - if (isset($translation[1]) && $translation[1] !== '') { - return $translation[1]; + if (isset($translation[0]) && $translation[0] !== '') { + return $translation[0]; } return $original; @@ -118,14 +131,14 @@ public function dpgettext($domain, $context, $original) */ public function dnpgettext($domain, $context, $original, $plural, $value) { - $key = $this->isPlural($domain, $value); $translation = $this->getTranslation($domain, $context, $original); + $key = $this->getPluralIndex($domain, $value, $translation === false); if (isset($translation[$key]) && $translation[$key] !== '') { return $translation[$key]; } - return ($key === 1) ? $original : $plural; + return ($key === 0) ? $original : $plural; } /** @@ -135,33 +148,31 @@ public function dnpgettext($domain, $context, $original, $plural, $value) */ protected function addTranslations(array $translations) { - $info = isset($translations['']) ? $translations[''] : null; - unset($translations['']); - - $domain = isset($info['domain']) ? $info['domain'] : 'messages'; + $domain = isset($translations['domain']) ? $translations['domain'] : ''; //Set the first domain loaded as default domain - if (!$this->domain) { + if ($this->domain === null) { $this->domain = $domain; } - if (!isset($this->dictionary[$domain])) { - // If a plural form is set we extract those values - $pluralForms = empty($info['plural-forms']) ? 'nplurals=2; plural=(n != 1)' : $info['plural-forms']; + if (isset($this->dictionary[$domain])) { + $this->dictionary[$domain] = array_replace_recursive($this->dictionary[$domain], $translations['messages']); + + return; + } - list($count, $code) = explode(';', $pluralForms, 2); + if (!empty($translations['plural-forms'])) { + list($count, $code) = array_map('trim', explode(';', $translations['plural-forms'], 2)); // extract just the expression turn 'n' into a php variable '$n'. // Slap on a return keyword and semicolon at the end. - $this->plurals[$domain] = array( + $this->plurals[$domain] = [ 'count' => (int) str_replace('nplurals=', '', $count), 'code' => str_replace('plural=', 'return ', str_replace('n', '$n', $code)).';', - ); - - $this->dictionary[$domain] = $translations; - } else { - $this->dictionary[$domain] = array_replace_recursive($this->dictionary[$domain], $translations); + ]; } + + $this->dictionary[$domain] = $translations['messages']; } /** @@ -171,13 +182,13 @@ protected function addTranslations(array $translations) * @param string $context * @param string $original * - * @return array + * @return string|false */ protected function getTranslation($domain, $context, $original) { - $key = isset($context) ? $context.$this->context_glue.$original : $original; - - return isset($this->dictionary[$domain][$key]) ? $this->dictionary[$domain][$key] : false; + return isset($this->dictionary[$domain][$context][$original]) + ? $this->dictionary[$domain][$context][$original] + : false; } /** @@ -186,27 +197,27 @@ protected function getTranslation($domain, $context, $original) * * @param string $domain * @param string $n + * @param bool $fallback set to true to get fallback plural index * * @return int */ - protected function isPlural($domain, $n) + protected function getPluralIndex($domain, $n, $fallback) { - //Not loaded domain, use a fallback - if (!isset($this->plurals[$domain])) { - return $n == 1 ? 1 : 2; + //Not loaded domain or translation, use a fallback + if (!isset($this->plurals[$domain]) || $fallback === true) { + return $n == 1 ? 0 : 1; } if (!isset($this->plurals[$domain]['function'])) { - $this->plurals[$domain]['function'] = create_function('$n', self::fixTerseIfs($this->plurals[$domain]['code'])); + $code = static::fixTerseIfs($this->plurals[$domain]['code']); + $this->plurals[$domain]['function'] = eval("return function (\$n) { $code };"); } if ($this->plurals[$domain]['count'] <= 2) { - return (call_user_func($this->plurals[$domain]['function'], $n)) ? 2 : 1; + return call_user_func($this->plurals[$domain]['function'], $n) ? 1 : 0; } - // We need to +1 because while (GNU) gettext codes assume 0 based, - // this gettext actually stores 1 based. - return (call_user_func($this->plurals[$domain]['function'], $n)) + 1; + return call_user_func($this->plurals[$domain]['function'], $n); } /** @@ -246,7 +257,7 @@ private static function fixTerseIfs($code, $inner = false) $failure = $matches['failure']; // Go look for another terse if in the failure state. - $failure = self::fixTerseIfs($failure, true); + $failure = static::fixTerseIfs($failure, true); $code = $expression.' ? '.$success.' : '.$failure; if ($inner) { diff --git a/vendor/gettext/gettext/src/TranslatorInterface.php b/vendor/gettext/gettext/src/TranslatorInterface.php index 2db9c14361..6c7baace69 100644 --- a/vendor/gettext/gettext/src/TranslatorInterface.php +++ b/vendor/gettext/gettext/src/TranslatorInterface.php @@ -9,9 +9,21 @@ interface TranslatorInterface { /** * Register this translator as global, to use with the gettext functions __(), p__(), etc. + * Returns the previous translator if exists. + * + * @return TranslatorInterface|null */ public function register(); + /** + * Noop, marks the string for translation but returns it unchanged. + * + * @param string $original + * + * @return string + */ + public function noop($original); + /** * Gets a translation using the original string. * diff --git a/vendor/gettext/gettext/src/Utils/CsvTrait.php b/vendor/gettext/gettext/src/Utils/CsvTrait.php new file mode 100644 index 0000000000..7911f12767 --- /dev/null +++ b/vendor/gettext/gettext/src/Utils/CsvTrait.php @@ -0,0 +1,56 @@ +<?php + +namespace Gettext\Utils; + +/* + * Trait to provide the functionality of read/write csv. + */ +trait CsvTrait +{ + protected static $csvEscapeChar; + + /** + * Check whether support the escape_char argument to fgetcsv/fputcsv or not + * + * @return bool + */ + protected static function supportsCsvEscapeChar() + { + if (static::$csvEscapeChar === null) { + static::$csvEscapeChar = version_compare(PHP_VERSION, '5.5.4') >= 0; + } + + return static::$csvEscapeChar; + } + + /** + * @param resource $handle + * @param array $options + * + * @return array + */ + protected static function fgetcsv($handle, $options) + { + if (static::supportsCsvEscapeChar()) { + return fgetcsv($handle, 0, $options['delimiter'], $options['enclosure'], $options['escape_char']); + } + + return fgetcsv($handle, 0, $options['delimiter'], $options['enclosure']); + } + + /** + * @param resource $handle + * @param array $fields + * @param array $options + * + * @return bool|int + */ + protected static function fputcsv($handle, $fields, $options) + { + if (static::supportsCsvEscapeChar()) { + return fputcsv($handle, $fields, $options['delimiter'], $options['enclosure'], $options['escape_char']); + } + + return fputcsv($handle, $fields, $options['delimiter'], $options['enclosure']); + } +} diff --git a/vendor/gettext/gettext/src/Utils/DictionaryTrait.php b/vendor/gettext/gettext/src/Utils/DictionaryTrait.php new file mode 100644 index 0000000000..eda7929431 --- /dev/null +++ b/vendor/gettext/gettext/src/Utils/DictionaryTrait.php @@ -0,0 +1,59 @@ +<?php + +namespace Gettext\Utils; + +use Gettext\Translations; + +/** + * Trait used by all generators that exports the translations to plain dictionary (original => singular-translation). + */ +trait DictionaryTrait +{ + use HeadersGeneratorTrait; + use HeadersExtractorTrait; + + /** + * Returns a plain dictionary with the format [original => translation]. + * + * @param Translations $translations + * @param bool $includeHeaders + * + * @return array + */ + protected static function toArray(Translations $translations, $includeHeaders) + { + $messages = []; + + if ($includeHeaders) { + $messages[''] = static::generateHeaders($translations); + } + + foreach ($translations as $translation) { + if ($translation->isDisabled()) { + continue; + } + + $messages[$translation->getOriginal()] = $translation->getTranslation(); + } + + return $messages; + } + + /** + * Extract the entries from a dictionary. + * + * @param array $messages + * @param Translations $translations + */ + protected static function fromArray(array $messages, Translations $translations) + { + foreach ($messages as $original => $translation) { + if ($original === '') { + static::extractHeaders($translation, $translations); + continue; + } + + $translations->insert(null, $original)->setTranslation($translation); + } + } +} diff --git a/vendor/gettext/gettext/src/Utils/FunctionsScanner.php b/vendor/gettext/gettext/src/Utils/FunctionsScanner.php index 9cee18b8ef..503c090f3a 100644 --- a/vendor/gettext/gettext/src/Utils/FunctionsScanner.php +++ b/vendor/gettext/gettext/src/Utils/FunctionsScanner.php @@ -10,125 +10,158 @@ abstract class FunctionsScanner /** * Scan and returns the functions and the arguments. * + * @param array $constants Constants used in the code to replace + * * @return array */ - abstract public function getFunctions(); + abstract public function getFunctions(array $constants = []); /** * Search for specific functions and create translations. * - * @param array $functions The gettext functions to search - * @param Translations $translations The translations instance where save the values - * @param string $file The filename used to the reference + * You can pass multiple translation with different domains and value found will be sorted respectively. + * + * @param Translations|Translations[] $translations Multiple domain translations instances where to save the values + * @param array $options The extractor options + * @throws Exception */ - public function saveGettextFunctions(array $functions, Translations $translations, $file = '') + public function saveGettextFunctions($translations, array $options) { - foreach ($this->getFunctions() as $function) { - list($name, $line, $args) = $function; - - if (!isset($functions[$name])) { - continue; - } - - $translation = null; + $translations = is_array($translations) ? $translations : [$translations]; - switch ($functions[$name]) { - case '__': - if (!isset($args[0])) { - continue 2; - } + /** @var Translations[] $translationByDomain [domain => translations, ..] */ + $translationByDomain = array_reduce($translations, function (&$carry, Translations $translations) { + $carry[$translations->getDomain()] = $translations; + return $carry; + }, []); - $original = $args[0]; + $functions = $options['functions']; + $file = $options['file']; - if ($original !== '') { - $translation = $translations->insert('', $original); - } - break; + foreach ($this->getFunctions($options['constants']) as $function) { + list($name, $line, $args) = $function; - case 'n__': - if (!isset($args[1])) { - continue 2; - } + if (isset($options['lineOffset'])) { + $line += $options['lineOffset']; + } - list($original, $plural) = $args; + if (!isset($functions[$name])) { + continue; + } - if ($original !== '') { - $translation = $translations->insert('', $original, $plural); - } - break; + $deconstructed = $this->deconstructArgs($functions[$name], $args); - case 'p__': - if (!isset($args[1])) { - continue 2; - } + if (!$deconstructed) { + continue; + } - list($context, $original) = $args; + list($domain, $context, $original, $plural) = $deconstructed; - if ($original !== '') { - $translation = $translations->insert($context, $original); - } - break; + if ((string)$original === '') { + continue; + } - case 'd__': - if (!isset($args[1])) { - continue 2; - } + $isDefaultDomain = $domain === null; - list($domain, $original) = $args; + $domainTranslations = isset($translationByDomain[$domain]) ? $translationByDomain[$domain] : false; - if ($original !== '' && $domain === $translations->getDomain()) { - $translation = $translations->insert('', $original); - } - break; + if (!empty($options['domainOnly']) && $isDefaultDomain) { + // If we want to find translations for a specific domain, skip default domain messages + continue; + } - case 'dp__': - if (!isset($args[2])) { - continue 2; - } + if (!$domainTranslations) { + continue; + } - list($domain, $context, $original) = $args; + $translation = $domainTranslations->insert($context, $original, $plural); + $translation->addReference($file, $line); - if ($original !== '' && $domain === $translations->getDomain()) { - $translation = $translations->insert($context, $original); - } - break; + if (isset($function[3])) { + foreach ($function[3] as $extractedComment) { + $translation->addExtractedComment($extractedComment); + } + } + } + } - case 'np__': - if (!isset($args[2])) { - continue 2; - } + /** + * Deconstruct arguments to translation values + * + * @param $function + * @param $args + * @return array|null + * @throws Exception + */ + protected function deconstructArgs($function, $args) + { + $domain = null; + $context = null; + $original = null; + $plural = null; + + switch ($function) { + case 'noop': + case 'gettext': + if (!isset($args[0])) { + return null; + } - list($context, $original, $plural) = $args; + $original = $args[0]; + break; + case 'ngettext': + if (!isset($args[1])) { + return null; + } - if ($original !== '') { - $translation = $translations->insert($context, $original, $plural); - } - break; + list($original, $plural) = $args; + break; + case 'pgettext': + if (!isset($args[1])) { + return null; + } - case 'dnp__': - if (!isset($args[4])) { - continue 2; - } + list($context, $original) = $args; + break; + case 'dgettext': + if (!isset($args[1])) { + return null; + } - list($domain, $context, $original, $plural) = $args; + list($domain, $original) = $args; + break; + case 'dpgettext': + if (!isset($args[2])) { + return null; + } - if ($original !== '' && $domain === $translations->getDomain()) { - $translation = $translations->insert($context, $original, $plural); - } - break; + list($domain, $context, $original) = $args; + break; + case 'npgettext': + if (!isset($args[2])) { + return null; + } - default: - throw new Exception('Not valid functions'); - } + list($context, $original, $plural) = $args; + break; + case 'dnpgettext': + if (!isset($args[3])) { + return null; + } - if (isset($translation)) { - $translation->addReference($file, $line); - if (isset($function[3])) { - foreach ($function[3] as $extractedComment) { - $translation->addExtractedComment($extractedComment); - } + list($domain, $context, $original, $plural) = $args; + break; + case 'dngettext': + if (!isset($args[2])) { + return null; } - } + + list($domain, $original, $plural) = $args; + break; + default: + throw new Exception(sprintf('Not valid function %s', $function)); } + + return [$domain, $context, $original, $plural]; } } diff --git a/vendor/gettext/gettext/src/Utils/HeadersExtractorTrait.php b/vendor/gettext/gettext/src/Utils/HeadersExtractorTrait.php new file mode 100644 index 0000000000..0cd92d4522 --- /dev/null +++ b/vendor/gettext/gettext/src/Utils/HeadersExtractorTrait.php @@ -0,0 +1,67 @@ +<?php + +namespace Gettext\Utils; + +use Gettext\Translations; + +/** + * Trait to provide the functionality of extracting headers. + */ +trait HeadersExtractorTrait +{ + /** + * Add the headers found to the translations instance. + * + * @param string $headers + * @param Translations $translations + * + * @return array + */ + protected static function extractHeaders($headers, Translations $translations) + { + $headers = explode("\n", $headers); + $currentHeader = null; + + foreach ($headers as $line) { + $line = static::convertString($line); + + if ($line === '') { + continue; + } + + if (static::isHeaderDefinition($line)) { + $header = array_map('trim', explode(':', $line, 2)); + $currentHeader = $header[0]; + $translations->setHeader($currentHeader, $header[1]); + } else { + $entry = $translations->getHeader($currentHeader); + $translations->setHeader($currentHeader, $entry.$line); + } + } + } + + /** + * Checks if it is a header definition line. Useful for distguishing between header definitions + * and possible continuations of a header entry. + * + * @param string $line Line to parse + * + * @return bool + */ + protected static function isHeaderDefinition($line) + { + return (bool) preg_match('/^[\w-]+:/', $line); + } + + /** + * Normalize a string. + * + * @param string $value + * + * @return string + */ + public static function convertString($value) + { + return $value; + } +} diff --git a/vendor/gettext/gettext/src/Utils/HeadersGeneratorTrait.php b/vendor/gettext/gettext/src/Utils/HeadersGeneratorTrait.php new file mode 100644 index 0000000000..77ccff9f8c --- /dev/null +++ b/vendor/gettext/gettext/src/Utils/HeadersGeneratorTrait.php @@ -0,0 +1,29 @@ +<?php + +namespace Gettext\Utils; + +use Gettext\Translations; + +/** + * Trait to provide the functionality of extracting headers. + */ +trait HeadersGeneratorTrait +{ + /** + * Returns the headers as a string. + * + * @param Translations $translations + * + * @return string + */ + protected static function generateHeaders(Translations $translations) + { + $headers = ''; + + foreach ($translations->getHeaders() as $name => $value) { + $headers .= sprintf("%s: %s\n", $name, $value); + } + + return $headers; + } +} diff --git a/vendor/gettext/gettext/src/Utils/JsFunctionsScanner.php b/vendor/gettext/gettext/src/Utils/JsFunctionsScanner.php index 7ff937409e..6e507dc32c 100644 --- a/vendor/gettext/gettext/src/Utils/JsFunctionsScanner.php +++ b/vendor/gettext/gettext/src/Utils/JsFunctionsScanner.php @@ -5,7 +5,7 @@ class JsFunctionsScanner extends FunctionsScanner { protected $code; - protected $status = array(); + protected $status = []; /** * Constructor. @@ -14,27 +14,55 @@ class JsFunctionsScanner extends FunctionsScanner */ public function __construct($code) { - $this->code = $code; + // Normalize newline characters + $this->code = str_replace(["\r\n", "\n\r", "\r"], "\n", $code); } /** * {@inheritdoc} */ - public function getFunctions() + public function getFunctions(array $constants = []) { $length = strlen($this->code); $line = 1; $buffer = ''; - $functions = array(); - $bufferFunctions = array(); + $functions = []; + $bufferFunctions = []; $char = null; for ($pos = 0; $pos < $length; ++$pos) { $prev = $char; $char = $this->code[$pos]; - $next = isset($this->code[$pos]) ? $this->code[$pos] : null; + $next = isset($this->code[$pos + 1]) ? $this->code[$pos + 1] : null; switch ($char) { + case '\\': + switch ($this->status()) { + case 'simple-quote': + if ($next !== "'") { + break 2; + } + break; + + case 'double-quote': + if ($next !== '"') { + break 2; + } + break; + + case 'back-tick': + if ($next !== '`') { + break 2; + } + break; + } + + $prev = $char; + $char = $next; + $pos++; + $next = isset($this->code[$pos]) ? $this->code[$pos] : null; + break; + case "\n": ++$line; @@ -47,6 +75,7 @@ public function getFunctions() switch ($this->status()) { case 'simple-quote': case 'double-quote': + case 'back-tick': case 'line-comment': break; @@ -75,6 +104,7 @@ public function getFunctions() case 'line-comment': case 'block-comment': case 'double-quote': + case 'back-tick': break; default: @@ -92,6 +122,7 @@ public function getFunctions() case 'line-comment': case 'block-comment': case 'simple-quote': + case 'back-tick': break; default: @@ -100,18 +131,37 @@ public function getFunctions() } break; + case '`': + switch ($this->status()) { + case 'back-tick': + $this->upStatus(); + break; + + case 'line-comment': + case 'block-comment': + case 'simple-quote': + case 'double-quote': + break; + + default: + $this->downStatus('back-tick'); + break; + } + break; + case '(': switch ($this->status()) { + case 'simple-quote': case 'double-quote': + case 'back-tick': case 'line-comment': case 'block-comment': - case 'line-comment': break; default: if ($buffer && preg_match('/(\w+)$/', $buffer, $matches)) { $this->downStatus('function'); - array_unshift($bufferFunctions, array($matches[1], $line, array())); + array_unshift($bufferFunctions, [$matches[1], $line, []]); $buffer = ''; continue 3; } @@ -122,7 +172,7 @@ public function getFunctions() case ')': switch ($this->status()) { case 'function': - if (($argument = self::prepareArgument($buffer))) { + if (($argument = static::prepareArgument($buffer))) { $bufferFunctions[0][2][] = $argument; } @@ -130,20 +180,37 @@ public function getFunctions() $functions[] = array_shift($bufferFunctions); } + $this->upStatus(); $buffer = ''; continue 3; } + break; case ',': switch ($this->status()) { case 'function': - if (($argument = self::prepareArgument($buffer))) { + if (($argument = static::prepareArgument($buffer))) { $bufferFunctions[0][2][] = $argument; } $buffer = ''; continue 3; } + break; + + case ' ': + case '\t': + switch ($this->status()) { + case 'double-quote': + case 'simple-quote': + case 'back-tick': + break; + + default: + $buffer = ''; + continue 3; + } + break; } switch ($this->status()) { @@ -207,14 +274,47 @@ protected function upStatus() */ protected static function prepareArgument($argument) { - if ($argument && ($argument[0] === '"' || $argument[0] === "'")) { - if ($argument[0] === '"') { - $argument = str_replace('\\"', '"', $argument); - } else { - $argument = str_replace("\\'", "'", $argument); - } + if ($argument && in_array($argument[0], ['"', "'", '`'], true)) { + return static::convertString(substr($argument, 1, -1)); + } + } - return substr($argument, 1, -1); + /** + * Decodes a string with an argument. + * + * @param string $value + * + * @return string + */ + protected static function convertString($value) + { + if (strpos($value, '\\') === false) { + return $value; } + + return preg_replace_callback( + '/\\\(n|r|t|v|e|f|"|\\\)/', + function ($match) { + switch ($match[1][0]) { + case 'n': + return "\n"; + case 'r': + return "\r"; + case 't': + return "\t"; + case 'v': + return "\v"; + case 'e': + return "\e"; + case 'f': + return "\f"; + case '"': + return '"'; + case '\\': + return '\\'; + } + }, + $value + ); } } diff --git a/vendor/gettext/gettext/src/Utils/MultidimensionalArrayTrait.php b/vendor/gettext/gettext/src/Utils/MultidimensionalArrayTrait.php new file mode 100644 index 0000000000..d2985b22f1 --- /dev/null +++ b/vendor/gettext/gettext/src/Utils/MultidimensionalArrayTrait.php @@ -0,0 +1,100 @@ +<?php + +namespace Gettext\Utils; + +use Gettext\Translations; + +/** + * Trait used by all generators that exports the translations to multidimensional arrays + * (context => [original => [translation, plural1, pluraln...]]). + */ +trait MultidimensionalArrayTrait +{ + use HeadersGeneratorTrait; + use HeadersExtractorTrait; + + /** + * Returns a multidimensional array. + * + * @param Translations $translations + * @param bool $includeHeaders + * @param bool $forceArray + * + * @return array + */ + protected static function toArray(Translations $translations, $includeHeaders, $forceArray = false) + { + $pluralForm = $translations->getPluralForms(); + $pluralSize = is_array($pluralForm) ? ($pluralForm[0] - 1) : null; + $messages = []; + + if ($includeHeaders) { + $messages[''] = [ + '' => [static::generateHeaders($translations)], + ]; + } + + foreach ($translations as $translation) { + if ($translation->isDisabled()) { + continue; + } + + $context = $translation->getContext(); + $original = $translation->getOriginal(); + + if (!isset($messages[$context])) { + $messages[$context] = []; + } + + if ($translation->hasPluralTranslations(true)) { + $messages[$context][$original] = $translation->getPluralTranslations($pluralSize); + array_unshift($messages[$context][$original], $translation->getTranslation()); + } elseif ($forceArray) { + $messages[$context][$original] = [$translation->getTranslation()]; + } else { + $messages[$context][$original] = $translation->getTranslation(); + } + } + + return [ + 'domain' => $translations->getDomain(), + 'plural-forms' => $translations->getHeader('Plural-Forms'), + 'messages' => $messages, + ]; + } + + /** + * Extract the entries from a multidimensional array. + * + * @param array $messages + * @param Translations $translations + */ + protected static function fromArray(array $messages, Translations $translations) + { + if (!empty($messages['domain'])) { + $translations->setDomain($messages['domain']); + } + + if (!empty($messages['plural-forms'])) { + $translations->setHeader(Translations::HEADER_PLURAL, $messages['plural-forms']); + } + + foreach ($messages['messages'] as $context => $contextTranslations) { + foreach ($contextTranslations as $original => $value) { + if ($context === '' && $original === '') { + static::extractHeaders(is_array($value) ? array_shift($value) : $value, $translations); + continue; + } + + $translation = $translations->insert($context, $original); + + if (is_array($value)) { + $translation->setTranslation(array_shift($value)); + $translation->setPluralTranslations($value); + } else { + $translation->setTranslation($value); + } + } + } + } +} diff --git a/vendor/gettext/gettext/src/Utils/ParsedComment.php b/vendor/gettext/gettext/src/Utils/ParsedComment.php new file mode 100644 index 0000000000..161a85a457 --- /dev/null +++ b/vendor/gettext/gettext/src/Utils/ParsedComment.php @@ -0,0 +1,140 @@ +<?php + +namespace Gettext\Utils; + +/** + * Comment parsed by PhpFunctionsScanner. + */ +class ParsedComment +{ + /** + * The comment itself. + * + * @var string + */ + protected $comment; + + /** + * The line where the comment starts. + * + * @var int + */ + protected $firstLine; + + /** + * The line where the comment ends. + * + * @var int + */ + protected $lastLine; + + /** + * Initializes the instance. + * + * @param string $comment The comment itself. + * @param int $firstLine The line where the comment starts. + * @param int $lastLine The line where the comment ends. + */ + public function __construct($comment, $firstLine, $lastLine) + { + $this->comment = $comment; + $this->firstLine = $firstLine; + $this->lastLine = $lastLine; + } + + /** + * Create new object from raw comment data. + * + * @param string $value The PHP comment string. + * @param int $line The line where the comment starts. + * + * @return static The parsed comment. + */ + public static function create($value, $line) + { + $lastLine = $line + substr_count($value, "\n"); + + $lines = array_map(function ($line) { + if ('' === trim($line)) { + return null; + } + + $line = ltrim($line, "#*/ \t"); + $line = rtrim($line, "#*/ \t"); + + return trim($line); + }, explode("\n", $value)); + + // Remove empty lines. + $lines = array_filter($lines); + $value = implode(' ', $lines); + + return new static($value, $line, $lastLine); + } + + /** + * Return the line where the comment starts. + * + * @return int Line number. + */ + public function getFirstLine() + { + return $this->firstLine; + } + + /** + * Return the line where the comment ends. + * + * @return int Line number. + */ + public function getLastLine() + { + return $this->lastLine; + } + + /** + * Return the actual comment string. + * + * @return string The comment. + */ + public function getComment() + { + return $this->comment; + } + + /** + * Whether this comment is related with a given function. + * + * @param ParsedFunction $function The function to check. + * @return bool Whether the comment is related or not. + */ + public function isRelatedWith(ParsedFunction $function) + { + return $this->getLastLine() === $function->getLine() || $this->getLastLine() === $function->getLine() - 1; + } + + /** + * Whether the comment matches the required prefixes. + * + * @param array $prefixes An array of prefixes to check. + * @return bool Whether the comment matches the prefixes or not. + */ + public function checkPrefixes(array $prefixes) + { + if ('' === $this->comment) { + return false; + } + + if (empty($prefixes)) { + return true; + } + + foreach ($prefixes as $prefix) { + if (strpos($this->comment, $prefix) === 0) { + return true; + } + } + + return false; + } +} diff --git a/vendor/gettext/gettext/src/Utils/ParsedFunction.php b/vendor/gettext/gettext/src/Utils/ParsedFunction.php index e2f5492346..5c5aa8ea3a 100644 --- a/vendor/gettext/gettext/src/Utils/ParsedFunction.php +++ b/vendor/gettext/gettext/src/Utils/ParsedFunction.php @@ -16,7 +16,7 @@ class ParsedFunction /** * The line where the function starts. - * + * * @var int */ protected $line; @@ -59,7 +59,7 @@ public function __construct($name, $line) { $this->name = $name; $this->line = $line; - $this->arguments = array(); + $this->arguments = []; $this->argumentIndex = -1; $this->argumentStopped = false; $this->comments = null; @@ -93,7 +93,7 @@ public function nextArgument() /** * Add a string to the current argument. * - * @param string $chunk + * @param string|null $chunk */ public function addArgumentChunk($chunk) { @@ -117,33 +117,43 @@ public function addArgumentChunk($chunk) public function addComment($comment) { if ($this->comments === null) { - $this->comments = array(); + $this->comments = []; } $this->comments[] = $comment; } + /** - * A closing parenthesis was found: return the final data. + * Return the line the function starts. * - * @return array{ + * @return int Line number. + */ + public function getLine() + { + return $this->line; + } + + /** + * A closing parenthesis was found: return the final data. + * The array returned has the following values: + * 0 => string The function name. + * 1 => int The line where the function starts. + * 2 => string[] the strings extracted from the function arguments. + * 3 => string[] the comments associated to the function. * - * @var string The function name. - * @var int The line where the function starts. - * @var string[] the strings extracted from the function arguments. - * @var string[] the comments associated to the function. - * } + * @return array */ public function close() { - $arguments = array(); + $arguments = []; for ($i = 0; $i <= $this->argumentIndex; ++$i) { - $arguments[$i] = isset($this->arguments[$i]) ? $this->arguments[$i] : ''; + $arguments[$i] = isset($this->arguments[$i]) ? $this->arguments[$i] : null; } - return array( + return [ $this->name, $this->line, $arguments, $this->comments, - ); + ]; } } diff --git a/vendor/gettext/gettext/src/Utils/PhpFunctionsScanner.php b/vendor/gettext/gettext/src/Utils/PhpFunctionsScanner.php index 760e175796..01dc1f8017 100644 --- a/vendor/gettext/gettext/src/Utils/PhpFunctionsScanner.php +++ b/vendor/gettext/gettext/src/Utils/PhpFunctionsScanner.php @@ -16,18 +16,18 @@ class PhpFunctionsScanner extends FunctionsScanner /** * If not false, comments will be extracted. * - * @var string|false + * @var string|false|array */ protected $extractComments = false; /** * Enable extracting comments that start with a tag (if $tag is empty all the comments will be extracted). * - * @param string $tag + * @param mixed $tag */ public function enableCommentsExtraction($tag = '') { - $this->extractComments = (string) $tag; + $this->extractComments = $tag; } /** @@ -58,13 +58,15 @@ function ($token) { /** * {@inheritdoc} */ - public function getFunctions() + public function getFunctions(array $constants = []) { $count = count($this->tokens); - $bufferFunctions = array(); /* @var ParsedFunction[] $bufferFunctions */ - $functions = array(); - /* @var ParsedFunction[] $functions */ + $bufferFunctions = []; + /* @var ParsedComment[] $bufferComments */ + $bufferComments = []; + /* @var array $functions */ + $functions = []; for ($k = 0; $k < $count; ++$k) { $value = $this->tokens[$k]; @@ -95,38 +97,62 @@ public function getFunctions() $bufferFunctions[0]->addArgumentChunk(PhpCode::convertString($value[1])); } break; + case T_STRING: if (isset($bufferFunctions[0])) { + if (isset($constants[$value[1]])) { + $bufferFunctions[0]->addArgumentChunk($constants[$value[1]]); + break; + } + + if (strtolower($value[1]) === 'null') { + $bufferFunctions[0]->addArgumentChunk(null); + break; + } + $bufferFunctions[0]->stopArgument(); } + //new function found for ($j = $k + 1; $j < $count; ++$j) { $nextToken = $this->tokens[$j]; + if (is_array($nextToken) && $nextToken[0] === T_COMMENT) { continue; } + if ($nextToken === '(') { $newFunction = new ParsedFunction($value[1], $value[2]); - if ($k > 0 && is_array($this->tokens[$k - 1]) && $this->tokens[$k - 1][0] === T_COMMENT) { - $comment = $this->parsePhpComment($this->tokens[$k - 1][1]); - if ($comment !== null) { - $newFunction->addComment($comment); + + // add comment that was on the line before. + if (isset($bufferComments[0])) { + $comment = $bufferComments[0]; + + if ($comment->isRelatedWith($newFunction)) { + $newFunction->addComment($comment->getComment()); } } + array_unshift($bufferFunctions, $newFunction); $k = $j; } break; } break; + case T_COMMENT: - if (isset($bufferFunctions[0])) { - $comment = $this->parsePhpComment($value[1]); - if ($comment !== null) { - $bufferFunctions[0]->addComment($comment); + $comment = $this->parsePhpComment($value[1], $value[2]); + + if ($comment) { + array_unshift($bufferComments, $comment); + + // The comment is inside the function call. + if (isset($bufferFunctions[0])) { + $bufferFunctions[0]->addComment($comment->getComment()); } } break; + default: if (isset($bufferFunctions[0])) { $bufferFunctions[0]->stopArgument(); @@ -138,23 +164,31 @@ public function getFunctions() return $functions; } - protected function parsePhpComment($value) + /** + * Extract the actual text from a PHP comment. + * + * If set, only returns comments that match the prefix(es). + * + * @param string $value The PHP comment. + * @param int $line Line number. + * + * @return null|ParsedComment Comment or null if comment extraction is disabled or if there is a prefix mismatch. + */ + protected function parsePhpComment($value, $line) { - $result = null; - if ($this->extractComments !== false) { - if ($value[0] === '#') { - $value = substr($value, 1); - } elseif ($value[1] === '/') { - $value = substr($value, 2); - } else { - $value = substr($value, 2, -2); - } - $value = trim($value); - if ($value !== '' && ($this->extractComments === '' || strpos($value, $this->extractComments) === 0)) { - $result = $value; - } + if ($this->extractComments === false) { + return null; + } + + //this returns a comment or null + $comment = ParsedComment::create($value, $line); + + $prefixes = array_filter((array) $this->extractComments); + + if ($comment && $comment->checkPrefixes($prefixes)) { + return $comment; } - return $result; + return null; } } diff --git a/vendor/gettext/gettext/src/translator_functions.php b/vendor/gettext/gettext/src/translator_functions.php old mode 100644 new mode 100755 index e240075ed9..fbfe68ea43 --- a/vendor/gettext/gettext/src/translator_functions.php +++ b/vendor/gettext/gettext/src/translator_functions.php @@ -19,7 +19,19 @@ function __($original) $args = array_slice(func_get_args(), 1); - return vsprintf($text, is_array($args[0]) ? $args[0] : $args); + return is_array($args[0]) ? strtr($text, $args[0]) : vsprintf($text, $args); +} + +/** + * Noop, marks the string for translation but returns it unchanged. + * + * @param string $original + * + * @return string + */ +function noop__($original) +{ + return $original; } /** @@ -41,7 +53,7 @@ function n__($original, $plural, $value) $args = array_slice(func_get_args(), 3); - return vsprintf($text, is_array($args[0]) ? $args[0] : $args); + return is_array($args[0]) ? strtr($text, $args[0]) : vsprintf($text, $args); } /** @@ -62,7 +74,7 @@ function p__($context, $original) $args = array_slice(func_get_args(), 2); - return vsprintf($text, is_array($args[0]) ? $args[0] : $args); + return is_array($args[0]) ? strtr($text, $args[0]) : vsprintf($text, $args); } /** @@ -83,7 +95,7 @@ function d__($domain, $original) $args = array_slice(func_get_args(), 2); - return vsprintf($text, is_array($args[0]) ? $args[0] : $args); + return is_array($args[0]) ? strtr($text, $args[0]) : vsprintf($text, $args); } /** @@ -105,22 +117,22 @@ function dp__($domain, $context, $original) $args = array_slice(func_get_args(), 3); - return vsprintf($text, is_array($args[0]) ? $args[0] : $args); + return is_array($args[0]) ? strtr($text, $args[0]) : vsprintf($text, $args); } /** - * Returns the singular/plural translation of a string in a specific context. + * Returns the singular/plural translation of a string in a specific domain. * - * @param string $context + * @param string $domain * @param string $original * @param string $plural * @param string $value * * @return string */ -function np__($context, $original, $plural, $value) +function dn__($domain, $original, $plural, $value) { - $text = BaseTranslator::$current->npgettext($context, $original, $plural, $value); + $text = BaseTranslator::$current->dngettext($domain, $original, $plural, $value); if (func_num_args() === 4) { return $text; @@ -128,13 +140,12 @@ function np__($context, $original, $plural, $value) $args = array_slice(func_get_args(), 4); - return vsprintf($text, is_array($args[0]) ? $args[0] : $args); + return is_array($args[0]) ? strtr($text, $args[0]) : vsprintf($text, $args); } /** - * Returns the singular/plural translation of a string in a specific domain and context. + * Returns the singular/plural translation of a string in a specific context. * - * @param string $domain * @param string $context * @param string $original * @param string $plural @@ -142,75 +153,39 @@ function np__($context, $original, $plural, $value) * * @return string */ -function dnp__($domain, $context, $original, $plural, $value) +function np__($context, $original, $plural, $value) { - $text = BaseTranslator::$current->dnpgettext($domain, $context, $original, $plural, $value); + $text = BaseTranslator::$current->npgettext($context, $original, $plural, $value); - if (func_num_args() === 5) { + if (func_num_args() === 4) { return $text; } - $args = array_slice(func_get_args(), 5); - - return vsprintf($text, is_array($args[0]) ? $args[0] : $args); -} + $args = array_slice(func_get_args(), 4); -/** - * Prints function result. - * - * @see __ - */ -function __e() -{ - echo call_user_func_array('__', func_get_args()); + return is_array($args[0]) ? strtr($text, $args[0]) : vsprintf($text, $args); } /** - * Prints function result. + * Returns the singular/plural translation of a string in a specific domain and context. * - * @see n__ - */ -function n__e() -{ - echo call_user_func_array('n__', func_get_args()); -} - -/** - * Prints function result. + * @param string $domain + * @param string $context + * @param string $original + * @param string $plural + * @param string $value * - * @see p__ + * @return string */ -function p__e() +function dnp__($domain, $context, $original, $plural, $value) { - echo call_user_func_array('p__', func_get_args()); -} + $text = BaseTranslator::$current->dnpgettext($domain, $context, $original, $plural, $value); -/** - * Prints function result. - * - * @see d__ - */ -function d__e() -{ - echo call_user_func_array('d__', func_get_args()); -} + if (func_num_args() === 5) { + return $text; + } -/** - * Prints function result. - * - * @see dp__ - */ -function dp__e() -{ - echo call_user_func_array('dp__', func_get_args()); -} + $args = array_slice(func_get_args(), 5); -/** - * Prints function result. - * - * @see dnp__ - */ -function dnp__e() -{ - echo call_user_func_array('dnp__', func_get_args()); + return is_array($args[0]) ? strtr($text, $args[0]) : vsprintf($text, $args); } diff --git a/vendor/gettext/languages/UNICODE-LICENSE.txt b/vendor/gettext/languages/UNICODE-LICENSE.txt index a121510c0b..567fda24dd 100644 --- a/vendor/gettext/languages/UNICODE-LICENSE.txt +++ b/vendor/gettext/languages/UNICODE-LICENSE.txt @@ -1,50 +1,46 @@ UNICODE, INC. LICENSE AGREEMENT - DATA FILES AND SOFTWARE - Unicode Data Files include all data files under the directories -http://www.unicode.org/Public/, http://www.unicode.org/reports/, and -http://www.unicode.org/cldr/data/. Unicode Data Files do not include PDF -online code charts under the directory http://www.unicode.org/Public/. -Software includes any source code published in the Unicode Standard or under -the directories http://www.unicode.org/Public/, -http://www.unicode.org/reports/, and http://www.unicode.org/cldr/data/. +See Terms of Use for definitions of Unicode Inc.'s +Data Files and Software. - NOTICE TO USER: Carefully read the following legal agreement. BY -DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING UNICODE INC.'S DATA FILES -("DATA FILES"), AND/OR SOFTWARE ("SOFTWARE"), YOU UNEQUIVOCALLY ACCEPT, AND -AGREE TO BE BOUND BY, ALL OF THE TERMS AND CONDITIONS OF THIS AGREEMENT. IF -YOU DO NOT AGREE, DO NOT DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE THE DATA -FILES OR SOFTWARE. +NOTICE TO USER: Carefully read the following legal agreement. +BY DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING UNICODE INC.'S +DATA FILES ("DATA FILES"), AND/OR SOFTWARE ("SOFTWARE"), +YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE +TERMS AND CONDITIONS OF THIS AGREEMENT. +IF YOU DO NOT AGREE, DO NOT DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE +THE DATA FILES OR SOFTWARE. - COPYRIGHT AND PERMISSION NOTICE +COPYRIGHT AND PERMISSION NOTICE - Copyright © 1991-2014 Unicode, Inc. All rights reserved. Distributed under -the Terms of Use in http://www.unicode.org/copyright.html. +Copyright © 1991-2019 Unicode, Inc. All rights reserved. +Distributed under the Terms of Use in https://www.unicode.org/copyright.html. - Permission is hereby granted, free of charge, to any person obtaining a -copy of the Unicode data files and any associated documentation (the "Data -Files") or Unicode software and any associated documentation (the "Software") -to deal in the Data Files or Software without restriction, including without -limitation the rights to use, copy, modify, merge, publish, distribute, and/or -sell copies of the Data Files or Software, and to permit persons to whom the -Data Files or Software are furnished to do so, provided that (a) the above -copyright notice(s) and this permission notice appear with all copies of the -Data Files or Software, (b) both the above copyright notice(s) and this -permission notice appear in associated documentation, and (c) there is clear -notice in each modified Data File or in the Software as well as in the -documentation associated with the Data File(s) or Software that the data or -software has been modified. +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Unicode data files and any associated documentation +(the "Data Files") or Unicode software and any associated documentation +(the "Software") to deal in the Data Files or Software +without restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, and/or sell copies of +the Data Files or Software, and to permit persons to whom the Data Files +or Software are furnished to do so, provided that either +(a) this copyright and permission notice appear with all copies +of the Data Files or Software, or +(b) this copyright and permission notice appear in associated +Documentation. - THE DATA FILES AND SOFTWARE ARE 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 OF THIRD -PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN -THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL -DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR -PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS -ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THE -DATA FILES OR SOFTWARE. +THE DATA FILES AND SOFTWARE ARE 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 OF THIRD PARTY RIGHTS. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS +NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL +DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, +DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THE DATA FILES OR SOFTWARE. - Except as contained in this notice, the name of a copyright holder shall -not be used in advertising or otherwise to promote the sale, use or other -dealings in these Data Files or Software without prior written authorization -of the copyright holder. +Except as contained in this notice, the name of a copyright holder +shall not be used in advertising or otherwise to promote the sale, +use or other dealings in these Data Files or Software without prior +written authorization of the copyright holder. diff --git a/vendor/gettext/languages/bin/export-plural-rules b/vendor/gettext/languages/bin/export-plural-rules index e246599cb0..0931ee5aca 100755 --- a/vendor/gettext/languages/bin/export-plural-rules +++ b/vendor/gettext/languages/bin/export-plural-rules @@ -1,4 +1,287 @@ -#!/usr/bin/env php <?php -include 'export-plural-rules.php'; +use Gettext\Languages\Exporter\Exporter; +use Gettext\Languages\Language; + +// Let's start by imposing that we don't accept any error or warning. +// This is a really life-saving approach. +error_reporting(E_ALL); +set_error_handler(function ($errno, $errstr, $errfile, $errline) { + fprintf(STDERR, "${errstr}\nFile: ${errfile}\nLine: ${errline}\nCode: ${errno}\n"); + die(5); +}); + +require_once dirname(__DIR__) . '/src/autoloader.php'; + +// Parse the command line options +Enviro::initialize(); + +try { + if (isset(Enviro::$languages)) { + $languages = array(); + foreach (Enviro::$languages as $languageId) { + $language = Language::getById($languageId); + if (!isset($language)) { + throw new Exception("Unable to find the language with id '${languageId}'"); + } + $languages[] = $language; + } + } else { + $languages = Language::getAll(); + } + if (Enviro::$reduce) { + $languages = Enviro::reduce($languages); + } + if (Enviro::$noExtraParenthesis) { + $languages = array_map( + function (Language $language) { + $language->formula = $language->buildFormula(true); + + return $language; + }, + $languages + ); + } + if (isset(Enviro::$outputFilename)) { + echo call_user_func(array(Exporter::getExporterClassName(Enviro::$outputFormat), 'toFile'), $languages, Enviro::$outputFilename, array('us-ascii' => Enviro::$outputUSAscii)); + } else { + echo call_user_func(array(Exporter::getExporterClassName(Enviro::$outputFormat), 'toString'), $languages, array('us-ascii' => Enviro::$outputUSAscii)); + } +} catch (Exception $x) { + fprintf(STDERR, $x->getMessage() . "\n"); + fprintf(STDERR, "Trace:\n"); + fprintf(STDERR, $x->getTraceAsString() . "\n"); + die(4); +} + +die(0); + +/** + * Helper class to handle command line options. + */ +class Enviro +{ + /** + * Shall the output contain only US-ASCII characters? + * + * @var bool + */ + public static $outputUSAscii; + + /** + * The output format. + * + * @var string + */ + public static $outputFormat; + + /** + * Output file name. + * + * @var string + */ + public static $outputFilename; + + /** + * List of wanted language IDs; it not set: all languages will be returned. + * + * @var array|null + */ + public static $languages; + + /** + * Reduce the language list to the minimum common denominator. + * + * @var bool + */ + public static $reduce; + + /** + * Omit extra parenthesis in plural rule formulas. + * + * @var bool + */ + public static $noExtraParenthesis; + + /** + * Parse the command line options. + */ + public static function initialize() + { + global $argv; + self::$outputUSAscii = false; + self::$outputFormat = null; + self::$outputFilename = null; + self::$languages = null; + self::$reduce = null; + self::$noExtraParenthesis = false; + $exporters = Exporter::getExporters(); + if (isset($argv) && is_array($argv)) { + foreach ($argv as $argi => $arg) { + if ($argi === 0) { + continue; + } + if (is_string($arg)) { + $argLC = trim(strtolower($arg)); + switch ($argLC) { + case '-h': + case '--help': + self::showSyntax(); + die(0); + case '--us-ascii': + self::$outputUSAscii = true; + break; + case '--reduce=yes': + self::$reduce = true; + break; + case '--reduce=no': + self::$reduce = false; + break; + case '--parenthesis=yes': + self::$noExtraParenthesis = false; + break; + case '--parenthesis=no': + self::$noExtraParenthesis = true; + break; + default: + if (preg_match('/^--output=.+$/', $argLC)) { + if (isset(self::$outputFilename)) { + fprintf(STDERR, "The output file name has been specified more than once!\n"); + self::showSyntax(); + die(3); + } + list(, self::$outputFilename) = explode('=', $arg, 2); + self::$outputFilename = trim(self::$outputFilename); + } elseif (preg_match('/^--languages?=.+$/', $argLC)) { + list(, $s) = explode('=', $arg, 2); + $list = explode(',', $s); + if (is_array(self::$languages)) { + self::$languages = array_merge(self::$languages, $list); + } else { + self::$languages = $list; + } + } elseif (isset($exporters[$argLC])) { + if (isset(self::$outputFormat)) { + fprintf(STDERR, "The output format has been specified more than once!\n"); + self::showSyntax(); + die(3); + } + self::$outputFormat = $argLC; + } else { + fprintf(STDERR, "Unknown option: ${arg}\n"); + self::showSyntax(); + die(2); + } + break; + } + } + } + } + if (!isset(self::$outputFormat)) { + self::showSyntax(); + die(1); + } + if (isset(self::$languages)) { + self::$languages = array_values(array_unique(self::$languages)); + } + if (!isset(self::$reduce)) { + self::$reduce = isset(self::$languages) ? false : true; + } + } + + /** + * Write out the syntax. + */ + public static function showSyntax() + { + $basename = basename(__FILE__); + $exporters = array_keys(Exporter::getExporters(true)); + $exporterList = implode('|', $exporters); + fprintf(STDERR, <<<EOT +Syntax: + ${basename} [-h|--help] [--us-ascii] [--languages=<LanguageId>[,<LanguageId>,...]] [--reduce=yes|no] [--parenthesis=yes|no] [--output=<file name>] <${exporterList}> + +Where: + --help + show this help message. + + --us-ascii + if specified, the output will contain only US-ASCII characters. + + --languages(or --language) + export only the specified language codes. + Separate languages with commas; you can also use this argument + more than once; it's case insensitive and accepts both '_' and + '-' as locale chunks separator (eg we accept 'it_IT' as well as + 'it-it'). + --reduce + if set to yes the output won't contain languages with the same + base language and rules. + For instance nl_BE ('Flemish') will be omitted because it's the + same as nl ('Dutch'). + Defaults to 'no' if --languages is specified, to 'yes' otherwise. + --parenthesis + if set to no, extra parenthesis will be omitted in generated + plural rules formulas. + Those extra parenthesis are needed to create a PHP-compatible + formula. + Defaults to 'yes' + --output + if specified, the output will be saved to <file name>. If not + specified we'll output to standard output. + +Output formats + +EOT + ); + $len = max(array_map('strlen', $exporters)); + foreach ($exporters as $exporter) { + fprintf(STDERR, ' ' . str_pad($exporter, $len) . ': ' . Exporter::getExporterDescription($exporter) . "\n"); + } + fprintf(STDERR, "\n"); + } + + /** + * Reduce a language list to the minimum common denominator. + * + * @param Language[] $languages + * + * @return Language[] + */ + public static function reduce($languages) + { + for ($numChunks = 3; $numChunks >= 2; $numChunks--) { + $filtered = array(); + foreach ($languages as $language) { + $chunks = explode('_', $language->id); + $compatibleFound = false; + if (count($chunks) === $numChunks) { + $categoriesHash = serialize($language->categories); + $otherIds = array(); + $otherIds[] = $chunks[0]; + for ($k = 2; $k < $numChunks; $k++) { + $otherIds[] = $chunks[0] . '_' . $chunks[$numChunks - 1]; + } + + foreach ($languages as $check) { + foreach ($otherIds as $otherId) { + if (($check->id === $otherId) && ($check->formula === $language->formula) && (serialize($check->categories) === $categoriesHash)) { + $compatibleFound = true; + break; + } + } + if ($compatibleFound === true) { + break; + } + } + } + if (!$compatibleFound) { + $filtered[] = $language; + } + } + $languages = $filtered; + } + + return $languages; + } +} diff --git a/vendor/gettext/languages/bin/export-plural-rules.bat b/vendor/gettext/languages/bin/export-plural-rules.bat index 8497bb6491..b99ef8d4b1 100644 --- a/vendor/gettext/languages/bin/export-plural-rules.bat +++ b/vendor/gettext/languages/bin/export-plural-rules.bat @@ -1,8 +1 @@ -@echo off - -if "%PHPBIN%" == "" set PHPBIN=@php_bin@ -if not exist "%PHPBIN%" set PHPBIN=%PHP_PEAR_PHP_BIN% -if not exist "%PHPBIN%" set PHPBIN=php -set MY_BIN_FOLDER=@bin_dir@ -if not exist "%MY_BIN_FOLDER%" set MY_BIN_FOLDER=%~dp0 -"%PHPBIN%" "%MY_BIN_FOLDER%\export-plural-rules" %* +@php "%~dpn0" %* \ No newline at end of file diff --git a/vendor/gettext/languages/bin/export-plural-rules.php b/vendor/gettext/languages/bin/export-plural-rules.php deleted file mode 100755 index 29adda0128..0000000000 --- a/vendor/gettext/languages/bin/export-plural-rules.php +++ /dev/null @@ -1,234 +0,0 @@ -<?php -use Gettext\Languages\Exporter\Exporter; -use Gettext\Languages\Language; - -// Let's start by imposing that we don't accept any error or warning. -// This is a really life-saving approach. -error_reporting(E_ALL); -set_error_handler(function ($errno, $errstr, $errfile, $errline) { - Enviro::echoErr("$errstr\nFile: $errfile\nLine: $errline\nCode: $errno\n"); - die(5); -}); - -require_once dirname(__DIR__).'/src/autoloader.php'; - -// Parse the command line options -Enviro::initialize(); - -try { - if (isset(Enviro::$languages)) { - $languages = array(); - foreach (Enviro::$languages as $languageId) { - $language = Language::getById($languageId); - if (!isset($language)) { - throw new Exception("Unable to find the language with id '$languageId'"); - } - $languages[] = $language; - } - } else { - $languages = Language::getAll(); - } - if (Enviro::$reduce) { - $languages = Enviro::reduce($languages); - } - if (isset(Enviro::$outputFilename)) { - echo call_user_func(array(Exporter::getExporterClassName(Enviro::$outputFormat), 'toFile'), $languages, Enviro::$outputFilename, array('us-ascii' => Enviro::$outputUSAscii)); - } else { - echo call_user_func(array(Exporter::getExporterClassName(Enviro::$outputFormat), 'toString'), $languages, array('us-ascii' => Enviro::$outputUSAscii)); - } -} catch (Exception $x) { - Enviro::echoErr($x->getMessage()."\n"); - Enviro::echoErr("Trace:\n"); - Enviro::echoErr($x->getTraceAsString()."\n"); - die(4); -} - -die(0); - -/** - * Helper class to handle command line options. - */ -class Enviro -{ - /** - * Shall the output contain only US-ASCII characters? - * @var bool - */ - public static $outputUSAscii; - /** - * The output format. - * @var string - */ - public static $outputFormat; - /** - * Output file name. - * @var string - */ - public static $outputFilename; - /** - * List of wanted language IDs; it not set: all languages will be returned. - * @var array|null - */ - public static $languages; - /** - * Reduce the language list to the minimum common denominator. - * @var bool - */ - public static $reduce; - /** - * Parse the command line options. - */ - public static function initialize() - { - global $argv; - self::$outputUSAscii = false; - self::$outputFormat = null; - self::$outputFilename = null; - self::$languages = null; - self::$reduce = null; - $exporters = Exporter::getExporters(); - if (isset($argv) && is_array($argv)) { - foreach ($argv as $argi => $arg) { - if ($argi === 0) { - continue; - } - if (is_string($arg)) { - $argLC = trim(strtolower($arg)); - switch ($argLC) { - case '--us-ascii': - self::$outputUSAscii = true; - break; - case '--reduce=yes': - self::$reduce = true; - break; - case '--reduce=no': - self::$reduce = false; - break; - default: - if (preg_match('/^--output=.+$/', $argLC)) { - if (isset(self::$outputFilename)) { - self::echoErr("The output file name has been specified more than once!\n"); - self::showSyntax(); - die(3); - } - list(, self::$outputFilename) = explode('=', $arg, 2); - self::$outputFilename = trim(self::$outputFilename); - } elseif (preg_match('/^--languages?=.+$/', $argLC)) { - list(, $s) = explode('=', $arg, 2); - $list = explode(',', $s); - if (is_array(self::$languages)) { - self::$languages = array_merge(self::$languages, $list); - } else { - self::$languages = $list; - } - } elseif (isset($exporters[$argLC])) { - if (isset(self::$outputFormat)) { - self::echoErr("The output format has been specified more than once!\n"); - self::showSyntax(); - die(3); - } - self::$outputFormat = $argLC; - } else { - self::echoErr("Unknown option: $arg\n"); - self::showSyntax(); - die(2); - } - break; - } - } - } - } - if (!isset(self::$outputFormat)) { - self::showSyntax(); - die(1); - } - if (isset(self::$languages)) { - self::$languages = array_values(array_unique(self::$languages)); - } - if (!isset(self::$reduce)) { - self::$reduce = isset(self::$languages) ? false : true; - } - } - - /** - * Write out the syntax. - */ - public static function showSyntax() - { - $exporters = array_keys(Exporter::getExporters(true)); - self::echoErr("Syntax: php ".basename(__FILE__)." [--us-ascii] [--languages=<LanguageId>[,<LanguageId>,...]] [--reduce=yes|no] [--output=<file name>] <".implode('|', $exporters).">\n"); - self::echoErr("Where:\n"); - self::echoErr("--us-ascii : if specified, the output will contain only US-ASCII characters.\n"); - self::echoErr("--languages: (or --language) export only the specified language codes.\n"); - self::echoErr(" Separate languages with commas; you can also use this argument\n"); - self::echoErr(" more than once; it's case insensitive and accepts both '_' and\n"); - self::echoErr(" '-' as locale chunks separator (eg we accept 'it_IT' as well as\n"); - self::echoErr(" 'it-it').\n"); - self::echoErr("--reduce : if set to yes the output won't contain languages with the same\n"); - self::echoErr(" base language and rules.\n For instance nl_BE ('Flemish') will be\n"); - self::echoErr(" omitted because it's the same as nl ('Dutch').\n"); - self::echoErr(" Defaults to 'no' --languages is specified, to 'yes' otherwise.\n"); - self::echoErr("--output : if specified, the output will be saved to <file name>. If not\n"); - self::echoErr(" specified we'll output to standard output.\n"); - self::echoErr("Output formats\n"); - $len = max(array_map('strlen', $exporters)); - foreach ($exporters as $exporter) { - self::echoErr(str_pad($exporter, $len).": ".Exporter::getExporterDescription($exporter)."\n"); - } - } - /** - * Print a string to stderr. - * @param string $str The string to be printed out. - */ - public static function echoErr($str) - { - $hStdErr = @fopen('php://stderr', 'a'); - if ($hStdErr === false) { - echo $str; - } else { - fwrite($hStdErr, $str); - fclose($hStdErr); - } - } - /** - * Reduce a language list to the minimum common denominator. - * @param Language[] $languages - * @return Language[] - */ - public static function reduce($languages) - { - for ($numChunks = 3; $numChunks >= 2; $numChunks--) { - $filtered = array(); - foreach ($languages as $language) { - $chunks = explode('_', $language->id); - $compatibleFound = false; - if (count($chunks) === $numChunks) { - $categoriesHash = serialize($language->categories); - $otherIds = array(); - $otherIds[] = $chunks[0]; - for ($k = 2; $k < $numChunks; $k++) { - $otherIds[] = $chunks[0].'_'.$chunks[$numChunks - 1]; - } - - foreach ($languages as $check) { - foreach ($otherIds as $otherId) { - if (($check->id === $otherId) && ($check->formula === $language->formula) && (serialize($check->categories) === $categoriesHash)) { - $compatibleFound = true; - break; - } - } - if ($compatibleFound === true) { - break; - } - } - } - if (!$compatibleFound) { - $filtered[] = $language; - } - } - $languages = $filtered; - } - - return $languages; - } -} diff --git a/vendor/gettext/languages/composer.json b/vendor/gettext/languages/composer.json index 3d5911d72c..ae56958c39 100644 --- a/vendor/gettext/languages/composer.json +++ b/vendor/gettext/languages/composer.json @@ -1,46 +1,54 @@ { - "name" : "gettext/languages", - "description" : "gettext languages with plural rules", - "keywords" : [ - "localization", - "l10n", - "internationalization", - "i18n", - "translations", - "translate", - "php", - "unicode", - "cldr", - "language", - "languages", - "plural", - "plurals", - "plural rules" - ], - "homepage" : "https://github.com/mlocati/cldr-to-gettext-plural-rules", - "license" : "MIT", - "authors" : [{ - "name" : "Michele Locati", - "email" : "mlocati@gmail.com", - "role" : "Developer" - } - ], - "autoload" : { - "psr-4" : { - "Gettext\\Languages\\" : "src/" - } - }, - "require" : { - "php" : ">=5.3" - }, - "require-dev": { - "phpunit/phpunit": "^4" - }, - "scripts": { - "test": "phpunit" - }, - "bin" : [ - "bin/export-plural-rules", - "bin/export-plural-rules.php" - ] + "name": "gettext/languages", + "description": "gettext languages with plural rules", + "keywords": [ + "localization", + "l10n", + "internationalization", + "i18n", + "translations", + "translate", + "php", + "unicode", + "cldr", + "language", + "languages", + "plural", + "plurals", + "plural rules" + ], + "homepage": "https://github.com/php-gettext/Languages", + "license": "MIT", + "authors": [ + { + "name": "Michele Locati", + "email": "mlocati@gmail.com", + "role": "Developer" + } + ], + "autoload": { + "psr-4": { + "Gettext\\Languages\\": "src/" + } + }, + "autoload-dev": { + "psr-4": { + "Gettext\\Languages\\Test\\": "tests/test/" + } + }, + "require": { + "php": ">=5.3" + }, + "require-dev": { + "phpunit/phpunit": "^4.8 || ^5.7 || ^6.5 || ^7.5 || ^8.4", + "friendsofphp/php-cs-fixer": "^2.16.0" + }, + "scripts": { + "test": "phpunit", + "cs-test": "php-cs-fixer fix --config=.php_cs.dist --path-mode=intersection --verbose --dry-run --diff", + "cs-fix": "php-cs-fixer fix --config=.php_cs.dist --path-mode=intersection" + }, + "bin": [ + "bin/export-plural-rules" + ] } \ No newline at end of file diff --git a/vendor/gettext/languages/src/Category.php b/vendor/gettext/languages/src/Category.php index c8a368ad81..5f491a0d9d 100644 --- a/vendor/gettext/languages/src/Category.php +++ b/vendor/gettext/languages/src/Category.php @@ -1,4 +1,5 @@ <?php + namespace Gettext\Languages; use Exception; @@ -10,38 +11,46 @@ class Category { /** * The category identifier (eg 'zero', 'one', ..., 'other'). + * * @var string */ public $id; + /** * The gettext formula that identifies this category (null if and only if the category is 'other'). + * * @var string|null */ public $formula; + /** * The CLDR representation of some exemplar numeric ranges that satisfy this category. + * * @var string|null */ public $examples; + /** * Initialize the instance and parse the formula. - * @param string $cldrCategoryId The CLDR category identifier (eg 'pluralRule-count-one'). - * @param string $cldrFormulaAndExamples The CLDR formula and examples (eg 'i = 1 and v = 0 @integer 1'). - * @throws Exception + * + * @param string $cldrCategoryId the CLDR category identifier (eg 'pluralRule-count-one') + * @param string $cldrFormulaAndExamples the CLDR formula and examples (eg 'i = 1 and v = 0 @integer 1') + * + * @throws \Exception */ public function __construct($cldrCategoryId, $cldrFormulaAndExamples) { $matches = array(); if (!preg_match('/^pluralRule-count-(.+)$/', $cldrCategoryId, $matches)) { - throw new Exception("Invalid CLDR category: '$cldrCategoryId'"); + throw new Exception("Invalid CLDR category: '${cldrCategoryId}'"); } if (!in_array($matches[1], CldrData::$categories)) { - throw new Exception("Invalid CLDR category: '$cldrCategoryId'"); + throw new Exception("Invalid CLDR category: '${cldrCategoryId}'"); } $this->id = $matches[1]; $cldrFormulaAndExamplesNormalized = trim(preg_replace('/\s+/', ' ', $cldrFormulaAndExamples)); if (!preg_match('/^([^@]*)(?:@integer([^@]+))?(?:@decimal(?:[^@]+))?$/', $cldrFormulaAndExamplesNormalized, $matches)) { - throw new Exception("Invalid CLDR category rule: $cldrFormulaAndExamples"); + throw new Exception("Invalid CLDR category rule: ${cldrFormulaAndExamples}"); } $cldrFormula = trim($matches[1]); $s = isset($matches[2]) ? trim($matches[2]) : ''; @@ -49,7 +58,7 @@ public function __construct($cldrCategoryId, $cldrFormulaAndExamples) switch ($this->id) { case CldrData::OTHER_CATEGORY: if ($cldrFormula !== '') { - throw new Exception("The '".CldrData::OTHER_CATEGORY."' category should not have any formula, but it has '$cldrFormula'"); + throw new Exception("The '" . CldrData::OTHER_CATEGORY . "' category should not have any formula, but it has '${cldrFormula}'"); } $this->formula = null; break; @@ -61,19 +70,26 @@ public function __construct($cldrCategoryId, $cldrFormulaAndExamples) break; } } + /** * Return a list of numbers corresponding to the $examples value. - * @throws Exception Throws an Exception if we weren't able to expand the examples. + * + * @throws \Exception throws an Exception if we weren't able to expand the examples + * * @return int[] */ public function getExampleIntegers() { return self::expandExamples($this->examples); } + /** * Expand a list of examples as defined by CLDR. + * * @param string $examples A string like '1, 2, 5...7, …'. - * @throws Exception Throws an Exception if we weren't able to expand $examples. + * + * @throws \Exception throws an Exception if we weren't able to expand $examples + * * @return int[] */ public static function expandExamples($examples) @@ -81,14 +97,14 @@ public static function expandExamples($examples) $result = array(); $m = null; if (substr($examples, -strlen(', …')) === ', …') { - $examples = substr($examples, 0, strlen($examples) -strlen(', …')); + $examples = substr($examples, 0, strlen($examples) - strlen(', …')); } foreach (explode(',', str_replace(' ', '', $examples)) as $range) { if (preg_match('/^\d+$/', $range)) { - $result[] = intval($range); + $result[] = (int) $range; } elseif (preg_match('/^(\d+)~(\d+)$/', $range, $m)) { - $from = intval($m[1]); - $to = intval($m[2]); + $from = (int) $m[1]; + $to = (int) $m[2]; $delta = $to - $from; $step = (int) max(1, $delta / 100); for ($i = $from; $i < $to; $i += $step) { @@ -96,11 +112,11 @@ public static function expandExamples($examples) } $result[] = $to; } else { - throw new Exception("Unhandled test range '$range' in '$examples'"); + throw new Exception("Unhandled test range '${range}' in '${examples}'"); } } if (empty($result)) { - throw new Exception("No test numbers from '$examples'"); + throw new Exception("No test numbers from '${examples}'"); } return $result; diff --git a/vendor/gettext/languages/src/CldrData.php b/vendor/gettext/languages/src/CldrData.php index 81b1d9fa8b..9218eca974 100644 --- a/vendor/gettext/languages/src/CldrData.php +++ b/vendor/gettext/languages/src/CldrData.php @@ -1,4 +1,5 @@ <?php + namespace Gettext\Languages; use Exception; @@ -10,166 +11,73 @@ class CldrData { /** * Super-special plural category: this should always be present for any language. + * * @var string */ const OTHER_CATEGORY = 'other'; + /** * The list of the plural categories, sorted from 'zero' to 'other'. + * * @var string[] */ public static $categories = array('zero', 'one', 'two', 'few', 'many', self::OTHER_CATEGORY); + /** - * The loaded CLDR data + * The loaded CLDR data. + * * @var array */ private static $data; + /** - * Returns the loaded CLDR data. - * @param string $key Can be 'languages', 'territories', 'plurals', 'supersededLanguages', 'scripts', 'standAloneScripts' + * @var array */ - private static function getData($key) - { - if (!isset(self::$data)) { - $fixKeys = function ($list, &$standAlone = null) { - $result = array(); - $standAlone = array(); - $match = null; - foreach ($list as $key => $value) { - $variant = ''; - if (preg_match('/^(.+)-alt-(short|variant|stand-alone|long)$/', $key, $match)) { - $key = $match[1]; - $variant = $match[2]; - } - $key = str_replace('-', '_', $key); - switch ($key) { - case 'root': // Language: Root - case 'und': // Language: Unknown Language - case 'zxx': // Language: No linguistic content - case 'ZZ': // Territory: Unknown Region - case 'Zinh': // Script: Inherited - case 'Zmth': // Script: Mathematical Notation - case 'Zsym': // Script: Symbols - case 'Zxxx': // Script: Unwritten - case 'Zyyy': // Script: Common - case 'Zzzz': // Script: Unknown Script - break; - default: - switch ($variant) { - case 'stand-alone': - $standAlone[$key] = $value; - break; - case '': - $result[$key] = $value; - break; - } - break; - } - } - - return $result; - }; - $data = array(); - $json = json_decode(file_get_contents(__DIR__.'/cldr-data/main/en-US/languages.json'), true); - $data['languages'] = $fixKeys($json['main']['en-US']['localeDisplayNames']['languages']); - $json = json_decode(file_get_contents(__DIR__.'/cldr-data/main/en-US/territories.json'), true); - $data['territories'] = $fixKeys($json['main']['en-US']['localeDisplayNames']['territories']); - $json = json_decode(file_get_contents(__DIR__.'/cldr-data/supplemental/plurals.json'), true); - $data['plurals'] = $fixKeys($json['supplemental']['plurals-type-cardinal']); - $json = json_decode(file_get_contents(__DIR__.'/cldr-data/main/en-US/scripts.json'), true); - $data['scripts'] = $fixKeys($json['main']['en-US']['localeDisplayNames']['scripts'], $data['standAloneScripts']); - $data['standAloneScripts'] = array_merge($data['scripts'], $data['standAloneScripts']); - $data['scripts'] = array_merge($data['standAloneScripts'], $data['scripts']); - $data['supersededLanguages'] = array(); - // Remove the languages for which we don't have plurals - $m = null; - foreach (array_keys(array_diff_key($data['languages'], $data['plurals'])) as $missingPlural) { - if (preg_match('/^([a-z]{2,3})_/', $missingPlural, $m)) { - if (!isset($data['plurals'][$m[1]])) { - unset($data['languages'][$missingPlural]); - } - } else { - unset($data['languages'][$missingPlural]); - } - } - // Fix the languages for which we have plurals - $formerCodes = array( - 'in' => 'id', // former Indonesian - 'iw' => 'he', // former Hebrew - 'ji' => 'yi', // former Yiddish - 'jw' => 'jv', // former Javanese - 'mo' => 'ro_MD', // former Moldavian - ); - $knownMissingLanguages = array( - 'bh' => 'Bihari', - 'guw' => 'Gun', - 'nah' => 'Nahuatl', - 'smi' => 'Sami', - ); - foreach (array_keys(array_diff_key($data['plurals'], $data['languages'])) as $missingLanguage) { - if (isset($formerCodes[$missingLanguage]) && isset($data['languages'][$formerCodes[$missingLanguage]])) { - $data['languages'][$missingLanguage] = $data['languages'][$formerCodes[$missingLanguage]]; - $data['supersededLanguages'][$missingLanguage] = $formerCodes[$missingLanguage]; - } else { - if (isset($knownMissingLanguages[$missingLanguage])) { - $data['languages'][$missingLanguage] = $knownMissingLanguages[$missingLanguage]; - } else { - throw new Exception("We have the plural rule for the language '$missingLanguage' but we don't have its language name"); - } - } - } - ksort($data['languages'], SORT_STRING); - ksort($data['territories'], SORT_STRING); - ksort($data['plurals'], SORT_STRING); - ksort($data['scripts'], SORT_STRING); - ksort($data['standAloneScripts'], SORT_STRING); - ksort($data['supersededLanguages'], SORT_STRING); - self::$data = $data; - } - if (!@isset(self::$data[$key])) { - throw new Exception("Invalid CLDR data key: '$key'"); - } + private static $plurals; - return self::$data[$key]; - } /** * Returns a dictionary containing the language names. * The keys are the language identifiers. * The values are the language names in US English. + * * @return string[] */ public static function getLanguageNames() { return self::getData('languages'); } + /** * Return a dictionary containing the territory names (in US English). * The keys are the territory identifiers. * The values are the territory names in US English. + * * @return string[] */ public static function getTerritoryNames() { return self::getData('territories'); } + /** * Return a dictionary containing the script names (in US English). * The keys are the script identifiers. * The values are the script names in US English. - * @param bool $standAlone Set to true to retrieve the stand-alone script names, false otherwise. + * + * @param bool $standAlone set to true to retrieve the stand-alone script names, false otherwise + * * @return string[] */ public static function getScriptNames($standAlone) { return self::getData($standAlone ? 'standAloneScripts' : 'scripts'); } - /** - * @var array - */ - private static $plurals; + /** * A dictionary containing the plural rules. * The keys are the language identifiers. * The values are arrays whose keys are the CLDR category names and the values are the CLDR category definition. + * * @example The English key-value pair is somethink like this: * <code><pre> * "en": { @@ -177,23 +85,29 @@ public static function getScriptNames($standAlone) * "pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …" * } * </pre></code> - * @var array + * + * @return array */ public static function getPlurals() { return self::getData('plurals'); } + /** * Return a list of superseded language codes. - * @return array Keys are the former language codes, values are the new language/locale codes. + * + * @return array keys are the former language codes, values are the new language/locale codes */ public static function getSupersededLanguages() { return self::getData('supersededLanguages'); } + /** * Retrieve the name of a language, as well as if a language code is deprecated in favor of another language code. - * @param string $id The language identifier. + * + * @param string $id the language identifier + * * @return array|null Returns an array with the keys 'id' (normalized), 'name', 'supersededBy' (optional), 'territory' (optional), 'script' (optional), 'baseLanguage' (optional), 'categories'. If $id is not valid returns null. */ public static function getLanguageInfo($id) @@ -206,10 +120,10 @@ public static function getLanguageInfo($id) $territoryId = (isset($matches[3]) && ($matches[3] !== '')) ? strtoupper($matches[3]) : null; $normalizedId = $languageId; if (isset($scriptId)) { - $normalizedId .= '_'.$scriptId; + $normalizedId .= '_' . $scriptId; } if (isset($territoryId)) { - $normalizedId .= '_'.$territoryId; + $normalizedId .= '_' . $territoryId; } // Structure precedence: see Likely Subtags - http://www.unicode.org/reports/tr35/tr35-31/tr35.html#Likely_Subtags $variants = array(); @@ -255,10 +169,10 @@ public static function getLanguageInfo($id) if (isset($languageNames[$variant])) { $languageName = $languageNames[$variant]; if (isset($scriptName) && (!in_array($variant, $variantsWithScript))) { - $languageName = $scriptName.' '.$languageName; + $languageName = $scriptName . ' ' . $languageName; } if (isset($territoryName) && (!in_array($variant, $variantsWithTerritory))) { - $languageName .= ' ('.$territoryNames[$territoryId].')'; + $languageName .= ' (' . $territoryNames[$territoryId] . ')'; } break; } @@ -313,4 +227,115 @@ public static function getLanguageInfo($id) return $result; } + + /** + * Returns the loaded CLDR data. + * + * @param string $key Can be 'languages', 'territories', 'plurals', 'supersededLanguages', 'scripts', 'standAloneScripts' + * + * @return array + */ + private static function getData($key) + { + if (!isset(self::$data)) { + $fixKeys = function ($list, &$standAlone = null) { + $result = array(); + $standAlone = array(); + $match = null; + foreach ($list as $key => $value) { + $variant = ''; + if (preg_match('/^(.+)-alt-(short|variant|stand-alone|long|menu)$/', $key, $match)) { + $key = $match[1]; + $variant = $match[2]; + } + $key = str_replace('-', '_', $key); + switch ($key) { + case 'root': // Language: Root + case 'und': // Language: Unknown Language + case 'zxx': // Language: No linguistic content + case 'ZZ': // Territory: Unknown Region + case 'Zinh': // Script: Inherited + case 'Zmth': // Script: Mathematical Notation + case 'Zsym': // Script: Symbols + case 'Zxxx': // Script: Unwritten + case 'Zyyy': // Script: Common + case 'Zzzz': // Script: Unknown Script + break; + default: + switch ($variant) { + case 'stand-alone': + $standAlone[$key] = $value; + break; + case '': + $result[$key] = $value; + break; + } + break; + } + } + + return $result; + }; + $data = array(); + $json = json_decode(file_get_contents(__DIR__ . '/cldr-data/main/en-US/languages.json'), true); + $data['languages'] = $fixKeys($json['main']['en-US']['localeDisplayNames']['languages']); + $json = json_decode(file_get_contents(__DIR__ . '/cldr-data/main/en-US/territories.json'), true); + $data['territories'] = $fixKeys($json['main']['en-US']['localeDisplayNames']['territories']); + $json = json_decode(file_get_contents(__DIR__ . '/cldr-data/supplemental/plurals.json'), true); + $data['plurals'] = $fixKeys($json['supplemental']['plurals-type-cardinal']); + $json = json_decode(file_get_contents(__DIR__ . '/cldr-data/main/en-US/scripts.json'), true); + $data['scripts'] = $fixKeys($json['main']['en-US']['localeDisplayNames']['scripts'], $data['standAloneScripts']); + $data['standAloneScripts'] = array_merge($data['scripts'], $data['standAloneScripts']); + $data['scripts'] = array_merge($data['standAloneScripts'], $data['scripts']); + $data['supersededLanguages'] = array(); + // Remove the languages for which we don't have plurals + $m = null; + foreach (array_keys(array_diff_key($data['languages'], $data['plurals'])) as $missingPlural) { + if (preg_match('/^([a-z]{2,3})_/', $missingPlural, $m)) { + if (!isset($data['plurals'][$m[1]])) { + unset($data['languages'][$missingPlural]); + } + } else { + unset($data['languages'][$missingPlural]); + } + } + // Fix the languages for which we have plurals + $formerCodes = array( + 'in' => 'id', // former Indonesian + 'iw' => 'he', // former Hebrew + 'ji' => 'yi', // former Yiddish + 'jw' => 'jv', // former Javanese + 'mo' => 'ro_MD', // former Moldavian + ); + $knownMissingLanguages = array( + 'guw' => 'Gun', + 'nah' => 'Nahuatl', + 'smi' => 'Sami', + ); + foreach (array_keys(array_diff_key($data['plurals'], $data['languages'])) as $missingLanguage) { + if (isset($formerCodes[$missingLanguage]) && isset($data['languages'][$formerCodes[$missingLanguage]])) { + $data['languages'][$missingLanguage] = $data['languages'][$formerCodes[$missingLanguage]]; + $data['supersededLanguages'][$missingLanguage] = $formerCodes[$missingLanguage]; + } else { + if (isset($knownMissingLanguages[$missingLanguage])) { + $data['languages'][$missingLanguage] = $knownMissingLanguages[$missingLanguage]; + } else { + throw new Exception("We have the plural rule for the language '${missingLanguage}' but we don't have its language name"); + } + } + } + ksort($data['languages'], SORT_STRING); + ksort($data['territories'], SORT_STRING); + ksort($data['plurals'], SORT_STRING); + ksort($data['scripts'], SORT_STRING); + ksort($data['standAloneScripts'], SORT_STRING); + ksort($data['supersededLanguages'], SORT_STRING); + self::$data = $data; + } + if (!isset(self::$data[$key])) { + throw new Exception("Invalid CLDR data key: '${key}'"); + } + + return self::$data[$key]; + } } diff --git a/vendor/gettext/languages/src/Exporter/Docs.php b/vendor/gettext/languages/src/Exporter/Docs.php index 45acac2738..3471294783 100644 --- a/vendor/gettext/languages/src/Exporter/Docs.php +++ b/vendor/gettext/languages/src/Exporter/Docs.php @@ -1,10 +1,33 @@ <?php + namespace Gettext\Languages\Exporter; class Docs extends Html { /** - * @see Exporter::toStringDo + * {@inheritdoc} + * + * @see \Gettext\Languages\Exporter\Exporter::isForPublicUse() + */ + public static function isForPublicUse() + { + return false; + } + + /** + * {@inheritdoc} + * + * @see \Gettext\Languages\Exporter\Exporter::getDescription() + */ + public static function getDescription() + { + return 'Build the page https://php-gettext.github.io/Languages/'; + } + + /** + * {@inheritdoc} + * + * @see \Gettext\Languages\Exporter\Exporter::toStringDo() */ protected static function toStringDo($languages) { @@ -18,11 +41,11 @@ protected static function toStringDo($languages) <meta name="author" content="Michele Locati"> <title>gettext plural rules - built from CLDR</title> <meta name="description" content="List of all language rules for gettext .po files automatically generated from the Unicode CLDR data" /> - <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css"> + <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css"> <link rel="stylesheet" href="style.css"> </head> <body> - <a href="https://github.com/mlocati/cldr-to-gettext-plural-rules" class="hidden-xs"><img style="position: fixed; top: 0; right: 0; border: 0; z-index: 2000" src="https://s3.amazonaws.com/github/ribbons/forkme_right_red_aa0000.png" alt="Fork me on GitHub"></a> + <a href="https://github.com/php-gettext/Languages" class="hidden-xs"><img style="position: fixed; top: 0; right: 0; border: 0; z-index: 2000" src="https://s3.amazonaws.com/github/ribbons/forkme_right_red_aa0000.png" alt="Fork me on GitHub"></a> <div class="container-fluid"> EOT; @@ -30,7 +53,7 @@ protected static function toStringDo($languages) $result .= <<<EOT </div> - <script src="http://code.jquery.com/jquery-1.11.2.min.js"></script> + <script src="//code.jquery.com/jquery-1.11.2.min.js"></script> <script src="script.js"></script> </body> </html> @@ -38,18 +61,4 @@ protected static function toStringDo($languages) return $result; } - /** - * @see Exporter::isForPublicUse - */ - public static function isForPublicUse() - { - return false; - } - /** - * @see Exporter::getDescription - */ - public static function getDescription() - { - return 'Build the page http://mlocati.github.io/cldr-to-gettext-plural-rules'; - } } diff --git a/vendor/gettext/languages/src/Exporter/Exporter.php b/vendor/gettext/languages/src/Exporter/Exporter.php index 9d7f19055f..834bf38026 100644 --- a/vendor/gettext/languages/src/Exporter/Exporter.php +++ b/vendor/gettext/languages/src/Exporter/Exporter.php @@ -1,8 +1,8 @@ <?php + namespace Gettext\Languages\Exporter; use Exception; -use Gettext\Languages\Language; /** * Base class for all the exporters. @@ -13,9 +13,12 @@ abstract class Exporter * @var array */ private static $exporters; + /** * Return the list of all the available exporters. Keys are the exporter handles, values are the exporter class names. - * @param bool $onlyForPublicUse If true, internal exporters will be omitted. + * + * @param bool $onlyForPublicUse if true, internal exporters will be omitted + * * @return string[] */ final public static function getExporters($onlyForPublicUse = false) @@ -35,7 +38,7 @@ final public static function getExporters($onlyForPublicUse = false) if ($onlyForPublicUse) { $result = array(); foreach (self::$exporters as $handle => $class) { - if (call_user_func(self::getExporterClassName($handle).'::isForPublicUse') === true) { + if (call_user_func(self::getExporterClassName($handle) . '::isForPublicUse') === true) { $result[$handle] = $class; } } @@ -45,42 +48,43 @@ final public static function getExporters($onlyForPublicUse = false) return $result; } + /** * Return the description of a specific exporter. - * @param string $exporterHandle The handle of the exporter. - * @throws Exception Throws an Exception if $exporterHandle is not valid. + * + * @param string $exporterHandle the handle of the exporter + * + * @throws \Exception throws an Exception if $exporterHandle is not valid + * * @return string */ final public static function getExporterDescription($exporterHandle) { $exporters = self::getExporters(); if (!isset($exporters[$exporterHandle])) { - throw new Exception("Invalid exporter handle: '$exporterHandle'"); + throw new Exception("Invalid exporter handle: '${exporterHandle}'"); } - return call_user_func(self::getExporterClassName($exporterHandle).'::getDescription'); + return call_user_func(self::getExporterClassName($exporterHandle) . '::getDescription'); } + /** * Returns the fully qualified class name of a exporter given its handle. - * @param string $exporterHandle The exporter class handle. + * + * @param string $exporterHandle the exporter class handle + * * @return string */ final public static function getExporterClassName($exporterHandle) { - return __NAMESPACE__.'\\'.ucfirst(strtolower($exporterHandle)); - } - /** - * Convert a list of Language instances to string. - * @param Language[] $languages The Language instances to convert. - * @return string - */ - protected static function toStringDo($languages) - { - throw new Exception(get_called_class().' does not implement the method '.__FUNCTION__); + return __NAMESPACE__ . '\\' . ucfirst(strtolower($exporterHandle)); } + /** * Convert a list of Language instances to string. - * @param Language[] $languages The Language instances to convert. + * + * @param \Gettext\Languages\Language[] $languages the Language instances to convert + * * @return string */ final public static function toString($languages, $options = null) @@ -97,32 +101,51 @@ final public static function toString($languages, $options = null) return static::toStringDo($languages); } + /** * Save the Language instances to a file. - * @param Language[] $languages The Language instances to convert. - * @throws Exception + * + * @param \Gettext\Languages\Language[] $languages the Language instances to convert + * + * @throws \Exception */ final public static function toFile($languages, $filename, $options = null) { $data = self::toString($languages, $options); if (@file_put_contents($filename, $data) === false) { - throw new Exception("Error writing data to '$filename'"); + throw new Exception("Error writing data to '${filename}'"); } } + /** * Is this exporter for public use? + * * @return bool */ public static function isForPublicUse() { return true; } + /** * Return a short description of the exporter. + * * @return string */ public static function getDescription() { - throw new Exception(get_called_class().' does not implement the method '.__FUNCTION__); + throw new Exception(get_called_class() . ' does not implement the method ' . __FUNCTION__); + } + + /** + * Convert a list of Language instances to string. + * + * @param \Gettext\Languages\Language[] $languages the Language instances to convert + * + * @return string + */ + protected static function toStringDo($languages) + { + throw new Exception(get_called_class() . ' does not implement the method ' . __FUNCTION__); } } diff --git a/vendor/gettext/languages/src/Exporter/Html.php b/vendor/gettext/languages/src/Exporter/Html.php index be293c70a3..d16e78206d 100644 --- a/vendor/gettext/languages/src/Exporter/Html.php +++ b/vendor/gettext/languages/src/Exporter/Html.php @@ -1,61 +1,69 @@ <?php + namespace Gettext\Languages\Exporter; class Html extends Exporter { /** - * @see Exporter::toStringDo + * {@inheritdoc} + * + * @see \Gettext\Languages\Exporter\Exporter::getDescription() + */ + public static function getDescription() + { + return 'Build a HTML table'; + } + + /** + * {@inheritdoc} + * + * @see \Gettext\Languages\Exporter\Exporter::toStringDo() */ protected static function toStringDo($languages) { return self::buildTable($languages, false); } + protected static function h($str) { return htmlspecialchars($str, ENT_COMPAT, 'UTF-8'); } + protected static function buildTable($languages, $forDocs) { $prefix = $forDocs ? ' ' : ''; $lines = array(); - $lines[] = $prefix.'<table'.($forDocs ? ' class="table table-bordered table-condensed table-striped"' : '').'>'; - $lines[] = $prefix.' <thead>'; - $lines[] = $prefix.' <tr>'; - $lines[] = $prefix.' <th>Language code</th>'; - $lines[] = $prefix.' <th>Language name</th>'; - $lines[] = $prefix.' <th># plurals</th>'; - $lines[] = $prefix.' <th>Formula</th>'; - $lines[] = $prefix.' <th>Plurals</th>'; - $lines[] = $prefix.' </tr>'; - $lines[] = $prefix.' </thead>'; - $lines[] = $prefix.' <tbody>'; + $lines[] = $prefix . '<table' . ($forDocs ? ' class="table table-bordered table-condensed table-striped"' : '') . '>'; + $lines[] = $prefix . ' <thead>'; + $lines[] = $prefix . ' <tr>'; + $lines[] = $prefix . ' <th>Language code</th>'; + $lines[] = $prefix . ' <th>Language name</th>'; + $lines[] = $prefix . ' <th># plurals</th>'; + $lines[] = $prefix . ' <th>Formula</th>'; + $lines[] = $prefix . ' <th>Plurals</th>'; + $lines[] = $prefix . ' </tr>'; + $lines[] = $prefix . ' </thead>'; + $lines[] = $prefix . ' <tbody>'; foreach ($languages as $lc) { - $lines[] = $prefix.' <tr>'; - $lines[] = $prefix.' <td>'.$lc->id.'</td>'; + $lines[] = $prefix . ' <tr>'; + $lines[] = $prefix . ' <td>' . $lc->id . '</td>'; $name = self::h($lc->name); if (isset($lc->supersededBy)) { - $name .= '<br /><small><span>Superseded by</span> '.$lc->supersededBy.'</small>'; + $name .= '<br /><small><span>Superseded by</span> ' . $lc->supersededBy . '</small>'; } - $lines[] = $prefix.' <td>'.$name.'</td>'; - $lines[] = $prefix.' <td>'.count($lc->categories).'</td>'; - $lines[] = $prefix.' <td>'.self::h($lc->formula).'</td>'; + $lines[] = $prefix . ' <td>' . $name . '</td>'; + $lines[] = $prefix . ' <td>' . count($lc->categories) . '</td>'; + $lines[] = $prefix . ' <td>' . self::h($lc->formula) . '</td>'; $cases = array(); foreach ($lc->categories as $c) { - $cases[] = '<li><span>'.$c->id.'</span><code>'.self::h($c->examples).'</code></li>'; + $cases[] = '<li><span>' . $c->id . '</span><code>' . self::h($c->examples) . '</code></li>'; } - $lines[] = $prefix.' <td><ol'.($forDocs ? ' class="cases"' : '').' start="0">'.implode('', $cases).'</ol></td>'; - $lines[] = $prefix.' </tr>'; + $lines[] = $prefix . ' <td><ol' . ($forDocs ? ' class="cases"' : '') . ' start="0">' . implode('', $cases) . '</ol></td>'; + $lines[] = $prefix . ' </tr>'; } - $lines[] = $prefix.' </tbody>'; - $lines[] = $prefix.'</table>'; + $lines[] = $prefix . ' </tbody>'; + $lines[] = $prefix . '</table>'; return implode("\n", $lines); } - /** - * @see Exporter::getDescription - */ - public static function getDescription() - { - return 'Build a HTML table'; - } } diff --git a/vendor/gettext/languages/src/Exporter/Json.php b/vendor/gettext/languages/src/Exporter/Json.php index 09e79f0149..8ea57b8865 100644 --- a/vendor/gettext/languages/src/Exporter/Json.php +++ b/vendor/gettext/languages/src/Exporter/Json.php @@ -1,10 +1,22 @@ <?php + namespace Gettext\Languages\Exporter; class Json extends Exporter { + /** + * {@inheritdoc} + * + * @see \Gettext\Languages\Exporter\Exporter::getDescription() + */ + public static function getDescription() + { + return 'Build a compressed JSON-encoded file'; + } + /** * Return the options for json_encode. + * * @return int */ protected static function getEncodeOptions() @@ -19,8 +31,11 @@ protected static function getEncodeOptions() return $result; } + /** - * @see Exporter::toStringDo + * {@inheritdoc} + * + * @see \Gettext\Languages\Exporter\Exporter::toStringDo() */ protected static function toStringDo($languages) { @@ -53,11 +68,4 @@ protected static function toStringDo($languages) return json_encode($list, static::getEncodeOptions()); } - /** - * @see Exporter::getDescription - */ - public static function getDescription() - { - return 'Build a compressed JSON-encoded file'; - } } diff --git a/vendor/gettext/languages/src/Exporter/Php.php b/vendor/gettext/languages/src/Exporter/Php.php index d8ef4cc18a..d6b8d1b301 100644 --- a/vendor/gettext/languages/src/Exporter/Php.php +++ b/vendor/gettext/languages/src/Exporter/Php.php @@ -1,10 +1,23 @@ <?php + namespace Gettext\Languages\Exporter; class Php extends Exporter { /** - * @see Exporter::toStringDo + * {@inheritdoc} + * + * @see \Gettext\Languages\Exporter\Exporter::getDescription() + */ + public static function getDescription() + { + return 'Build a PHP array'; + } + + /** + * {@inheritdoc} + * + * @see \Gettext\Languages\Exporter\Exporter::toStringDo() */ protected static function toStringDo($languages) { @@ -12,30 +25,30 @@ protected static function toStringDo($languages) $lines[] = '<?php'; $lines[] = 'return array('; foreach ($languages as $lc) { - $lines[] = ' \''.$lc->id.'\' => array('; - $lines[] = ' \'name\' => \''.addslashes($lc->name).'\','; + $lines[] = ' \'' . $lc->id . '\' => array('; + $lines[] = ' \'name\' => \'' . addslashes($lc->name) . '\','; if (isset($lc->supersededBy)) { - $lines[] = ' \'supersededBy\' => \''.$lc->supersededBy.'\','; + $lines[] = ' \'supersededBy\' => \'' . $lc->supersededBy . '\','; } if (isset($lc->script)) { - $lines[] = ' \'script\' => \''.addslashes($lc->script).'\','; + $lines[] = ' \'script\' => \'' . addslashes($lc->script) . '\','; } if (isset($lc->territory)) { - $lines[] = ' \'territory\' => \''.addslashes($lc->territory).'\','; + $lines[] = ' \'territory\' => \'' . addslashes($lc->territory) . '\','; } if (isset($lc->baseLanguage)) { - $lines[] = ' \'baseLanguage\' => \''.addslashes($lc->baseLanguage).'\','; + $lines[] = ' \'baseLanguage\' => \'' . addslashes($lc->baseLanguage) . '\','; } - $lines[] = ' \'formula\' => \''.$lc->formula.'\','; - $lines[] = ' \'plurals\' => '.count($lc->categories).','; + $lines[] = ' \'formula\' => \'' . $lc->formula . '\','; + $lines[] = ' \'plurals\' => ' . count($lc->categories) . ','; $catNames = array(); foreach ($lc->categories as $c) { $catNames[] = "'{$c->id}'"; } - $lines[] = ' \'cases\' => array('.implode(', ', $catNames).'),'; + $lines[] = ' \'cases\' => array(' . implode(', ', $catNames) . '),'; $lines[] = ' \'examples\' => array('; foreach ($lc->categories as $c) { - $lines[] = ' \''.$c->id.'\' => \''.$c->examples.'\','; + $lines[] = ' \'' . $c->id . '\' => \'' . $c->examples . '\','; } $lines[] = ' ),'; $lines[] = ' ),'; @@ -45,11 +58,4 @@ protected static function toStringDo($languages) return implode("\n", $lines); } - /** - * @see Exporter::getDescription - */ - public static function getDescription() - { - return 'Build a PHP array'; - } } diff --git a/vendor/gettext/languages/src/Exporter/Po.php b/vendor/gettext/languages/src/Exporter/Po.php index c89ab13b8c..797f4b92de 100644 --- a/vendor/gettext/languages/src/Exporter/Po.php +++ b/vendor/gettext/languages/src/Exporter/Po.php @@ -1,4 +1,5 @@ <?php + namespace Gettext\Languages\Exporter; use Exception; @@ -6,26 +7,31 @@ class Po extends Exporter { /** - * @see Exporter::toStringDo + * {@inheritdoc} + * + * @see \Gettext\Languages\Exporter\Exporter::getDescription() + */ + public static function getDescription() + { + return 'Build a string to be used for gettext .po files'; + } + + /** + * {@inheritdoc} + * + * @see \Gettext\Languages\Exporter\Exporter::toStringDo() */ protected static function toStringDo($languages) { if (count($languages) !== 1) { - throw new Exception('The '.get_called_class().' exporter can only export one language'); + throw new Exception('The ' . get_called_class() . ' exporter can only export one language'); } $language = $languages[0]; $lines = array(); - $lines[] = '"Language: '.$language->id.'\n"'; - $lines[] = '"Plural-Forms: nplurals='.count($language->categories).'; plural='.$language->formula.'\n"'; + $lines[] = '"Language: ' . $language->id . '\n"'; + $lines[] = '"Plural-Forms: nplurals=' . count($language->categories) . '; plural=' . $language->formula . '\n"'; $lines[] = ''; return implode("\n", $lines); } - /** - * @see Exporter::getDescription - */ - public static function getDescription() - { - return 'Build a string to be used for gettext .po files'; - } } diff --git a/vendor/gettext/languages/src/Exporter/Prettyjson.php b/vendor/gettext/languages/src/Exporter/Prettyjson.php index aa8fd991d5..927f80a6c4 100644 --- a/vendor/gettext/languages/src/Exporter/Prettyjson.php +++ b/vendor/gettext/languages/src/Exporter/Prettyjson.php @@ -1,4 +1,5 @@ <?php + namespace Gettext\Languages\Exporter; use Exception; @@ -6,20 +7,26 @@ class Prettyjson extends Json { /** - * @see Json::getEncodeOptions + * {@inheritdoc} + * + * @see \Gettext\Languages\Exporter\Exporter::getDescription() + */ + public static function getDescription() + { + return 'Build an uncompressed JSON-encoded file (PHP 5.4 or later is needed)'; + } + + /** + * {@inheritdoc} + * + * @see \Gettext\Languages\Exporter\Json::getEncodeOptions() */ protected static function getEncodeOptions() { if (!(defined('\JSON_PRETTY_PRINT') && defined('\JSON_UNESCAPED_SLASHES') && defined('\JSON_UNESCAPED_UNICODE'))) { throw new Exception('PHP 5.4 or later is required to export uncompressed JSON'); } + return \JSON_PRETTY_PRINT | \JSON_UNESCAPED_SLASHES | \JSON_UNESCAPED_UNICODE; } - /** - * @see Exporter::getDescription - */ - public static function getDescription() - { - return 'Build an uncompressed JSON-encoded file (PHP 5.4 or later is needed)'; - } } diff --git a/vendor/gettext/languages/src/Exporter/Xml.php b/vendor/gettext/languages/src/Exporter/Xml.php index 350181d321..32358b8f46 100644 --- a/vendor/gettext/languages/src/Exporter/Xml.php +++ b/vendor/gettext/languages/src/Exporter/Xml.php @@ -1,10 +1,23 @@ <?php + namespace Gettext\Languages\Exporter; class Xml extends Exporter { /** - * @see Exporter::toStringDo + * {@inheritdoc} + * + * @see \Gettext\Languages\Exporter\Exporter::getDescription() + */ + public static function getDescription() + { + return 'Build an XML file - schema available at http://mlocati.github.io/cldr-to-gettext-plural-rules/GettextLanguages.xsd'; + } + + /** + * {@inheritdoc} + * + * @see \Gettext\Languages\Exporter\Exporter::toStringDo() */ protected static function toStringDo($languages) { @@ -44,11 +57,4 @@ protected static function toStringDo($languages) return $xml->saveXML(); } - /** - * @see Exporter::getDescription - */ - public static function getDescription() - { - return 'Build an XML file - schema available at http://mlocati.github.io/cldr-to-gettext-plural-rules/GettextLanguages.xsd'; - } } diff --git a/vendor/gettext/languages/src/FormulaConverter.php b/vendor/gettext/languages/src/FormulaConverter.php index 4890117ceb..6eb14b5f7e 100644 --- a/vendor/gettext/languages/src/FormulaConverter.php +++ b/vendor/gettext/languages/src/FormulaConverter.php @@ -1,4 +1,5 @@ <?php + namespace Gettext\Languages; use Exception; @@ -10,14 +11,17 @@ class FormulaConverter { /** * Converts a formula from the CLDR representation to the gettext representation. - * @param string $cldrFormula The CLDR formula to convert. - * @throws Exception - * @return bool|string Returns true if the gettext will always evaluate to true, false if gettext will always evaluate to false, return the gettext formula otherwise. + * + * @param string $cldrFormula the CLDR formula to convert + * + * @throws \Exception + * + * @return bool|string returns true if the gettext will always evaluate to true, false if gettext will always evaluate to false, return the gettext formula otherwise */ public static function convertFormula($cldrFormula) { if (strpbrk($cldrFormula, '()') !== false) { - throw new Exception("Unable to convert the formula '$cldrFormula': parenthesis handling not implemented"); + throw new Exception("Unable to convert the formula '${cldrFormula}': parenthesis handling not implemented"); } $orSeparatedChunks = array(); foreach (explode(' or ', $cldrFormula) as $cldrFormulaChunk) { @@ -29,7 +33,8 @@ public static function convertFormula($cldrFormula) // One atom joined by 'and' always evaluates to false => the whole 'and' group is always false $gettextFormulaChunk = false; break; - } elseif ($gettextAtom !== true) { + } + if ($gettextAtom !== true) { $andSeparatedChunks[] = $gettextAtom; } } @@ -50,22 +55,27 @@ public static function convertFormula($cldrFormula) if ($gettextFormulaChunk === true) { // One part of the formula joined with the others by 'or' always evaluates to true => the whole formula always evaluates to true return true; - } elseif ($gettextFormulaChunk !== false) { + } + if ($gettextFormulaChunk !== false) { $orSeparatedChunks[] = $gettextFormulaChunk; } } if (empty($orSeparatedChunks)) { // All the parts joined by 'or' always evaluate to false => the whole formula always evaluates to false return false; - } else { - return implode(' || ', $orSeparatedChunks); } + + return implode(' || ', $orSeparatedChunks); } + /** * Converts an atomic part of the CLDR formula to its gettext representation. - * @param string $cldrAtom The CLDR formula atom to convert. - * @throws Exception - * @return bool|string Returns true if the gettext will always evaluate to true, false if gettext will always evaluate to false, return the gettext formula otherwise. + * + * @param string $cldrAtom the CLDR formula atom to convert + * + * @throws \Exception + * + * @return bool|string returns true if the gettext will always evaluate to true, false if gettext will always evaluate to false, return the gettext formula otherwise */ private static function convertAtom($cldrAtom) { @@ -80,23 +90,27 @@ private static function convertAtom($cldrAtom) return self::expandAtom($gettextAtom); } if (preg_match('/^(?:v|w)(?: % 10+)? == (\d+)(?:\.\.\d+)?$/', $gettextAtom, $m)) { // For gettext: v == 0, w == 0 - return (intval($m[1]) === 0) ? true : false; + return (int) $m[1] === 0 ? true : false; } if (preg_match('/^(?:v|w)(?: % 10+)? != (\d+)(?:\.\.\d+)?$/', $gettextAtom, $m)) { // For gettext: v == 0, w == 0 - return (intval($m[1]) === 0) ? false : true; + return (int) $m[1] === 0 ? false : true; } if (preg_match('/^(?:f|t)(?: % 10+)? == (\d+)(?:\.\.\d+)?$/', $gettextAtom, $m)) { // f == empty, t == empty - return (intval($m[1]) === 0) ? true : false; + return (int) $m[1] === 0 ? true : false; } if (preg_match('/^(?:f|t)(?: % 10+)? != (\d+)(?:\.\.\d+)?$/', $gettextAtom, $m)) { // f == empty, t == empty - return (intval($m[1]) === 0) ? false : true; + return (int) $m[1] === 0 ? false : true; } - throw new Exception("Unable to convert the formula chunk '$cldrAtom' from CLDR to gettext"); + throw new Exception("Unable to convert the formula chunk '${cldrAtom}' from CLDR to gettext"); } + /** * Expands an atom containing a range (for instance: 'n == 1,3..5'). + * * @param string $atom - * @throws Exception + * + * @throws \Exception + * * @return string */ private static function expandAtom($atom) @@ -109,37 +123,37 @@ private static function expandAtom($atom) foreach (explode(',', $m[3]) as $range) { $chunk = null; if ((!isset($chunk)) && preg_match('/^\d+$/', $range)) { - $chunk = "$what $op $range"; + $chunk = "${what} ${op} ${range}"; } if ((!isset($chunk)) && preg_match('/^(\d+)\.\.(\d+)$/', $range, $m)) { - $from = intval($m[1]); - $to = intval($m[2]); + $from = (int) $m[1]; + $to = (int) $m[2]; if (($to - $from) === 1) { switch ($op) { case '==': - $chunk = "($what == $from || $what == $to)"; + $chunk = "(${what} == ${from} || ${what} == ${to})"; break; case '!=': - $chunk = "$what != $from && $what == $to"; + $chunk = "${what} != ${from} && ${what} == ${to}"; break; } } else { switch ($op) { case '==': - $chunk = "$what >= $from && $what <= $to"; + $chunk = "${what} >= ${from} && ${what} <= ${to}"; break; case '!=': if ($what === 'n' && $from <= 0) { - $chunk = "$what > $to"; + $chunk = "${what} > ${to}"; } else { - $chunk = "($what < $from || $what > $to)"; + $chunk = "(${what} < ${from} || ${what} > ${to})"; } break; } } } if (!isset($chunk)) { - throw new Exception("Unhandled range '$range' in '$atom'"); + throw new Exception("Unhandled range '${range}' in '${atom}'"); } $chunks[] = $chunk; } @@ -148,11 +162,11 @@ private static function expandAtom($atom) } switch ($op) { case '==': - return '('.implode(' || ', $chunks).')';break; + return '(' . implode(' || ', $chunks) . ')'; break; case '!=': return implode(' && ', $chunks); } } - throw new Exception("Unable to expand '$atom'"); + throw new Exception("Unable to expand '${atom}'"); } } diff --git a/vendor/gettext/languages/src/Language.php b/vendor/gettext/languages/src/Language.php index 2323400cdf..eb17189b82 100644 --- a/vendor/gettext/languages/src/Language.php +++ b/vendor/gettext/languages/src/Language.php @@ -1,4 +1,5 @@ <?php + namespace Gettext\Languages; use Exception; @@ -10,48 +11,66 @@ class Language { /** * The language ID. + * * @var string */ public $id; + /** * The language name. + * * @var string */ public $name; + /** * If this language is deprecated: the gettext code of the new language. - * @var null|string + * + * @var string|null */ public $supersededBy; + /** * The script name. + * * @var string|null */ public $script; + /** * The territory name. + * * @var string|null */ public $territory; + /** - * The name of the base language + * The name of the base language. + * * @var string|null */ public $baseLanguage; + /** * The list of categories. - * @var Category[] + * + * @var \Gettext\Languages\Category[] */ public $categories; + /** * The gettext formula to decide which category should be applied. + * * @var string */ public $formula; + /** * Initialize the instance and parse the language code. + * * @param array $info The result of CldrData::getLanguageInfo() - * @throws Exception Throws an Exception if $fullId is not valid. + * + * @throws \Exception throws an Exception if $fullId is not valid */ private function __construct($info) { @@ -81,47 +100,108 @@ private function __construct($info) }); // The 'other' category should always be there if ($this->categories[count($this->categories) - 1]->id !== CldrData::OTHER_CATEGORY) { - throw new Exception("The language '{$info['id']}' does not have the '".CldrData::OTHER_CATEGORY."' plural category"); + throw new Exception("The language '{$info['id']}' does not have the '" . CldrData::OTHER_CATEGORY . "' plural category"); } $this->checkAlwaysTrueCategories(); $this->checkAlwaysFalseCategories(); $this->checkAllCategoriesWithExamples(); $this->formula = $this->buildFormula(); } + /** * Return a list of all languages available. - * @throws Exception - * @return Language[] + * + * @throws \Exception + * + * @return \Gettext\Languages\Language[] */ public static function getAll() { $result = array(); foreach (array_keys(CldrData::getLanguageNames()) as $cldrLanguageId) { - $result[] = new Language(CldrData::getLanguageInfo($cldrLanguageId)); + $result[] = new self(CldrData::getLanguageInfo($cldrLanguageId)); } return $result; } + /** - * Return a Language instance given the language id + * Return a Language instance given the language id. + * * @param string $id - * @return Language|null + * + * @return \Gettext\Languages\Language|null */ public static function getById($id) { $result = null; $info = CldrData::getLanguageInfo($id); if (isset($info)) { - $result = new Language($info); + $result = new self($info); } return $result; } + /** + * Returns a clone of this instance with all the strings to US-ASCII. + * + * @return \Gettext\Languages\Language + */ + public function getUSAsciiClone() + { + $clone = clone $this; + self::asciifier($clone->name); + self::asciifier($clone->formula); + $clone->categories = array(); + foreach ($this->categories as $category) { + $categoryClone = clone $category; + self::asciifier($categoryClone->examples); + $clone->categories[] = $categoryClone; + } + + return $clone; + } + + /** + * Build the formula starting from the currently defined categories. + * + * @param bool $withoutParenthesis TRUE to build a formula in standard gettext format, FALSE (default) to build a PHP-compatible formula + * + * @return string + */ + public function buildFormula($withoutParenthesis = false) + { + $numCategories = count($this->categories); + switch ($numCategories) { + case 1: + // Just one category + return '0'; + case 2: + return self::reduceFormula(self::reverseFormula($this->categories[0]->formula)); + default: + $formula = (string) ($numCategories - 1); + for ($i = $numCategories - 2; $i >= 0; $i--) { + $f = self::reduceFormula($this->categories[$i]->formula); + if (!$withoutParenthesis && !preg_match('/^\([^()]+\)$/', $f)) { + $f = "(${f})"; + } + $formula = "${f} ? ${i} : ${formula}"; + if (!$withoutParenthesis && $i > 0) { + $formula = "(${formula})"; + } + } + + return $formula; + } + } + /** * Let's look for categories that will always occur. * This because with decimals (CLDR) we may have more cases, with integers (gettext) we have just one case. * If we found that (single) category we reduce the categories to that one only. + * + * @throws \Exception */ private function checkAlwaysTrueCategories() { @@ -146,10 +226,13 @@ private function checkAlwaysTrueCategories() $this->categories = array($alwaysTrueCategory); } } + /** * Let's look for categories that will never occur. * This because with decimals (CLDR) we may have more cases, with integers (gettext) we have some less cases. * If we found those categories we strip them out. + * + * @throws \Exception */ private function checkAlwaysFalseCategories() { @@ -165,11 +248,13 @@ private function checkAlwaysFalseCategories() } $this->categories = $filtered; } + /** * Let's look for categories that don't have examples. * This because with decimals (CLDR) we may have more cases, with integers (gettext) we have some less cases. * If we found those categories, we check that they never occur and we strip them out. - * @throws Exception + * + * @throws \Exception */ private function checkAllCategoriesWithExamples() { @@ -190,8 +275,8 @@ private function checkAllCategoriesWithExamples() return; } $removeCategoriesWithoutExamples = false; - switch (implode(',', $badCategoriesIds).'@'.implode(',', $allCategoriesIds)) { - case CldrData::OTHER_CATEGORY.'@one,few,many,'.CldrData::OTHER_CATEGORY: + switch (implode(',', $badCategoriesIds) . '@' . implode(',', $allCategoriesIds)) { + case CldrData::OTHER_CATEGORY . '@one,few,many,' . CldrData::OTHER_CATEGORY: switch ($this->buildFormula()) { case '(n % 10 == 1 && n % 100 != 11) ? 0 : ((n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % 100 > 14)) ? 1 : ((n % 10 == 0 || n % 10 >= 5 && n % 10 <= 9 || n % 100 >= 11 && n % 100 <= 14) ? 2 : 3))': // Numbers ending with 0 => case 2 ('many') @@ -232,7 +317,7 @@ private function checkAllCategoriesWithExamples() } } if (!$removeCategoriesWithoutExamples) { - throw new Exception("Unhandled case of plural categories without examples '".implode(', ', $badCategoriesIds)."' out of '".implode(', ', $allCategoriesIds)."'"); + throw new Exception("Unhandled case of plural categories without examples '" . implode(', ', $badCategoriesIds) . "' out of '" . implode(', ', $allCategoriesIds) . "'"); } if ($badCategories[count($badCategories) - 1]->id === CldrData::OTHER_CATEGORY) { // We're removing the 'other' cagory: let's change the last good category to 'other' @@ -242,39 +327,14 @@ private function checkAllCategoriesWithExamples() } $this->categories = $goodCategories; } - /** - * Build the formula starting from the currently defined categories. - * @return string - */ - private function buildFormula() - { - $numCategories = count($this->categories); - switch ($numCategories) { - case 1: - // Just one category - return '0'; - case 2: - return self::reduceFormula(self::reverseFormula($this->categories[0]->formula)); - default: - $formula = strval($numCategories - 1); - for ($i = $numCategories - 2; $i >= 0; $i--) { - $f = self::reduceFormula($this->categories[$i]->formula); - if (!preg_match('/^\([^()]+\)$/', $f)) { - $f = "($f)"; - } - $formula = "$f ? $i : $formula"; - if ($i > 0) { - $formula = "($formula)"; - } - } - return $formula; - } - } /** * Reverse a formula. + * * @param string $formula - * @throws Exception + * + * @throws \Exception + * * @return string */ private static function reverseFormula($formula) @@ -298,30 +358,36 @@ private static function reverseFormula($formula) case '(n == 0 || n == 1) || n >= 11 && n <= 99': return 'n >= 2 && (n < 11 || n > 99)'; } - throw new Exception("Unable to reverse the formula '$formula'"); + throw new Exception("Unable to reverse the formula '${formula}'"); } + /** * Reduce some excessively complex formulas. + * * @param string $formula + * * @return string */ private static function reduceFormula($formula) { $map = array( - 'n != 0 && n != 1' => 'n > 1' , - '(n == 0 || n == 1) && n != 0' => 'n == 1', + 'n != 0 && n != 1' => 'n > 1', + '(n == 0 || n == 1) && n != 0' => 'n == 1', ); return isset($map[$formula]) ? $map[$formula] : $formula; } + /** * Take one variable and, if it's a string, we transliterate it to US-ASCII. - * @param mixed $value The variable to work on. - * @throws Exception + * + * @param mixed $value the variable to work on + * + * @throws \Exception */ private static function asciifier(&$value) { - if (is_string($value) && ($value !== '')) { + if (is_string($value) && $value !== '') { // Avoid converting from 'Ÿ' to '"Y', let's prefer 'Y' $transliterated = strtr($value, array( 'À' => 'A', 'Á' => 'A', 'Â' => 'A', 'Ã' => 'A', 'Ä' => 'A', @@ -339,28 +405,10 @@ private static function asciifier(&$value) 'ý' => 'y', 'ÿ' => 'y', )); $transliterated = @iconv('UTF-8', 'US-ASCII//IGNORE//TRANSLIT', $transliterated); - if (($transliterated === false) || ($transliterated === '')) { - throw new Exception("Unable to transliterate '$value'"); + if ($transliterated === false || $transliterated === '') { + throw new Exception("Unable to transliterate '${value}'"); } $value = $transliterated; } } - /** - * Returns a clone of this instance with all the strings to US-ASCII. - * @return Language - */ - public function getUSAsciiClone() - { - $clone = clone $this; - self::asciifier($clone->name); - self::asciifier($clone->formula); - $clone->categories = array(); - foreach ($this->categories as $category) { - $categoryClone = clone $category; - self::asciifier($categoryClone->examples); - $clone->categories[] = $categoryClone; - } - - return $clone; - } } diff --git a/vendor/gettext/languages/src/autoloader.php b/vendor/gettext/languages/src/autoloader.php index 435eb8900f..03077d46f1 100644 --- a/vendor/gettext/languages/src/autoloader.php +++ b/vendor/gettext/languages/src/autoloader.php @@ -1,10 +1,11 @@ <?php + spl_autoload_register( function ($class) { if (strpos($class, 'Gettext\\Languages\\') !== 0) { return; } - $file = __DIR__.str_replace('\\', DIRECTORY_SEPARATOR, substr($class, strlen('Gettext\\Languages'))).'.php'; + $file = __DIR__ . str_replace('\\', DIRECTORY_SEPARATOR, substr($class, strlen('Gettext\\Languages'))) . '.php'; if (is_file($file)) { require_once $file; } diff --git a/vendor/gettext/languages/src/cldr-data/main/en-US/languages.json b/vendor/gettext/languages/src/cldr-data/main/en-US/languages.json index dffbc614dd..aef743dbd8 100644 --- a/vendor/gettext/languages/src/cldr-data/main/en-US/languages.json +++ b/vendor/gettext/languages/src/cldr-data/main/en-US/languages.json @@ -3,8 +3,8 @@ "en-US": { "identity": { "version": { - "_number": "$Revision: 13869 $", - "_cldrVersion": "33.1" + "_number": "$Revision$", + "_cldrVersion": "36" }, "language": "en", "territory": "US" @@ -113,6 +113,7 @@ "chp": "Chipewyan", "chr": "Cherokee", "chy": "Cheyenne", + "cic": "Chickasaw", "ckb": "Central Kurdish", "co": "Corsican", "cop": "Coptic", @@ -384,7 +385,7 @@ "mt": "Maltese", "mua": "Mundang", "mul": "Multiple languages", - "mus": "Creek", + "mus": "Muscogee", "mwl": "Mirandese", "mwr": "Marwari", "mwv": "Mentawai", @@ -624,6 +625,7 @@ "yo": "Yoruba", "yrl": "Nheengatu", "yue": "Cantonese", + "yue-alt-menu": "Chinese, Cantonese", "za": "Zhuang", "zap": "Zapotec", "zbl": "Blissymbols", @@ -632,8 +634,11 @@ "zgh": "Standard Moroccan Tamazight", "zh": "Chinese", "zh-alt-long": "Mandarin Chinese", + "zh-alt-menu": "Chinese, Mandarin", "zh-Hans": "Simplified Chinese", + "zh-Hans-alt-long": "Simplified Mandarin Chinese", "zh-Hant": "Traditional Chinese", + "zh-Hant-alt-long": "Traditional Mandarin Chinese", "zu": "Zulu", "zun": "Zuni", "zxx": "No linguistic content", diff --git a/vendor/gettext/languages/src/cldr-data/main/en-US/scripts.json b/vendor/gettext/languages/src/cldr-data/main/en-US/scripts.json index c0ff6c059f..f0ff7d4ae9 100644 --- a/vendor/gettext/languages/src/cldr-data/main/en-US/scripts.json +++ b/vendor/gettext/languages/src/cldr-data/main/en-US/scripts.json @@ -3,8 +3,8 @@ "en-US": { "identity": { "version": { - "_number": "$Revision: 13869 $", - "_cldrVersion": "33.1" + "_number": "$Revision$", + "_cldrVersion": "36" }, "language": "en", "territory": "US" @@ -51,6 +51,7 @@ "Egyh": "Egyptian hieratic", "Egyp": "Egyptian hieroglyphs", "Elba": "Elbasan", + "Elym": "Elymaic", "Ethi": "Ethiopic", "Geok": "Georgian Khutsuri", "Geor": "Georgian", @@ -75,6 +76,7 @@ "Hira": "Hiragana", "Hluw": "Anatolian Hieroglyphs", "Hmng": "Pahawh Hmong", + "Hmnp": "Nyiakeng Puachue Hmong", "Hrkt": "Japanese syllabaries", "Hung": "Old Hungarian", "Inds": "Indus", @@ -123,6 +125,7 @@ "Mtei": "Meitei Mayek", "Mult": "Multani", "Mymr": "Myanmar", + "Nand": "Nandinagari", "Narb": "Old North Arabian", "Nbat": "Nabataean", "Newa": "Newa", @@ -145,6 +148,7 @@ "Phnx": "Phoenician", "Plrd": "Pollard Phonetic", "Prti": "Inscriptional Parthian", + "Qaag": "Zawgyi", "Rjng": "Rejang", "Rohg": "Hanifi Rohingya", "Roro": "Rongorongo", @@ -188,6 +192,7 @@ "Vaii": "Vai", "Visp": "Visible Speech", "Wara": "Varang Kshiti", + "Wcho": "Wancho", "Wole": "Woleai", "Xpeo": "Old Persian", "Xsux": "Sumero-Akkadian Cuneiform", diff --git a/vendor/gettext/languages/src/cldr-data/main/en-US/territories.json b/vendor/gettext/languages/src/cldr-data/main/en-US/territories.json index 574b43be73..190522b5ce 100644 --- a/vendor/gettext/languages/src/cldr-data/main/en-US/territories.json +++ b/vendor/gettext/languages/src/cldr-data/main/en-US/territories.json @@ -3,8 +3,8 @@ "en-US": { "identity": { "version": { - "_number": "$Revision: 13869 $", - "_cldrVersion": "33.1" + "_number": "$Revision$", + "_cldrVersion": "36" }, "language": "en", "territory": "US" @@ -200,14 +200,14 @@ "MF": "St. Martin", "MG": "Madagascar", "MH": "Marshall Islands", - "MK": "Macedonia", - "MK-alt-variant": "Macedonia (FYROM)", + "MK": "North Macedonia", + "MK-alt-variant": "MK", "ML": "Mali", "MM": "Myanmar (Burma)", "MM-alt-short": "Myanmar", "MN": "Mongolia", - "MO": "Macau SAR China", - "MO-alt-short": "Macau", + "MO": "Macao SAR China", + "MO-alt-short": "Macao", "MP": "Northern Mariana Islands", "MQ": "Martinique", "MR": "Mauritania", @@ -274,7 +274,8 @@ "SV": "El Salvador", "SX": "Sint Maarten", "SY": "Syria", - "SZ": "Swaziland", + "SZ": "Eswatini", + "SZ-alt-variant": "Swaziland", "TA": "Tristan da Cunha", "TC": "Turks & Caicos Islands", "TD": "Chad", @@ -311,6 +312,8 @@ "VU": "Vanuatu", "WF": "Wallis & Futuna", "WS": "Samoa", + "XA": "Pseudo-Accents", + "XB": "Pseudo-Bidi", "XK": "Kosovo", "YE": "Yemen", "YT": "Mayotte", diff --git a/vendor/gettext/languages/src/cldr-data/supplemental/plurals.json b/vendor/gettext/languages/src/cldr-data/supplemental/plurals.json index d52afd7080..b83bbc0d78 100644 --- a/vendor/gettext/languages/src/cldr-data/supplemental/plurals.json +++ b/vendor/gettext/languages/src/cldr-data/supplemental/plurals.json @@ -1,9 +1,9 @@ { "supplemental": { "version": { - "_number": "$Revision: 13898 $", - "_unicodeVersion": "11.0.0", - "_cldrVersion": "33.1" + "_number": "$Revision$", + "_unicodeVersion": "12.1.0", + "_cldrVersion": "36" }, "plurals-type-cardinal": { "af": { @@ -18,6 +18,10 @@ "pluralRule-count-one": "i = 0 or n = 1 @integer 0, 1 @decimal 0.0~1.0, 0.00~0.04", "pluralRule-count-other": " @integer 2~17, 100, 1000, 10000, 100000, 1000000, … @decimal 1.1~2.6, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …" }, + "an": { + "pluralRule-count-one": "n = 1 @integer 1 @decimal 1.0, 1.00, 1.000, 1.0000", + "pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~0.9, 1.1~1.6, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …" + }, "ar": { "pluralRule-count-zero": "n = 0 @integer 0 @decimal 0.0, 0.00, 0.000, 0.0000", "pluralRule-count-one": "n = 1 @integer 1 @decimal 1.0, 1.00, 1.000, 1.0000", @@ -68,7 +72,7 @@ "pluralRule-count-one": "n = 1 @integer 1 @decimal 1.0, 1.00, 1.000, 1.0000", "pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~0.9, 1.1~1.6, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …" }, - "bh": { + "bho": { "pluralRule-count-one": "n = 0..1 @integer 0, 1 @decimal 0.0, 1.0, 0.00, 1.00, 0.000, 1.000, 0.0000, 1.0000", "pluralRule-count-other": " @integer 2~17, 100, 1000, 10000, 100000, 1000000, … @decimal 0.1~0.9, 1.1~1.7, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …" }, @@ -106,6 +110,10 @@ "pluralRule-count-one": "n = 1 @integer 1 @decimal 1.0, 1.00, 1.000, 1.0000", "pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~0.9, 1.1~1.6, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …" }, + "ceb": { + "pluralRule-count-one": "v = 0 and i = 1,2,3 or v = 0 and i % 10 != 4,6,9 or v != 0 and f % 10 != 4,6,9 @integer 0~3, 5, 7, 8, 10~13, 15, 17, 18, 20, 21, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~0.3, 0.5, 0.7, 0.8, 1.0~1.3, 1.5, 1.7, 1.8, 2.0, 2.1, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …", + "pluralRule-count-other": " @integer 4, 6, 9, 14, 16, 19, 24, 26, 104, 1004, … @decimal 0.4, 0.6, 0.9, 1.4, 1.6, 1.9, 2.4, 2.6, 10.4, 100.4, 1000.4, …" + }, "cgg": { "pluralRule-count-one": "n = 1 @integer 1 @decimal 1.0, 1.00, 1.000, 1.0000", "pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~0.9, 1.1~1.6, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …" @@ -286,6 +294,10 @@ "pluralRule-count-one": "i = 0,1 @integer 0, 1 @decimal 0.0~1.5", "pluralRule-count-other": " @integer 2~17, 100, 1000, 10000, 100000, 1000000, … @decimal 2.0~3.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …" }, + "ia": { + "pluralRule-count-one": "i = 1 and v = 0 @integer 1", + "pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …" + }, "id": { "pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …" }, @@ -407,9 +419,12 @@ "pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~0.9, 1.1~1.6, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …" }, "kw": { + "pluralRule-count-zero": "n = 0 @integer 0 @decimal 0.0, 0.00, 0.000, 0.0000", "pluralRule-count-one": "n = 1 @integer 1 @decimal 1.0, 1.00, 1.000, 1.0000", - "pluralRule-count-two": "n = 2 @integer 2 @decimal 2.0, 2.00, 2.000, 2.0000", - "pluralRule-count-other": " @integer 0, 3~17, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~0.9, 1.1~1.6, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …" + "pluralRule-count-two": "n % 100 = 2,22,42,62,82 or n % 1000 = 0 and n % 100000 = 1000..20000,40000,60000,80000 or n != 0 and n % 1000000 = 100000 @integer 2, 22, 42, 62, 82, 102, 122, 142, 1000, 10000, 100000, … @decimal 2.0, 22.0, 42.0, 62.0, 82.0, 102.0, 122.0, 142.0, 1000.0, 10000.0, 100000.0, …", + "pluralRule-count-few": "n % 100 = 3,23,43,63,83 @integer 3, 23, 43, 63, 83, 103, 123, 143, 1003, … @decimal 3.0, 23.0, 43.0, 63.0, 83.0, 103.0, 123.0, 143.0, 1003.0, …", + "pluralRule-count-many": "n != 1 and n % 100 = 1,21,41,61,81 @integer 21, 41, 61, 81, 101, 121, 141, 161, 1001, … @decimal 21.0, 41.0, 61.0, 81.0, 101.0, 121.0, 141.0, 161.0, 1001.0, …", + "pluralRule-count-other": " @integer 4~19, 100, 1004, 1000000, … @decimal 0.1~0.9, 1.1~1.7, 10.0, 100.0, 1000.1, 1000000.0, …" }, "ky": { "pluralRule-count-one": "n = 1 @integer 1 @decimal 1.0, 1.00, 1.000, 1.0000", @@ -475,12 +490,12 @@ }, "mo": { "pluralRule-count-one": "i = 1 and v = 0 @integer 1", - "pluralRule-count-few": "v != 0 or n = 0 or n != 1 and n % 100 = 1..19 @integer 0, 2~16, 101, 1001, … @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …", + "pluralRule-count-few": "v != 0 or n = 0 or n % 100 = 2..19 @integer 0, 2~16, 102, 1002, … @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …", "pluralRule-count-other": " @integer 20~35, 100, 1000, 10000, 100000, 1000000, …" }, "mr": { - "pluralRule-count-one": "i = 0 or n = 1 @integer 0, 1 @decimal 0.0~1.0, 0.00~0.04", - "pluralRule-count-other": " @integer 2~17, 100, 1000, 10000, 100000, 1000000, … @decimal 1.1~2.6, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …" + "pluralRule-count-one": "n = 1 @integer 1 @decimal 1.0, 1.00, 1.000, 1.0000", + "pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~0.9, 1.1~1.6, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …" }, "ms": { "pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …" @@ -562,6 +577,9 @@ "pluralRule-count-one": "n = 1 @integer 1 @decimal 1.0, 1.00, 1.000, 1.0000", "pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~0.9, 1.1~1.6, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …" }, + "osa": { + "pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …" + }, "pa": { "pluralRule-count-one": "n = 0..1 @integer 0, 1 @decimal 0.0, 1.0, 0.00, 1.00, 0.000, 1.000, 0.0000, 1.0000", "pluralRule-count-other": " @integer 2~17, 100, 1000, 10000, 100000, 1000000, … @decimal 0.1~0.9, 1.1~1.7, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …" @@ -599,7 +617,7 @@ }, "ro": { "pluralRule-count-one": "i = 1 and v = 0 @integer 1", - "pluralRule-count-few": "v != 0 or n = 0 or n != 1 and n % 100 = 1..19 @integer 0, 2~16, 101, 1001, … @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …", + "pluralRule-count-few": "v != 0 or n = 0 or n % 100 = 2..19 @integer 0, 2~16, 102, 1002, … @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …", "pluralRule-count-other": " @integer 20~35, 100, 1000, 10000, 100000, 1000000, …" }, "rof": { @@ -626,6 +644,10 @@ "pluralRule-count-one": "n = 1 @integer 1 @decimal 1.0, 1.00, 1.000, 1.0000", "pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~0.9, 1.1~1.6, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …" }, + "sc": { + "pluralRule-count-one": "i = 1 and v = 0 @integer 1", + "pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …" + }, "scn": { "pluralRule-count-one": "i = 1 and v = 0 @integer 1", "pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …" @@ -733,6 +755,9 @@ "pluralRule-count-one": "n = 1 @integer 1 @decimal 1.0, 1.00, 1.000, 1.0000", "pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~0.9, 1.1~1.6, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …" }, + "su": { + "pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …" + }, "sv": { "pluralRule-count-one": "i = 1 and v = 0 @integer 1", "pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …" diff --git a/vendor/jaimeperez/twig-configurable-i18n/.codecov.yml b/vendor/jaimeperez/twig-configurable-i18n/.codecov.yml new file mode 100644 index 0000000000..f7f39e1e93 --- /dev/null +++ b/vendor/jaimeperez/twig-configurable-i18n/.codecov.yml @@ -0,0 +1,11 @@ +coverage: + status: + project: yes + +comment: + layout: "diff" + behavior: once + require_changes: true + require_base: no + require_head: yes + branches: null diff --git a/vendor/jaimeperez/twig-configurable-i18n/.php_cs.dist b/vendor/jaimeperez/twig-configurable-i18n/.php_cs.dist new file mode 100644 index 0000000000..ea8d36ca50 --- /dev/null +++ b/vendor/jaimeperez/twig-configurable-i18n/.php_cs.dist @@ -0,0 +1,14 @@ +<?php +$finder = PhpCsFixer\Finder::create() + ->in([ + __DIR__ . '/src', + ]) +; +return PhpCsFixer\Config::create() + ->setRules([ + '@PSR2' => true, + '@PSR4' => true, + '@PSR5' => true, + ]) + ->setFinder($finder) +; diff --git a/vendor/jaimeperez/twig-configurable-i18n/.travis.yml b/vendor/jaimeperez/twig-configurable-i18n/.travis.yml new file mode 100644 index 0000000000..1ab409c11d --- /dev/null +++ b/vendor/jaimeperez/twig-configurable-i18n/.travis.yml @@ -0,0 +1,32 @@ +sudo: required + +language: php + +php: + - 5.5 + - 5.6 + - 7.0 + - 7.1 + - 7.2 + - 7.3 + +matrix: + allow_failures: + - php: 7.3 + +before_script: + - composer update --no-interaction + - if [[ "$TRAVIS_PHP_VERSION" == "7.3" ]]; then composer require --dev vimeo/psalm; fi + +script: + - bin/check-syntax.sh + - if [[ "$TRAVIS_PHP_VERSION" == "5.6" ]]; then php vendor/phpunit/phpunit/phpunit; else php vendor/phpunit/phpunit/phpunit --no-coverage; fi + - if [[ "$TRAVIS_PHP_VERSION" == "7.3" ]]; then vendor/bin/psalm; fi + +after_success: + # Codecov, need to edit bash uploader for incorrect TRAVIS_PYTHON_VERSION environment variable matching, at least until codecov/codecov-bash#133 is resolved + - curl -s https://codecov.io/bash > .codecov + - sed -i -e 's/TRAVIS_.*_VERSION/^TRAVIS_.*_VERSION=/' .codecov + - chmod +x .codecov + - if [[ $TRAVIS_PHP_VERSION == "5.6" ]]; then ./.codecov -X gcov; fi +# - if [[ "$TRAVIS_PHP_VERSION" == "5.6" ]]; then bash <(curl -s https://codecov.io/bash); fi diff --git a/vendor/jaimeperez/twig-configurable-i18n/bin/check-syntax.sh b/vendor/jaimeperez/twig-configurable-i18n/bin/check-syntax.sh new file mode 100755 index 0000000000..15cc4389d6 --- /dev/null +++ b/vendor/jaimeperez/twig-configurable-i18n/bin/check-syntax.sh @@ -0,0 +1,15 @@ +#!/usr/bin/env bash + +PHP='/usr/bin/env php' +RETURN=0 + +# check PHP files +for FILE in `find src -name "*.php"`; do + $PHP -l $FILE > /dev/null 2>&1 + if [ $? -ne 0 ]; then + echo "Syntax check failed for ${FILE}" + RETURN=`expr ${RETURN} + 1` + fi +done + +exit $RETURN diff --git a/vendor/jaimeperez/twig-configurable-i18n/composer.json b/vendor/jaimeperez/twig-configurable-i18n/composer.json index b5f6d8829a..d916ce30a7 100644 --- a/vendor/jaimeperez/twig-configurable-i18n/composer.json +++ b/vendor/jaimeperez/twig-configurable-i18n/composer.json @@ -16,7 +16,11 @@ } }, "require": { - "twig/extensions": "^1.3" + "twig/extensions": "^1.5" + }, + "require-dev": { + "phpunit/phpunit": "~4.8.36", + "twig/twig": "^1.37 || ^2.7" }, "support": { "issues": "https://github.com/jaimeperez/twig-configurable-i18n/issues", diff --git a/vendor/jaimeperez/twig-configurable-i18n/phpunit.xml b/vendor/jaimeperez/twig-configurable-i18n/phpunit.xml new file mode 100644 index 0000000000..c0985fdd80 --- /dev/null +++ b/vendor/jaimeperez/twig-configurable-i18n/phpunit.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="utf-8" ?> +<phpunit bootstrap="tests/bootstrap.php"> + <testsuites> + <testsuite name="The project's test suite"> + <directory>tests/</directory> + </testsuite> + </testsuites> + <filter> + <whitelist processUncoveredFilesFromWhitelist="true"> + <directory suffix=".php">./lib</directory> + </whitelist> + </filter> + <logging> + <log type="coverage-text" target="php://stdout" showUncoveredFiles="true" /> + <log type="coverage-html" target="build/coverage" title="PHP Coveralls" charset="UTF-8" yui="true" highlight="true" lowUpperBound="35" highLowerBound="70" /> + <log type="coverage-clover" target="build/logs/clover.xml" /> + </logging> +</phpunit> + diff --git a/vendor/jaimeperez/twig-configurable-i18n/psalm.xml b/vendor/jaimeperez/twig-configurable-i18n/psalm.xml new file mode 100644 index 0000000000..9c06c67202 --- /dev/null +++ b/vendor/jaimeperez/twig-configurable-i18n/psalm.xml @@ -0,0 +1,30 @@ +<?xml version="1.0"?> +<psalm + name="Twig configurable i18n" + useDocblockTypes="true" + totallyTyped="false" +> + <projectFiles> + <directory name="src" /> + </projectFiles> + + <issueHandlers> + <LessSpecificReturnType errorLevel="info" /> + + <!-- level 3 issues - slightly lazy code writing, but probably low false-negatives --> + <DeprecatedMethod errorLevel="info" /> + + <MissingClosureReturnType errorLevel="info" /> + <MissingReturnType errorLevel="info" /> + <MissingPropertyType errorLevel="info" /> + <InvalidDocblock errorLevel="info" /> + <MisplacedRequiredParam errorLevel="info" /> + + <PropertyNotSetInConstructor errorLevel="info" /> + <MissingConstructor errorLevel="info" /> + <MissingClosureParamType errorLevel="info" /> + <MissingParamType errorLevel="info" /> + <UnusedClass errorLevel="info" /> + <PossiblyUnusedMethod errorLevel="info" /> + </issueHandlers> +</psalm> diff --git a/vendor/jaimeperez/twig-configurable-i18n/src/Twig/Environment.php b/vendor/jaimeperez/twig-configurable-i18n/src/Twig/Environment.php index fab8ab6c5e..a0013d9768 100644 --- a/vendor/jaimeperez/twig-configurable-i18n/src/Twig/Environment.php +++ b/vendor/jaimeperez/twig-configurable-i18n/src/Twig/Environment.php @@ -9,13 +9,12 @@ */ namespace JaimePerez\TwigConfigurableI18n\Twig; -class Environment extends \Twig_Environment +class Environment extends \Twig\Environment { - /** * @var array The array of options passed to the constructor. */ - protected $options = array(); + protected $options = []; /** @@ -27,11 +26,11 @@ class Environment extends \Twig_Environment * * * translation_function_plural: the name of a function to translate a message in plural. * - * @see \Twig_Environment::__construct() - * @param \Twig_LoaderInterface|null $loader A Twig_LoaderInterface instance. + * @see \Twig\Environment::__construct() + * @param \Twig\Loader\LoaderInterface $loader A Twig_LoaderInterface instance. * @param array $options An array of options. */ - public function __construct(\Twig_LoaderInterface $loader = null, $options = array()) + public function __construct(\Twig\Loader\LoaderInterface $loader, $options = []) { parent::__construct($loader, $options); $this->options = $options; diff --git a/vendor/jaimeperez/twig-configurable-i18n/src/Twig/Extensions/Extension/I18n.php b/vendor/jaimeperez/twig-configurable-i18n/src/Twig/Extensions/Extension/I18n.php index c6584e7a2e..d0fa671fd6 100644 --- a/vendor/jaimeperez/twig-configurable-i18n/src/Twig/Extensions/Extension/I18n.php +++ b/vendor/jaimeperez/twig-configurable-i18n/src/Twig/Extensions/Extension/I18n.php @@ -7,67 +7,47 @@ namespace JaimePerez\TwigConfigurableI18n\Twig\Extensions\Extension; use JaimePerez\TwigConfigurableI18n\Twig\Extensions\TokenParser\Trans; -use Twig_Extensions_Extension_I18n; -class I18n extends Twig_Extensions_Extension_I18n implements \Twig_Extension_InitRuntimeInterface +class I18n extends \Twig\Extensions\I18nExtension { + /** @var array */ + protected $filters = []; - /** - * @var string The function to use to translate singular sentences. Defaults to gettext(). - */ - protected $singular = 'gettext'; /** - * @var string The function to use to translate plural sentences. Defaults to ngettext(). - */ - protected $plural = 'ngettext'; - - - /** - * @param \Twig_Environment $environment The Twig environment to use with this exception. + * Build a new I18N extension. + * + * Two filters, "trans" and "transchoice" are registered by default. These two will allow you to translate + * singular and plural sentences, respectively. */ - public function initRuntime(\Twig_Environment $environment) + public function __construct() { - if ($environment instanceof \JaimePerez\TwigConfigurableI18n\Twig\Environment) { - $options = $environment->getOptions(); - if (array_key_exists('translation_function', $options) && - is_callable($options['translation_function'], false, $callable) - ) { - $this->singular = $options['translation_function']; - } - if (array_key_exists('translation_function_plural', $options) && - is_callable($options['translation_function_plural'], false, $callable) - ) { - $this->plural = $options['translation_function_plural']; - } - } - - parent::initRuntime($environment); + $this->filters = [ + new \Twig\TwigFilter('trans', [$this, 'translateSingular'], ['needs_environment' => true]), + new \Twig\TwigFilter('transchoice', [$this, 'translatePlural'], ['needs_environment' => true]), + ]; } /** * Returns the token parser instances to add to the existing list. * - * @return array An array of Twig_TokenParserInterface or Twig_TokenParserBrokerInterface instances + * @return \Twig\TokenParser\TokenParserInterface[] */ public function getTokenParsers() { - return array(new Trans()); + return [new Trans()]; } /** * Returns a list of filters to add to the existing list. * - * @return array An array of filters + * @return \Twig\TwigFilter[] An array of filters */ public function getFilters() { - return array( - new \Twig_SimpleFilter('trans', array($this, 'translateSingular')), - new \Twig_SimpleFilter('transchoice', array($this, 'translatePlural')), - ); + return $this->filters; } @@ -80,8 +60,18 @@ public function getFilters() */ public function translateSingular() { + $singular = 'gettext'; $args = func_get_args(); - return call_user_func_array($this->singular, $args); + + /** @var \JaimePerez\TwigConfigurableI18n\Twig\Environment $env */ + $env = array_shift($args); + $options = $env->getOptions(); + if (array_key_exists('translation_function', $options) && + is_callable($options['translation_function'], false, $callable) + ) { + $singular = $options['translation_function']; + } + return call_user_func_array($singular, $args); } @@ -94,7 +84,18 @@ public function translateSingular() */ public function translatePlural() { + $plural = 'ngettext'; $args = func_get_args(); - return call_user_func_array($this->plural, $args); + + /** @var \JaimePerez\TwigConfigurableI18n\Twig\Environment $env */ + $env = array_shift($args); + $options = $env->getOptions(); + + if (array_key_exists('translation_function_plural', $options) && + is_callable($options['translation_function_plural']) + ) { + $plural = $options['translation_function_plural']; + } + return call_user_func_array($plural, $args); } } diff --git a/vendor/jaimeperez/twig-configurable-i18n/src/Twig/Extensions/Node/Trans.php b/vendor/jaimeperez/twig-configurable-i18n/src/Twig/Extensions/Node/Trans.php index a1d5e3817f..1b5042d77c 100644 --- a/vendor/jaimeperez/twig-configurable-i18n/src/Twig/Extensions/Node/Trans.php +++ b/vendor/jaimeperez/twig-configurable-i18n/src/Twig/Extensions/Node/Trans.php @@ -8,10 +8,9 @@ namespace JaimePerez\TwigConfigurableI18n\Twig\Extensions\Node; use ReflectionClass; -use Twig_Compiler; -use Twig_Extensions_Node_Trans; +use Twig\Compiler; -class Trans extends Twig_Extensions_Node_Trans +class Trans extends \Twig\Extensions\Node\TransNode { /** * Compiles the node to PHP. @@ -20,14 +19,15 @@ class Trans extends Twig_Extensions_Node_Trans * Twig_Extensions_Extension_I18n allows it, we will try to change all calls to the default translation methods * to whatever is configured in the environment. * - * @param Twig_Compiler $compiler A Twig_Compiler instance + * @param \Twig\Compiler $compiler A \Twig\Compiler instance + * @return void */ - public function compile(Twig_Compiler $compiler) + public function compile(Compiler $compiler) { parent::compile($compiler); // get the reflection class for Twig_Compiler and evaluate if we can parasite it - $class = new ReflectionClass('Twig_Compiler'); + $class = new ReflectionClass(Compiler::class); if (!$class->hasProperty('source')) { // the source must have changed, we don't have the "source" property, so nothing we can do here... return; @@ -39,7 +39,7 @@ public function compile(Twig_Compiler $compiler) // now, if we have proper configuration, rename the calls to gettext with the ones configured in the environment $env = $compiler->getEnvironment(); - if (is_a($env, '\JaimePerez\TwigConfigurableI18n\Twig\Environment')) { + if (is_a($env, \JaimePerez\TwigConfigurableI18n\Twig\Environment::class)) { /** @var \JaimePerez\TwigConfigurableI18n\Twig\Environment $env */ $options = $env->getOptions(); $source = $compiler->getSource(); diff --git a/vendor/jaimeperez/twig-configurable-i18n/src/Twig/Extensions/TokenParser/Trans.php b/vendor/jaimeperez/twig-configurable-i18n/src/Twig/Extensions/TokenParser/Trans.php index 0612c6e69f..2f4d79e397 100644 --- a/vendor/jaimeperez/twig-configurable-i18n/src/Twig/Extensions/TokenParser/Trans.php +++ b/vendor/jaimeperez/twig-configurable-i18n/src/Twig/Extensions/TokenParser/Trans.php @@ -7,25 +7,27 @@ namespace JaimePerez\TwigConfigurableI18n\Twig\Extensions\TokenParser; use JaimePerez\TwigConfigurableI18n\Twig\Extensions\Node\Trans as NodeTrans; -use Twig_Token; -use Twig_Extensions_TokenParser_Trans; +use Twig\Token; -class Trans extends Twig_Extensions_TokenParser_Trans +class Trans extends \Twig\Extensions\TokenParser\TransTokenParser { /** * Parses a token and returns a node. * - * @param Twig_Token $token A Twig_Token instance + * @param \Twig\Token $token A \Twig\Token instance * - * @return NodeTrans A Twig_Node instance + * @return \Twig\Node\Node A \Twig\Node\Node instance */ - public function parse(Twig_Token $token) + public function parse(Token $token) { $parsed = parent::parse($token); $body = ($parsed->hasNode('body')) ? $parsed->getNode('body') : null; $plural = ($parsed->hasNode('plural')) ? $parsed->getNode('plural') : null; $count = ($parsed->hasNode('count')) ? $parsed->getNode('count') : null; $notes = ($parsed->hasNode('notes')) ? $parsed->getNode('notes') : null; - return new NodeTrans($body, $plural, $count, $notes, $parsed->getLine(), $parsed->getNodeTag()); + + /** @var \Twig\Node\Node $retval */ + $retval = new NodeTrans($body, $plural, $count, $notes, $parsed->getTemplateLine(), $parsed->getNodeTag()); + return $retval; } } diff --git a/vendor/jaimeperez/twig-configurable-i18n/tests/bootstrap.php b/vendor/jaimeperez/twig-configurable-i18n/tests/bootstrap.php new file mode 100644 index 0000000000..e23960d24a --- /dev/null +++ b/vendor/jaimeperez/twig-configurable-i18n/tests/bootstrap.php @@ -0,0 +1,4 @@ +<?php + +$projectRoot = dirname(__DIR__); +require_once($projectRoot.'/vendor/autoload.php'); diff --git a/vendor/psr/log/Psr/Log/LoggerInterface.php b/vendor/psr/log/Psr/Log/LoggerInterface.php index 5ea72438b5..e695046e30 100644 --- a/vendor/psr/log/Psr/Log/LoggerInterface.php +++ b/vendor/psr/log/Psr/Log/LoggerInterface.php @@ -118,6 +118,8 @@ public function debug($message, array $context = array()); * @param array $context * * @return void + * + * @throws \Psr\Log\InvalidArgumentException */ public function log($level, $message, array $context = array()); } diff --git a/vendor/psr/log/Psr/Log/LoggerTrait.php b/vendor/psr/log/Psr/Log/LoggerTrait.php index 867225df1d..e392fef0a0 100644 --- a/vendor/psr/log/Psr/Log/LoggerTrait.php +++ b/vendor/psr/log/Psr/Log/LoggerTrait.php @@ -135,6 +135,8 @@ public function debug($message, array $context = array()) * @param array $context * * @return void + * + * @throws \Psr\Log\InvalidArgumentException */ abstract public function log($level, $message, array $context = array()); } diff --git a/vendor/psr/log/Psr/Log/NullLogger.php b/vendor/psr/log/Psr/Log/NullLogger.php index d8cd682c8f..c8f7293b1c 100644 --- a/vendor/psr/log/Psr/Log/NullLogger.php +++ b/vendor/psr/log/Psr/Log/NullLogger.php @@ -20,6 +20,8 @@ class NullLogger extends AbstractLogger * @param array $context * * @return void + * + * @throws \Psr\Log\InvalidArgumentException */ public function log($level, $message, array $context = array()) { diff --git a/vendor/psr/log/Psr/Log/Test/LoggerInterfaceTest.php b/vendor/psr/log/Psr/Log/Test/LoggerInterfaceTest.php index 4b861c3ef6..9ecb6c4b07 100644 --- a/vendor/psr/log/Psr/Log/Test/LoggerInterfaceTest.php +++ b/vendor/psr/log/Psr/Log/Test/LoggerInterfaceTest.php @@ -4,6 +4,7 @@ use Psr\Log\LoggerInterface; use Psr\Log\LogLevel; +use PHPUnit\Framework\TestCase; /** * Provides a base test class for ensuring compliance with the LoggerInterface. @@ -11,7 +12,7 @@ * Implementors can extend the class and implement abstract methods to run this * as part of their test suite. */ -abstract class LoggerInterfaceTest extends \PHPUnit_Framework_TestCase +abstract class LoggerInterfaceTest extends TestCase { /** * @return LoggerInterface @@ -140,5 +141,6 @@ class DummyTest { public function __toString() { + return 'DummyTest'; } } diff --git a/vendor/psr/log/Psr/Log/Test/TestLogger.php b/vendor/psr/log/Psr/Log/Test/TestLogger.php index 0cdffe4f92..1be3230496 100644 --- a/vendor/psr/log/Psr/Log/Test/TestLogger.php +++ b/vendor/psr/log/Psr/Log/Test/TestLogger.php @@ -142,5 +142,6 @@ public function __call($method, $args) public function reset() { $this->records = []; + $this->recordsByLevel = []; } } diff --git a/vendor/psr/log/README.md b/vendor/psr/log/README.md index 5571a25e8d..a9f20c437b 100644 --- a/vendor/psr/log/README.md +++ b/vendor/psr/log/README.md @@ -38,6 +38,12 @@ class Foo if ($this->logger) { $this->logger->info('Doing work'); } + + try { + $this->doSomethingElse(); + } catch (Exception $exception) { + $this->logger->error('Oh no!', array('exception' => $exception)); + } // do something useful } diff --git a/vendor/psr/log/composer.json b/vendor/psr/log/composer.json index 87934d707e..3f6d4eea4c 100644 --- a/vendor/psr/log/composer.json +++ b/vendor/psr/log/composer.json @@ -20,7 +20,7 @@ }, "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "1.1.x-dev" } } } diff --git a/vendor/robrichards/xmlseclibs/CHANGELOG.txt b/vendor/robrichards/xmlseclibs/CHANGELOG.txt index 959cc74138..faaf61cf42 100644 --- a/vendor/robrichards/xmlseclibs/CHANGELOG.txt +++ b/vendor/robrichards/xmlseclibs/CHANGELOG.txt @@ -1,5 +1,34 @@ xmlseclibs.php ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| +06, Nov 2019, 3.0.4 +Security Improvements: +- Insure only a single SignedInfo element exists within a signature during + verification. Refs CVE-2019-3465. +Bug Fixes: +- Fix variable casing. + +15, Nov 2018, 3.0.3 +Bug Fixes: +- Fix casing of class name. (Willem Stuursma-Ruwen) +- Fix Xpath casing. (Tim van Dijen) + +Improvements: +- Make PCRE2 compliant. (Stefan Winter) +- Add PHP 7.3 support. (Stefan Winter) + +27, Sep 2018, 3.0.2 +Security Improvements: +- OpenSSL is now a requirement rather than suggestion. (Slaven Bacelic) +- Filter input to avoid XPath injection. (Jaime Pérez) + +Bug Fixes: +- Fix missing parentheses (Tim van Dijen) + +Improvements: +- Use strict comparison operator to compare digest values. (Jaime Pérez) +- Remove call to file_get_contents that doesn't even work. (Jaime Pérez) +- Document potentially dangerous return value behaviour. (Thijs Kinkhorst) + 31, Aug 2017, 3.0.1 Bug Fixes: - Fixed missing () in function call. (Dennis Væversted) diff --git a/vendor/robrichards/xmlseclibs/LICENSE b/vendor/robrichards/xmlseclibs/LICENSE index e54bd03ee8..4fe5e5ffbd 100644 --- a/vendor/robrichards/xmlseclibs/LICENSE +++ b/vendor/robrichards/xmlseclibs/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2007-2016, Robert Richards <rrichards@cdatazone.org>. +Copyright (c) 2007-2019, Robert Richards <rrichards@cdatazone.org>. All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/vendor/robrichards/xmlseclibs/README.md b/vendor/robrichards/xmlseclibs/README.md index 0d0f3ee98b..1a83735ba5 100644 --- a/vendor/robrichards/xmlseclibs/README.md +++ b/vendor/robrichards/xmlseclibs/README.md @@ -5,7 +5,7 @@ xmlseclibs is a library written in PHP for working with XML Encryption and Signa The author of xmlseclibs is Rob Richards. # Branches -Both the master and the 2.0 branches are actively maintained. The 1.4 branch is only updated for security related issues. +Master is currently the only actively maintained branch. * master: Removes mcrypt usage requiring 5.4+ (5.6.24+ recommended for security reasons) * 2.0: Contains namespace support requiring 5.3+ * 1.4: Contains auto-loader support while also maintaining backwards compatiblity with the older 1.3 version using the xmlseclibs.php file. Supports PHP 5.2+ diff --git a/vendor/robrichards/xmlseclibs/composer.json b/vendor/robrichards/xmlseclibs/composer.json index 3d77709cdc..22ce7a3e1f 100644 --- a/vendor/robrichards/xmlseclibs/composer.json +++ b/vendor/robrichards/xmlseclibs/composer.json @@ -15,9 +15,7 @@ } }, "require": { - "php": ">= 5.4" - }, - "suggest": { - "ext-openssl": "OpenSSL extension" + "php": ">= 5.4", + "ext-openssl": "*" } } diff --git a/vendor/robrichards/xmlseclibs/src/Utils/XPath.php b/vendor/robrichards/xmlseclibs/src/Utils/XPath.php new file mode 100644 index 0000000000..8cdc48e157 --- /dev/null +++ b/vendor/robrichards/xmlseclibs/src/Utils/XPath.php @@ -0,0 +1,44 @@ +<?php + +namespace RobRichards\XMLSecLibs\Utils; + +class XPath +{ + const ALPHANUMERIC = '\w\d'; + const NUMERIC = '\d'; + const LETTERS = '\w'; + const EXTENDED_ALPHANUMERIC = '\w\d\s\-_:\.'; + + const SINGLE_QUOTE = '\''; + const DOUBLE_QUOTE = '"'; + const ALL_QUOTES = '[\'"]'; + + + /** + * Filter an attribute value for save inclusion in an XPath query. + * + * @param string $value The value to filter. + * @param string $quotes The quotes used to delimit the value in the XPath query. + * + * @return string The filtered attribute value. + */ + public static function filterAttrValue($value, $quotes = self::ALL_QUOTES) + { + return preg_replace('#'.$quotes.'#', '', $value); + } + + + /** + * Filter an attribute name for save inclusion in an XPath query. + * + * @param string $name The attribute name to filter. + * @param mixed $allow The set of characters to allow. Can be one of the constants provided by this class, or a + * custom regex excluding the '#' character (used as delimiter). + * + * @return string The filtered attribute name. + */ + public static function filterAttrName($name, $allow = self::EXTENDED_ALPHANUMERIC) + { + return preg_replace('#[^'.$allow.']#', '', $name); + } +} diff --git a/vendor/robrichards/xmlseclibs/src/XMLSecEnc.php b/vendor/robrichards/xmlseclibs/src/XMLSecEnc.php index d0621c5f63..f2b26796dd 100644 --- a/vendor/robrichards/xmlseclibs/src/XMLSecEnc.php +++ b/vendor/robrichards/xmlseclibs/src/XMLSecEnc.php @@ -5,11 +5,12 @@ use DOMNode; use DOMXPath; use Exception; +use RobRichards\XMLSecLibs\Utils\XPath as XPath; /** * xmlseclibs.php * - * Copyright (c) 2007-2017, Robert Richards <rrichards@cdatazone.org>. + * Copyright (c) 2007-2019, Robert Richards <rrichards@cdatazone.org>. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -42,7 +43,7 @@ * POSSIBILITY OF SUCH DAMAGE. * * @author Robert Richards <rrichards@cdatazone.org> - * @copyright 2007-2017 Robert Richards <rrichards@cdatazone.org> + * @copyright 2007-2019 Robert Richards <rrichards@cdatazone.org> * @license http://www.opensource.org/licenses/bsd-license.php BSD License */ @@ -470,7 +471,7 @@ public static function staticLocateKeyInfo($objBaseKey=null, $node=null) } $id = substr($uri, 1); - $query = "//xmlsecenc:EncryptedKey[@Id='$id']"; + $query = '//xmlsecenc:EncryptedKey[@Id="'.XPath::filterAttrValue($id, XPath::DOUBLE_QUOTE).'"]'; $keyElement = $xpath->query($query)->item(0); if (!$keyElement) { throw new Exception("Unable to locate EncryptedKey with @Id='$id'."); diff --git a/vendor/robrichards/xmlseclibs/src/XMLSecurityDSig.php b/vendor/robrichards/xmlseclibs/src/XMLSecurityDSig.php index 7166a41569..c9063d0f59 100644 --- a/vendor/robrichards/xmlseclibs/src/XMLSecurityDSig.php +++ b/vendor/robrichards/xmlseclibs/src/XMLSecurityDSig.php @@ -6,11 +6,12 @@ use DOMNode; use DOMXPath; use Exception; +use RobRichards\XMLSecLibs\Utils\XPath as XPath; /** * xmlseclibs.php * - * Copyright (c) 2007-2017, Robert Richards <rrichards@cdatazone.org>. + * Copyright (c) 2007-2019, Robert Richards <rrichards@cdatazone.org>. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -43,7 +44,7 @@ * POSSIBILITY OF SUCH DAMAGE. * * @author Robert Richards <rrichards@cdatazone.org> - * @copyright 2007-2017 Robert Richards <rrichards@cdatazone.org> + * @copyright 2007-2019 Robert Richards <rrichards@cdatazone.org> * @license http://www.opensource.org/licenses/bsd-license.php BSD License */ @@ -193,6 +194,11 @@ public function locateSignature($objDoc, $pos=0) $query = ".//secdsig:Signature"; $nodeset = $xpath->query($query, $objDoc); $this->sigNode = $nodeset->item($pos); + $query = "./secdsig:SignedInfo"; + $nodeset = $xpath->query($query, $this->sigNode); + if ($nodeset->length > 1) { + throw new Exception("Invalid structure - Too many SignedInfo elements found"); + } return $this->sigNode; } return null; @@ -302,6 +308,9 @@ public function canonicalizeSignedInfo() $xpath = $this->getXPathObj(); $query = "./secdsig:SignedInfo"; $nodeset = $xpath->query($query, $this->sigNode); + if ($nodeset->length > 1) { + throw new Exception("Invalid structure - Too many SignedInfo elements found"); + } if ($signInfoNode = $nodeset->item(0)) { $query = "./secdsig:CanonicalizationMethod"; $nodeset = $xpath->query($query, $signInfoNode); @@ -366,7 +375,7 @@ public function validateDigest($refNode, $data) $digValue = $this->calculateDigest($digestAlgorithm, $data, false); $query = 'string(./secdsig:DigestValue)'; $digestValue = $xpath->evaluate($query, $refNode); - return ($digValue == base64_decode($digestValue)); + return ($digValue === base64_decode($digestValue)); } /** @@ -439,7 +448,7 @@ public function processTransforms($refNode, $objData, $includeCommentNodes = tru if ($node->localName == 'XPath') { $arXPath = array(); $arXPath['query'] = '(.//. | .//@* | .//namespace::*)['.$node->nodeValue.']'; - $arXpath['namespaces'] = array(); + $arXPath['namespaces'] = array(); $nslist = $xpath->query('./namespace::*', $node); foreach ($nslist AS $nsnode) { if ($nsnode->localName != "xml") { @@ -485,14 +494,15 @@ public function processRefNode($refNode) $xPath = new DOMXPath($refNode->ownerDocument); if ($this->idNS && is_array($this->idNS)) { - foreach ($this->idNS AS $nspf => $ns) { + foreach ($this->idNS as $nspf => $ns) { $xPath->registerNamespace($nspf, $ns); } } - $iDlist = '@Id="'.$identifier.'"'; + $iDlist = '@Id="'.XPath::filterAttrValue($identifier, XPath::DOUBLE_QUOTE).'"'; if (is_array($this->idKeys)) { - foreach ($this->idKeys AS $idKey) { - $iDlist .= " or @$idKey='$identifier'"; + foreach ($this->idKeys as $idKey) { + $iDlist .= " or @".XPath::filterAttrName($idKey).'="'. + XPath::filterAttrValue($identifier, XPath::DOUBLE_QUOTE).'"'; } } $query = '//*['.$iDlist.']'; @@ -500,8 +510,6 @@ public function processRefNode($refNode) } else { $dataObject = $refNode->ownerDocument; } - } else { - $dataObject = file_get_contents($arUrl); } } else { /* This reference identifies the root node with an empty URI. This should @@ -554,7 +562,7 @@ public function getRefIDs() $refids = array(); $xpath = $this->getXPathObj(); - $query = "./secdsig:SignedInfo/secdsig:Reference"; + $query = "./secdsig:SignedInfo[1]/secdsig:Reference"; $nodeset = $xpath->query($query, $this->sigNode); if ($nodeset->length == 0) { throw new Exception("Reference nodes not found"); @@ -578,7 +586,7 @@ public function validateReference() } } $xpath = $this->getXPathObj(); - $query = "./secdsig:SignedInfo/secdsig:Reference"; + $query = "./secdsig:SignedInfo[1]/secdsig:Reference"; $nodeset = $xpath->query($query, $this->sigNode); if ($nodeset->length == 0) { throw new Exception("Reference nodes not found"); diff --git a/vendor/robrichards/xmlseclibs/src/XMLSecurityKey.php b/vendor/robrichards/xmlseclibs/src/XMLSecurityKey.php index af5500554e..6c01f0cc7a 100644 --- a/vendor/robrichards/xmlseclibs/src/XMLSecurityKey.php +++ b/vendor/robrichards/xmlseclibs/src/XMLSecurityKey.php @@ -7,7 +7,7 @@ /** * xmlseclibs.php * - * Copyright (c) 2007-2017, Robert Richards <rrichards@cdatazone.org>. + * Copyright (c) 2007-2019, Robert Richards <rrichards@cdatazone.org>. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -40,7 +40,7 @@ * POSSIBILITY OF SUCH DAMAGE. * * @author Robert Richards <rrichards@cdatazone.org> - * @copyright 2007-2017 Robert Richards <rrichards@cdatazone.org> + * @copyright 2007-2019 Robert Richards <rrichards@cdatazone.org> * @license http://www.opensource.org/licenses/bsd-license.php BSD License */ @@ -448,7 +448,7 @@ private function encryptPublic($data) private function decryptPublic($data) { if (! openssl_public_decrypt($data, $decrypted, $this->key, $this->cryptParams['padding'])) { - throw new Exception('Failure decrypting Data (openssl public) - ' . openssl_error_string); + throw new Exception('Failure decrypting Data (openssl public) - ' . openssl_error_string()); } return $decrypted; } @@ -585,6 +585,16 @@ public function signData($data) /** * Verifies the data (string) against the given signature using the extension assigned to the type in the constructor. + * + * Returns in case of openSSL: + * 1 on succesful signature verification, + * 0 when signature verification failed, + * -1 if an error occurred during processing. + * + * NOTE: be very careful when checking the return value, because in PHP, + * -1 will be cast to True when in boolean context. So always check the + * return value in a strictly typed way, e.g. "$obj->verify(...) === 1". + * * @param string $data * @param string $signature * @return bool|int diff --git a/vendor/robrichards/xmlseclibs/xmlseclibs.php b/vendor/robrichards/xmlseclibs/xmlseclibs.php index 609597950d..4470dab269 100644 --- a/vendor/robrichards/xmlseclibs/xmlseclibs.php +++ b/vendor/robrichards/xmlseclibs/xmlseclibs.php @@ -2,7 +2,7 @@ /** * xmlseclibs.php * - * Copyright (c) 2007-2016, Robert Richards <rrichards@cdatazone.org>. + * Copyright (c) 2007-2019, Robert Richards <rrichards@cdatazone.org>. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -35,12 +35,13 @@ * POSSIBILITY OF SUCH DAMAGE. * * @author Robert Richards <rrichards@cdatazone.org> - * @copyright 2007-2017 Robert Richards <rrichards@cdatazone.org> + * @copyright 2007-2019 Robert Richards <rrichards@cdatazone.org> * @license http://www.opensource.org/licenses/bsd-license.php BSD License - * @version 3.0.1 + * @version 3.0.4 */ $xmlseclibs_srcdir = dirname(__FILE__) . '/src/'; require $xmlseclibs_srcdir . '/XMLSecurityKey.php'; require $xmlseclibs_srcdir . '/XMLSecurityDSig.php'; require $xmlseclibs_srcdir . '/XMLSecEnc.php'; +require $xmlseclibs_srcdir . '/Utils/XPath.php'; diff --git a/vendor/simplesamlphp/saml2/composer.json b/vendor/simplesamlphp/saml2/composer.json index 11fcf460ac..5c3800b50c 100644 --- a/vendor/simplesamlphp/saml2/composer.json +++ b/vendor/simplesamlphp/saml2/composer.json @@ -14,15 +14,17 @@ "ext-dom": "*", "ext-zlib": "*", - "robrichards/xmlseclibs": "^3.0", - "psr/log": "~1.0" + "psr/log": "~1.0", + "robrichards/xmlseclibs": "^3.0.4", + "webmozart/assert": "^1.4" }, "require-dev": { - "squizlabs/php_codesniffer": "~1.4", - "phpmd/phpmd": "~1.5", - "sensiolabs/security-checker": "~1.1", - "phpunit/phpunit": "~4", - "sebastian/phpcpd": "~1.4", + "simplesamlphp/simplesamlphp-test-framework": "0.0.11", + "squizlabs/php_codesniffer": "~3.2", + "phpunit/phpunit": "~5.7", + "phpmd/phpmd": "~2.6", + "sensiolabs/security-checker": "~4.1", + "sebastian/phpcpd": "~2.0", "mockery/mockery": "~0.9" }, "autoload": { diff --git a/vendor/simplesamlphp/saml2/phpunit.xml b/vendor/simplesamlphp/saml2/phpunit.xml new file mode 100644 index 0000000000..729cdaed27 --- /dev/null +++ b/vendor/simplesamlphp/saml2/phpunit.xml @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<phpunit backupGlobals="false" + backupStaticAttributes="false" + colors="true" + convertErrorsToExceptions="true" + convertNoticesToExceptions="true" + convertWarningsToExceptions="true" + processIsolation="false" + stopOnFailure="false" + syntaxCheck="false" + bootstrap="./tests/autoload.php"> + <testsuites> + <testsuite name="Test Suite"> + <directory>./tests</directory> + </testsuite> + </testsuites> + <filter> + <whitelist processUncoveredFilesFromWhitelist="true"> + <directory>./src</directory> + </whitelist> + </filter> + <listeners> + <listener class="\Mockery\Adapter\Phpunit\TestListener" /> + </listeners> +</phpunit> diff --git a/vendor/simplesamlphp/saml2/psalm.xml b/vendor/simplesamlphp/saml2/psalm.xml new file mode 100644 index 0000000000..50ad1256a9 --- /dev/null +++ b/vendor/simplesamlphp/saml2/psalm.xml @@ -0,0 +1,36 @@ +<?xml version="1.0"?> +<psalm + name="SimpleSAMLphp" + useDocblockTypes="true" + totallyTyped="false" + hideExternalErrors="true" +> + <projectFiles> + <directory name="src/SAML2" /> + <ignoreFiles> + <directory name="vendor" /> + </ignoreFiles> + </projectFiles> + + <issueHandlers> + <LessSpecificReturnType errorLevel="info" /> + + <!-- level 3 issues - slightly lazy code writing, but probably low false-negatives --> + <DeprecatedMethod errorLevel="info" /> + + <MissingClosureReturnType errorLevel="info" /> + <MissingReturnType errorLevel="info" /> + <MissingPropertyType errorLevel="info" /> + <InvalidDocblock errorLevel="info" /> + <MisplacedRequiredParam errorLevel="info" /> + + <PropertyNotSetInConstructor errorLevel="info" /> + <MissingConstructor errorLevel="info" /> + <MissingClosureParamType errorLevel="info" /> + <MissingParamType errorLevel="info" /> + <UnusedClass errorLevel="info" /> + <PossiblyUnusedMethod errorLevel="info" /> + <PropertyNotSetInConstructor errorLevel="suppress" /> + <MissingClosureReturnType errorLevel="suppress" /> + </issueHandlers> +</psalm> diff --git a/vendor/simplesamlphp/saml2/src/SAML2/ArtifactResolve.php b/vendor/simplesamlphp/saml2/src/SAML2/ArtifactResolve.php index eec256f327..2e50b36357 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/ArtifactResolve.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/ArtifactResolve.php @@ -2,6 +2,8 @@ namespace SAML2; +use Webmozart\Assert\Assert; + /** * The Artifact is part of the SAML 2.0 IdP code, and it builds an artifact object. * I am using strings, because I find them easier to work with. @@ -14,6 +16,12 @@ class ArtifactResolve extends Request { private $artifact; + + /** + * Constructor for SAML 2 ArtifactResolve. + * + * @param \DOMElement|null $xml The input assertion. + */ public function __construct(\DOMElement $xml = null) { parent::__construct('ArtifactResolve', $xml); @@ -34,17 +42,20 @@ public function getArtifact() return $this->artifact; } + /** * Set the artifact that should be included in this response. * * @param string $artifact + * @return void */ public function setArtifact($artifact) { - assert(is_string($artifact)); + Assert::string($artifact); $this->artifact = $artifact; } + /** * Convert the response message to an XML element. * diff --git a/vendor/simplesamlphp/saml2/src/SAML2/ArtifactResponse.php b/vendor/simplesamlphp/saml2/src/SAML2/ArtifactResponse.php index 9a17d25be8..7d6a42ee58 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/ArtifactResponse.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/ArtifactResponse.php @@ -2,6 +2,8 @@ namespace SAML2; +use Webmozart\Assert\Assert; + /** * The \SAML2\ArtifactResponse, is the response to the \SAML2\ArtifactResolve. * @@ -19,13 +21,19 @@ class ArtifactResponse extends StatusResponse private $any; + /** + * Constructor for SAML 2 ArtifactResponse. + * + * @param \DOMElement|null $xml The input assertion. + * @throws \Exception + */ public function __construct(\DOMElement $xml = null) { parent::__construct('ArtifactResponse', $xml); if (!is_null($xml)) { $status = Utils::xpQuery($xml, './saml_protocol:Status'); - assert(!empty($status)); /* Will have failed during StatusResponse parsing. */ + Assert::notEmpty($status); /* Will have failed during StatusResponse parsing. */ $status = $status[0]; @@ -39,16 +47,26 @@ public function __construct(\DOMElement $xml = null) } } + + /** + * @param \DOMElement|null $any + * @return void + */ public function setAny(\DOMElement $any = null) { $this->any = $any; } + + /** + * @return \DOMElement|null + */ public function getAny() { return $this->any; } + /** * Convert the response message to an XML element. * diff --git a/vendor/simplesamlphp/saml2/src/SAML2/Assertion.php b/vendor/simplesamlphp/saml2/src/SAML2/Assertion.php index 9fadbb5739..6ec45d5124 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/Assertion.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/Assertion.php @@ -7,7 +7,10 @@ use SAML2\Exception\RuntimeException; use SAML2\Utilities\Temporal; use SAML2\XML\Chunk; +use SAML2\XML\saml\Issuer as Issuer; +use SAML2\XML\saml\NameID; use SAML2\XML\saml\SubjectConfirmation; +use Webmozart\Assert\Assert; /** * Class representing a SAML 2 assertion. @@ -176,16 +179,16 @@ class Assertion implements SignedElement /** * The attributes values types as per http://www.w3.org/2001/XMLSchema definitions * the variable is as an associative array, indexed by attribute name - * + * * when parsing assertion, the variable will be: - * - <attribute name> => array(<Value1's xs type>|null, <xs type Value2>|null, ...) + * - <attribute name> => [<Value1's xs type>|null, <xs type Value2>|null, ...] * array will always have the same size of the array of vaules in $attributes for the same <attribute name> * * when generating assertion, the varuable can be: * - null : backward compatibility * - <attribute name> => <xs type> : all values for the given attribute will have the same xs type - * - <attribute name> => array(<Value1's xs type>|null, <xs type Value2>|null, ...) : Nth value will have type of the Nth in the array - * + * - <attribute name> => [<Value1's xs type>|null, <xs type Value2>|null, ...] : Nth value will have type of the Nth in the array + * * @var array multi-dimensional array of array */ private $attributesValueTypes; @@ -248,6 +251,7 @@ class Assertion implements SignedElement */ private $signatureMethod; + /** * Constructor for SAML 2 assertions. * @@ -256,16 +260,16 @@ class Assertion implements SignedElement */ public function __construct(\DOMElement $xml = null) { - $this->id = Utils::getContainer()->generateId(); - $this->issueInstant = Temporal::getTime(); - $this->issuer = ''; - $this->authnInstant = Temporal::getTime(); - $this->attributes = array(); - $this->nameFormat = Constants::NAMEFORMAT_UNSPECIFIED; - $this->certificates = array(); - $this->AuthenticatingAuthority = array(); - $this->SubjectConfirmation = array(); - $this->requiredEncAttributes = false; + $this->setId(Utils::getContainer()->generateId()); + $this->setIssueInstant(Temporal::getTime()); + $this->setIssuer(''); + $this->setAuthnInstant(Temporal::getTime()); + $this->setAttributes([]); + $this->setAttributeNameFormat(Constants::NAMEFORMAT_UNSPECIFIED); + $this->setCertificates([]); + $this->setAuthenticatingAuthority([]); + $this->setSubjectConfirmation([]); + $this->setRequiredEncAttributes(false); if ($xml === null) { return; @@ -278,7 +282,7 @@ public function __construct(\DOMElement $xml = null) if ($xml->getAttribute('Version') !== '2.0') { /* Currently a very strict check. */ - throw new \Exception('Unsupported version: ' . $xml->getAttribute('Version')); + throw new \Exception('Unsupported version: '.$xml->getAttribute('Version')); } $this->issueInstant = Utils::xsDateTimeToTimestamp($xml->getAttribute('IssueInstant')); @@ -287,7 +291,7 @@ public function __construct(\DOMElement $xml = null) if (empty($issuer)) { throw new \Exception('Missing <saml:Issuer> in assertion.'); } - $this->issuer = new XML\saml\Issuer($issuer[0]); + $this->issuer = new Issuer($issuer[0]); if ($this->issuer->Format === Constants::NAMEID_ENTITY) { $this->issuer = $this->issuer->value; } @@ -300,11 +304,13 @@ public function __construct(\DOMElement $xml = null) $this->parseSignature($xml); } + /** * Parse subject in assertion. * * @param \DOMElement $xml The assertion XML element. * @throws \Exception + * @return void */ private function parseSubject(\DOMElement $xml) { @@ -330,7 +336,7 @@ private function parseSubject(\DOMElement $xml) /* The NameID element is encrypted. */ $this->encryptedNameId = $nameId; } else { - $this->nameId = new XML\saml\NameID($nameId); + $this->nameId = new NameID($nameId); } } @@ -344,11 +350,13 @@ private function parseSubject(\DOMElement $xml) } } + /** * Parse conditions in assertion. * * @param \DOMElement $xml The assertion XML element. * @throws \Exception + * @return void */ private function parseConditions(\DOMElement $xml) { @@ -364,14 +372,14 @@ private function parseConditions(\DOMElement $xml) if ($conditions->hasAttribute('NotBefore')) { $notBefore = Utils::xsDateTimeToTimestamp($conditions->getAttribute('NotBefore')); - if ($this->notBefore === null || $this->notBefore < $notBefore) { - $this->notBefore = $notBefore; + if ($this->getNotBefore() === null || $this->getNotBefore() < $notBefore) { + $this->setNotBefore($notBefore); } } if ($conditions->hasAttribute('NotOnOrAfter')) { $notOnOrAfter = Utils::xsDateTimeToTimestamp($conditions->getAttribute('NotOnOrAfter')); - if ($this->notOnOrAfter === null || $this->notOnOrAfter > $notOnOrAfter) { - $this->notOnOrAfter = $notOnOrAfter; + if ($this->getNotOnOrAfter() === null || $this->getNotOnOrAfter() > $notOnOrAfter) { + $this->setNotOnOrAfter($notOnOrAfter); } } @@ -380,7 +388,7 @@ private function parseConditions(\DOMElement $xml) continue; } if ($node->namespaceURI !== Constants::NS_SAML) { - throw new \Exception('Unknown namespace of condition: ' . var_export($node->namespaceURI, true)); + throw new \Exception('Unknown namespace of condition: '.var_export($node->namespaceURI, true)); } switch ($node->localName) { case 'AudienceRestriction': @@ -403,16 +411,18 @@ private function parseConditions(\DOMElement $xml) /* Currently ignored. */ break; default: - throw new \Exception('Unknown condition: ' . var_export($node->localName, true)); + throw new \Exception('Unknown condition: '.var_export($node->localName, true)); } } } + /** * Parse AuthnStatement in assertion. * * @param \DOMElement $xml The assertion XML element. * @throws \Exception + * @return void */ private function parseAuthnStatement(\DOMElement $xml) { @@ -442,11 +452,13 @@ private function parseAuthnStatement(\DOMElement $xml) $this->parseAuthnContext($authnStatement); } + /** * Parse AuthnContext in AuthnStatement. * * @param \DOMElement $authnStatementEl * @throws \Exception + * @return void */ private function parseAuthnContext(\DOMElement $authnStatementEl) { @@ -501,11 +513,13 @@ private function parseAuthnContext(\DOMElement $authnStatementEl) ); } + /** * Parse attribute statements in assertion. * * @param \DOMElement $xml The XML element with the assertion. * @throws \Exception + * @return void */ private function parseAttributes(\DOMElement $xml) { @@ -533,17 +547,19 @@ private function parseAttributes(\DOMElement $xml) } if (!array_key_exists($name, $this->attributes)) { - $this->attributes[$name] = array(); - $this->attributesValueTypes[$name] = array(); + $this->attributes[$name] = []; + $this->attributesValueTypes[$name] = []; } $this->parseAttributeValue($attribute, $name); } } + /** * @param \DOMNode $attribute * @param string $attributeName + * @return void */ private function parseAttributeValue($attribute, $attributeName) { @@ -554,15 +570,15 @@ private function parseAttributeValue($attribute, $attributeName) foreach ($values as $index => $eptiAttributeValue) { $eptiNameId = Utils::xpQuery($eptiAttributeValue, './saml_assertion:NameID'); - if (count($eptiNameId) !== 1) { - throw new RuntimeException(sprintf( - 'A "%s" (EPTI) attribute value must be a NameID, none found for value no. "%d"', - $attributeName, - $index - )); + if (count($eptiNameId) === 1) { + $this->attributes[$attributeName][] = new NameID($eptiNameId[0]); + } else { + /* Fall back for legacy IdPs sending string value (e.g. SSP < 1.15) */ + Utils::getContainer()->getLogger()->warning(sprintf("Attribute %s (EPTI) value %d is not an XML NameId", $attributeName, $index)); + $nameId = new NameID(); + $nameId->setValue($eptiAttributeValue->textContent); + $this->attributes[$attributeName][] = $nameId; } - - $this->attributes[$attributeName][] = new XML\saml\NameID($eptiNameId[0]); } return; @@ -590,30 +606,34 @@ private function parseAttributeValue($attribute, $attributeName) } if ($type === 'xs:integer') { - $this->attributes[$attributeName][] = (int)$value->textContent; + $this->attributes[$attributeName][] = (int) $value->textContent; } else { $this->attributes[$attributeName][] = trim($value->textContent); } } } + /** * Parse encrypted attribute statements in assertion. * * @param \DOMElement $xml The XML element with the assertion. + * @return void */ private function parseEncryptedAttributes(\DOMElement $xml) { - $this->encryptedAttributes = Utils::xpQuery( + $this->setEncryptedAttributes(Utils::xpQuery( $xml, './saml_assertion:AttributeStatement/saml_assertion:EncryptedAttribute' - ); + )); } + /** * Parse signature on assertion. * * @param \DOMElement $xml The assertion XML element. + * @return void */ private function parseSignature(\DOMElement $xml) { @@ -623,13 +643,14 @@ private function parseSignature(\DOMElement $xml) /* Validate the signature element of the message. */ $sig = Utils::validateElement($xml); if ($sig !== false) { - $this->wasSignedAtConstruction = true; - $this->certificates = $sig['Certificates']; - $this->signatureData = $sig; - $this->signatureMethod = $signatureMethod[0]->value; + $this->setWasSignedAtConstruction(true); + $this->setCertificates($sig['Certificates']); + $this->setSignatureData($sig); + $this->setSignatureMethod($signatureMethod[0]->value); } } + /** * Validate this assertion against a public key. * @@ -642,17 +663,18 @@ private function parseSignature(\DOMElement $xml) */ public function validate(XMLSecurityKey $key) { - assert($key->type === \RobRichards\XMLSecLibs\XMLSecurityKey::RSA_SHA1); + Assert::same($key->type, XMLSecurityKey::RSA_SHA256); - if ($this->signatureData === null) { + if ($this->getSignatureData() === null) { return false; } - Utils::validateSignature($this->signatureData, $key); + Utils::validateSignature($this->getSignatureData(), $key); return true; } + /** * Retrieve the identifier of this assertion. * @@ -663,18 +685,21 @@ public function getId() return $this->id; } + /** * Set the identifier of this assertion. * * @param string $id The new identifier of this assertion. + * @return void */ public function setId($id) { - assert(is_string($id)); + Assert::string($id); $this->id = $id; } + /** * Retrieve the issue timestamp of this assertion. * @@ -685,18 +710,21 @@ public function getIssueInstant() return $this->issueInstant; } + /** * Set the issue timestamp of this assertion. * * @param int $issueInstant The new issue timestamp of this assertion, as an UNIX timestamp. + * @return void */ public function setIssueInstant($issueInstant) { - assert(is_int($issueInstant)); + Assert::integer($issueInstant); $this->issueInstant = $issueInstant; } + /** * Retrieve the issuer if this assertion. * @@ -707,23 +735,26 @@ public function getIssuer() return $this->issuer; } + /** * Set the issuer of this message. * * @param string|\SAML2\XML\saml\Issuer $issuer The new issuer of this assertion. + * @return void */ public function setIssuer($issuer) { - assert(is_string($issuer) || $issuer instanceof XML\saml\Issuer); + Assert::true(is_string($issuer) || $issuer instanceof Issuer); $this->issuer = $issuer; } + /** * Retrieve the NameId of the subject in the assertion. * - * @return \SAML2\XML\saml\NameID|null The name identifier of the assertion. * @throws \Exception + * @return \SAML2\XML\saml\NameID|null The name identifier of the assertion. */ public function getNameId() { @@ -734,6 +765,7 @@ public function getNameId() return $this->nameId; } + /** * Set the NameId of the subject in the assertion. * @@ -742,31 +774,36 @@ public function getNameId() * * @see \SAML2\Utils::addNameId() * @param \SAML2\XML\saml\NameID|array|null $nameId The name identifier of the assertion. + * @return void */ public function setNameId($nameId) { - assert(is_array($nameId) || is_null($nameId) || $nameId instanceof XML\saml\NameID); + Assert::true(is_array($nameId) || is_null($nameId) || $nameId instanceof NameID); if (is_array($nameId)) { - $nameId = XML\saml\NameID::fromArray($nameId); + // @deprecated behaviour + $nameId = NameID::fromArray($nameId); } $this->nameId = $nameId; } + /** * Check whether the NameId is encrypted. * - * @return true if the NameId is encrypted, false if not. + * @return bool True if the NameId is encrypted, false if not. */ public function isNameIdEncrypted() { return $this->encryptedNameId !== null; } + /** * Encrypt the NameID in the Assertion. * * @param XMLSecurityKey $key The encryption key. + * @return void */ public function encryptNameId(XMLSecurityKey $key) { @@ -794,13 +831,15 @@ public function encryptNameId(XMLSecurityKey $key) $this->nameId = null; } + /** * Decrypt the NameId of the subject in the assertion. * * @param XMLSecurityKey $key The decryption key. * @param array $blacklist Blacklisted decryption algorithms. + * @return void */ - public function decryptNameId(XMLSecurityKey $key, array $blacklist = array()) + public function decryptNameId(XMLSecurityKey $key, array $blacklist = []) { if ($this->encryptedNameId === null) { /* No NameID to decrypt. */ @@ -810,11 +849,12 @@ public function decryptNameId(XMLSecurityKey $key, array $blacklist = array()) $nameId = Utils::decryptElement($this->encryptedNameId, $key, $blacklist); Utils::getContainer()->debugMessage($nameId, 'decrypt'); - $this->nameId = new XML\saml\NameID($nameId); + $this->nameId = new NameID($nameId); $this->encryptedNameId = null; } + /** * Did this Assertion contain encrypted Attributes? * @@ -825,20 +865,22 @@ public function hasEncryptedAttributes() return $this->encryptedAttributes !== []; } + /** * Decrypt the assertion attributes. * * @param XMLSecurityKey $key * @param array $blacklist * @throws \Exception + * @return void */ - public function decryptAttributes(XMLSecurityKey $key, array $blacklist = array()) + public function decryptAttributes(XMLSecurityKey $key, array $blacklist = []) { if (!$this->hasEncryptedAttributes()) { return; } $firstAttribute = true; - $attributes = $this->encryptedAttributes; + $attributes = $this->getEncryptedAttributes(); foreach ($attributes as $attributeEnc) { /*Decrypt node <EncryptedAttribute>*/ $attribute = Utils::decryptElement( @@ -868,13 +910,14 @@ public function decryptAttributes(XMLSecurityKey $key, array $blacklist = array( } if (!array_key_exists($name, $this->attributes)) { - $this->attributes[$name] = array(); + $this->attributes[$name] = []; } $this->parseAttributeValue($attribute, $name); } } + /** * Retrieve the earliest timestamp this assertion is valid. * @@ -888,20 +931,23 @@ public function getNotBefore() return $this->notBefore; } + /** * Set the earliest timestamp this assertion can be used. * * Set this to null if no limit is required. * * @param int|null $notBefore The earliest timestamp this assertion is valid. + * @return void */ public function setNotBefore($notBefore) { - assert(is_int($notBefore) || is_null($notBefore)); + Assert::nullOrInteger($notBefore); $this->notBefore = $notBefore; } + /** * Retrieve the expiration timestamp of this assertion. * @@ -915,30 +961,47 @@ public function getNotOnOrAfter() return $this->notOnOrAfter; } + /** * Set the expiration timestamp of this assertion. * * Set this to null if no limit is required. * * @param int|null $notOnOrAfter The latest timestamp this assertion is valid. + * @return void */ public function setNotOnOrAfter($notOnOrAfter) { - assert(is_int($notOnOrAfter) || is_null($notOnOrAfter)); + Assert::nullOrInteger($notOnOrAfter); $this->notOnOrAfter = $notOnOrAfter; } + + /** + * Retrieve $requiredEncAttributes if attributes will be send encrypted + * + * @return boolean Rrue to encrypt attributes in the assertion. + */ + public function getRequiredEncAttributes() + { + return $this->requiredEncAttributes; + } + + /** - * Set $EncryptedAttributes if attributes will send encrypted + * Set $requiredEncAttributes if attributes will be send encrypted * * @param boolean $ea true to encrypt attributes in the assertion. + * @return void */ - public function setEncryptedAttributes($ea) + public function setRequiredEncAttributes($ea) { + Assert::boolean($ea); $this->requiredEncAttributes = $ea; } + /** * Retrieve the audiences that are allowed to receive this assertion. * @@ -951,18 +1014,21 @@ public function getValidAudiences() return $this->validAudiences; } + /** * Set the audiences that are allowed to receive this assertion. * * This may be null, in which case all audiences are allowed. * * @param array|null $validAudiences The allowed audiences. + * @return void */ public function setValidAudiences(array $validAudiences = null) { $this->validAudiences = $validAudiences; } + /** * Retrieve the AuthnInstant of the assertion. * @@ -978,14 +1044,16 @@ public function getAuthnInstant() * Set the AuthnInstant of the assertion. * * @param int|null $authnInstant Timestamp the user was authenticated, or NULL if we don't want an AuthnStatement. + * @return void */ public function setAuthnInstant($authnInstant) { - assert(is_int($authnInstant) || is_null($authnInstant)); + Assert::nullOrInteger($authnInstant); $this->authnInstant = $authnInstant; } + /** * Retrieve the session expiration timestamp. * @@ -999,20 +1067,23 @@ public function getSessionNotOnOrAfter() return $this->sessionNotOnOrAfter; } + /** * Set the session expiration timestamp. * * Set this to null if no limit is required. * * @param int|null $sessionNotOnOrAfter The latest timestamp this session is valid. + * @return void */ public function setSessionNotOnOrAfter($sessionNotOnOrAfter) { - assert(is_int($sessionNotOnOrAfter) || is_null($sessionNotOnOrAfter)); + Assert::nullOrInteger($sessionNotOnOrAfter); $this->sessionNotOnOrAfter = $sessionNotOnOrAfter; } + /** * Retrieve the session index of the user at the IdP. * @@ -1023,6 +1094,7 @@ public function getSessionIndex() return $this->sessionIndex; } + /** * Set the session index of the user at the IdP. * @@ -1030,14 +1102,16 @@ public function getSessionIndex() * session index can be inluded in the assertion. * * @param string|null $sessionIndex The session index of the user at the IdP. + * @return void */ public function setSessionIndex($sessionIndex) { - assert(is_string($sessionIndex) || is_null($sessionIndex)); + Assert::nullOrString($sessionIndex); $this->sessionIndex = $sessionIndex; } + /** * Retrieve the authentication method used to authenticate the user. * @@ -1063,6 +1137,7 @@ public function getAuthnContext() return null; } + /** * Set the authentication method used to authenticate the user. * @@ -1071,12 +1146,14 @@ public function getAuthnContext() * * @deprecated use setAuthnContextClassRef * @param string|null $authnContext The authentication method. + * @return void */ public function setAuthnContext($authnContext) { $this->setAuthnContextClassRef($authnContext); } + /** * Retrieve the authentication method used to authenticate the user. * @@ -1090,6 +1167,7 @@ public function getAuthnContextClassRef() return $this->authnContextClassRef; } + /** * Set the authentication method used to authenticate the user. * @@ -1097,19 +1175,47 @@ public function getAuthnContextClassRef() * included in the assertion. The default is null. * * @param string|null $authnContextClassRef The authentication method. + * @return void */ public function setAuthnContextClassRef($authnContextClassRef) { - assert(is_string($authnContextClassRef) || is_null($authnContextClassRef)); + Assert::nullOrString($authnContextClassRef); $this->authnContextClassRef = $authnContextClassRef; } + + /** + * Retrieve the signature method. + * + * @return string|null The signature method. + */ + public function getSignatureMethod() + { + return $this->signatureMethod; + } + + + /** + * Set the signature method used. + * + * @param string|null $signatureMethod + * @return void + */ + public function setSignatureMethod($signatureMethod) + { + Assert::nullOrString($signatureMethod); + + $this->signatureMethod = $signatureMethod; + } + + /** * Set the authentication context declaration. * * @param \SAML2\XML\Chunk $authnContextDecl * @throws \Exception + * @return void */ public function setAuthnContextDecl(Chunk $authnContextDecl) { @@ -1122,6 +1228,7 @@ public function setAuthnContextDecl(Chunk $authnContextDecl) $this->authnContextDecl = $authnContextDecl; } + /** * Get the authentication context declaration. * @@ -1135,11 +1242,13 @@ public function getAuthnContextDecl() return $this->authnContextDecl; } + /** * Set the authentication context declaration reference. * - * @param string $authnContextDeclRef + * @param string|\SAML2\XML\Chunk $authnContextDeclRef * @throws \Exception + * @return void */ public function setAuthnContextDeclRef($authnContextDeclRef) { @@ -1152,6 +1261,7 @@ public function setAuthnContextDeclRef($authnContextDeclRef) $this->authnContextDeclRef = $authnContextDeclRef; } + /** * Get the authentication context declaration reference. * URI reference that identifies an authentication context declaration. @@ -1165,10 +1275,10 @@ public function getAuthnContextDeclRef() return $this->authnContextDeclRef; } + /** * Retrieve the AuthenticatingAuthority. * - * * @return array */ public function getAuthenticatingAuthority() @@ -1176,17 +1286,19 @@ public function getAuthenticatingAuthority() return $this->AuthenticatingAuthority; } + /** * Set the AuthenticatingAuthority * - * - * @param array. + * @param array + * @return void */ - public function setAuthenticatingAuthority($authenticatingAuthority) + public function setAuthenticatingAuthority(array $authenticatingAuthority) { $this->AuthenticatingAuthority = $authenticatingAuthority; } + /** * Retrieve all attributes. * @@ -1197,16 +1309,37 @@ public function getAttributes() return $this->attributes; } + /** * Replace all attributes. * * @param array $attributes All new attributes, as an associative array. + * @return void */ public function setAttributes(array $attributes) { $this->attributes = $attributes; } + /** + * @return array + */ + public function getSignatureData() + { + return $this->signatureData; + } + + + /** + * @param array|null $signatureData + * @return void + */ + public function setSignatureData(array $signatureData = null) + { + $this->signatureData = $signatureData; + } + + /** * Retrieve all attributes value types. * @@ -1217,16 +1350,19 @@ public function getAttributesValueTypes() return $this->attributesValueTypes; } + /** * Replace all attributes value types.. * * @param array $attributesValueTypes All new attribute value types, as an associative array. + * @return void */ public function setAttributesValueTypes(array $attributesValueTypes) { $this->attributesValueTypes = $attributesValueTypes; } + /** * Retrieve the NameFormat used on all attributes. * @@ -1240,18 +1376,21 @@ public function getAttributeNameFormat() return $this->nameFormat; } + /** * Set the NameFormat used on all attributes. * * @param string $nameFormat The NameFormat used on all attributes. + * @return void */ public function setAttributeNameFormat($nameFormat) { - assert(is_string($nameFormat)); + Assert::string($nameFormat); $this->nameFormat = $nameFormat; } + /** * Retrieve the SubjectConfirmation elements we have in our Subject element. * @@ -1262,16 +1401,42 @@ public function getSubjectConfirmation() return $this->SubjectConfirmation; } + /** * Set the SubjectConfirmation elements that should be included in the assertion. * * @param array $SubjectConfirmation Array of \SAML2\XML\saml\SubjectConfirmation elements. + * @return void */ public function setSubjectConfirmation(array $SubjectConfirmation) { $this->SubjectConfirmation = $SubjectConfirmation; } + + /** + * Retrieve the encryptedAttributes elements we have. + * + * @return array Array of \DOMElement elements. + */ + public function getEncryptedAttributes() + { + return $this->encryptedAttributes; + } + + + /** + * Set the encryptedAttributes elements + * + * @param array $encAttrs Array of \DOMElement elements. + * @return void + */ + public function setEncryptedAttributes(array $encAttrs) + { + $this->encryptedAttributes = $encAttrs; + } + + /** * Retrieve the private key we should use to sign the assertion. * @@ -1282,18 +1447,21 @@ public function getSignatureKey() return $this->signatureKey; } + /** * Set the private key we should use to sign the assertion. * * If the key is null, the assertion will be sent unsigned. * * @param XMLSecurityKey|null $signatureKey + * @return void */ public function setSignatureKey(XMLSecurityKey $signatureKey = null) { $this->signatureKey = $signatureKey; } + /** * Return the key we should use to encrypt the assertion. * @@ -1305,28 +1473,33 @@ public function getEncryptionKey() return $this->encryptionKey; } + /** * Set the private key we should use to encrypt the attributes. * * @param XMLSecurityKey|null $Key + * @return void */ public function setEncryptionKey(XMLSecurityKey $Key = null) { $this->encryptionKey = $Key; } + /** * Set the certificates that should be included in the assertion. * * The certificates should be strings with the PEM encoded data. * * @param array $certificates An array of certificates. + * @return void */ public function setCertificates(array $certificates) { $this->certificates = $certificates; } + /** * Retrieve the certificates that are included in the assertion. * @@ -1337,6 +1510,7 @@ public function getCertificates() return $this->certificates; } + /** * @return bool */ @@ -1345,14 +1519,18 @@ public function getWasSignedAtConstruction() return $this->wasSignedAtConstruction; } + /** - * @return null|string + * @param bool $flag + * @return void */ - public function getSignatureMethod() + public function setWasSignedAtConstruction($flag) { - return $this->signatureMethod; + Assert::boolean($flag); + $this->wasSignedAtConstruction = $flag; } + /** * Convert this assertion to an XML element. * @@ -1368,7 +1546,7 @@ public function toXML(\DOMNode $parentElement = null) $document = $parentElement->ownerDocument; } - $root = $document->createElementNS(Constants::NS_SAML, 'saml:' . 'Assertion'); + $root = $document->createElementNS(Constants::NS_SAML, 'saml:'.'Assertion'); $parentElement->appendChild($root); /* Ugly hack to add another namespace declaration to the root element. */ @@ -1385,14 +1563,14 @@ public function toXML(\DOMNode $parentElement = null) if (is_string($this->issuer)) { $issuer = Utils::addString($root, Constants::NS_SAML, 'saml:Issuer', $this->issuer); - } elseif ($this->issuer instanceof XML\saml\Issuer) { + } elseif ($this->issuer instanceof Issuer) { $issuer = $this->issuer->toXML($root); } $this->addSubject($root); $this->addConditions($root); $this->addAuthnStatement($root); - if ($this->requiredEncAttributes === false) { + if ($this->getRequiredEncAttributes() === false) { $this->addAttributeStatement($root); } else { $this->addEncryptedAttributeStatement($root); @@ -1405,10 +1583,12 @@ public function toXML(\DOMNode $parentElement = null) return $root; } + /** * Add a Subject-node to the assertion. * * @param \DOMElement $root The assertion element we should add the subject to. + * @return void */ private function addSubject(\DOMElement $root) { @@ -1424,7 +1604,7 @@ private function addSubject(\DOMElement $root) if ($this->encryptedNameId === null) { $this->nameId->toXML($subject); } else { - $eid = $subject->ownerDocument->createElementNS(Constants::NS_SAML, 'saml:' . 'EncryptedID'); + $eid = $subject->ownerDocument->createElementNS(Constants::NS_SAML, 'saml:'.'EncryptedID'); $subject->appendChild($eid); $eid->appendChild($subject->ownerDocument->importNode($this->encryptedNameId, true)); } @@ -1439,6 +1619,7 @@ private function addSubject(\DOMElement $root) * Add a Conditions-node to the assertion. * * @param \DOMElement $root The assertion element we should add the conditions to. + * @return void */ private function addConditions(\DOMElement $root) { @@ -1467,6 +1648,7 @@ private function addConditions(\DOMElement $root) * Add a AuthnStatement-node to the assertion. * * @param \DOMElement $root The assertion element we should add the authentication statement to. + * @return void */ private function addAuthnStatement(\DOMElement $root) { @@ -1533,6 +1715,7 @@ private function addAuthnStatement(\DOMElement $root) * Add an AttributeStatement-node to the assertion. * * @param \DOMElement $root The assertion element we should add the subject to. + * @return void */ private function addAttributeStatement(\DOMElement $root) { @@ -1559,7 +1742,7 @@ private function addAttributeStatement(\DOMElement $root) foreach ($values as $eptiValue) { $attributeValue = $document->createElementNS(Constants::NS_SAML, 'saml:AttributeValue'); $attribute->appendChild($attributeValue); - if ($eptiValue instanceof XML\saml\NameID) { + if ($eptiValue instanceof NameID) { $eptiValue->toXML($attributeValue); } elseif ($eptiValue instanceof \DOMNodeList) { $node = $root->ownerDocument->importNode($eptiValue->item(0), true); @@ -1576,7 +1759,7 @@ private function addAttributeStatement(\DOMElement $root) if (is_array($this->attributesValueTypes) && array_key_exists($name, $this->attributesValueTypes)) { $valueTypes = $this->attributesValueTypes[$name]; if (is_array($valueTypes) && count($valueTypes) != count($values)) { - throw new \Exception('Array of value types and array of values have different size for attribute '. var_export($name, true)); + throw new \Exception('Array of value types and array of values have different size for attribute '.var_export($name, true)); } } else { // if no type(s), default behaviour @@ -1634,10 +1817,11 @@ private function addAttributeStatement(\DOMElement $root) * Add an EncryptedAttribute Statement-node to the assertion. * * @param \DOMElement $root The assertion element we should add the Encrypted Attribute Statement to. + * @return void */ private function addEncryptedAttributeStatement(\DOMElement $root) { - if ($this->requiredEncAttributes === false) { + if ($this->getRequiredEncAttributes() === false) { return; } @@ -1653,7 +1837,7 @@ private function addEncryptedAttributeStatement(\DOMElement $root) $document2->appendChild($attribute); if ($this->nameFormat !== Constants::NAMEFORMAT_UNSPECIFIED) { - $attribute->setAttribute('NameFormat', $this->nameFormat); + $attribute->setAttribute('NameFormat', $this->getAttributeNameFormat()); } foreach ($values as $value) { diff --git a/vendor/simplesamlphp/saml2/src/SAML2/Assertion/Decrypter.php b/vendor/simplesamlphp/saml2/src/SAML2/Assertion/Decrypter.php index 4a5a646d5f..a1ec8d5ec5 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/Assertion/Decrypter.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/Assertion/Decrypter.php @@ -31,6 +31,15 @@ class Decrypter */ private $logger; + + /** + * Constructor for Decrypter. + * + * @param LoggerInterface $logger + * @param IdentityProvider $identityProvider + * @param ServiceProvider $serviceProvider + * @param PrivateKeyLoader $privateKeyLoader + */ public function __construct( LoggerInterface $logger, IdentityProvider $identityProvider, @@ -43,8 +52,11 @@ public function __construct( $this->privateKeyLoader = $privateKeyLoader; } + /** * Allows for checking whether either the SP or the IdP requires assertion encryption + * + * @return bool */ public function isEncryptionRequired() { @@ -52,6 +64,7 @@ public function isEncryptionRequired() || $this->serviceProvider->isAssertionEncryptionRequired(); } + /** * @param \SAML2\EncryptedAssertion $assertion * diff --git a/vendor/simplesamlphp/saml2/src/SAML2/Assertion/Processor.php b/vendor/simplesamlphp/saml2/src/SAML2/Assertion/Processor.php index 882d73c309..a2494b052a 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/Assertion/Processor.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/Assertion/Processor.php @@ -55,6 +55,16 @@ class Processor */ private $logger; + + /** + * @param Decrypter $decrypter + * @param Validator $signatureValidator + * @param AssertionValidator $assertionValidator + * @param SubjectConfirmationValidator $subjectConfirmationValidator + * @param Transformer $transformer + * @param IdentityProvider $identityProviderConfiguration + * @param LoggerInterface $logger + */ public function __construct( Decrypter $decrypter, Validator $signatureValidator, @@ -73,9 +83,9 @@ public function __construct( $this->logger = $logger; } + /** * @param \SAML2\Utilities\ArrayCollection $assertions - * * @return \SAML2\Assertion[] Collection (\SAML2\Utilities\ArrayCollection) of processed assertions */ public function processAssertions($assertions) @@ -88,9 +98,9 @@ public function processAssertions($assertions) return $processed; } + /** * @param \SAML2\Assertion|\SAML2\EncryptedAssertion $assertion - * * @return \SAML2\Assertion */ public function process($assertion) @@ -117,9 +127,9 @@ public function process($assertion) return $assertion; } + /** * @param \SAML2\Assertion|\SAML2\EncryptedAssertion $assertion - * * @return \SAML2\Assertion */ private function decryptAssertion($assertion) @@ -135,8 +145,10 @@ private function decryptAssertion($assertion) return $this->decrypter->decrypt($assertion); } + /** * @param \SAML2\Assertion $assertion + * @return void */ public function validateAssertion(Assertion $assertion) { @@ -161,9 +173,9 @@ public function validateAssertion(Assertion $assertion) } } + /** * @param \SAML2\Assertion $assertion - * * @return \SAML2\Assertion */ private function transformAssertion(Assertion $assertion) diff --git a/vendor/simplesamlphp/saml2/src/SAML2/Assertion/ProcessorBuilder.php b/vendor/simplesamlphp/saml2/src/SAML2/Assertion/ProcessorBuilder.php index a2b4baf9fb..f04930cf60 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/Assertion/ProcessorBuilder.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/Assertion/ProcessorBuilder.php @@ -33,6 +33,16 @@ */ class ProcessorBuilder { + /** + * Constructor for ProcessorBuilder + * + * @param LoggerInterface $logger + * @param Validator $signatureValidator + * @param Destination $currentDestination + * @param IdentityProvider $identityProvider + * @param ServiceProvider $serviceProvider + * @param Response $response + */ public static function build( LoggerInterface $logger, Validator $signatureValidator, @@ -69,6 +79,12 @@ public static function build( ); } + + /** + * @param IdentityProvider $identityProvider + * @param ServiceProvider $serviceProvider + * @return AssertionValidator + */ private static function createAssertionValidator( IdentityProvider $identityProvider, ServiceProvider $serviceProvider @@ -82,6 +98,14 @@ private static function createAssertionValidator( return $validator; } + + /** + * @param IdentityProvider $identityProvider + * @param ServiceProvider $serviceProvider + * @param Destination $currentDestination + * @param Response $response + * @return SubjectConfirmationValidator + */ private static function createSubjectConfirmationValidator( IdentityProvider $identityProvider, ServiceProvider $serviceProvider, @@ -112,6 +136,13 @@ private static function createSubjectConfirmationValidator( return $validator; } + /** + * @param LoggerInterface $logger + * @param PrivateKeyLoader $keyLoader + * @param IdentityProvider $identityProvider + * @param ServiceProvider $serviceProvider + * @return TransformerChain + */ private static function createAssertionTransformerChain( LoggerInterface $logger, PrivateKeyLoader $keyloader, diff --git a/vendor/simplesamlphp/saml2/src/SAML2/Assertion/Transformer/DecodeBase64Transformer.php b/vendor/simplesamlphp/saml2/src/SAML2/Assertion/Transformer/DecodeBase64Transformer.php index f8738c0b59..e2522d1828 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/Assertion/Transformer/DecodeBase64Transformer.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/Assertion/Transformer/DecodeBase64Transformer.php @@ -15,11 +15,21 @@ class DecodeBase64Transformer implements */ private $identityProvider; + + /** + * @param IdentityProvider $identityProvider + * @return void + */ public function setIdentityProvider(IdentityProvider $identityProvider) { $this->identityProvider = $identityProvider; } + + /** + * @param Assertion $assertion + * @return Assertion + */ public function transform(Assertion $assertion) { if (!$this->identityProvider->hasBase64EncodedAttributes()) { @@ -28,13 +38,15 @@ public function transform(Assertion $assertion) $attributes = $assertion->getAttributes(); $keys = array_keys($attributes); - $decoded = array_map(array($this, 'decodeValue'), $attributes); + $decoded = array_map([$this, 'decodeValue'], $attributes); $attributes = array_combine($keys, $decoded); $assertion->setAttributes($attributes); + return $assertion; } + /** * @param $value * diff --git a/vendor/simplesamlphp/saml2/src/SAML2/Assertion/Transformer/NameIdDecryptionTransformer.php b/vendor/simplesamlphp/saml2/src/SAML2/Assertion/Transformer/NameIdDecryptionTransformer.php index 6440581617..0f4411523f 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/Assertion/Transformer/NameIdDecryptionTransformer.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/Assertion/Transformer/NameIdDecryptionTransformer.php @@ -36,6 +36,13 @@ class NameIdDecryptionTransformer implements */ private $logger; + + /** + * Constructor for NameIdDecryptionTransformer + * + * @param LoggerInterface $logger + * @param PrivateKeyLoader $privateKeyLoader + */ public function __construct( LoggerInterface $logger, PrivateKeyLoader $privateKeyLoader @@ -44,6 +51,11 @@ public function __construct( $this->privateKeyLoader = $privateKeyLoader; } + + /** + * @param Assertion $assertion + * @return Assertion + */ public function transform(Assertion $assertion) { if (!$assertion->isNameIdEncrypted()) { @@ -79,11 +91,21 @@ public function transform(Assertion $assertion) return $assertion; } + + /** + * @param IdentityProvider $identityProvider + * @return void + */ public function setIdentityProvider(IdentityProvider $identityProvider) { $this->identityProvider = $identityProvider; } + + /** + * @param ServiceProvider $serviceProvider + * @return void + */ public function setServiceProvider(ServiceProvider $serviceProvider) { $this->serviceProvider = $serviceProvider; diff --git a/vendor/simplesamlphp/saml2/src/SAML2/Assertion/Transformer/TransformerChain.php b/vendor/simplesamlphp/saml2/src/SAML2/Assertion/Transformer/TransformerChain.php index 3490bd5c48..8b34d462ed 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/Assertion/Transformer/TransformerChain.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/Assertion/Transformer/TransformerChain.php @@ -13,7 +13,7 @@ class TransformerChain implements Transformer /** * @var \SAML2\Assertion\Transformer\Transformer[] */ - private $transformers = array(); + private $transformers = []; /** * @var \SAML2\Configuration\IdentityProvider @@ -25,6 +25,13 @@ class TransformerChain implements Transformer */ private $serviceProvider; + + /** + * Constructor for TransformerChain + * + * @param IdentityProvider $identityProvider + * @param ServiceProvider $serviceProvider + */ public function __construct( IdentityProvider $identityProvider, ServiceProvider $serviceProvider @@ -33,6 +40,11 @@ public function __construct( $this->serviceProvider = $serviceProvider; } + + /** + * @param Transformer $transformer + * @return void + */ public function addTransformerStep(Transformer $transformer) { if ($transformer instanceof IdentityProviderAware) { @@ -46,6 +58,7 @@ public function addTransformerStep(Transformer $transformer) $this->transformers[] = $transformer; } + /** * @param \SAML2\Assertion $assertion * diff --git a/vendor/simplesamlphp/saml2/src/SAML2/Assertion/Validation/AssertionConstraintValidator.php b/vendor/simplesamlphp/saml2/src/SAML2/Assertion/Validation/AssertionConstraintValidator.php index 1efc08a794..9205ea0307 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/Assertion/Validation/AssertionConstraintValidator.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/Assertion/Validation/AssertionConstraintValidator.php @@ -6,5 +6,10 @@ interface AssertionConstraintValidator { + /** + * @param Assertion $assertion + * @param Result $result + * @return void + */ public function validate(Assertion $assertion, Result $result); } diff --git a/vendor/simplesamlphp/saml2/src/SAML2/Assertion/Validation/AssertionValidator.php b/vendor/simplesamlphp/saml2/src/SAML2/Assertion/Validation/AssertionValidator.php index b39cabfbb9..11da8a261e 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/Assertion/Validation/AssertionValidator.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/Assertion/Validation/AssertionValidator.php @@ -25,6 +25,7 @@ class AssertionValidator */ private $serviceProvider; + /** * @param \SAML2\Configuration\IdentityProvider $identityProvider * @param \SAML2\Configuration\ServiceProvider $serviceProvider @@ -37,6 +38,11 @@ public function __construct( $this->serviceProvider = $serviceProvider; } + + /** + * @param AssertionConstraintValidator $constraint + * @return void + */ public function addConstraintValidator(AssertionConstraintValidator $constraint) { if ($constraint instanceof IdentityProviderAware) { @@ -50,6 +56,11 @@ public function addConstraintValidator(AssertionConstraintValidator $constraint) $this->constraints[] = $constraint; } + + /** + * @param Assertion $assertion + * @return Result + */ public function validate(Assertion $assertion) { $result = new Result(); diff --git a/vendor/simplesamlphp/saml2/src/SAML2/Assertion/Validation/ConstraintValidator/NotBefore.php b/vendor/simplesamlphp/saml2/src/SAML2/Assertion/Validation/ConstraintValidator/NotBefore.php index 197772dbeb..5b9ea6dc75 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/Assertion/Validation/ConstraintValidator/NotBefore.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/Assertion/Validation/ConstraintValidator/NotBefore.php @@ -10,10 +10,15 @@ class NotBefore implements AssertionConstraintValidator { + /** + * @param Assertion $assertion + * @param Result $result + * @return void + */ public function validate(Assertion $assertion, Result $result) { $notBeforeTimestamp = $assertion->getNotBefore(); - if ($notBeforeTimestamp && $notBeforeTimestamp > Temporal::getTime() + 60) { + if (($notBeforeTimestamp !== null) && ($notBeforeTimestamp > (Temporal::getTime() + 60))) { $result->addError( 'Received an assertion that is valid in the future. Check clock synchronization on IdP and SP.' ); diff --git a/vendor/simplesamlphp/saml2/src/SAML2/Assertion/Validation/ConstraintValidator/NotOnOrAfter.php b/vendor/simplesamlphp/saml2/src/SAML2/Assertion/Validation/ConstraintValidator/NotOnOrAfter.php index 38527df78e..83b634ea7d 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/Assertion/Validation/ConstraintValidator/NotOnOrAfter.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/Assertion/Validation/ConstraintValidator/NotOnOrAfter.php @@ -10,10 +10,15 @@ class NotOnOrAfter implements AssertionConstraintValidator { + /** + * @param Assertion $assertion + * @param Result $result + * @return void + */ public function validate(Assertion $assertion, Result $result) { $notValidOnOrAfterTimestamp = $assertion->getNotOnOrAfter(); - if ($notValidOnOrAfterTimestamp && $notValidOnOrAfterTimestamp <= Temporal::getTime() - 60) { + if (($notValidOnOrAfterTimestamp !== null) && ($notValidOnOrAfterTimestamp <= (Temporal::getTime() - 60))) { $result->addError( 'Received an assertion that has expired. Check clock synchronization on IdP and SP.' ); diff --git a/vendor/simplesamlphp/saml2/src/SAML2/Assertion/Validation/ConstraintValidator/SessionNotOnOrAfter.php b/vendor/simplesamlphp/saml2/src/SAML2/Assertion/Validation/ConstraintValidator/SessionNotOnOrAfter.php index 74f9bc4d81..0c9543a9b3 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/Assertion/Validation/ConstraintValidator/SessionNotOnOrAfter.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/Assertion/Validation/ConstraintValidator/SessionNotOnOrAfter.php @@ -10,11 +10,16 @@ class SessionNotOnOrAfter implements AssertionConstraintValidator { + /** + * @param Assertion $assertion + * @param Result $result + * @return void + */ public function validate(Assertion $assertion, Result $result) { $sessionNotOnOrAfterTimestamp = $assertion->getSessionNotOnOrAfter(); $currentTime = Temporal::getTime(); - if ($sessionNotOnOrAfterTimestamp && $sessionNotOnOrAfterTimestamp <= $currentTime - 60) { + if (($sessionNotOnOrAfterTimestamp !== null) && ($sessionNotOnOrAfterTimestamp <= ($currentTime - 60))) { $result->addError( 'Received an assertion with a session that has expired. Check clock synchronization on IdP and SP.' ); diff --git a/vendor/simplesamlphp/saml2/src/SAML2/Assertion/Validation/ConstraintValidator/SpIsValidAudience.php b/vendor/simplesamlphp/saml2/src/SAML2/Assertion/Validation/ConstraintValidator/SpIsValidAudience.php index 0ea473ac3a..75fe7e0b2f 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/Assertion/Validation/ConstraintValidator/SpIsValidAudience.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/Assertion/Validation/ConstraintValidator/SpIsValidAudience.php @@ -17,11 +17,22 @@ class SpIsValidAudience implements */ private $serviceProvider; + + /** + * @param ServiceProvider $serviceProvider + * @return void + */ public function setServiceProvider(ServiceProvider $serviceProvider) { $this->serviceProvider = $serviceProvider; } + + /** + * @param Assertion $assertion + * @param Result $result + * @return void + */ public function validate(Assertion $assertion, Result $result) { $intendedAudiences = $assertion->getValidAudiences(); @@ -30,10 +41,10 @@ public function validate(Assertion $assertion, Result $result) } $entityId = $this->serviceProvider->getEntityId(); - if (!in_array($entityId, $intendedAudiences)) { + if (!in_array($entityId, $intendedAudiences, true)) { $result->addError(sprintf( 'The configured Service Provider [%s] is not a valid audience for the assertion. Audiences: [%s]', - $entityId, + strval($entityId), implode('], [', $intendedAudiences) )); } diff --git a/vendor/simplesamlphp/saml2/src/SAML2/Assertion/Validation/ConstraintValidator/SubjectConfirmationMethod.php b/vendor/simplesamlphp/saml2/src/SAML2/Assertion/Validation/ConstraintValidator/SubjectConfirmationMethod.php index 28523685ac..a0ea751e19 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/Assertion/Validation/ConstraintValidator/SubjectConfirmationMethod.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/Assertion/Validation/ConstraintValidator/SubjectConfirmationMethod.php @@ -10,6 +10,11 @@ class SubjectConfirmationMethod implements SubjectConfirmationConstraintValidator { + /** + * @param SubjectConfirmation $subjectConfirmation + * @param Result $result + * @return void + */ public function validate( SubjectConfirmation $subjectConfirmation, Result $result diff --git a/vendor/simplesamlphp/saml2/src/SAML2/Assertion/Validation/ConstraintValidator/SubjectConfirmationNotBefore.php b/vendor/simplesamlphp/saml2/src/SAML2/Assertion/Validation/ConstraintValidator/SubjectConfirmationNotBefore.php index 41f72ba425..3642d7ae9a 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/Assertion/Validation/ConstraintValidator/SubjectConfirmationNotBefore.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/Assertion/Validation/ConstraintValidator/SubjectConfirmationNotBefore.php @@ -10,11 +10,16 @@ class SubjectConfirmationNotBefore implements SubjectConfirmationConstraintValidator { + /** + * @param SubjectConfirmation $subjectConfirmation + * @param Result $result + * @return void + */ public function validate( SubjectConfirmation $subjectConfirmation, Result $result ) { - $notBefore = $subjectConfirmation->SubjectConfirmationData->NotBefore; + $notBefore = $subjectConfirmation->getSubjectConfirmationData()->getNotBefore(); if ($notBefore && $notBefore > Temporal::getTime() + 60) { $result->addError('NotBefore in SubjectConfirmationData is in the future'); } diff --git a/vendor/simplesamlphp/saml2/src/SAML2/Assertion/Validation/ConstraintValidator/SubjectConfirmationNotOnOrAfter.php b/vendor/simplesamlphp/saml2/src/SAML2/Assertion/Validation/ConstraintValidator/SubjectConfirmationNotOnOrAfter.php index 43262b1d03..4a0fb076aa 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/Assertion/Validation/ConstraintValidator/SubjectConfirmationNotOnOrAfter.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/Assertion/Validation/ConstraintValidator/SubjectConfirmationNotOnOrAfter.php @@ -10,11 +10,16 @@ class SubjectConfirmationNotOnOrAfter implements SubjectConfirmationConstraintValidator { + /** + * @param SubjectConfirmation $subjectConfirmation + * @param Result $result + * @return void + */ public function validate( SubjectConfirmation $subjectConfirmation, Result $result ) { - $notOnOrAfter = $subjectConfirmation->SubjectConfirmationData->NotOnOrAfter; + $notOnOrAfter = $subjectConfirmation->getSubjectConfirmationData()->getNotOnOrAfter(); if ($notOnOrAfter && $notOnOrAfter <= Temporal::getTime() - 60) { $result->addError('NotOnOrAfter in SubjectConfirmationData is in the past'); } diff --git a/vendor/simplesamlphp/saml2/src/SAML2/Assertion/Validation/ConstraintValidator/SubjectConfirmationRecipientMatches.php b/vendor/simplesamlphp/saml2/src/SAML2/Assertion/Validation/ConstraintValidator/SubjectConfirmationRecipientMatches.php index 140ab969a2..81b5002205 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/Assertion/Validation/ConstraintValidator/SubjectConfirmationRecipientMatches.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/Assertion/Validation/ConstraintValidator/SubjectConfirmationRecipientMatches.php @@ -15,16 +15,27 @@ class SubjectConfirmationRecipientMatches implements */ private $destination; + + /** + * Constructor for SubjectConfirmationRecipientMatches + * @param Destination $destination + */ public function __construct(Destination $destination) { $this->destination = $destination; } + + /** + * @param SubjectConfirmation + * @param Result $result + * @return void + */ public function validate( SubjectConfirmation $subjectConfirmation, Result $result ) { - $recipient = $subjectConfirmation->SubjectConfirmationData->Recipient; + $recipient = $subjectConfirmation->getSubjectConfirmationData()->getRecipient(); if ($recipient && !$this->destination->equals(new Destination($recipient))) { $result->addError(sprintf( 'Recipient in SubjectConfirmationData ("%s") does not match the current destination ("%s")', diff --git a/vendor/simplesamlphp/saml2/src/SAML2/Assertion/Validation/ConstraintValidator/SubjectConfirmationResponseToMatches.php b/vendor/simplesamlphp/saml2/src/SAML2/Assertion/Validation/ConstraintValidator/SubjectConfirmationResponseToMatches.php index 91db324fec..99dd5d9e1e 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/Assertion/Validation/ConstraintValidator/SubjectConfirmationResponseToMatches.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/Assertion/Validation/ConstraintValidator/SubjectConfirmationResponseToMatches.php @@ -10,27 +10,43 @@ class SubjectConfirmationResponseToMatches implements SubjectConfirmationConstraintValidator { + /** @var Response */ private $response; + + /** + * Constructor for SubjectConfirmationResponseToMatches + * @param Response $response + */ public function __construct(Response $response) { $this->response = $response; } + + /** + * @param SubjectConfirmation + * @param Result $result + * @return void + */ public function validate( SubjectConfirmation $subjectConfirmation, Result $result ) { - $inResponseTo = $subjectConfirmation->SubjectConfirmationData->InResponseTo; - if ($inResponseTo && $this->getInResponseTo() && $this->getInResponseTo() !== $inResponseTo) { + $inResponseTo = $subjectConfirmation->getSubjectConfirmationData()->getInResponseTo(); + if ($inResponseTo && ($this->getInResponseTo() !== false) && ($this->getInResponseTo() !== $inResponseTo)) { $result->addError(sprintf( 'InResponseTo in SubjectConfirmationData ("%s") does not match the Response InResponseTo ("%s")', $inResponseTo, - $this->getInResponseTo() + strval($this->getInResponseTo()) )); } } + + /** + * @return string|bool + */ private function getInResponseTo() { $inResponseTo = $this->response->getInResponseTo(); diff --git a/vendor/simplesamlphp/saml2/src/SAML2/Assertion/Validation/Result.php b/vendor/simplesamlphp/saml2/src/SAML2/Assertion/Validation/Result.php index bc4116bb3e..17bb319466 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/Assertion/Validation/Result.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/Assertion/Validation/Result.php @@ -12,10 +12,12 @@ class Result /** * @var array */ - private $errors = array(); + private $errors = []; + /** * @param $message + * @return void */ public function addError($message) { @@ -26,6 +28,7 @@ public function addError($message) $this->errors[] = $message; } + /** * @return bool */ @@ -34,6 +37,7 @@ public function isValid() return empty($this->errors); } + /** * @return array */ diff --git a/vendor/simplesamlphp/saml2/src/SAML2/Assertion/Validation/SubjectConfirmationConstraintValidator.php b/vendor/simplesamlphp/saml2/src/SAML2/Assertion/Validation/SubjectConfirmationConstraintValidator.php index 18b624cf29..02759290f6 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/Assertion/Validation/SubjectConfirmationConstraintValidator.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/Assertion/Validation/SubjectConfirmationConstraintValidator.php @@ -6,6 +6,11 @@ interface SubjectConfirmationConstraintValidator { + /** + * @param SubjectConfirmation $subjectConfirmation + * @param Result $result + * @return void + */ public function validate( SubjectConfirmation $subjectConfirmation, Result $result diff --git a/vendor/simplesamlphp/saml2/src/SAML2/Assertion/Validation/SubjectConfirmationValidator.php b/vendor/simplesamlphp/saml2/src/SAML2/Assertion/Validation/SubjectConfirmationValidator.php index bbd5ba9827..7e65d4105a 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/Assertion/Validation/SubjectConfirmationValidator.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/Assertion/Validation/SubjectConfirmationValidator.php @@ -25,6 +25,13 @@ class SubjectConfirmationValidator */ protected $serviceProvider; + + /** + * Constructor for SubjectConfirmationValidator + * + * @param IdentityProvider $identityProvider + * @param ServiceProvider $serviceProvider + */ public function __construct( IdentityProvider $identityProvider, ServiceProvider $serviceProvider @@ -33,6 +40,11 @@ public function __construct( $this->serviceProvider = $serviceProvider; } + + /** + * @param SubjectConfirmationConstraintValidator $constraint + * @return void + */ public function addConstraintValidator( SubjectConfirmationConstraintValidator $constraint ) { @@ -47,6 +59,11 @@ public function addConstraintValidator( $this->constraints[] = $constraint; } + + /** + * @param SubjectConfirmation $subjectConfirmation + * @return Result + */ public function validate(SubjectConfirmation $subjectConfirmation) { $result = new Result(); diff --git a/vendor/simplesamlphp/saml2/src/SAML2/AttributeQuery.php b/vendor/simplesamlphp/saml2/src/SAML2/AttributeQuery.php index e11bc211aa..170f29e7bf 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/AttributeQuery.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/AttributeQuery.php @@ -2,6 +2,8 @@ namespace SAML2; +use Webmozart\Assert\Assert; + /** * Class for SAML 2 attribute query messages. * @@ -36,6 +38,7 @@ class AttributeQuery extends SubjectQuery */ private $nameFormat; + /** * Constructor for SAML 2 attribute query messages. * @@ -46,7 +49,7 @@ public function __construct(\DOMElement $xml = null) { parent::__construct('AttributeQuery', $xml); - $this->attributes = array(); + $this->attributes = []; $this->nameFormat = Constants::NAMEFORMAT_UNSPECIFIED; if ($xml === null) { @@ -77,7 +80,7 @@ public function __construct(\DOMElement $xml = null) } if (!array_key_exists($name, $this->attributes)) { - $this->attributes[$name] = array(); + $this->attributes[$name] = []; } $values = Utils::xpQuery($attribute, './saml_assertion:AttributeValue'); @@ -87,6 +90,7 @@ public function __construct(\DOMElement $xml = null) } } + /** * Retrieve all requested attributes. * @@ -97,16 +101,19 @@ public function getAttributes() return $this->attributes; } + /** * Set all requested attributes. * * @param array $attributes All requested attributes, as an associative array. + * @return void */ public function setAttributes(array $attributes) { $this->attributes = $attributes; } + /** * Retrieve the NameFormat used on all attributes. * @@ -120,18 +127,21 @@ public function getAttributeNameFormat() return $this->nameFormat; } + /** * Set the NameFormat used on all attributes. * * @param string $nameFormat The NameFormat used on all attributes. + * @return void */ public function setAttributeNameFormat($nameFormat) { - assert(is_string($nameFormat)); + Assert::string($nameFormat); $this->nameFormat = $nameFormat; } + /** * Convert the attribute query message to an XML element. * @@ -159,7 +169,7 @@ public function toUnsignedXML() $type = null; } - $attributeValue = Utils::addString($attribute, Constants::NS_SAML, 'saml:AttributeValue', $value); + $attributeValue = Utils::addString($attribute, Constants::NS_SAML, 'saml:AttributeValue', strval($value)); if ($type !== null) { $attributeValue->setAttributeNS(Constants::NS_XSI, 'xsi:type', $type); } diff --git a/vendor/simplesamlphp/saml2/src/SAML2/AuthnRequest.php b/vendor/simplesamlphp/saml2/src/SAML2/AuthnRequest.php index c2c3a827d3..8ce7f69275 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/AuthnRequest.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/AuthnRequest.php @@ -4,8 +4,10 @@ use RobRichards\XMLSecLibs\XMLSecEnc; use RobRichards\XMLSecLibs\XMLSecurityKey; +use SAML2\XML\saml\NameID; use SAML2\XML\saml\SubjectConfirmation; use SAML2\Exception\InvalidArgumentException; +use Webmozart\Assert\Assert; /** * Class for SAML 2 authentication request messages. @@ -28,7 +30,6 @@ class AuthnRequest extends Request */ private $forceAuthn; - /** * Optional ProviderID attribute * @@ -36,11 +37,10 @@ class AuthnRequest extends Request */ private $ProviderName; - /** * Set to true if this request is passive. * - * @var bool. + * @var bool */ private $isPassive; @@ -49,7 +49,7 @@ class AuthnRequest extends Request * * @var array */ - private $IDPList = array(); + private $IDPList = []; /** * The ProxyCount in this request's scoping element @@ -64,7 +64,7 @@ class AuthnRequest extends Request * @var array */ - private $RequesterID = array(); + private $RequesterID = []; /** * The URL of the asertion consumer service where the response should be delivered. @@ -73,7 +73,6 @@ class AuthnRequest extends Request */ private $assertionConsumerServiceURL; - /** * What binding should be used when sending the response. * @@ -81,7 +80,6 @@ class AuthnRequest extends Request */ private $protocolBinding; - /** * The index of the AttributeConsumingService. * @@ -96,7 +94,6 @@ class AuthnRequest extends Request */ private $assertionConsumerServiceIndex; - /** * What authentication context was requested. * @@ -108,10 +105,17 @@ class AuthnRequest extends Request */ private $requestedAuthnContext; + /** + * Audiences to send in the request. + * + * @var array + */ + private $audiences = []; + /** * @var \SAML2\XML\saml\SubjectConfirmation[] */ - private $subjectConfirmation = array(); + private $subjectConfirmation = []; /** * @var string @@ -123,6 +127,7 @@ class AuthnRequest extends Request */ private $nameId; + /** * Constructor for SAML 2 authentication request messages. * @@ -133,7 +138,7 @@ public function __construct(\DOMElement $xml = null) { parent::__construct('AuthnRequest', $xml); - $this->nameIdPolicy = array(); + $this->nameIdPolicy = []; $this->forceAuthn = false; $this->isPassive = false; @@ -168,12 +173,14 @@ public function __construct(\DOMElement $xml = null) $this->parseNameIdPolicy($xml); $this->parseRequestedAuthnContext($xml); $this->parseScoping($xml); + $this->parseConditions($xml); } + /** * @param $xml - * * @throws \Exception + * @return void */ private function parseSubject(\DOMElement $xml) { @@ -201,7 +208,7 @@ private function parseSubject(\DOMElement $xml) /* The NameID element is encrypted. */ $this->encryptedNameId = $nameId; } else { - $this->nameId = new XML\saml\NameID($nameId); + $this->nameId = new NameID($nameId); } $subjectConfirmation = Utils::xpQuery($subject, './saml_assertion:SubjectConfirmation'); @@ -210,10 +217,11 @@ private function parseSubject(\DOMElement $xml) } } + /** * @param \DOMElement $xml - * * @throws \Exception + * @return void */ protected function parseNameIdPolicy(\DOMElement $xml) { @@ -234,8 +242,10 @@ protected function parseNameIdPolicy(\DOMElement $xml) } } + /** * @param \DOMElement $xml + * @return void */ protected function parseRequestedAuthnContext(\DOMElement $xml) { @@ -246,10 +256,10 @@ protected function parseRequestedAuthnContext(\DOMElement $xml) $requestedAuthnContext = $requestedAuthnContext[0]; - $rac = array( - 'AuthnContextClassRef' => array(), + $rac = [ + 'AuthnContextClassRef' => [], 'Comparison' => Constants::COMPARISON_EXACT, - ); + ]; $accr = Utils::xpQuery($requestedAuthnContext, './saml_assertion:AuthnContextClassRef'); foreach ($accr as $i) { @@ -263,10 +273,11 @@ protected function parseRequestedAuthnContext(\DOMElement $xml) $this->requestedAuthnContext = $rac; } + /** * @param \DOMElement $xml - * * @throws \Exception + * @return void */ protected function parseScoping(\DOMElement $xml) { @@ -295,6 +306,33 @@ protected function parseScoping(\DOMElement $xml) } } + + /** + * @param \DOMElement $xml + * @return void + */ + protected function parseConditions(\DOMElement $xml) + { + $conditions = Utils::xpQuery($xml, './saml_assertion:Conditions'); + if (empty($conditions)) { + return; + } + $conditions = $conditions[0]; + + $ar = Utils::xpQuery($conditions, './saml_assertion:AudienceRestriction'); + if (empty($ar)) { + return; + } + $ar = $ar[0]; + + $audiences = Utils::xpQuery($ar, './saml_assertion:Audience'); + $this->audiences = array(); + foreach ($audiences as $a) { + $this->audiences[] = trim($a->textContent); + } + } + + /** * Retrieve the NameIdPolicy. * @@ -316,6 +354,7 @@ public function getNameIdPolicy() * - 'AllowCreate' (bool) * * @param array $nameIdPolicy The NameIDPolicy. + * @return void */ public function setNameIdPolicy(array $nameIdPolicy) { @@ -348,10 +387,11 @@ public function getForceAuthn() * Set the value of the ForceAuthn attribute. * * @param bool $forceAuthn The ForceAuthn attribute. + * @return void */ public function setForceAuthn($forceAuthn) { - assert(is_bool($forceAuthn)); + Assert::boolean($forceAuthn); $this->forceAuthn = $forceAuthn; } @@ -372,10 +412,11 @@ public function getProviderName() * Set the value of the ProviderName attribute. * * @param string $ProviderName The ProviderName attribute. + * @return void */ public function setProviderName($ProviderName) { - assert(is_string($ProviderName)); + Assert::string($ProviderName); $this->ProviderName = $ProviderName; } @@ -396,15 +437,41 @@ public function getIsPassive() * Set the value of the IsPassive attribute. * * @param bool $isPassive The IsPassive attribute. + * @return void */ public function setIsPassive($isPassive) { - assert(is_bool($isPassive)); + Assert::boolean($isPassive); $this->isPassive = $isPassive; } + /** + * Retrieve the audiences from the request. + * This may be null, in which case no audience is included. + * + * @return array The audiences. + */ + public function getAudiences() + { + return $this->audiences; + } + + + /** + * Set the audiences to send in the request. + * This may be null, in which case no audience will be sent. + * + * @param array|null $audiences The audiences. + * @return void + */ + public function setAudiences(array $audiences) + { + $this->audiences = $audiences; + } + + /** * This function sets the scoping for the request. * See Core 3.4.1.2 for the definition of scoping. @@ -417,10 +484,12 @@ public function setIsPassive($isPassive) * For backward compatibility, an idpEntries can also * be a string instead of an array, where each string * is mapped to the value of attribute ProviderID. + * + * @param array $IDPList List of idpEntries to scope the request to. + * @return void */ - public function setIDPList($IDPList) + public function setIDPList(array $IDPList) { - assert(is_array($IDPList)); $this->IDPList = $IDPList; } @@ -428,6 +497,7 @@ public function setIDPList($IDPList) /** * This function retrieves the list of providerIDs from this authentication request. * Currently we only support a list of ipd ientity id's. + * * @return array List of idp EntityIDs from the request */ public function getIDPList() @@ -435,31 +505,37 @@ public function getIDPList() return $this->IDPList; } + /** * @param int $ProxyCount + * @return void */ public function setProxyCount($ProxyCount) { - assert(is_int($ProxyCount)); + Assert::integer($ProxyCount); $this->ProxyCount = $ProxyCount; } + /** - * @return int + * @return int|null */ public function getProxyCount() { return $this->ProxyCount; } + /** * @param array $RequesterID + * @return void */ public function setRequesterID(array $RequesterID) { $this->RequesterID = $RequesterID; } + /** * @return array */ @@ -468,6 +544,7 @@ public function getRequesterID() return $this->RequesterID; } + /** * Retrieve the value of the AssertionConsumerServiceURL attribute. * @@ -478,18 +555,21 @@ public function getAssertionConsumerServiceURL() return $this->assertionConsumerServiceURL; } + /** * Set the value of the AssertionConsumerServiceURL attribute. * * @param string|null $assertionConsumerServiceURL The AssertionConsumerServiceURL attribute. + * @return void */ public function setAssertionConsumerServiceURL($assertionConsumerServiceURL) { - assert(is_string($assertionConsumerServiceURL) || is_null($assertionConsumerServiceURL)); + Assert::nullOrString($assertionConsumerServiceURL); $this->assertionConsumerServiceURL = $assertionConsumerServiceURL; } + /** * Retrieve the value of the ProtocolBinding attribute. * @@ -500,18 +580,21 @@ public function getProtocolBinding() return $this->protocolBinding; } + /** * Set the value of the ProtocolBinding attribute. * * @param string $protocolBinding The ProtocolBinding attribute. + * @return void */ public function setProtocolBinding($protocolBinding) { - assert(is_string($protocolBinding) || is_null($protocolBinding)); + Assert::nullOrString($protocolBinding); $this->protocolBinding = $protocolBinding; } + /** * Retrieve the value of the AttributeConsumingServiceIndex attribute. * @@ -522,18 +605,21 @@ public function getAttributeConsumingServiceIndex() return $this->attributeConsumingServiceIndex; } + /** * Set the value of the AttributeConsumingServiceIndex attribute. * * @param int|null $attributeConsumingServiceIndex The AttributeConsumingServiceIndex attribute. + * @return void */ public function setAttributeConsumingServiceIndex($attributeConsumingServiceIndex) { - assert(is_int($attributeConsumingServiceIndex) || is_null($attributeConsumingServiceIndex)); + Assert::nullOrInteger($attributeConsumingServiceIndex); $this->attributeConsumingServiceIndex = $attributeConsumingServiceIndex; } + /** * Retrieve the value of the AssertionConsumerServiceIndex attribute. * @@ -544,18 +630,21 @@ public function getAssertionConsumerServiceIndex() return $this->assertionConsumerServiceIndex; } + /** * Set the value of the AssertionConsumerServiceIndex attribute. * * @param int|null $assertionConsumerServiceIndex The AssertionConsumerServiceIndex attribute. + * @return void */ public function setAssertionConsumerServiceIndex($assertionConsumerServiceIndex) { - assert(is_int($assertionConsumerServiceIndex) || is_null($assertionConsumerServiceIndex)); + Assert::nullOrString($assertionConsumerServiceIndex); $this->assertionConsumerServiceIndex = $assertionConsumerServiceIndex; } + /** * Retrieve the RequestedAuthnContext. * @@ -566,23 +655,24 @@ public function getRequestedAuthnContext() return $this->requestedAuthnContext; } + /** * Set the RequestedAuthnContext. * - * @param array|null $requestedAuthnContext The RequestedAuthnContext. + * @param array $requestedAuthnContext The RequestedAuthnContext. + * @return void */ - public function setRequestedAuthnContext($requestedAuthnContext) + public function setRequestedAuthnContext(array $requestedAuthnContext) { - assert(is_array($requestedAuthnContext) || is_null($requestedAuthnContext)); - $this->requestedAuthnContext = $requestedAuthnContext; } + /** * Retrieve the NameId of the subject in the assertion. * - * @return \SAML2\XML\saml\NameID|null The name identifier of the assertion. * @throws \Exception + * @return \SAML2\XML\saml\NameID|null The name identifier of the assertion. */ public function getNameId() { @@ -593,25 +683,29 @@ public function getNameId() return $this->nameId; } + /** * Set the NameId of the subject in the assertion. * * @param \SAML2\XML\saml\NameID|null $nameId The name identifier of the assertion. + * @return void */ public function setNameId($nameId) { - assert(is_array($nameId) || is_null($nameId) || $nameId instanceof XML\saml\NameID); + Assert::true(is_array($nameId) || is_null($nameId) || $nameId instanceof NameID); if (is_array($nameId)) { - $nameId = XML\saml\NameID::fromArray($nameId); + $nameId = NameID::fromArray($nameId); } $this->nameId = $nameId; } + /** * Encrypt the NameID in the AuthnRequest. * * @param XMLSecurityKey $key The encryption key. + * @return void */ public function encryptNameId(XMLSecurityKey $key) { @@ -636,16 +730,18 @@ public function encryptNameId(XMLSecurityKey $key) $enc->encryptKey($key, $symmetricKey); $this->encryptedNameId = $enc->encryptNode($symmetricKey); - $this->nameId = null; + $this->nameId = null; } + /** * Decrypt the NameId of the subject in the assertion. * * @param XMLSecurityKey $key The decryption key. * @param array $blacklist Blacklisted decryption algorithms. + * @return void */ - public function decryptNameId(XMLSecurityKey $key, array $blacklist = array()) + public function decryptNameId(XMLSecurityKey $key, array $blacklist = []) { if ($this->encryptedNameId === null) { /* No NameID to decrypt. */ @@ -654,11 +750,12 @@ public function decryptNameId(XMLSecurityKey $key, array $blacklist = array()) $nameId = Utils::decryptElement($this->encryptedNameId, $key, $blacklist); Utils::getContainer()->debugMessage($nameId, 'decrypt'); - $this->nameId = new XML\saml\NameID($nameId); + $this->nameId = new NameID($nameId); $this->encryptedNameId = null; } + /** * Retrieve the SubjectConfirmation elements we have in our Subject element. * @@ -669,16 +766,19 @@ public function getSubjectConfirmation() return $this->subjectConfirmation; } + /** * Set the SubjectConfirmation elements that should be included in the assertion. * * @param array \SAML2\XML\saml\SubjectConfirmation[] + * @return void */ public function setSubjectConfirmation(array $subjectConfirmation) { $this->subjectConfirmation = $subjectConfirmation; } + /** * Convert this authentication request to an XML element. * @@ -731,6 +831,8 @@ public function toUnsignedXML() $root->appendChild($nameIdPolicy); } + $this->addConditions($root); + $rac = $this->requestedAuthnContext; if (!empty($rac) && !empty($rac['AuthnContextClassRef'])) { $e = $this->document->createElementNS(Constants::NS_SAMLP, 'RequestedAuthnContext'); @@ -757,11 +859,11 @@ public function toUnsignedXML() $idpEntry->setAttribute('ProviderID', $provider); } elseif (is_array($provider)) { foreach ($provider as $attribute => $value) { - if (in_array($attribute, array( + if (in_array($attribute, [ 'ProviderID', 'Loc', 'Name' - ))) { + ], true)) { $idpEntry->setAttribute($attribute, $value); } } @@ -778,10 +880,12 @@ public function toUnsignedXML() return $root; } + /** * Add a Subject-node to the assertion. * * @param \DOMElement $root The assertion element we should add the subject to. + * @return void */ private function addSubject(\DOMElement $root) { @@ -805,4 +909,26 @@ private function addSubject(\DOMElement $root) $sc->toXML($subject); } } + + + /** + * Add a Conditions-node to the request. + * + * @param \DOMElement $root The request element we should add the conditions to. + * @return void + */ + private function addConditions(\DOMElement $root) + { + if ($this->audiences !== []) { + $document = $root->ownerDocument; + + $conditions = $document->createElementNS(Constants::NS_SAML, 'saml:Conditions'); + $root->appendChild($conditions); + + $ar = $document->createElementNS(Constants::NS_SAML, 'saml:AudienceRestriction'); + $conditions->appendChild($ar); + + Utils::addStrings($ar, Constants::NS_SAML, 'saml:Audience', false, $this->getAudiences()); + } + } } diff --git a/vendor/simplesamlphp/saml2/src/SAML2/Binding.php b/vendor/simplesamlphp/saml2/src/SAML2/Binding.php index 21d2f35723..a4a38fca28 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/Binding.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/Binding.php @@ -2,6 +2,8 @@ namespace SAML2; +use Webmozart\Assert\Assert; + /** * Base class for SAML 2 bindings. * @@ -16,18 +18,19 @@ abstract class Binding */ protected $destination; + /** * Retrieve a binding with the given URN. * * Will throw an exception if it is unable to locate the binding. * - * @param string $urn The URN of the binding. - * @return \SAML2\Binding The binding. + * @param string $urn The URN of the binding. * @throws \Exception + * @return \SAML2\Binding The binding. */ public static function getBinding($urn) { - assert(is_string($urn)); + Assert::string($urn); switch ($urn) { case Constants::BINDING_HTTP_POST: @@ -44,10 +47,11 @@ public static function getBinding($urn) case Constants::BINDING_PAOS: return new SOAP(); default: - throw new \Exception('Unsupported binding: ' . var_export($urn, true)); + throw new \Exception('Unsupported binding: '.var_export($urn, true)); } } + /** * Guess the current binding. * @@ -56,8 +60,8 @@ public static function getBinding($urn) * * An exception will be thrown if it is unable to guess the binding. * - * @return \SAML2\Binding The binding. * @throws \Exception + * @return \SAML2\Binding The binding. */ public static function getCurrentBinding() { @@ -90,20 +94,21 @@ public static function getCurrentBinding() $logger = Utils::getContainer()->getLogger(); $logger->warning('Unable to find the SAML 2 binding used for this request.'); - $logger->warning('Request method: ' . var_export($_SERVER['REQUEST_METHOD'], true)); + $logger->warning('Request method: '.var_export($_SERVER['REQUEST_METHOD'], true)); if (!empty($_GET)) { - $logger->warning("GET parameters: '" . implode("', '", array_map('addslashes', array_keys($_GET))) . "'"); + $logger->warning("GET parameters: '".implode("', '", array_map('addslashes', array_keys($_GET)))."'"); } if (!empty($_POST)) { - $logger->warning("POST parameters: '" . implode("', '", array_map('addslashes', array_keys($_POST))) . "'"); + $logger->warning("POST parameters: '".implode("', '", array_map('addslashes', array_keys($_POST)))."'"); } if (isset($_SERVER['CONTENT_TYPE'])) { - $logger->warning('Content-Type: ' . var_export($_SERVER['CONTENT_TYPE'], true)); + $logger->warning('Content-Type: '.var_export($_SERVER['CONTENT_TYPE'], true)); } throw new \Exception('Unable to find the current binding.'); } + /** * Retrieve the destination of a message. * @@ -114,20 +119,23 @@ public function getDestination() return $this->destination; } + /** * Override the destination of a message. * * Set to null to use the destination set in the message. * * @param string|null $destination The destination the message should be delivered to. + * @return void */ public function setDestination($destination) { - assert(is_string($destination) || is_null($destination)); + Assert::nullOrString($destination); $this->destination = $destination; } + /** * Send a SAML 2 message. * @@ -135,9 +143,11 @@ public function setDestination($destination) * The message will be delivered to the destination set in the message. * * @param \SAML2\Message $message The message which should be sent. + * @return void */ abstract public function send(Message $message); + /** * Receive a SAML 2 message. * diff --git a/vendor/simplesamlphp/saml2/src/SAML2/Certificate/Fingerprint.php b/vendor/simplesamlphp/saml2/src/SAML2/Certificate/Fingerprint.php index f42e4dc5df..89a0a916bf 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/Certificate/Fingerprint.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/Certificate/Fingerprint.php @@ -16,6 +16,7 @@ class Fingerprint */ private $contents; + /** * @param string $fingerPrint * @@ -30,6 +31,7 @@ public function __construct($fingerPrint) $this->contents = $fingerPrint; } + /** * Get the raw, unmodified fingerprint value. * @@ -40,6 +42,7 @@ public function getRaw() return $this->contents; } + /** * @return string */ @@ -48,9 +51,9 @@ public function getNormalized() return strtolower(str_replace(':', '', $this->contents)); } + /** * @param \SAML2\Certificate\Fingerprint $fingerprint - * * @return bool */ public function equals(Fingerprint $fingerprint) diff --git a/vendor/simplesamlphp/saml2/src/SAML2/Certificate/FingerprintCollection.php b/vendor/simplesamlphp/saml2/src/SAML2/Certificate/FingerprintCollection.php index 1d80afcd89..1926663ce8 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/Certificate/FingerprintCollection.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/Certificate/FingerprintCollection.php @@ -15,6 +15,7 @@ class FingerprintCollection extends ArrayCollection * Add a key to the collection * * @param \SAML2\Certificate\Fingerprint $fingerprint + * @return void * * @deprecated */ @@ -30,9 +31,9 @@ public function add($fingerprint) parent::add($fingerprint); } + /** * @param \SAML2\Certificate\Fingerprint $otherFingerprint - * * @return bool * * @deprecated diff --git a/vendor/simplesamlphp/saml2/src/SAML2/Certificate/FingerprintLoader.php b/vendor/simplesamlphp/saml2/src/SAML2/Certificate/FingerprintLoader.php index 26a63e1f09..98d2b53a21 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/Certificate/FingerprintLoader.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/Certificate/FingerprintLoader.php @@ -14,7 +14,6 @@ class FingerprintLoader * Static method mainly for BC, should be replaced with DI. * * @param \SAML2\Configuration\CertificateProvider $configuration - * * @return \SAML2\Certificate\FingerprintCollection * * @deprecated @@ -26,11 +25,11 @@ public static function loadFromConfiguration(CertificateProvider $configuration) return $loader->loadFingerprints($configuration); } + /** * Loads the fingerprints from a configurationValue * * @param \SAML2\Configuration\CertificateProvider $configuration - * * @return \SAML2\Certificate\FingerprintCollection * * @deprecated diff --git a/vendor/simplesamlphp/saml2/src/SAML2/Certificate/Key.php b/vendor/simplesamlphp/saml2/src/SAML2/Certificate/Key.php index 98e14715c5..51784b797f 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/Certificate/Key.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/Certificate/Key.php @@ -18,7 +18,8 @@ class Key implements \ArrayAccess /** * @var array */ - protected $keyData = array(); + protected $keyData = []; + /** * @param array $keyData @@ -31,6 +32,7 @@ public function __construct(array $keyData) } } + /** * Whether or not the key is configured to be used for usage given * @@ -39,61 +41,80 @@ public function __construct(array $keyData) */ public function canBeUsedFor($usage) { - if (!in_array($usage, static::getValidKeyUsages())) { + if (!in_array($usage, static::getValidKeyUsages(), true)) { throw new InvalidKeyUsageException($usage); } return isset($this->keyData[$usage]) && $this->keyData[$usage]; } + /** * Returns the list of valid key usage options * @return array */ public static function getValidKeyUsages() { - return array( + return [ self::USAGE_ENCRYPTION, self::USAGE_SIGNING - ); + ]; } + + /** + * @param mixed $offset + * @throws InvalidArgumentException + * @return bool + */ public function offsetExists($offset) { + if (!is_string($offset)) { + throw InvalidArgumentException::invalidType('string', $offset); + } return array_key_exists($offset, $this->keyData); } + + /** + * @param mixed $offset + * @throws InvalidArgumentException + * @return string + */ public function offsetGet($offset) { - $this->assertIsString($offset); - + if (!is_string($offset)) { + throw InvalidArgumentException::invalidType('string', $offset); + } return $this->keyData[$offset]; } + + /** + * @param mixed $offset + * @param mixed $value + * @throws InvalidArgumentException + * @return void + */ public function offsetSet($offset, $value) { - $this->assertIsString($offset); - + if (!is_string($offset)) { + throw InvalidArgumentException::invalidType('string', $offset); + } $this->keyData[$offset] = $value; } - public function offsetUnset($offset) - { - $this->assertIsString($offset); - - unset($this->keyData[$offset]); - } /** - * Asserts that the parameter is of type string - * @param mixed $test - * - * @throws \Exception + * @param mixed $offset + * @throws InvalidArgumentException + * @return void */ - protected function assertIsString($test) + public function offsetUnset($offset) { - if (!is_string($test)) { - throw InvalidArgumentException::invalidType('string', $test); + if (!is_string($offset)) { + throw InvalidArgumentException::invalidType('string', $offset); } + unset($this->keyData[$offset]); } } diff --git a/vendor/simplesamlphp/saml2/src/SAML2/Certificate/KeyCollection.php b/vendor/simplesamlphp/saml2/src/SAML2/Certificate/KeyCollection.php index ca4d296ce8..6df321de16 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/Certificate/KeyCollection.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/Certificate/KeyCollection.php @@ -14,10 +14,11 @@ class KeyCollection extends ArrayCollection * Add a key to the collection * * @param \SAML2\Certificate\Key $key + * @return void */ public function add($key) { - if (!$key instanceof Key) { + if (!($key instanceof Key)) { throw InvalidArgumentException::invalidType( 'SAML2\Certificate\Key', $key diff --git a/vendor/simplesamlphp/saml2/src/SAML2/Certificate/KeyLoader.php b/vendor/simplesamlphp/saml2/src/SAML2/Certificate/KeyLoader.php index 8d1233e5bd..742de2c46c 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/Certificate/KeyLoader.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/Certificate/KeyLoader.php @@ -19,19 +19,23 @@ class KeyLoader */ private $loadedKeys; + + /** + * Constructor for KeyLoader. + */ public function __construct() { $this->loadedKeys = new KeyCollection(); } + /** * Extracts the public keys given by the configuration. Mainly exists for BC purposes. * Prioritisation order is keys > certData > certificate * * @param \SAML2\Configuration\CertificateProvider $config - * @param null $usage - * @param bool $required - * + * @param string|null $usage + * @param bool $required * @return \SAML2\Certificate\KeyCollection */ public static function extractPublicKeys( @@ -44,11 +48,11 @@ public static function extractPublicKeys( return $keyLoader->loadKeysFromConfiguration($config, $usage, $required); } + /** * @param \SAML2\Configuration\CertificateProvider $config * @param null|string $usage * @param bool $required - * * @return \SAML2\Certificate\KeyCollection */ public function loadKeysFromConfiguration( @@ -71,19 +75,21 @@ public function loadKeysFromConfiguration( if ($required && !$this->hasKeys()) { throw new NoKeysFoundException( 'No keys found in configured metadata, please ensure that either the "keys", "certData" or ' - . '"certificate" entries is available.' + .'"certificate" entries is available.' ); } return $this->getKeys(); } + /** * Loads the keys given, optionally excluding keys when a usage is given and they * are not configured to be used with the usage given * * @param array $configuredKeys - * @param $usage + * @param string $usage + * @return void */ public function loadKeys(array $configuredKeys, $usage) { @@ -102,10 +108,12 @@ public function loadKeys(array $configuredKeys, $usage) } } + /** * Attempts to load a key based on the given certificateData * * @param string $certificateData + * @return void */ public function loadCertificateData($certificateData) { @@ -116,10 +124,12 @@ public function loadCertificateData($certificateData) $this->loadedKeys->add(X509::createFromCertificateData($certificateData)); } + /** * Loads the certificate in the file given * * @param string $certificateFile the full path to the cert file. + * @return void */ public function loadCertificateFile($certificateFile) { @@ -137,6 +147,7 @@ public function loadCertificateFile($certificateFile) $this->loadedKeys->add(X509::createFromCertificateData($matches[1])); } + /** * @return \SAML2\Certificate\KeyCollection */ @@ -145,6 +156,7 @@ public function getKeys() return $this->loadedKeys; } + /** * @return bool */ diff --git a/vendor/simplesamlphp/saml2/src/SAML2/Certificate/PrivateKey.php b/vendor/simplesamlphp/saml2/src/SAML2/Certificate/PrivateKey.php index 883d389907..c6c0e9ce8a 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/Certificate/PrivateKey.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/Certificate/PrivateKey.php @@ -6,6 +6,12 @@ class PrivateKey extends Key { + /** + * @param string $keyContents + * @param string|null $passphrase + * @throws InvalidArgumentException + * @return PrivateKey + */ public static function create($keyContents, $passphrase = null) { if (!is_string($keyContents)) { @@ -16,7 +22,7 @@ public static function create($keyContents, $passphrase = null) throw InvalidArgumentException::invalidType('string', $passphrase); } - $keyData = array('PEM' => $keyContents, self::USAGE_ENCRYPTION => true); + $keyData = ['PEM' => $keyContents, self::USAGE_ENCRYPTION => true]; if ($passphrase) { $keyData['passphrase'] = $passphrase; } @@ -24,11 +30,19 @@ public static function create($keyContents, $passphrase = null) return new self($keyData); } + + /** + * @return string + */ public function getKeyAsString() { return $this->keyData['PEM']; } + + /** + * @return string|null + */ public function getPassphrase() { return isset($this->keyData['passphrase']) ? $this->keyData['passphrase'] : null; diff --git a/vendor/simplesamlphp/saml2/src/SAML2/Certificate/PrivateKeyLoader.php b/vendor/simplesamlphp/saml2/src/SAML2/Certificate/PrivateKeyLoader.php index 677411ae22..c86f244fac 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/Certificate/PrivateKeyLoader.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/Certificate/PrivateKeyLoader.php @@ -14,22 +14,25 @@ class PrivateKeyLoader * Loads a private key based on the configuration given. * * @param \SAML2\Configuration\PrivateKey $key - * * @return \SAML2\Certificate\PrivateKey */ public function loadPrivateKey(PrivateKeyConfiguration $key) { - $privateKey = File::getFileContents($key->getFilePath()); + if ($key->isFile()) { + $privateKey = File::getFileContents($key->getFilePath()); + } else { + $privateKey = $key->getContents(); + } return PrivateKey::create($privateKey, $key->getPassPhrase()); } + /** * @param \SAML2\Configuration\DecryptionProvider $identityProvider * @param \SAML2\Configuration\DecryptionProvider $serviceProvider - * - * @return \SAML2\Utilities\ArrayCollection * @throws \Exception + * @return \SAML2\Utilities\ArrayCollection */ public function loadDecryptionKeys( DecryptionProvider $identityProvider, @@ -38,7 +41,7 @@ public function loadDecryptionKeys( $decryptionKeys = new ArrayCollection(); $senderSharedKey = $identityProvider->getSharedKey(); - if ($senderSharedKey) { + if ($senderSharedKey !== null) { $key = new XMLSecurityKey(XMLSecurityKey::AES128_CBC); $key->loadKey($senderSharedKey); $decryptionKeys->add($key); @@ -59,15 +62,15 @@ public function loadDecryptionKeys( return $decryptionKeys; } + /** * @param \SAML2\Certificate\PrivateKey $privateKey - * - * @return XMLSecurityKey * @throws \Exception + * @return XMLSecurityKey */ private function convertPrivateKeyToRsaKey(PrivateKey $privateKey) { - $key = new XMLSecurityKey(XMLSecurityKey::RSA_1_5, array('type' => 'private')); + $key = new XMLSecurityKey(XMLSecurityKey::RSA_1_5, ['type' => 'private']); $passphrase = $privateKey->getPassphrase(); if ($passphrase) { $key->passphrase = $passphrase; diff --git a/vendor/simplesamlphp/saml2/src/SAML2/Certificate/X509.php b/vendor/simplesamlphp/saml2/src/SAML2/Certificate/X509.php index 92ee24c9e9..59cf10dea0 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/Certificate/X509.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/Certificate/X509.php @@ -12,20 +12,29 @@ class X509 extends Key */ private $fingerprint; + + /** + * @param string $certificateContents + * @return X509 + */ public static function createFromCertificateData($certificateContents) { - $data = array( + $data = [ 'encryption' => true, 'signing' => true, 'type' => 'X509Certificate', 'X509Certificate' => $certificateContents - ); + ]; return new self($data); } + /** * {@inheritdoc} Best place to ensure the logic is encapsulated in a single place + * @param mixed $offset + * @param mixed $value + * @return void */ public function offsetSet($offset, $value) { @@ -36,6 +45,7 @@ public function offsetSet($offset, $value) parent::offsetSet($offset, $value); } + /** * Get the certificate representation * @@ -48,6 +58,7 @@ public function getCertificate() . "-----END CERTIFICATE-----\n"; } + /** * @return \SAML2\Certificate\Fingerprint * diff --git a/vendor/simplesamlphp/saml2/src/SAML2/Compat/AbstractContainer.php b/vendor/simplesamlphp/saml2/src/SAML2/Compat/AbstractContainer.php index cdda031dd1..f77df62cf1 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/Compat/AbstractContainer.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/Compat/AbstractContainer.php @@ -10,11 +10,14 @@ abstract class AbstractContainer */ abstract public function getLogger(); + /** * Generate a random identifier for identifying SAML2 documents. + * @return string */ abstract public function generateId(); + /** * Log an incoming message to the debug log. * @@ -24,12 +27,13 @@ abstract public function generateId(); * - **encrypt** XML that is about to be encrypted * - **decrypt** XML that was just decrypted * - * @param string $message + * @param string|\DOMNode $message * @param string $type * @return void */ abstract public function debugMessage($message, $type); + /** * Trigger the user to perform a GET to the given URL with the given data. * @@ -37,7 +41,8 @@ abstract public function debugMessage($message, $type); * @param array $data * @return void */ - abstract public function redirect($url, $data = array()); + abstract public function redirect($url, $data = []); + /** * Trigger the user to perform a POST to the given URL with the given data. @@ -46,5 +51,5 @@ abstract public function redirect($url, $data = array()); * @param array $data * @return void */ - abstract public function postRedirect($url, $data = array()); + abstract public function postRedirect($url, $data = []); } diff --git a/vendor/simplesamlphp/saml2/src/SAML2/Compat/ContainerSingleton.php b/vendor/simplesamlphp/saml2/src/SAML2/Compat/ContainerSingleton.php index 652487f90d..5232d358ae 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/Compat/ContainerSingleton.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/Compat/ContainerSingleton.php @@ -7,12 +7,13 @@ class ContainerSingleton { /** - * @var \SAML2\Compat\Ssp\Container + * @var \SAML2\Compat\AbstractContainer */ protected static $container; + /** - * @return \SAML2\Compat\Ssp\Container + * @return \SAML2\Compat\AbstractContainer */ public static function getInstance() { @@ -22,6 +23,7 @@ public static function getInstance() return self::$container; } + /** * Set a container to use. * @@ -34,6 +36,7 @@ public static function setContainer(AbstractContainer $container) return $container; } + /** * @return \SAML2\Compat\Ssp\Container */ diff --git a/vendor/simplesamlphp/saml2/src/SAML2/Compat/MockContainer.php b/vendor/simplesamlphp/saml2/src/SAML2/Compat/MockContainer.php index c63473a0ce..649dcadca8 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/Compat/MockContainer.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/Compat/MockContainer.php @@ -15,7 +15,7 @@ class MockContainer extends AbstractContainer /** * @var array */ - private $debugMessages = array(); + private $debugMessages = []; /** * @var string @@ -37,6 +37,7 @@ class MockContainer extends AbstractContainer */ private $postRedirectData; + /** * Get a PSR-3 compatible logger. * @return \Psr\Log\LoggerInterface @@ -46,14 +47,17 @@ public function getLogger() return new \Psr\Log\NullLogger(); } + /** * Generate a random identifier for identifying SAML2 documents. + * @return string */ public function generateId() { return $this->id; } + /** * Log an incoming message to the debug log. * @@ -72,6 +76,7 @@ public function debugMessage($message, $type) $this->debugMessages[$type] = $message; } + /** * Trigger the user to perform a GET to the given URL with the given data. * @@ -79,12 +84,13 @@ public function debugMessage($message, $type) * @param array $data * @return void */ - public function redirect($url, $data = array()) + public function redirect($url, $data = []) { $this->redirectUrl = $url; $this->redirectData = $data; } + /** * Trigger the user to perform a POST to the given URL with the given data. * @@ -92,7 +98,7 @@ public function redirect($url, $data = array()) * @param array $data * @return void */ - public function postRedirect($url, $data = array()) + public function postRedirect($url, $data = []) { $this->postRedirectUrl = $url; $this->postRedirectData = $data; diff --git a/vendor/simplesamlphp/saml2/src/SAML2/Compat/Ssp/Container.php b/vendor/simplesamlphp/saml2/src/SAML2/Compat/Ssp/Container.php index 57a32959bd..efc0f40125 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/Compat/Ssp/Container.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/Compat/Ssp/Container.php @@ -3,7 +3,6 @@ namespace SAML2\Compat\Ssp; use SAML2\Compat\AbstractContainer; -use SimpleSAML_Utilities; class Container extends AbstractContainer { @@ -12,6 +11,7 @@ class Container extends AbstractContainer */ protected $logger; + /** * Create a new SimpleSAMLphp compatible container. */ @@ -20,43 +20,57 @@ public function __construct() $this->logger = new Logger(); } + /** * {@inheritdoc} + * @return \Psr\Log\LoggerInterface */ public function getLogger() { return $this->logger; } + /** * {@inheritdoc} + * @return string */ public function generateId() { - return SimpleSAML_Utilities::generateID(); + return \SimpleSAML\Utils\Random::generateID(); } + /** * {@inheritdoc} + * @return void */ public function debugMessage($message, $type) { - SimpleSAML_Utilities::debugMessage($message, $type); + \SimpleSAML\Utils\XML::debugSAMLMessage($message, $type); } + /** * {@inheritdoc} + * @param string $url + * @param array $data + * @return void */ - public function redirect($url, $data = array()) + public function redirect($url, $data = []) { - SimpleSAML_Utilities::redirectTrustedURL($url, $data); + \SimpleSAML\Utils\HTTP::redirectTrustedURL($url, $data); } + /** * {@inheritdoc} + * @param string $url + * @param array $data + * @return void */ - public function postRedirect($url, $data = array()) + public function postRedirect($url, $data = []) { - SimpleSAML_Utilities::postRedirect($url, $data); + \SimpleSAML\Utils\HTTP::submitPOSTData($url, $data); } } diff --git a/vendor/simplesamlphp/saml2/src/SAML2/Compat/Ssp/Logger.php b/vendor/simplesamlphp/saml2/src/SAML2/Compat/Ssp/Logger.php index 6a9f904498..5d112ad0a2 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/Compat/Ssp/Logger.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/Compat/Ssp/Logger.php @@ -3,6 +3,7 @@ namespace SAML2\Compat\Ssp; use Psr\Log\LoggerInterface; +use Psr\Log\LogLevel; class Logger implements LoggerInterface { @@ -11,13 +12,14 @@ class Logger implements LoggerInterface * * @param string $message * @param array $context - * @return null + * @return void */ - public function emergency($message, array $context = array()) + public function emergency($message, array $context = []) { - \SimpleSAML\Logger::emergency($message . var_export($context, true)); + \SimpleSAML\Logger::emergency($message.($context ? " ".var_export($context, true) : "")); } + /** * Action must be taken immediately. * @@ -26,13 +28,14 @@ public function emergency($message, array $context = array()) * * @param string $message * @param array $context - * @return null + * @return void */ - public function alert($message, array $context = array()) + public function alert($message, array $context = []) { - \SimpleSAML\Logger::alert($message . var_export($context, true)); + \SimpleSAML\Logger::alert($message.($context ? " ".var_export($context, true) : "")); } + /** * Critical conditions. * @@ -40,26 +43,28 @@ public function alert($message, array $context = array()) * * @param string $message * @param array $context - * @return null + * @return void */ - public function critical($message, array $context = array()) + public function critical($message, array $context = []) { - \SimpleSAML\Logger::critical($message . var_export($context, true)); + \SimpleSAML\Logger::critical($message.($context ? " ".var_export($context, true) : "")); } + /** * Runtime errors that do not require immediate action but should typically * be logged and monitored. * * @param string $message * @param array $context - * @return null + * @return void */ - public function error($message, array $context = array()) + public function error($message, array $context = []) { - \SimpleSAML\Logger::error($message . var_export($context, true)); + \SimpleSAML\Logger::error($message.($context ? " ".var_export($context, true) : "")); } + /** * Exceptional occurrences that are not errors. * @@ -68,25 +73,27 @@ public function error($message, array $context = array()) * * @param string $message * @param array $context - * @return null + * @return void */ - public function warning($message, array $context = array()) + public function warning($message, array $context = []) { - \SimpleSAML\Logger::warning($message . var_export($context, true)); + \SimpleSAML\Logger::warning($message.($context ? " ".var_export($context, true) : "")); } + /** * Normal but significant events. * * @param string $message * @param array $context - * @return null + * @return void */ - public function notice($message, array $context = array()) + public function notice($message, array $context = []) { - \SimpleSAML\Logger::notice($message . var_export($context, true)); + \SimpleSAML\Logger::notice($message.($context ? " ".var_export($context, true) : "")); } + /** * Interesting events. * @@ -94,59 +101,67 @@ public function notice($message, array $context = array()) * * @param string $message * @param array $context - * @return null + * @return void */ - public function info($message, array $context = array()) + public function info($message, array $context = []) { - \SimpleSAML\Logger::info($message . var_export($context, true)); + \SimpleSAML\Logger::info($message.($context ? " ".var_export($context, true) : "")); } + /** * Detailed debug information. * * @param string $message * @param array $context - * @return null + * @return void */ - public function debug($message, array $context = array()) + public function debug($message, array $context = []) { - \SimpleSAML\Logger::debug($message . var_export($context, true)); + \SimpleSAML\Logger::debug($message.($context ? " ".var_export($context, true) : "")); } + /** * Logs with an arbitrary level. * * @param mixed $level * @param string $message * @param array $context - * @return null + * @return void */ - public function log($level, $message, array $context = array()) + public function log($level, $message, array $context = []) { switch ($level) { - case \SimpleSAML\Logger::ALERT: - \SimpleSAML\Logger::alert($message); + /* From PSR: Calling this method with one of the log level constants + MUST have the same result as calling the level-specific method + */ + case LogLevel::ALERT: + $this->alert($message, $context); + break; + case LogLevel::CRITICAL: + $this->critical($message, $context); break; - case \SimpleSAML\Logger::CRIT: - \SimpleSAML\Logger::critical($message); + case LogLevel::DEBUG: + $this->debug($message, $context); break; - case \SimpleSAML\Logger::DEBUG: - \SimpleSAML\Logger::debug($message); + case LogLevel::EMERGENCY: + $this->emergency($message, $context); break; - case \SimpleSAML\Logger::EMERG: - \SimpleSAML\Logger::emergency($message); + case LogLevel::ERROR: + $this->error($message, $context); break; - case \SimpleSAML\Logger::ERR: - \SimpleSAML\Logger::error($message); + case LogLevel::INFO: + $this->info($message, $context); break; - case \SimpleSAML\Logger::INFO: - \SimpleSAML\Logger::info($message); + case LogLevel::NOTICE: + $this->notice($message, $context); break; - case \SimpleSAML\Logger::NOTICE: - \SimpleSAML\Logger::notice($message); + case LogLevel::WARNING: + $this->warning($message, $context); break; - case \SimpleSAML\Logger::WARNING: - \SimpleSAML\Logger::warning($message); + default: + throw new \Psr\Log\InvalidArgumentException("Unrecognized log level '$level''"); } } } diff --git a/vendor/simplesamlphp/saml2/src/SAML2/Configuration/ArrayAdapter.php b/vendor/simplesamlphp/saml2/src/SAML2/Configuration/ArrayAdapter.php index 018509c788..ef79306c5a 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/Configuration/ArrayAdapter.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/Configuration/ArrayAdapter.php @@ -12,6 +12,7 @@ class ArrayAdapter implements Queryable */ private $configuration; + /** * @param array $configuration */ @@ -20,6 +21,12 @@ public function __construct(array $configuration) $this->configuration = $configuration; } + + /** + * @param mixed $key + * @param mixed|null $defaultValue + * @return mixed + */ public function get($key, $defaultValue = null) { if (!$this->has($key)) { @@ -29,6 +36,10 @@ public function get($key, $defaultValue = null) return $this->configuration[$key]; } + + /** + * @param mixed $key + */ public function has($key) { return array_key_exists($key, $this->configuration); diff --git a/vendor/simplesamlphp/saml2/src/SAML2/Configuration/CertificateProvider.php b/vendor/simplesamlphp/saml2/src/SAML2/Configuration/CertificateProvider.php index 902d320c71..c436858c23 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/Configuration/CertificateProvider.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/Configuration/CertificateProvider.php @@ -16,6 +16,7 @@ interface CertificateProvider extends Queryable */ public function getKeys(); + /** * Returns the contents of an X509 pem certificate, without the '-----BEGIN CERTIFICATE-----' and * '-----END CERTIFICATE-----'. @@ -24,6 +25,7 @@ public function getKeys(); */ public function getCertificateData(); + /** * Returns the full path to the (local) file that contains the X509 pem certificate. * @@ -31,6 +33,7 @@ public function getCertificateData(); */ public function getCertificateFile(); + /** * Returns an array or \Traversable where each element represents a certificate fingerprint. A certificate * fingerprint is a string containing the certificate fingerprint. diff --git a/vendor/simplesamlphp/saml2/src/SAML2/Configuration/DecryptionProvider.php b/vendor/simplesamlphp/saml2/src/SAML2/Configuration/DecryptionProvider.php index 06ac6476bf..57d4d3a9a1 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/Configuration/DecryptionProvider.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/Configuration/DecryptionProvider.php @@ -9,11 +9,13 @@ interface DecryptionProvider */ public function isAssertionEncryptionRequired(); + /** * @return null|string */ public function getSharedKey(); + /** * @param string $name the name of the private key * @param boolean $required whether or not the private key must exist @@ -22,6 +24,7 @@ public function getSharedKey(); */ public function getPrivateKey($name, $required = false); + /** * @return array */ diff --git a/vendor/simplesamlphp/saml2/src/SAML2/Configuration/Destination.php b/vendor/simplesamlphp/saml2/src/SAML2/Configuration/Destination.php index cbba14af89..71e6e8aa82 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/Configuration/Destination.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/Configuration/Destination.php @@ -14,6 +14,7 @@ class Destination */ private $destination; + /** * @param string $destination */ @@ -26,6 +27,7 @@ public function __construct($destination) $this->destination = $destination; } + /** * @param \SAML2\Configuration\Destination $otherDestination * @@ -36,6 +38,10 @@ public function equals(Destination $otherDestination) return $this->destination === $otherDestination->destination; } + + /** + * @return string + */ public function __toString() { return $this->destination; diff --git a/vendor/simplesamlphp/saml2/src/SAML2/Configuration/IdentityProvider.php b/vendor/simplesamlphp/saml2/src/SAML2/Configuration/IdentityProvider.php index 6c32283b73..0f6acb2d46 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/Configuration/IdentityProvider.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/Configuration/IdentityProvider.php @@ -10,22 +10,35 @@ class IdentityProvider extends ArrayAdapter implements DecryptionProvider, EntityIdProvider { + /** + * @return mixed + */ public function getKeys() { return $this->get('keys'); } + + /** + * @return mixed + */ public function getCertificateData() { return $this->get('certificateData'); } + + /** + * @return mixed + */ public function getCertificateFile() { return $this->get('certificateFile'); } + /** + * @return mixed * @deprecated Please use getCertifiateFile() or getCertificateData() */ public function getCertificateFingerprints() @@ -33,21 +46,39 @@ public function getCertificateFingerprints() return $this->get('certificateFingerprints'); } + + /** + * @return mixed + */ public function isAssertionEncryptionRequired() { return $this->get('assertionEncryptionEnabled'); } + + /** + * @return mixed + */ public function getSharedKey() { return $this->get('sharedKey'); } + + /** + * @return mixed + */ public function hasBase64EncodedAttributes() { return $this->get('base64EncodedAttributes'); } + + /** + * @param string $name + * @param bool $required + * @return mixed|null + */ public function getPrivateKey($name, $required = false) { $privateKeys = $this->get('privateKeys'); @@ -72,13 +103,18 @@ public function getPrivateKey($name, $required = false) return array_pop($key); } + + /** + * @return mixed + */ public function getBlacklistedAlgorithms() { return $this->get('blacklistedEncryptionAlgorithms'); } + /** - * @return null|string + * @return mixed */ public function getEntityId() { diff --git a/vendor/simplesamlphp/saml2/src/SAML2/Configuration/IdentityProviderAware.php b/vendor/simplesamlphp/saml2/src/SAML2/Configuration/IdentityProviderAware.php index f954d144c6..b02a5847ac 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/Configuration/IdentityProviderAware.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/Configuration/IdentityProviderAware.php @@ -7,5 +7,9 @@ */ interface IdentityProviderAware { + /** + * @param IdentityProvider $identityProvider + * @return void + */ public function setIdentityProvider(IdentityProvider $identityProvider); } diff --git a/vendor/simplesamlphp/saml2/src/SAML2/Configuration/PrivateKey.php b/vendor/simplesamlphp/saml2/src/SAML2/Configuration/PrivateKey.php index 41149a51a9..605307bbb5 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/Configuration/PrivateKey.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/Configuration/PrivateKey.php @@ -3,6 +3,7 @@ namespace SAML2\Configuration; use SAML2\Exception\InvalidArgumentException; +use SAML2\Exception\RuntimeException; /** * Configuration of a private key. @@ -15,7 +16,7 @@ class PrivateKey extends ArrayAdapter /** * @var string */ - private $filePath; + private $filePathOrContents; /** * @var string @@ -27,10 +28,24 @@ class PrivateKey extends ArrayAdapter */ private $name; - public function __construct($filePath, $name, $passphrase = null) + /** + * @var bool + */ + private $isFile; + + /** + * Constructor for PrivateKey. + * + * @param string $filePathOrContents + * @param string $name + * @param string|null $passphrase + * @param bool $isFile + * @throws \Exception + */ + public function __construct($filePathOrContents, $name, $passphrase = null, $isFile = true) { - if (!is_string($filePath)) { - throw InvalidArgumentException::invalidType('string', $filePath); + if (!is_string($filePathOrContents)) { + throw InvalidArgumentException::invalidType('string', $filePathOrContents); } if (!is_string($name)) { @@ -41,19 +56,26 @@ public function __construct($filePath, $name, $passphrase = null) throw InvalidArgumentException::invalidType('string', $passphrase); } - $this->filePath = $filePath; + $this->filePathOrContents = $filePathOrContents; $this->passphrase = $passphrase; $this->name = $name; + $this->isFile = $isFile; } + /** * @return string */ public function getFilePath() { - return $this->filePath; + if (!$this->isFile()) { + throw new RuntimeException('No path provided.'); + } + + return $this->filePathOrContents; } + /** * @return bool */ @@ -62,6 +84,7 @@ public function hasPassPhrase() return (bool) $this->passphrase; } + /** * @return string */ @@ -70,6 +93,7 @@ public function getPassPhrase() return $this->passphrase; } + /** * @return string */ @@ -77,4 +101,24 @@ public function getName() { return $this->name; } + + /** + * @return string + */ + public function getContents() + { + if ($this->isFile()) { + throw new RuntimeException('No contents provided'); + } + + return $this->filePathOrContents; + } + + /** + * @return bool + */ + public function isFile() + { + return $this->isFile; + } } diff --git a/vendor/simplesamlphp/saml2/src/SAML2/Configuration/Queryable.php b/vendor/simplesamlphp/saml2/src/SAML2/Configuration/Queryable.php index 8e73e25d26..8a16281138 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/Configuration/Queryable.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/Configuration/Queryable.php @@ -15,6 +15,7 @@ interface Queryable */ public function has($key); + /** * Query to get the value in the configuration for the given key. If no value is present the default value is * returned diff --git a/vendor/simplesamlphp/saml2/src/SAML2/Configuration/ServiceProvider.php b/vendor/simplesamlphp/saml2/src/SAML2/Configuration/ServiceProvider.php index e71d0166f6..c70be74d47 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/Configuration/ServiceProvider.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/Configuration/ServiceProvider.php @@ -12,22 +12,35 @@ class ServiceProvider extends ArrayAdapter implements DecryptionProvider, EntityIdProvider { + /** + * @return mixed + */ public function getKeys() { return $this->get('keys'); } + + /** + * @return mixed + */ public function getCertificateData() { return $this->get('certificateData'); } + + /** + * @return mixed + */ public function getCertificateFile() { return $this->get('certificateFile'); } + /** + * @return mixed * @deprecated Please use getCertificateData() or getCertificateFile(). */ public function getCertificateFingerprints() @@ -35,21 +48,39 @@ public function getCertificateFingerprints() return $this->get('certificateFingerprints'); } + + /** + * @return mixed + */ public function getEntityId() { return $this->get('entityId'); } + + /** + * @return mixed + */ public function isAssertionEncryptionRequired() { return $this->get('assertionEncryptionEnabled'); } + + /** + * @return mixed + */ public function getSharedKey() { return $this->get('sharedKey'); } + + /** + * @param string $name + * @param bool $required + * @return mixed|null + */ public function getPrivateKey($name, $required = false) { $privateKeys = $this->get('privateKeys'); @@ -74,8 +105,12 @@ public function getPrivateKey($name, $required = false) return array_pop($key); } + + /** + * @return mixed + */ public function getBlacklistedAlgorithms() { - return $this->get('blacklistedEncryptionAlgorithms', array(XMLSecurityKey::RSA_1_5)); + return $this->get('blacklistedEncryptionAlgorithms', [XMLSecurityKey::RSA_1_5]); } } diff --git a/vendor/simplesamlphp/saml2/src/SAML2/Configuration/ServiceProviderAware.php b/vendor/simplesamlphp/saml2/src/SAML2/Configuration/ServiceProviderAware.php index 02a72b6289..db453fa4f1 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/Configuration/ServiceProviderAware.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/Configuration/ServiceProviderAware.php @@ -7,5 +7,9 @@ */ interface ServiceProviderAware { + /** + * @param ServiceProvider $serviceProvider + * @return void + */ public function setServiceProvider(ServiceProvider $serviceProvider); } diff --git a/vendor/simplesamlphp/saml2/src/SAML2/Configuration/SimpleSAMLConverter.php b/vendor/simplesamlphp/saml2/src/SAML2/Configuration/SimpleSAMLConverter.php index 7cbd93c4ec..1c2bfb872f 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/Configuration/SimpleSAMLConverter.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/Configuration/SimpleSAMLConverter.php @@ -2,7 +2,7 @@ namespace SAML2\Configuration; -use SimpleSAML_Configuration; +use \SimpleSAML\Configuration; /** * Backwards compatibility helper for SimpleSAMLphp @@ -10,13 +10,13 @@ class SimpleSAMLConverter { /** - * @param \SimpleSAML_Configuration $configuration + * @param \SimpleSAML\Configuration $configuration * @param string $certificatePrefix * * @return \SAML2\Configuration\IdentityProvider */ public static function convertToIdentityProvider( - SimpleSAML_Configuration $configuration, + Configuration $configuration, $certificatePrefix = '' ) { $pluckedConfiguration = static::pluckConfiguration($configuration, $certificatePrefix); @@ -26,14 +26,15 @@ public static function convertToIdentityProvider( return new IdentityProvider($pluckedConfiguration); } + /** - * @param \SimpleSAML_Configuration $configuration + * @param \SimpleSAML\Configuration $configuration * @param string $certificatePrefix * * @return \SAML2\Configuration\ServiceProvider */ public static function convertToServiceProvider( - SimpleSAML_Configuration $configuration, + Configuration $configuration, $certificatePrefix = '' ) { $pluckedConfiguration = static::pluckConfiguration($configuration, $certificatePrefix); @@ -43,37 +44,38 @@ public static function convertToServiceProvider( return new ServiceProvider($pluckedConfiguration); } + /** - * @param \SimpleSAML_Configuration $configuration + * @param \SimpleSAML\Configuration $configuration * @param string $prefix * * @return array */ - private static function pluckConfiguration(SimpleSAML_Configuration $configuration, $prefix = '') + protected static function pluckConfiguration(Configuration $configuration, $prefix = '') { - $extracted = array(); + $extracted = []; // ported from // https://github.com/simplesamlphp/simplesamlphp/blob/3d735912342767d391297cc5e13272a76730aca0/lib/SimpleSAML/Configuration.php#L1092 - if ($configuration->hasValue($prefix . 'keys')) { - $extracted['keys'] = $configuration->getArray($prefix . 'keys'); + if ($configuration->hasValue($prefix.'keys')) { + $extracted['keys'] = $configuration->getArray($prefix.'keys'); } // ported from // https://github.com/simplesamlphp/simplesamlphp/blob/3d735912342767d391297cc5e13272a76730aca0/lib/SimpleSAML/Configuration.php#L1108 - if ($configuration->hasValue($prefix . 'certData')) { - $extracted['certificateData'] = $configuration->getString($prefix . 'certData'); + if ($configuration->hasValue($prefix.'certData')) { + $extracted['certificateData'] = $configuration->getString($prefix.'certData'); } // ported from // https://github.com/simplesamlphp/simplesamlphp/blob/3d735912342767d391297cc5e13272a76730aca0/lib/SimpleSAML/Configuration.php#L1119 - if ($configuration->hasValue($prefix . 'certificate')) { - $extracted['certificateData'] = $configuration->getString($prefix . 'certificate'); + if ($configuration->hasValue($prefix.'certificate')) { + $extracted['certificateData'] = $configuration->getString($prefix.'certificate'); } // ported from // https://github.com/simplesamlphp/simplesamlphp/blob/3d735912342767d391297cc5e13272a76730aca0/modules/saml/lib/Message.php#L161 - if ($configuration->hasValue($prefix . 'certFingerprint')) { + if ($configuration->hasValue($prefix.'certFingerprint')) { $extracted['certificateFingerprint'] = $configuration->getArrayizeString('certFingerprint'); } @@ -86,19 +88,40 @@ private static function pluckConfiguration(SimpleSAML_Configuration $configurati return $extracted; } - private static function enrichForIdentityProvider(SimpleSAML_Configuration $configuration, &$baseConfiguration) + + /** + * @param \SimpleSAML\Configuration $configuration + * @param array $baseConfiguration + * + * @return void + */ + protected static function enrichForIdentityProvider(Configuration $configuration, array &$baseConfiguration) { $baseConfiguration['base64EncodedAttributes'] = $configuration->getBoolean('base64attributes', false); $baseConfiguration['entityId'] = $configuration->getString('entityid'); } - private static function enrichForServiceProvider(SimpleSAML_Configuration $configuration, &$baseConfiguration) + + /** + * @param \SimpleSAML\Configuration $configuration + * @param array $baseConfiguration + * + * @return void + */ + protected static function enrichForServiceProvider(Configuration $configuration, array &$baseConfiguration) { $baseConfiguration['entityId'] = $configuration->getString('entityid'); } - private static function enrichForDecryptionProvider( - SimpleSAML_Configuration $configuration, + + /** + * @param \SimpleSAML\Configuration $configuration + * @param array $baseConfiguration + * + * @return void + */ + protected static function enrichForDecryptionProvider( + Configuration $configuration, array &$baseConfiguration ) { if ($configuration->has('sharedKey')) { diff --git a/vendor/simplesamlphp/saml2/src/SAML2/Constants.php b/vendor/simplesamlphp/saml2/src/SAML2/Constants.php index 5e61b3be32..35c5193775 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/Constants.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/Constants.php @@ -14,6 +14,11 @@ class Constants */ const AC_PASSWORD = 'urn:oasis:names:tc:SAML:2.0:ac:classes:Password'; + /** + * PasswordProtectedTransport authentication context. + */ + const AC_PASSWORD_PROTECTED_TRANSPORT = 'urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport'; + /** * Unspecified authentication context. */ @@ -55,8 +60,8 @@ class Constants const CM_BEARER = 'urn:oasis:names:tc:SAML:2.0:cm:bearer'; /** - * Holder-of-Key subject confirmation method. - */ + * Holder-of-Key subject confirmation method. + */ const CM_HOK = 'urn:oasis:names:tc:SAML:2.0:cm:holder-of-key'; /** @@ -415,4 +420,9 @@ class Constants * Second-level status code. */ const STATUS_UNSUPPORTED_BINDING = 'urn:oasis:names:tc:SAML:2.0:status:UnsupportedBinding'; + + /** + * The name of the EntityAttribute used to indicate the subject-id needs of a Service Provider. + */ + const SUBJECT_ID_REQ = 'urn:oasis:names:tc:SAML:profiles:subject-id:req'; } diff --git a/vendor/simplesamlphp/saml2/src/SAML2/DOMDocumentFactory.php b/vendor/simplesamlphp/saml2/src/SAML2/DOMDocumentFactory.php index 44c2902bb8..2aebcb4dd2 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/DOMDocumentFactory.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/DOMDocumentFactory.php @@ -8,10 +8,15 @@ final class DOMDocumentFactory { + /** + * Constructor for DOMDocumentFactory. + * This class should never be instantiated + */ private function __construct() { } + /** * @param string $xml * @@ -29,7 +34,7 @@ public static function fromString($xml) $domDocument = self::create(); $options = LIBXML_DTDLOAD | LIBXML_DTDATTR | LIBXML_NONET; - if (defined(LIBXML_COMPACT)) { + if (defined('LIBXML_COMPACT')) { $options |= LIBXML_COMPACT; } @@ -58,6 +63,7 @@ public static function fromString($xml) return $domDocument; } + /** * @param $file * @@ -94,6 +100,7 @@ public static function fromFile($file) return static::fromString($xml); } + /** * @return \DOMDocument */ diff --git a/vendor/simplesamlphp/saml2/src/SAML2/EncryptedAssertion.php b/vendor/simplesamlphp/saml2/src/SAML2/EncryptedAssertion.php index 3ce8c3c244..823bf7ee22 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/EncryptedAssertion.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/EncryptedAssertion.php @@ -19,6 +19,7 @@ class EncryptedAssertion */ private $encryptedData; + /** * Constructor for SAML 2 encrypted assertions. * @@ -40,12 +41,14 @@ public function __construct(\DOMElement $xml = null) $this->encryptedData = $data[0]; } + /** * Set the assertion. * * @param \SAML2\Assertion $assertion The assertion. * @param XMLSecurityKey $key The key we should use to encrypt the assertion. * @throws \Exception + * @return void */ public function setAssertion(Assertion $assertion, XMLSecurityKey $key) { @@ -75,12 +78,13 @@ public function setAssertion(Assertion $assertion, XMLSecurityKey $key) break; default: - throw new \Exception('Unknown key type for encryption: ' . $key->type); + throw new \Exception('Unknown key type for encryption: '.$key->type); } $this->encryptedData = $enc->encryptNode($symmetricKey); } + /** * Retrieve the assertion. * @@ -88,7 +92,7 @@ public function setAssertion(Assertion $assertion, XMLSecurityKey $key) * @param array $blacklist Blacklisted decryption algorithms. * @return \SAML2\Assertion The decrypted assertion. */ - public function getAssertion(XMLSecurityKey $inputKey, array $blacklist = array()) + public function getAssertion(XMLSecurityKey $inputKey, array $blacklist = []) { $assertionXML = Utils::decryptElement($this->encryptedData, $inputKey, $blacklist); @@ -97,6 +101,7 @@ public function getAssertion(XMLSecurityKey $inputKey, array $blacklist = array( return new Assertion($assertionXML); } + /** * Convert this encrypted assertion to an XML element. * @@ -112,7 +117,7 @@ public function toXML(\DOMNode $parentElement = null) $document = $parentElement->ownerDocument; } - $root = $document->createElementNS(Constants::NS_SAML, 'saml:' . 'EncryptedAssertion'); + $root = $document->createElementNS(Constants::NS_SAML, 'saml:'.'EncryptedAssertion'); $parentElement->appendChild($root); $root->appendChild($document->importNode($this->encryptedData, true)); diff --git a/vendor/simplesamlphp/saml2/src/SAML2/Exception/UnparseableXmlException.php b/vendor/simplesamlphp/saml2/src/SAML2/Exception/UnparseableXmlException.php index 11cc67c656..dac6d549b1 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/Exception/UnparseableXmlException.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/Exception/UnparseableXmlException.php @@ -4,17 +4,23 @@ final class UnparseableXmlException extends RuntimeException { - private static $levelMap = array( + private static $levelMap = [ LIBXML_ERR_WARNING => 'WARNING', LIBXML_ERR_ERROR => 'ERROR', LIBXML_ERR_FATAL => 'FATAL' - ); + ]; + + /** + * Constructor for UnparseableXmlException + * + * @param \LibXMLError $error + */ public function __construct(\LibXMLError $error) { $message = sprintf( 'Unable to parse XML - "%s[%d]": "%s" in "%s" at line %d on column %d"', - static::$levelMap[$error->level], + self::$levelMap[$error->level], $error->code, $error->message, $error->file ?: '(string)', diff --git a/vendor/simplesamlphp/saml2/src/SAML2/HTTPArtifact.php b/vendor/simplesamlphp/saml2/src/SAML2/HTTPArtifact.php index 0a13dbed0b..44fa4bc423 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/HTTPArtifact.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/HTTPArtifact.php @@ -4,10 +4,9 @@ use RobRichards\XMLSecLibs\XMLSecurityKey; use SAML2\Utilities\Temporal; -use SimpleSAML_Configuration; -use SimpleSAML_Metadata_MetaDataStorageHandler; -use SimpleSAML_Store; -use SimpleSAML_Utilities; +use SimpleSAML\Configuration; +use SimpleSAML\Metadata\MetaDataStorageHandler; +use SimpleSAML\Store; /** * Class which implements the HTTP-Artifact binding. @@ -20,48 +19,51 @@ class HTTPArtifact extends Binding { /** - * @var \SimpleSAML_Configuration + * @var \SimpleSAML\Configuration */ private $spMetadata; + /** * Create the redirect URL for a message. * * @param \SAML2\Message $message The message. - * @return string The URL the user should be redirected to in order to send a message. * @throws \Exception + * @return string The URL the user should be redirected to in order to send a message. */ public function getRedirectURL(Message $message) { - $store = SimpleSAML_Store::getInstance(); + $store = Store::getInstance(); if ($store === false) { throw new \Exception('Unable to send artifact without a datastore configured.'); } - $generatedId = pack('H*', ((string) SimpleSAML_Utilities::stringToHex(SimpleSAML_Utilities::generateRandomBytes(20)))); - $artifact = base64_encode("\x00\x04\x00\x00" . sha1($message->getIssuer(), true) . $generatedId) ; + $generatedId = pack('H*', bin2hex(openssl_random_pseudo_bytes(20))); + $artifact = base64_encode("\x00\x04\x00\x00".sha1($message->getIssuer(), true).$generatedId); $artifactData = $message->toUnsignedXML(); $artifactDataString = $artifactData->ownerDocument->saveXML($artifactData); $store->set('artifact', $artifact, $artifactDataString, Temporal::getTime() + 15*60); - $params = array( + $params = [ 'SAMLart' => $artifact, - ); + ]; $relayState = $message->getRelayState(); if ($relayState !== null) { $params['RelayState'] = $relayState; } - return SimpleSAML_Utilities::addURLparameter($message->getDestination(), $params); + return \SimpleSAML\Utils\HTTP::addURLparameter($message->getDestination(), $params); } + /** * Send a SAML 2 message using the HTTP-Redirect binding. * * Note: This function never returns. * * @param \SAML2\Message $message The message we should send. + * @retrun void */ public function send(Message $message) { @@ -69,35 +71,36 @@ public function send(Message $message) Utils::getContainer()->redirect($destination); } + /** * Receive a SAML 2 message sent using the HTTP-Artifact binding. * * Throws an exception if it is unable receive the message. * - * @return \SAML2\Message The received message. * @throws \Exception + * @return \SAML2\Message The received message. */ public function receive() { if (array_key_exists('SAMLart', $_REQUEST)) { $artifact = base64_decode($_REQUEST['SAMLart']); - $endpointIndex = bin2hex(substr($artifact, 2, 2)); + $endpointIndex = bin2hex(substr($artifact, 2, 2)); $sourceId = bin2hex(substr($artifact, 4, 20)); } else { throw new \Exception('Missing SAMLart parameter.'); } - $metadataHandler = SimpleSAML_Metadata_MetaDataStorageHandler::getMetadataHandler(); + $metadataHandler = MetaDataStorageHandler::getMetadataHandler(); $idpMetadata = $metadataHandler->getMetaDataConfigForSha1($sourceId, 'saml20-idp-remote'); if ($idpMetadata === null) { - throw new \Exception('No metadata found for remote provider with SHA1 ID: ' . var_export($sourceId, true)); + throw new \Exception('No metadata found for remote provider with SHA1 ID: '.var_export($sourceId, true)); } $endpoint = null; foreach ($idpMetadata->getEndpoints('ArtifactResolutionService') as $ep) { - if ($ep['index'] === hexdec($endpointIndex)) { + if ($ep['index'] === hexdec($endpointIndex)) { $endpoint = $ep; break; } @@ -107,7 +110,7 @@ public function receive() throw new \Exception('No ArtifactResolutionService with the correct index.'); } - Utils::getContainer()->getLogger()->debug("ArtifactResolutionService endpoint being used is := " . $endpoint['Location']); + Utils::getContainer()->getLogger()->debug("ArtifactResolutionService endpoint being used is := ".$endpoint['Location']); //Construct the ArtifactResolve Request $ar = new ArtifactResolve(); @@ -119,7 +122,7 @@ public function receive() $ar->setDestination($endpoint['Location']); /* Sign the request */ - \sspmod_saml_Message::addSign($this->spMetadata, $idpMetadata, $ar); // Shoaib - moved from the SOAPClient. + \SimpleSAML\Module\saml\Message::addSign($this->spMetadata, $idpMetadata, $ar); // Shoaib - moved from the SOAPClient. $soap = new SOAPClient(); @@ -139,7 +142,7 @@ public function receive() } $samlResponse = Message::fromXML($xml); - $samlResponse->addValidator(array(get_class($this), 'validateSignature'), $artifactResponse); + $samlResponse->addValidator([get_class($this), 'validateSignature'], $artifactResponse); if (isset($_REQUEST['RelayState'])) { $samlResponse->setRelayState($_REQUEST['RelayState']); @@ -148,14 +151,17 @@ public function receive() return $samlResponse; } + /** - * @param \SimpleSAML_Configuration $sp + * @param \SimpleSAML\Configuration $sp + * @return void */ - public function setSPMetadata(SimpleSAML_Configuration $sp) + public function setSPMetadata(Configuration $sp) { $this->spMetadata = $sp; } + /** * A validator which returns true if the ArtifactResponse was signed with the given key * diff --git a/vendor/simplesamlphp/saml2/src/SAML2/HTTPPost.php b/vendor/simplesamlphp/saml2/src/SAML2/HTTPPost.php index 95a704c276..3109f15fbf 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/HTTPPost.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/HTTPPost.php @@ -38,7 +38,7 @@ public function send(Message $message) $msgType = 'SAMLResponse'; } - $post = array(); + $post = []; $post[$msgType] = $msgStr; if ($relayState !== null) { @@ -48,6 +48,7 @@ public function send(Message $message) Utils::getContainer()->postRedirect($destination, $post); } + /** * Receive a SAML 2 message sent using the HTTP-POST binding. * diff --git a/vendor/simplesamlphp/saml2/src/SAML2/HTTPRedirect.php b/vendor/simplesamlphp/saml2/src/SAML2/HTTPRedirect.php index 501a32058a..18533dbed1 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/HTTPRedirect.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/HTTPRedirect.php @@ -3,6 +3,7 @@ namespace SAML2; use RobRichards\XMLSecLibs\XMLSecurityKey; +use Webmozart\Assert\Assert; /** * Class which implements the HTTP-Redirect binding. @@ -13,6 +14,7 @@ class HTTPRedirect extends Binding { const DEFLATE = 'urn:oasis:names:tc:SAML:2.0:bindings:URL-Encoding:DEFLATE'; + /** * Create the redirect URL for a message. * @@ -49,47 +51,49 @@ public function getRedirectURL(Message $message) $msg .= urlencode($msgStr); if ($relayState !== null) { - $msg .= '&RelayState=' . urlencode($relayState); + $msg .= '&RelayState='.urlencode($relayState); } if ($key !== null) { /* Add the signature. */ - $msg .= '&SigAlg=' . urlencode($key->type); + $msg .= '&SigAlg='.urlencode($key->type); $signature = $key->signData($msg); - $msg .= '&Signature=' . urlencode(base64_encode($signature)); + $msg .= '&Signature='.urlencode(base64_encode($signature)); } if (strpos($destination, '?') === false) { - $destination .= '?' . $msg; + $destination .= '?'.$msg; } else { - $destination .= '&' . $msg; + $destination .= '&'.$msg; } return $destination; } + /** * Send a SAML 2 message using the HTTP-Redirect binding. - * * Note: This function never returns. * * @param \SAML2\Message $message The message we should send. + * @return void */ public function send(Message $message) { $destination = $this->getRedirectURL($message); - Utils::getContainer()->getLogger()->debug('Redirect to ' . strlen($destination) . ' byte URL: ' . $destination); + Utils::getContainer()->getLogger()->debug('Redirect to '.strlen($destination).' byte URL: '.$destination); Utils::getContainer()->redirect($destination); } + /** * Receive a SAML 2 message sent using the HTTP-Redirect binding. * * Throws an exception if it is unable receive the message. * - * @return \SAML2\Message The received message. * @throws \Exception + * @return \SAML2\Message The received message. * * NPath is currently too high but solving that just moves code around. * @SuppressWarnings(PHPMD.NPathComplexity) @@ -106,7 +110,7 @@ public function receive() } if (isset($data['SAMLEncoding']) && $data['SAMLEncoding'] !== self::DEFLATE) { - throw new \Exception('Unknown SAMLEncoding: ' . var_export($data['SAMLEncoding'], true)); + throw new \Exception('Unknown SAMLEncoding: '.var_export($data['SAMLEncoding'], true)); } $message = base64_decode($message); @@ -136,17 +140,18 @@ public function receive() throw new \Exception('Missing signature algorithm.'); } - $signData = array( + $signData = [ 'Signature' => $data['Signature'], 'SigAlg' => $data['SigAlg'], 'Query' => $data['SignedQuery'], - ); + ]; - $message->addValidator(array(get_class($this), 'validateSignature'), $signData); + $message->addValidator([get_class($this), 'validateSignature'], $signData); return $message; } + /** * Helper function to parse query data. * @@ -154,7 +159,7 @@ public function receive() * It also adds a new parameter, SignedQuery, which contains the data that is * signed. * - * @return string The query data that is signed. + * @return array The query data that is signed. */ private static function parseQuery() { @@ -163,7 +168,7 @@ private static function parseQuery() * to the raw (urlencoded) values. This is required because different software * can urlencode to different values. */ - $data = array(); + $data = []; $relayState = ''; $sigAlg = ''; $sigQuery = ''; @@ -182,22 +187,23 @@ private static function parseQuery() switch ($name) { case 'SAMLRequest': case 'SAMLResponse': - $sigQuery = $name . '=' . $value; + $sigQuery = $name.'='.$value; break; case 'RelayState': - $relayState = '&RelayState=' . $value; + $relayState = '&RelayState='.$value; break; case 'SigAlg': - $sigAlg = '&SigAlg=' . $value; + $sigAlg = '&SigAlg='.$value; break; } } - $data['SignedQuery'] = $sigQuery . $relayState . $sigAlg; + $data['SignedQuery'] = $sigQuery.$relayState.$sigAlg; return $data; } + /** * Validate the signature on a HTTP-Redirect message. * @@ -206,12 +212,13 @@ private static function parseQuery() * @param array $data The data we need to validate the query string. * @param XMLSecurityKey $key The key we should validate the query against. * @throws \Exception + * @return void */ public static function validateSignature(array $data, XMLSecurityKey $key) { - assert(array_key_exists("Query", $data)); - assert(array_key_exists("SigAlg", $data)); - assert(array_key_exists("Signature", $data)); + Assert::keyExists($data, "Query"); + Assert::keyExists($data, "SigAlg"); + Assert::keyExists($data, "Signature"); $query = $data['Query']; $sigAlg = $data['SigAlg']; @@ -219,7 +226,7 @@ public static function validateSignature(array $data, XMLSecurityKey $key) $signature = base64_decode($signature); - if ($key->type !== XMLSecurityKey::RSA_SHA1) { + if ($key->type !== XMLSecurityKey::RSA_SHA256) { throw new \Exception('Invalid key type for validating signature on query string.'); } if ($key->type !== $sigAlg) { diff --git a/vendor/simplesamlphp/saml2/src/SAML2/LogoutRequest.php b/vendor/simplesamlphp/saml2/src/SAML2/LogoutRequest.php index ee76dddfa8..88c1340421 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/LogoutRequest.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/LogoutRequest.php @@ -4,6 +4,8 @@ use RobRichards\XMLSecLibs\XMLSecEnc; use RobRichards\XMLSecLibs\XMLSecurityKey; +use SAML2\XML\saml\NameID; +use Webmozart\Assert\Assert; /** * Class for SAML 2 logout request messages. @@ -42,6 +44,7 @@ class LogoutRequest extends Request */ private $sessionIndexes; + /** * Constructor for SAML 2 logout request messages. * @@ -52,14 +55,14 @@ public function __construct(\DOMElement $xml = null) { parent::__construct('LogoutRequest', $xml); - $this->sessionIndexes = array(); + $this->sessionIndexes = []; if ($xml === null) { return; } if ($xml->hasAttribute('NotOnOrAfter')) { - $this->notOnOrAfter = Utils::xsDateTimeToTimestamp($xml->getAttribute('NotOnOrAfter')); + $this->setNotOnOrAfter(Utils::xsDateTimeToTimestamp($xml->getAttribute('NotOnOrAfter'))); } $nameId = Utils::xpQuery($xml, './saml_assertion:NameID | ./saml_assertion:EncryptedID/xenc:EncryptedData'); @@ -71,9 +74,9 @@ public function __construct(\DOMElement $xml = null) $nameId = $nameId[0]; if ($nameId->localName === 'EncryptedData') { /* The NameID element is encrypted. */ - $this->encryptedNameId = $nameId; + $this->setEncryptedNameId($nameId); } else { - $this->nameId = new XML\saml\NameID($nameId); + $this->setNameId(new NameID($nameId)); } $sessionIndexes = Utils::xpQuery($xml, './saml_protocol:SessionIndex'); @@ -82,6 +85,7 @@ public function __construct(\DOMElement $xml = null) } } + /** * Retrieve the expiration time of this request. * @@ -92,36 +96,41 @@ public function getNotOnOrAfter() return $this->notOnOrAfter; } + /** * Set the expiration time of this request. * * @param int|null $notOnOrAfter The expiration time of this request. + * @return void */ public function setNotOnOrAfter($notOnOrAfter) { - assert(is_int($notOnOrAfter) || is_null($notOnOrAfter)); + Assert::nullOrInteger($notOnOrAfter); $this->notOnOrAfter = $notOnOrAfter; } + /** * Check whether the NameId is encrypted. * - * @return true if the NameId is encrypted, false if not. + * @return bool True if the NameId is encrypted, false if not. */ public function isNameIdEncrypted() { - if ($this->encryptedNameId !== null) { + if ($this->getEncryptedNameId() !== null) { return true; } return false; } + /** * Encrypt the NameID in the LogoutRequest. * * @param XMLSecurityKey $key The encryption key. + * @return void */ public function encryptNameId(XMLSecurityKey $key) { @@ -129,7 +138,7 @@ public function encryptNameId(XMLSecurityKey $key) $doc = DOMDocumentFactory::create(); $root = $doc->createElement('root'); $doc->appendChild($root); - $this->nameId->toXML($root); + $this->getNameId()->toXML($root); $nameId = $root->firstChild; Utils::getContainer()->debugMessage($nameId, 'encrypt'); @@ -143,61 +152,89 @@ public function encryptNameId(XMLSecurityKey $key) $symmetricKey->generateSessionKey(); $enc->encryptKey($key, $symmetricKey); - $this->encryptedNameId = $enc->encryptNode($symmetricKey); - $this->nameId = null; + $this->setEncryptedNameId($enc->encryptNode($symmetricKey)); + $this->setNameId(null); } + /** * Decrypt the NameID in the LogoutRequest. * * @param XMLSecurityKey $key The decryption key. * @param array $blacklist Blacklisted decryption algorithms. + * @return void */ - public function decryptNameId(XMLSecurityKey $key, array $blacklist = array()) + public function decryptNameId(XMLSecurityKey $key, array $blacklist = []) { - if ($this->encryptedNameId === null) { + if ($this->getEncryptedNameId() === null) { /* No NameID to decrypt. */ - return; } - $nameId = Utils::decryptElement($this->encryptedNameId, $key, $blacklist); + $nameId = Utils::decryptElement($this->getEncryptedNameId(), $key, $blacklist); Utils::getContainer()->debugMessage($nameId, 'decrypt'); - $this->nameId = new XML\saml\NameID($nameId); + $this->setNameId(new NameID($nameId)); - $this->encryptedNameId = null; + $this->setEncryptedNameId(null); } + /** * Retrieve the name identifier of the session that should be terminated. * - * @return \SAML2\XML\saml\NameID The name identifier of the session that should be terminated. * @throws \Exception + * @return \SAML2\XML\saml\NameID The name identifier of the session that should be terminated. */ public function getNameId() { - if ($this->encryptedNameId !== null) { + if ($this->getEncryptedNameId() !== null) { throw new \Exception('Attempted to retrieve encrypted NameID without decrypting it first.'); } return $this->nameId; } + /** * Set the name identifier of the session that should be terminated. * * @param \SAML2\XML\saml\NameID|array|null $nameId The name identifier of the session that should be terminated. + * @return void */ public function setNameId($nameId) { - assert(is_array($nameId) || $nameId instanceof XML\saml\NameID); + Assert::true(is_array($nameId) || $nameId instanceof NameID || is_null($nameId)); if (is_array($nameId)) { - $nameId = XML\saml\NameID::fromArray($nameId); + $nameId = NameID::fromArray($nameId); } $this->nameId = $nameId; } + + /** + * Retrieve the encrypted name identifier. + * + * @return \DOMElement|null + */ + private function getEncryptedNameId() + { + return $this->encryptedNameId; + } + + + /** + * Set the encrypted name identifier. + * + * @param \DOMElement|null $nameId The name identifier of the session that should be terminated. + * @return void + */ + private function setEncryptedNameId(\DOMElement $nameId = null) + { + $this->encryptedNameId = $nameId; + } + + /** * Retrieve the SessionIndexes of the sessions that should be terminated. * @@ -208,16 +245,19 @@ public function getSessionIndexes() return $this->sessionIndexes; } + /** * Set the SessionIndexes of the sessions that should be terminated. * * @param array $sessionIndexes The SessionIndexes, or an empty array if all sessions should be terminated. + * @return void */ public function setSessionIndexes(array $sessionIndexes) { $this->sessionIndexes = $sessionIndexes; } + /** * Retrieve the sesion index of the session that should be terminated. * @@ -232,22 +272,25 @@ public function getSessionIndex() return $this->sessionIndexes[0]; } + /** * Set the sesion index of the session that should be terminated. * * @param string|null $sessionIndex The sesion index of the session that should be terminated. + * @return void */ public function setSessionIndex($sessionIndex) { - assert(is_string($sessionIndex) || is_null($sessionIndex)); + Assert::nullOrString($sessionIndex); if (is_null($sessionIndex)) { - $this->sessionIndexes = array(); + $this->sessionIndexes = []; } else { - $this->sessionIndexes = array($sessionIndex); + $this->sessionIndexes = [$sessionIndex]; } } + /** * Convert this logout request message to an XML element. * @@ -258,15 +301,15 @@ public function toUnsignedXML() $root = parent::toUnsignedXML(); if ($this->notOnOrAfter !== null) { - $root->setAttribute('NotOnOrAfter', gmdate('Y-m-d\TH:i:s\Z', $this->notOnOrAfter)); + $root->setAttribute('NotOnOrAfter', gmdate('Y-m-d\TH:i:s\Z', $this->getNotOnOrAfter())); } - if ($this->encryptedNameId === null) { + if ($this->getEncryptedNameId() === null) { $this->nameId->toXML($root); } else { - $eid = $root->ownerDocument->createElementNS(Constants::NS_SAML, 'saml:' . 'EncryptedID'); + $eid = $root->ownerDocument->createElementNS(Constants::NS_SAML, 'saml:'.'EncryptedID'); $root->appendChild($eid); - $eid->appendChild($root->ownerDocument->importNode($this->encryptedNameId, true)); + $eid->appendChild($root->ownerDocument->importNode($this->getEncryptedNameId(), true)); } foreach ($this->sessionIndexes as $sessionIndex) { diff --git a/vendor/simplesamlphp/saml2/src/SAML2/Message.php b/vendor/simplesamlphp/saml2/src/SAML2/Message.php index a318ff3034..1dace0cd27 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/Message.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/Message.php @@ -4,7 +4,9 @@ use RobRichards\XMLSecLibs\XMLSecurityKey; use SAML2\Utilities\Temporal; +use SAML2\XML\saml\Issuer; use SAML2\XML\samlp\Extensions; +use Webmozart\Assert\Assert; /** * Base class for all SAML 2 messages. @@ -14,6 +16,7 @@ * * * @SuppressWarnings(PHPMD.ExcessiveClassComplexity) + * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ abstract class Message implements SignedElement { @@ -22,7 +25,7 @@ abstract class Message implements SignedElement * * @var array */ - protected $extensions; + protected $extensions = []; /** * The name of the root element of the DOM tree for the message. @@ -118,6 +121,7 @@ abstract class Message implements SignedElement */ private $signatureMethod; + /** * Initialize a message. * @@ -135,13 +139,13 @@ abstract class Message implements SignedElement */ protected function __construct($tagName, \DOMElement $xml = null) { - assert(is_string($tagName)); + Assert::string($tagName); $this->tagName = $tagName; $this->id = Utils::getContainer()->generateId(); $this->issueInstant = Temporal::getTime(); - $this->certificates = array(); - $this->validators = array(); + $this->certificates = []; + $this->validators = []; if ($xml === null) { return; @@ -169,7 +173,7 @@ protected function __construct($tagName, \DOMElement $xml = null) $issuer = Utils::xpQuery($xml, './saml_assertion:Issuer'); if (!empty($issuer)) { - $this->issuer = new XML\saml\Issuer($issuer[0]); + $this->issuer = new Issuer($issuer[0]); if ($this->issuer->Format === Constants::NAMEID_ENTITY) { $this->issuer = $this->issuer->value; } @@ -189,6 +193,7 @@ protected function __construct($tagName, \DOMElement $xml = null) * this object to do the verification. * * @param \DOMElement $xml The SAML message whose signature we want to validate. + * @return void */ private function validateSignature(\DOMElement $xml) { @@ -201,10 +206,10 @@ private function validateSignature(\DOMElement $xml) if ($sig !== false) { $this->messageContainedSignatureUponConstruction = true; $this->certificates = $sig['Certificates']; - $this->validators[] = array( - 'Function' => array('\SAML2\Utils', 'validateSignature'), + $this->validators[] = [ + 'Function' => ['\SAML2\Utils', 'validateSignature'], 'Data' => $sig, - ); + ]; $this->signatureMethod = $signatureMethod[0]->value; } } catch (\Exception $e) { @@ -221,17 +226,17 @@ private function validateSignature(\DOMElement $xml) * * @param callback $function The function which should be called * @param mixed $data The data that should be included as the first parameter to the function + * @return void */ - public function addValidator($function, $data) + public function addValidator(callable $function, $data) { - assert(is_callable($function)); - - $this->validators[] = array( + $this->validators[] = [ 'Function' => $function, 'Data' => $data, - ); + ]; } + /** * Validate this message against a public key. * @@ -240,10 +245,8 @@ public function addValidator($function, $data) * validation fails. * * @param XMLSecurityKey $key The key we should check against - * - * @return bool true on success, false when we don't have a signature - * * @throws \Exception + * @return bool true on success, false when we don't have a signature */ public function validate(XMLSecurityKey $key) { @@ -251,7 +254,7 @@ public function validate(XMLSecurityKey $key) return false; } - $exceptions = array(); + $exceptions = []; foreach ($this->validators as $validator) { $function = $validator['Function']; @@ -271,6 +274,7 @@ public function validate(XMLSecurityKey $key) throw $exceptions[0]; } + /** * Retrieve the identifier of this message. * @@ -281,18 +285,21 @@ public function getId() return $this->id; } + /** * Set the identifier of this message. * * @param string $id The new identifier of this message + * @return void */ public function setId($id) { - assert(is_string($id)); + Assert::string($id); $this->id = $id; } + /** * Retrieve the issue timestamp of this message. * @@ -303,18 +310,21 @@ public function getIssueInstant() return $this->issueInstant; } + /** * Set the issue timestamp of this message. * * @param int $issueInstant The new issue timestamp of this message, as an UNIX timestamp + * @return void */ public function setIssueInstant($issueInstant) { - assert(is_int($issueInstant)); + Assert::integer($issueInstant); $this->issueInstant = $issueInstant; } + /** * Retrieve the destination of this message. * @@ -325,41 +335,42 @@ public function getDestination() return $this->destination; } + /** * Set the destination of this message. * * @param string|null $destination The new destination of this message + * @return void */ public function setDestination($destination) { - assert(is_string($destination) || is_null($destination)); + Assert::nullOrString($destination); $this->destination = $destination; } + /** * Set the given consent for this message. - * - * Most likely (though not required) a value of rn:oasis:names:tc:SAML:2.0:consent. + * Most likely (though not required) a value of urn:oasis:names:tc:SAML:2.0:consent. * * @see \SAML2\Constants - * * @param string $consent + * @return void */ public function setConsent($consent) { - assert(is_string($consent)); + Assert::string($consent); $this->consent = $consent; } + /** - * Set the given consent for this message. - * - * Most likely (though not required) a value of rn:oasis:names:tc:SAML:2.0:consent. + * Get the given consent for this message. + * Most likely (though not required) a value of urn:oasis:names:tc:SAML:2.0:consent. * * @see \SAML2\Constants - * * @return string Consent */ public function getConsent() @@ -367,6 +378,7 @@ public function getConsent() return $this->consent; } + /** * Retrieve the issuer if this message. * @@ -374,25 +386,28 @@ public function getConsent() */ public function getIssuer() { - if (is_string($this->issuer) || $this->issuer instanceof XML\saml\Issuer) { + if (is_string($this->issuer) || $this->issuer instanceof Issuer) { return $this->issuer; } return null; } + /** * Set the issuer of this message. * * @param string|\SAML2\XML\saml\Issuer|null $issuer The new issuer of this message + * @return void */ public function setIssuer($issuer) { - assert(is_string($issuer) || $issuer instanceof XML\saml\Issuer || is_null($issuer)); + Assert::true(is_string($issuer) || $issuer instanceof Issuer || is_null($issuer)); $this->issuer = $issuer; } + /** * Query whether or not the message contained a signature at the root level when the object was constructed. * @@ -403,6 +418,7 @@ public function isMessageConstructedWithSignature() return $this->messageContainedSignatureUponConstruction; } + /** * Retrieve the RelayState associated with this message. * @@ -413,21 +429,23 @@ public function getRelayState() return $this->relayState; } + /** * Set the RelayState associated with this message. * * @param string|null $relayState The new RelayState + * @return void */ public function setRelayState($relayState) { - assert(is_string($relayState) || is_null($relayState)); + Assert::nullOrString($relayState); $this->relayState = $relayState; } + /** * Convert this message to an unsigned XML document. - * * This method does not sign the resulting XML document. * * @return \DOMElement The root element of the DOM tree @@ -457,7 +475,7 @@ public function toUnsignedXML() if ($this->issuer !== null) { if (is_string($this->issuer)) { Utils::addString($root, Constants::NS_SAML, 'saml:Issuer', $this->issuer); - } elseif ($this->issuer instanceof XML\saml\Issuer) { + } elseif ($this->issuer instanceof Issuer) { $this->issuer->toXML($root); } } @@ -472,7 +490,6 @@ public function toUnsignedXML() /** * Convert this message to a signed XML document. - * * This method sign the resulting XML document if the private key for * the signature is set. * @@ -506,6 +523,7 @@ public function toSignedXML() return $root; } + /** * Retrieve the private key we should use to sign the message. * @@ -516,30 +534,33 @@ public function getSignatureKey() return $this->signatureKey; } + /** * Set the private key we should use to sign the message. - * * If the key is null, the message will be sent unsigned. * * @param XMLSecurityKey|null $signatureKey + * @return void */ public function setSignatureKey(XMLSecurityKey $signatureKey = null) { $this->signatureKey = $signatureKey; } + /** * Set the certificates that should be included in the message. - * * The certificates should be strings with the PEM encoded data. * * @param array $certificates An array of certificates + * @return void */ public function setCertificates(array $certificates) { $this->certificates = $certificates; } + /** * Retrieve the certificates that are included in the message. * @@ -550,14 +571,13 @@ public function getCertificates() return $this->certificates; } + /** * Convert an XML element into a message. * * @param \DOMElement $xml The root XML element - * - * @return \SAML2\Message The message - * * @throws \Exception + * @return \SAML2\Message The message */ public static function fromXML(\DOMElement $xml) { @@ -585,28 +605,42 @@ public static function fromXML(\DOMElement $xml) } } + /** * Retrieve the Extensions. * - * @return \SAML2\XML\samlp\Extensions + * @return \SAML2\XML\samlp\Extensions[] */ public function getExtensions() { return $this->extensions; } + /** * Set the Extensions. * - * @param array|null $extensions The Extensions + * @param array $extensions The Extensions + * @return void */ - public function setExtensions($extensions) + public function setExtensions(array $extensions) { - assert(is_array($extensions) || is_null($extensions)); - $this->extensions = $extensions; } + + /** + * Add an Extension. + * + * @param \SAML2\XML\samlp\Extensions $extensions The Extensions + * @return void + */ + public function addExtension(Extensions $extension) + { + $this->extensions[] = $extension; + } + + /** * @return null|string */ diff --git a/vendor/simplesamlphp/saml2/src/SAML2/Response.php b/vendor/simplesamlphp/saml2/src/SAML2/Response.php index d11f9d0427..76076e6671 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/Response.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/Response.php @@ -14,6 +14,7 @@ class Response extends StatusResponse */ private $assertions; + /** * Constructor for SAML 2 response messages. * @@ -23,7 +24,7 @@ public function __construct(\DOMElement $xml = null) { parent::__construct('Response', $xml); - $this->assertions = array(); + $this->assertions = []; if ($xml === null) { return; @@ -42,6 +43,7 @@ public function __construct(\DOMElement $xml = null) } } + /** * Retrieve the assertions in this response. * @@ -52,16 +54,19 @@ public function getAssertions() return $this->assertions; } + /** * Set the assertions that should be included in this response. * - * @param \SAML2\Assertion[]|\SAML2\EncryptedAssertion[] The assertions. + * @param \SAML2\Assertion[]|\SAML2\EncryptedAssertion[] $assertions The assertions. + * @return void */ public function setAssertions(array $assertions) { $this->assertions = $assertions; } + /** * Convert the response message to an XML element. * diff --git a/vendor/simplesamlphp/saml2/src/SAML2/Response/Exception/PreconditionNotMetException.php b/vendor/simplesamlphp/saml2/src/SAML2/Response/Exception/PreconditionNotMetException.php index 41a9ada0d7..fe0a14c1e7 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/Response/Exception/PreconditionNotMetException.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/Response/Exception/PreconditionNotMetException.php @@ -9,6 +9,10 @@ */ class PreconditionNotMetException extends InvalidResponseException { + /** + * @param Result $result + * @return PreconditionNotMetException + */ public static function createFromValidationResult(Result $result) { $message = sprintf( diff --git a/vendor/simplesamlphp/saml2/src/SAML2/Response/Processor.php b/vendor/simplesamlphp/saml2/src/SAML2/Response/Processor.php index 89275f50f2..666de8198b 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/Response/Processor.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/Response/Processor.php @@ -48,17 +48,18 @@ class Processor */ private $responseIsSigned = false; + /** - * @param \Psr\Log\LoggerInterface $logger + * @param \Psr\Log\LoggerInterface $logger * */ public function __construct(LoggerInterface $logger) { $this->logger = $logger; - $this->signatureValidator = new Validator($logger); } + /** * @param \SAML2\Configuration\ServiceProvider $serviceProviderConfiguration * @param \SAML2\Configuration\IdentityProvider $identityProviderConfiguration @@ -88,10 +89,13 @@ public function process( return $this->processAssertions($response); } + /** * Checks the preconditions that must be valid in order for the response to be processed. * * @param \SAML2\Response $response + * @throws PreconditionNotMetException + * @return void */ private function enforcePreconditions(Response $response) { @@ -102,9 +106,12 @@ private function enforcePreconditions(Response $response) } } + /** * @param \SAML2\Response $response * @param \SAML2\Configuration\IdentityProvider $identityProviderConfiguration + * @throws InvalidResponseException + * @return void */ private function verifySignature( Response $response, @@ -132,9 +139,11 @@ private function verifySignature( } } + /** * @param \SAML2\Response $response - * + * @throws UnsignedResponseException + * @throws NoAssertionsFoundException * @return \SAML2\Assertion[] */ private function processAssertions(Response $response) diff --git a/vendor/simplesamlphp/saml2/src/SAML2/Response/Validation/ConstraintValidator.php b/vendor/simplesamlphp/saml2/src/SAML2/Response/Validation/ConstraintValidator.php index 47b2536923..2b761d6731 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/Response/Validation/ConstraintValidator.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/Response/Validation/ConstraintValidator.php @@ -6,5 +6,10 @@ interface ConstraintValidator { + /** + * @param Response $response + * @param Result $result + * @return void + */ public function validate(Response $response, Result $result); } diff --git a/vendor/simplesamlphp/saml2/src/SAML2/Response/Validation/ConstraintValidator/DestinationMatches.php b/vendor/simplesamlphp/saml2/src/SAML2/Response/Validation/ConstraintValidator/DestinationMatches.php index edd0eb8543..4e20831509 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/Response/Validation/ConstraintValidator/DestinationMatches.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/Response/Validation/ConstraintValidator/DestinationMatches.php @@ -15,11 +15,21 @@ class DestinationMatches implements */ private $expectedDestination; + /** + * Constructor for DestinationMatches + * @param Destination $destination + */ public function __construct(Destination $destination) { $this->expectedDestination = $destination; } + + /** + * @param Response $response + * @param Result $result + * @return void + */ public function validate(Response $response, Result $result) { $destination = $response->getDestination(); diff --git a/vendor/simplesamlphp/saml2/src/SAML2/Response/Validation/ConstraintValidator/IsSuccessful.php b/vendor/simplesamlphp/saml2/src/SAML2/Response/Validation/ConstraintValidator/IsSuccessful.php index 2accc7a043..1f17ae3409 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/Response/Validation/ConstraintValidator/IsSuccessful.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/Response/Validation/ConstraintValidator/IsSuccessful.php @@ -7,9 +7,13 @@ use SAML2\Response\Validation\ConstraintValidator; use SAML2\Response\Validation\Result; -class IsSuccessful implements - ConstraintValidator +class IsSuccessful implements ConstraintValidator { + /** + * @param \SAML2\Response $response + * @param \SAML2\Response\Validation\Result $result + * + */ public function validate( Response $response, Result $result @@ -19,6 +23,7 @@ public function validate( } } + /** * @param array $responseStatus * @@ -29,11 +34,12 @@ private function buildMessage(array $responseStatus) return sprintf( '%s%s%s', $this->truncateStatus($responseStatus['Code']), - $responseStatus['SubCode'] ? '/' . $this->truncateStatus($responseStatus['SubCode']) : '', - $responseStatus['Message'] ? ' ' . $responseStatus['Message'] : '' + $responseStatus['SubCode'] ? '/'.$this->truncateStatus($responseStatus['SubCode']) : '', + $responseStatus['Message'] ? ' '.$responseStatus['Message'] : '' ); } + /** * Truncate the status if it is prefixed by its urn. * @param string $status diff --git a/vendor/simplesamlphp/saml2/src/SAML2/Response/Validation/PreconditionValidator.php b/vendor/simplesamlphp/saml2/src/SAML2/Response/Validation/PreconditionValidator.php index c656cd1a81..54230ea570 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/Response/Validation/PreconditionValidator.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/Response/Validation/PreconditionValidator.php @@ -11,6 +11,11 @@ */ class PreconditionValidator extends Validator { + /** + * Constructor for PreconditionValidator + * + * @param Destination $destination + */ public function __construct(Destination $destination) { // move to DI diff --git a/vendor/simplesamlphp/saml2/src/SAML2/Response/Validation/Result.php b/vendor/simplesamlphp/saml2/src/SAML2/Response/Validation/Result.php index 9d8ae1748b..3310a4443c 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/Response/Validation/Result.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/Response/Validation/Result.php @@ -12,10 +12,13 @@ class Result /** * @var array */ - private $errors = array(); + private $errors = []; + /** * @param $message + * @throws InvalidArgumentException + * @return void */ public function addError($message) { @@ -26,6 +29,7 @@ public function addError($message) $this->errors[] = $message; } + /** * @return bool */ @@ -34,6 +38,7 @@ public function isValid() return empty($this->errors); } + /** * @return array */ diff --git a/vendor/simplesamlphp/saml2/src/SAML2/Response/Validation/Validator.php b/vendor/simplesamlphp/saml2/src/SAML2/Response/Validation/Validator.php index 39ca5670be..07ab3f79a9 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/Response/Validation/Validator.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/Response/Validation/Validator.php @@ -11,11 +11,21 @@ class Validator */ protected $constraints; + + /** + * @param ConstraintValidator $constraint + * @return void + */ public function addConstraintValidator(ConstraintValidator $constraint) { $this->constraints[] = $constraint; } + + /** + * @param Response $response + * @return Result + */ public function validate(Response $response) { $result = new Result(); diff --git a/vendor/simplesamlphp/saml2/src/SAML2/SOAP.php b/vendor/simplesamlphp/saml2/src/SAML2/SOAP.php index 86e2885841..a7686e151f 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/SOAP.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/SOAP.php @@ -3,7 +3,6 @@ namespace SAML2; use DOMDocument; - use SAML2\XML\ecp\Response as ECPResponse; /** @@ -13,6 +12,10 @@ */ class SOAP extends Binding { + /** + * @param Message $message + * @return string|bool The XML or false on error + */ public function getOutputToSend(Message $message) { $envelope = <<<SOAP @@ -34,7 +37,7 @@ public function getOutputToSend(Message $message) $header = $doc->getElementsByTagNameNS(Constants::NS_SOAP, 'Header')->item(0); $response = new ECPResponse; - $response->AssertionConsumerServiceURL = $this->getDestination() ?: $message->getDestination(); + $response->setAssertionConsumerServiceURL($this->getDestination() ?: $message->getDestination()); $response->toXML($header); @@ -54,12 +57,14 @@ public function getOutputToSend(Message $message) return $doc->saveXML(); } + /** * Send a SAML 2 message using the SOAP binding. * * Note: This function never returns. * * @param \SAML2\Message $message The message we should send. + * @return void * * @SuppressWarnings(PHPMD.ExitExpression) */ @@ -74,13 +79,12 @@ public function send(Message $message) exit(0); } + /** * Receive a SAML 2 message sent using the HTTP-POST binding. * - * Throws an exception if it is unable receive the message. - * + * @throws \Exception If unable to receive the message * @return \SAML2\Message The received message. - * @throws \Exception */ public function receive() { @@ -98,6 +102,9 @@ public function receive() return Message::fromXML($results[0]); } + /** + * @return string|bool + */ protected function getInputStream() { return file_get_contents('php://input'); diff --git a/vendor/simplesamlphp/saml2/src/SAML2/SOAPClient.php b/vendor/simplesamlphp/saml2/src/SAML2/SOAPClient.php index 12266073aa..2bd9e8819f 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/SOAPClient.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/SOAPClient.php @@ -4,8 +4,8 @@ use RobRichards\XMLSecLibs\XMLSecurityKey; use SAML2\Exception\RuntimeException; -use SimpleSAML_Configuration; -use SimpleSAML_Utilities; +use SimpleSAML\Configuration; +use Webmozart\Assert\Assert; /** * Implementation of the SAML 2.0 SOAP binding. @@ -18,31 +18,32 @@ class SOAPClient const START_SOAP_ENVELOPE = '<soap-env:Envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/"><soap-env:Header/><soap-env:Body>'; const END_SOAP_ENVELOPE = '</soap-env:Body></soap-env:Envelope>'; + /** * This function sends the SOAP message to the service location and returns SOAP response * * @param \SAML2\Message $msg The request that should be sent. - * @param \SimpleSAML_Configuration $srcMetadata The metadata of the issuer of the message. - * @param \SimpleSAML_Configuration $dstMetadata The metadata of the destination of the message. - * @return \SAML2\Message The response we received. + * @param \SimpleSAML\Configuration $srcMetadata The metadata of the issuer of the message. + * @param \SimpleSAML\Configuration $dstMetadata The metadata of the destination of the message. * @throws \Exception + * @return \SAML2\Message The response we received. */ - public function send(Message $msg, SimpleSAML_Configuration $srcMetadata, SimpleSAML_Configuration $dstMetadata = null) + public function send(Message $msg, Configuration $srcMetadata, Configuration $dstMetadata = null) { $issuer = $msg->getIssuer(); - $ctxOpts = array( - 'ssl' => array( + $ctxOpts = [ + 'ssl' => [ 'capture_peer_cert' => true, 'allow_self_signed' => true - ), - ); + ], + ]; // Determine if we are going to do a MutualSSL connection between the IdP and SP - Shoaib if ($srcMetadata->hasValue('saml.SOAPClient.certificate')) { $cert = $srcMetadata->getValue('saml.SOAPClient.certificate'); if ($cert !== false) { - $ctxOpts['ssl']['local_cert'] = SimpleSAML_Utilities::resolveCert( + $ctxOpts['ssl']['local_cert'] = \SimpleSAML\Utils\Config::resolveCert( $srcMetadata->getString('saml.SOAPClient.certificate') ); if ($srcMetadata->hasValue('saml.SOAPClient.privatekey_pass')) { @@ -51,13 +52,13 @@ public function send(Message $msg, SimpleSAML_Configuration $srcMetadata, Simple } } else { /* Use the SP certificate and privatekey if it is configured. */ - $privateKey = SimpleSAML_Utilities::loadPrivateKey($srcMetadata); - $publicKey = SimpleSAML_Utilities::loadPublicKey($srcMetadata); + $privateKey = \SimpleSAML\Utils\Crypto::loadPrivateKey($srcMetadata); + $publicKey = \SimpleSAML\Utils\Crypto::loadPublicKey($srcMetadata); if ($privateKey !== null && $publicKey !== null && isset($publicKey['PEM'])) { - $keyCertData = $privateKey['PEM'] . $publicKey['PEM']; - $file = SimpleSAML_Utilities::getTempDir() . '/' . sha1($keyCertData) . '.pem'; + $keyCertData = $privateKey['PEM'].$publicKey['PEM']; + $file = \SimpleSAML\Utils\System::getTempDir().'/'.sha1($keyCertData).'.pem'; if (!file_exists($file)) { - SimpleSAML_Utilities::writeFile($file, $keyCertData); + \SimpleSAML\Utils\System::writeFile($file, $keyCertData); } $ctxOpts['ssl']['local_cert'] = $file; if (isset($privateKey['password'])) { @@ -74,13 +75,13 @@ public function send(Message $msg, SimpleSAML_Configuration $srcMetadata, Simple if ($key['type'] !== 'X509Certificate') { continue; } - $certData .= "-----BEGIN CERTIFICATE-----\n" . - chunk_split($key['X509Certificate'], 64) . + $certData .= "-----BEGIN CERTIFICATE-----\n". + chunk_split($key['X509Certificate'], 64). "-----END CERTIFICATE-----\n"; } - $peerCertFile = SimpleSAML_Utilities::getTempDir() . '/' . sha1($certData) . '.pem'; + $peerCertFile = \SimpleSAML\Utils\System::getTempDir().'/'.sha1($certData).'.pem'; if (!file_exists($peerCertFile)) { - SimpleSAML_Utilities::writeFile($peerCertFile, $certData); + \SimpleSAML\Utils\System::writeFile($peerCertFile, $certData); } // create ssl context $ctxOpts['ssl']['verify_peer'] = true; @@ -97,11 +98,11 @@ public function send(Message $msg, SimpleSAML_Configuration $srcMetadata, Simple throw new \Exception('Unable to create SSL stream context'); } - $options = array( + $options = [ 'uri' => $issuer, 'location' => $msg->getDestination(), 'stream_context' => $context, - ); + ]; if ($srcMetadata->hasValue('saml.SOAPClient.proxyhost')) { $options['proxy_host'] = $srcMetadata->getValue('saml.SOAPClient.proxyhost'); @@ -115,12 +116,12 @@ public function send(Message $msg, SimpleSAML_Configuration $srcMetadata, Simple // Add soap-envelopes $request = $msg->toSignedXML(); - $request = self::START_SOAP_ENVELOPE . $request->ownerDocument->saveXML($request) . self::END_SOAP_ENVELOPE; + $request = self::START_SOAP_ENVELOPE.$request->ownerDocument->saveXML($request).self::END_SOAP_ENVELOPE; Utils::getContainer()->debugMessage($request, 'out'); $action = 'http://www.oasis-open.org/committees/security'; - $version = '1.1'; + $version = SOAP_1_1; $destination = $msg->getDestination(); /* Perform SOAP Request over HTTP */ @@ -154,11 +155,13 @@ public function send(Message $msg, SimpleSAML_Configuration $srcMetadata, Simple return $samlresponse; } + /** * Add a signature validator based on a SSL context. * * @param \SAML2\Message $msg The message we should add a validator to. * @param resource $context The stream context. + * @return void */ private static function addSSLValidator(Message $msg, $context) { @@ -190,9 +193,10 @@ private static function addSSLValidator(Message $msg, $context) return; } - $msg->addValidator(array('\SAML2\SOAPClient', 'validateSSL'), $keyInfo['key']); + $msg->addValidator(['\SAML2\SOAPClient', 'validateSSL'], $keyInfo['key']); } + /** * Validate a SOAP message against the certificate on the SSL connection. * @@ -202,7 +206,7 @@ private static function addSSLValidator(Message $msg, $context) */ public static function validateSSL($data, XMLSecurityKey $key) { - assert(is_string($data)); + Assert::string($data); $keyInfo = openssl_pkey_get_details($key->key); if ($keyInfo === false) { @@ -222,10 +226,12 @@ public static function validateSSL($data, XMLSecurityKey $key) Utils::getContainer()->getLogger()->debug('Message validated based on SSL certificate.'); } + /* * Extracts the SOAP Fault from SOAP message + * * @param $soapmessage Soap response needs to be type DOMDocument - * @return $soapfaultstring string|null + * @return string|null $soapfaultstring */ private function getSOAPFault($soapMessage) { @@ -240,7 +246,7 @@ private function getSOAPFault($soapMessage) // There is a fault element but we haven't found out what the fault string is $soapFaultString = "Unknown fault string found"; // find out the fault string - $faultStringElement = Utils::xpQuery($soapFaultElement, './soap-env:faultstring') ; + $faultStringElement = Utils::xpQuery($soapFaultElement, './soap-env:faultstring'); if (!empty($faultStringElement)) { return $faultStringElement[0]->textContent; } diff --git a/vendor/simplesamlphp/saml2/src/SAML2/Signature/AbstractChainedValidator.php b/vendor/simplesamlphp/saml2/src/SAML2/Signature/AbstractChainedValidator.php index 1be459e206..1ae888db68 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/Signature/AbstractChainedValidator.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/Signature/AbstractChainedValidator.php @@ -13,11 +13,18 @@ abstract class AbstractChainedValidator implements ChainedValidator */ protected $logger; + + /** + * Constructor for AbstractChainedValidator + * + * @param LoggerInterface $logger + */ public function __construct(LoggerInterface $logger) { $this->logger = $logger; } + /** * BC compatible version of the signature check * @@ -32,7 +39,7 @@ protected function validateElementWithKeys(SignedElement $element, $pemCandidate { $lastException = null; foreach ($pemCandidates as $index => $candidateKey) { - $key = new XMLSecurityKey(XMLSecurityKey::RSA_SHA1, array('type' => 'public')); + $key = new XMLSecurityKey(XMLSecurityKey::RSA_SHA256, ['type' => 'public']); $key->loadKey($candidateKey->getCertificate()); try { diff --git a/vendor/simplesamlphp/saml2/src/SAML2/Signature/ChainedValidator.php b/vendor/simplesamlphp/saml2/src/SAML2/Signature/ChainedValidator.php index efee82f6d5..4058de13ef 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/Signature/ChainedValidator.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/Signature/ChainedValidator.php @@ -15,7 +15,7 @@ interface ChainedValidator extends ValidatorInterface /** * Test whether or not this link in the chain can validate the signedElement signature. * - * @param \SAML2\SignedElement $signedElement + * @param \SAML2\SignedElement $signedElement * @param \SAML2\Configuration\CertificateProvider $configuration * * @return bool diff --git a/vendor/simplesamlphp/saml2/src/SAML2/Signature/FingerprintValidator.php b/vendor/simplesamlphp/saml2/src/SAML2/Signature/FingerprintValidator.php index 828ea5a732..10d5f1df64 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/Signature/FingerprintValidator.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/Signature/FingerprintValidator.php @@ -25,7 +25,10 @@ class FingerprintValidator extends AbstractChainedValidator */ private $fingerprintLoader; + /** + * @param LoggerInterface $logger + * @param FingerprintLoader $fingerprintLoader * @deprecated Please use full certificates instead. */ public function __construct( @@ -33,10 +36,16 @@ public function __construct( FingerprintLoader $fingerprintLoader ) { $this->fingerprintLoader = $fingerprintLoader; - parent::__construct($logger); } + + /** + * @param SignedElement $signedElement + * @param CertificateProvider $configuration + * + * @return bool + */ public function canValidate( SignedElement $signedElement, CertificateProvider $configuration @@ -60,6 +69,7 @@ public function canValidate( return true; } + /** * @param \SAML2\SignedElement $signedElement * @param \SAML2\Configuration\CertificateProvider $configuration @@ -76,7 +86,7 @@ public function hasValidSignature( $fingerprintCollection = $this->fingerprintLoader->loadFromConfiguration($configuration); - $pemCandidates = array(); + $pemCandidates = []; foreach ($this->certificates as $certificate) { /** @var \SAML2\Certificate\X509 $certificate */ $certificateFingerprint = $certificate->getFingerprint(); diff --git a/vendor/simplesamlphp/saml2/src/SAML2/Signature/PublicKeyValidator.php b/vendor/simplesamlphp/saml2/src/SAML2/Signature/PublicKeyValidator.php index 0812192869..0e13feba95 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/Signature/PublicKeyValidator.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/Signature/PublicKeyValidator.php @@ -21,6 +21,13 @@ class PublicKeyValidator extends AbstractChainedValidator */ private $keyLoader; + + /** + * Constructor for PublicKeyValidator + * + * @param LoggerInterface $logger + * @param KeyLoader $keyLoader + */ public function __construct(LoggerInterface $logger, KeyLoader $keyLoader) { $this->keyLoader = $keyLoader; @@ -28,6 +35,7 @@ public function __construct(LoggerInterface $logger, KeyLoader $keyLoader) parent::__construct($logger); } + /** * @param \SAML2\SignedElement $signedElement * @param \SAML2\Configuration\CertificateProvider $configuration @@ -43,6 +51,7 @@ public function canValidate( return !!count($this->configuredKeys); } + /** * @param \SAML2\SignedElement $signedElement * @param \SAML2\Configuration\CertificateProvider $configuration diff --git a/vendor/simplesamlphp/saml2/src/SAML2/Signature/Validator.php b/vendor/simplesamlphp/saml2/src/SAML2/Signature/Validator.php index 179b4d36fd..361e033d22 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/Signature/Validator.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/Signature/Validator.php @@ -18,11 +18,23 @@ class Validator */ private $logger; + + /** + * Constructor for Validator + * + * @param LoggerInterface $logger + */ public function __construct(LoggerInterface $logger) { $this->logger = $logger; } + + /** + * @param SignedElement $signedElement + * @oaram CertificateProvider $configuration + * @return bool + */ public function hasValidSignature( SignedElement $signedElement, CertificateProvider $configuration @@ -30,10 +42,10 @@ public function hasValidSignature( // should be DI $validator = new ValidatorChain( $this->logger, - array( + [ new PublicKeyValidator($this->logger, new KeyLoader()), new FingerprintValidator($this->logger, new FingerprintLoader()) - ) + ] ); return $validator->hasValidSignature($signedElement, $configuration); diff --git a/vendor/simplesamlphp/saml2/src/SAML2/Signature/ValidatorChain.php b/vendor/simplesamlphp/saml2/src/SAML2/Signature/ValidatorChain.php index 9a31077b16..8cb4ec7f25 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/Signature/ValidatorChain.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/Signature/ValidatorChain.php @@ -22,7 +22,8 @@ class ValidatorChain implements ValidatorInterface /** * @var \SAML2\Signature\ChainedValidator[] */ - private $validators = array(); + private $validators = []; + /** * @param \Psr\Log\LoggerInterface $logger @@ -38,14 +39,17 @@ public function __construct(LoggerInterface $logger, array $validators) } } + /** * @param \SAML2\Signature\ChainedValidator $validator + * @return void */ public function appendValidator(ChainedValidator $validator) { $this->validators[] = $validator; } + /** * @param \SAML2\SignedElement $signedElement * @param \SAML2\Configuration\CertificateProvider $configuration @@ -74,7 +78,7 @@ public function hasValidSignature( throw new MissingConfigurationException(sprintf( 'No certificates or fingerprints have been configured%s', - $configuration->has('entityid') ? ' for "' . $configuration->get('entityid') . '"' : '' + $configuration->has('entityid') ? ' for "'.$configuration->get('entityid').'"' : '' )); } } diff --git a/vendor/simplesamlphp/saml2/src/SAML2/SignedElement.php b/vendor/simplesamlphp/saml2/src/SAML2/SignedElement.php index 819e8f7653..261b7192c8 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/SignedElement.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/SignedElement.php @@ -22,15 +22,17 @@ interface SignedElement */ public function validate(XMLSecurityKey $key); + /** * Set the certificates that should be included in the element. - * * The certificates should be strings with the PEM encoded data. * * @param array $certificates An array of certificates. + * @return void */ public function setCertificates(array $certificates); + /** * Retrieve the certificates that are included in the element (if any). * @@ -38,6 +40,7 @@ public function setCertificates(array $certificates); */ public function getCertificates(); + /** * Retrieve the private key we should use to sign the element. * @@ -45,12 +48,13 @@ public function getCertificates(); */ public function getSignatureKey(); + /** * Set the private key we should use to sign the element. - * * If the key is null, the message will be sent unsigned. * * @param XMLSecurityKey|null $signatureKey + * @return void */ public function setSignatureKey(XMLSecurityKey $signatureKey = null); } diff --git a/vendor/simplesamlphp/saml2/src/SAML2/SignedElementHelper.php b/vendor/simplesamlphp/saml2/src/SAML2/SignedElementHelper.php index c502e038c3..d6f8c02a0e 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/SignedElementHelper.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/SignedElementHelper.php @@ -36,6 +36,7 @@ class SignedElementHelper implements SignedElement */ private $validators; + /** * Initialize the helper class. * @@ -43,8 +44,8 @@ class SignedElementHelper implements SignedElement */ protected function __construct(\DOMElement $xml = null) { - $this->certificates = array(); - $this->validators = array(); + $this->certificates = []; + $this->validators = []; if ($xml === null) { return; @@ -56,16 +57,17 @@ protected function __construct(\DOMElement $xml = null) if ($sig !== false) { $this->certificates = $sig['Certificates']; - $this->validators[] = array( - 'Function' => array('\SAML2\Utils', 'validateSignature'), + $this->validators[] = [ + 'Function' => ['\SAML2\Utils', 'validateSignature'], 'Data' => $sig, - ); + ]; } } catch (\Exception $e) { /* Ignore signature validation errors. */ } } + /** * Add a method for validating this element. * @@ -73,17 +75,17 @@ protected function __construct(\DOMElement $xml = null) * * @param callback $function The function which should be called. * @param mixed $data The data that should be included as the first parameter to the function. + * @return void */ - public function addValidator($function, $data) + public function addValidator(callable $function, $data) { - assert(is_callable($function)); - - $this->validators[] = array( + $this->validators[] = [ 'Function' => $function, 'Data' => $data, - ); + ]; } + /** * Validate this element against a public key. * @@ -92,8 +94,8 @@ public function addValidator($function, $data) * validation fails. * * @param XMLSecurityKey $key The key we should check against. - * @return boolean true on success, false when we don't have a signature. * @throws \Exception + * @return boolean true on success, false when we don't have a signature. */ public function validate(XMLSecurityKey $key) { @@ -101,7 +103,7 @@ public function validate(XMLSecurityKey $key) return false; } - $exceptions = array(); + $exceptions = []; foreach ($this->validators as $validator) { $function = $validator['Function']; @@ -121,6 +123,7 @@ public function validate(XMLSecurityKey $key) throw $exceptions[0]; } + /** * Retrieve the private key we should use to sign the message. * @@ -131,30 +134,35 @@ public function getSignatureKey() return $this->signatureKey; } + /** * Set the private key we should use to sign the message. * * If the key is null, the message will be sent unsigned. * * @param XMLSecurityKey|null $signatureKey + * @return void */ public function setSignatureKey(XMLSecurityKey $signatureKey = null) { $this->signatureKey = $signatureKey; } + /** * Set the certificates that should be included in the message. * * The certificates should be strings with the PEM encoded data. * * @param array $certificates An array of certificates. + * @return void */ public function setCertificates(array $certificates) { $this->certificates = $certificates; } + /** * Retrieve the certificates that are included in the message. * @@ -165,6 +173,7 @@ public function getCertificates() return $this->certificates; } + /** * Retrieve certificates that sign this element. * @@ -172,16 +181,15 @@ public function getCertificates() */ public function getValidatingCertificates() { - $ret = array(); + $ret = []; foreach ($this->certificates as $cert) { - /* Construct a PEM formatted certificate */ - $pemCert = "-----BEGIN CERTIFICATE-----\n" . - chunk_split($cert, 64) . + $pemCert = "-----BEGIN CERTIFICATE-----\n". + chunk_split($cert, 64). "-----END CERTIFICATE-----\n"; /* Extract the public key from the certificate for validation. */ - $key = new XMLSecurityKey(XMLSecurityKey::RSA_SHA1, array('type'=>'public')); + $key = new XMLSecurityKey(XMLSecurityKey::RSA_SHA256, ['type'=>'public']); $key->loadKey($pemCert); try { @@ -197,6 +205,7 @@ public function getValidatingCertificates() return $ret; } + /** * Sign the given XML element. * @@ -208,7 +217,6 @@ protected function signElement(\DOMElement $root, \DOMElement $insertBefore = nu { if ($this->signatureKey === null) { /* We cannot sign this element. */ - return null; } diff --git a/vendor/simplesamlphp/saml2/src/SAML2/StatusResponse.php b/vendor/simplesamlphp/saml2/src/SAML2/StatusResponse.php index d70a9585f5..44b6712c36 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/StatusResponse.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/StatusResponse.php @@ -2,6 +2,8 @@ namespace SAML2; +use Webmozart\Assert\Assert; + /** * Base class for all SAML 2 response messages. * @@ -11,11 +13,11 @@ * responses. * * The status code is represented as an array on the following form: - * array( + * [ * 'Code' => '<top-level status code>', * 'SubCode' => '<second-level status code>', * 'Message' => '<status message>', - * ) + * ] * * Only the 'Code' field is required. The others will be set to null if they * aren't present. @@ -51,11 +53,11 @@ protected function __construct($tagName, \DOMElement $xml = null) { parent::__construct($tagName, $xml); - $this->status = array( + $this->status = [ 'Code' => Constants::STATUS_SUCCESS, 'SubCode' => null, 'Message' => null, - ); + ]; if ($xml === null) { return; @@ -98,7 +100,7 @@ protected function __construct($tagName, \DOMElement $xml = null) */ public function isSuccess() { - assert(array_key_exists("Code", $this->status)); + Assert::keyExists($this->status, "Code"); if ($this->status['Code'] === Constants::STATUS_SUCCESS) { return true; @@ -123,10 +125,11 @@ public function getInResponseTo() * Set the ID of the request this is a response to. * * @param string|null $inResponseTo The ID of the request. + * @return void */ public function setInResponseTo($inResponseTo) { - assert(is_string($inResponseTo) || is_null($inResponseTo)); + Assert::nullOrString($inResponseTo); $this->inResponseTo = $inResponseTo; } @@ -147,10 +150,11 @@ public function getStatus() * Set the status code. * * @param array $status The status code. + * @return void */ public function setStatus(array $status) { - assert(array_key_exists("Code", $status)); + Assert::keyExists($status, "Code"); $this->status = $status; if (!array_key_exists('SubCode', $status)) { diff --git a/vendor/simplesamlphp/saml2/src/SAML2/SubjectQuery.php b/vendor/simplesamlphp/saml2/src/SAML2/SubjectQuery.php index ca4f817f87..ff4f50bf14 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/SubjectQuery.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/SubjectQuery.php @@ -2,6 +2,9 @@ namespace SAML2; +use SAML2\XML\saml\NameID; +use Webmozart\Assert\Assert; + /** * Base class for SAML 2 subject query messages. * @@ -46,6 +49,7 @@ protected function __construct($tagName, \DOMElement $xml = null) * * @param \DOMElement $xml The SubjectQuery XML element. * @throws \Exception + * @return void */ private function parseSubject(\DOMElement $xml) { @@ -54,7 +58,7 @@ private function parseSubject(\DOMElement $xml) /* No Subject node. */ throw new \Exception('Missing subject in subject query.'); } elseif (count($subject) > 1) { - throw new \Exception('More than one <saml:Subject> in <saml:Assertion>.'); + throw new \Exception('More than one <saml:Subject> in subject query.'); } $subject = $subject[0]; @@ -65,7 +69,7 @@ private function parseSubject(\DOMElement $xml) throw new \Exception('More than one <saml:NameID> in <saml:Subject>.'); } $nameId = $nameId[0]; - $this->nameId = new XML\saml\NameID($nameId); + $this->nameId = new NameID($nameId); } @@ -84,13 +88,14 @@ public function getNameId() * Set the NameId of the subject in the query. * * @param \SAML2\XML\saml\NameID|array|null $nameId The name identifier of the assertion. + * @return void */ public function setNameId($nameId) { - assert(is_array($nameId) || is_null($nameId) || $nameId instanceof XML\saml\NameID); + Assert::true(is_array($nameId) || is_null($nameId) || $nameId instanceof NameID); if (is_array($nameId)) { - $nameId = XML\saml\NameID::fromArray($nameId); + $nameId = NameID::fromArray($nameId); } $this->nameId = $nameId; } diff --git a/vendor/simplesamlphp/saml2/src/SAML2/Utilities/ArrayCollection.php b/vendor/simplesamlphp/saml2/src/SAML2/Utilities/ArrayCollection.php index ea72239899..68e98b093f 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/Utilities/ArrayCollection.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/Utilities/ArrayCollection.php @@ -16,31 +16,55 @@ class ArrayCollection implements Collection */ protected $elements; - public function __construct(array $elements = array()) + + /** + * @return void + */ + public function __construct(array $elements = []) { $this->elements = $elements; } + + /** + * @return void + */ public function add($element) { $this->elements[] = $element; } + + /** + * @return mixed|null + */ public function get($key) { return isset($this->elements[$key]) ? $this->elements[$key] : null; } + + /** + * @return ArrayCollection + */ public function filter(\Closure $f) { return new self(array_filter($this->elements, $f)); } + + /** + * @return void + */ public function set($key, $value) { $this->elements[$key] = $value; } + + /** + * @return mixed + */ public function remove($element) { $key = array_search($element, $this->elements); @@ -55,11 +79,16 @@ public function remove($element) return $removed; } + + /** + * @throws RuntimeException + * @return mixed + */ public function getOnlyElement() { if ($this->count() !== 1) { throw new RuntimeException(sprintf( - __CLASS__ . '::' . __METHOD__ . ' requires that the collection has exactly one element, ' + __CLASS__.'::'.__METHOD__.' requires that the collection has exactly one element, ' . '"%d" elements found', $this->count() )); @@ -68,46 +97,87 @@ public function getOnlyElement() return reset($this->elements); } + + /** + * @return mixed + */ public function first() { return reset($this->elements); } + + /** + * @return mixed + */ public function last() { return end($this->elements); } + + /** + * @return ArrayCollection + */ public function map(\Closure $function) { return new self(array_map($function, $this->elements)); } + + /** + * @return int + */ public function count() { return count($this->elements); } + + /** + * @return \ArrayIterator + */ public function getIterator() { return new \ArrayIterator($this->elements); } + + /** + * @param mixed $offset + * @return bool + */ public function offsetExists($offset) { return isset($this->elements[$offset]); } + + /** + * @param mixed $offset + * @return mixed + */ public function offsetGet($offset) { return $this->elements[$offset]; } + + /** + * @param mixed $offset + * @param mixed $value + * @return void + */ public function offsetSet($offset, $value) { $this->elements[$offset] = $value; } + + /** + * @param mixed + * @return void + */ public function offsetUnset($offset) { unset($this->elements[$offset]); diff --git a/vendor/simplesamlphp/saml2/src/SAML2/Utilities/Certificate.php b/vendor/simplesamlphp/saml2/src/SAML2/Utilities/Certificate.php index 2b2bdf4de7..7c5f4f2ebb 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/Utilities/Certificate.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/Utilities/Certificate.php @@ -12,6 +12,7 @@ class Certificate */ const CERTIFICATE_PATTERN = '/^-----BEGIN CERTIFICATE-----([^-]*)^-----END CERTIFICATE-----/m'; + /** * @param $certificate * @@ -22,6 +23,7 @@ public static function hasValidStructure($certificate) return !!preg_match(self::CERTIFICATE_PATTERN, $certificate); } + /** * @param string $X509CertificateContents * diff --git a/vendor/simplesamlphp/saml2/src/SAML2/Utilities/Collection.php b/vendor/simplesamlphp/saml2/src/SAML2/Utilities/Collection.php index 0a3866497a..9a4e63339e 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/Utilities/Collection.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/Utilities/Collection.php @@ -13,15 +13,17 @@ interface Collection extends \ArrayAccess, \Countable, \IteratorAggregate */ public function add($element); + /** * Shorthand for getting a single element that also must be the only element in the collection. * - * @return mixed - * * @throws \SAML2\Exception\RuntimeException if the element was not the only element + * + * @return mixed */ public function getOnlyElement(); + /** * Return the first element from the collection * @@ -29,6 +31,7 @@ public function getOnlyElement(); */ public function first(); + /** * Return the last element from the collection * @@ -36,6 +39,7 @@ public function first(); */ public function last(); + /** * Applies the given function to each element in the collection and returns a new collection with the elements returned by the function. * @@ -45,6 +49,7 @@ public function last(); */ public function map(\Closure $function); + /** * @param callable $filterFunction * @@ -52,6 +57,7 @@ public function map(\Closure $function); */ public function filter(\Closure $filterFunction); + /** * Get the element at index * @@ -61,16 +67,20 @@ public function filter(\Closure $filterFunction); */ public function get($key); + /** * @param $element + * @return void */ public function remove($element); + /** * Set the value for index * * @param mixed $key * @param mixed $value + * @return void */ public function set($key, $value); } diff --git a/vendor/simplesamlphp/saml2/src/SAML2/Utils.php b/vendor/simplesamlphp/saml2/src/SAML2/Utils.php index 61f2fd4c9b..ed710c359a 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/Utils.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/Utils.php @@ -11,6 +11,7 @@ use SAML2\XML\ds\X509Certificate; use SAML2\XML\ds\X509Data; use SAML2\XML\md\KeyDescriptor; +use Webmozart\Assert\Assert; /** * Helper functions for the SAML2 library. @@ -35,8 +36,8 @@ class Utils * check the signature against a public key. * * @param \DOMElement $root The element which should be validated. - * @return array|bool An array with information about the Signature-element. * @throws \Exception + * @return array|bool An array with information about the Signature-element. */ public static function validateElement(\DOMElement $root) { @@ -84,17 +85,17 @@ public static function validateElement(\DOMElement $root) } /* Now we extract all available X509 certificates in the signature element. */ - $certificates = array(); + $certificates = []; foreach (self::xpQuery($signatureElement, './ds:KeyInfo/ds:X509Data/ds:X509Certificate') as $certNode) { $certData = trim($certNode->textContent); - $certData = str_replace(array("\r", "\n", "\t", ' '), '', $certData); + $certData = str_replace(["\r", "\n", "\t", ' '], '', $certData); $certificates[] = $certData; } - $ret = array( + $ret = [ 'Signature' => $objXMLSecDSig, 'Certificates' => $certificates, - ); + ]; return $ret; } @@ -106,26 +107,26 @@ public static function validateElement(\DOMElement $root) * @param XMLSecurityKey $key The key. * @param string $algorithm The desired algorithm. * @param string $type Public or private key, defaults to public. - * @return XMLSecurityKey The new key. * @throws \Exception + * @return XMLSecurityKey The new key. */ public static function castKey(XMLSecurityKey $key, $algorithm, $type = 'public') { - assert(is_string($algorithm)); - assert($type === "public" || $type === "private"); + Assert::string($algorithm); + Assert::oneOf($type, ["public", "private"]); // do nothing if algorithm is already the type of the key if ($key->type === $algorithm) { return $key; } - if (!in_array($algorithm, array( + if (!in_array($algorithm, [ XMLSecurityKey::RSA_1_5, XMLSecurityKey::RSA_SHA1, XMLSecurityKey::RSA_SHA256, XMLSecurityKey::RSA_SHA384, XMLSecurityKey::RSA_SHA512 - ))) { + ], true)) { throw new \Exception('Unsupported signing algorithm.'); } @@ -137,7 +138,7 @@ public static function castKey(XMLSecurityKey $key, $algorithm, $type = 'public' throw new \Exception('Missing key in public key details.'); } - $newKey = new XMLSecurityKey($algorithm, array('type'=>$type)); + $newKey = new XMLSecurityKey($algorithm, ['type' => $type]); $newKey->loadKey($keyInfo['key']); return $newKey; @@ -152,10 +153,11 @@ public static function castKey(XMLSecurityKey $key, $algorithm, $type = 'public' * @param array $info The information returned by the validateElement()-function. * @param XMLSecurityKey $key The publickey that should validate the Signature object. * @throws \Exception + * @return void */ public static function validateSignature(array $info, XMLSecurityKey $key) { - assert(array_key_exists("Signature", $info)); + Assert::keyExists($info, "Signature"); /** @var XMLSecurityDSig $objXMLSecDSig */ $objXMLSecDSig = $info['Signature']; @@ -170,7 +172,7 @@ public static function validateSignature(array $info, XMLSecurityKey $key) } $algo = $sigMethod->getAttribute('Algorithm'); - if ($key->type === XMLSecurityKey::RSA_SHA1 && $algo !== $key->type) { + if ($key->type === XMLSecurityKey::RSA_SHA256 && $algo !== $key->type) { $key = self::castKey($key, $algo); } @@ -185,12 +187,12 @@ public static function validateSignature(array $info, XMLSecurityKey $key) * Do an XPath query on an XML node. * * @param \DOMNode $node The XML node. - * @param string $query The query. - * @return \DOMElement[] Array with matching DOM nodes. + * @param string $query The query. + * @return \DOMNode[] Array with matching DOM nodes. */ public static function xpQuery(\DOMNode $node, $query) { - assert(is_string($query)); + Assert::string($query); static $xpCache = null; if ($node instanceof \DOMDocument) { @@ -210,7 +212,7 @@ public static function xpQuery(\DOMNode $node, $query) } $results = $xpCache->query($query, $node); - $ret = array(); + $ret = []; for ($i = 0; $i < $results->length; $i++) { $ret[$i] = $results->item($i); } @@ -234,7 +236,7 @@ public static function copyElement(\DOMElement $element, \DOMElement $parent = n $document = $parent->ownerDocument; } - $namespaces = array(); + $namespaces = []; for ($e = $element; $e !== null; $e = $e->parentNode) { foreach (Utils::xpQuery($e, './namespace::*') as $ns) { $prefix = $ns->localName; @@ -256,7 +258,7 @@ public static function copyElement(\DOMElement $element, \DOMElement $parent = n } foreach ($namespaces as $prefix => $uri) { - $newElement->setAttributeNS($uri, $prefix . ':__ns_workaround__', 'tmp'); + $newElement->setAttributeNS($uri, $prefix.':__ns_workaround__', 'tmp'); $newElement->removeAttributeNS($uri, '__ns_workaround__'); } @@ -270,12 +272,12 @@ public static function copyElement(\DOMElement $element, \DOMElement $parent = n * @param \DOMElement $node The element we should fetch the attribute from. * @param string $attributeName The name of the attribute. * @param mixed $default The value that should be returned if the attribute doesn't exist. - * @return bool|mixed The value of the attribute, or $default if the attribute doesn't exist. * @throws \Exception + * @return bool|mixed The value of the attribute, or $default if the attribute doesn't exist. */ public static function parseBoolean(\DOMElement $node, $attributeName, $default = null) { - assert(is_string($attributeName)); + Assert::string($attributeName); if (!$node->hasAttribute($attributeName)) { return $default; @@ -289,7 +291,7 @@ public static function parseBoolean(\DOMElement $node, $attributeName, $default case 'true': return true; default: - throw new \Exception('Invalid value of boolean attribute ' . var_export($attributeName, true) . ': ' . var_export($value, true)); + throw new \Exception('Invalid value of boolean attribute '.var_export($attributeName, true).': '.var_export($value, true)); } } @@ -304,6 +306,7 @@ public static function parseBoolean(\DOMElement $node, $attributeName, $default * * @param \DOMElement $node The DOM node we should append the NameId to. * @param array $nameId The name identifier. + * @return void * * @deprecated Please use \SAML2\XML\saml\NameID objects instead: * $nameId = new \SAML2\XML\saml\NameID(); @@ -313,25 +316,26 @@ public static function parseBoolean(\DOMElement $node, $attributeName, $default */ public static function addNameId(\DOMElement $node, array $nameId) { - assert(array_key_exists("Value", $nameId)); + Assert::keyExists($nameId, "Value"); $nid = new XML\saml\NameID(); $nid->value = $nameId['Value']; if (array_key_exists('NameQualifier', $nameId) && $nameId['NameQualifier'] !== null) { - $nid->NameQualifier = $nameId['NameQualifier']; + $nid->setNameQualifier($nameId['NameQualifier']); } if (array_key_exists('SPNameQualifier', $nameId) && $nameId['SPNameQualifier'] !== null) { - $nid->SPNameQualifier = $nameId['SPNameQualifier']; + $nid->setSPNameQualifier($nameId['SPNameQualifier']); } if (array_key_exists('Format', $nameId) && $nameId['Format'] !== null) { - $nid->Format = $nameId['Format']; + $nid->setFormat($nameId['Format']); } $nid->toXML($node); } + /** * Parse a NameID element. * @@ -342,9 +346,9 @@ public static function addNameId(\DOMElement $node, array $nameId) */ public static function parseNameId(\DOMElement $xml) { - $ret = array('Value' => trim($xml->textContent)); + $ret = ['Value' => trim($xml->textContent)]; - foreach (array('NameQualifier', 'SPNameQualifier', 'SPProvidedID', 'Format') as $attr) { + foreach (['NameQualifier', 'SPNameQualifier', 'SPProvidedID', 'Format'] as $attr) { if ($xml->hasAttribute($attr)) { $ret[$attr] = $xml->getAttribute($attr); } @@ -353,6 +357,7 @@ public static function parseNameId(\DOMElement $xml) return $ret; } + /** * Insert a Signature-node. * @@ -360,6 +365,7 @@ public static function parseNameId(\DOMElement $xml) * @param array $certificates The certificates we should add to the signature node. * @param \DOMElement $root The XML node we should sign. * @param \DOMNode $insertBefore The XML element we should insert the signature element before. + * @return void */ public static function insertSignature( XMLSecurityKey $key, @@ -385,10 +391,10 @@ public static function insertSignature( } $objXMLSecDSig->addReferenceList( - array($root), + [$root], $type, - array('http://www.w3.org/2000/09/xmldsig#enveloped-signature', XMLSecurityDSig::EXC_C14N), - array('id_name' => 'ID', 'overwrite' => false) + ['http://www.w3.org/2000/09/xmldsig#enveloped-signature', XMLSecurityDSig::EXC_C14N], + ['id_name' => 'ID', 'overwrite' => false] ); $objXMLSecDSig->sign($key); @@ -400,6 +406,7 @@ public static function insertSignature( $objXMLSecDSig->insertSignature($root, $insertBefore); } + /** * Decrypt an encrypted element. * @@ -408,8 +415,8 @@ public static function insertSignature( * @param \DOMElement $encryptedData The encrypted data. * @param XMLSecurityKey $inputKey The decryption key. * @param array &$blacklist Blacklisted decryption algorithms. - * @return \DOMElement The decrypted element. * @throws \Exception + * @return \DOMElement The decrypted element. */ private static function doDecryptElement(\DOMElement $encryptedData, XMLSecurityKey $inputKey, array &$blacklist) { @@ -433,7 +440,7 @@ private static function doDecryptElement(\DOMElement $encryptedData, XMLSecurity $symKeyInfoAlgo = $symmetricKeyInfo->getAlgorithm(); if (in_array($symKeyInfoAlgo, $blacklist, true)) { - throw new \Exception('Algorithm disabled: ' . var_export($symKeyInfoAlgo, true)); + throw new \Exception('Algorithm disabled: '.var_export($symKeyInfoAlgo, true)); } if ($symKeyInfoAlgo === XMLSecurityKey::RSA_OAEP_MGF1P && $inputKeyAlgo === XMLSecurityKey::RSA_1_5) { @@ -449,9 +456,9 @@ private static function doDecryptElement(\DOMElement $encryptedData, XMLSecurity /* Make sure that the input key format is the same as the one used to encrypt the key. */ if ($inputKeyAlgo !== $symKeyInfoAlgo) { throw new \Exception( - 'Algorithm mismatch between input key and key used to encrypt ' . - ' the symmetric key for the message. Key was: ' . - var_export($inputKeyAlgo, true) . '; message was: ' . + 'Algorithm mismatch between input key and key used to encrypt '. + ' the symmetric key for the message. Key was: '. + var_export($inputKeyAlgo, true).'; message was: '. var_export($symKeyInfoAlgo, true) ); } @@ -465,20 +472,20 @@ private static function doDecryptElement(\DOMElement $encryptedData, XMLSecurity /* To protect against "key oracle" attacks, we need to be able to create a * symmetric key, and for that we need to know the key size. */ - throw new \Exception('Unknown key size for encryption algorithm: ' . var_export($symmetricKey->type, true)); + throw new \Exception('Unknown key size for encryption algorithm: '.var_export($symmetricKey->type, true)); } try { $key = $encKey->decryptKey($symmetricKeyInfo); if (strlen($key) != $keySize) { throw new \Exception( - 'Unexpected key size (' . strlen($key) * 8 . 'bits) for encryption algorithm: ' . + 'Unexpected key size ('.strval(strlen($key)*8).'bits) for encryption algorithm: '. var_export($symmetricKey->type, true) ); } } catch (\Exception $e) { /* We failed to decrypt this key. Log it, and substitute a "random" key. */ - Utils::getContainer()->getLogger()->error('Failed to decrypt symmetric key: ' . $e->getMessage()); + Utils::getContainer()->getLogger()->error('Failed to decrypt symmetric key: '.$e->getMessage()); /* Create a replacement key, so that it looks like we fail in the same way as if the key was correctly padded. */ /* We base the symmetric key on the encrypted key and private key, so that we always behave the @@ -487,7 +494,7 @@ private static function doDecryptElement(\DOMElement $encryptedData, XMLSecurity $encryptedKey = $encKey->getCipherValue(); $pkey = openssl_pkey_get_details($symmetricKeyInfo->key); $pkey = sha1(serialize($pkey), true); - $key = sha1($encryptedKey . $pkey, true); + $key = sha1($encryptedKey.$pkey, true); /* Make sure that the key has the correct length. */ if (strlen($key) > $keySize) { @@ -502,8 +509,8 @@ private static function doDecryptElement(\DOMElement $encryptedData, XMLSecurity /* Make sure that the input key has the correct format. */ if ($inputKeyAlgo !== $symKeyAlgo) { throw new \Exception( - 'Algorithm mismatch between input key and key in message. ' . - 'Key was: ' . var_export($inputKeyAlgo, true) . '; message was: ' . + 'Algorithm mismatch between input key and key in message. '. + 'Key was: '.var_export($inputKeyAlgo, true).'; message was: '. var_export($symKeyAlgo, true) ); } @@ -512,7 +519,7 @@ private static function doDecryptElement(\DOMElement $encryptedData, XMLSecurity $algorithm = $symmetricKey->getAlgorithm(); if (in_array($algorithm, $blacklist, true)) { - throw new \Exception('Algorithm disabled: ' . var_export($algorithm, true)); + throw new \Exception('Algorithm disabled: '.var_export($algorithm, true)); } /** @var string $decrypted */ @@ -524,8 +531,8 @@ private static function doDecryptElement(\DOMElement $encryptedData, XMLSecurity * namespaces needed to parse the XML. */ $xml = '<root xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion" '. - 'xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">' . - $decrypted . + 'xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">'. + $decrypted. '</root>'; try { @@ -546,16 +553,17 @@ private static function doDecryptElement(\DOMElement $encryptedData, XMLSecurity return $decryptedElement; } + /** * Decrypt an encrypted element. * * @param \DOMElement $encryptedData The encrypted data. * @param XMLSecurityKey $inputKey The decryption key. * @param array $blacklist Blacklisted decryption algorithms. - * @return \DOMElement The decrypted element. * @throws \Exception + * @return \DOMElement The decrypted element. */ - public static function decryptElement(\DOMElement $encryptedData, XMLSecurityKey $inputKey, array $blacklist = array()) + public static function decryptElement(\DOMElement $encryptedData, XMLSecurityKey $inputKey, array $blacklist = []) { try { return self::doDecryptElement($encryptedData, $inputKey, $blacklist); @@ -564,11 +572,12 @@ public static function decryptElement(\DOMElement $encryptedData, XMLSecurityKey * Something went wrong during decryption, but for security * reasons we cannot tell the user what failed. */ - Utils::getContainer()->getLogger()->error('Decryption failed: ' . $e->getMessage()); + Utils::getContainer()->getLogger()->error('Decryption failed: '.$e->getMessage()); throw new \Exception('Failed to decrypt XML element.', 0, $e); } } + /** * Extract localized strings from a set of nodes. * @@ -579,10 +588,10 @@ public static function decryptElement(\DOMElement $encryptedData, XMLSecurityKey */ public static function extractLocalizedStrings(\DOMElement $parent, $namespaceURI, $localName) { - assert(is_string($namespaceURI)); - assert(is_string($localName)); + Assert::string($namespaceURI); + Assert::string($localName); - $ret = array(); + $ret = []; for ($node = $parent->firstChild; $node !== null; $node = $node->nextSibling) { if ($node->namespaceURI !== $namespaceURI || $node->localName !== $localName) { continue; @@ -599,6 +608,7 @@ public static function extractLocalizedStrings(\DOMElement $parent, $namespaceUR return $ret; } + /** * Extract strings from a set of nodes. * @@ -609,10 +619,10 @@ public static function extractLocalizedStrings(\DOMElement $parent, $namespaceUR */ public static function extractStrings(\DOMElement $parent, $namespaceURI, $localName) { - assert(is_string($namespaceURI)); - assert(is_string($localName)); + Assert::string($namespaceURI); + Assert::string($localName); - $ret = array(); + $ret = []; for ($node = $parent->firstChild; $node !== null; $node = $node->nextSibling) { if ($node->namespaceURI !== $namespaceURI || $node->localName !== $localName) { continue; @@ -623,6 +633,7 @@ public static function extractStrings(\DOMElement $parent, $namespaceURI, $local return $ret; } + /** * Append string element. * @@ -634,9 +645,9 @@ public static function extractStrings(\DOMElement $parent, $namespaceURI, $local */ public static function addString(\DOMElement $parent, $namespace, $name, $value) { - assert(is_string($namespace)); - assert(is_string($name)); - assert(is_string($value)); + Assert::string($namespace); + Assert::string($name); + Assert::string($value); $doc = $parent->ownerDocument; @@ -647,6 +658,7 @@ public static function addString(\DOMElement $parent, $namespace, $name, $value) return $n; } + /** * Append string elements. * @@ -655,12 +667,13 @@ public static function addString(\DOMElement $parent, $namespace, $name, $value) * @param string $name The name of the created elements * @param bool $localized Whether the strings are localized, and should include the xml:lang attribute. * @param array $values The values we should create the elements from. + * @return void */ public static function addStrings(\DOMElement $parent, $namespace, $name, $localized, array $values) { - assert(is_string($namespace)); - assert(is_string($name)); - assert(is_bool($localized)); + Assert::string($namespace); + Assert::string($name); + Assert::boolean($localized); $doc = $parent->ownerDocument; @@ -674,6 +687,7 @@ public static function addStrings(\DOMElement $parent, $namespace, $name, $local } } + /** * Create a KeyDescriptor with the given certificate. * @@ -682,16 +696,16 @@ public static function addStrings(\DOMElement $parent, $namespace, $name, $local */ public static function createKeyDescriptor($x509Data) { - assert(is_string($x509Data)); + Assert::string($x509Data); $x509Certificate = new X509Certificate(); - $x509Certificate->certificate = $x509Data; + $x509Certificate->setCertificate($x509Data); $x509Data = new X509Data(); - $x509Data->data[] = $x509Certificate; + $x509Data->addData($x509Certificate); $keyInfo = new KeyInfo(); - $keyInfo->info[] = $x509Data; + $keyInfo->addInfo($x509Data); $keyDescriptor = new KeyDescriptor(); $keyDescriptor->KeyInfo = $keyInfo; @@ -699,6 +713,7 @@ public static function createKeyDescriptor($x509Data) return $keyDescriptor; } + /** * This function converts a SAML2 timestamp on the form * yyyy-mm-ddThh:mm:ss(\.s+)?Z to a UNIX timestamp. The sub-second @@ -715,18 +730,18 @@ public static function createKeyDescriptor($x509Data) * background. * * @param string $time The time we should convert. - * @return int Converted to a unix timestamp. * @throws \Exception + * @return int Converted to a unix timestamp. */ public static function xsDateTimeToTimestamp($time) { - $matches = array(); + $matches = []; // We use a very strict regex to parse the timestamp. $regex = '/^(\\d\\d\\d\\d)-(\\d\\d)-(\\d\\d)T(\\d\\d):(\\d\\d):(\\d\\d)(?:\\.\\d{1,9})?Z$/D'; if (preg_match($regex, $time, $matches) == 0) { throw new \Exception( - 'Invalid SAML2 timestamp passed to xsDateTimeToTimestamp: ' . $time + 'Invalid SAML2 timestamp passed to xsDateTimeToTimestamp: '.$time ); } @@ -746,6 +761,7 @@ public static function xsDateTimeToTimestamp($time) return $ts; } + /** * @return \SAML2\Compat\Ssp\Container */ diff --git a/vendor/simplesamlphp/saml2/src/SAML2/XML/Chunk.php b/vendor/simplesamlphp/saml2/src/SAML2/XML/Chunk.php index 2f25f45103..4b150093a1 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/XML/Chunk.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/XML/Chunk.php @@ -2,8 +2,10 @@ namespace SAML2\XML; +use DOMElement; use SAML2\DOMDocumentFactory; use SAML2\Utils; +use Webmozart\Assert\Assert; /** * Serializable class used to hold an XML element. @@ -22,7 +24,7 @@ class Chunk implements \Serializable /** * The namespaceURI of this element. * - * @var string + * @var string|null */ public $namespaceURI; @@ -33,6 +35,7 @@ class Chunk implements \Serializable */ public $xml; + /** * Create a XMLChunk from a copy of the given \DOMElement. * @@ -40,12 +43,13 @@ class Chunk implements \Serializable */ public function __construct(\DOMElement $xml) { - $this->localName = $xml->localName; - $this->namespaceURI = $xml->namespaceURI; + $this->setLocalName($xml->localName); + $this->setNamespaceURI($xml->namespaceURI); - $this->xml = Utils::copyElement($xml); + $this->setXml(Utils::copyElement($xml)); } + /** * Get this \DOMElement. * @@ -57,17 +61,75 @@ public function getXML() return $this->xml; } + /** * Append this XML element to a different XML element. * * @param \DOMElement $parent The element we should append this element to. * @return \DOMElement The new element. */ - public function toXML(\DOMElement $parent) + public function toXML(DOMElement $parent) { return Utils::copyElement($this->xml, $parent); } + + /** + * Collect the value of the localName-property + * @return string + */ + public function getLocalName() + { + return $this->localName; + } + + + /** + * Set the value of the localName-property + * @param string $localName + * @return void + */ + public function setLocalName($localName) + { + Assert::string($localName); + $this->localName = $localName; + } + + + /** + * Collect the value of the namespaceURI-property + * @return string|null + */ + public function getNamespaceURI() + { + return $this->namespaceURI; + } + + + /** + * Set the value of the namespaceURI-property + * @param string|null $namespaceURI + * @return void + */ + public function setNamespaceURI($namespaceURI = null) + { + Assert::nullOrString($namespaceURI); + $this->namespaceURI = $namespaceURI; + } + + + /** + * Set the value of the xml-property + * @param \DOMelement $xml + * @return void + */ + private function setXml($xml) + { + Assert::isInstanceOf($xml, DOMElement::class); + $this->xml = $xml; + } + + /** * Serialize this XML chunk. * @@ -75,19 +137,21 @@ public function toXML(\DOMElement $parent) */ public function serialize() { - return serialize($this->xml->ownerDocument->saveXML($this->xml)); + return serialize($this->getXml()->ownerDocument->saveXML($this->getXml())); } + /** * Un-serialize this XML chunk. * * @param string $serialized The serialized chunk. + * @return void */ public function unserialize($serialized) { $doc = DOMDocumentFactory::fromString(unserialize($serialized)); - $this->xml = $doc->documentElement; - $this->localName = $this->xml->localName; - $this->namespaceURI = $this->xml->namespaceURI; + $this->setXml($doc->documentElement); + $this->setLocalName($this->getXml()->localName); + $this->setNamespaceURI($this->getXml()->namespaceURI); } } diff --git a/vendor/simplesamlphp/saml2/src/SAML2/XML/alg/DigestMethod.php b/vendor/simplesamlphp/saml2/src/SAML2/XML/alg/DigestMethod.php index ccf70f2a61..04f0cb3eb1 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/XML/alg/DigestMethod.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/XML/alg/DigestMethod.php @@ -2,6 +2,8 @@ namespace SAML2\XML\alg; +use Webmozart\Assert\Assert; + /** * Class for handling the alg:DigestMethod element. * @@ -35,7 +37,29 @@ public function __construct(\DOMElement $xml = null) if (!$xml->hasAttribute('Algorithm')) { throw new \Exception('Missing required attribute "Algorithm" in alg:DigestMethod element.'); } - $this->Algorithm = $xml->getAttribute('Algorithm'); + $this->setAlgorithm($xml->getAttribute('Algorithm')); + } + + + /** + * Collect the value of the algorithm-property + * @return string + */ + public function getAlgorithm() + { + return $this->Algorithm; + } + + + /** + * Set the value of the Algorithm-property + * @param string $algorithm + * @return void + */ + public function setAlgorithm($algorithm) + { + Assert::string($algorithm); + $this->Algorithm = $algorithm; } @@ -47,12 +71,12 @@ public function __construct(\DOMElement $xml = null) */ public function toXML(\DOMElement $parent) { - assert(is_string($this->Algorithm)); + Assert::string($this->getAlgorithm()); $doc = $parent->ownerDocument; $e = $doc->createElementNS(Common::NS, 'alg:DigestMethod'); $parent->appendChild($e); - $e->setAttribute('Algorithm', $this->Algorithm); + $e->setAttribute('Algorithm', $this->getAlgorithm()); return $e; } diff --git a/vendor/simplesamlphp/saml2/src/SAML2/XML/alg/SigningMethod.php b/vendor/simplesamlphp/saml2/src/SAML2/XML/alg/SigningMethod.php index 6e4d54b7e7..d2fe64684b 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/XML/alg/SigningMethod.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/XML/alg/SigningMethod.php @@ -2,6 +2,8 @@ namespace SAML2\XML\alg; +use Webmozart\Assert\Assert; + /** * Class for handling the alg:SigningMethod element. * @@ -37,12 +39,78 @@ class SigningMethod public $MaxKeySize; + /** + * Collect the value of the Algorithm-property + * @return string + */ + public function getAlgorithm() + { + return $this->Algorithm; + } + + + /** + * Set the value of the Algorithm-property + * @param string $algorithm + * @return void + */ + public function setAlgorithm($algorithm) + { + Assert::string($algorithm); + $this->Algorithm = $algorithm; + } + + + /** + * Collect the value of the MinKeySize-property + * @return int|null + */ + public function getMinKeySize() + { + return $this->MinKeySize; + } + + + /** + * Set the value of the MinKeySize-property + * @param int|null $minKeySize + * @return void + */ + public function setMinKeySize($minKeySize = null) + { + Assert::nullOrInteger($minKeySize); + $this->MinKeySize = $minKeySize; + } + + + /** + * Collect the value of the MaxKeySize-property + * @return int|null + */ + public function getMaxKeySize() + { + return $this->MaxKeySize; + } + + + /** + * Set the value of the MaxKeySize-property + * @param int|null $maxKeySize + * @return void + */ + public function setMaxKeySize($maxKeySize = null) + { + Assert::nullOrInteger($maxKeySize); + $this->MaxKeySize = $maxKeySize; + } + + /** * Create/parse an alg:SigningMethod element. * * @param \DOMElement|null $xml The XML element we should load or null to create a new one from scratch. - * * @throws \Exception + * @return void */ public function __construct(\DOMElement $xml = null) { @@ -53,14 +121,14 @@ public function __construct(\DOMElement $xml = null) if (!$xml->hasAttribute('Algorithm')) { throw new \Exception('Missing required attribute "Algorithm" in alg:SigningMethod element.'); } - $this->Algorithm = $xml->getAttribute('Algorithm'); + $this->setAlgorithm($xml->getAttribute('Algorithm')); if ($xml->hasAttribute('MinKeySize')) { - $this->MinKeySize = intval($xml->getAttribute('MinKeySize')); + $this->setMinKeySize(intval($xml->getAttribute('MinKeySize'))); } if ($xml->hasAttribute('MaxKeySize')) { - $this->MaxKeySize = intval($xml->getAttribute('MaxKeySize')); + $this->setMaxKeySize(intval($xml->getAttribute('MaxKeySize'))); } } @@ -73,21 +141,21 @@ public function __construct(\DOMElement $xml = null) */ public function toXML(\DOMElement $parent) { - assert(is_string($this->Algorithm)); - assert(is_int($this->MinKeySize) || is_null($this->MinKeySize)); - assert(is_int($this->MaxKeySize) || is_null($this->MaxKeySize)); + Assert::string($this->getAlgorithm()); + Assert::nullOrInteger($this->getMinKeySize()); + Assert::nullOrInteger($this->getMaxKeySize()); $doc = $parent->ownerDocument; $e = $doc->createElementNS(Common::NS, 'alg:SigningMethod'); $parent->appendChild($e); - $e->setAttribute('Algorithm', $this->Algorithm); + $e->setAttribute('Algorithm', $this->getAlgorithm()); - if ($this->MinKeySize !== null) { - $e->setAttribute('MinKeySize', $this->MinKeySize); + if ($this->getMinKeySize() !== null) { + $e->setAttribute('MinKeySize', $this->getMinKeySize()); } - if ($this->MaxKeySize !== null) { - $e->setAttribute('MaxKeySize', $this->MaxKeySize); + if ($this->getMaxKeySize() !== null) { + $e->setAttribute('MaxKeySize', $this->getMaxKeySize()); } return $e; diff --git a/vendor/simplesamlphp/saml2/src/SAML2/XML/ds/KeyInfo.php b/vendor/simplesamlphp/saml2/src/SAML2/XML/ds/KeyInfo.php index 684bd432d4..8ea8ec0e55 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/XML/ds/KeyInfo.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/XML/ds/KeyInfo.php @@ -4,6 +4,7 @@ use RobRichards\XMLSecLibs\XMLSecurityDSig; use SAML2\XML\Chunk; +use Webmozart\Assert\Assert; /** * Class representing a ds:KeyInfo element. @@ -27,7 +28,8 @@ class KeyInfo * * @var (\SAML2\XML\Chunk|\SAML2\XML\ds\KeyName|\SAML2\XML\ds\X509Data)[] */ - public $info = array(); + public $info = []; + /** * Initialize a KeyInfo element. @@ -41,7 +43,7 @@ public function __construct(\DOMElement $xml = null) } if ($xml->hasAttribute('Id')) { - $this->Id = $xml->getAttribute('Id'); + $this->setId($xml->getAttribute('Id')); } for ($n = $xml->firstChild; $n !== null; $n = $n->nextSibling) { @@ -50,23 +52,79 @@ public function __construct(\DOMElement $xml = null) } if ($n->namespaceURI !== XMLSecurityDSig::XMLDSIGNS) { - $this->info[] = new Chunk($n); + $this->addInfo(new Chunk($n)); continue; } switch ($n->localName) { case 'KeyName': - $this->info[] = new KeyName($n); + $this->addInfo(new KeyName($n)); break; case 'X509Data': - $this->info[] = new X509Data($n); + $this->addInfo(new X509Data($n)); break; default: - $this->info[] = new Chunk($n); + $this->addInfo(new Chunk($n)); break; } } } + + /** + * Collect the value of the Id-property + * @return string|null + */ + public function getId() + { + return $this->Id; + } + + + /** + * Set the value of the Id-property + * @param string|null $id + * @return void + */ + public function setId($id = null) + { + Assert::nullOrString($id); + $this->Id = $id; + } + + + /** + * Collect the value of the info-property + * @return array + */ + public function getInfo() + { + return $this->info; + } + + + /** + * Set the value of the info-property + * @param array $info + * @return void + */ + public function setInfo(array $info) + { + $this->info = $info; + } + + + /** + * Add the value to the info-property + * @param \SAML2\XML\Chunk|\SAML2\XML\ds\KeyName|\SAML2\XML\ds\X509Data $info + * @return void + */ + public function addInfo($info) + { + Assert::isInstanceOfAny($info, [Chunk::class, KeyName::class, X509Data::class]); + $this->info[] = $info; + } + + /** * Convert this KeyInfo to XML. * @@ -75,20 +133,20 @@ public function __construct(\DOMElement $xml = null) */ public function toXML(\DOMElement $parent) { - assert(is_null($this->Id) || is_string($this->Id)); - assert(is_array($this->info)); + Assert::nullOrString($this->getId()); + Assert::isArray($this->getInfo()); $doc = $parent->ownerDocument; $e = $doc->createElementNS(XMLSecurityDSig::XMLDSIGNS, 'ds:KeyInfo'); $parent->appendChild($e); - if (isset($this->Id)) { - $e->setAttribute('Id', $this->Id); + if ($this->getId() !== null) { + $e->setAttribute('Id', $this->getId()); } /** @var \SAML2\XML\Chunk|\SAML2\XML\ds\KeyName|\SAML2\XML\ds\X509Data $n */ - foreach ($this->info as $n) { + foreach ($this->getInfo() as $n) { $n->toXML($e); } diff --git a/vendor/simplesamlphp/saml2/src/SAML2/XML/ds/KeyName.php b/vendor/simplesamlphp/saml2/src/SAML2/XML/ds/KeyName.php index bd5fd5f2b0..2bfbce93f3 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/XML/ds/KeyName.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/XML/ds/KeyName.php @@ -4,6 +4,7 @@ use RobRichards\XMLSecLibs\XMLSecurityDSig; use SAML2\Utils; +use Webmozart\Assert\Assert; /** * Class representing a ds:KeyName element. @@ -19,6 +20,7 @@ class KeyName */ public $name; + /** * Initialize a KeyName element. * @@ -30,9 +32,32 @@ public function __construct(\DOMElement $xml = null) return; } - $this->name = $xml->textContent; + $this->setName($xml->textContent); + } + + + /** + * Collect the value of the name-property + * @return string + */ + public function getName() + { + return $this->name; + } + + + /** + * Set the value of the name-property + * @param string $name + * @return void + */ + public function setName($name) + { + Assert::nullOrString($name); + $this->name = $name; } + /** * Convert this KeyName element to XML. * @@ -41,7 +66,7 @@ public function __construct(\DOMElement $xml = null) */ public function toXML(\DOMElement $parent) { - assert(is_string($this->name)); + Assert::string($this->name); return Utils::addString($parent, XMLSecurityDSig::XMLDSIGNS, 'ds:KeyName', $this->name); } diff --git a/vendor/simplesamlphp/saml2/src/SAML2/XML/ds/X509Certificate.php b/vendor/simplesamlphp/saml2/src/SAML2/XML/ds/X509Certificate.php index 83d9a4c950..8283e78cb5 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/XML/ds/X509Certificate.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/XML/ds/X509Certificate.php @@ -4,6 +4,7 @@ use RobRichards\XMLSecLibs\XMLSecurityDSig; use SAML2\Utils; +use Webmozart\Assert\Assert; /** * Class representing a ds:X509Certificate element. @@ -19,6 +20,7 @@ class X509Certificate */ public $certificate; + /** * Initialize an X509Certificate element. * @@ -30,9 +32,32 @@ public function __construct(\DOMElement $xml = null) return; } - $this->certificate = $xml->textContent; + $this->setCertificate($xml->textContent); + } + + + /** + * Collect the value of the certificate-property + * @return string + */ + public function getCertificate() + { + return $this->certificate; } + + /** + * Set the value of the certificate-property + * @param string $certificate + * @return void + */ + public function setCertificate($certificate) + { + Assert::string($certificate); + $this->certificate = $certificate; + } + + /** * Convert this X509Certificate element to XML. * @@ -41,8 +66,7 @@ public function __construct(\DOMElement $xml = null) */ public function toXML(\DOMElement $parent) { - assert(is_string($this->certificate)); - - return Utils::addString($parent, XMLSecurityDSig::XMLDSIGNS, 'ds:X509Certificate', $this->certificate); + Assert::string($this->certificate); + return Utils::addString($parent, XMLSecurityDSig::XMLDSIGNS, 'ds:X509Certificate', $this->getCertificate()); } } diff --git a/vendor/simplesamlphp/saml2/src/SAML2/XML/ds/X509Data.php b/vendor/simplesamlphp/saml2/src/SAML2/XML/ds/X509Data.php index bdc3d1b5ca..74be5d8010 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/XML/ds/X509Data.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/XML/ds/X509Data.php @@ -4,6 +4,8 @@ use RobRichards\XMLSecLibs\XMLSecurityDSig; use SAML2\XML\Chunk; +use SAML2\XML\ds\X509Certificate; +use Webmozart\Assert\Assert; /** * Class representing a ds:X509Data element. @@ -20,7 +22,8 @@ class X509Data * * @var (\SAML2\XML\Chunk|\SAML2\XML\ds\X509Certificate)[] */ - public $data = array(); + public $data = []; + /** * Initialize a X509Data. @@ -39,20 +42,54 @@ public function __construct(\DOMElement $xml = null) } if ($n->namespaceURI !== XMLSecurityDSig::XMLDSIGNS) { - $this->data[] = new Chunk($n); + $this->addData(new Chunk($n)); continue; } switch ($n->localName) { case 'X509Certificate': - $this->data[] = new X509Certificate($n); + $this->addData(new X509Certificate($n)); break; default: - $this->data[] = new Chunk($n); + $this->addData(new Chunk($n)); break; } } } + + /** + * Collect the value of the data-property + * @return array + */ + public function getData() + { + return $this->data; + } + + + /** + * Set the value of the data-property + * @param array $data + * @return void + */ + public function setData(array $data) + { + $this->data = $data; + } + + + /** + * Add the value to the data-property + * @param \SAML2\XML\Chunk|\SAML2\XML\ds\X509Certificate $data + * @return void + */ + public function addData($data) + { + Assert::isInstanceOfAny($data, [Chunk::class, X509Certificate::class]); + $this->data[] = $data; + } + + /** * Convert this X509Data element to XML. * @@ -61,7 +98,7 @@ public function __construct(\DOMElement $xml = null) */ public function toXML(\DOMElement $parent) { - assert(is_array($this->data)); + Assert::isArray($this->getData()); $doc = $parent->ownerDocument; @@ -69,7 +106,7 @@ public function toXML(\DOMElement $parent) $parent->appendChild($e); /** @var \SAML2\XML\Chunk|\SAML2\XML\ds\X509Certificate $n */ - foreach ($this->data as $n) { + foreach ($this->getData() as $n) { $n->toXML($e); } diff --git a/vendor/simplesamlphp/saml2/src/SAML2/XML/ecp/Response.php b/vendor/simplesamlphp/saml2/src/SAML2/XML/ecp/Response.php index 2bc45f381a..2e76d2437d 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/XML/ecp/Response.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/XML/ecp/Response.php @@ -4,8 +4,8 @@ use DOMElement; use InvalidArgumentException; - use SAML2\Constants; +use Webmozart\Assert\Assert; /** * Class representing the ECP Response element. @@ -19,10 +19,11 @@ class Response */ public $AssertionConsumerServiceURL; + /** * Create a ECP Response element. * - * @param DOMElement|null $xml The XML element we should load. + * @param \DOMElement|null $xml The XML element we should load. */ public function __construct(DOMElement $xml = null) { @@ -31,33 +32,63 @@ public function __construct(DOMElement $xml = null) } if (!$xml->hasAttributeNS(Constants::NS_SOAP, 'mustUnderstand')) { - throw new Exception('Missing SOAP-ENV:mustUnderstand attribute in <ecp:Response>.'); + throw new \Exception('Missing SOAP-ENV:mustUnderstand attribute in <ecp:Response>.'); } if ($xml->getAttributeNS(Constants::NS_SOAP, 'mustUnderstand') !== '1') { - throw new Exception('Invalid value of SOAP-ENV:mustUnderstand attribute in <ecp:Response>.'); + throw new \Exception('Invalid value of SOAP-ENV:mustUnderstand attribute in <ecp:Response>.'); } if (!$xml->hasAttributeNS(Constants::NS_SOAP, 'actor')) { - throw new Exception('Missing SOAP-ENV:actor attribute in <ecp:Response>.'); + throw new \Exception('Missing SOAP-ENV:actor attribute in <ecp:Response>.'); } if ($xml->getAttributeNS(Constants::NS_SOAP, 'actor') !== 'http://schemas.xmlsoap.org/soap/actor/next') { - throw new Exception('Invalid value of SOAP-ENV:actor attribute in <ecp:Response>.'); + throw new \Exception('Invalid value of SOAP-ENV:actor attribute in <ecp:Response>.'); } if (!$xml->hasAttribute('AssertionConsumerServiceURL')) { - throw new Exception('Missing AssertionConsumerServiceURL attribute in <ecp:Response>.'); + throw new \Exception('Missing AssertionConsumerServiceURL attribute in <ecp:Response>.'); } - $this->AssertionConsumerServiceURL = $xml->getAttribute('AssertionConsumerServiceURL'); + $this->setAssertionConsumerServiceURL($xml->getAttribute('AssertionConsumerServiceURL')); } + + + /** + * Collect the value of the AssertionConsumerServiceURL-property + * @return string + */ + public function getAssertionConsumerServiceURL() + { + return $this->AssertionConsumerServiceURL; + } + + + /** + * Set the value of the AssertionConsumerServiceURL-property + * @param string $assertionConsumerServiceURL + * @throws InvalidArgumentException + * @return void + */ + public function setAssertionConsumerServiceURL($assertionConsumerServiceURL) + { + Assert::string($assertionConsumerServiceURL); + if (!filter_var($assertionConsumerServiceURL, FILTER_VALIDATE_URL)) { + throw new InvalidArgumentException('AssertionConsumerServiceURL is not a valid URL.'); + } + $this->AssertionConsumerServiceURL = $assertionConsumerServiceURL; + } + + /** * Convert this ECP Response to XML. * - * @param DOMElement $parent The element we should append this element to. + * @param \DOMElement $parent The element we should append this element to. + * @throws InvalidArgumentException + * @return \DOMElement */ - public function toXML(DOMElement $parent) + public function toXML(\DOMElement $parent) { - if (!is_string($this->AssertionConsumerServiceURL)) { + if (!is_string($this->getAssertionConsumerServiceURL())) { throw new InvalidArgumentException("AssertionConsumerServiceURL must be a string"); } @@ -68,7 +99,7 @@ public function toXML(DOMElement $parent) $response->setAttributeNS(Constants::NS_SOAP, 'SOAP-ENV:mustUnderstand', '1'); $response->setAttributeNS(Constants::NS_SOAP, 'SOAP-ENV:actor', 'http://schemas.xmlsoap.org/soap/actor/next'); - $response->setAttribute('AssertionConsumerServiceURL', $this->AssertionConsumerServiceURL); + $response->setAttribute('AssertionConsumerServiceURL', $this->getAssertionConsumerServiceURL()); return $response; } diff --git a/vendor/simplesamlphp/saml2/src/SAML2/XML/md/AdditionalMetadataLocation.php b/vendor/simplesamlphp/saml2/src/SAML2/XML/md/AdditionalMetadataLocation.php index 322f703e0f..23acb0bf9e 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/XML/md/AdditionalMetadataLocation.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/XML/md/AdditionalMetadataLocation.php @@ -4,6 +4,7 @@ use SAML2\Constants; use SAML2\Utils; +use Webmozart\Assert\Assert; /** * Class representing SAML 2 metadata AdditionalMetadataLocation element. @@ -26,6 +27,7 @@ class AdditionalMetadataLocation */ public $location; + /** * Initialize an AdditionalMetadataLocation element. * @@ -41,11 +43,56 @@ public function __construct(\DOMElement $xml = null) if (!$xml->hasAttribute('namespace')) { throw new \Exception('Missing namespace attribute on AdditionalMetadataLocation element.'); } - $this->namespace = $xml->getAttribute('namespace'); + $this->setNamespace($xml->getAttribute('namespace')); + + $this->setLocation($xml->textContent); + } + + + /** + * Collect the value of the namespace-property + * @return string + */ + public function getNamespace() + { + return $this->namespace; + } + + + /** + * Set the value of the namespace-property + * @param string $namespace + * @return void + */ + public function setNamespace($namespace) + { + Assert::string($namespace); + $this->namespace = $namespace; + } - $this->location = $xml->textContent; + + /** + * Collect the value of the location-property + * @return string + */ + public function getLocation() + { + return $this->location; } + + /** + * Set the value of the location-property + * @param string $location + * @return void + */ + public function setLocation($location) + { + Assert::string($location); + $this->location = $location; + } + + /** * Convert this AdditionalMetadataLocation to XML. * @@ -54,11 +101,11 @@ public function __construct(\DOMElement $xml = null) */ public function toXML(\DOMElement $parent) { - assert(is_string($this->namespace)); - assert(is_string($this->location)); + Assert::string($this->getNamespace()); + Assert::string($this->getLocation()); - $e = Utils::addString($parent, Constants::NS_MD, 'md:AdditionalMetadataLocation', $this->location); - $e->setAttribute('namespace', $this->namespace); + $e = Utils::addString($parent, Constants::NS_MD, 'md:AdditionalMetadataLocation', $this->getLocation()); + $e->setAttribute('namespace', $this->getNamespace()); return $e; } diff --git a/vendor/simplesamlphp/saml2/src/SAML2/XML/md/AffiliationDescriptor.php b/vendor/simplesamlphp/saml2/src/SAML2/XML/md/AffiliationDescriptor.php index 5b1a2cf453..f56d025775 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/XML/md/AffiliationDescriptor.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/XML/md/AffiliationDescriptor.php @@ -5,6 +5,7 @@ use SAML2\Constants; use SAML2\SignedElementHelper; use SAML2\Utils; +use Webmozart\Assert\Assert; /** * Class representing SAML 2 AffiliationDescriptor element. @@ -46,9 +47,9 @@ class AffiliationDescriptor extends SignedElementHelper * * Array of extension elements. * - * @var array + * @var \SAML2\XML\Chunk[] */ - public $Extensions = array(); + public $Extensions = []; /** * The AffiliateMember(s). @@ -57,7 +58,7 @@ class AffiliationDescriptor extends SignedElementHelper * * @var array */ - public $AffiliateMember = array(); + public $AffiliateMember = []; /** * KeyDescriptor elements. @@ -66,7 +67,8 @@ class AffiliationDescriptor extends SignedElementHelper * * @var \SAML2\XML\md\KeyDescriptor[] */ - public $KeyDescriptor = array(); + public $KeyDescriptor = []; + /** * Initialize a AffiliationDescriptor. @@ -85,32 +87,208 @@ public function __construct(\DOMElement $xml = null) if (!$xml->hasAttribute('affiliationOwnerID')) { throw new \Exception('Missing affiliationOwnerID on AffiliationDescriptor.'); } - $this->affiliationOwnerID = $xml->getAttribute('affiliationOwnerID'); + $this->setAffiliationOwnerID($xml->getAttribute('affiliationOwnerID')); if ($xml->hasAttribute('ID')) { - $this->ID = $xml->getAttribute('ID'); + $this->setID($xml->getAttribute('ID')); } if ($xml->hasAttribute('validUntil')) { - $this->validUntil = Utils::xsDateTimeToTimestamp($xml->getAttribute('validUntil')); + $this->setValidUntil(Utils::xsDateTimeToTimestamp($xml->getAttribute('validUntil'))); } if ($xml->hasAttribute('cacheDuration')) { - $this->cacheDuration = $xml->getAttribute('cacheDuration'); + $this->setCacheDuration($xml->getAttribute('cacheDuration')); } - $this->Extensions = Extensions::getList($xml); + $this->setExtensions(Extensions::getList($xml)); - $this->AffiliateMember = Utils::extractStrings($xml, Constants::NS_MD, 'AffiliateMember'); + $this->setAffiliateMember(Utils::extractStrings($xml, Constants::NS_MD, 'AffiliateMember')); if (empty($this->AffiliateMember)) { throw new \Exception('Missing AffiliateMember in AffiliationDescriptor.'); } foreach (Utils::xpQuery($xml, './saml_metadata:KeyDescriptor') as $kd) { - $this->KeyDescriptor[] = new KeyDescriptor($kd); + $this->addKeyDescriptor(new KeyDescriptor($kd)); } } + + /** + * Collect the value of the affiliationOwnerId-property + * @return string + */ + public function getAffiliationOwnerID() + { + return $this->affiliationOwnerID; + } + + + /** + * Set the value of the affiliationOwnerId-property + * @param string $affiliationOwnerId + * @return void + */ + public function setAffiliationOwnerID($affiliationOwnerId) + { + Assert::string($affiliationOwnerId); + $this->affiliationOwnerID = $affiliationOwnerId; + } + + + /** + * Collect the value of the ID-property + * @return string|null + */ + public function getID() + { + return $this->ID; + } + + + /** + * Set the value of the ID-property + * @param string|null $Id + * @return void + */ + public function setID($Id = null) + { + Assert::nullOrString($Id); + + $this->ID = $Id; + } + + + /** + * Collect the value of the validUntil-property + * @return int|null + */ + public function getValidUntil() + { + return $this->validUntil; + } + + + /** + * Set the value of the validUntil-property + * @param int|null $validUntil + * @return void + */ + public function setValidUntil($validUntil = null) + { + Assert::nullOrInteger($validUntil); + $this->validUntil = $validUntil; + } + + + /** + * Collect the value of the cacheDuration-property + * @return string|null + */ + public function getCacheDuration() + { + return $this->cacheDuration; + } + + + /** + * Set the value of the cacheDuration-property + * @param string|null $cacheDuration + * @return void + */ + public function setCacheDuration($cacheDuration = null) + { + Assert::nullOrString($cacheDuration); + $this->cacheDuration = $cacheDuration; + } + + + /** + * Collect the value of the Extensions-property + * @return \SAML2\XML\Chunk[] + */ + public function getExtensions() + { + return $this->Extensions; + } + + + /** + * Set the value of the Extensions-property + * @param array $extensions + * @return void + */ + public function setExtensions(array $extensions) + { + $this->Extensions = $extensions; + } + + + /** + * Add an Extension. + * + * @param \SAML2\XML\Chunk $extensions The Extensions + * @return void + */ + public function addExtension(Extensions $extension) + { + $this->Extensions[] = $extension; + } + + + /** + * Collect the value of the AffiliateMember-property + * @return array + */ + public function getAffiliateMember() + { + return $this->AffiliateMember; + } + + + /** + * Set the value of the AffiliateMember-property + * @param array $affiliateMember + * @return void + */ + public function setAffiliateMember(array $affiliateMember) + { + $this->AffiliateMember = $affiliateMember; + } + + + /** + * Collect the value of the KeyDescriptor-property + * @return \SAML2\XML\md\KeyDescriptor[] + */ + public function getKeyDescriptor() + { + return $this->KeyDescriptor; + } + + + /** + * Set the value of the KeyDescriptor-property + * @param array $keyDescriptor + * @return void + */ + public function setKeyDescriptor(array $keyDescriptor) + { + $this->KeyDescriptor = $keyDescriptor; + } + + + /** + * Add the value to the KeyDescriptor-property + * @param \SAML2\XML\md\KeyDescriptor $keyDescriptor + * @return void + */ + public function addKeyDescriptor(KeyDescriptor $keyDescriptor) + { + $this->KeyDescriptor[] = $keyDescriptor; + } + + /** * Add this AffiliationDescriptor to an EntityDescriptor. * @@ -119,37 +297,37 @@ public function __construct(\DOMElement $xml = null) */ public function toXML(\DOMElement $parent) { - assert(is_string($this->affiliationOwnerID)); - assert(is_null($this->ID) || is_string($this->ID)); - assert(is_null($this->validUntil) || is_int($this->validUntil)); - assert(is_null($this->cacheDuration) || is_string($this->cacheDuration)); - assert(is_array($this->Extensions)); - assert(is_array($this->AffiliateMember)); - assert(!empty($this->AffiliateMember)); - assert(is_array($this->KeyDescriptor)); + Assert::string($this->getAffiliationOwnerID()); + Assert::nullOrString($this->getID()); + Assert::nullOrInteger($this->getValidUntil()); + Assert::nullOrString($this->getCacheDuration()); + Assert::isArray($this->getExtensions()); + Assert::isArray($affiliateMember = $this->getAffiliateMember()); + Assert::notEmpty($affiliateMember); + Assert::isArray($this->getKeyDescriptor()); $e = $parent->ownerDocument->createElementNS(Constants::NS_MD, 'md:AffiliationDescriptor'); $parent->appendChild($e); - $e->setAttribute('affiliationOwnerID', $this->affiliationOwnerID); + $e->setAttribute('affiliationOwnerID', $this->getAffiliationOwnerID()); - if (isset($this->ID)) { - $e->setAttribute('ID', $this->ID); + if ($this->getID() !== null) { + $e->setAttribute('ID', $this->getID()); } - if (isset($this->validUntil)) { - $e->setAttribute('validUntil', gmdate('Y-m-d\TH:i:s\Z', $this->validUntil)); + if ($this->getValidUntil() !== null) { + $e->setAttribute('validUntil', gmdate('Y-m-d\TH:i:s\Z', $this->getValidUntil())); } - if (isset($this->cacheDuration)) { - $e->setAttribute('cacheDuration', $this->cacheDuration); + if ($this->getCacheDuration() !== null) { + $e->setAttribute('cacheDuration', $this->getCacheDuration()); } - Extensions::addList($e, $this->Extensions); + Extensions::addList($e, $this->getExtensions()); - Utils::addStrings($e, Constants::NS_MD, 'md:AffiliateMember', false, $this->AffiliateMember); + Utils::addStrings($e, Constants::NS_MD, 'md:AffiliateMember', false, $this->getAffiliateMember()); - foreach ($this->KeyDescriptor as $kd) { + foreach ($this->getKeyDescriptor() as $kd) { $kd->toXML($e); } diff --git a/vendor/simplesamlphp/saml2/src/SAML2/XML/md/AttributeAuthorityDescriptor.php b/vendor/simplesamlphp/saml2/src/SAML2/XML/md/AttributeAuthorityDescriptor.php index ec6e5cd5e1..244adad925 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/XML/md/AttributeAuthorityDescriptor.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/XML/md/AttributeAuthorityDescriptor.php @@ -5,6 +5,7 @@ use SAML2\Constants; use SAML2\Utils; use SAML2\XML\saml\Attribute; +use Webmozart\Assert\Assert; /** * Class representing SAML 2 metadata AttributeAuthorityDescriptor. @@ -20,7 +21,7 @@ class AttributeAuthorityDescriptor extends RoleDescriptor * * @var \SAML2\XML\md\EndpointType[] */ - public $AttributeService = array(); + public $AttributeService = []; /** * List of AssertionIDRequestService endpoints. @@ -29,7 +30,7 @@ class AttributeAuthorityDescriptor extends RoleDescriptor * * @var \SAML2\XML\md\EndpointType[] */ - public $AssertionIDRequestService = array(); + public $AssertionIDRequestService = []; /** * List of supported NameID formats. @@ -38,7 +39,7 @@ class AttributeAuthorityDescriptor extends RoleDescriptor * * @var string[] */ - public $NameIDFormat = array(); + public $NameIDFormat = []; /** * List of supported attribute profiles. @@ -47,7 +48,7 @@ class AttributeAuthorityDescriptor extends RoleDescriptor * * @var array */ - public $AttributeProfile = array(); + public $AttributeProfile = []; /** * List of supported attributes. @@ -56,7 +57,8 @@ class AttributeAuthorityDescriptor extends RoleDescriptor * * @var \SAML2\XML\saml\Attribute[] */ - public $Attribute = array(); + public $Attribute = []; + /** * Initialize an IDPSSODescriptor. @@ -73,25 +75,167 @@ public function __construct(\DOMElement $xml = null) } foreach (Utils::xpQuery($xml, './saml_metadata:AttributeService') as $ep) { - $this->AttributeService[] = new EndpointType($ep); + $this->addAttributeService(new EndpointType($ep)); } - if (empty($this->AttributeService)) { + if ($this->getAttributeService() === []) { throw new \Exception('Must have at least one AttributeService in AttributeAuthorityDescriptor.'); } foreach (Utils::xpQuery($xml, './saml_metadata:AssertionIDRequestService') as $ep) { - $this->AssertionIDRequestService[] = new EndpointType($ep); + $this->addAssertionIDRequestService(new EndpointType($ep)); } - $this->NameIDFormat = Utils::extractStrings($xml, Constants::NS_MD, 'NameIDFormat'); + $this->setNameIDFormat(Utils::extractStrings($xml, Constants::NS_MD, 'NameIDFormat')); - $this->AttributeProfile = Utils::extractStrings($xml, Constants::NS_MD, 'AttributeProfile'); + $this->setAttributeProfile(Utils::extractStrings($xml, Constants::NS_MD, 'AttributeProfile')); foreach (Utils::xpQuery($xml, './saml_assertion:Attribute') as $a) { - $this->Attribute[] = new Attribute($a); + $this->addAttribute(new Attribute($a)); } } + + /** + * Collect the value of the AttributeService-property + * @return \SAML2\XML\md\EndpointType[] + */ + public function getAttributeService() + { + return $this->AttributeService; + } + + + /** + * Set the value of the AttributeService-property + * @param \SAML2\XML\md\EndpointType[] $attributeService + * @return void + */ + public function setAttributeService(array $attributeService) + { + $this->AttributeService = $attributeService; + } + + + /** + * Add the value to the AttributeService-property + * @param \SAML2\XML\md\EndpointType $attributeService + * @return void + */ + public function addAttributeService(EndpointType $attributeService) + { + Assert::isInstanceOf($attributeService, EndpointType::class); + $this->AttributeService[] = $attributeService; + } + + + /** + * Collect the value of the NameIDFormat-property + * @return string[] + */ + public function getNameIDFormat() + { + return $this->NameIDFormat; + } + + + /** + * Set the value of the NameIDFormat-property + * @param string[] $nameIDFormat + * @return void + */ + public function setNameIDFormat(array $nameIDFormat) + { + $this->NameIDFormat = $nameIDFormat; + } + + + /** + * Collect the value of the AssertionIDRequestService-property + * @return \SAML2\XML\md\EndpointType[] + */ + public function getAssertionIDRequestService() + { + return $this->AssertionIDRequestService; + } + + + /** + * Set the value of the AssertionIDRequestService-property + * @param \SAML2\XML\md\EndpointType[] $assertionIDRequestService + * @return void + */ + public function setAssertionIDRequestService(array $assertionIDRequestService) + { + $this->AssertionIDRequestService = $assertionIDRequestService; + } + + + /** + * Add the value to the AssertionIDRequestService-property + * @param \SAML2\XML\md\EndpointType $assertionIDRequestService + * @return void + */ + public function addAssertionIDRequestService(EndpointType $assertionIDRequestService) + { + Assert::isInstanceOf($assertionIDRequestService, EndpointType::class); + $this->AssertionIDRequestService[] = $assertionIDRequestService; + } + + + /** + * Collect the value of the AttributeProfile-property + * @return string[] + */ + public function getAttributeProfile() + { + return $this->AttributeProfile; + } + + + /** + * Set the value of the AttributeProfile-property + * @param string[] $attributeProfile + * @return void + */ + public function setAttributeProfile(array $attributeProfile) + { + $this->AttributeProfile = $attributeProfile; + } + + + /** + * Collect the value of the Attribute-property + * @return \SAML2\XML\saml\Attribute[] + */ + public function getAttribute() + { + return $this->Attribute; + } + + + /** + * Set the value of the Attribute-property + * @param \SAML2\XML\saml\Attribute[] $attribute + * @return void + */ + public function setAttribute(array $attribute) + { + $this->Attribute = $attribute; + } + + + /** + * Add the value to the Attribute-property + * @param \SAML2\XML\saml\Attribute $attribute + * @return void + */ + public function addAttribute(Attribute $attribute) + { + Assert::isInstanceOf($attribute, Attribute::class); + $this->Attribute[] = $attribute; + } + + /** * Add this AttributeAuthorityDescriptor to an EntityDescriptor. * @@ -100,28 +244,28 @@ public function __construct(\DOMElement $xml = null) */ public function toXML(\DOMElement $parent) { - assert(is_array($this->AttributeService)); - assert(!empty($this->AttributeService)); - assert(is_array($this->AssertionIDRequestService)); - assert(is_array($this->NameIDFormat)); - assert(is_array($this->AttributeProfile)); - assert(is_array($this->Attribute)); + Assert::isArray($attributeService = $this->getAttributeService()); + Assert::notEmpty($attributeService); + Assert::isArray($this->getAssertionIDRequestService()); + Assert::isArray($this->getNameIDFormat()); + Assert::isArray($this->getAttributeProfile()); + Assert::isArray($this->Attribute); $e = parent::toXML($parent); - foreach ($this->AttributeService as $ep) { + foreach ($this->getAttributeService() as $ep) { $ep->toXML($e, 'md:AttributeService'); } - foreach ($this->AssertionIDRequestService as $ep) { + foreach ($this->getAssertionIDRequestService() as $ep) { $ep->toXML($e, 'md:AssertionIDRequestService'); } - Utils::addStrings($e, Constants::NS_MD, 'md:NameIDFormat', false, $this->NameIDFormat); + Utils::addStrings($e, Constants::NS_MD, 'md:NameIDFormat', false, $this->getNameIDFormat()); - Utils::addStrings($e, Constants::NS_MD, 'md:AttributeProfile', false, $this->AttributeProfile); + Utils::addStrings($e, Constants::NS_MD, 'md:AttributeProfile', false, $this->getAttributeProfile()); - foreach ($this->Attribute as $a) { + foreach ($this->getAttribute() as $a) { $a->toXML($e); } diff --git a/vendor/simplesamlphp/saml2/src/SAML2/XML/md/AttributeConsumingService.php b/vendor/simplesamlphp/saml2/src/SAML2/XML/md/AttributeConsumingService.php index c7a5c138d4..e7d64a3f8e 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/XML/md/AttributeConsumingService.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/XML/md/AttributeConsumingService.php @@ -4,6 +4,7 @@ use SAML2\Constants; use SAML2\Utils; +use Webmozart\Assert\Assert; /** * Class representing SAML 2 Metadata AttributeConsumingService element. @@ -33,7 +34,7 @@ class AttributeConsumingService * * @var array */ - public $ServiceName = array(); + public $ServiceName = []; /** * The ServiceDescription of this AttributeConsumingService. @@ -42,7 +43,7 @@ class AttributeConsumingService * * @var array */ - public $ServiceDescription = array(); + public $ServiceDescription = []; /** * The RequestedAttribute elements. @@ -51,7 +52,8 @@ class AttributeConsumingService * * @var \SAML2\XML\md\RequestedAttribute[] */ - public $RequestedAttribute = array(); + public $RequestedAttribute = []; + /** * Initialize / parse an AttributeConsumingService. @@ -68,22 +70,141 @@ public function __construct(\DOMElement $xml = null) if (!$xml->hasAttribute('index')) { throw new \Exception('Missing index on AttributeConsumingService.'); } - $this->index = (int) $xml->getAttribute('index'); + $this->setIndex(intval($xml->getAttribute('index'))); - $this->isDefault = Utils::parseBoolean($xml, 'isDefault', null); + $this->setIsDefault(Utils::parseBoolean($xml, 'isDefault', null)); - $this->ServiceName = Utils::extractLocalizedStrings($xml, Constants::NS_MD, 'ServiceName'); - if (empty($this->ServiceName)) { + $this->setServiceName(Utils::extractLocalizedStrings($xml, Constants::NS_MD, 'ServiceName')); + if ($this->getServiceName() === []) { throw new \Exception('Missing ServiceName in AttributeConsumingService.'); } - $this->ServiceDescription = Utils::extractLocalizedStrings($xml, Constants::NS_MD, 'ServiceDescription'); + $this->setServiceDescription(Utils::extractLocalizedStrings($xml, Constants::NS_MD, 'ServiceDescription')); foreach (Utils::xpQuery($xml, './saml_metadata:RequestedAttribute') as $ra) { - $this->RequestedAttribute[] = new RequestedAttribute($ra); + $this->addRequestedAttribute(new RequestedAttribute($ra)); } } + + /** + * Collect the value of the index-property + * @return int + */ + public function getIndex() + { + return $this->index; + } + + + /** + * Set the value of the index-property + * @param int $index + * @return void + */ + public function setIndex($index) + { + Assert::integer($index); + $this->index = $index; + } + + + /** + * Collect the value of the isDefault-property + * @return boolean|null + */ + public function getIsDefault() + { + return $this->isDefault; + } + + + /** + * Set the value of the isDefault-property + * @param boolean|null $flag + * @return void + */ + public function setIsDefault($flag = null) + { + Assert::nullOrBoolean($flag); + $this->isDefault = $flag; + } + + + /** + * Collect the value of the ServiceName-property + * @return string[] + */ + public function getServiceName() + { + return $this->ServiceName; + } + + + /** + * Set the value of the ServiceName-property + * @param string[] $serviceName + * @return void + */ + public function setServiceName(array $serviceName) + { + $this->ServiceName = $serviceName; + } + + + /** + * Collect the value of the ServiceDescription-property + * @return string[] + */ + public function getServiceDescription() + { + return $this->ServiceDescription; + } + + + /** + * Set the value of the ServiceDescription-property + * @param string[] $serviceDescription + * @return void + */ + public function setServiceDescription(array $serviceDescription) + { + $this->ServiceDescription = $serviceDescription; + } + + + /** + * Collect the value of the RequestedAttribute-property + * @return \SAML2\XML\md\RequestedAttribute[] + */ + public function getRequestedAttribute() + { + return $this->RequestedAttribute; + } + + + /** + * Set the value of the RequestedAttribute-property + * @param \SAML2\XML\md\RequestedAttribute[] $requestedAttribute + * @return void + */ + public function setRequestedAttribute(array $requestedAttribute) + { + $this->RequestedAttribute = $requestedAttribute; + } + + + /** + * Add the value to the RequestedAttribute-property + * @param \SAML2\XML\md\RequestedAttribute $requestedAttribute + * @return void + */ + public function addRequestedAttribute(RequestedAttribute $requestedAttribute) + { + $this->RequestedAttribute[] = $requestedAttribute; + } + + /** * Convert to \DOMElement. * @@ -92,29 +213,29 @@ public function __construct(\DOMElement $xml = null) */ public function toXML(\DOMElement $parent) { - assert(is_int($this->index)); - assert(is_null($this->isDefault) || is_bool($this->isDefault)); - assert(is_array($this->ServiceName)); - assert(is_array($this->ServiceDescription)); - assert(is_array($this->RequestedAttribute)); + Assert::integer($this->getIndex()); + Assert::nullOrBoolean($this->getIsDefault()); + Assert::isArray($this->getServiceName()); + Assert::isArray($this->getServiceDescription()); + Assert::isArray($this->getRequestedAttribute()); $doc = $parent->ownerDocument; $e = $doc->createElementNS(Constants::NS_MD, 'md:AttributeConsumingService'); $parent->appendChild($e); - $e->setAttribute('index', (string) $this->index); + $e->setAttribute('index', strval($this->getIndex())); - if ($this->isDefault === true) { + if ($this->getIsDefault() === true) { $e->setAttribute('isDefault', 'true'); - } elseif ($this->isDefault === false) { + } elseif ($this->getIsDefault() === false) { $e->setAttribute('isDefault', 'false'); } - Utils::addStrings($e, Constants::NS_MD, 'md:ServiceName', true, $this->ServiceName); - Utils::addStrings($e, Constants::NS_MD, 'md:ServiceDescription', true, $this->ServiceDescription); + Utils::addStrings($e, Constants::NS_MD, 'md:ServiceName', true, $this->getServiceName()); + Utils::addStrings($e, Constants::NS_MD, 'md:ServiceDescription', true, $this->getServiceDescription()); - foreach ($this->RequestedAttribute as $ra) { + foreach ($this->getRequestedAttribute() as $ra) { $ra->toXML($e); } diff --git a/vendor/simplesamlphp/saml2/src/SAML2/XML/md/AuthnAuthorityDescriptor.php b/vendor/simplesamlphp/saml2/src/SAML2/XML/md/AuthnAuthorityDescriptor.php index 013ca2ec35..1343b13cd4 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/XML/md/AuthnAuthorityDescriptor.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/XML/md/AuthnAuthorityDescriptor.php @@ -4,6 +4,7 @@ use SAML2\Constants; use SAML2\Utils; +use Webmozart\Assert\Assert; /** * Class representing SAML 2 metadata AuthnAuthorityDescriptor. @@ -19,7 +20,7 @@ class AuthnAuthorityDescriptor extends RoleDescriptor * * @var \SAML2\XML\md\EndpointType[] */ - public $AuthnQueryService = array(); + public $AuthnQueryService = []; /** * List of AssertionIDRequestService endpoints. @@ -28,7 +29,7 @@ class AuthnAuthorityDescriptor extends RoleDescriptor * * @var \SAML2\XML\md\EndpointType[] */ - public $AssertionIDRequestService = array(); + public $AssertionIDRequestService = []; /** * List of supported NameID formats. @@ -37,7 +38,8 @@ class AuthnAuthorityDescriptor extends RoleDescriptor * * @var string[] */ - public $NameIDFormat = array(); + public $NameIDFormat = []; + /** * Initialize an IDPSSODescriptor. @@ -54,19 +56,107 @@ public function __construct(\DOMElement $xml = null) } foreach (Utils::xpQuery($xml, './saml_metadata:AuthnQueryService') as $ep) { - $this->AuthnQueryService[] = new EndpointType($ep); + $this->addAuthnQueryService(new EndpointType($ep)); } - if (empty($this->AuthnQueryService)) { + if ($this->getAuthnQueryService() === []) { throw new \Exception('Must have at least one AuthnQueryService in AuthnAuthorityDescriptor.'); } foreach (Utils::xpQuery($xml, './saml_metadata:AssertionIDRequestService') as $ep) { - $this->AssertionIDRequestService[] = new EndpointType($ep); + $this->addAssertionIDRequestService(new EndpointType($ep)); } - $this->NameIDFormat = Utils::extractStrings($xml, Constants::NS_MD, 'NameIDFormat'); + $this->setNameIDFormat(Utils::extractStrings($xml, Constants::NS_MD, 'NameIDFormat')); + } + + + /** + * Collect the value of the AuthnQueryService-property + * @return \SAML2\XML\md\EndpointType[] + */ + public function getAuthnQueryService() + { + return $this->AuthnQueryService; + } + + + /** + * Set the value of the AuthnQueryService-property + * @param \SAML2\XML\md\EndpointType[] $authnQueryService + * @return void + */ + public function setAuthnQueryService(array $authnQueryService) + { + $this->AuthnQueryService = $authnQueryService; + } + + + /** + * Add the value to the AuthnQueryService-property + * @param \SAML2\XML\md\EndpointType $authnQueryService + * @return void + */ + public function addAuthnQueryService(EndpointType $authnQueryService) + { + Assert::isInstanceOf($authnQueryService, EndpointType::class); + $this->AuthnQueryService[] = $authnQueryService; + } + + + /** + * Collect the value of the AssertionIDRequestService-property + * @return \SAML2\XML\md\EndpointType[] + */ + public function getAssertionIDRequestService() + { + return $this->AssertionIDRequestService; + } + + + /** + * Set the value of the AssertionIDRequestService-property + * @param \SAML2\XML\md\EndpointType[] $assertionIDRequestService + * @return void + */ + public function setAssertionIDRequestService(array $assertionIDRequestService) + { + $this->AssertionIDRequestService = $assertionIDRequestService; } + + /** + * Add the value to the AssertionIDRequestService-property + * @param \SAML2\XML\md\EndpointType $assertionIDRequestService + * @return void + */ + public function addAssertionIDRequestService(EndpointType $assertionIDRequestService) + { + Assert::isInstanceOf($assertionIDRequestService, EndpointType::class); + $this->AssertionIDRequestService[] = $assertionIDRequestService; + } + + + /** + * Collect the value of the NameIDFormat-property + * @return string[] + */ + public function getNameIDFormat() + { + return $this->NameIDFormat; + } + + + /** + * Set the value of the NameIDFormat-property + * @param string[] $nameIDFormat + * @return void + */ + public function setNameIDFormat(array $nameIDFormat) + { + $this->NameIDFormat = $nameIDFormat; + } + + /** * Add this IDPSSODescriptor to an EntityDescriptor. * @@ -75,22 +165,22 @@ public function __construct(\DOMElement $xml = null) */ public function toXML(\DOMElement $parent) { - assert(is_array($this->AuthnQueryService)); - assert(!empty($this->AuthnQueryService)); - assert(is_array($this->AssertionIDRequestService)); - assert(is_array($this->NameIDFormat)); + Assert::isArray($authnQueryService = $this->getAuthnQueryService()); + Assert::notEmpty($authnQueryService); + Assert::isArray($this->getAssertionIDRequestService()); + Assert::isArray($this->NameIDFormat); $e = parent::toXML($parent); - foreach ($this->AuthnQueryService as $ep) { + foreach ($this->getAuthnQueryService() as $ep) { $ep->toXML($e, 'md:AuthnQueryService'); } - foreach ($this->AssertionIDRequestService as $ep) { + foreach ($this->getAssertionIDRequestService() as $ep) { $ep->toXML($e, 'md:AssertionIDRequestService'); } - Utils::addStrings($e, Constants::NS_MD, 'md:NameIDFormat', false, $this->NameIDFormat); + Utils::addStrings($e, Constants::NS_MD, 'md:NameIDFormat', false, $this->getNameIDFormat()); return $e; } diff --git a/vendor/simplesamlphp/saml2/src/SAML2/XML/md/ContactPerson.php b/vendor/simplesamlphp/saml2/src/SAML2/XML/md/ContactPerson.php index fb40c6de8a..1c748042b8 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/XML/md/ContactPerson.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/XML/md/ContactPerson.php @@ -4,6 +4,8 @@ use SAML2\Constants; use SAML2\Utils; +use SAML2\XML\Chunk; +use Webmozart\Assert\Assert; /** * Class representing SAML 2 ContactPerson. @@ -26,7 +28,7 @@ class ContactPerson * * @var array */ - public $Extensions = array(); + public $Extensions = []; /** * The Company of this contact. @@ -54,21 +56,22 @@ class ContactPerson * * @var array */ - public $EmailAddress = array(); + public $EmailAddress = []; /** * The TelephoneNumbers of this contact. * * @var array */ - public $TelephoneNumber = array(); + public $TelephoneNumber = []; /** * Extra attributes on the contact element. * * @var array */ - public $ContactPersonAttributes = array(); + public $ContactPersonAttributes = []; + /** * Initialize a ContactPerson element. @@ -85,25 +88,26 @@ public function __construct(\DOMElement $xml = null) if (!$xml->hasAttribute('contactType')) { throw new \Exception('Missing contactType on ContactPerson.'); } - $this->contactType = $xml->getAttribute('contactType'); + $this->setContactType($xml->getAttribute('contactType')); - $this->Extensions = Extensions::getList($xml); + $this->setExtensions(Extensions::getList($xml)); - $this->Company = self::getStringElement($xml, 'Company'); - $this->GivenName = self::getStringElement($xml, 'GivenName'); - $this->SurName = self::getStringElement($xml, 'SurName'); - $this->EmailAddress = self::getStringElements($xml, 'EmailAddress'); - $this->TelephoneNumber = self::getStringElements($xml, 'TelephoneNumber'); + $this->setCompany(self::getStringElement($xml, 'Company')); + $this->setGivenName(self::getStringElement($xml, 'GivenName')); + $this->setSurName(self::getStringElement($xml, 'SurName')); + $this->setEmailAddress(self::getStringElements($xml, 'EmailAddress')); + $this->setTelephoneNumber(self::getStringElements($xml, 'TelephoneNumber')); foreach ($xml->attributes as $attr) { if ($attr->nodeName == "contactType") { continue; } - $this->ContactPersonAttributes[$attr->nodeName] = $attr->nodeValue; + $this->addContactPersonAttributes($attr->nodeName, $attr->nodeValue); } } + /** * Retrieve the value of a child \DOMElements as an array of strings. * @@ -113,11 +117,11 @@ public function __construct(\DOMElement $xml = null) */ private static function getStringElements(\DOMElement $parent, $name) { - assert(is_string($name)); + Assert::string($name); - $e = Utils::xpQuery($parent, './saml_metadata:' . $name); + $e = Utils::xpQuery($parent, './saml_metadata:'.$name); - $ret = array(); + $ret = []; foreach ($e as $i) { $ret[] = $i->textContent; } @@ -125,29 +129,251 @@ private static function getStringElements(\DOMElement $parent, $name) return $ret; } + /** * Retrieve the value of a child \DOMElement as a string. * * @param \DOMElement $parent The parent element. * @param string $name The name of the child element. - * @return string|null The value of the child element. * @throws \Exception + * @return string|null The value of the child element. */ private static function getStringElement(\DOMElement $parent, $name) { - assert(is_string($name)); + Assert::string($name); $e = self::getStringElements($parent, $name); if (empty($e)) { return null; } if (count($e) > 1) { - throw new \Exception('More than one ' . $name . ' in ' . $parent->tagName); + throw new \Exception('More than one '.$name.' in '.$parent->tagName); } return $e[0]; } + + /** + * Collect the value of the contactType-property + * @return string + */ + public function getContactType() + { + return $this->contactType; + } + + + /** + * Set the value of the contactType-property + * @param string $contactType + * @return void + */ + public function setContactType($contactType) + { + Assert::string($contactType); + $this->contactType = $contactType; + } + + + /** + * Collect the value of the Company-property + * @return string|null + */ + public function getCompany() + { + return $this->Company; + } + + + /** + * Set the value of the Company-property + * @param string|null $company + * @return void + */ + public function setCompany($company) + { + Assert::nullOrString($company); + $this->Company = $company; + } + + + /** + * Collect the value of the GivenName-property + * @return string|null + */ + public function getGivenName() + { + return $this->GivenName; + } + + + /** + * Set the value of the GivenName-property + * @param string|null $givenName + * @return void + */ + public function setGivenName($givenName) + { + Assert::nullOrString($givenName); + $this->GivenName = $givenName; + } + + + /** + * Collect the value of the SurName-property + * @return string|null + */ + public function getSurName() + { + return $this->SurName; + } + + + /** + * Set the value of the SurName-property + * @param string|null $surName + * @return void + */ + public function setSurName($surName) + { + Assert::nullOrString($surName); + $this->SurName = $surName; + } + + + /** + * Collect the value of the EmailAddress-property + * @return string[] + */ + public function getEmailAddress() + { + return $this->EmailAddress; + } + + + /** + * Set the value of the EmailAddress-property + * @param string[] $emailAddress + * @return void + */ + public function setEmailAddress(array $emailAddress) + { + $this->EmailAddress = $emailAddress; + } + + + /** + * Add the value to the EmailAddress-property + * @param string $emailAddress + * @return void + */ + public function addEmailAddress($emailAddress) + { + $this->EmailAddress[] = $emailAddress; + } + + + /** + * Collect the value of the TelephoneNumber-property + * @return string[] + */ + public function getTelephoneNumber() + { + return $this->TelephoneNumber; + } + + + /** + * Set the value of the TelephoneNumber-property + * @param string[] $telephoneNumber + * @return void + */ + public function setTelephoneNumber(array $telephoneNumber) + { + $this->TelephoneNumber = $telephoneNumber; + } + + + /** + * Add the value to the TelephoneNumber-property + * @param string $telephoneNumber + * @return void + */ + public function addTelephoneNumber($telephoneNumber) + { + $this->TelephoneNumber[] = $telephoneNumber; + } + + + /** + * Collect the value of the Extensions-property + * @return \SAML2\XML\Chunk[] + */ + public function getExtensions() + { + return $this->Extensions; + } + + + /** + * Set the value of the Extensions-property + * @param array $extensions + * @return void + */ + public function setExtensions(array $extensions) + { + $this->Extensions = $extensions; + } + + + /** + * Add an Extension. + * + * @param \SAML2\XML\Chunk $extensions The Extensions + * @return void + */ + public function addExtension(Chunk $extension) + { + $this->Extensions[] = $extension; + } + + + /** + * Collect the value of the ContactPersonAttributes-property + * @return string[] + */ + public function getContactPersonAttributes() + { + return $this->ContactPersonAttributes; + } + + + /** + * Set the value of the ContactPersonAttributes-property + * @param string[] $contactPersonAttributes + * @return void + */ + public function setContactPersonAttributes(array $contactPersonAttributes) + { + $this->ContactPersonAttributes = $contactPersonAttributes; + } + + + /** + * Add the key/value of the ContactPersonAttributes-property + * @param string $attr + * @param string $value + * @return void + */ + public function addContactPersonAttributes($attr, $value) + { + Assert::string($attr); + Assert::string($value); + $this->ContactPersonAttributes[$attr] = $value; + } + + /** * Convert this ContactPerson to XML. * @@ -156,42 +382,42 @@ private static function getStringElement(\DOMElement $parent, $name) */ public function toXML(\DOMElement $parent) { - assert(is_string($this->contactType)); - assert(is_array($this->Extensions)); - assert(is_null($this->Company) || is_string($this->Company)); - assert(is_null($this->GivenName) || is_string($this->GivenName)); - assert(is_null($this->SurName) || is_string($this->SurName)); - assert(is_array($this->EmailAddress)); - assert(is_array($this->TelephoneNumber)); - assert(is_array($this->ContactPersonAttributes)); + Assert::string($this->getContactType()); + Assert::isArray($this->getExtensions()); + Assert::nullOrString($this->getCompany()); + Assert::nullOrString($this->getGivenName()); + Assert::nullOrString($this->getSurName()); + Assert::isArray($this->getEmailAddress()); + Assert::isArray($this->getTelephoneNumber()); + Assert::isArray($this->getContactPersonAttributes()); $doc = $parent->ownerDocument; $e = $doc->createElementNS(Constants::NS_MD, 'md:ContactPerson'); $parent->appendChild($e); - $e->setAttribute('contactType', $this->contactType); + $e->setAttribute('contactType', $this->getContactType()); - foreach ($this->ContactPersonAttributes as $attr => $val) { + foreach ($this->getContactPersonAttributes() as $attr => $val) { $e->setAttribute($attr, $val); } - Extensions::addList($e, $this->Extensions); + Extensions::addList($e, $this->getExtensions()); - if (isset($this->Company)) { - Utils::addString($e, Constants::NS_MD, 'md:Company', $this->Company); + if ($this->getCompany() !== null) { + Utils::addString($e, Constants::NS_MD, 'md:Company', $this->getCompany()); } - if (isset($this->GivenName)) { - Utils::addString($e, Constants::NS_MD, 'md:GivenName', $this->GivenName); + if ($this->getGivenName() !== null) { + Utils::addString($e, Constants::NS_MD, 'md:GivenName', $this->getGivenName()); } - if (isset($this->SurName)) { - Utils::addString($e, Constants::NS_MD, 'md:SurName', $this->SurName); + if ($this->getSurName() !== null) { + Utils::addString($e, Constants::NS_MD, 'md:SurName', $this->getSurName()); } - if (!empty($this->EmailAddress)) { - Utils::addStrings($e, Constants::NS_MD, 'md:EmailAddress', false, $this->EmailAddress); + if ($this->getEmailAddress() !== null) { + Utils::addStrings($e, Constants::NS_MD, 'md:EmailAddress', false, $this->getEmailAddress()); } - if (!empty($this->TelephoneNumber)) { - Utils::addStrings($e, Constants::NS_MD, 'md:TelephoneNumber', false, $this->TelephoneNumber); + if ($this->getTelephoneNumber() !== null) { + Utils::addStrings($e, Constants::NS_MD, 'md:TelephoneNumber', false, $this->getTelephoneNumber()); } return $e; diff --git a/vendor/simplesamlphp/saml2/src/SAML2/XML/md/EndpointType.php b/vendor/simplesamlphp/saml2/src/SAML2/XML/md/EndpointType.php index 45b47ee7ff..2985b73443 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/XML/md/EndpointType.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/XML/md/EndpointType.php @@ -3,6 +3,7 @@ namespace SAML2\XML\md; use SAML2\Constants; +use Webmozart\Assert\Assert; /** * Class representing SAML 2 EndpointType. @@ -37,7 +38,8 @@ class EndpointType * * @var array */ - private $attributes = array(); + private $attributes = []; + /** * Initialize an EndpointType. @@ -52,32 +54,33 @@ public function __construct(\DOMElement $xml = null) } if (!$xml->hasAttribute('Binding')) { - throw new \Exception('Missing Binding on ' . $xml->tagName); + throw new \Exception('Missing Binding on '.$xml->tagName); } - $this->Binding = $xml->getAttribute('Binding'); + $this->setBinding($xml->getAttribute('Binding')); if (!$xml->hasAttribute('Location')) { - throw new \Exception('Missing Location on ' . $xml->tagName); + throw new \Exception('Missing Location on '.$xml->tagName); } - $this->Location = $xml->getAttribute('Location'); + $this->setLocation($xml->getAttribute('Location')); if ($xml->hasAttribute('ResponseLocation')) { - $this->ResponseLocation = $xml->getAttribute('ResponseLocation'); + $this->setResponseLocation($xml->getAttribute('ResponseLocation')); } foreach ($xml->attributes as $a) { if ($a->namespaceURI === null) { continue; /* Not namespace-qualified -- skip. */ } - $fullName = '{' . $a->namespaceURI . '}' . $a->localName; - $this->attributes[$fullName] = array( + $fullName = '{'.$a->namespaceURI.'}'.$a->localName; + $this->attributes[$fullName] = [ 'qualifiedName' => $a->nodeName, 'namespaceURI' => $a->namespaceURI, 'value' => $a->value, - ); + ]; } } + /** * Check if a namespace-qualified attribute exists. * @@ -87,14 +90,15 @@ public function __construct(\DOMElement $xml = null) */ public function hasAttributeNS($namespaceURI, $localName) { - assert(is_string($namespaceURI)); - assert(is_string($localName)); + Assert::string($namespaceURI); + Assert::string($localName); - $fullName = '{' . $namespaceURI . '}' . $localName; + $fullName = '{'.$namespaceURI.'}'.$localName; return isset($this->attributes[$fullName]); } + /** * Get a namespace-qualified attribute. * @@ -104,10 +108,10 @@ public function hasAttributeNS($namespaceURI, $localName) */ public function getAttributeNS($namespaceURI, $localName) { - assert(is_string($namespaceURI)); - assert(is_string($localName)); + Assert::string($namespaceURI); + Assert::string($localName); - $fullName = '{' . $namespaceURI . '}' . $localName; + $fullName = '{'.$namespaceURI.'}'.$localName; if (!isset($this->attributes[$fullName])) { return ''; } @@ -115,6 +119,7 @@ public function getAttributeNS($namespaceURI, $localName) return $this->attributes[$fullName]['value']; } + /** * Get a namespace-qualified attribute. * @@ -122,11 +127,12 @@ public function getAttributeNS($namespaceURI, $localName) * @param string $qualifiedName The local name. * @param string $value The attribute value. * @throws \Exception + * @return void */ public function setAttributeNS($namespaceURI, $qualifiedName, $value) { - assert(is_string($namespaceURI)); - assert(is_string($qualifiedName)); + Assert::string($namespaceURI); + Assert::string($qualifiedName); $name = explode(':', $qualifiedName, 2); if (count($name) < 2) { @@ -134,29 +140,98 @@ public function setAttributeNS($namespaceURI, $qualifiedName, $value) } $localName = $name[1]; - $fullName = '{' . $namespaceURI . '}' . $localName; - $this->attributes[$fullName] = array( + $fullName = '{'.$namespaceURI.'}'.$localName; + $this->attributes[$fullName] = [ 'qualifiedName' => $qualifiedName, 'namespaceURI' => $namespaceURI, 'value' => $value, - ); + ]; } + /** * Remove a namespace-qualified attribute. * * @param string $namespaceURI The namespace URI. * @param string $localName The local name. + * @return void */ public function removeAttributeNS($namespaceURI, $localName) { - assert(is_string($namespaceURI)); - assert(is_string($localName)); + Assert::string($namespaceURI); + assert::string($localName); - $fullName = '{' . $namespaceURI . '}' . $localName; + $fullName = '{'.$namespaceURI.'}'.$localName; unset($this->attributes[$fullName]); } + + /** + * Collect the value of the Binding-property + * @return string + */ + public function getBinding() + { + return $this->Binding; + } + + + /** + * Set the value of the Binding-property + * @param string $binding + * @return void + */ + public function setBinding($binding) + { + Assert::string($binding); + $this->Binding = $binding; + } + + + /** + * Collect the value of the Location-property + * @return string|null + */ + public function getLocation() + { + return $this->Location; + } + + + /** + * Set the value of the Location-property + * @param string|null $location + * @return void + */ + public function setLocation($location) + { + Assert::nullOrString($location); + $this->Location = $location; + } + + + /** + * Collect the value of the ResponseLocation-property + * @return string|null + */ + public function getResponseLocation() + { + return $this->ResponseLocation; + } + + + /** + * Set the value of the ResponseLocation-property + * @param string|null $responseLocation + * @return void + */ + public function setResponseLocation($responseLocation) + { + Assert::nullOrString($responseLocation); + $this->ResponseLocation = $responseLocation; + } + + /** * Add this endpoint to an XML element. * @@ -166,19 +241,19 @@ public function removeAttributeNS($namespaceURI, $localName) */ public function toXML(\DOMElement $parent, $name) { - assert(is_string($name)); - assert(is_string($this->Binding)); - assert(is_string($this->Location)); - assert(is_null($this->ResponseLocation) || is_string($this->ResponseLocation)); + Assert::string($name); + Assert::string($this->getBinding()); + Assert::string($this->getLocation()); + Assert::nullOrString($this->getResponseLocation()); $e = $parent->ownerDocument->createElementNS(Constants::NS_MD, $name); $parent->appendChild($e); - $e->setAttribute('Binding', $this->Binding); - $e->setAttribute('Location', $this->Location); + $e->setAttribute('Binding', $this->getBinding()); + $e->setAttribute('Location', $this->getLocation()); - if (isset($this->ResponseLocation)) { - $e->setAttribute('ResponseLocation', $this->ResponseLocation); + if ($this->getResponseLocation() !== null) { + $e->setAttribute('ResponseLocation', $this->getResponseLocation()); } foreach ($this->attributes as $a) { diff --git a/vendor/simplesamlphp/saml2/src/SAML2/XML/md/EntitiesDescriptor.php b/vendor/simplesamlphp/saml2/src/SAML2/XML/md/EntitiesDescriptor.php index 21b7b5ef36..139b11c280 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/XML/md/EntitiesDescriptor.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/XML/md/EntitiesDescriptor.php @@ -6,6 +6,8 @@ use SAML2\DOMDocumentFactory; use SAML2\SignedElementHelper; use SAML2\Utils; +use SAML2\XML\Chunk; +use Webmozart\Assert\Assert; /** * Class representing SAML 2 EntitiesDescriptor element. @@ -49,14 +51,15 @@ class EntitiesDescriptor extends SignedElementHelper * * @var array */ - public $Extensions = array(); + public $Extensions = []; /** * Child EntityDescriptor and EntitiesDescriptor elements. * * @var (\SAML2\XML\md\EntityDescriptor|\SAML2\XML\md\EntitiesDescriptor)[] */ - public $children = array(); + public $children = []; + /** * Initialize an EntitiesDescriptor. @@ -72,19 +75,19 @@ public function __construct(\DOMElement $xml = null) } if ($xml->hasAttribute('ID')) { - $this->ID = $xml->getAttribute('ID'); + $this->setID($xml->getAttribute('ID')); } if ($xml->hasAttribute('validUntil')) { - $this->validUntil = Utils::xsDateTimeToTimestamp($xml->getAttribute('validUntil')); + $this->setValidUntil(Utils::xsDateTimeToTimestamp($xml->getAttribute('validUntil'))); } if ($xml->hasAttribute('cacheDuration')) { - $this->cacheDuration = $xml->getAttribute('cacheDuration'); + $this->setCacheDuration($xml->getAttribute('cacheDuration')); } if ($xml->hasAttribute('Name')) { - $this->Name = $xml->getAttribute('Name'); + $this->setName($xml->getAttribute('Name')); } - $this->Extensions = Extensions::getList($xml); + $this->setExtensions(Extensions::getList($xml)); foreach (Utils::xpQuery($xml, './saml_metadata:EntityDescriptor|./saml_metadata:EntitiesDescriptor') as $node) { if ($node->localName === 'EntityDescriptor') { @@ -95,6 +98,161 @@ public function __construct(\DOMElement $xml = null) } } + + /** + * Collect the value of the Name-property + * @return string|null + */ + public function getName() + { + return $this->Name; + } + + + /** + * Set the value of the Name-property + * @param string|null $name + * @return void + */ + public function setName($name = null) + { + Assert::nullOrString($name); + $this->Name = $name; + } + + + /** + * Collect the value of the ID-property + * @return string|null + */ + public function getID() + { + return $this->ID; + } + + + /** + * Set the value of the ID-property + * @param string|null $Id + * @return void + */ + public function setID($Id = null) + { + Assert::nullOrString($Id); + $this->ID = $Id; + } + + + /** + * Collect the value of the validUntil-property + * @return int|null + */ + public function getValidUntil() + { + return $this->validUntil; + } + + + /** + * Set the value of the validUntil-property + * @param int|null $validUntil + * @return void + */ + public function setValidUntil($validUntil = null) + { + Assert::nullOrInteger($validUntil); + $this->validUntil = $validUntil; + } + + + /** + * Collect the value of the cacheDuration-property + * @return string|null + */ + public function getCacheDuration() + { + return $this->cacheDuration; + } + + + /** + * Set the value of the cacheDuration-property + * @param string|null $cacheDuration + * @return void + */ + public function setCacheDuration($cacheDuration = null) + { + Assert::nullOrString($cacheDuration); + $this->cacheDuration = $cacheDuration; + } + + + /** + * Collect the value of the Extensions-property + * @return \SAML2\XML\Chunk[] + */ + public function getExtensions() + { + return $this->Extensions; + } + + + /** + * Set the value of the Extensions-property + * @param array $extensions + * @return void + */ + public function setExtensions(array $extensions) + { + $this->Extensions = $extensions; + } + + + /** + * Add an Extension. + * + * @param \SAML2\XML\Chunk $extensions The Extensions + * @return void + */ + public function addExtension(Extensions $extension) + { + $this->Extensions[] = $extension; + } + + + /** + * Collect the value of the children-property + * @return (\SAML2\XML\md\EntityDescriptor|\SAML2\XML\md\EntitiesDescriptor)[] + */ + public function getChildren() + { + return $this->children; + } + + + /** + * Set the value of the childen-property + * @param array $children + * @return void + */ + public function setChildren(array $children) + { + $this->children = $children; + } + + + /** + * Add the value to the children-property + * @param \SAML2\XML\md\EntityDescriptor|\SAML2\XML\md\EntitiesDescriptor $child + * @return void + */ + public function addChildren($child) + { + Assert::isInstanceOfAny($child, [EntityDescriptor::class, EntitiesDescriptor::class]); + $this->children[] = $child; + } + + /** * Convert this EntitiesDescriptor to XML. * @@ -103,12 +261,12 @@ public function __construct(\DOMElement $xml = null) */ public function toXML(\DOMElement $parent = null) { - assert(is_null($this->ID) || is_string($this->ID)); - assert(is_null($this->validUntil) || is_int($this->validUntil)); - assert(is_null($this->cacheDuration) || is_string($this->cacheDuration)); - assert(is_null($this->Name) || is_string($this->Name)); - assert(is_array($this->Extensions)); - assert(is_array($this->children)); + Assert::nullOrString($this->getID()); + Assert::nullOrInteger($this->getValidUntil()); + Assert::nullOrString($this->getCacheDuration()); + Assert::nullOrString($this->getName()); + Assert::isArray($this->getExtensions()); + Assert::isArray($this->getChildren()); if ($parent === null) { $doc = DOMDocumentFactory::create(); @@ -119,26 +277,26 @@ public function toXML(\DOMElement $parent = null) $parent->appendChild($e); } - if (isset($this->ID)) { - $e->setAttribute('ID', $this->ID); + if ($this->getID() !== null) { + $e->setAttribute('ID', $this->getID()); } - if (isset($this->validUntil)) { - $e->setAttribute('validUntil', gmdate('Y-m-d\TH:i:s\Z', $this->validUntil)); + if ($this->getValidUntil() !== null) { + $e->setAttribute('validUntil', gmdate('Y-m-d\TH:i:s\Z', $this->getValidUntil())); } - if (isset($this->cacheDuration)) { - $e->setAttribute('cacheDuration', $this->cacheDuration); + if ($this->getCacheDuration() !== null) { + $e->setAttribute('cacheDuration', $this->getCacheDuration()); } - if (isset($this->Name)) { - $e->setAttribute('Name', $this->Name); + if ($this->getName() !== null) { + $e->setAttribute('Name', $this->getName()); } - Extensions::addList($e, $this->Extensions); + Extensions::addList($e, $this->getExtensions()); /** @var \SAML2\XML\md\EntityDescriptor|\SAML2\XML\md\EntitiesDescriptor $node */ - foreach ($this->children as $node) { + foreach ($this->getChildren() as $node) { $node->toXML($e); } diff --git a/vendor/simplesamlphp/saml2/src/SAML2/XML/md/EntityDescriptor.php b/vendor/simplesamlphp/saml2/src/SAML2/XML/md/EntityDescriptor.php index 7669109956..094dc21593 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/XML/md/EntityDescriptor.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/XML/md/EntityDescriptor.php @@ -6,6 +6,10 @@ use SAML2\DOMDocumentFactory; use SAML2\SignedElementHelper; use SAML2\Utils; +use SAML2\XML\Chunk; +use SAML2\XML\md\AffiliationDescriptor; +use SAML2\XML\md\Organization; +use Webmozart\Assert\Assert; /** * Class representing SAML 2 EntityDescriptor element. @@ -49,7 +53,7 @@ class EntityDescriptor extends SignedElementHelper * * @var array */ - public $Extensions = array(); + public $Extensions = []; /** * Array with all roles for this entity. @@ -58,7 +62,7 @@ class EntityDescriptor extends SignedElementHelper * * @var (\SAML2\XML\md\UnknownRoleDescriptor|\SAML2\XML\md\IDPSSODescriptor|\SAML2\XML\md\SPSSODescriptor|\SAML2\XML\md\AuthnAuthorityDescriptor|\SAML2\XML\md\AttributeAuthorityDescriptor|\SAML2\XML\md\PDPDescriptor)[] */ - public $RoleDescriptor = array(); + public $RoleDescriptor = []; /** * AffiliationDescriptor of this entity. @@ -79,14 +83,15 @@ class EntityDescriptor extends SignedElementHelper * * @var \SAML2\XML\md\ContactPerson[] */ - public $ContactPerson = array(); + public $ContactPerson = []; /** * AdditionalMetadataLocation elements for this entity. * * @var \SAML2\XML\md\AdditionalMetadataLocation[] */ - public $AdditionalMetadataLocation = array(); + public $AdditionalMetadataLocation = []; + /** * Initialize an EntitiyDescriptor. @@ -105,19 +110,19 @@ public function __construct(\DOMElement $xml = null) if (!$xml->hasAttribute('entityID')) { throw new \Exception('Missing required attribute entityID on EntityDescriptor.'); } - $this->entityID = $xml->getAttribute('entityID'); + $this->setEntityID($xml->getAttribute('entityID')); if ($xml->hasAttribute('ID')) { - $this->ID = $xml->getAttribute('ID'); + $this->setID($xml->getAttribute('ID')); } if ($xml->hasAttribute('validUntil')) { - $this->validUntil = Utils::xsDateTimeToTimestamp($xml->getAttribute('validUntil')); + $this->setValidUntil(Utils::xsDateTimeToTimestamp($xml->getAttribute('validUntil'))); } if ($xml->hasAttribute('cacheDuration')) { - $this->cacheDuration = $xml->getAttribute('cacheDuration'); + $this->setCacheDuration($xml->getAttribute('cacheDuration')); } - $this->Extensions = Extensions::getList($xml); + $this->setExtensions(Extensions::getList($xml)); for ($node = $xml->firstChild; $node !== null; $node = $node->nextSibling) { if (!($node instanceof \DOMElement)) { @@ -130,22 +135,22 @@ public function __construct(\DOMElement $xml = null) switch ($node->localName) { case 'RoleDescriptor': - $this->RoleDescriptor[] = new UnknownRoleDescriptor($node); + $this->addRoleDescriptor(new UnknownRoleDescriptor($node)); break; case 'IDPSSODescriptor': - $this->RoleDescriptor[] = new IDPSSODescriptor($node); + $this->addRoleDescriptor(new IDPSSODescriptor($node)); break; case 'SPSSODescriptor': - $this->RoleDescriptor[] = new SPSSODescriptor($node); + $this->addRoleDescriptor(new SPSSODescriptor($node)); break; case 'AuthnAuthorityDescriptor': - $this->RoleDescriptor[] = new AuthnAuthorityDescriptor($node); + $this->addRoleDescriptor(new AuthnAuthorityDescriptor($node)); break; case 'AttributeAuthorityDescriptor': - $this->RoleDescriptor[] = new AttributeAuthorityDescriptor($node); + $this->addRoleDescriptor(new AttributeAuthorityDescriptor($node)); break; case 'PDPDescriptor': - $this->RoleDescriptor[] = new PDPDescriptor($node); + $this->addRoleDescriptor(new PDPDescriptor($node)); break; } } @@ -154,12 +159,13 @@ public function __construct(\DOMElement $xml = null) if (count($affiliationDescriptor) > 1) { throw new \Exception('More than one AffiliationDescriptor in the entity.'); } elseif (!empty($affiliationDescriptor)) { - $this->AffiliationDescriptor = new AffiliationDescriptor($affiliationDescriptor[0]); + $this->setAffiliationDescriptor(new AffiliationDescriptor($affiliationDescriptor[0])); } - if (empty($this->RoleDescriptor) && is_null($this->AffiliationDescriptor)) { + $roleDescriptor = $this->getRoleDescriptor(); + if (empty($roleDescriptor) && is_null($this->getAffiliationDescriptor())) { throw new \Exception('Must have either one of the RoleDescriptors or an AffiliationDescriptor in EntityDescriptor.'); - } elseif (!empty($this->RoleDescriptor) && !is_null($this->AffiliationDescriptor)) { + } elseif (!empty($roleDescriptor) && !is_null($this->getAffiliationDescriptor())) { throw new \Exception('AffiliationDescriptor cannot be combined with other RoleDescriptor elements in EntityDescriptor.'); } @@ -167,18 +173,278 @@ public function __construct(\DOMElement $xml = null) if (count($organization) > 1) { throw new \Exception('More than one Organization in the entity.'); } elseif (!empty($organization)) { - $this->Organization = new Organization($organization[0]); + $this->setOrganization(new Organization($organization[0])); } foreach (Utils::xpQuery($xml, './saml_metadata:ContactPerson') as $cp) { - $this->ContactPerson[] = new ContactPerson($cp); + $this->addContactPerson(new ContactPerson($cp)); } foreach (Utils::xpQuery($xml, './saml_metadata:AdditionalMetadataLocation') as $aml) { - $this->AdditionalMetadataLocation[] = new AdditionalMetadataLocation($aml); + $this->addAdditionalMetadataLocation(new AdditionalMetadataLocation($aml)); } } + + /** + * Collect the value of the entityID-property + * @return string + */ + public function getEntityID() + { + return $this->entityID; + } + + + /** + * Set the value of the entityID-property + * @param string|null $entityId + * @return void + */ + public function setEntityID($entityId) + { + Assert::nullOrString($entityId); + $this->entityID = $entityId; + } + + + /** + * Collect the value of the ID-property + * @return string|null + */ + public function getID() + { + return $this->ID; + } + + + /** + * Set the value of the ID-property + * @param string|null $Id + * @return void + */ + public function setID($Id = null) + { + Assert::nullOrString($Id); + $this->ID = $Id; + } + + + /** + * Collect the value of the validUntil-property + * @return int|null + */ + public function getValidUntil() + { + return $this->validUntil; + } + + + /** + * Set the value of the validUntil-property + * @param int|null $validUntil + * @return void + */ + public function setValidUntil($validUntil = null) + { + Assert::nullOrInteger($validUntil); + $this->validUntil = $validUntil; + } + + + /** + * Collect the value of the cacheDuration-property + * @return string|null + */ + public function getCacheDuration() + { + return $this->cacheDuration; + } + + + /** + * Set the value of the cacheDuration-property + * @param string|null $cacheDuration + * @return void + */ + public function setCacheDuration($cacheDuration = null) + { + Assert::nullOrString($cacheDuration); + $this->cacheDuration = $cacheDuration; + } + + + /** + * Collect the value of the Extensions-property + * @return \SAML2\XML\Chunk[] + */ + public function getExtensions() + { + return $this->Extensions; + } + + + /** + * Set the value of the Extensions-property + * @param array $extensions + * @return void + */ + public function setExtensions(array $extensions) + { + $this->Extensions = $extensions; + } + + + /** + * Add an Extension. + * + * @param \SAML2\XML\Chunk $extensions The Extensions + * @return void + */ + public function addExtension(Extensions $extension) + { + $this->Extensions[] = $extension; + } + + + /** + * Collect the value of the RoleDescriptor-property + * @return \SAML2\XML\md\RoleDescriptor[] + */ + public function getRoleDescriptor() + { + return $this->RoleDescriptor; + } + + + /** + * Set the value of the RoleDescriptor-property + * @param array $roleDescriptor + * @return void + */ + public function setRoleDescriptor(array $roleDescriptor) + { + $this->RoleDescriptor = $roleDescriptor; + } + + + /** + * Add the value to the RoleDescriptor-property + * @param \SAML2\XML\md\RoleDescriptor $roleDescriptor + * @return void + */ + public function addRoleDescriptor(RoleDescriptor $roleDescriptor) + { + $this->RoleDescriptor[] = $roleDescriptor; + } + + + /** + * Collect the value of the AffiliationDescriptor-property + * @return \SAML2\XML\md\AffiliationDescriptor|null + */ + public function getAffiliationDescriptor() + { + return $this->AffiliationDescriptor; + } + + + /** + * Set the value of the AffliationDescriptor-property + * @param \SAML2\XML\md\AffiliationDescriptor|null $affiliationDescriptor + * @return void + */ + public function setAffiliationDescriptor(AffiliationDescriptor $affiliationDescriptor = null) + { + $this->AffiliationDescriptor = $affiliationDescriptor; + } + + + /** + * Collect the value of the Organization-property + * @return \SAML2\XML\md\Organization|null + */ + public function getOrganization() + { + return $this->Organization; + } + + + /** + * Set the value of the Organization-property + * @param \SAML2\XML\md\Organization|null $organization + * @return void + */ + public function setOrganization(Organization $organization = null) + { + $this->Organization = $organization; + } + + + /** + * Collect the value of the ContactPerson-property + * @return \SAML2\XML\md\ContactPerson[] + */ + public function getContactPerson() + { + return $this->ContactPerson; + } + + + /** + * Set the value of the ContactPerson-property + * @param array $contactPerson + * @return void + */ + public function setContactPerson(array $contactPerson) + { + $this->ContactPerson = $contactPerson; + } + + + /** + * Add the value to the ContactPerson-property + * @param \SAML2\XML\md\ContactPerson $contactPerson + * @return void + */ + public function addContactPerson(ContactPerson $contactPerson) + { + $this->ContactPerson[] = $contactPerson; + } + + + /** + * Collect the value of the AdditionalMetadataLocation-property + * @return \SAML2\XML\md\AdditionalMetadataLocation[] + */ + public function getAdditionalMetadataLocation() + { + return $this->AdditionalMetadataLocation; + } + + + /** + * Set the value of the AdditionalMetadataLocation-property + * @param array $additionalMetadataLocation + * @return void + */ + public function setAdditionalMetadataLocation(array $additionalMetadataLocation) + { + $this->AdditionalMetadataLocation = $additionalMetadataLocation; + } + + + /** + * Add the value to the AdditionalMetadataLocation-property + * @param AdditionalMetadataLocation $additionalMetadataLocation + * @return void + */ + public function addAdditionalMetadataLocation(AdditionalMetadataLocation $additionalMetadataLocation) + { + $this->AdditionalMetadataLocation[] = $additionalMetadataLocation; + } + + /** * Create this EntityDescriptor. * @@ -187,16 +453,16 @@ public function __construct(\DOMElement $xml = null) */ public function toXML(\DOMElement $parent = null) { - assert(is_string($this->entityID)); - assert(is_null($this->ID) || is_string($this->ID)); - assert(is_null($this->validUntil) || is_int($this->validUntil)); - assert(is_null($this->cacheDuration) || is_string($this->cacheDuration)); - assert(is_array($this->Extensions)); - assert(is_array($this->RoleDescriptor)); - assert(is_null($this->AffiliationDescriptor) || $this->AffiliationDescriptor instanceof AffiliationDescriptor); - assert(is_null($this->Organization) || $this->Organization instanceof Organization); - assert(is_array($this->ContactPerson)); - assert(is_array($this->AdditionalMetadataLocation)); + Assert::string($this->getEntityID()); + Assert::nullOrString($this->getID()); + Assert::nullOrInteger($this->getValidUntil()); + Assert::nullOrString($this->getCacheDuration()); + Assert::isArray($this->getExtensions()); + Assert::isArray($this->getRoleDescriptor()); + Assert::nullOrIsInstanceOf($this->getAffiliationDescriptor(), AffiliationDescriptor::class); + Assert::nullOrIsInstanceOf($this->getOrganization(), Organization::class); + Assert::isArray($this->getContactPerson()); + Assert::isArray($this->getAdditionalMetadataLocation()); if ($parent === null) { $doc = DOMDocumentFactory::create(); @@ -207,40 +473,40 @@ public function toXML(\DOMElement $parent = null) $parent->appendChild($e); } - $e->setAttribute('entityID', $this->entityID); + $e->setAttribute('entityID', $this->getEntityID()); - if (isset($this->ID)) { - $e->setAttribute('ID', $this->ID); + if ($this->getID() !== null) { + $e->setAttribute('ID', $this->getID()); } - if (isset($this->validUntil)) { - $e->setAttribute('validUntil', gmdate('Y-m-d\TH:i:s\Z', $this->validUntil)); + if ($this->getValidUntil() !== null) { + $e->setAttribute('validUntil', gmdate('Y-m-d\TH:i:s\Z', $this->getValidUntil())); } - if (isset($this->cacheDuration)) { - $e->setAttribute('cacheDuration', $this->cacheDuration); + if ($this->getCacheDuration() !== null) { + $e->setAttribute('cacheDuration', $this->getCacheDuration()); } - Extensions::addList($e, $this->Extensions); + Extensions::addList($e, $this->getExtensions()); /** @var \SAML2\XML\md\UnknownRoleDescriptor|\SAML2\XML\md\IDPSSODescriptor|\SAML2\XML\md\SPSSODescriptor|\SAML2\XML\md\AuthnAuthorityDescriptor|\SAML2\XML\md\AttributeAuthorityDescriptor|\SAML2\XML\md\PDPDescriptor $n */ - foreach ($this->RoleDescriptor as $n) { + foreach ($this->getRoleDescriptor() as $n) { $n->toXML($e); } - if (isset($this->AffiliationDescriptor)) { - $this->AffiliationDescriptor->toXML($e); + if ($this->getAffiliationDescriptor() !== null) { + $this->getAffiliationDescriptor()->toXML($e); } - if (isset($this->Organization)) { - $this->Organization->toXML($e); + if ($this->getOrganization() !== null) { + $this->getOrganization()->toXML($e); } - foreach ($this->ContactPerson as $cp) { + foreach ($this->getContactPerson() as $cp) { $cp->toXML($e); } - foreach ($this->AdditionalMetadataLocation as $n) { + foreach ($this->getAdditionalMetadataLocation() as $n) { $n->toXML($e); } diff --git a/vendor/simplesamlphp/saml2/src/SAML2/XML/md/Extensions.php b/vendor/simplesamlphp/saml2/src/SAML2/XML/md/Extensions.php index 7d99096f31..2faab4828b 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/XML/md/Extensions.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/XML/md/Extensions.php @@ -26,27 +26,27 @@ class Extensions */ public static function getList(\DOMElement $parent) { - $ret = array(); - $supported = array( - Scope::NS => array( + $ret = []; + $supported = [ + Scope::NS => [ 'Scope' => '\SAML2\XML\shibmd\Scope', - ), - EntityAttributes::NS => array( + ], + EntityAttributes::NS => [ 'EntityAttributes' => '\SAML2\XML\mdattr\EntityAttributes', - ), - MDRPI::NS_MDRPI => array( + ], + MDRPI::NS_MDRPI => [ 'RegistrationInfo' => '\SAML2\XML\mdrpi\RegistrationInfo', 'PublicationInfo' => '\SAML2\XML\mdrpi\PublicationInfo', - ), - MDUI::NS => array( + ], + MDUI::NS => [ 'UIInfo' => '\SAML2\XML\mdui\UIInfo', 'DiscoHints' => '\SAML2\XML\mdui\DiscoHints', - ), - ALG::NS => array( + ], + ALG::NS => [ 'DigestMethod' => '\SAML2\XML\alg\DigestMethod', 'SigningMethod' => '\SAML2\XML\alg\SigningMethod', - ), - ); + ], + ]; foreach (Utils::xpQuery($parent, './saml_metadata:Extensions/*') as $node) { if (array_key_exists($node->namespaceURI, $supported) && @@ -61,11 +61,13 @@ public static function getList(\DOMElement $parent) return $ret; } + /** * Add a list of Extensions to the given element. * * @param \DOMElement $parent The element we should add the extensions to. * @param \SAML2\XML\Chunk[] $extensions List of extension objects. + * @return void */ public static function addList(\DOMElement $parent, array $extensions) { diff --git a/vendor/simplesamlphp/saml2/src/SAML2/XML/md/IDPSSODescriptor.php b/vendor/simplesamlphp/saml2/src/SAML2/XML/md/IDPSSODescriptor.php index 4ee186881e..12bcfcafcf 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/XML/md/IDPSSODescriptor.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/XML/md/IDPSSODescriptor.php @@ -5,6 +5,7 @@ use SAML2\Constants; use SAML2\Utils; use SAML2\XML\saml\Attribute; +use Webmozart\Assert\Assert; /** * Class representing SAML 2 IDPSSODescriptor. @@ -27,7 +28,7 @@ class IDPSSODescriptor extends SSODescriptorType * * @var \SAML2\XML\md\EndpointType[] */ - public $SingleSignOnService = array(); + public $SingleSignOnService = []; /** * List of NameIDMappingService endpoints. @@ -36,7 +37,7 @@ class IDPSSODescriptor extends SSODescriptorType * * @var \SAML2\XML\md\EndpointType[] */ - public $NameIDMappingService = array(); + public $NameIDMappingService = []; /** * List of AssertionIDRequestService endpoints. @@ -45,7 +46,7 @@ class IDPSSODescriptor extends SSODescriptorType * * @var \SAML2\XML\md\EndpointType[] */ - public $AssertionIDRequestService = array(); + public $AssertionIDRequestService = []; /** * List of supported attribute profiles. @@ -54,7 +55,7 @@ class IDPSSODescriptor extends SSODescriptorType * * @var array */ - public $AttributeProfile = array(); + public $AttributeProfile = []; /** * List of supported attributes. @@ -63,7 +64,8 @@ class IDPSSODescriptor extends SSODescriptorType * * @var \SAML2\XML\saml\Attribute[] */ - public $Attribute = array(); + public $Attribute = []; + /** * Initialize an IDPSSODescriptor. @@ -78,27 +80,199 @@ public function __construct(\DOMElement $xml = null) return; } - $this->WantAuthnRequestsSigned = Utils::parseBoolean($xml, 'WantAuthnRequestsSigned', null); + $this->setWantAuthnRequestsSigned(Utils::parseBoolean($xml, 'WantAuthnRequestsSigned', null)); foreach (Utils::xpQuery($xml, './saml_metadata:SingleSignOnService') as $ep) { - $this->SingleSignOnService[] = new EndpointType($ep); + $this->addSingleSignOnService(new EndpointType($ep)); } foreach (Utils::xpQuery($xml, './saml_metadata:NameIDMappingService') as $ep) { - $this->NameIDMappingService[] = new EndpointType($ep); + $this->addNameIDMappingService(new EndpointType($ep)); } foreach (Utils::xpQuery($xml, './saml_metadata:AssertionIDRequestService') as $ep) { - $this->AssertionIDRequestService[] = new EndpointType($ep); + $this->addAssertionIDRequestService(new EndpointType($ep)); } - $this->AttributeProfile = Utils::extractStrings($xml, Constants::NS_MD, 'AttributeProfile'); + $this->setAttributeProfile(Utils::extractStrings($xml, Constants::NS_MD, 'AttributeProfile')); foreach (Utils::xpQuery($xml, './saml_assertion:Attribute') as $a) { - $this->Attribute[] = new Attribute($a); + $this->addAttribute(new Attribute($a)); } } + + /** + * Collect the value of the WantAuthnRequestsSigned-property + * @return bool|null + */ + public function wantAuthnRequestsSigned() + { + return $this->WantAuthnRequestsSigned; + } + + + /** + * Set the value of the WantAuthnRequestsSigned-property + * @param bool|null $flag + * @return void + */ + public function setWantAuthnRequestsSigned($flag = null) + { + Assert::nullOrBoolean($flag); + $this->WantAuthnRequestsSigned = $flag; + } + + + /** + * Collect the value of the SingleSignOnService-property + * @return \SAML2\XML\md\EndpointType[] + */ + public function getSingleSignOnService() + { + return $this->SingleSignOnService; + } + + + /** + * Set the value of the SingleSignOnService-property + * @param array $singleSignOnService + * @return void + */ + public function setSingleSignOnService(array $singleSignOnService) + { + $this->SingleSignOnService = $singleSignOnService; + } + + + /** + * Add the value to the SingleSignOnService-property + * @param \SAML2\XML\md\EndpointType $singleSignOnService + * @return void + */ + public function addSingleSignOnService(EndpointType $singleSignOnService) + { + $this->SingleSignOnService[] = $singleSignOnService; + } + + + /** + * Collect the value of the NameIDMappingService-property + * @return \SAML2\XML\md\EndpointType[] + */ + public function getNameIDMappingService() + { + return $this->NameIDMappingService; + } + + + /** + * Set the value of the NameIDMappingService-property + * @param array $nameIDMappingService + * @return void + */ + public function setNameIDMappingService(array $nameIDMappingService) + { + $this->NameIDMappingService = $nameIDMappingService; + } + + + /** + * Add the value to the NameIDMappingService-property + * @param \SAML2\XML\md\EndpointType $nameIDMappingService + * @return void + */ + public function addNameIDMappingService(EndpointType $nameIDMappingService) + { + $this->NameIDMappingService[] = $nameIDMappingService; + } + + + /** + * Collect the value of the AssertionIDRequestService-property + * @return \SAML2\XML\md\EndpointType[] + */ + public function getAssertionIDRequestService() + { + return $this->AssertionIDRequestService; + } + + + /** + * Set the value of the AssertionIDRequestService-property + * @param array $assertionIDRequestService + * @return void + */ + public function setAssertionIDRequestService(array $assertionIDRequestService) + { + $this->AssertionIDRequestService = $assertionIDRequestService; + } + + + /** + * Add the value to the AssertionIDRequestService-property + * @param \SAML2\XML\md\EndpointType $assertionIDRequestService + * @return void + */ + public function addAssertionIDRequestService(EndpointType $assertionIDRequestService) + { + $this->AssertionIDRequestService[] = $assertionIDRequestService; + } + + + /** + * Collect the value of the AttributeProfile-property + * @return array + */ + public function getAttributeProfile() + { + return $this->AttributeProfile; + } + + + /** + * Set the value of the AttributeProfile-property + * @param array $attributeProfile + * @return void + */ + public function setAttributeProfile(array $attributeProfile) + { + $this->AttributeProfile = $attributeProfile; + } + + + /** + * Collect the value of the Attribute-property + * @return \SAML2\XML\saml\Attribute[] + */ + public function getAttribute() + { + return $this->Attribute; + } + + + /** + * Set the value of the Attribute-property + * @param array $attribute + * @return void + */ + public function setAttribute(array $attribute) + { + $this->Attribute = $attribute; + } + + + /** + * Addthe value to the Attribute-property + * @param \SAML2\XML\saml\Attribute $attribute + * @return void + */ + public function addAttribute(Attribute $attribute) + { + $this->Attribute[] = $attribute; + } + + /** * Add this IDPSSODescriptor to an EntityDescriptor. * @@ -107,36 +281,36 @@ public function __construct(\DOMElement $xml = null) */ public function toXML(\DOMElement $parent) { - assert(is_null($this->WantAuthnRequestsSigned) || is_bool($this->WantAuthnRequestsSigned)); - assert(is_array($this->SingleSignOnService)); - assert(is_array($this->NameIDMappingService)); - assert(is_array($this->AssertionIDRequestService)); - assert(is_array($this->AttributeProfile)); - assert(is_array($this->Attribute)); + Assert::nullOrBoolean($this->WantAuthnRequestsSigned()); + Assert::isArray($this->getSingleSignOnService()); + Assert::isArray($this->getNameIDMappingService()); + Assert::isArray($this->getAssertionIDRequestService()); + Assert::isArray($this->getAttributeProfile()); + Assert::isArray($this->getAttribute()); $e = parent::toXML($parent); - if ($this->WantAuthnRequestsSigned === true) { + if ($this->WantAuthnRequestsSigned() === true) { $e->setAttribute('WantAuthnRequestsSigned', 'true'); - } elseif ($this->WantAuthnRequestsSigned === false) { + } elseif ($this->WantAuthnRequestsSigned() === false) { $e->setAttribute('WantAuthnRequestsSigned', 'false'); } - foreach ($this->SingleSignOnService as $ep) { + foreach ($this->getSingleSignOnService() as $ep) { $ep->toXML($e, 'md:SingleSignOnService'); } - foreach ($this->NameIDMappingService as $ep) { + foreach ($this->getNameIDMappingService() as $ep) { $ep->toXML($e, 'md:NameIDMappingService'); } - foreach ($this->AssertionIDRequestService as $ep) { + foreach ($this->getAssertionIDRequestService() as $ep) { $ep->toXML($e, 'md:AssertionIDRequestService'); } - Utils::addStrings($e, Constants::NS_MD, 'md:AttributeProfile', false, $this->AttributeProfile); + Utils::addStrings($e, Constants::NS_MD, 'md:AttributeProfile', false, $this->getAttributeProfile()); - foreach ($this->Attribute as $a) { + foreach ($this->getAttribute() as $a) { $a->toXML($e); } diff --git a/vendor/simplesamlphp/saml2/src/SAML2/XML/md/IndexedEndpointType.php b/vendor/simplesamlphp/saml2/src/SAML2/XML/md/IndexedEndpointType.php index 00a0e435af..e980783bbe 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/XML/md/IndexedEndpointType.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/XML/md/IndexedEndpointType.php @@ -3,6 +3,7 @@ namespace SAML2\XML\md; use SAML2\Utils; +use Webmozart\Assert\Assert; /** * Class representing SAML 2 IndexedEndpointType. @@ -25,6 +26,7 @@ class IndexedEndpointType extends EndpointType */ public $isDefault = null; + /** * Initialize an IndexedEndpointType. * @@ -40,13 +42,58 @@ public function __construct(\DOMElement $xml = null) } if (!$xml->hasAttribute('index')) { - throw new \Exception('Missing index on ' . $xml->tagName); + throw new \Exception('Missing index on '.$xml->tagName); } - $this->index = (int) $xml->getAttribute('index'); + $this->setIndex(intval($xml->getAttribute('index'))); + + $this->setIsDefault(Utils::parseBoolean($xml, 'isDefault', null)); + } + + + /** + * Collect the value of the index-property + * @return int + */ + public function getIndex() + { + return $this->index; + } + + + /** + * Set the value of the index-property + * @param int $index + * @return void + */ + public function setIndex($index) + { + Assert::integer($index); + $this->index = $index; + } - $this->isDefault = Utils::parseBoolean($xml, 'isDefault', null); + + /** + * Collect the value of the isDefault-property + * @return bool|null + */ + public function getIsDefault() + { + return $this->isDefault; } + + /** + * Set the value of the isDefault-property + * @param bool|null $flag + * @return void + */ + public function setIsDefault($flag = null) + { + Assert::nullOrBoolean($flag); + $this->isDefault = $flag; + } + + /** * Add this endpoint to an XML element. * @@ -56,16 +103,16 @@ public function __construct(\DOMElement $xml = null) */ public function toXML(\DOMElement $parent, $name) { - assert(is_string($name)); - assert(is_int($this->index)); - assert(is_null($this->isDefault) || is_bool($this->isDefault)); + Assert::string($name); + Assert::integer($this->getIndex()); + Assert::nullOrBoolean($this->getIsDefault()); $e = parent::toXML($parent, $name); - $e->setAttribute('index', (string) $this->index); + $e->setAttribute('index', (string) $this->getIndex()); - if ($this->isDefault === true) { + if ($this->getIsDefault() === true) { $e->setAttribute('isDefault', 'true'); - } elseif ($this->isDefault === false) { + } elseif ($this->getIsDefault() === false) { $e->setAttribute('isDefault', 'false'); } diff --git a/vendor/simplesamlphp/saml2/src/SAML2/XML/md/KeyDescriptor.php b/vendor/simplesamlphp/saml2/src/SAML2/XML/md/KeyDescriptor.php index ee853f7341..aa2b6bdbe4 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/XML/md/KeyDescriptor.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/XML/md/KeyDescriptor.php @@ -6,6 +6,7 @@ use SAML2\Utils; use SAML2\XML\Chunk; use SAML2\XML\ds\KeyInfo; +use Webmozart\Assert\Assert; /** * Class representing a KeyDescriptor element. @@ -37,7 +38,8 @@ class KeyDescriptor * * @var \SAML2\XML\Chunk[] */ - public $EncryptionMethod = array(); + public $EncryptionMethod = []; + /** * Initialize an KeyDescriptor. @@ -52,7 +54,7 @@ public function __construct(\DOMElement $xml = null) } if ($xml->hasAttribute('use')) { - $this->use = $xml->getAttribute('use'); + $this->setUse($xml->getAttribute('use')); } $keyInfo = Utils::xpQuery($xml, './ds:KeyInfo'); @@ -61,13 +63,89 @@ public function __construct(\DOMElement $xml = null) } elseif (empty($keyInfo)) { throw new \Exception('No ds:KeyInfo in the KeyDescriptor.'); } - $this->KeyInfo = new KeyInfo($keyInfo[0]); + $this->setKeyInfo(new KeyInfo($keyInfo[0])); foreach (Utils::xpQuery($xml, './saml_metadata:EncryptionMethod') as $em) { - $this->EncryptionMethod[] = new Chunk($em); + $this->addEncryptionMethod(new Chunk($em)); } } + + /** + * Collect the value of the use-property + * @return string + */ + public function getUse() + { + return $this->use; + } + + + /** + * Set the value of the use-property + * @param string|null $use + * @return void + */ + public function setUse($use) + { + Assert::nullOrString($use); + $this->use = $use; + } + + + /** + * Collect the value of the KeyInfo-property + * @return \SAML2\XML\ds\KeyInfo + */ + public function getKeyInfo() + { + return $this->KeyInfo; + } + + + /** + * Set the value of the KeyInfo-property + * @param \SAML2\XML\ds\KeyInfo $keyInfo + * @return void + */ + public function setKeyInfo(KeyInfo $keyInfo) + { + $this->KeyInfo = $keyInfo; + } + + + /** + * Collect the value of the EncryptionMethod-property + * @return \SAML2\XML\Chunk[] + */ + public function getEncryptionMethod() + { + return $this->EncryptionMethod; + } + + + /** + * Set the value of the EncryptionMethod-property + * @param \SAML2\XML\Chunk[] $encryptionMethod + * @return void + */ + public function setEncryptionMethod(array $encryptionMethod) + { + $this->EncryptionMethod = $encryptionMethod; + } + + + /** + * Add the value to the EncryptionMethod-property + * @param \SAML2\XML\Chunk $encryptionMethod + * @return void + */ + public function addEncryptionMethod(Chunk $encryptionMethod) + { + $this->EncryptionMethod[] = $encryptionMethod; + } + + /** * Convert this KeyDescriptor to XML. * @@ -76,22 +154,22 @@ public function __construct(\DOMElement $xml = null) */ public function toXML(\DOMElement $parent) { - assert(is_null($this->use) || is_string($this->use)); - assert($this->KeyInfo instanceof KeyInfo); - assert(is_array($this->EncryptionMethod)); + Assert::nullOrString($this->getUse()); + Assert::isInstanceOf($this->getKeyInfo(), KeyInfo::class); + Assert::isArray($this->getEncryptionMethod()); $doc = $parent->ownerDocument; $e = $doc->createElementNS(Constants::NS_MD, 'md:KeyDescriptor'); $parent->appendChild($e); - if (isset($this->use)) { - $e->setAttribute('use', $this->use); + if ($this->getUse() !== null) { + $e->setAttribute('use', $this->getUse()); } - $this->KeyInfo->toXML($e); + $this->getKeyInfo()->toXML($e); - foreach ($this->EncryptionMethod as $em) { + foreach ($this->getEncryptionMethod() as $em) { $em->toXML($e); } diff --git a/vendor/simplesamlphp/saml2/src/SAML2/XML/md/Organization.php b/vendor/simplesamlphp/saml2/src/SAML2/XML/md/Organization.php index 1d7b4af307..46427a9432 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/XML/md/Organization.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/XML/md/Organization.php @@ -4,6 +4,8 @@ use SAML2\Constants; use SAML2\Utils; +use SAML2\XML\Chunk; +use Webmozart\Assert\Assert; /** * Class representing SAML 2 Organization element. @@ -19,28 +21,29 @@ class Organization * * @var array */ - public $Extensions = array(); + public $Extensions = []; /** * The OrganizationName, as an array of language => translation. * * @var array */ - public $OrganizationName = array(); + public $OrganizationName = []; /** * The OrganizationDisplayName, as an array of language => translation. * * @var array */ - public $OrganizationDisplayName = array(); + public $OrganizationDisplayName = []; /** * The OrganizationURL, as an array of language => translation. * * @var array */ - public $OrganizationURL = array(); + public $OrganizationURL = []; + /** * Initialize an Organization element. @@ -53,24 +56,124 @@ public function __construct(\DOMElement $xml = null) return; } - $this->Extensions = Extensions::getList($xml); + $this->setExtensions(Extensions::getList($xml)); - $this->OrganizationName = Utils::extractLocalizedStrings($xml, Constants::NS_MD, 'OrganizationName'); - if (empty($this->OrganizationName)) { - $this->OrganizationName = array('invalid' => ''); + $this->setOrganizationName(Utils::extractLocalizedStrings($xml, Constants::NS_MD, 'OrganizationName')); + $organizationName = $this->getOrganizationName(); + if (empty($organizationName)) { + $this->setOrganizationName(['invalid' => '']); } - $this->OrganizationDisplayName = Utils::extractLocalizedStrings($xml, Constants::NS_MD, 'OrganizationDisplayName'); - if (empty($this->OrganizationDisplayName)) { - $this->OrganizationDisplayName = array('invalid' => ''); + $this->setOrganizationDisplayName(Utils::extractLocalizedStrings($xml, Constants::NS_MD, 'OrganizationDisplayName')); + $organizationDisplayName = $this->getOrganizationDisplayName(); + if (empty($organizationDisplayName)) { + $this->setOrganizationDisplayName(['invalid' => '']); } - $this->OrganizationURL = Utils::extractLocalizedStrings($xml, Constants::NS_MD, 'OrganizationURL'); - if (empty($this->OrganizationURL)) { - $this->OrganizationURL = array('invalid' => ''); + $this->setOrganizationURL(Utils::extractLocalizedStrings($xml, Constants::NS_MD, 'OrganizationURL')); + $organizationURL = $this->getOrganizationURL(); + if (empty($organizationURL)) { + $this->setOrganizationURL(['invalid' => '']); } } + + /** + * Collect the value of the Extensions-property + * @return \SAML2\XML\Chunk[] + */ + public function getExtensions() + { + return $this->Extensions; + } + + + /** + * Set the value of the Extensions-property + * @param array $extensions + * @return void + */ + public function setExtensions(array $extensions) + { + $this->Extensions = $extensions; + } + + + /** + * Add an Extension. + * + * @param \SAML2\XML\Chunk $extensions The Extensions + * @return void + */ + public function addExtension(Extensions $extension) + { + $this->Extensions[] = $extension; + } + + + /** + * Collect the value of the OrganizationName-property + * @return string[] + */ + public function getOrganizationName() + { + return $this->OrganizationName; + } + + + /** + * Set the value of the OrganizationName-property + * @param array $organizationName + * @return void + */ + public function setOrganizationName(array $organizationName) + { + $this->OrganizationName = $organizationName; + } + + + /** + * Collect the value of the OrganizationDisplayName-property + * @return string[] + */ + public function getOrganizationDisplayName() + { + return $this->OrganizationDisplayName; + } + + + /** + * Set the value of the OrganizationDisplayName-property + * @param array $organizationDisplayName + * @return void + */ + public function setOrganizationDisplayName(array $organizationDisplayName) + { + $this->OrganizationDisplayName = $organizationDisplayName; + } + + + /** + * Collect the value of the OrganizationURL-property + * @return string[] + */ + public function getOrganizationURL() + { + return $this->OrganizationURL; + } + + + /** + * Set the value of the OrganizationURL-property + * @param array $organizationURL + * @return void + */ + public function setOrganizationURL(array $organizationURL) + { + $this->OrganizationURL = $organizationURL; + } + + /** * Convert this Organization to XML. * @@ -79,24 +182,24 @@ public function __construct(\DOMElement $xml = null) */ public function toXML(\DOMElement $parent) { - assert(is_array($this->Extensions)); - assert(is_array($this->OrganizationName)); - assert(!empty($this->OrganizationName)); - assert(is_array($this->OrganizationDisplayName)); - assert(!empty($this->OrganizationDisplayName)); - assert(is_array($this->OrganizationURL)); - assert(!empty($this->OrganizationURL)); + Assert::isArray($this->getExtensions()); + Assert::isArray($organizationName = $this->getOrganizationName()); + Assert::notEmpty($organizationName); + Assert::isArray($organizationDisplayName = $this->getOrganizationDisplayName()); + Assert::notEmpty($organizationDisplayName); + Assert::isArray($organizationURL = $this->getOrganizationURL()); + Assert::notEmpty($organizationURL); $doc = $parent->ownerDocument; $e = $doc->createElementNS(Constants::NS_MD, 'md:Organization'); $parent->appendChild($e); - Extensions::addList($e, $this->Extensions); + Extensions::addList($e, $this->getExtensions()); - Utils::addStrings($e, Constants::NS_MD, 'md:OrganizationName', true, $this->OrganizationName); - Utils::addStrings($e, Constants::NS_MD, 'md:OrganizationDisplayName', true, $this->OrganizationDisplayName); - Utils::addStrings($e, Constants::NS_MD, 'md:OrganizationURL', true, $this->OrganizationURL); + Utils::addStrings($e, Constants::NS_MD, 'md:OrganizationName', true, $this->getOrganizationName()); + Utils::addStrings($e, Constants::NS_MD, 'md:OrganizationDisplayName', true, $this->getOrganizationDisplayName()); + Utils::addStrings($e, Constants::NS_MD, 'md:OrganizationURL', true, $this->getOrganizationURL()); return $e; } diff --git a/vendor/simplesamlphp/saml2/src/SAML2/XML/md/PDPDescriptor.php b/vendor/simplesamlphp/saml2/src/SAML2/XML/md/PDPDescriptor.php index 2dcf562d10..0eae33bb93 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/XML/md/PDPDescriptor.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/XML/md/PDPDescriptor.php @@ -4,6 +4,7 @@ use SAML2\Constants; use SAML2\Utils; +use Webmozart\Assert\Assert; /** * Class representing SAML 2 metadata PDPDescriptor. @@ -19,7 +20,7 @@ class PDPDescriptor extends RoleDescriptor * * @var \SAML2\XML\md\EndpointType[] */ - public $AuthzService = array(); + public $AuthzService = []; /** * List of AssertionIDRequestService endpoints. @@ -28,7 +29,7 @@ class PDPDescriptor extends RoleDescriptor * * @var \SAML2\XML\md\EndpointType[] */ - public $AssertionIDRequestService = array(); + public $AssertionIDRequestService = []; /** * List of supported NameID formats. @@ -37,7 +38,8 @@ class PDPDescriptor extends RoleDescriptor * * @var string[] */ - public $NameIDFormat = array(); + public $NameIDFormat = []; + /** * Initialize an IDPSSODescriptor. @@ -54,19 +56,107 @@ public function __construct(\DOMElement $xml = null) } foreach (Utils::xpQuery($xml, './saml_metadata:AuthzService') as $ep) { - $this->AuthzService[] = new EndpointType($ep); + $this->addAuthzService(new EndpointType($ep)); } - if (empty($this->AuthzService)) { + if ($this->getAuthzService() !== []) { throw new \Exception('Must have at least one AuthzService in PDPDescriptor.'); } foreach (Utils::xpQuery($xml, './saml_metadata:AssertionIDRequestService') as $ep) { - $this->AssertionIDRequestService[] = new EndpointType($ep); + $this->addAssertionIDRequestService(new EndpointType($ep)); } - $this->NameIDFormat = Utils::extractStrings($xml, Constants::NS_MD, 'NameIDFormat'); + $this->setNameIDFormat(Utils::extractStrings($xml, Constants::NS_MD, 'NameIDFormat')); + } + + + /** + * Collect the value of the AuthzService-property + * @return \SAML2\XML\md\EndpointType[] + */ + public function getAuthzService() + { + return $this->AuthzService; + } + + + /** + * Set the value of the AuthzService-property + * @param \SAML2\XML\md\EndpointType[] $authzService + * @return void + */ + public function setAuthzService(array $authzService = []) + { + $this->AuthzService = $authzService; + } + + + /** + * Add the value to the AuthzService-property + * @param \SAML2\XML\md\EndpointType $authzService + * @return void + */ + public function addAuthzService(EndpointType $authzService) + { + Assert::isInstanceOf($authzService, EndpointType::class); + $this->AuthzService[] = $authzService; + } + + + /** + * Collect the value of the AssertionIDRequestService-property + * @return \SAML2\XML\md\EndpointType[] + */ + public function getAssertionIDRequestService() + { + return $this->AssertionIDRequestService; + } + + + /** + * Set the value of the AssertionIDRequestService-property + * @param \SAML2\XML\md\EndpointType[] $assertionIDRequestService + * @return void + */ + public function setAssertionIDRequestService(array $assertionIDRequestService) + { + $this->AssertionIDRequestService = $assertionIDRequestService; } + + /** + * Add the value to the AssertionIDRequestService-property + * @param \SAML2\XML\md\EndpointType $assertionIDRequestService + * @return void + */ + public function addAssertionIDRequestService(EndpointType $assertionIDRequestService) + { + Assert::isInstanceOf($assertionIDRequestService, EndpointType::class); + $this->AssertionIDRequestService[] = $assertionIDRequestService; + } + + + /** + * Collect the value of the NameIDFormat-property + * @return string[] + */ + public function getNameIDFormat() + { + return $this->NameIDFormat; + } + + + /** + * Set the value of the NameIDFormat-property + * @param string[] $nameIDFormat + * @return void + */ + public function setNameIDFormat(array $nameIDFormat) + { + $this->NameIDFormat = $nameIDFormat; + } + + /** * Add this PDPDescriptor to an EntityDescriptor. * @@ -75,22 +165,22 @@ public function __construct(\DOMElement $xml = null) */ public function toXML(\DOMElement $parent) { - assert(is_array($this->AuthzService)); - assert(!empty($this->AuthzService)); - assert(is_array($this->AssertionIDRequestService)); - assert(is_array($this->NameIDFormat)); + Assert::isArray($authzService = $this->getAuthzService()); + Assert::notEmpty($authzService); + Assert::isArray($this->getAssertionIDRequestService()); + Assert::isArray($this->getNameIDFormat()); $e = parent::toXML($parent); - foreach ($this->AuthzService as $ep) { + foreach ($this->getAuthzService() as $ep) { $ep->toXML($e, 'md:AuthzService'); } - foreach ($this->AssertionIDRequestService as $ep) { + foreach ($this->getAssertionIDRequestService() as $ep) { $ep->toXML($e, 'md:AssertionIDRequestService'); } - Utils::addStrings($e, Constants::NS_MD, 'md:NameIDFormat', false, $this->NameIDFormat); + Utils::addStrings($e, Constants::NS_MD, 'md:NameIDFormat', false, $this->getNameIDFormat()); return $e; } diff --git a/vendor/simplesamlphp/saml2/src/SAML2/XML/md/RequestedAttribute.php b/vendor/simplesamlphp/saml2/src/SAML2/XML/md/RequestedAttribute.php index 76e0f8957f..e1ed35e47e 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/XML/md/RequestedAttribute.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/XML/md/RequestedAttribute.php @@ -5,6 +5,7 @@ use SAML2\Constants; use SAML2\Utils; use SAML2\XML\saml\Attribute; +use Webmozart\Assert\Assert; /** * Class representing SAML 2 metadata RequestedAttribute. @@ -20,6 +21,7 @@ class RequestedAttribute extends Attribute */ public $isRequired = null; + /** * Initialize an RequestedAttribute. * @@ -33,9 +35,32 @@ public function __construct(\DOMElement $xml = null) return; } - $this->isRequired = Utils::parseBoolean($xml, 'isRequired', null); + $this->setIsRequired(Utils::parseBoolean($xml, 'isRequired', null)); + } + + + /** + * Collect the value of the isRequired-property + * @return boolean|null + */ + public function getIsRequired() + { + return $this->isRequired; + } + + + /** + * Set the value of the isRequired-property + * @param boolean|null $flag + * @return void + */ + public function setIsRequired($flag = null) + { + Assert::nullOrBoolean($flag); + $this->isRequired = $flag; } + /** * Convert this RequestedAttribute to XML. * @@ -44,13 +69,13 @@ public function __construct(\DOMElement $xml = null) */ public function toXML(\DOMElement $parent) { - assert(is_bool($this->isRequired) || is_null($this->isRequired)); + Assert::nullOrBoolean($this->isRequired); $e = $this->toXMLInternal($parent, Constants::NS_MD, 'md:RequestedAttribute'); - if ($this->isRequired === true) { + if ($this->getIsRequired() === true) { $e->setAttribute('isRequired', 'true'); - } elseif ($this->isRequired === false) { + } elseif ($this->getIsRequired() === false) { $e->setAttribute('isRequired', 'false'); } diff --git a/vendor/simplesamlphp/saml2/src/SAML2/XML/md/RoleDescriptor.php b/vendor/simplesamlphp/saml2/src/SAML2/XML/md/RoleDescriptor.php index 53d007c385..fbfc2721bc 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/XML/md/RoleDescriptor.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/XML/md/RoleDescriptor.php @@ -5,6 +5,8 @@ use SAML2\Constants; use SAML2\SignedElementHelper; use SAML2\Utils; +use SAML2\XML\Chunk; +use Webmozart\Assert\Assert; /** * Class representing SAML 2 RoleDescriptor element. @@ -46,7 +48,7 @@ class RoleDescriptor extends SignedElementHelper * * @var array */ - public $protocolSupportEnumeration = array(); + public $protocolSupportEnumeration = []; /** * Error URL for this role. @@ -62,7 +64,7 @@ class RoleDescriptor extends SignedElementHelper * * @var array */ - public $Extensions = array(); + public $Extensions = []; /** * KeyDescriptor elements. @@ -71,7 +73,7 @@ class RoleDescriptor extends SignedElementHelper * * @var \SAML2\XML\md\KeyDescriptor[] */ - public $KeyDescriptor = array(); + public $KeyDescriptor = []; /** * Organization of this role. @@ -87,7 +89,8 @@ class RoleDescriptor extends SignedElementHelper * * @var \SAML2\XML\md\ContactPerson[] */ - public $ContactPerson = array(); + public $ContactPerson = []; + /** * Initialize a RoleDescriptor. @@ -98,7 +101,7 @@ class RoleDescriptor extends SignedElementHelper */ protected function __construct($elementName, \DOMElement $xml = null) { - assert(is_string($elementName)); + Assert::string($elementName); parent::__construct($xml); $this->elementName = $elementName; @@ -108,42 +111,284 @@ protected function __construct($elementName, \DOMElement $xml = null) } if ($xml->hasAttribute('ID')) { - $this->ID = $xml->getAttribute('ID'); + $this->setID($xml->getAttribute('ID')); } if ($xml->hasAttribute('validUntil')) { - $this->validUntil = Utils::xsDateTimeToTimestamp($xml->getAttribute('validUntil')); + $this->setValidUntil(Utils::xsDateTimeToTimestamp($xml->getAttribute('validUntil'))); } if ($xml->hasAttribute('cacheDuration')) { - $this->cacheDuration = $xml->getAttribute('cacheDuration'); + $this->setCacheDuration($xml->getAttribute('cacheDuration')); } if (!$xml->hasAttribute('protocolSupportEnumeration')) { - throw new \Exception('Missing protocolSupportEnumeration attribute on ' . $xml->localName); + throw new \Exception('Missing protocolSupportEnumeration attribute on '.$xml->localName); } - $this->protocolSupportEnumeration = preg_split('/[\s]+/', $xml->getAttribute('protocolSupportEnumeration')); + $this->setProtocolSupportEnumeration(preg_split('/[\s]+/', $xml->getAttribute('protocolSupportEnumeration'))); if ($xml->hasAttribute('errorURL')) { - $this->errorURL = $xml->getAttribute('errorURL'); + $this->setErrorURL($xml->getAttribute('errorURL')); } - $this->Extensions = Extensions::getList($xml); + $this->setExtensions(Extensions::getList($xml)); foreach (Utils::xpQuery($xml, './saml_metadata:KeyDescriptor') as $kd) { - $this->KeyDescriptor[] = new KeyDescriptor($kd); + $this->addKeyDescriptor(new KeyDescriptor($kd)); } $organization = Utils::xpQuery($xml, './saml_metadata:Organization'); if (count($organization) > 1) { throw new \Exception('More than one Organization in the entity.'); } elseif (!empty($organization)) { - $this->Organization = new Organization($organization[0]); + $this->setOrganization(new Organization($organization[0])); } foreach (Utils::xpQuery($xml, './saml_metadata:ContactPerson') as $cp) { - $this->contactPersons[] = new ContactPerson($cp); + $this->addContactPerson(new ContactPerson($cp)); + } + } + + + /** + * Collect the value of the ID-property + * @return string|null + */ + public function getID() + { + return $this->ID; + } + + + /** + * Set the value of the ID-property + * @param string|null $Id + * @return void + */ + public function setID($Id = null) + { + Assert::nullOrString($Id); + $this->ID = $Id; + } + + + /** + * Collect the value of the validUntil-property + * @return int|null + */ + public function getValidUntil() + { + return $this->validUntil; + } + + + /** + * Set the value of the validUntil-property + * @param int|null $validUntil + * @return void + */ + public function setValidUntil($validUntil = null) + { + Assert::nullOrInteger($validUntil); + $this->validUntil = $validUntil; + } + + + /** + * Collect the value of the cacheDuration-property + * @return string|null + */ + public function getCacheDuration() + { + return $this->cacheDuration; + } + + + /** + * Set the value of the cacheDuration-property + * @param string|null $cacheDuration + * @return void + */ + public function setCacheDuration($cacheDuration = null) + { + Assert::nullOrString($cacheDuration); + $this->cacheDuration = $cacheDuration; + } + + + /** + * Collect the value of the Extensions-property + * @return \SAML2\XML\Chunk[] + */ + public function getExtensions() + { + return $this->Extensions; + } + + + /** + * Set the value of the Extensions-property + * @param array $extensions + * @return void + */ + public function setExtensions(array $extensions) + { + $this->Extensions = $extensions; + } + + + /** + * Add an Extension. + * + * @param \SAML2\XML\Chunk $extensions The Extensions + * @return void + */ + public function addExtension(Extensions $extension) + { + $this->Extensions[] = $extension; + } + + + /** + * Set the value of the errorURL-property + * @param string|null $errorURL + * @return void + */ + public function setErrorURL($errorURL = null) + { + Assert::nullOrString($errorURL); + if (!is_null($errorURL) && !filter_var($errorURL, FILTER_VALIDATE_URL)) { + throw new \InvalidArgumentException('RoleDescriptor errorURL is not a valid URL.'); } + $this->errorURL = $errorURL; + } + + + /** + * Collect the value of the errorURL-property + * @return string|null + */ + public function getErrorURL() + { + return $this->errorURL; + } + + + /** + * Collect the value of the ProtocolSupportEnumeration-property + * @return string[] + */ + public function getProtocolSupportEnumeration() + { + return $this->protocolSupportEnumeration; + } + + + /** + * Set the value of the ProtocolSupportEnumeration-property + * @param array $protocols + * @return void + */ + public function setProtocolSupportEnumeration(array $protocols) + { + $this->protocolSupportEnumeration = $protocols; + } + + + /** + * Add the value to the ProtocolSupportEnumeration-property + * @param string $protocol + * @return void + */ + public function addProtocolSupportEnumeration($protocol) + { + $this->protocolSupportEnumeration[] = $protocol; + } + + + /** + * Collect the value of the Organization-property + * @return \SAML2\XML\md\Organization + */ + public function getOrganization() + { + return $this->Organization; + } + + + /** + * Set the value of the Organization-property + * @param \SAML2\XML\md\Organization|null $organization + * @return void + */ + public function setOrganization(Organization $organization = null) + { + $this->Organization = $organization; + } + + + /** + * Collect the value of the ContactPerson-property + * @return \SAML2\XML\md\ContactPerson[] + */ + public function getContactPerson() + { + return $this->ContactPerson; + } + + + /** + * Set the value of the ContactPerson-property + * @param array $contactPerson + * @return void + */ + public function setContactPerson(array $contactPerson) + { + $this->ContactPerson = $contactPerson; + } + + + /** + * Add the value to the ContactPerson-property + * @param \SAML2\XML\md\ContactPerson $contactPerson + * @return void + */ + public function addContactPerson(ContactPerson $contactPerson) + { + $this->ContactPerson[] = $contactPerson; + } + + + /** + * Collect the value of the KeyDescriptor-property + * @return \SAML2\XML\md\KeyDescriptor[] + */ + public function getKeyDescriptor() + { + return $this->KeyDescriptor; } + + /** + * Set the value of the KeyDescriptor-property + * @param array $keyDescriptor + * @return void + */ + public function setKeyDescriptor(array $keyDescriptor) + { + $this->KeyDescriptor = $keyDescriptor; + } + + + /** + * Add the value to the KeyDescriptor-property + * @param \SAML2\XML\md\KeyDescriptor $keyDescriptor + * @return void + */ + public function addKeyDescriptor(KeyDescriptor $keyDescriptor) + { + $this->KeyDescriptor[] = $keyDescriptor; + } + + /** * Add this RoleDescriptor to an EntityDescriptor. * @@ -152,48 +397,48 @@ protected function __construct($elementName, \DOMElement $xml = null) */ protected function toXML(\DOMElement $parent) { - assert(is_null($this->ID) || is_string($this->ID)); - assert(is_null($this->validUntil) || is_int($this->validUntil)); - assert(is_null($this->cacheDuration) || is_string($this->cacheDuration)); - assert(is_array($this->protocolSupportEnumeration)); - assert(is_null($this->errorURL) || is_string($this->errorURL)); - assert(is_array($this->Extensions)); - assert(is_array($this->KeyDescriptor)); - assert(is_null($this->Organization) || $this->Organization instanceof Organization); - assert(is_array($this->ContactPerson)); + Assert::nullOrString($this->getID()); + Assert::nullOrInteger($this->getValidUntil()); + Assert::nullOrString($this->getCacheDuration()); + Assert::isArray($this->getProtocolSupportEnumeration()); + Assert::nullOrString($this->getErrorURL()); + Assert::isArray($this->getExtensions()); + Assert::isArray($this->getKeyDescriptor()); + Assert::nullOrIsInstanceOf($this->getOrganization(), Organization::class); + Assert::isArray($this->getContactPerson()); $e = $parent->ownerDocument->createElementNS(Constants::NS_MD, $this->elementName); $parent->appendChild($e); - if (isset($this->ID)) { - $e->setAttribute('ID', $this->ID); + if ($this->getID() !== null) { + $e->setAttribute('ID', $this->getID()); } - if (isset($this->validUntil)) { - $e->setAttribute('validUntil', gmdate('Y-m-d\TH:i:s\Z', $this->validUntil)); + if ($this->getValidUntil() !== null) { + $e->setAttribute('validUntil', gmdate('Y-m-d\TH:i:s\Z', $this->getValidUntil())); } - if (isset($this->cacheDuration)) { - $e->setAttribute('cacheDuration', $this->cacheDuration); + if ($this->getCacheDuration() !== null) { + $e->setAttribute('cacheDuration', $this->getCacheDuration()); } - $e->setAttribute('protocolSupportEnumeration', implode(' ', $this->protocolSupportEnumeration)); + $e->setAttribute('protocolSupportEnumeration', implode(' ', $this->getProtocolSupportEnumeration())); - if (isset($this->errorURL)) { - $e->setAttribute('errorURL', $this->errorURL); + if ($this->getErrorURL() !== null) { + $e->setAttribute('errorURL', $this->getErrorURL()); } - Extensions::addList($e, $this->Extensions); + Extensions::addList($e, $this->getExtensions()); - foreach ($this->KeyDescriptor as $kd) { + foreach ($this->getKeyDescriptor() as $kd) { $kd->toXML($e); } - if (isset($this->Organization)) { - $this->Organization->toXML($e); + if ($this->getOrganization() !== null) { + $this->getOrganization()->toXML($e); } - foreach ($this->ContactPerson as $cp) { + foreach ($this->getContactPerson() as $cp) { $cp->toXML($e); } diff --git a/vendor/simplesamlphp/saml2/src/SAML2/XML/md/SPSSODescriptor.php b/vendor/simplesamlphp/saml2/src/SAML2/XML/md/SPSSODescriptor.php index d5370003bf..5cc9fc9986 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/XML/md/SPSSODescriptor.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/XML/md/SPSSODescriptor.php @@ -3,6 +3,7 @@ namespace SAML2\XML\md; use SAML2\Utils; +use Webmozart\Assert\Assert; /** * Class representing SAML 2 SPSSODescriptor. @@ -32,7 +33,7 @@ class SPSSODescriptor extends SSODescriptorType * * @var \SAML2\XML\md\IndexedEndpointType[] */ - public $AssertionConsumerService = array(); + public $AssertionConsumerService = []; /** * List of AttributeConsumingService descriptors for this SP. @@ -41,7 +42,8 @@ class SPSSODescriptor extends SSODescriptorType * * @var \SAML2\XML\md\AttributeConsumingService[] */ - public $AttributeConsumingService = array(); + public $AttributeConsumingService = []; + /** * Initialize a SPSSODescriptor. @@ -56,51 +58,162 @@ public function __construct(\DOMElement $xml = null) return; } - $this->AuthnRequestsSigned = Utils::parseBoolean($xml, 'AuthnRequestsSigned', null); - $this->WantAssertionsSigned = Utils::parseBoolean($xml, 'WantAssertionsSigned', null); + $this->setAuthnRequestsSigned(Utils::parseBoolean($xml, 'AuthnRequestsSigned', null)); + $this->setWantAssertionsSigned(Utils::parseBoolean($xml, 'WantAssertionsSigned', null)); foreach (Utils::xpQuery($xml, './saml_metadata:AssertionConsumerService') as $ep) { - $this->AssertionConsumerService[] = new IndexedEndpointType($ep); + $this->addAssertionConsumerService(new IndexedEndpointType($ep)); } foreach (Utils::xpQuery($xml, './saml_metadata:AttributeConsumingService') as $acs) { - $this->AttributeConsumingService[] = new AttributeConsumingService($acs); + $this->addAttributeConsumingService(new AttributeConsumingService($acs)); } } + + /** + * Collect the value of the AuthnRequestsSigned-property + * @return bool|null + */ + public function getAuthnRequestsSigned() + { + return $this->AuthnRequestsSigned; + } + + + /** + * Set the value of the AuthnRequestsSigned-property + * @param bool|null $flag + * @return void + */ + public function setAuthnRequestsSigned($flag = null) + { + Assert::nullOrBoolean($flag); + $this->AuthnRequestsSigned = $flag; + } + + + /** + * Collect the value of the WantAssertionsSigned-property + * @return bool|null + */ + public function wantAssertionsSigned() + { + return $this->WantAssertionsSigned; + } + + + /** + * Set the value of the WantAssertionsSigned-property + * @param bool|null $flag + * @return void + */ + public function setWantAssertionsSigned($flag = null) + { + Assert::nullOrBoolean($flag); + $this->WantAssertionsSigned = $flag; + } + + + /** + * Collect the value of the AssertionConsumerService-property + * @return array + */ + public function getAssertionConsumerService() + { + return $this->AssertionConsumerService; + } + + + /** + * Set the value of the AssertionConsumerService-property + * @param array $acs + * @return void + */ + public function setAssertionConsumerService(array $acs) + { + $this->AssertionConsumerService = $acs; + } + + + /** + * Add the value to the AssertionConsumerService-property + * @param \SAML2\XML\md\IndexedEndpointType $acs + * @return void + */ + public function addAssertionConsumerService(IndexedEndpointType $acs) + { + $this->AssertionConsumerService[] = $acs; + } + + + /** + * Collect the value of the AttributeConsumingService-property + * @return array + */ + public function getAttributeConsumingService() + { + return $this->AttributeConsumingService; + } + + + /** + * Add the value to the AttributeConsumingService-property + * @param \SAML2\XML\md\AttributeConsumingService $acs + * @return void + */ + public function addAttributeConsumingService(AttributeConsumingService $acs) + { + $this->AttributeConsumingService[] = $acs; + } + + + /** + * Set the value of the AttributeConsumingService-property + * @param array $acs + * @return void + */ + public function setAttributeConsumingService(array $acs) + { + $this->AttributeConsumingService = $acs; + } + + /** * Add this SPSSODescriptor to an EntityDescriptor. * * @param \DOMElement $parent The EntityDescriptor we should append this SPSSODescriptor to. - * @return void + * @return \DOMElement */ public function toXML(\DOMElement $parent) { - assert(is_null($this->AuthnRequestsSigned) || is_bool($this->AuthnRequestsSigned)); - assert(is_null($this->WantAssertionsSigned) || is_bool($this->WantAssertionsSigned)); - assert(is_array($this->AssertionConsumerService)); - assert(is_array($this->AttributeConsumingService)); + Assert::nullOrBoolean($this->getAuthnRequestsSigned()); + Assert::nullOrBoolean($this->wantAssertionsSigned()); + Assert::isArray($this->getAssertionConsumerService()); + Assert::isArray($this->getAttributeConsumingService()); $e = parent::toXML($parent); - if ($this->AuthnRequestsSigned === true) { + if ($this->getAuthnRequestsSigned() === true) { $e->setAttribute('AuthnRequestsSigned', 'true'); - } elseif ($this->AuthnRequestsSigned === false) { + } elseif ($this->getAuthnRequestsSigned() === false) { $e->setAttribute('AuthnRequestsSigned', 'false'); } - if ($this->WantAssertionsSigned === true) { + if ($this->wantAssertionsSigned() === true) { $e->setAttribute('WantAssertionsSigned', 'true'); - } elseif ($this->WantAssertionsSigned === false) { + } elseif ($this->wantAssertionsSigned() === false) { $e->setAttribute('WantAssertionsSigned', 'false'); } - foreach ($this->AssertionConsumerService as $ep) { + foreach ($this->getAssertionConsumerService() as $ep) { $ep->toXML($e, 'md:AssertionConsumerService'); } - foreach ($this->AttributeConsumingService as $acs) { + foreach ($this->getAttributeConsumingService() as $acs) { $acs->toXML($e); } + + return $e; } } diff --git a/vendor/simplesamlphp/saml2/src/SAML2/XML/md/SSODescriptorType.php b/vendor/simplesamlphp/saml2/src/SAML2/XML/md/SSODescriptorType.php index 5993bd2a54..3477ee895d 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/XML/md/SSODescriptorType.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/XML/md/SSODescriptorType.php @@ -4,6 +4,7 @@ use SAML2\Constants; use SAML2\Utils; +use Webmozart\Assert\Assert; /** * Class representing SAML 2 SSODescriptorType. @@ -19,7 +20,7 @@ abstract class SSODescriptorType extends RoleDescriptor * * @var \SAML2\XML\md\IndexedEndpointType[] */ - public $ArtifactResolutionService = array(); + public $ArtifactResolutionService = []; /** * List of SingleLogoutService endpoints. @@ -28,7 +29,7 @@ abstract class SSODescriptorType extends RoleDescriptor * * @var \SAML2\XML\md\EndpointType[] */ - public $SingleLogoutService = array(); + public $SingleLogoutService = []; /** * List of ManageNameIDService endpoints. @@ -37,7 +38,7 @@ abstract class SSODescriptorType extends RoleDescriptor * * @var \SAML2\XML\md\EndpointType[] */ - public $ManageNameIDService = array(); + public $ManageNameIDService = []; /** * List of supported NameID formats. @@ -46,7 +47,8 @@ abstract class SSODescriptorType extends RoleDescriptor * * @var string[] */ - public $NameIDFormat = array(); + public $NameIDFormat = []; + /** * Initialize a SSODescriptor. @@ -56,7 +58,7 @@ abstract class SSODescriptorType extends RoleDescriptor */ protected function __construct($elementName, \DOMElement $xml = null) { - assert(is_string($elementName)); + Assert::string($elementName); parent::__construct($elementName, $xml); @@ -65,20 +67,141 @@ protected function __construct($elementName, \DOMElement $xml = null) } foreach (Utils::xpQuery($xml, './saml_metadata:ArtifactResolutionService') as $ep) { - $this->ArtifactResolutionService[] = new IndexedEndpointType($ep); + $this->addArtifactResolutionService(new IndexedEndpointType($ep)); } foreach (Utils::xpQuery($xml, './saml_metadata:SingleLogoutService') as $ep) { - $this->SingleLogoutService[] = new EndpointType($ep); + $this->addSingleLogoutService(new EndpointType($ep)); } foreach (Utils::xpQuery($xml, './saml_metadata:ManageNameIDService') as $ep) { - $this->ManageNameIDService[] = new EndpointType($ep); + $this->addManageNameIDService(new EndpointType($ep)); } - $this->NameIDFormat = Utils::extractStrings($xml, Constants::NS_MD, 'NameIDFormat'); + $this->setNameIDFormat(Utils::extractStrings($xml, Constants::NS_MD, 'NameIDFormat')); + } + + + /** + * Collect the value of the ArtifactResolutionService-property + * @return \SAML2\XML\md\IndexedEndpointType[] + */ + public function getArtifactResolutionService() + { + return $this->ArtifactResolutionService; + } + + + /** + * Set the value of the ArtifactResolutionService-property + * @param \SAML2\XML\md\IndexedEndpointType[] $artifactResolutionService + * @return void + */ + public function setArtifactResolutionService(array $artifactResolutionService) + { + $this->ArtifactResolutionService = $artifactResolutionService; + } + + + /** + * Add the value to the ArtifactResolutionService-property + * @param \SAML2\XML\md\IndexedEndpointType $artifactResolutionService + * @return void + */ + public function addArtifactResolutionService(IndexedEndpointType $artifactResolutionService) + { + Assert::isInstanceOf($artifactResolutionService, IndexedEndpointType::class); + $this->ArtifactResolutionService[] = $artifactResolutionService; + } + + + /** + * Collect the value of the SingleLogoutService-property + * @return \SAML2\XML\md\EndpointType[] + */ + public function getSingleLogoutService() + { + return $this->SingleLogoutService; + } + + + /** + * Set the value of the SingleLogoutService-property + * @param \SAML2\XML\md\EndpointType[] $singleLogoutService + * @return void + */ + public function setSingleLogoutService(array $singleLogoutService) + { + $this->SingleLogoutService = $singleLogoutService; + } + + + /** + * Add the value to the SingleLogoutService-property + * @param \SAML2\XML\md\EndpointType $singleLogoutService + * @return void + */ + public function addSingleLogoutService(EndpointType $singleLogoutService) + { + Assert::isInstanceOf($singleLogoutService, EndpointType::class); + $this->SingleLogoutService[] = $singleLogoutService; + } + + + /** + * Collect the value of the ManageNameIDService-property + * @return \SAML2\XML\md\EndpointType[] + */ + public function getManageNameIDService() + { + return $this->ManageNameIDService; + } + + + /** + * Set the value of the ManageNameIDService-property + * @param \SAML2\XML\md\EndpointType[] $manageNameIDService + * @return void + */ + public function setManageNameIDService(array $manageNameIDService) + { + $this->ManageNameIDService = $manageNameIDService; + } + + + /** + * Add the value to the ManageNameIDService-property + * @param \SAML2\XML\md\EndpointType $manageNameIDService + * @return void + */ + public function addManageNameIDService(EndpointType $manageNameIDService) + { + Assert::isInstanceOf($manageNameIDService, EndpointType::class); + $this->ManageNameIDService[] = $manageNameIDService; } + + /** + * Collect the value of the NameIDFormat-property + * @return string[] + */ + public function getNameIDFormat() + { + return $this->NameIDFormat; + } + + + /** + * Set the value of the NameIDFormat-property + * @param string[] $nameIDFormat + * @return void + */ + public function setNameIDFormat(array $nameIDFormat) + { + $this->NameIDFormat = $nameIDFormat; + } + + /** * Add this SSODescriptorType to an EntityDescriptor. * @@ -87,26 +210,26 @@ protected function __construct($elementName, \DOMElement $xml = null) */ protected function toXML(\DOMElement $parent) { - assert(is_array($this->ArtifactResolutionService)); - assert(is_array($this->SingleLogoutService)); - assert(is_array($this->ManageNameIDService)); - assert(is_array($this->NameIDFormat)); + Assert::isArray($this->getArtifactResolutionService()); + Assert::isArray($this->getSingleLogoutService()); + Assert::isArray($this->getManageNameIDService()); + Assert::isArray($this->getNameIDFormat()); $e = parent::toXML($parent); - foreach ($this->ArtifactResolutionService as $ep) { + foreach ($this->getArtifactResolutionService() as $ep) { $ep->toXML($e, 'md:ArtifactResolutionService'); } - foreach ($this->SingleLogoutService as $ep) { + foreach ($this->getSingleLogoutService() as $ep) { $ep->toXML($e, 'md:SingleLogoutService'); } - foreach ($this->ManageNameIDService as $ep) { + foreach ($this->getManageNameIDService() as $ep) { $ep->toXML($e, 'md:ManageNameIDService'); } - Utils::addStrings($e, Constants::NS_MD, 'md:NameIDFormat', false, $this->NameIDFormat); + Utils::addStrings($e, Constants::NS_MD, 'md:NameIDFormat', false, $this->getNameIDFormat()); return $e; } diff --git a/vendor/simplesamlphp/saml2/src/SAML2/XML/md/UnknownRoleDescriptor.php b/vendor/simplesamlphp/saml2/src/SAML2/XML/md/UnknownRoleDescriptor.php index 6656d4efa9..c530d88d67 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/XML/md/UnknownRoleDescriptor.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/XML/md/UnknownRoleDescriptor.php @@ -18,6 +18,7 @@ class UnknownRoleDescriptor extends RoleDescriptor */ private $xml; + /** * Initialize an unknown RoleDescriptor. * @@ -30,6 +31,7 @@ public function __construct(\DOMElement $xml) $this->xml = new Chunk($xml); } + /** * Add this RoleDescriptor to an EntityDescriptor. * diff --git a/vendor/simplesamlphp/saml2/src/SAML2/XML/mdattr/EntityAttributes.php b/vendor/simplesamlphp/saml2/src/SAML2/XML/mdattr/EntityAttributes.php index 896a4d839d..bad38df955 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/XML/mdattr/EntityAttributes.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/XML/mdattr/EntityAttributes.php @@ -5,6 +5,7 @@ use SAML2\Utils; use SAML2\XML\Chunk; use SAML2\XML\saml\Attribute; +use Webmozart\Assert\Assert; /** * Class for handling the EntityAttributes metadata extension. @@ -28,6 +29,7 @@ class EntityAttributes */ public $children; + /** * Create a EntityAttributes element. * @@ -41,13 +43,47 @@ public function __construct(\DOMElement $xml = null) foreach (Utils::xpQuery($xml, './saml_assertion:Attribute|./saml_assertion:Assertion') as $node) { if ($node->localName === 'Attribute') { - $this->children[] = new Attribute($node); + $this->addChildren(new Attribute($node)); } else { - $this->children[] = new Chunk($node); + $this->addChildren(new Chunk($node)); } } } + + /** + * Collect the value of the children-property + * @return (\SAML2\XML\Chunk|\SAML2\XML\saml\Attribute)[] + */ + public function getChildren() + { + return $this->children; + } + + + /** + * Set the value of the childen-property + * @param array $children + * @return void + */ + public function setChildren(array $children) + { + $this->children = $children; + } + + + /** + * Add the value to the children-property + * @param \SAML2\XML\Chunk|\SAML2\XML\saml\Attribute $child + * @return void + */ + public function addChildren($child) + { + Assert::isInstanceOfAny($child, [Chunk::class, Attribute::class]); + $this->children[] = $child; + } + + /** * Convert this EntityAttributes to XML. * @@ -56,7 +92,7 @@ public function __construct(\DOMElement $xml = null) */ public function toXML(\DOMElement $parent) { - assert(is_array($this->children)); + Assert::isArray($this->getChildren()); $doc = $parent->ownerDocument; @@ -64,7 +100,7 @@ public function toXML(\DOMElement $parent) $parent->appendChild($e); /** @var \SAML2\XML\saml\Attribute|\SAML2\XML\Chunk $child */ - foreach ($this->children as $child) { + foreach ($this->getChildren() as $child) { $child->toXML($e); } diff --git a/vendor/simplesamlphp/saml2/src/SAML2/XML/mdrpi/PublicationInfo.php b/vendor/simplesamlphp/saml2/src/SAML2/XML/mdrpi/PublicationInfo.php index 6e95ec943e..54e6217e91 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/XML/mdrpi/PublicationInfo.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/XML/mdrpi/PublicationInfo.php @@ -3,6 +3,7 @@ namespace SAML2\XML\mdrpi; use SAML2\Utils; +use Webmozart\Assert\Assert; /** * Class for handling the mdrpi:PublicationInfo element. @@ -40,7 +41,8 @@ class PublicationInfo * * @var array */ - public $UsagePolicy = array(); + public $UsagePolicy = []; + /** * Create/parse a mdrpi:PublicationInfo element. @@ -57,19 +59,107 @@ public function __construct(\DOMElement $xml = null) if (!$xml->hasAttribute('publisher')) { throw new \Exception('Missing required attribute "publisher" in mdrpi:PublicationInfo element.'); } - $this->publisher = $xml->getAttribute('publisher'); + $this->setPublisher($xml->getAttribute('publisher')); if ($xml->hasAttribute('creationInstant')) { - $this->creationInstant = Utils::xsDateTimeToTimestamp($xml->getAttribute('creationInstant')); + $this->setCreationInstant(Utils::xsDateTimeToTimestamp($xml->getAttribute('creationInstant'))); } if ($xml->hasAttribute('publicationId')) { - $this->publicationId = $xml->getAttribute('publicationId'); + $this->setPublicationId($xml->getAttribute('publicationId')); } - $this->UsagePolicy = Utils::extractLocalizedStrings($xml, Common::NS_MDRPI, 'UsagePolicy'); + $this->setUsagePolicy(Utils::extractLocalizedStrings($xml, Common::NS_MDRPI, 'UsagePolicy')); + } + + + /** + * Collect the value of the publisher-property + * @return string + */ + public function getPublisher() + { + return $this->publisher; + } + + + /** + * Collect the value of the creationInstant-property + * @return int|null + */ + public function getCreationInstant() + { + return $this->creationInstant; + } + + + /** + * Collect the value of the publicationId-property + * @return string|null + */ + public function getPublicationId() + { + return $this->publicationId; + } + + + /** + * Collect the value of the UsagePolicy-property + * @return array + */ + public function getUsagePolicy() + { + return $this->UsagePolicy; + } + + + /** + * Set the value of the publisher-property + * @param string $publisher + * @return void + */ + public function setPublisher($publisher) + { + Assert::string($publisher); + $this->publisher = $publisher; } + + /** + * Set the value of the creationInstant-property + * @param int|null $creationInstant + * @return void + */ + public function setCreationInstant($creationInstant = null) + { + Assert::nullOrInteger($creationInstant); + $this->creationInstant = $creationInstant; + } + + + /** + * Set the value of the publicationId-property + * @param string|null $publicationId + * @return void + */ + public function setPublicationId($publicationId = null) + { + Assert::nullOrString($publicationId); + $this->publicationId = $publicationId; + } + + + /** + * Set the value of the UsagePolicy-property + * @param array $usagePolicy + * @return void + */ + public function setUsagePolicy(array $usagePolicy) + { + $this->UsagePolicy = $usagePolicy; + } + + /** * Convert this element to XML. * @@ -78,27 +168,27 @@ public function __construct(\DOMElement $xml = null) */ public function toXML(\DOMElement $parent) { - assert(is_string($this->publisher)); - assert(is_int($this->creationInstant) || is_null($this->creationInstant)); - assert(is_string($this->publicationId) || is_null($this->publicationId)); - assert(is_array($this->UsagePolicy)); + Assert::string($this->getPublisher()); + Assert::nullOrInteger($this->getCreationInstant()); + Assert::nullOrString($this->getPublicationId()); + Assert::isArray($this->getUsagePolicy()); $doc = $parent->ownerDocument; $e = $doc->createElementNS(Common::NS_MDRPI, 'mdrpi:PublicationInfo'); $parent->appendChild($e); - $e->setAttribute('publisher', $this->publisher); + $e->setAttribute('publisher', $this->getPublisher()); - if ($this->creationInstant !== null) { - $e->setAttribute('creationInstant', gmdate('Y-m-d\TH:i:s\Z', $this->creationInstant)); + if ($this->getCreationInstant() !== null) { + $e->setAttribute('creationInstant', gmdate('Y-m-d\TH:i:s\Z', $this->getCreationInstant())); } - if ($this->publicationId !== null) { - $e->setAttribute('publicationId', $this->publicationId); + if ($this->getPublicationId() !== null) { + $e->setAttribute('publicationId', $this->getPublicationId()); } - Utils::addStrings($e, Common::NS_MDRPI, 'mdrpi:UsagePolicy', true, $this->UsagePolicy); + Utils::addStrings($e, Common::NS_MDRPI, 'mdrpi:UsagePolicy', true, $this->getUsagePolicy()); return $e; } diff --git a/vendor/simplesamlphp/saml2/src/SAML2/XML/mdrpi/RegistrationInfo.php b/vendor/simplesamlphp/saml2/src/SAML2/XML/mdrpi/RegistrationInfo.php index 544c231bf0..e59c134847 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/XML/mdrpi/RegistrationInfo.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/XML/mdrpi/RegistrationInfo.php @@ -3,6 +3,7 @@ namespace SAML2\XML\mdrpi; use SAML2\Utils; +use Webmozart\Assert\Assert; /** * Class for handling the mdrpi:RegistrationInfo element. @@ -33,7 +34,8 @@ class RegistrationInfo * * @var array */ - public $RegistrationPolicy = array(); + public $RegistrationPolicy = []; + /** * Create/parse a mdrpi:RegistrationInfo element. @@ -50,15 +52,81 @@ public function __construct(\DOMElement $xml = null) if (!$xml->hasAttribute('registrationAuthority')) { throw new \Exception('Missing required attribute "registrationAuthority" in mdrpi:RegistrationInfo element.'); } - $this->registrationAuthority = $xml->getAttribute('registrationAuthority'); + $this->setRegistrationAuthority($xml->getAttribute('registrationAuthority')); if ($xml->hasAttribute('registrationInstant')) { - $this->registrationInstant = Utils::xsDateTimeToTimestamp($xml->getAttribute('registrationInstant')); + $this->setRegistrationInstant(Utils::xsDateTimeToTimestamp($xml->getAttribute('registrationInstant'))); } - $this->RegistrationPolicy = Utils::extractLocalizedStrings($xml, Common::NS_MDRPI, 'RegistrationPolicy'); + $this->setRegistrationPolicy(Utils::extractLocalizedStrings($xml, Common::NS_MDRPI, 'RegistrationPolicy')); + } + + + /** + * Collect the value of the RegistrationAuthority-property + * @return string + */ + public function getRegistrationAuthority() + { + return $this->registrationAuthority; + } + + + /** + * Set the value of the registrationAuthority-property + * @param string $registrationAuthority + * @return void + */ + public function setRegistrationAuthority($registrationAuthority) + { + Assert::string($registrationAuthority); + $this->registrationAuthority = $registrationAuthority; + } + + + /** + * Collect the value of the registrationInstant-property + * @return int|null + */ + public function getRegistrationInstant() + { + return $this->registrationInstant; + } + + + /** + * Set the value of the registrationInstant-property + * @param int|null $registrationInstant + * @return void + */ + public function setRegistrationInstant($registrationInstant = null) + { + Assert::nullOrInteger($registrationInstant); + $this->registrationInstant = $registrationInstant; } + + /** + * Collect the value of the RegistrationPolicy-property + * @return array + */ + public function getRegistrationPolicy() + { + return $this->RegistrationPolicy; + } + + + /** + * Set the value of the RegistrationPolicy-property + * @param array $registrationPolicy + * @return void + */ + public function setRegistrationPolicy(array $registrationPolicy) + { + $this->RegistrationPolicy = $registrationPolicy; + } + + /** * Convert this element to XML. * @@ -67,11 +135,12 @@ public function __construct(\DOMElement $xml = null) */ public function toXML(\DOMElement $parent) { - assert(is_string($this->registrationAuthority)); - assert(is_int($this->registrationInstant) || is_null($this->registrationInstant)); - assert(is_array($this->RegistrationPolicy)); + Assert::string($this->getRegistrationAuthority()); + Assert::nullOrInteger($this->getRegistrationInstant()); + Assert::isArray($this->getRegistrationPolicy()); - if (empty($this->registrationAuthority)) { + $registrationAuthority = $this->getRegistrationAuthority(); + if (empty($registrationAuthority)) { throw new \Exception('Missing required registration authority.'); } @@ -80,13 +149,13 @@ public function toXML(\DOMElement $parent) $e = $doc->createElementNS(Common::NS_MDRPI, 'mdrpi:RegistrationInfo'); $parent->appendChild($e); - $e->setAttribute('registrationAuthority', $this->registrationAuthority); + $e->setAttribute('registrationAuthority', $this->getRegistrationAuthority()); - if ($this->registrationInstant !== null) { - $e->setAttribute('registrationInstant', gmdate('Y-m-d\TH:i:s\Z', $this->registrationInstant)); + if ($this->getRegistrationInstant() !== null) { + $e->setAttribute('registrationInstant', gmdate('Y-m-d\TH:i:s\Z', $this->getRegistrationInstant())); } - Utils::addStrings($e, Common::NS_MDRPI, 'mdrpi:RegistrationPolicy', true, $this->RegistrationPolicy); + Utils::addStrings($e, Common::NS_MDRPI, 'mdrpi:RegistrationPolicy', true, $this->getRegistrationPolicy()); return $e; } diff --git a/vendor/simplesamlphp/saml2/src/SAML2/XML/mdui/DiscoHints.php b/vendor/simplesamlphp/saml2/src/SAML2/XML/mdui/DiscoHints.php index c8435299c9..43392cd9f1 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/XML/mdui/DiscoHints.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/XML/mdui/DiscoHints.php @@ -4,6 +4,7 @@ use SAML2\Utils; use SAML2\XML\Chunk; +use Webmozart\Assert\Assert; /** * Class for handling the metadata extensions for login and discovery user interface @@ -20,28 +21,29 @@ class DiscoHints * * @var \SAML2\XML\Chunk[] */ - public $children = array(); + public $children = []; /** * The IPHint, as an array of strings. * * @var string[] */ - public $IPHint = array(); + public $IPHint = []; /** * The DomainHint, as an array of strings. * * @var string[] */ - public $DomainHint = array(); + public $DomainHint = []; /** * The GeolocationHint, as an array of strings. * * @var string[] */ - public $GeolocationHint = array(); + public $GeolocationHint = []; + /** * Create a DiscoHints element. @@ -54,15 +56,112 @@ public function __construct(\DOMElement $xml = null) return; } - $this->IPHint = Utils::extractStrings($xml, Common::NS, 'IPHint'); - $this->DomainHint = Utils::extractStrings($xml, Common::NS, 'DomainHint'); - $this->GeolocationHint = Utils::extractStrings($xml, Common::NS, 'GeolocationHint'); + $this->setIPHint(Utils::extractStrings($xml, Common::NS, 'IPHint')); + $this->setDomainHint(Utils::extractStrings($xml, Common::NS, 'DomainHint')); + $this->setGeolocationHint(Utils::extractStrings($xml, Common::NS, 'GeolocationHint')); foreach (Utils::xpQuery($xml, "./*[namespace-uri()!='".Common::NS."']") as $node) { - $this->children[] = new Chunk($node); + $this->addChildren(new Chunk($node)); } } + + /** + * Collect the value of the IPHint-property + * @return string[] + */ + public function getIPHint() + { + return $this->IPHint; + } + + + /** + * Set the value of the IPHint-property + * @param string[] $hints + * @return void + */ + public function setIPHint(array $hints) + { + $this->IPHint = $hints; + } + + + /** + * Collect the value of the DomainHint-property + * @return string[] + */ + public function getDomainHint() + { + return $this->DomainHint; + } + + + /** + * Set the value of the DomainHint-property + * @param string[] $hints + * @return void + */ + public function setDomainHint(array $hints) + { + $this->DomainHint = $hints; + } + + + /** + * Collect the value of the GeolocationHint-property + * @return string[] + */ + public function getGeolocationHint() + { + return $this->GeolocationHint; + } + + + /** + * Set the value of the GeolocationHint-property + * @param string[] $hints + * @return void + */ + public function setGeolocationHint(array $hints) + { + $this->GeolocationHint = $hints; + } + + + /** + * Collect the value of the children-property + * @return \SAML2\XML\Chunk[] + */ + public function getChildren() + { + return $this->children; + } + + + /** + * Set the value of the childen-property + * @param array $children + * @return void + */ + public function setChildren(array $children) + { + $this->children = $children; + } + + + /** + * Add the value to the children-property + * @param \SAML2\XML\Chunk $child + * @return void + */ + public function addChildren(Chunk $child) + { + Assert::isInstanceOf($child, Chunk::class); + $this->children[] = $child; + } + + /** * Convert this DiscoHints to XML. * @@ -71,29 +170,29 @@ public function __construct(\DOMElement $xml = null) */ public function toXML(\DOMElement $parent) { - assert(is_array($this->IPHint)); - assert(is_array($this->DomainHint)); - assert(is_array($this->GeolocationHint)); - assert(is_array($this->children)); - - if (!empty($this->IPHint) - || !empty($this->DomainHint) - || !empty($this->GeolocationHint) - || !empty($this->children)) { + Assert::isArray($IPHint = $this->getIPHint()); + Assert::isArray($DomainHint = $this->getDomainHint()); + Assert::isArray($GeolocationHint = $this->getGeolocationHint()); + Assert::isArray($children = $this->getChildren()); + + if (!empty($IPHint) + || !empty($DomainHint) + || !empty($GeolocationHint) + || !empty($children)) { $doc = $parent->ownerDocument; $e = $doc->createElementNS(Common::NS, 'mdui:DiscoHints'); $parent->appendChild($e); - if (!empty($this->children)) { - foreach ($this->children as $child) { + if (!empty($children)) { + foreach ($this->getChildren() as $child) { $child->toXML($e); } } - Utils::addStrings($e, Common::NS, 'mdui:IPHint', false, $this->IPHint); - Utils::addStrings($e, Common::NS, 'mdui:DomainHint', false, $this->DomainHint); - Utils::addStrings($e, Common::NS, 'mdui:GeolocationHint', false, $this->GeolocationHint); + Utils::addStrings($e, Common::NS, 'mdui:IPHint', false, $this->getIPHint()); + Utils::addStrings($e, Common::NS, 'mdui:DomainHint', false, $this->getDomainHint()); + Utils::addStrings($e, Common::NS, 'mdui:GeolocationHint', false, $this->getGeolocationHint()); return $e; } diff --git a/vendor/simplesamlphp/saml2/src/SAML2/XML/mdui/Keywords.php b/vendor/simplesamlphp/saml2/src/SAML2/XML/mdui/Keywords.php index f7bcb76729..33fc368887 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/XML/mdui/Keywords.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/XML/mdui/Keywords.php @@ -2,6 +2,8 @@ namespace SAML2\XML\mdui; +use Webmozart\Assert\Assert; + /** * Class for handling the Keywords metadata extensions for login and discovery user interface * @@ -22,10 +24,11 @@ class Keywords /** * The language of this item. * - * @var string + * @var string|null */ public $lang; + /** * Initialize a Keywords. * @@ -44,35 +47,91 @@ public function __construct(\DOMElement $xml = null) if (!is_string($xml->textContent) || !strlen($xml->textContent)) { throw new \Exception('Missing value for Keywords.'); } - $this->Keywords = array(); + $this->setKeywords([]); foreach (explode(' ', $xml->textContent) as $keyword) { - $this->Keywords[] = str_replace('+', ' ', $keyword); + $this->addKeyword(str_replace('+', ' ', $keyword)); } - $this->lang = $xml->getAttribute('xml:lang'); + $this->setLanguage($xml->getAttribute('xml:lang')); + } + + + /** + * Collect the value of the lang-property + * @return string|null + */ + public function getLanguage() + { + return $this->lang; + } + + + /** + * Set the value of the lang-property + * @param string $lang + * @return void + */ + public function setLanguage($lang) + { + Assert::nullOrString($lang); + $this->lang = $lang; } + + /** + * Collect the value of the Keywords-property + * @return string[] + */ + public function getKeywords() + { + return $this->Keywords; + } + + + /** + * Set the value of the Keywords-property + * @param string[] $keywords + * @return void + */ + public function setKeywords(array $keywords) + { + $this->Keywords = $keywords; + } + + + /** + * Add the value to the Keywords-property + * @param string $keyword + * @return void + */ + public function addKeyword($keyword) + { + Assert::string($keyword); + $this->Keywords[] = $keyword; + } + + /** * Convert this Keywords to XML. * * @param \DOMElement $parent The element we should append this Keywords to. - * @return \DOMElement * @throws \Exception + * @return \DOMElement */ public function toXML(\DOMElement $parent) { - assert(is_string($this->lang)); - assert(is_array($this->Keywords)); + Assert::string($this->getLanguage()); + Assert::isArray($this->getKeywords()); $doc = $parent->ownerDocument; $e = $doc->createElementNS(Common::NS, 'mdui:Keywords'); - $e->setAttribute('xml:lang', $this->lang); + $e->setAttribute('xml:lang', $this->getLanguage()); $value = ''; - foreach ($this->Keywords as $keyword) { + foreach ($this->getKeywords() as $keyword) { if (strpos($keyword, "+") !== false) { throw new \Exception('Keywords may not contain a "+" character.'); } - $value .= str_replace(' ', '+', $keyword) . ' '; + $value .= str_replace(' ', '+', $keyword).' '; } $value = rtrim($value); $e->appendChild($doc->createTextNode($value)); diff --git a/vendor/simplesamlphp/saml2/src/SAML2/XML/mdui/Logo.php b/vendor/simplesamlphp/saml2/src/SAML2/XML/mdui/Logo.php index 9764fde33d..dce6e025fa 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/XML/mdui/Logo.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/XML/mdui/Logo.php @@ -2,6 +2,8 @@ namespace SAML2\XML\mdui; +use Webmozart\Assert\Assert; + /** * Class for handling the Logo metadata extensions for login and discovery user interface * @@ -38,6 +40,7 @@ class Logo */ public $lang; + /** * Initialize a Logo. * @@ -59,12 +62,105 @@ public function __construct(\DOMElement $xml = null) if (!is_string($xml->textContent) || !strlen($xml->textContent)) { throw new \Exception('Missing url value for Logo.'); } - $this->url = $xml->textContent; - $this->width = (int) $xml->getAttribute('width'); - $this->height = (int) $xml->getAttribute('height'); - $this->lang = $xml->hasAttribute('xml:lang') ? $xml->getAttribute('xml:lang') : null; + $this->setUrl($xml->textContent); + $this->setWidth(intval($xml->getAttribute('width'))); + $this->setHeight(intval($xml->getAttribute('height'))); + if ($xml->hasAttribute('xml:lang')) { + $this->setLanguage($xml->getAttribute('xml:lang')); + } + } + + + /** + * Collect the value of the url-property + * @return string + */ + public function getUrl() + { + return $this->url; } + + /** + * Set the value of the url-property + * @param string $url + */ + public function setUrl($url) + { + Assert::string($url); + if (!filter_var(trim($url), FILTER_VALIDATE_URL) && substr(trim($url), 0, 5) !== 'data:') { + throw new \InvalidArgumentException('mdui:Logo is not a valid URL.'); + } + $this->url = $url; + } + + + /** + * Collect the value of the lang-property + * @return string + */ + public function getLanguage() + { + return $this->lang; + } + + + /** + * Set the value of the lang-property + * @param string $lang + * @return void + */ + public function setLanguage($lang) + { + Assert::string($lang); + $this->lang = $lang; + } + + + /** + * Collect the value of the height-property + * @return int + */ + public function getHeight() + { + return $this->height; + } + + + /** + * Set the value of the height-property + * @param int $height + * @return void + */ + public function setHeight($height) + { + Assert::integer($height); + $this->height = $height; + } + + + /** + * Collect the value of the width-property + * @return int + */ + public function getWidth() + { + return $this->width; + } + + + /** + * Set the value of the width-property + * @param int $width + * @return void + */ + public function setWidth($width) + { + Assert::integer($width); + $this->width = $width; + } + + /** * Convert this Logo to XML. * @@ -73,18 +169,18 @@ public function __construct(\DOMElement $xml = null) */ public function toXML(\DOMElement $parent) { - assert(is_int($this->width)); - assert(is_int($this->height)); - assert(is_string($this->url)); + Assert::integer($this->getWidth()); + Assert::integer($this->getHeight()); + Assert::string($this->getUrl()); $doc = $parent->ownerDocument; $e = $doc->createElementNS(Common::NS, 'mdui:Logo'); - $e->appendChild($doc->createTextNode($this->url)); - $e->setAttribute('width', (int) $this->width); - $e->setAttribute('height', (int) $this->height); - if (isset($this->lang)) { - $e->setAttribute('xml:lang', $this->lang); + $e->appendChild($doc->createTextNode($this->getUrl())); + $e->setAttribute('width', intval($this->getWidth())); + $e->setAttribute('height', intval($this->getHeight())); + if ($this->getLanguage() !== null) { + $e->setAttribute('xml:lang', $this->getLanguage()); } $parent->appendChild($e); diff --git a/vendor/simplesamlphp/saml2/src/SAML2/XML/mdui/UIInfo.php b/vendor/simplesamlphp/saml2/src/SAML2/XML/mdui/UIInfo.php index 191829285d..5327d0024c 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/XML/mdui/UIInfo.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/XML/mdui/UIInfo.php @@ -2,8 +2,10 @@ namespace SAML2\XML\mdui; +use DOMElement; use SAML2\Utils; use SAML2\XML\Chunk; +use Webmozart\Assert\Assert; /** * Class for handling the metadata extensions for login and discovery user interface @@ -20,49 +22,50 @@ class UIInfo * * @var \SAML2\XML\Chunk[] */ - public $children = array(); + public $children = []; /** * The DisplayName, as an array of language => translation. * * @var array */ - public $DisplayName = array(); + public $DisplayName = []; /** * The Description, as an array of language => translation. * * @var array */ - public $Description = array(); + public $Description = []; /** * The InformationURL, as an array of language => url. * * @var array */ - public $InformationURL = array(); + public $InformationURL = []; /** * The PrivacyStatementURL, as an array of language => url. * * @var array */ - public $PrivacyStatementURL = array(); + public $PrivacyStatementURL = []; /** * The Keywords, as an array of Keywords objects * * @var \SAML2\XML\mdui\Keywords[] */ - public $Keywords = array(); + public $Keywords = []; /** * The Logo, as an array of Logo objects * * @var \SAML2\XML\mdui\Logo[] */ - public $Logo = array(); + public $Logo = []; + /** * Create a UIInfo element. @@ -75,27 +78,209 @@ public function __construct(\DOMElement $xml = null) return; } - $this->DisplayName = Utils::extractLocalizedStrings($xml, Common::NS, 'DisplayName'); - $this->Description = Utils::extractLocalizedStrings($xml, Common::NS, 'Description'); - $this->InformationURL = Utils::extractLocalizedStrings($xml, Common::NS, 'InformationURL'); - $this->PrivacyStatementURL = Utils::extractLocalizedStrings($xml, Common::NS, 'PrivacyStatementURL'); + $this->setDisplayName(Utils::extractLocalizedStrings($xml, Common::NS, 'DisplayName')); + $this->setDescription(Utils::extractLocalizedStrings($xml, Common::NS, 'Description')); + $this->setInformationURL(Utils::extractLocalizedStrings($xml, Common::NS, 'InformationURL')); + $this->setPrivacyStatementURL(Utils::extractLocalizedStrings($xml, Common::NS, 'PrivacyStatementURL')); foreach (Utils::xpQuery($xml, './*') as $node) { if ($node->namespaceURI === Common::NS) { switch ($node->localName) { case 'Keywords': - $this->Keywords[] = new Keywords($node); + $this->addKeyword(new Keywords($node)); break; case 'Logo': - $this->Logo[] = new Logo($node); + $this->addLogo(new Logo($node)); break; } } else { - $this->children[] = new Chunk($node); + $this->addChildren(new Chunk($node)); } } } + + /** + * Collect the value of the Keywords-property + * @return \SAML2\XML\mdui\Keywords[] + */ + public function getKeywords() + { + return $this->Keywords; + } + + + /** + * Set the value of the Keywords-property + * @param \SAML2\XML\mdui\Keywords[] $keywords + * @return void + */ + public function setKeywords(array $keywords) + { + Assert::allIsInstanceOf($keywords, Keywords::class); + $this->Keywords = $keywords; + } + + + /** + * Add the value to the Keywords-property + * @param \SAML2\XML\mdui\Keywords $keyword + * @return void + */ + public function addKeyword(Keywords $keyword) + { + $this->Keywords[] = $keyword; + } + + + /** + * Collect the value of the DisplayName-property + * @return string[] + */ + public function getDisplayName() + { + return $this->DisplayName; + } + + + /** + * Set the value of the DisplayName-property + * @param array $displayName + * @return void + */ + public function setDisplayName(array $displayName) + { + $this->DisplayName = $displayName; + } + + + /** + * Collect the value of the Description-property + * @return string[] + */ + public function getDescription() + { + return $this->Description; + } + + + /** + * Set the value of the Description-property + * @param array $description + * @return void + */ + public function setDescription(array $description) + { + $this->Description = $description; + } + + + /** + * Collect the value of the InformationURL-property + * @return string[] + */ + public function getInformationURL() + { + return $this->InformationURL; + } + + + /** + * Set the value of the InformationURL-property + * @param array $informationURL + * @return void + */ + public function setInformationURL(array $informationURL) + { + $this->InformationURL = $informationURL; + } + + + /** + * Collect the value of the PrivacyStatementURL-property + * @return string[] + */ + public function getPrivacyStatementURL() + { + return $this->PrivacyStatementURL; + } + + + /** + * Set the value of the PrivacyStatementURL-property + * @param array $privacyStatementURL + * @return void + */ + public function setPrivacyStatementURL(array $privacyStatementURL) + { + $this->PrivacyStatementURL = $privacyStatementURL; + } + + + /** + * Collect the value of the Logo-property + * @return \SAML2\XML\mdui\Logo[] + */ + public function getLogo() + { + return $this->Logo; + } + + + /** + * Set the value of the Logo-property + * @param \SAML2\XML\mdui\Logo $logo + * @return void + */ + public function setLogo(array $logo) + { + $this->Logo = $logo; + } + + + /** + * Add the value to the Logo-property + * @param \SAML2\XML\mdui\Logo $logo + * @return void + */ + public function addLogo(Logo $logo) + { + $this->Logo[] = $logo; + } + + + /** + * Collect the value of the children-property + * @return \SAML2\XML\Chunk[] + */ + public function getChildren() + { + return $this->children; + } + + + /** + * Set the value of the childen-property + * @param array $children + * @return void + */ + public function setChildren(array $children) + { + $this->children = $children; + } + + + /** + * Add the value to the children-property + * @param \SAML2\XML\Chunk $child + * @return void + */ + public function addChildren(Chunk $child) + { + $this->children[] = $child; + } + + /** * Convert this UIInfo to XML. * @@ -104,45 +289,46 @@ public function __construct(\DOMElement $xml = null) */ public function toXML(\DOMElement $parent) { - assert(is_array($this->DisplayName)); - assert(is_array($this->InformationURL)); - assert(is_array($this->PrivacyStatementURL)); - assert(is_array($this->Keywords)); - assert(is_array($this->Logo)); - assert(is_array($this->children)); + Assert::isArray($displayName = $this->getDisplayName()); + Assert::isArray($description = $this->getDescription()); + Assert::isArray($informationURL = $this->getInformationURL()); + Assert::isArray($privacyStatementURL = $this->getPrivacyStatementURL()); + Assert::isArray($keywords = $this->getKeywords()); + Assert::isArray($logo = $this->getLogo()); + Assert::isArray($children = $this->getChildren()); $e = null; - if (!empty($this->DisplayName) - || !empty($this->Description) - || !empty($this->InformationURL) - || !empty($this->PrivacyStatementURL) - || !empty($this->Keywords) - || !empty($this->Logo) - || !empty($this->children)) { + if (!empty($displayName) + || !empty($description) + || !empty($informationURL) + || !empty($privacyStatementURL) + || !empty($keywords) + || !empty($logo) + || !empty($children)) { $doc = $parent->ownerDocument; $e = $doc->createElementNS(Common::NS, 'mdui:UIInfo'); $parent->appendChild($e); - Utils::addStrings($e, Common::NS, 'mdui:DisplayName', true, $this->DisplayName); - Utils::addStrings($e, Common::NS, 'mdui:Description', true, $this->Description); - Utils::addStrings($e, Common::NS, 'mdui:InformationURL', true, $this->InformationURL); - Utils::addStrings($e, Common::NS, 'mdui:PrivacyStatementURL', true, $this->PrivacyStatementURL); + Utils::addStrings($e, Common::NS, 'mdui:DisplayName', true, $this->getDisplayName()); + Utils::addStrings($e, Common::NS, 'mdui:Description', true, $this->getDescription()); + Utils::addStrings($e, Common::NS, 'mdui:InformationURL', true, $this->getInformationURL()); + Utils::addStrings($e, Common::NS, 'mdui:PrivacyStatementURL', true, $this->getPrivacyStatementURL()); - if (!empty($this->Keywords)) { - foreach ($this->Keywords as $child) { + if ($this->getKeywords() !== null) { + foreach ($this->getKeywords() as $child) { $child->toXML($e); } } - if (!empty($this->Logo)) { - foreach ($this->Logo as $child) { + if ($this->getLogo() !== null) { + foreach ($this->getLogo() as $child) { $child->toXML($e); } } - if (!empty($this->children)) { - foreach ($this->children as $child) { + if ($this->getChildren() !== null) { + foreach ($this->getChildren() as $child) { $child->toXML($e); } } diff --git a/vendor/simplesamlphp/saml2/src/SAML2/XML/saml/Attribute.php b/vendor/simplesamlphp/saml2/src/SAML2/XML/saml/Attribute.php index 2c5f447cbe..b516935111 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/XML/saml/Attribute.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/XML/saml/Attribute.php @@ -4,6 +4,7 @@ use SAML2\Constants; use SAML2\Utils; +use Webmozart\Assert\Assert; /** * Class representing SAML 2 Attribute. @@ -40,7 +41,8 @@ class Attribute * * @var \SAML2\XML\saml\AttributeValue[] */ - public $AttributeValue = array(); + public $AttributeValue = []; + /** * Initialize an Attribute. @@ -57,21 +59,120 @@ public function __construct(\DOMElement $xml = null) if (!$xml->hasAttribute('Name')) { throw new \Exception('Missing Name on Attribute.'); } - $this->Name = $xml->getAttribute('Name'); + $this->setName($xml->getAttribute('Name')); if ($xml->hasAttribute('NameFormat')) { - $this->NameFormat = $xml->getAttribute('NameFormat'); + $this->setNameFormat($xml->getAttribute('NameFormat')); } if ($xml->hasAttribute('FriendlyName')) { - $this->FriendlyName = $xml->getAttribute('FriendlyName'); + $this->setFriendlyName($xml->getAttribute('FriendlyName')); } foreach (Utils::xpQuery($xml, './saml_assertion:AttributeValue') as $av) { - $this->AttributeValue[] = new AttributeValue($av); + $this->addAttributeValue(new AttributeValue($av)); } } + + /** + * Collect the value of the Name-property + * @return string + */ + public function getName() + { + return $this->Name; + } + + + /** + * Set the value of the Name-property + * @param string $name + * @return void + */ + public function setName($name) + { + Assert::string($name); + $this->Name = $name; + } + + + /** + * Collect the value of the NameFormat-property + * @return string|null + */ + public function getNameFormat() + { + return $this->NameFormat; + } + + + /** + * Set the value of the NameFormat-property + * @param string|null $nameFormat + * @return void + */ + public function setNameFormat($nameFormat = null) + { + Assert::nullOrString($nameFormat); + $this->NameFormat = $nameFormat; + } + + + /** + * Collect the value of the FriendlyName-property + * @return string|null + */ + public function getFriendlyName() + { + return $this->FriendlyName; + } + + + /** + * Set the value of the FriendlyName-property + * @param string|null $friendlyName + * @return void + */ + public function setFriendlyName($friendlyName = null) + { + Assert::nullOrString($friendlyName); + $this->FriendlyName = $friendlyName; + } + + + /** + * Collect the value of the AttributeValue-property + * @return \SAML2\XML\saml\AttributeValue[] + */ + public function getAttributeValue() + { + return $this->AttributeValue; + } + + + /** + * Set the value of the AttributeValue-property + * @param array $attributeValue + * @return void + */ + public function setAttributeValue(array $attributeValue) + { + $this->AttributeValue = $attributeValue; + } + + + /** + * Add the value to the AttributeValue-property + * @param \SAML2\XML\saml\AttributeValue $attributeValue + * @return void + */ + public function addAttributeValue(AttributeValue $attributeValue) + { + $this->AttributeValue[] = $attributeValue; + } + + /** * Internal implementation of toXML. * This function allows RequestedAttribute to specify the element name and namespace. @@ -83,33 +184,34 @@ public function __construct(\DOMElement $xml = null) */ protected function toXMLInternal(\DOMElement $parent, $namespace, $name) { - assert(is_string($namespace)); - assert(is_string($name)); - assert(is_string($this->Name)); - assert(is_null($this->NameFormat) || is_string($this->NameFormat)); - assert(is_null($this->FriendlyName) || is_string($this->FriendlyName)); - assert(is_array($this->AttributeValue)); + Assert::string($namespace); + Assert::string($name); + Assert::string($this->getName()); + Assert::nullOrString($this->getNameFormat()); + Assert::nullOrString($this->getFriendlyName()); + Assert::isArray($this->getAttributeValue()); $e = $parent->ownerDocument->createElementNS($namespace, $name); $parent->appendChild($e); - $e->setAttribute('Name', $this->Name); + $e->setAttribute('Name', $this->getName()); - if (isset($this->NameFormat)) { + if ($this->getNameFormat() !== null) { $e->setAttribute('NameFormat', $this->NameFormat); } - if (isset($this->FriendlyName)) { - $e->setAttribute('FriendlyName', $this->FriendlyName); + if ($this->FriendlyName !== null) { + $e->setAttribute('FriendlyName', $this->getFriendlyName()); } - foreach ($this->AttributeValue as $av) { + foreach ($this->getAttributeValue() as $av) { $av->toXML($e); } return $e; } + /** * Convert this Attribute to XML. * diff --git a/vendor/simplesamlphp/saml2/src/SAML2/XML/saml/AttributeValue.php b/vendor/simplesamlphp/saml2/src/SAML2/XML/saml/AttributeValue.php index a4e7e25789..c696c243e1 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/XML/saml/AttributeValue.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/XML/saml/AttributeValue.php @@ -2,9 +2,11 @@ namespace SAML2\XML\saml; +use DOMElement; use SAML2\Constants; use SAML2\DOMDocumentFactory; use SAML2\Utils; +use Webmozart\Assert\Assert; /** * Serializable class representing an AttributeValue. @@ -20,6 +22,7 @@ class AttributeValue implements \Serializable */ public $element; + /** * Create an AttributeValue. * @@ -30,56 +33,78 @@ class AttributeValue implements \Serializable */ public function __construct($value) { - assert(is_string($value) || $value instanceof \DOMElement); + Assert::true(is_string($value) || $value instanceof DOMElement); if (is_string($value)) { $doc = DOMDocumentFactory::create(); - $this->element = $doc->createElementNS(Constants::NS_SAML, 'saml:AttributeValue'); - $this->element->setAttributeNS(Constants::NS_XSI, 'xsi:type', 'xs:string'); - $this->element->appendChild($doc->createTextNode($value)); + $this->setElement($doc->createElementNS(Constants::NS_SAML, 'saml:AttributeValue')); + $this->getElement()->setAttributeNS(Constants::NS_XSI, 'xsi:type', 'xs:string'); + $this->getElement()->appendChild($doc->createTextNode($value)); /* Make sure that the xs-namespace is available in the AttributeValue (for xs:string). */ - $this->element->setAttributeNS(Constants::NS_XS, 'xs:tmp', 'tmp'); - $this->element->removeAttributeNS(Constants::NS_XS, 'tmp'); - + $this->getElement()->setAttributeNS(Constants::NS_XS, 'xs:tmp', 'tmp'); + $this->getElement()->removeAttributeNS(Constants::NS_XS, 'tmp'); return; } if ($value->namespaceURI === Constants::NS_SAML && $value->localName === 'AttributeValue') { - $this->element = Utils::copyElement($value); - + $this->setElement(Utils::copyElement($value)); return; } $doc = DOMDocumentFactory::create(); - $this->element = $doc->createElementNS(Constants::NS_SAML, 'saml:AttributeValue'); + $this->setElement($doc->createElementNS(Constants::NS_SAML, 'saml:AttributeValue')); Utils::copyElement($value, $this->element); } + + /** + * Collect the value of the element-property + * @return \DOMElement + */ + public function getElement() + { + return $this->element; + } + + + /** + * Set the value of the element-property + * @param \DOMElement $element + * @return void + */ + public function setElement(DOMElement $element) + { + $this->element = $element; + } + + /** * Append this attribute value to an element. * * @param \DOMElement $parent The element we should append this attribute value to. * @return \DOMElement The generated AttributeValue element. */ - public function toXML(\DOMElement $parent) + public function toXML(DOMElement $parent) { - assert($this->element instanceof \DOMElement); - assert($this->element->namespaceURI === \SAML2\Constants::NS_SAML && $this->element->localName === "AttributeValue"); - - $v = Utils::copyElement($this->element, $parent); + Assert::isInstanceOf($this->getElement(), DOMElement::class); + Assert::same($this->getElement()->namespaceURI, Constants::NS_SAML); + Assert::same($this->element->localName, "AttributeValue"); - return $v; + return Utils::copyElement($this->getElement(), $parent); } + /** * Returns a plain text content of the attribute value. + * @return string */ public function getString() { return $this->element->textContent; } + /** * Convert this attribute value to a string. * @@ -89,12 +114,12 @@ public function getString() */ public function __toString() { - assert($this->element instanceof \DOMElement); + Assert::isInstanceOf($this->getElement(), DOMElement::class); - $doc = $this->element->ownerDocument; + $doc = $this->getElement()->ownerDocument; $ret = ''; - foreach ($this->element->childNodes as $c) { + foreach ($this->getElement()->childNodes as $c) { $ret .= $doc->saveXML($c); } @@ -109,7 +134,7 @@ public function __toString() */ public function serialize() { - return serialize($this->element->ownerDocument->saveXML($this->element)); + return serialize($this->getElement()->ownerDocument->saveXML($this->getElement())); } @@ -117,10 +142,11 @@ public function serialize() * Un-serialize this AttributeValue. * * @param string $serialized The serialized AttributeValue. + * @return void */ public function unserialize($serialized) { $doc = DOMDocumentFactory::fromString(unserialize($serialized)); - $this->element = $doc->documentElement; + $this->setElement($doc->documentElement); } } diff --git a/vendor/simplesamlphp/saml2/src/SAML2/XML/saml/BaseIDType.php b/vendor/simplesamlphp/saml2/src/SAML2/XML/saml/BaseIDType.php index 7338a11ff5..6299ec6991 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/XML/saml/BaseIDType.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/XML/saml/BaseIDType.php @@ -8,9 +8,9 @@ namespace SAML2\XML\saml; - use SAML2\Constants; use SAML2\DOMDocumentFactory; +use Webmozart\Assert\Assert; abstract class BaseIDType { @@ -43,6 +43,11 @@ abstract class BaseIDType */ protected $nodeName; + /** + * @var \DOMElement + */ + protected $element; + /** * Initialize a saml:BaseID, either from scratch or from an existing \DOMElement. @@ -58,25 +63,69 @@ public function __construct(\DOMElement $xml = null) $this->element = $xml; if ($xml->hasAttribute('NameQualifier')) { - $this->NameQualifier = $xml->getAttribute('NameQualifier'); + $this->setNameQualifier($xml->getAttribute('NameQualifier')); } if ($xml->hasAttribute('SPNameQualifier')) { - $this->SPNameQualifier = $xml->getAttribute('SPNameQualifier'); + $this->setSPNameQualifier($xml->getAttribute('SPNameQualifier')); } } + /** + * Collect the value of the NameQualifier-property + * @return string|null + */ + public function getNameQualifier() + { + return $this->NameQualifier; + } + + + /** + * Set the value of the NameQualifier-property + * @param string|null $nameQualifier + * @return void + */ + public function setNameQualifier($nameQualifier = null) + { + Assert::nullOrString($nameQualifier); + $this->NameQualifier = $nameQualifier; + } + + + /** + * Collect the value of the SPNameQualifier-property + * @return string|null + */ + public function getSPNameQualifier() + { + return $this->SPNameQualifier; + } + + + /** + * Set the value of the SPNameQualifier-property + * @param string|null $spNameQualifier + * @return void + */ + public function setSPNameQualifier($spNameQualifier = null) + { + Assert::nullOrString($spNameQualifier); + $this->SPNameQualifier = $spNameQualifier; + } + + /** * Convert this BaseID to XML. * - * @param \DOMElement $element The element we are converting to XML. + * @param \DOMElement $parent The element we are converting to XML. * @return \DOMElement The XML element after adding the data corresponding to this BaseID. */ public function toXML(\DOMElement $parent = null) { - assert(is_string($this->NameQualifier) || is_null($this->NameQualifier)); - assert(is_string($this->SPNameQualifier) || is_null($this->SPNameQualifier)); + Assert::nullOrString($this->getNameQualifier()); + Assert::nullOrString($this->getSPNameQualifier()); if ($parent === null) { $parent = DOMDocumentFactory::create(); @@ -87,12 +136,12 @@ public function toXML(\DOMElement $parent = null) $element = $doc->createElementNS(Constants::NS_SAML, $this->nodeName); $parent->appendChild($element); - if ($this->NameQualifier !== null) { - $element->setAttribute('NameQualifier', $this->NameQualifier); + if ($this->getNameQualifier() !== null) { + $element->setAttribute('NameQualifier', $this->getNameQualifier()); } - if ($this->SPNameQualifier !== null) { - $element->setAttribute('SPNameQualifier', $this->SPNameQualifier); + if ($this->getSPNameQualifier() !== null) { + $element->setAttribute('SPNameQualifier', $this->getSPNameQualifier()); } return $element; diff --git a/vendor/simplesamlphp/saml2/src/SAML2/XML/saml/Issuer.php b/vendor/simplesamlphp/saml2/src/SAML2/XML/saml/Issuer.php index 7684b059a4..5c8d283506 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/XML/saml/Issuer.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/XML/saml/Issuer.php @@ -4,6 +4,7 @@ use SAML2\Constants; use SAML2\DOMDocumentFactory; +use Webmozart\Assert\Assert; /** * Class representing the saml:Issuer element. @@ -13,28 +14,6 @@ */ class Issuer extends NameIDType { - - /** - * The format of this NameIDType. - * - * Defaults to urn:oasis:names:tc:SAML:2.0:nameid-format:entity: - * - * Indicates that the content of the element is the identifier of an entity that provides SAML-based services (such - * as a SAML authority, requester, or responder) or is a participant in SAML profiles (such as a service provider - * supporting the browser SSO profile). Such an identifier can be used in the <Issuer> element to identify the - * issuer of a SAML request, response, or assertion, or within the <NameID> element to make assertions about system - * entities that can issue SAML requests, responses, and assertions. It can also be used in other elements and - * attributes whose purpose is to identify a system entity in various protocol exchanges. - * - * The syntax of such an identifier is a URI of not more than 1024 characters in length. It is RECOMMENDED that a - * system entity use a URL containing its own domain name to identify itself. - * - * @see saml-core-2.0-os - * - * @var string - */ - public $Format = Constants::NAMEID_ENTITY; - /** * Set the name of this XML element to "saml:Issuer" * @@ -42,20 +21,72 @@ class Issuer extends NameIDType */ protected $nodeName = 'saml:Issuer'; - /* - * - * if $this->SAML2IssuerShowAll is set false - * From saml-core-2.0-os 8.3.6, when the entity Format is used: "The NameQualifier, SPNameQualifier, and + /** + * if $this->SAML2IssuerShowAll is set false + * From saml-core-2.0-os 8.3.6, when the entity Format is used: "The NameQualifier, SPNameQualifier, and * SPProvidedID attributes MUST be omitted." * * if $this->SAML2IssuerShowAll is set true * when the entity Format is used: "The NameQualifier, SPNameQualifier, and SPProvidedID attributes are not omitted" * @see saml-core-2.0-os 8.3.6 - * + * * @var boolean */ public $Saml2IssuerShowAll = false; //setting true break saml-core-2.0-os 8.3.6 - + + + /** + * Initialize a saml:NameIDType, either from scratch or from an existing \DOMElement. + * + * @param \DOMElement|null $xml The XML element we should load, if any. + */ + public function __construct(\DOMElement $xml = null) + { + /** + * The format of this NameIDType. + * + * Defaults to urn:oasis:names:tc:SAML:2.0:nameid-format:entity: + * + * Indicates that the content of the element is the identifier of an entity that provides SAML-based services (such + * as a SAML authority, requester, or responder) or is a participant in SAML profiles (such as a service provider + * supporting the browser SSO profile). Such an identifier can be used in the <Issuer> element to identify the + * issuer of a SAML request, response, or assertion, or within the <NameID> element to make assertions about system + * entities that can issue SAML requests, responses, and assertions. It can also be used in other elements and + * attributes whose purpose is to identify a system entity in various protocol exchanges. + * + * The syntax of such an identifier is a URI of not more than 1024 characters in length. It is RECOMMENDED that a + * system entity use a URL containing its own domain name to identify itself. + * + * @see saml-core-2.0-os + * + * @var string + */ + $this->setFormat(Constants::NAMEID_ENTITY); + + parent::__construct($xml); + } + + + /** + * Collect the value of the Saml2IssuerShowAll-property + * @return boolean + */ + public function isSaml2IssuerShowAll() + { + return $this->Saml2IssuerShowAll; + } + + + /** + * Set the value of the Saml2IssuerShowAll-property + * @param boolean $saml2IssuerShowAll + * @return void + */ + public function setSaml2IssuerShowAll($saml2IssuerShowAll) + { + Assert::boolean($saml2IssuerShowAll); + $this->Saml2IssuerShowAll = $saml2IssuerShowAll; + } /** @@ -67,16 +98,17 @@ class Issuer extends NameIDType */ public function toXML(\DOMElement $parent = null) { - - if ((($this->Saml2IssuerShowAll) && ($this->Format === Constants::NAMEID_ENTITY)) || ($this->Format !== Constants::NAMEID_ENTITY)) { + if (($this->isSaml2IssuerShowAll() && ($this->getFormat() === Constants::NAMEID_ENTITY)) + || ($this->getFormat() !== Constants::NAMEID_ENTITY) + ) { return parent::toXML($parent); } /* - * if $this->SAML2IssuerShowAll is set false + * if $this->isSaml2IssuerShowAll() is set false * From saml-core-2.0-os 8.3.6, when the entity Format is used: "The NameQualifier, SPNameQualifier, and * SPProvidedID attributes MUST be omitted." - * if $this->SAML2IssuerShowAll is set true when the entity Format is used: "The NameQualifier, SPNameQualifier, and + * if $this->isSaml2IssuerShowAll() is set true when the entity Format is used: "The NameQualifier, SPNameQualifier, and * SPProvidedID attributes are not omitted." */ @@ -89,7 +121,7 @@ public function toXML(\DOMElement $parent = null) $element = $doc->createElementNS(Constants::NS_SAML, 'saml:Issuer'); $parent->appendChild($element); - $value = $element->ownerDocument->createTextNode($this->value); + $value = $element->ownerDocument->createTextNode($this->getValue()); $element->appendChild($value); return $element; diff --git a/vendor/simplesamlphp/saml2/src/SAML2/XML/saml/NameID.php b/vendor/simplesamlphp/saml2/src/SAML2/XML/saml/NameID.php index 59db4b5eb4..c53dc9bf4a 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/XML/saml/NameID.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/XML/saml/NameID.php @@ -2,7 +2,6 @@ namespace SAML2\XML\saml; - /** * Class representing the saml:NameID element. * diff --git a/vendor/simplesamlphp/saml2/src/SAML2/XML/saml/NameIDType.php b/vendor/simplesamlphp/saml2/src/SAML2/XML/saml/NameIDType.php index d2b9abce7c..cc869f067d 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/XML/saml/NameIDType.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/XML/saml/NameIDType.php @@ -1,4 +1,5 @@ <?php + /** * SAML NameIDType abstract data type. * @@ -8,6 +9,7 @@ namespace SAML2\XML\saml; +use Webmozart\Assert\Assert; abstract class NameIDType extends BaseIDType { @@ -63,14 +65,80 @@ public function __construct(\DOMElement $xml = null) } if ($xml->hasAttribute('Format')) { - $this->Format = $xml->getAttribute('Format'); + $this->setFormat($xml->getAttribute('Format')); } if ($xml->hasAttribute('SPProvidedID')) { - $this->SPProvidedID = $xml->getAttribute('SPProvidedID'); + $this->setSPProvidedID($xml->getAttribute('SPProvidedID')); } - $this->value = trim($xml->textContent); + $this->setValue(trim($xml->textContent)); + } + + + /** + * Collect the value of the Format-property + * @return string|null + */ + public function getFormat() + { + return $this->Format; + } + + + /** + * Set the value of the Format-property + * @param string|null $format + * @return void + */ + public function setFormat($format = null) + { + Assert::nullOrString($format); + $this->Format = $format; + } + + + /** + * Collect the value of the value-property + * @return string|null + */ + public function getValue() + { + return $this->value; + } + + + /** + * Set the value of the value-property + * @param string|null $value + * @return void + */ + public function setValue($value) + { + Assert::nullOrString($value); + $this->value = $value; + } + + + /** + * Collect the value of the SPProvidedID-property + * @return string|null + */ + public function getSPProvidedID() + { + return $this->SPProvidedID; + } + + + /** + * Set the value of the SPProvidedID-property + * @param string|null $spProvidedID + * @return void + */ + public function setSPProvidedID($spProvidedID) + { + Assert::nullOrString($spProvidedID); + $this->SPProvidedID = $spProvidedID; } @@ -78,9 +146,8 @@ public function __construct(\DOMElement $xml = null) * Create a \SAML2\XML\saml\NameID object from an array with its contents. * * @param array $nameId An array whose keys correspond to the fields of a NameID. - * @return \SAML2\XML\saml\NameID The corresponding NameID object. - * * @throws \InvalidArgumentException If the array does not contain the "Value" key. + * @return \SAML2\XML\saml\NameID The corresponding NameID object. * * @deprecated */ @@ -90,19 +157,19 @@ public static function fromArray(array $nameId) if (!array_key_exists('Value', $nameId)) { throw new \InvalidArgumentException('Missing "Value" in array, cannot create NameID from it.'); } - $nid->value = $nameId['Value']; + $nid->setValue($nameId['Value']); if (array_key_exists('NameQualifier', $nameId) && $nameId['NameQualifier'] !== null) { - $nid->NameQualifier = $nameId['NameQualifier']; + $nid->setNameQualifier($nameId['NameQualifier']); } if (array_key_exists('SPNameQualifier', $nameId) && $nameId['SPNameQualifier'] !== null) { - $nid->SPNameQualifier = $nameId['SPNameQualifier']; + $nid->setSPNameQualifier($nameId['SPNameQualifier']); } - if (array_key_exists('SPProvidedID', $nameId) && $nameId['SPProvidedId'] !== null) { - $nid->SPProvidedID = $nameId['SPProvidedID']; + if (array_key_exists('SPProvidedID', $nameId) && $nameId['SPProvidedID'] !== null) { + $nid->setSPProvidedID($nameId['SPProvidedID']); } if (array_key_exists('Format', $nameId) && $nameId['Format'] !== null) { - $nid->Format = $nameId['Format']; + $nid->setFormat($nameId['Format']); } return $nid; } @@ -111,27 +178,26 @@ public static function fromArray(array $nameId) /** * Convert this NameIDType to XML. * - * @param \DOMElement $element The element we are converting to XML. - * + * @param \DOMElement $parent The element we are converting to XML. * @return \DOMElement The XML element after adding the data corresponding to this NameIDType. */ public function toXML(\DOMElement $parent = null) { - assert(is_string($this->Format) || is_null($this->Format)); - assert(is_string($this->SPProvidedID) || is_null($this->SPProvidedID)); - assert(is_string($this->value)); + Assert::nullOrString($this->getFormat()); + Assert::nullOrString($this->getSPProvidedID()); + Assert::string($this->getValue()); $element = parent::toXML($parent); - if ($this->Format !== null) { - $element->setAttribute('Format', $this->Format); + if ($this->getFormat() !== null) { + $element->setAttribute('Format', $this->getFormat()); } - if ($this->SPProvidedID !== null) { - $element->setAttribute('SPProvidedID', $this->SPProvidedID); + if ($this->getSPProvidedID() !== null) { + $element->setAttribute('SPProvidedID', $this->getSPProvidedID()); } - $value = $element->ownerDocument->createTextNode($this->value); + $value = $element->ownerDocument->createTextNode($this->getValue()); $element->appendChild($value); return $element; diff --git a/vendor/simplesamlphp/saml2/src/SAML2/XML/saml/SubjectConfirmation.php b/vendor/simplesamlphp/saml2/src/SAML2/XML/saml/SubjectConfirmation.php index 86a124aa62..dced4035d7 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/XML/saml/SubjectConfirmation.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/XML/saml/SubjectConfirmation.php @@ -4,6 +4,7 @@ use SAML2\Constants; use SAML2\Utils; +use Webmozart\Assert\Assert; /** * Class representing SAML 2 SubjectConfirmation element. @@ -33,6 +34,7 @@ class SubjectConfirmation */ public $SubjectConfirmationData; + /** * Initialize (and parse? a SubjectConfirmation element. * @@ -48,23 +50,88 @@ public function __construct(\DOMElement $xml = null) if (!$xml->hasAttribute('Method')) { throw new \Exception('SubjectConfirmation element without Method attribute.'); } - $this->Method = $xml->getAttribute('Method'); + $this->setMethod($xml->getAttribute('Method')); $nid = Utils::xpQuery($xml, './saml_assertion:NameID'); if (count($nid) > 1) { throw new \Exception('More than one NameID in a SubjectConfirmation element.'); } elseif (!empty($nid)) { - $this->NameID = new NameID($nid[0]); + $this->setNameID(new NameID($nid[0])); } $scd = Utils::xpQuery($xml, './saml_assertion:SubjectConfirmationData'); if (count($scd) > 1) { throw new \Exception('More than one SubjectConfirmationData child in a SubjectConfirmation element.'); } elseif (!empty($scd)) { - $this->SubjectConfirmationData = new SubjectConfirmationData($scd[0]); + $this->setSubjectConfirmationData(new SubjectConfirmationData($scd[0])); } } + + /** + * Collect the value of the Method-property + * @return string + */ + public function getMethod() + { + return $this->Method; + } + + + /** + * Set the value of the Method-property + * @param string $method + * @return void + */ + public function setMethod($method) + { + Assert::string($method); + $this->Method = $method; + } + + + /** + * Collect the value of the NameID-property + * @return \SAML2\XML\saml\NameID + */ + public function getNameID() + { + return $this->NameID; + } + + + /** + * Set the value of the NameID-property + * @param \SAML2\XML\saml\NameID $nameId + * @return void + */ + public function setNameID(NameID $nameId) + { + $this->NameID = $nameId; + } + + + /** + * Collect the value of the SubjectConfirmationData-property + * @return \SAML2\XML\saml\SubjectConfirmationData|null + */ + public function getSubjectConfirmationData() + { + return $this->SubjectConfirmationData; + } + + + /** + * Set the value of the SubjectConfirmationData-property + * @param \SAML2\XML\saml\SubjectConfirmationData|null $subjectConfirmationData + * @return void + */ + public function setSubjectConfirmationData($subjectConfirmationData = null) + { + $this->SubjectConfirmationData = $subjectConfirmationData; + } + + /** * Convert this element to XML. * @@ -73,20 +140,20 @@ public function __construct(\DOMElement $xml = null) */ public function toXML(\DOMElement $parent) { - assert(is_string($this->Method)); - assert(is_null($this->NameID) || $this->NameID instanceof NameID); - assert(is_null($this->SubjectConfirmationData) || $this->SubjectConfirmationData instanceof SubjectConfirmationData); + Assert::string($this->getMethod()); + Assert::nullOrIsInstanceOf($this->getNameID(), NameID::class); + Assert::nullOrIsInstanceOf($this->getSubjectConfirmationData(), SubjectConfirmationData::class); $e = $parent->ownerDocument->createElementNS(Constants::NS_SAML, 'saml:SubjectConfirmation'); $parent->appendChild($e); - $e->setAttribute('Method', $this->Method); + $e->setAttribute('Method', $this->getMethod()); - if (isset($this->NameID)) { - $this->NameID->toXML($e); + if ($this->getNameID() !== null) { + $this->getNameID()->toXML($e); } - if (isset($this->SubjectConfirmationData)) { - $this->SubjectConfirmationData->toXML($e); + if ($this->getSubjectConfirmationData() !== null) { + $this->getSubjectConfirmationData()->toXML($e); } return $e; diff --git a/vendor/simplesamlphp/saml2/src/SAML2/XML/saml/SubjectConfirmationData.php b/vendor/simplesamlphp/saml2/src/SAML2/XML/saml/SubjectConfirmationData.php index c52631e18a..e3937d7d44 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/XML/saml/SubjectConfirmationData.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/XML/saml/SubjectConfirmationData.php @@ -7,6 +7,7 @@ use SAML2\Utils; use SAML2\XML\Chunk; use SAML2\XML\ds\KeyInfo; +use Webmozart\Assert\Assert; /** * Class representing SAML 2 SubjectConfirmationData element. @@ -58,7 +59,154 @@ class SubjectConfirmationData * * @var (\SAML2\XML\ds\KeyInfo|\SAML2\XML\Chunk)[] */ - public $info = array(); + public $info = []; + + + /** + * Collect the value of the NotBefore-property + * @return int|null + */ + public function getNotBefore() + { + return $this->NotBefore; + } + + + /** + * Set the value of the NotBefore-property + * @param int|null $notBefore + * @return void + */ + public function setNotBefore($notBefore = null) + { + Assert::nullOrInteger($notBefore); + $this->NotBefore = $notBefore; + } + + + /** + * Collect the value of the NotOnOrAfter-property + * @return int|null + */ + public function getNotOnOrAfter() + { + return $this->NotOnOrAfter; + } + + + /** + * Set the value of the NotOnOrAfter-property + * @param int|null $notOnOrAfter + * @return void + */ + public function setNotOnOrAfter($notOnOrAfter = null) + { + Assert::nullOrInteger($notOnOrAfter); + $this->NotOnOrAfter = $notOnOrAfter; + } + + + /** + * Collect the value of the Recipient-property + * @return string|null + */ + public function getRecipient() + { + return $this->Recipient; + } + + + /** + * Set the value of the Recipient-property + * @param string|null $recipient + * @return void + */ + public function setRecipient($recipient = null) + { + Assert::nullOrString($recipient); + $this->Recipient = $recipient; + } + + + /** + * Collect the value of the InResponseTo-property + * @return string|null + */ + public function getInResponseTo() + { + return $this->InResponseTo; + } + + + /** + * Set the value of the InResponseTo-property + * @param string|null $inResponseTo + * @return void + */ + public function setInResponseTo($inResponseTo = null) + { + Assert::nullOrString($inResponseTo); + $this->InResponseTo = $inResponseTo; + } + + + /** + * Collect the value of the Address-property + * @return string|null + */ + public function getAddress() + { + return $this->Address; + } + + + /** + * Set the value of the Address-property + * @param string|null $address + * @return void + */ + public function setAddress($address = null) + { + Assert::nullOrstring($address); + if (!is_null($address) && !filter_var($address, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4 | FILTER_FLAG_IPV6)) { + Utils::getContainer()->getLogger()->warning(sprintf('Provided argument (%s) is not a valid IP address.', $address)); + } + $this->Address = $address; + } + + + /** + * Collect the value of the info-property + * @return (\SAML2\XML\ds\KeyInfo|\SAML2\XML\Chunk)[] + */ + public function getInfo() + { + return $this->info; + } + + + /** + * Set the value of the info-property + * @param (\SAML2\XML\ds\KeyInfo|\SAML2\XML\Chunk)[] $info + * @return void + */ + public function setInfo(array $info) + { + $this->info = $info; + } + + + /** + * Add the value to the info-property + * @param \SAML2\XML\Chunk|\SAML2\XML\ds\KeyInfo $info + * @return void + */ + public function addInfo($info) + { + Assert::isInstanceOfAny($info, [Chunk::class, KeyInfo::class]); + $this->info[] = $info; + } + /** * Initialize (and parse) a SubjectConfirmationData element. @@ -72,39 +220,40 @@ public function __construct(\DOMElement $xml = null) } if ($xml->hasAttribute('NotBefore')) { - $this->NotBefore = Utils::xsDateTimeToTimestamp($xml->getAttribute('NotBefore')); + $this->setNotBefore(Utils::xsDateTimeToTimestamp($xml->getAttribute('NotBefore'))); } if ($xml->hasAttribute('NotOnOrAfter')) { - $this->NotOnOrAfter = Utils::xsDateTimeToTimestamp($xml->getAttribute('NotOnOrAfter')); + $this->setNotOnOrAfter(Utils::xsDateTimeToTimestamp($xml->getAttribute('NotOnOrAfter'))); } if ($xml->hasAttribute('Recipient')) { - $this->Recipient = $xml->getAttribute('Recipient'); + $this->setRecipient($xml->getAttribute('Recipient')); } if ($xml->hasAttribute('InResponseTo')) { - $this->InResponseTo = $xml->getAttribute('InResponseTo'); + $this->setInResponseTo($xml->getAttribute('InResponseTo')); } if ($xml->hasAttribute('Address')) { - $this->Address = $xml->getAttribute('Address'); + $this->setAddress($xml->getAttribute('Address')); } for ($n = $xml->firstChild; $n !== null; $n = $n->nextSibling) { if (!($n instanceof \DOMElement)) { continue; } if ($n->namespaceURI !== XMLSecurityDSig::XMLDSIGNS) { - $this->info[] = new Chunk($n); + $this->addInfo(new Chunk($n)); continue; } switch ($n->localName) { case 'KeyInfo': - $this->info[] = new KeyInfo($n); + $this->addInfo(new KeyInfo($n)); break; default: - $this->info[] = new Chunk($n); + $this->addInfo(new Chunk($n)); break; } } } + /** * Convert this element to XML. * @@ -113,32 +262,32 @@ public function __construct(\DOMElement $xml = null) */ public function toXML(\DOMElement $parent) { - assert(is_null($this->NotBefore) || is_int($this->NotBefore)); - assert(is_null($this->NotOnOrAfter) || is_int($this->NotOnOrAfter)); - assert(is_null($this->Recipient) || is_string($this->Recipient)); - assert(is_null($this->InResponseTo) || is_string($this->InResponseTo)); - assert(is_null($this->Address) || is_string($this->Address)); + Assert::nullOrInteger($this->getNotBefore()); + Assert::nullOrInteger($this->getNotOnOrAfter()); + Assert::nullOrString($this->getRecipient()); + Assert::nullOrString($this->getInResponseTo()); + Assert::nullOrString($this->getAddress()); $e = $parent->ownerDocument->createElementNS(Constants::NS_SAML, 'saml:SubjectConfirmationData'); $parent->appendChild($e); - if (isset($this->NotBefore)) { - $e->setAttribute('NotBefore', gmdate('Y-m-d\TH:i:s\Z', $this->NotBefore)); + if ($this->getNotBefore() !== null) { + $e->setAttribute('NotBefore', gmdate('Y-m-d\TH:i:s\Z', $this->getNotBefore())); } - if (isset($this->NotOnOrAfter)) { - $e->setAttribute('NotOnOrAfter', gmdate('Y-m-d\TH:i:s\Z', $this->NotOnOrAfter)); + if ($this->getNotOnOrAfter() !== null) { + $e->setAttribute('NotOnOrAfter', gmdate('Y-m-d\TH:i:s\Z', $this->getNotOnOrAfter())); } - if (isset($this->Recipient)) { - $e->setAttribute('Recipient', $this->Recipient); + if ($this->getRecipient() !== null) { + $e->setAttribute('Recipient', $this->getRecipient()); } - if (isset($this->InResponseTo)) { - $e->setAttribute('InResponseTo', $this->InResponseTo); + if ($this->getInResponseTo() !== null) { + $e->setAttribute('InResponseTo', $this->getInResponseTo()); } - if (isset($this->Address)) { - $e->setAttribute('Address', $this->Address); + if ($this->getAddress() !== null) { + $e->setAttribute('Address', $this->getAddress()); } /** @var \SAML2\XML\ds\KeyInfo|\SAML2\XML\Chunk $n */ - foreach ($this->info as $n) { + foreach ($this->getInfo() as $n) { $n->toXML($e); } diff --git a/vendor/simplesamlphp/saml2/src/SAML2/XML/samlp/Extensions.php b/vendor/simplesamlphp/saml2/src/SAML2/XML/samlp/Extensions.php index 9f6db1f8cd..61e805fa3e 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/XML/samlp/Extensions.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/XML/samlp/Extensions.php @@ -21,7 +21,7 @@ class Extensions */ public static function getList(\DOMElement $parent) { - $ret = array(); + $ret = []; foreach (Utils::xpQuery($parent, './saml_protocol:Extensions/*') as $node) { $ret[] = new Chunk($node); } @@ -29,11 +29,13 @@ public static function getList(\DOMElement $parent) return $ret; } + /** * Add a list of Extensions to the given element. * * @param \DOMElement $parent The element we should add the extensions to. * @param \SAML2\XML\Chunk[] $extensions List of extension objects. + * @return void */ public static function addList(\DOMElement $parent, array $extensions) { diff --git a/vendor/simplesamlphp/saml2/src/SAML2/XML/shibmd/Scope.php b/vendor/simplesamlphp/saml2/src/SAML2/XML/shibmd/Scope.php index 6f9c348ac0..dad3e310e6 100644 --- a/vendor/simplesamlphp/saml2/src/SAML2/XML/shibmd/Scope.php +++ b/vendor/simplesamlphp/saml2/src/SAML2/XML/shibmd/Scope.php @@ -3,6 +3,7 @@ namespace SAML2\XML\shibmd; use SAML2\Utils; +use Webmozart\Assert\Assert; /** * Class which represents the Scope element found in Shibboleth metadata. @@ -31,6 +32,7 @@ class Scope */ public $regexp = false; + /** * Create a Scope. * @@ -42,10 +44,55 @@ public function __construct(\DOMElement $xml = null) return; } - $this->scope = $xml->textContent; - $this->regexp = Utils::parseBoolean($xml, 'regexp', false); + $this->setScope($xml->textContent); + $this->setIsRegexpScope(Utils::parseBoolean($xml, 'regexp', false)); + } + + + /** + * Collect the value of the scope-property + * @return string + */ + public function getScope() + { + return $this->scope; + } + + + /** + * Set the value of the scope-property + * @param string $scope + * @return void + */ + public function setScope($scope) + { + Assert::string($scope); + $this->scope = $scope; + } + + + /** + * Collect the value of the regexp-property + * @return boolean + */ + public function isRegexpScope() + { + return $this->regexp; } + + /** + * Set the value of the regexp-property + * @param boolean $regexp + * @return void + */ + public function setIsRegexpScope($regexp) + { + Assert::boolean($regexp); + $this->regexp = $regexp; + } + + /** * Convert this Scope to XML. * @@ -54,17 +101,17 @@ public function __construct(\DOMElement $xml = null) */ public function toXML(\DOMElement $parent) { - assert(is_string($this->scope)); - assert(is_bool($this->regexp) || is_null($this->regexp)); + Assert::string($this->getScope()); + Assert::nullOrBoolean($this->isRegexpScope()); $doc = $parent->ownerDocument; $e = $doc->createElementNS(Scope::NS, 'shibmd:Scope'); $parent->appendChild($e); - $e->appendChild($doc->createTextNode($this->scope)); + $e->appendChild($doc->createTextNode($this->getScope())); - if ($this->regexp === true) { + if ($this->isRegexpScope() === true) { $e->setAttribute('regexp', 'true'); } else { $e->setAttribute('regexp', 'false'); diff --git a/vendor/simplesamlphp/saml2/src/_autoload.php b/vendor/simplesamlphp/saml2/src/_autoload.php index 281e506e7d..1061c3b9c2 100644 --- a/vendor/simplesamlphp/saml2/src/_autoload.php +++ b/vendor/simplesamlphp/saml2/src/_autoload.php @@ -15,9 +15,9 @@ function SAML2_autoload($className) { // handle classes that have been renamed - $renamed = array( + $renamed = [ 'SAML2_Const' => 'SAML2_Constants', - ); + ]; $oldName = $className; if (array_key_exists($className, $renamed)) { $className = $renamed[$className]; @@ -29,7 +29,6 @@ function SAML2_autoload($className) $newName = '\\'.str_replace('_', '\\', $className); class_alias($newName, $oldName); } - } spl_autoload_register('SAML2_autoload'); diff --git a/vendor/simplesamlphp/simplesamlphp/.github/ISSUE_TEMPLATE/bug_report.md b/vendor/simplesamlphp/simplesamlphp/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000000..9e6459bfce --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,26 @@ +--- +name: Bug report +about: Create a report to help us improve + +--- + +# **Help us to keep this issue-tracker clean! For questions or support, please refer to our [mailing lists](https://simplesamlphp.org/lists)** + +**Describe the bug** +A clear and concise description of what the bug is. + +**To Reproduce** +Steps to reproduce the behavior: +1. Go to '...' +2. Click on '....' +3. Scroll down to '....' +4. See error + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Screenshots or logs** +If applicable, add screenshots and/or log files to help explain your problem. + +**Additional context** +Add any other context about the problem here. diff --git a/vendor/simplesamlphp/simplesamlphp/.github/ISSUE_TEMPLATE/feature_request.md b/vendor/simplesamlphp/simplesamlphp/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000000..066b2d920a --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,17 @@ +--- +name: Feature request +about: Suggest an idea for this project + +--- + +**Is your feature request related to a problem? Please describe.** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +**Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered. + +**Additional context** +Add any other context or screenshots about the feature request here. diff --git a/vendor/simplesamlphp/simplesamlphp/.php_cs.dist b/vendor/simplesamlphp/simplesamlphp/.php_cs.dist new file mode 100644 index 0000000000..b2f3d6e4dd --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/.php_cs.dist @@ -0,0 +1,19 @@ +<?php + +$finder = PhpCsFixer\Finder::create() + ->exclude(__DIR__ . '/www/resources') + ->in([ + __DIR__ . '/lib', + __DIR__ . '/modules', + __DIR__ . '/templates', + __DIR__ . '/tests', + __DIR__ . '/www', + ]) +; + +return PhpCsFixer\Config::create() + ->setRules([ + '@PSR2' => true, + ]) + ->setFinder($finder) +; diff --git a/vendor/simplesamlphp/simplesamlphp/CONTRIBUTING.md b/vendor/simplesamlphp/simplesamlphp/CONTRIBUTING.md index 8a16e72314..d16eec4696 100644 --- a/vendor/simplesamlphp/simplesamlphp/CONTRIBUTING.md +++ b/vendor/simplesamlphp/simplesamlphp/CONTRIBUTING.md @@ -1,15 +1,11 @@ # Contribution guidelines +**SimpleSAMLphp welcomes all contributions**. It is impossible to make a product like this without the efforts of many people, so please don't be shy and share your help with us. Even the tiniest contribution can make a difference! -**SimpleSAMLphp welcomes all contributions**. It is impossible to make a product like this without the efforts of many -people, so please don't be shy and share your help with us. Even the tiniest contribution can make a difference! - -This guidelines briefly explain how to contribute to SimpleSAMLphp in an effective manner, making sure to keep high -quality standards and making it easier for your contributions to make through. +These guidelines briefly explain how to contribute to SimpleSAMLphp effectively and consistently, making sure to keep high quality standards and making it easier for you to contribute. <!-- {{TOC}} --> ## Team members - Currently, the core team members are: * Jaime Pérez Crespo, *main developer and release manager*, UNINETT <jaime.perez@uninett.no> @@ -17,83 +13,64 @@ Currently, the core team members are: * Andreas Åkre Solberg, *architect and original developer*, UNINETT <andreas.solberg@uninett.no> * Hanne Moa, *developer*, UNINETT <hanne.moa@uninett.no> -We've been lucky to have the help of many people through the years. SimpleSAMLphp wouldn't have reached so far without -them, and we want to thank them from here. Unfortunately, they are so many it is nearly impossible to mention all of -them. [Github can offer a good summary on who has contributed to the project](https://github.com/simplesamlphp/simplesamlphp/graphs/contributors?from=2007-09-09&to=2015-09-06&type=c). -Big thanks to you all! +We have been lucky enough to have so many people help us through the years. SimpleSAMLphp wouldn't have reached so far without them. We want to thank them from here, but unfortunately they are so many it is nearly impossible to mention all of them. [Here is a Github page that summarizes everyone's contributions](https://github.com/simplesamlphp/simplesamlphp/graphs/contributors?from=2007-09-09&to=2015-09-06&type=c). -## First things first +***Big thanks to you all!*** -Before embarking yourself in a contribution, please make sure you are familiar with the way SimpleSAMLphp is written, -the way it works, and what is required or not. +## First things first +Before embarking yourself in a contribution, please make sure you are familiar with the way SimpleSAMLphp is written, the way it works, and what is required or not. -* Make sure to read [the documentation](https://simplesamlphp.org/docs/stable/). If you use the search engine in the -website, please verify that you are reading the latest stable version. If you want to develop something, check [the -development branch of the documentation](https://simplesamlphp.org/docs/development/). +* Make sure to read [the documentation](https://simplesamlphp.org/docs/stable/). If you use the search engine in the website, please verify that you are reading the latest stable version. If you want to make a change, check [the development branch of the documentation](https://simplesamlphp.org/docs/development/). * If you have a question about **using SimpleSAMLphp**, please use [the mailing list](http://groups.google.com/group/simplesamlphp). * If you have a question about **developing SimpleSAMLphp**, please ask in the [development mailing list](http://groups.google.com/group/simplesamlphp-dev). -* If you think you have discovered a bug, please check the [issue tracker](https://github.com/simplesamlphp/simplesamlphp/issues) -and the [pull requests](https://github.com/simplesamlphp/simplesamlphp/pulls) to verify it hasn't been reported before. +* If you think you have discovered a bug, please check the [issue tracker](https://github.com/simplesamlphp/simplesamlphp/issues) and the [pull requests](https://github.com/simplesamlphp/simplesamlphp/pulls) to verify it hasn't been reported already. ## Contributing code - -New features are always welcome provided they will be useful to someone apart from yourself. Please take a look at the -[list of issues](https://github.com/simplesamlphp/simplesamlphp/issues) to see what people is demanding. Our -[roadmap](https://simplesamlphp.org/releaseplan) might also be a good place to start if you don't know exactly what -you can contribute with. - -When contributing your code, please make sure to: - -* Respect the coding standards. We try to comply with PHP's [PSR-2](http://www.php-fig.org/psr/psr-2/). Pay special -attention to: - * Lines should not be longer than 80 characters. - * Use **4 spaces** instead of tabs. - * Keep the keywords in **lowercase**, including `true`, `false` and `null`. - * Make sure your classes work with *autoloading*. - * Never include a trailing `?>` in your files. - * The first line of every file must be `<?php`. - * Use namespaces if you are adding new files. -* Do not include many changes in every commit. Commits should be focused and address one single problem or feature. By -having **multiple, small commits** instead of few large ones, it is easier to track what you are doing, revert changes -in case of an error and help you out if needed. +New features are always welcome, provided they will be useful to someone apart from yourself. Please take a look at the [list of issues](https://github.com/simplesamlphp/simplesamlphp/issues) to see what people are asking for. Our [roadmap](https://simplesamlphp.org/releaseplan) might also be a good place to start if you do not know exactly how you can contribute. + +When submitting a pull request, please make sure to account for: + +### Coding standards +* Respect the coding standards. We try to comply with PHP's [PSR-2](http://www.php-fig.org/psr/psr-2/). Pay special attention to the rules below: + * Lines should not be longer than 80 characters. + * Use **4 spaces** instead of tabs. + * Keep the keywords in **lowercase**, including `true`, `false` and `null`. + * Make sure your classes work with *autoloading*. + * Never include a trailing `?>` in your files. + * The first line of every file must be `<?php`. + * Use namespaces if you are adding new files. +* Do not include too many changes in every commit. Commits should be focused and address one single problem or feature. By having **multiple, small commits** instead of fewer large ones, it is easier to track what you are doing, revert changes in case of an error and help you make changes if needed. * Try to write clean **commit messages**, largely based on the [seven rules](http://chris.beams.io/posts/git-commit/): - * Write a **short** subject line, followed by a blank line and a longer explanation. - * Prefix the subject line with the component(s) changed, e.g. "docs: Update foo", or "SAML: Don't log bar twice", - or "tests: Add tests for quux". - * Explain **what and why** in the commit message, not just _how_. Things obvious now might become quite confusing - when rediscovered years later. -* **Be explicit**. Add comments. Use strict comparison operators like `===` and check for specific values when testing -conditions. -* **Keep things simple**. Avoid big functions, long nested loops or `if` statements. -* Include complete **phpdoc** documentation for every property and method you add. If you change a method or property, -make sure to update the existing *phpdoc* accordingly. Do not forget to document all parameters, returned values and -exceptions thrown. -* Try to keep **backwards-compatibility**. Code that breaks current configurations and installations is difficult to -deploy, and therefore we try to avoid it. -* Add **unit tests** to verify that your code not only works but also keeps working over time. When adding tests, keep -the same directory structure used for regular classes. Try to cover **all your code** with tests. The bigger the test -coverage, the more reliable and better our library is. Read our [guidelines](TESTING.md) to learn more about tests. -* Add proper **documentation** explaining your how to use your new feature or how your code changes things. -* Submit your code as a **pull request** in github, from a branch with a descriptive name in your own fork of the -repository. Add a meaningful, short title, and explain in detail what you did and why in the description of the *PR*. -Add instructions on how to test your code. We appreciate branch names like `feature/whatever-new-feature` for new -features and `bug/something-not-working` for bug fixes, but this is not carved in stone. - -Sometimes it can take a long time until we are able to process your pull requests. Don't get discouraged, we'll -eventually reach up to you. And remember that following this guidelines you are making it easier for us to analyze your -request so the process will be smoother and faster. We really appreciate you helping us out, not only with your code, -but also by following this guidelines. + * Write a **short** subject line, followed by a blank line and a longer explanation. + * Prefix the subject line with the component(s) changed, e.g. "docs: Update foo", or "SAML: Don't log bar twice", or "tests: Add tests for quux". + * Explain **what and why** in the commit message, not just _how_. Things that seem obvious now might become quite confusing when rediscovered years later. -## Reporting bugs +### Comments, comparisons, and simplicity +* Add comments that describe why/how your code works. +* Include complete **phpdoc** documentation for every property and method you add. If you change a method or property, make sure to update the existing *phpdoc* accordingly. Do not forget to document all parameters, returned values and exceptions thrown. +* Use strict comparison operators like `===` and check for specific values when writing tests. +* Avoid big functions, long nested loops or `if` statements. +* Try to keep **backwards-compatibility**. Code that breaks current configurations and installations is difficult to deploy, and therefore we try to avoid that as much as possible. + +### Unit tests +Add **unit tests** to verify that your code not only works but also keeps working over time. When adding tests, keep the same directory structure used for regular classes. Try to cover **all your code** with tests. The bigger the test coverage, the more reliable and better our library is. Read our [guidelines](TESTING.md) to learn more about tests. + +### Documentation +In order to keep this library user-friendly, we ask that you add proper **documentation** explaining how to use your new feature or how your code changes things. -Before reporting a bug, please make sure it is indeed a bug. Check [the documentation](https://simplesamlphp.org/docs/stable/) -to verify what the intended behaviour is. Review the [list of issues](https://github.com/simplesamlphp/simplesamlphp/issues) -and the [pull requests](https://github.com/simplesamlphp/simplesamlphp/pulls) to see if someone has already reported the -same issue. +### Pull requests +Please follow all instructions below: -Pull requests are definitely more appreciated than plain issue reports, as they are easier and faster to address, but -please, do not hesitate to open an issue if you don't have coding skills or just can't find the bug. It's better to have -just an issue report than nothing! +1. Submit your code as a **pull request** in github from a branch with a descriptive name in your own fork of the repository. +2. Add a meaningful, short title, and explain in detail what you did and why in the description of the *PR*. +3. Add instructions on how to test your code. We appreciate branch names like `feature/whatever-new-feature` for new features and `bug/something-not-working` for bug fixes, but this is not required. + +Sometimes it can take a long time before we are able to process your pull requests. Do not get discouraged, we will eventually reach your change. Remember that by following these guidelines, you are making it easier for us to analyze your request so the process will be smooth and fast. We really appreciate you helping us out, not only with your code, but also by following these guidelines. + +## Reporting bugs +Before reporting a bug, please make sure it is indeed a bug. Check [the documentation](https://simplesamlphp.org/docs/stable/) to verify what the intended behaviour is. Review the [issue tracker](https://github.com/simplesamlphp/simplesamlphp/issues) and the [pull requests](https://github.com/simplesamlphp/simplesamlphp/pulls) to see if someone has already reported the same issue. + +If you are able, a pull request is much more appreciated than just a new issue. If not, please do not hesitate to open one. It is better to have just an issue report than nothing! You can help us diagnose and fix bugs by asking and providing answers to the following questions: @@ -102,18 +79,12 @@ You can help us diagnose and fix bugs by asking and providing answers to the fol * Are the steps to reproduce the bug clear? If not, can you describe how you might reproduce it? * What tags should the bug have? * How critical is this bug? Does it impact a large amount of users? -* Is this a security issue? If so, how severe is it? How can an attacker exploit it? Read more about security issues in -the next section. +* Is this a security issue? If so, how severe is it? How can an attacker exploit it? Read more about security issues in the next section. ## Reporting vulnerabilities +In case you find a vulnerability in SimpleSAMLphp, or you want to confirm a possible security issue in the software, please get in touch with us through [UNINETT's CERT team](https://www.uninett.no/cert). Please use our PGP public key to encrypt any possibly sensitive data that you may need to submit. We will get back to you as soon as possible according to our working hours in Central European Time. -In case you find a vulnerability in SimpleSAMLphp, or you want to confirm a possible security issue in the software, please -get in touch with us through [UNINETT's CERT team](https://www.uninett.no/cert). Please use our PGP public key to encrypt -any possible sensitive data that you may need to submit. We will get back to you as soon as possible according to our -working hours in Central European Time. - -When reporting a security issue, please add as much information as possible to help us identify, confirm, replicate and -fix the problem. In particular, remember to include the following information in your report: +When reporting a security issue, please add as much information as possible to help us identify, confirm, replicate and fix the problem. In particular, remember to include the following information in your report: * The version or versions of SimpleSAMLphp affected. * An exact version that can be used to replicate the issue. @@ -125,42 +96,23 @@ fix the problem. In particular, remember to include the following information in * Context on how you discovered the issue. * Your own name and whether you want to be credited for the discovery or not. -Please **DO NOT** report security incidents related to systems that use SimpleSAMLphp, where this software is not the -cause of the incident. Issues related to the use (or misuse) of infrastructure, misconfiguration of the software, -malfunction of a particular system or user-related errors should not be reported either. If you are using SimpleSAMLphp -to authenticate or login to services, but you don't know what SimpleSAMLphp is or you are not sure about the nature of -the issue, please contact the organization running the service for you. +Please **DO NOT** report security incidents related to systems that use SimpleSAMLphp, where this software is not the cause of the incident. Issues related to the use (or misuse) of infrastructure, misconfiguration of the software, malfunction of a particular system or user-related errors should not be reported either. If you are using SimpleSAMLphp to authenticate or login to services, but you don't know what SimpleSAMLphp is or you are not sure about the nature of the issue, please contact the organization running the service for you. -Finally, be reasonable. We'll do our best to resolve the issue according to our principles of security and transparency. -Every confirmed vulnerability will be published and resolved in a timely manner. All we ask in return is that you -contact us privately first in order to avoid any potential damage to those using the software. +Finally, be reasonable. We'll do our best to resolve the issue according to our principles of security and transparency. Every confirmed vulnerability will be published and resolved in a timely manner. All we ask in return is that you contact us privately first in order to avoid any potential damage to those using the software. You can find the list of security advisories we have published [here](https://simplesamlphp.org/security). ## Translations +SimpleSAMLphp is translated to many languages, though it needs constant updates from translators, as well as new translations to other languages. For the moment, translations can be contributed as **pull requests**. We are looking at better ways to translate the software that would make your life easier, so stay tuned! You can also join the [translators mailing list](http://groups.google.com/group/simplesamlphp-translation) to keep up to date on the latest news. -SimpleSAMLphp is translated to many languages, though it needs constant updates from translators, as well as new -translations to other languages. For the moment, translations can be contributed as **pull requests**. We are looking -at better ways to translate the software that would make your life easier, so stay tuned! You can also join the -[translators mailing list](http://groups.google.com/group/simplesamlphp-translation) to keep up to date on the -latest news. - -Before starting a new translation, decide what style you want to use, whether you want to address the user in a polite -manner or not, etc. Be coherent and keep that style through all your translations. If there is already a translation and -you want to complete it, make sure to keep the same style used by your fellow translators. +Before starting a new translation, decide what style you want to use, whether you want to address the user in a polite manner or not, etc. Be coherent and keep that style through all your translations. If there is already a translation and you want to complete it, make sure to keep the same style used by your fellow translators. ## Documentation +Did you find a typo in the documentation? Does something make no sense? Did we use poor english? Tell us! -Did you find a typo in the documentation? Does something make no sense? Did we use very poor english? Tell us! - -Documentation is included in our own repository in *markdown* format. You can submit pull requests with fixes. If you -encounter some feature that's not documented, or the documentation does not reflect the real behaviour of the library, -please do not hesitate to open an issue. +Documentation is included in our own repository in *markdown* format. You can submit pull requests with fixes. If you encounter some feature that is not documented, or the documentation does not reflect the real behaviour of the library, please do not hesitate to open an issue. Good documentation is key to make things easier for our users! ## Community - -You don't feel capable of contributing with your code, but are using SimpleSAMLphp and can share your knowledge and -experience? Please, do so! Join our [users mailing list](http://groups.google.com/group/simplesamlphp) and help other -users when you can. Your experience might be valuable for many! +You do not feel capable of contributing with your code, but are using SimpleSAMLphp and can share your knowledge and experience? Please, do so! Join our [users mailing list](http://groups.google.com/group/simplesamlphp) and help other users when you can. Your experience might be valuable for many! diff --git a/vendor/simplesamlphp/simplesamlphp/TESTING.md b/vendor/simplesamlphp/simplesamlphp/TESTING.md index 3dbb738178..c38db47e8f 100644 --- a/vendor/simplesamlphp/simplesamlphp/TESTING.md +++ b/vendor/simplesamlphp/simplesamlphp/TESTING.md @@ -27,13 +27,13 @@ definition: namespace SimpleSAML\Test\Utils; ``` -The test classes need to extend `PHPUnit_Framework_TestCase`, and inside +The test classes need to extend `PHPUnit\Framework\TestCase`, and inside you can implement as many methods as you want. `phpunit` will only run the ones prefixed with "test". You will usually make use of the `assert*()` methods provided by -`PHPUnit_Framework_TestCase`, but you can also tell `phpunit` to expect -an exception to be thrown using *phpdoc*. For example, if you want to +`PHPUnit\Framework\TestCase`, but you can also tell `phpunit` to expect +an exception to be thrown using *phpdoc*. For example, if you want to ensure that the `SimpleSAML\Utils\HTTP::addURLParameters()` method throws an exception in a specific situation: @@ -47,7 +47,7 @@ throws an exception in a specific situation: ``` Refer to [the `phpunit 4.8` documentation](https://phpunit.de/manual/4.8/en/installation.html) -for more information on how to write tests. We currently use the `phpunit 4.8` +for more information on how to write tests. We currently use the `phpunit 4.8` since it is the last version to support php 5.3. Once you have implemented your tests, you can run them locally. First, @@ -56,17 +56,17 @@ SimpleSAMLphp installation, as the tests cannot use that. Make sure you have `phpunit` installed and run: ```sh -phpunit -c tools/phpunit/phpunit.xml +phpunit -c ./phpunit.xml ``` If your default version of `phpunit` is more recent than 4.8, you can run the old version installed by composer ```sh -./vendor/bin/phpunit -c tools/phpunit/phpunit.xml +./vendor/bin/phpunit -c ./phpunit.xml ``` -All the tests are run by our *continuous integration* platform, +All the tests are run by our *continuous integration* platform, [travis](https://travis-ci.org/simplesamlphp/simplesamlphp). If you are submitting a pull request, Travis will run your tests and notify whether your code builds or not according to them. diff --git a/vendor/simplesamlphp/simplesamlphp/attributemap/addurnprefix.php b/vendor/simplesamlphp/simplesamlphp/attributemap/addurnprefix.php index 9d9877c000..c8623954f9 100644 --- a/vendor/simplesamlphp/simplesamlphp/attributemap/addurnprefix.php +++ b/vendor/simplesamlphp/simplesamlphp/attributemap/addurnprefix.php @@ -1,6 +1,6 @@ <?php -$attributemap = array( +$attributemap = [ 'sn' => 'urn:mace:dir:attribute-def:sn', 'telephoneNumber' => 'urn:mace:dir:attribute-def:telephoneNumber', 'facsimileTelephoneNumber' => 'urn:mace:dir:attribute-def:facsimileTelephoneNumber', @@ -17,4 +17,4 @@ 'eduPersonEntitlement' => 'urn:mace:dir:attribute-def:eduPersonEntitlement', 'eduPersonOrgDN' => 'urn:mace:dir:attribute-def:eduPersonOrgDN', 'eduPersonOrgUnitDN' => 'urn:mace:dir:attribute-def:eduPersonOrgUnitDN', -); +]; diff --git a/vendor/simplesamlphp/simplesamlphp/attributemap/deprecatedSchacNS.php b/vendor/simplesamlphp/simplesamlphp/attributemap/deprecatedSchacNS.php index 5f90e03ab7..4a613348e1 100644 --- a/vendor/simplesamlphp/simplesamlphp/attributemap/deprecatedSchacNS.php +++ b/vendor/simplesamlphp/simplesamlphp/attributemap/deprecatedSchacNS.php @@ -11,7 +11,7 @@ define('SCHAC_NEW_NS', 'urn:schac:attribute-def:'); } -$attributemap = array( +$attributemap = [ SCHAC_NEW_NS.'schacCountryOfCitizenship' => SCHAC_OLD_NS.'schacCountryOfCitizenship', SCHAC_NEW_NS.'schacCountryOfResidence' => SCHAC_OLD_NS.'schacCountryOfResidence', SCHAC_NEW_NS.'schacDateOfBirth' => SCHAC_OLD_NS.'schacDateOfBirth', @@ -32,4 +32,4 @@ SCHAC_NEW_NS.'schacUserPresenceID' => SCHAC_OLD_NS.'schacUserPresenceID', SCHAC_NEW_NS.'schacUserPrivateAttribute' => SCHAC_OLD_NS.'schacUserPrivateAttribute', SCHAC_NEW_NS.'schacUserStatus' => SCHAC_OLD_NS.'schacUserStatus', -); +]; diff --git a/vendor/simplesamlphp/simplesamlphp/attributemap/facebook2name.php b/vendor/simplesamlphp/simplesamlphp/attributemap/facebook2name.php index 5867ea7edf..e567a69f20 100644 --- a/vendor/simplesamlphp/simplesamlphp/attributemap/facebook2name.php +++ b/vendor/simplesamlphp/simplesamlphp/attributemap/facebook2name.php @@ -1,5 +1,5 @@ <?php -$attributemap = array( +$attributemap = [ // Generated Facebook Attributes 'facebook_user' => 'eduPersonPrincipalName', // username OR uid @ facebook.com @@ -15,4 +15,4 @@ 'facebook.profile_url' => 'labeledURI', 'facebook.locale' => 'preferredLanguage', 'facebook.about_me' => 'description', -); +]; diff --git a/vendor/simplesamlphp/simplesamlphp/attributemap/feide-oid.php b/vendor/simplesamlphp/simplesamlphp/attributemap/feide-oid.php index dc94cd7a4e..45a1a28a40 100644 --- a/vendor/simplesamlphp/simplesamlphp/attributemap/feide-oid.php +++ b/vendor/simplesamlphp/simplesamlphp/attributemap/feide-oid.php @@ -1,6 +1,6 @@ <?php -$attributemap = array( +$attributemap = [ 'mobile' => 'urn:mace:dir:attribute-def:mobile', 'displayName' => 'urn:oid:2.16.840.1.113730.3.1.241', -); +]; diff --git a/vendor/simplesamlphp/simplesamlphp/attributemap/linkedin2name.php b/vendor/simplesamlphp/simplesamlphp/attributemap/linkedin2name.php index 97231dd4b3..9b654682d8 100644 --- a/vendor/simplesamlphp/simplesamlphp/attributemap/linkedin2name.php +++ b/vendor/simplesamlphp/simplesamlphp/attributemap/linkedin2name.php @@ -1,5 +1,5 @@ <?php -$attributemap = array( +$attributemap = [ // See http://developer.linkedin.com/docs/DOC-1061 for LinkedIn Profile fields. // NB: JSON response requires the conversion of field names from hyphened to camelCase. @@ -15,4 +15,4 @@ 'linkedin.id' => 'uid', // alpha + mixed case user id 'linkedin.headline' => 'title', 'linkedin.summary' => 'description', -); +]; diff --git a/vendor/simplesamlphp/simplesamlphp/attributemap/myspace2name.php b/vendor/simplesamlphp/simplesamlphp/attributemap/myspace2name.php deleted file mode 100644 index 6111f61d05..0000000000 --- a/vendor/simplesamlphp/simplesamlphp/attributemap/myspace2name.php +++ /dev/null @@ -1,16 +0,0 @@ -<?php -$attributemap = array( - - // See http://developerwiki.myspace.com/index.php?title=People_API for attributes - - // Generated MySpace Attributes - 'myspace_user' => 'eduPersonPrincipalName', // username OR uid @ myspace.com - 'myspace_targetedID' => 'eduPersonTargetedID', // http://myspace.com!uid - 'myspace_username' => 'uid', // myspace username (maybe numeric uid) - - // Attributes Returned by MySpace - 'myspace.name.givenName' => 'givenName', - 'myspace.name.familyName' => 'sn', - 'myspace.displayName' => 'displayName', - 'myspace.profileUrl' => 'labeledURI', -); diff --git a/vendor/simplesamlphp/simplesamlphp/attributemap/name2claim.php b/vendor/simplesamlphp/simplesamlphp/attributemap/name2claim.php index 482bb6d8bd..7b03b10453 100644 --- a/vendor/simplesamlphp/simplesamlphp/attributemap/name2claim.php +++ b/vendor/simplesamlphp/simplesamlphp/attributemap/name2claim.php @@ -1,5 +1,5 @@ <?php // Maps AD LDAP to Claims from http://msdn.microsoft.com/en-us/library/hh159803.aspx -$attributemap = array( +$attributemap = [ 'c' => 'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/country', 'givenName' => 'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname', 'mail' => 'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress', @@ -10,4 +10,4 @@ 'st' => 'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/stateorprovince', 'streetaddress' => 'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/streetaddress', 'telephonenumber' => 'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/otherphone', -); +]; diff --git a/vendor/simplesamlphp/simplesamlphp/attributemap/name2oid.php b/vendor/simplesamlphp/simplesamlphp/attributemap/name2oid.php index 1a5e10ca27..c99f0e0b37 100644 --- a/vendor/simplesamlphp/simplesamlphp/attributemap/name2oid.php +++ b/vendor/simplesamlphp/simplesamlphp/attributemap/name2oid.php @@ -1,5 +1,5 @@ <?php -$attributemap = array( +$attributemap = [ 'aRecord' => 'urn:oid:0.9.2342.19200300.100.1.26', 'aliasedEntryName' => 'urn:oid:2.5.4.1', 'aliasedObjectName' => 'urn:oid:2.5.4.1', @@ -189,4 +189,4 @@ 'userid' => 'urn:oid:0.9.2342.19200300.100.1.1', 'x121Address' => 'urn:oid:2.5.4.24', 'x500UniqueIdentifier' => 'urn:oid:2.5.4.45', -); +]; diff --git a/vendor/simplesamlphp/simplesamlphp/attributemap/name2urn.php b/vendor/simplesamlphp/simplesamlphp/attributemap/name2urn.php index 477f6c665c..03190f3090 100644 --- a/vendor/simplesamlphp/simplesamlphp/attributemap/name2urn.php +++ b/vendor/simplesamlphp/simplesamlphp/attributemap/name2urn.php @@ -1,5 +1,5 @@ <?php -$attributemap = array( +$attributemap = [ 'aRecord' => 'urn:mace:dir:attribute-def:aRecord', 'aliasedEntryName' => 'urn:mace:dir:attribute-def:aliasedEntryName', 'aliasedObjectName' => 'urn:mace:dir:attribute-def:aliasedObjectName', @@ -112,6 +112,7 @@ 'owner' => 'urn:mace:dir:attribute-def:owner', 'pager' => 'urn:mace:dir:attribute-def:pager', 'pagerTelephoneNumber' => 'urn:mace:dir:attribute-def:pagerTelephoneNumber', + 'pairwise-id' => 'urn:oasis:names:tc:SAML:attribute:pairwise-id', 'personalSignature' => 'urn:mace:dir:attribute-def:personalSignature', 'personalTitle' => 'urn:mace:dir:attribute-def:personalTitle', 'photo' => 'urn:mace:dir:attribute-def:photo', @@ -163,6 +164,7 @@ 'stateOrProvinceName' => 'urn:mace:dir:attribute-def:stateOrProvinceName', 'street' => 'urn:mace:dir:attribute-def:street', 'streetAddress' => 'urn:mace:dir:attribute-def:streetAddress', + 'subject-id' => 'urn:oasis:names:tc:SAML:attribute:subject-id', 'subtreeMaximumQuality' => 'urn:mace:dir:attribute-def:subtreeMaximumQuality', 'subtreeMinimumQuality' => 'urn:mace:dir:attribute-def:subtreeMinimumQuality', 'supportedAlgorithms' => 'urn:mace:dir:attribute-def:supportedAlgorithms', @@ -184,4 +186,4 @@ 'userid' => 'urn:mace:dir:attribute-def:userid', 'x121Address' => 'urn:mace:dir:attribute-def:x121Address', 'x500UniqueIdentifier' => 'urn:mace:dir:attribute-def:x500UniqueIdentifier', -); +]; diff --git a/vendor/simplesamlphp/simplesamlphp/attributemap/newSchacNS.php b/vendor/simplesamlphp/simplesamlphp/attributemap/newSchacNS.php index 8b3d2a7568..16e67394ee 100644 --- a/vendor/simplesamlphp/simplesamlphp/attributemap/newSchacNS.php +++ b/vendor/simplesamlphp/simplesamlphp/attributemap/newSchacNS.php @@ -11,7 +11,7 @@ define('SCHAC_NEW_NS', 'urn:schac:attribute-def:'); } -$attributemap = array( +$attributemap = [ SCHAC_OLD_NS.'schacCountryOfCitizenship' => SCHAC_NEW_NS.'schacCountryOfCitizenship', SCHAC_OLD_NS.'schacCountryOfResidence' => SCHAC_NEW_NS.'schacCountryOfResidence', SCHAC_OLD_NS.'schacDateOfBirth' => SCHAC_NEW_NS.'schacDateOfBirth', @@ -32,4 +32,4 @@ SCHAC_OLD_NS.'schacUserPresenceID' => SCHAC_NEW_NS.'schacUserPresenceID', SCHAC_OLD_NS.'schacUserPrivateAttribute' => SCHAC_NEW_NS.'schacUserPrivateAttribute', SCHAC_OLD_NS.'schacUserStatus' => SCHAC_NEW_NS.'schacUserStatus', -); +]; diff --git a/vendor/simplesamlphp/simplesamlphp/attributemap/oid-feide.php b/vendor/simplesamlphp/simplesamlphp/attributemap/oid-feide.php index e20b7a8850..c6bc2148d2 100644 --- a/vendor/simplesamlphp/simplesamlphp/attributemap/oid-feide.php +++ b/vendor/simplesamlphp/simplesamlphp/attributemap/oid-feide.php @@ -1,6 +1,6 @@ <?php -$attributemap = array( +$attributemap = [ 'urn:oid:0.9.2342.19200300.100.1.41' => 'mobile', 'urn:oid:1.3.6.1.4.1.5923.1.1.1.6' => 'eduPersonPrincipalName', 'urn:oid:0.9.2342.19200300.100.1.3' => 'mail', @@ -9,4 +9,4 @@ 'urn:oid:2.5.4.4' => 'sn', 'urn:oid:2.5.4.42' => 'givenName', 'urn:oid:2.16.756.1.2.5.1.1.1' => 'eduPerson', -); +]; diff --git a/vendor/simplesamlphp/simplesamlphp/attributemap/oid2name.php b/vendor/simplesamlphp/simplesamlphp/attributemap/oid2name.php index e1ce887d6e..f36dd1cab3 100644 --- a/vendor/simplesamlphp/simplesamlphp/attributemap/oid2name.php +++ b/vendor/simplesamlphp/simplesamlphp/attributemap/oid2name.php @@ -1,5 +1,5 @@ <?php -$attributemap = array( +$attributemap = [ 'urn:oid:0.9.2342.19200300.100.1.1' => 'uid', 'urn:oid:0.9.2342.19200300.100.1.10' => 'manager', 'urn:oid:0.9.2342.19200300.100.1.11' => 'documentIdentifier', @@ -167,4 +167,4 @@ 'urn:oid:2.5.4.7' => 'l', 'urn:oid:2.5.4.8' => 'st', 'urn:oid:2.5.4.9' => 'street', -); +]; diff --git a/vendor/simplesamlphp/simplesamlphp/attributemap/oid2urn.php b/vendor/simplesamlphp/simplesamlphp/attributemap/oid2urn.php index cefb99ce76..a2b0a78e32 100644 --- a/vendor/simplesamlphp/simplesamlphp/attributemap/oid2urn.php +++ b/vendor/simplesamlphp/simplesamlphp/attributemap/oid2urn.php @@ -1,5 +1,5 @@ <?php -$attributemap = array( +$attributemap = [ 'urn:oid:0.9.2342.19200300.100.1.1' => 'urn:mace:dir:attribute-def:uid', 'urn:oid:0.9.2342.19200300.100.1.10' => 'urn:mace:dir:attribute-def:manager', 'urn:oid:0.9.2342.19200300.100.1.11' => 'urn:mace:dir:attribute-def:documentIdentifier', @@ -164,4 +164,4 @@ 'urn:oid:2.5.4.7' => 'urn:mace:dir:attribute-def:l', 'urn:oid:2.5.4.8' => 'urn:mace:dir:attribute-def:st', 'urn:oid:2.5.4.9' => 'urn:mace:dir:attribute-def:street', -); +]; diff --git a/vendor/simplesamlphp/simplesamlphp/attributemap/openid2name.php b/vendor/simplesamlphp/simplesamlphp/attributemap/openid2name.php index 624074b02c..1cef43ef2c 100644 --- a/vendor/simplesamlphp/simplesamlphp/attributemap/openid2name.php +++ b/vendor/simplesamlphp/simplesamlphp/attributemap/openid2name.php @@ -1,5 +1,5 @@ <?php -$attributemap = array( +$attributemap = [ // Simple Registration + AX Schema 'http://axschema.org/namePerson/friendly' => 'displayName', // Alias/Username -> displayName 'openid.sreg.nickname' => 'displayName', @@ -30,4 +30,4 @@ 'http://axschema.org/contact/phone/fax' => 'facsimileTelephoneNumber', // Phone (fax) // Further attributes can be found at http://www.axschema.org/types/ -); +]; diff --git a/vendor/simplesamlphp/simplesamlphp/attributemap/removeurnprefix.php b/vendor/simplesamlphp/simplesamlphp/attributemap/removeurnprefix.php index 6a7c920d59..f9ac92f5ed 100644 --- a/vendor/simplesamlphp/simplesamlphp/attributemap/removeurnprefix.php +++ b/vendor/simplesamlphp/simplesamlphp/attributemap/removeurnprefix.php @@ -1,6 +1,6 @@ <?php -$attributemap = array( +$attributemap = [ 'urn:mace:dir:attribute-def:sn' => 'sn', 'urn:mace:dir:attribute-def:telephoneNumber' => 'telephoneNumber', 'urn:mace:dir:attribute-def:facsimileTelephoneNumber' => 'facsimileTelephoneNumber', @@ -17,4 +17,4 @@ 'urn:mace:dir:attribute-def:eduPersonEntitlement' => 'eduPersonEntitlement', 'urn:mace:dir:attribute-def:eduPersonOrgDN' => 'eduPersonOrgDN', 'urn:mace:dir:attribute-def:eduPersonOrgUnitDN' => 'eduPersonOrgUnitDN', -); +]; diff --git a/vendor/simplesamlphp/simplesamlphp/attributemap/test.php b/vendor/simplesamlphp/simplesamlphp/attributemap/test.php index a89ad869f7..8ddd84b698 100644 --- a/vendor/simplesamlphp/simplesamlphp/attributemap/test.php +++ b/vendor/simplesamlphp/simplesamlphp/attributemap/test.php @@ -1,5 +1,5 @@ <?php -$attributemap = array( +$attributemap = [ 'mobile' => 'urn:mace:dir:attribute-def:mobile' -); +]; diff --git a/vendor/simplesamlphp/simplesamlphp/attributemap/twitter2name.php b/vendor/simplesamlphp/simplesamlphp/attributemap/twitter2name.php index 27c9e755a1..00f65317a2 100644 --- a/vendor/simplesamlphp/simplesamlphp/attributemap/twitter2name.php +++ b/vendor/simplesamlphp/simplesamlphp/attributemap/twitter2name.php @@ -1,5 +1,5 @@ <?php -$attributemap = array( +$attributemap = [ // Generated Twitter Attributes 'twitter_screen_n_realm' => 'eduPersonPrincipalName', // screen_name@twitter.com @@ -11,4 +11,4 @@ 'twitter.url' => 'labeledURI', 'twitter.lang' => 'preferredLanguage', 'twitter.description' => 'description', -); +]; diff --git a/vendor/simplesamlphp/simplesamlphp/attributemap/urn2name.php b/vendor/simplesamlphp/simplesamlphp/attributemap/urn2name.php index 66cd8589ab..8cf8bffd7d 100644 --- a/vendor/simplesamlphp/simplesamlphp/attributemap/urn2name.php +++ b/vendor/simplesamlphp/simplesamlphp/attributemap/urn2name.php @@ -1,5 +1,5 @@ <?php -$attributemap = array( +$attributemap = [ 'urn:mace:dir:attribute-def:aRecord' => 'aRecord', 'urn:mace:dir:attribute-def:aliasedEntryName' => 'aliasedEntryName', 'urn:mace:dir:attribute-def:aliasedObjectName' => 'aliasedObjectName', @@ -184,4 +184,6 @@ 'urn:mace:terena.org:attribute-def:schacUserPresenceID' => 'schacUserPresenceID', 'urn:mace:terena.org:attribute-def:schacUserPrivateAttribute' => 'schacUserPrivateAttribute', 'urn:mace:terena.org:attribute-def:schacUserStatus' => 'schacUserStatus', -); + 'urn:oasis:names:tc:SAML:attribute:pairwise-id' => 'pairwise-id', + 'urn:oasis:names:tc:SAML:attribute:subject-id' => 'subject-id', +]; diff --git a/vendor/simplesamlphp/simplesamlphp/attributemap/urn2oid.php b/vendor/simplesamlphp/simplesamlphp/attributemap/urn2oid.php index fda382b93a..4abf467844 100644 --- a/vendor/simplesamlphp/simplesamlphp/attributemap/urn2oid.php +++ b/vendor/simplesamlphp/simplesamlphp/attributemap/urn2oid.php @@ -1,5 +1,5 @@ <?php -$attributemap = array( +$attributemap = [ 'urn:mace:dir:attribute-def:aRecord' => 'urn:oid:0.9.2342.19200300.100.1.26', 'urn:mace:dir:attribute-def:aliasedEntryName' => 'urn:oid:2.5.4.1', 'urn:mace:dir:attribute-def:aliasedObjectName' => 'urn:oid:2.5.4.1', @@ -185,4 +185,4 @@ 'urn:mace:terena.org:attribute-def:schacUserPresenceID' => 'urn:oid:1.3.6.1.4.1.25178.1.2.12', 'urn:mace:terena.org:attribute-def:schacUserPrivateAttribute' => 'urn:oid:1.3.6.1.4.1.25178.1.2.18', 'urn:mace:terena.org:attribute-def:schacUserStatus' => 'urn:oid:1.3.6.1.4.1.25178.1.2.19', -); +]; diff --git a/vendor/simplesamlphp/simplesamlphp/attributemap/windowslive2name.php b/vendor/simplesamlphp/simplesamlphp/attributemap/windowslive2name.php index 1c5496c90d..3c3ffa1f00 100644 --- a/vendor/simplesamlphp/simplesamlphp/attributemap/windowslive2name.php +++ b/vendor/simplesamlphp/simplesamlphp/attributemap/windowslive2name.php @@ -1,5 +1,5 @@ <?php -$attributemap = array( +$attributemap = [ // Generated Windows Live ID Attributes 'windowslive_user' => 'eduPersonPrincipalName', // uid @ windowslive.com @@ -19,4 +19,4 @@ 'windowslive.mail' => 'mail', 'windowslive.preferredLanguage' => 'preferredLanguage', -); +]; diff --git a/vendor/simplesamlphp/simplesamlphp/bin/build-release.sh b/vendor/simplesamlphp/simplesamlphp/bin/build-release.sh index 464d652af2..da576e5973 100755 --- a/vendor/simplesamlphp/simplesamlphp/bin/build-release.sh +++ b/vendor/simplesamlphp/simplesamlphp/bin/build-release.sh @@ -15,7 +15,7 @@ exit 1 fi -if [ -z "$REPO" ]; then +if [ -z "$REPOPATH" ]; then REPOPATH="https://github.com/simplesamlphp/simplesamlphp.git" fi @@ -36,30 +36,38 @@ git checkout $TAG cd .. -# Use composer only on newer versions that have a composer.json -if [ -f "$TARGET/composer.json" ]; then - if [ ! -x "$TARGET/composer.phar" ]; then - curl -sS https://getcomposer.org/installer | php -- --install-dir=$TARGET - fi - - # Install dependencies (without vcs history or dev tools) - php "$TARGET/composer.phar" install --no-dev --prefer-dist -o -d "$TARGET" +if [ ! -x "$TARGET/composer.phar" ]; then + curl -sS https://getcomposer.org/installer | php -- --install-dir=$TARGET fi -mkdir -p "$TARGET/config" "$TARGET/metadata" "$TARGET/cert" "$TARGET/log" +# Set the version in composer.json +php "$TARGET/composer.phar" config version "$VERSION" -d "$TARGET" + +# Install dependencies (without vcs history or dev tools) +php "$TARGET/composer.phar" install --no-dev --prefer-dist -o -d "$TARGET" + +cd $TARGET +npm install +npm audit fix +npm run build +cd .. + +mkdir -p "$TARGET/config" "$TARGET/metadata" "$TARGET/cert" "$TARGET/log" "$TARGET/data" cp -rv "$TARGET/config-templates/"* "$TARGET/config/" cp -rv "$TARGET/metadata-templates/"* "$TARGET/metadata/" rm -rf "$TARGET/.git" +rm -rf "$TARGET/node_modules" +rm "$TARGET/www/assets/js/stylesheet.js"* rm "$TARGET/.coveralls.yml" +rm "$TARGET/.editorconfig" +rm "$TARGET/.gitattributes" +rm "$TARGET/.php_cs.dist" rm "$TARGET/.travis.yml" rm "$TARGET/psalm.xml" rm "$TARGET"/{,modules}/.gitignore -rm "$TARGET/.gitattributes" rm "$TARGET"/{cache,config,metadata,locales}/.gitkeep -rm "$TARGET/.editorconfig" rm "$TARGET/composer.phar" tar --owner 0 --group 0 -cvzf "$TARGET.tar.gz" "$TARGET" rm -rf "$TARGET" echo "Created: /tmp/$TARGET.tar.gz" - diff --git a/vendor/simplesamlphp/simplesamlphp/bin/check-syntax.sh b/vendor/simplesamlphp/simplesamlphp/bin/check-syntax.sh old mode 100644 new mode 100755 diff --git a/vendor/simplesamlphp/simplesamlphp/bin/importPdoMetadata.php b/vendor/simplesamlphp/simplesamlphp/bin/importPdoMetadata.php index 79e4b504a2..abf4fdd484 100755 --- a/vendor/simplesamlphp/simplesamlphp/bin/importPdoMetadata.php +++ b/vendor/simplesamlphp/simplesamlphp/bin/importPdoMetadata.php @@ -3,18 +3,18 @@ $baseDir = dirname(dirname(__FILE__)); require_once $baseDir.DIRECTORY_SEPARATOR.'lib'.DIRECTORY_SEPARATOR.'_autoload.php'; -require_once SimpleSAML\Utils\Config::getConfigDir().DIRECTORY_SEPARATOR.'config.php'; +require_once \SimpleSAML\Utils\Config::getConfigDir().DIRECTORY_SEPARATOR.'config.php'; # Iterate through configured metadata sources and ensure # that a PDO source exists. foreach ($config['metadata.sources'] as $s) { # If pdo is configured, create the new handler and add in the metadata sets. if ($s['type'] === "pdo") { - $mdshp = new SimpleSAML_Metadata_MetaDataStorageHandlerPdo($s); + $mdshp = new \SimpleSAML\Metadata\MetaDataStorageHandlerPdo($s); $mdshp->initDatabase(); foreach (glob("metadata/*.php") as $filename) { - $metadata = array(); + $metadata = []; require_once $filename; $set = basename($filename, ".php"); echo "importing set '$set'...".PHP_EOL; diff --git a/vendor/simplesamlphp/simplesamlphp/bin/initMDSPdo.php b/vendor/simplesamlphp/simplesamlphp/bin/initMDSPdo.php index b68a5b22f6..403b4d2de0 100755 --- a/vendor/simplesamlphp/simplesamlphp/bin/initMDSPdo.php +++ b/vendor/simplesamlphp/simplesamlphp/bin/initMDSPdo.php @@ -6,7 +6,7 @@ // Add library autoloader and configuration require_once $baseDir.DIRECTORY_SEPARATOR.'lib'.DIRECTORY_SEPARATOR.'_autoload.php'; -require_once SimpleSAML\Utils\Config::getConfigDir().DIRECTORY_SEPARATOR.'config.php'; +require_once \SimpleSAML\Utils\Config::getConfigDir().DIRECTORY_SEPARATOR.'config.php'; echo "Initializing Metadata Database...".PHP_EOL; @@ -15,7 +15,7 @@ foreach ($config['metadata.sources'] as $source) { # If pdo is configured, create the new handler and initialize the DB. if ($source['type'] === "pdo") { - $metadataStorageHandler = new SimpleSAML_Metadata_MetaDataStorageHandlerPdo($source); + $metadataStorageHandler = new \SimpleSAML\Metadata\MetaDataStorageHandlerPdo($source); $result = $metadataStorageHandler->initDatabase(); if ($result === false) { diff --git a/vendor/simplesamlphp/simplesamlphp/bin/memcacheSync.php b/vendor/simplesamlphp/simplesamlphp/bin/memcacheSync.php index 64605a952a..0dfdc31f47 100755 --- a/vendor/simplesamlphp/simplesamlphp/bin/memcacheSync.php +++ b/vendor/simplesamlphp/simplesamlphp/bin/memcacheSync.php @@ -3,19 +3,19 @@ // Check that the memcache library is enabled -if(!class_exists('Memcache') && !class_exists('Memcached')) { - echo("Error: the memcached (or memcache) PHP extension appears to be unavailable.\n"); - echo("\n"); - echo("This is most likely because PHP doesn't load it for the command line\n"); - echo("version. You probably need to enable it somehow.\n"); - echo("\n"); - if(is_executable('/usr/sbin/phpenmod')) { - echo("It is possible that running one of the following commands as root will fix it:\n"); - echo(" phpenmod -s cli memcached\n"); - echo(" phpenmod -s cli memcache\n"); - } - - exit(1); +if (!class_exists('Memcache') && !class_exists('Memcached')) { + echo "Error: the memcached (or memcache) PHP extension appears to be unavailable.\n"; + echo "\n"; + echo "This is most likely because PHP doesn't load it for the command line\n"; + echo "version. You probably need to enable it somehow.\n"; + echo "\n"; + if (is_executable('/usr/sbin/phpenmod')) { + echo "It is possible that running one of the following commands as root will fix it:\n"; + echo " phpenmod -s cli memcached\n"; + echo " phpenmod -s cli memcache\n"; + } + + exit(1); } // This is the base directory of the SimpleSAMLphp installation @@ -26,42 +26,41 @@ // Initialize the configuration $configdir = SimpleSAML\Utils\Config::getConfigDir(); -SimpleSAML_Configuration::setConfigDir($configdir); +\SimpleSAML\Configuration::setConfigDir($configdir); // Things we should warn the user about $warnServerDown = 0; $warnBigSlab = 0; // We use the stats interface to determine which servers exists -$stats = SimpleSAML_Memcache::getRawStats(); +$stats = \SimpleSAML\Memcache::getRawStats(); -$keys = array(); +$keys = []; foreach ($stats as $group) { foreach ($group as $server => $state) { - if ($state === false) { - echo("WARNING: Server ".$server." is down.\n"); + echo "WARNING: Server ".$server." is down.\n"; $warnServerDown++; continue; } $items = $state['curr_items']; - echo("Server ".$server." has ".$items." items.\n"); + echo "Server ".$server." has ".$items." items.\n"; $serverKeys = getServerKeys($server); $keys = array_merge($keys, $serverKeys); } } -echo("Total number of keys: ".count($keys)."\n"); +echo "Total number of keys: ".count($keys)."\n"; $keys = array_unique($keys); -echo("Total number of unique keys: ".count($keys)."\n"); +echo "Total number of unique keys: ".count($keys)."\n"; -echo("Starting synchronization.\n"); +echo "Starting synchronization.\n" ; $skipped = 0; $sync = 0; foreach ($keys as $key) { - $res = SimpleSAML_Memcache::get($key); + $res = \SimpleSAML\Memcache::get($key); if ($res === null) { $skipped += 1; } else { @@ -70,20 +69,20 @@ } -echo("Synchronization done.\n"); -echo($sync." keys in sync.\n"); +echo "Synchronization done.\n"; +echo $sync." keys in sync.\n"; if ($skipped > 0) { - echo($skipped." keys skipped.\n"); - echo("Keys are skipped because they are either expired, or are of a type unknown\n"); - echo("to SimpleSAMLphp.\n"); + echo $skipped." keys skipped.\n"; + echo "Keys are skipped because they are either expired, or are of a type unknown\n"; + echo "to SimpleSAMLphp.\n"; } if ($warnServerDown > 0) { - echo("WARNING: ".$warnServerDown." server(s) down. Not all servers are synchronized.\n"); + echo "WARNING: ".$warnServerDown." server(s) down. Not all servers are synchronized.\n"; } if ($warnBigSlab > 0) { - echo("WARNING: ".$warnBigSlab." slab(s) may have contained more keys than we were told about.\n"); + echo "WARNING: ".$warnBigSlab." slab(s) may have contained more keys than we were told about.\n"; } /** @@ -99,17 +98,17 @@ function getServerKeys($server) $host = $server[0]; $port = (int) $server[1]; - echo("Connecting to: ".$host.":".$port."\n"); + echo "Connecting to: ".$host.":".$port."\n"; $socket = fsockopen($host, $port); - echo("Connected. Finding keys.\n"); + echo "Connected. Finding keys.\n"; if (fwrite($socket, "stats slabs\r\n") === false) { - echo("Error requesting slab dump from server.\n"); + echo "Error requesting slab dump from server.\n"; exit(1); } // Read list of slabs - $slabs = array(); + $slabs = []; while (($line = fgets($socket)) !== false) { $line = rtrim($line); if ($line === 'END') { @@ -125,11 +124,10 @@ function getServerKeys($server) } // Dump keys in slabs - $keys = array(); + $keys = []; foreach ($slabs as $slab) { - if (fwrite($socket, "stats cachedump ".$slab." 1000000\r\n") === false) { - echo("Error requesting cache dump from server.\n"); + echo "Error requesting cache dump from server.\n"; exit(1); } @@ -149,17 +147,17 @@ function getServerKeys($server) if (preg_match('/^ITEM (.*) \[\d+ b; \d+ s\]/', $line, $matches)) { $keys[] = $matches[1]; } else { - echo("Unknown result from cache dump: ".$line."\n"); + echo "Unknown result from cache dump: ".$line."\n"; } } if ($resultSize > 1900000 || count($keys) >= 1000000) { - echo("WARNING: Slab ".$slab." on server ".$host.":".$port. - " may have contained more keys than we were told about.\n"); + echo "WARNING: Slab ".$slab." on server ".$host.":".$port. + " may have contained more keys than we were told about.\n"; $GLOBALS['warnBigSlab'] += 1; } } - echo("Found ".count($keys)." key(s).\n"); + echo "Found ".count($keys)." key(s).\n"; fclose($socket); return $keys; diff --git a/vendor/simplesamlphp/simplesamlphp/bin/pwgen.php b/vendor/simplesamlphp/simplesamlphp/bin/pwgen.php index 97d82d1e2b..b9789cb57b 100755 --- a/vendor/simplesamlphp/simplesamlphp/bin/pwgen.php +++ b/vendor/simplesamlphp/simplesamlphp/bin/pwgen.php @@ -21,27 +21,4 @@ exit(1); } -$table = ''; -foreach (array_chunk(hash_algos(), 6) as $chunk) { - foreach ($chunk as $algo) { - $table .= sprintf('%-13s', $algo); - } - $table .= "\n"; -} - -echo "The following hashing algorithms are available:\n".$table."\n"; -echo "Which one do you want? [sha256] "; -$algo = trim(fgets(STDIN)); -if (empty($algo)) { - $algo = 'sha256'; -} - -if (!in_array(strtolower($algo), hash_algos(), true)) { - echo "Hashing algorithm '$algo' is not supported\n"; - exit(1); -} - -echo "Do you want to use a salt? (yes/no) [yes] "; -$s = (trim(fgets(STDIN)) == 'no') ? '' : 'S'; - -echo "\n ".SimpleSAML\Utils\Crypto::pwHash($password, strtoupper($s.$algo))."\n\n"; +echo "\n ".SimpleSAML\Utils\Crypto::pwHash($password)."\n\n"; diff --git a/vendor/simplesamlphp/simplesamlphp/composer.json b/vendor/simplesamlphp/simplesamlphp/composer.json index f4e54d3dd6..945bf8e9cc 100644 --- a/vendor/simplesamlphp/simplesamlphp/composer.json +++ b/vendor/simplesamlphp/simplesamlphp/composer.json @@ -1,7 +1,6 @@ { "name": "simplesamlphp/simplesamlphp", "description": "A PHP implementation of a SAML 2.0 service provider and identity provider, also compatible with Shibboleth 1.3 and 2.0.", - "version": "v1.15.4", "type": "project", "keywords": [ "saml2", "shibboleth","oauth","ws-federation","sp","idp" ], "homepage": "http://simplesamlphp.org", @@ -27,7 +26,7 @@ "files": ["lib/_autoload_modules.php"] }, "require": { - "php": ">=5.4", + "php": ">=5.5", "ext-SPL": "*", "ext-zlib": "*", "ext-pcre": "*", @@ -37,20 +36,33 @@ "ext-hash": "*", "ext-json": "*", "ext-mbstring": "*", - "simplesamlphp/saml2": "~3.1.4", - "robrichards/xmlseclibs": "~3.0", + "simplesamlphp/saml2": "^3.3", + "robrichards/xmlseclibs": "^3.0.4", "whitehat101/apr1-md5": "~1.0", - "twig/twig": "~1.0", - "gettext/gettext": "^3.5", - "jaimeperez/twig-configurable-i18n": "^1.2" + "twig/twig": "~1.0 || ~2.0", + "gettext/gettext": "^4.6", + "jaimeperez/twig-configurable-i18n": "^2.0", + "symfony/routing": "^3.4 || ^4.0", + "symfony/http-foundation": "^3.4 || ^4.0", + "symfony/config": "^3.4 || ^4.0", + "symfony/http-kernel": "^3.4 || ^4.0", + "symfony/dependency-injection": "^3.4 || ^4.0", + "symfony/yaml": "^3.4 || ^4.0" }, "require-dev": { - "ext-pdo_sqlite": "*", "phpunit/phpunit": "~4.8", - "mikey179/vfsStream": "~1.6" + "mikey179/vfsstream": "~1.6", + "ext-curl": "*" }, - "suggests": { - "predis/predis": "1.1.1" + "suggest": { + "predis/predis": "Needed if a Redis server is used to store session information", + "ext-curl": "Needed in order to check for updates automatically", + "ext-ldap": "Needed if an LDAP backend is used", + "ext-radius": "Needed if a Radius backend is used", + "ext-memcache": "Needed if a Memcache server is used to store session information", + "ext-pdo": "Needed if a database backend is used, either for authentication or to store session information", + "ext-mysql": "Needed if a MySQL backend is used, either for authentication or to store session information", + "ext-pgsql": "Needed if a PostgreSQL backend is used, either for authentication or to store session information" }, "support": { "issues": "https://github.com/simplesamlphp/simplesamlphp/issues", diff --git a/vendor/simplesamlphp/simplesamlphp/composer.lock b/vendor/simplesamlphp/simplesamlphp/composer.lock index fd83a95762..b828386ff6 100644 --- a/vendor/simplesamlphp/simplesamlphp/composer.lock +++ b/vendor/simplesamlphp/simplesamlphp/composer.lock @@ -1,34 +1,36 @@ { "_readme": [ "This file locks the dependencies of your project to a known state", - "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "a1afc8384f78dbc65c1f422dd44e4955", + "content-hash": "0603e3b6481824853d37eeb5801017d3", "packages": [ { "name": "gettext/gettext", - "version": "v3.6.1", + "version": "v4.8.0", "source": { "type": "git", - "url": "https://github.com/oscarotero/Gettext.git", - "reference": "cd3be64443551e3a693117c4bccbe53e36282456" + "url": "https://github.com/php-gettext/Gettext.git", + "reference": "207719c6eae36f5ac7c2c9542f6a4d4b76307e5a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/oscarotero/Gettext/zipball/cd3be64443551e3a693117c4bccbe53e36282456", - "reference": "cd3be64443551e3a693117c4bccbe53e36282456", + "url": "https://api.github.com/repos/php-gettext/Gettext/zipball/207719c6eae36f5ac7c2c9542f6a4d4b76307e5a", + "reference": "207719c6eae36f5ac7c2c9542f6a4d4b76307e5a", "shasum": "" }, "require": { - "gettext/languages": "2.*", - "php": ">=5.3.0" + "gettext/languages": "^2.3", + "php": ">=5.4.0" }, "require-dev": { "illuminate/view": "*", + "phpunit/phpunit": "^4.8|^5.7|^6.5", + "squizlabs/php_codesniffer": "^3.0", "symfony/yaml": "~2", "twig/extensions": "*", - "twig/twig": "*" + "twig/twig": "^1.31|^2.0" }, "suggest": { "illuminate/view": "Is necessary if you want to use the Blade extractor", @@ -64,20 +66,20 @@ "po", "translation" ], - "time": "2016-08-01T18:09:57+00:00" + "time": "2019-11-04T18:03:29+00:00" }, { "name": "gettext/languages", - "version": "2.3.0", + "version": "2.5.0", "source": { "type": "git", "url": "https://github.com/mlocati/cldr-to-gettext-plural-rules.git", - "reference": "49c39e51569963cc917a924b489e7025bfb9d8c7" + "reference": "78db2d17933f0765a102f368a6663f057162ddbd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/mlocati/cldr-to-gettext-plural-rules/zipball/49c39e51569963cc917a924b489e7025bfb9d8c7", - "reference": "49c39e51569963cc917a924b489e7025bfb9d8c7", + "url": "https://api.github.com/repos/mlocati/cldr-to-gettext-plural-rules/zipball/78db2d17933f0765a102f368a6663f057162ddbd", + "reference": "78db2d17933f0765a102f368a6663f057162ddbd", "shasum": "" }, "require": { @@ -125,24 +127,28 @@ "translations", "unicode" ], - "time": "2017-03-23T17:02:28+00:00" + "time": "2018-11-13T22:06:07+00:00" }, { "name": "jaimeperez/twig-configurable-i18n", - "version": "v1.2", + "version": "v2.1", "source": { "type": "git", "url": "https://github.com/jaimeperez/twig-configurable-i18n.git", - "reference": "75d4926fd102c9e62219ad7f94a6136d2f2ccd93" + "reference": "38a22aaa6b31efdc0d76d58f5934dea3ebac8556" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/jaimeperez/twig-configurable-i18n/zipball/75d4926fd102c9e62219ad7f94a6136d2f2ccd93", - "reference": "75d4926fd102c9e62219ad7f94a6136d2f2ccd93", + "url": "https://api.github.com/repos/jaimeperez/twig-configurable-i18n/zipball/38a22aaa6b31efdc0d76d58f5934dea3ebac8556", + "reference": "38a22aaa6b31efdc0d76d58f5934dea3ebac8556", "shasum": "" }, "require": { - "twig/extensions": "^1.3" + "twig/extensions": "^1.5" + }, + "require-dev": { + "phpunit/phpunit": "~4.8.36", + "twig/twig": "^1.37 || ^2.7" }, "type": "project", "autoload": { @@ -162,42 +168,856 @@ ], "description": "This is an extension on top of Twig's i18n extension, allowing you to customize which functions to use for translations.", "keywords": [ - "extension", - "gettext", - "i18n", - "internationalization", - "translation", - "twig" + "extension", + "gettext", + "i18n", + "internationalization", + "translation", + "twig" + ], + "abandoned": "simplesamlphp/twig-configurable-i18n", + "time": "2019-06-07T11:03:28+00:00" + }, + { + "name": "paragonie/random_compat", + "version": "v2.0.18", + "source": { + "type": "git", + "url": "https://github.com/paragonie/random_compat.git", + "reference": "0a58ef6e3146256cc3dc7cc393927bcc7d1b72db" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/paragonie/random_compat/zipball/0a58ef6e3146256cc3dc7cc393927bcc7d1b72db", + "reference": "0a58ef6e3146256cc3dc7cc393927bcc7d1b72db", + "shasum": "" + }, + "require": { + "php": ">=5.2.0" + }, + "require-dev": { + "phpunit/phpunit": "4.*|5.*" + }, + "suggest": { + "ext-libsodium": "Provides a modern crypto API that can be used to generate random bytes." + }, + "type": "library", + "autoload": { + "files": [ + "lib/random.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Paragon Initiative Enterprises", + "email": "security@paragonie.com", + "homepage": "https://paragonie.com" + } + ], + "description": "PHP 5.x polyfill for random_bytes() and random_int() from PHP 7", + "keywords": [ + "csprng", + "polyfill", + "pseudorandom", + "random" + ], + "time": "2019-01-03T20:59:08+00:00" + }, + { + "name": "psr/container", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/container.git", + "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f", + "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Container\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", + "keywords": [ + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" + ], + "time": "2017-02-14T16:28:37+00:00" + }, + { + "name": "psr/log", + "version": "1.1.2", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "446d54b4cb6bf489fc9d75f55843658e6f25d801" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/446d54b4cb6bf489fc9d75f55843658e6f25d801", + "reference": "446d54b4cb6bf489fc9d75f55843658e6f25d801", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Log\\": "Psr/Log/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "time": "2019-11-01T11:05:21+00:00" + }, + { + "name": "robrichards/xmlseclibs", + "version": "3.0.4", + "source": { + "type": "git", + "url": "https://github.com/robrichards/xmlseclibs.git", + "reference": "0a53d3c3aa87564910cae4ed01416441d3ae0db5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/robrichards/xmlseclibs/zipball/0a53d3c3aa87564910cae4ed01416441d3ae0db5", + "reference": "0a53d3c3aa87564910cae4ed01416441d3ae0db5", + "shasum": "" + }, + "require": { + "ext-openssl": "*", + "php": ">= 5.4" + }, + "type": "library", + "autoload": { + "psr-4": { + "RobRichards\\XMLSecLibs\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "A PHP library for XML Security", + "homepage": "https://github.com/robrichards/xmlseclibs", + "keywords": [ + "security", + "signature", + "xml", + "xmldsig" + ], + "time": "2019-11-05T11:44:22+00:00" + }, + { + "name": "simplesamlphp/saml2", + "version": "v3.4.2", + "source": { + "type": "git", + "url": "https://github.com/simplesamlphp/saml2.git", + "reference": "3806d276edb066c60aa3d748ffd0681d92ffbda7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/simplesamlphp/saml2/zipball/3806d276edb066c60aa3d748ffd0681d92ffbda7", + "reference": "3806d276edb066c60aa3d748ffd0681d92ffbda7", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-openssl": "*", + "ext-zlib": "*", + "php": ">=5.4", + "psr/log": "~1.0", + "robrichards/xmlseclibs": "^3.0.4", + "webmozart/assert": "^1.4" + }, + "require-dev": { + "mockery/mockery": "~0.9", + "phpmd/phpmd": "~2.6", + "phpunit/phpunit": "~5.7", + "sebastian/phpcpd": "~2.0", + "sensiolabs/security-checker": "~4.1", + "simplesamlphp/simplesamlphp-test-framework": "0.0.11", + "squizlabs/php_codesniffer": "~3.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "v3.1.x-dev" + } + }, + "autoload": { + "psr-0": { + "SAML2\\": "src/" + }, + "files": [ + "src/_autoload.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-2.1-or-later" + ], + "authors": [ + { + "name": "Andreas Åkre Solberg", + "email": "andreas.solberg@uninett.no" + } + ], + "description": "SAML2 PHP library from SimpleSAMLphp", + "time": "2019-11-06T10:00:32+00:00" + }, + { + "name": "symfony/config", + "version": "v3.4.33", + "source": { + "type": "git", + "url": "https://github.com/symfony/config.git", + "reference": "c111091db748ed394fd8c3e473a90ad3b80e08ad" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/config/zipball/c111091db748ed394fd8c3e473a90ad3b80e08ad", + "reference": "c111091db748ed394fd8c3e473a90ad3b80e08ad", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8", + "symfony/filesystem": "~2.8|~3.0|~4.0", + "symfony/polyfill-ctype": "~1.8" + }, + "conflict": { + "symfony/dependency-injection": "<3.3", + "symfony/finder": "<3.3" + }, + "require-dev": { + "symfony/dependency-injection": "~3.3|~4.0", + "symfony/event-dispatcher": "~3.3|~4.0", + "symfony/finder": "~3.3|~4.0", + "symfony/yaml": "~3.0|~4.0" + }, + "suggest": { + "symfony/yaml": "To use the yaml reference dumper" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Config\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Config Component", + "homepage": "https://symfony.com", + "time": "2019-10-30T12:46:47+00:00" + }, + { + "name": "symfony/debug", + "version": "v3.4.33", + "source": { + "type": "git", + "url": "https://github.com/symfony/debug.git", + "reference": "f72e33fdb1170b326e72c3157f0cd456351dd086" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/debug/zipball/f72e33fdb1170b326e72c3157f0cd456351dd086", + "reference": "f72e33fdb1170b326e72c3157f0cd456351dd086", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8", + "psr/log": "~1.0" + }, + "conflict": { + "symfony/http-kernel": ">=2.3,<2.3.24|~2.4.0|>=2.5,<2.5.9|>=2.6,<2.6.2" + }, + "require-dev": { + "symfony/http-kernel": "~2.8|~3.0|~4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Debug\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Debug Component", + "homepage": "https://symfony.com", + "time": "2019-10-24T15:33:53+00:00" + }, + { + "name": "symfony/dependency-injection", + "version": "v3.4.33", + "source": { + "type": "git", + "url": "https://github.com/symfony/dependency-injection.git", + "reference": "413a2c0cae6a1a5d8720bdfeebc0dbbfac24155d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/413a2c0cae6a1a5d8720bdfeebc0dbbfac24155d", + "reference": "413a2c0cae6a1a5d8720bdfeebc0dbbfac24155d", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8", + "psr/container": "^1.0" + }, + "conflict": { + "symfony/config": "<3.3.7", + "symfony/finder": "<3.3", + "symfony/proxy-manager-bridge": "<3.4", + "symfony/yaml": "<3.4" + }, + "provide": { + "psr/container-implementation": "1.0" + }, + "require-dev": { + "symfony/config": "~3.3|~4.0", + "symfony/expression-language": "~2.8|~3.0|~4.0", + "symfony/yaml": "~3.4|~4.0" + }, + "suggest": { + "symfony/config": "", + "symfony/expression-language": "For using expressions in service container configuration", + "symfony/finder": "For using double-star glob patterns or when GLOB_BRACE portability is required", + "symfony/proxy-manager-bridge": "Generate service proxies to lazy load them", + "symfony/yaml": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\DependencyInjection\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony DependencyInjection Component", + "homepage": "https://symfony.com", + "time": "2019-10-24T15:33:53+00:00" + }, + { + "name": "symfony/event-dispatcher", + "version": "v3.4.33", + "source": { + "type": "git", + "url": "https://github.com/symfony/event-dispatcher.git", + "reference": "f9031c22ec127d4a2450760f81a8677fe8a10177" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/f9031c22ec127d4a2450760f81a8677fe8a10177", + "reference": "f9031c22ec127d4a2450760f81a8677fe8a10177", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8" + }, + "conflict": { + "symfony/dependency-injection": "<3.3" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/config": "~2.8|~3.0|~4.0", + "symfony/dependency-injection": "~3.3|~4.0", + "symfony/expression-language": "~2.8|~3.0|~4.0", + "symfony/stopwatch": "~2.8|~3.0|~4.0" + }, + "suggest": { + "symfony/dependency-injection": "", + "symfony/http-kernel": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\EventDispatcher\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony EventDispatcher Component", + "homepage": "https://symfony.com", + "time": "2019-10-24T15:33:53+00:00" + }, + { + "name": "symfony/filesystem", + "version": "v3.4.33", + "source": { + "type": "git", + "url": "https://github.com/symfony/filesystem.git", + "reference": "00e3a6ddd723b8bcfe4f2a1b6f82b98eeeb51516" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/00e3a6ddd723b8bcfe4f2a1b6f82b98eeeb51516", + "reference": "00e3a6ddd723b8bcfe4f2a1b6f82b98eeeb51516", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8", + "symfony/polyfill-ctype": "~1.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Filesystem\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Filesystem Component", + "homepage": "https://symfony.com", + "time": "2019-08-20T13:31:17+00:00" + }, + { + "name": "symfony/http-foundation", + "version": "v3.4.33", + "source": { + "type": "git", + "url": "https://github.com/symfony/http-foundation.git", + "reference": "7b4626ab40d8562707e6d1c9a6fab977a86c2037" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/7b4626ab40d8562707e6d1c9a6fab977a86c2037", + "reference": "7b4626ab40d8562707e6d1c9a6fab977a86c2037", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8", + "symfony/polyfill-mbstring": "~1.1", + "symfony/polyfill-php70": "~1.6" + }, + "require-dev": { + "symfony/expression-language": "~2.8|~3.0|~4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\HttpFoundation\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony HttpFoundation Component", + "homepage": "https://symfony.com", + "time": "2019-10-24T15:33:53+00:00" + }, + { + "name": "symfony/http-kernel", + "version": "v3.4.33", + "source": { + "type": "git", + "url": "https://github.com/symfony/http-kernel.git", + "reference": "a2e189ee513dc02df98bf8ac8e1a765afd91e41f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/a2e189ee513dc02df98bf8ac8e1a765afd91e41f", + "reference": "a2e189ee513dc02df98bf8ac8e1a765afd91e41f", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8", + "psr/log": "~1.0", + "symfony/debug": "^3.3.3|~4.0", + "symfony/event-dispatcher": "~2.8|~3.0|~4.0", + "symfony/http-foundation": "~3.4.12|~4.0.12|^4.1.1", + "symfony/polyfill-ctype": "~1.8" + }, + "conflict": { + "symfony/config": "<2.8", + "symfony/dependency-injection": "<3.4.10|<4.0.10,>=4", + "symfony/var-dumper": "<3.3", + "twig/twig": "<1.34|<2.4,>=2" + }, + "provide": { + "psr/log-implementation": "1.0" + }, + "require-dev": { + "psr/cache": "~1.0", + "symfony/browser-kit": "~2.8|~3.0|~4.0", + "symfony/class-loader": "~2.8|~3.0", + "symfony/config": "~2.8|~3.0|~4.0", + "symfony/console": "~2.8|~3.0|~4.0", + "symfony/css-selector": "~2.8|~3.0|~4.0", + "symfony/dependency-injection": "^3.4.10|^4.0.10", + "symfony/dom-crawler": "~2.8|~3.0|~4.0", + "symfony/expression-language": "~2.8|~3.0|~4.0", + "symfony/finder": "~2.8|~3.0|~4.0", + "symfony/process": "~2.8|~3.0|~4.0", + "symfony/routing": "~3.4|~4.0", + "symfony/stopwatch": "~2.8|~3.0|~4.0", + "symfony/templating": "~2.8|~3.0|~4.0", + "symfony/translation": "~2.8|~3.0|~4.0", + "symfony/var-dumper": "~3.3|~4.0" + }, + "suggest": { + "symfony/browser-kit": "", + "symfony/config": "", + "symfony/console": "", + "symfony/dependency-injection": "", + "symfony/finder": "", + "symfony/var-dumper": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\HttpKernel\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony HttpKernel Component", + "homepage": "https://symfony.com", + "time": "2019-11-01T09:46:31+00:00" + }, + { + "name": "symfony/polyfill-ctype", + "version": "v1.12.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "550ebaac289296ce228a706d0867afc34687e3f4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/550ebaac289296ce228a706d0867afc34687e3f4", + "reference": "550ebaac289296ce228a706d0867afc34687e3f4", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-ctype": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.12-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for ctype functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "ctype", + "polyfill", + "portable" + ], + "time": "2019-08-06T08:03:45+00:00" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.12.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "b42a2f66e8f1b15ccf25652c3424265923eb4f17" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/b42a2f66e8f1b15ccf25652c3424265923eb4f17", + "reference": "b42a2f66e8f1b15ccf25652c3424265923eb4f17", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.12-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" ], - "time": "2016-10-03T12:34:15+00:00" + "time": "2019-08-06T08:03:45+00:00" }, { - "name": "psr/log", - "version": "1.0.2", + "name": "symfony/polyfill-php70", + "version": "v1.12.0", "source": { "type": "git", - "url": "https://github.com/php-fig/log.git", - "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d" + "url": "https://github.com/symfony/polyfill-php70.git", + "reference": "54b4c428a0054e254223797d2713c31e08610831" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", - "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", + "url": "https://api.github.com/repos/symfony/polyfill-php70/zipball/54b4c428a0054e254223797d2713c31e08610831", + "reference": "54b4c428a0054e254223797d2713c31e08610831", "shasum": "" }, "require": { - "php": ">=5.3.0" + "paragonie/random_compat": "~1.0|~2.0|~9.99", + "php": ">=5.3.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "1.12-dev" } }, "autoload": { "psr-4": { - "Psr\\Log\\": "Psr/Log/" - } + "Symfony\\Polyfill\\Php70\\": "" + }, + "files": [ + "bootstrap.php" + ], + "classmap": [ + "Resources/stubs" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -205,136 +1025,179 @@ ], "authors": [ { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "Common interface for logging libraries", - "homepage": "https://github.com/php-fig/log", + "description": "Symfony polyfill backporting some PHP 7.0+ features to lower PHP versions", + "homepage": "https://symfony.com", "keywords": [ - "log", - "psr", - "psr-3" + "compatibility", + "polyfill", + "portable", + "shim" ], - "time": "2016-10-10T12:19:37+00:00" + "time": "2019-08-06T08:03:45+00:00" }, { - "name": "robrichards/xmlseclibs", - "version": "3.0.1", + "name": "symfony/routing", + "version": "v3.4.33", "source": { "type": "git", - "url": "https://github.com/robrichards/xmlseclibs.git", - "reference": "d937712f70f93a584eb0299ccd87dc6374003781" + "url": "https://github.com/symfony/routing.git", + "reference": "ebc745e728f7a9fb571e7c116a14245c00b8f366" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/robrichards/xmlseclibs/zipball/d937712f70f93a584eb0299ccd87dc6374003781", - "reference": "d937712f70f93a584eb0299ccd87dc6374003781", + "url": "https://api.github.com/repos/symfony/routing/zipball/ebc745e728f7a9fb571e7c116a14245c00b8f366", + "reference": "ebc745e728f7a9fb571e7c116a14245c00b8f366", "shasum": "" }, "require": { - "php": ">= 5.4" + "php": "^5.5.9|>=7.0.8" + }, + "conflict": { + "symfony/config": "<3.3.1", + "symfony/dependency-injection": "<3.3", + "symfony/yaml": "<3.4" + }, + "require-dev": { + "doctrine/annotations": "~1.0", + "psr/log": "~1.0", + "symfony/config": "^3.3.1|~4.0", + "symfony/dependency-injection": "~3.3|~4.0", + "symfony/expression-language": "~2.8|~3.0|~4.0", + "symfony/http-foundation": "~2.8|~3.0|~4.0", + "symfony/yaml": "~3.4|~4.0" }, "suggest": { - "ext-openssl": "OpenSSL extension" + "doctrine/annotations": "For using the annotation loader", + "symfony/config": "For using the all-in-one router or any loader", + "symfony/expression-language": "For using expression matching", + "symfony/http-foundation": "For using a Symfony Request object", + "symfony/yaml": "For using the YAML loader" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, "autoload": { "psr-4": { - "RobRichards\\XMLSecLibs\\": "src" - } + "Symfony\\Component\\Routing\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], - "description": "A PHP library for XML Security", - "homepage": "https://github.com/robrichards/xmlseclibs", + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Routing Component", + "homepage": "https://symfony.com", "keywords": [ - "security", - "signature", - "xml", - "xmldsig" + "router", + "routing", + "uri", + "url" ], - "time": "2017-08-31T09:27:07+00:00" + "time": "2019-10-24T15:33:53+00:00" }, { - "name": "simplesamlphp/saml2", - "version": "v3.1.4", + "name": "symfony/yaml", + "version": "v3.4.33", "source": { "type": "git", - "url": "https://github.com/simplesamlphp/saml2.git", - "reference": "4f6af7f69f29df8555a18b9bb7b646906b45924d" + "url": "https://github.com/symfony/yaml.git", + "reference": "dab657db15207879217fc81df4f875947bf68804" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/simplesamlphp/saml2/zipball/4f6af7f69f29df8555a18b9bb7b646906b45924d", - "reference": "4f6af7f69f29df8555a18b9bb7b646906b45924d", + "url": "https://api.github.com/repos/symfony/yaml/zipball/dab657db15207879217fc81df4f875947bf68804", + "reference": "dab657db15207879217fc81df4f875947bf68804", "shasum": "" }, "require": { - "ext-dom": "*", - "ext-openssl": "*", - "ext-zlib": "*", - "php": ">=5.4", - "psr/log": "~1.0", - "robrichards/xmlseclibs": "^3.0" + "php": "^5.5.9|>=7.0.8", + "symfony/polyfill-ctype": "~1.8" + }, + "conflict": { + "symfony/console": "<3.4" }, "require-dev": { - "mockery/mockery": "~0.9", - "phpmd/phpmd": "~1.5", - "phpunit/phpunit": "~3.7", - "sebastian/phpcpd": "~1.4", - "sensiolabs/security-checker": "~1.1", - "squizlabs/php_codesniffer": "~1.4" + "symfony/console": "~3.4|~4.0" + }, + "suggest": { + "symfony/console": "For validating YAML files using the lint command" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "v3.0.x-dev" + "dev-master": "3.4-dev" } }, "autoload": { - "psr-0": { - "SAML2\\": "src/" + "psr-4": { + "Symfony\\Component\\Yaml\\": "" }, - "files": [ - "src/_autoload.php" + "exclude-from-classmap": [ + "/Tests/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "LGPL-2.1-or-later" + "MIT" ], "authors": [ { - "name": "Andreas Åkre Solberg", - "email": "andreas.solberg@uninett.no" + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "SAML2 PHP library from SimpleSAMLphp", - "time": "2018-03-02T14:30:38+00:00" + "description": "Symfony Yaml Component", + "homepage": "https://symfony.com", + "time": "2019-10-24T15:33:53+00:00" }, { "name": "twig/extensions", - "version": "v1.5.1", + "version": "v1.5.4", "source": { "type": "git", "url": "https://github.com/twigphp/Twig-extensions.git", - "reference": "d188c76168b853481cc75879ea045bf93d718e9c" + "reference": "57873c8b0c1be51caa47df2cdb824490beb16202" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig-extensions/zipball/d188c76168b853481cc75879ea045bf93d718e9c", - "reference": "d188c76168b853481cc75879ea045bf93d718e9c", + "url": "https://api.github.com/repos/twigphp/Twig-extensions/zipball/57873c8b0c1be51caa47df2cdb824490beb16202", + "reference": "57873c8b0c1be51caa47df2cdb824490beb16202", "shasum": "" }, "require": { - "twig/twig": "~1.27|~2.0" + "twig/twig": "^1.27|^2.0" }, "require-dev": { - "symfony/phpunit-bridge": "~3.3@dev", - "symfony/translation": "~2.3|~3.0" + "symfony/phpunit-bridge": "^3.4", + "symfony/translation": "^2.7|^3.4" }, "suggest": { "symfony/translation": "Allow the time_diff output to be translated" @@ -364,39 +1227,39 @@ } ], "description": "Common additional features for Twig that do not directly belong in core", - "homepage": "http://twig.sensiolabs.org/doc/extensions/index.html", "keywords": [ "i18n", "text" ], - "time": "2017-06-08T18:19:53+00:00" + "time": "2018-12-05T18:34:18+00:00" }, { "name": "twig/twig", - "version": "v1.35.0", + "version": "v1.42.3", "source": { "type": "git", "url": "https://github.com/twigphp/Twig.git", - "reference": "daa657073e55b0a78cce8fdd22682fddecc6385f" + "reference": "201baee843e0ffe8b0b956f336dd42b2a92fae4e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/daa657073e55b0a78cce8fdd22682fddecc6385f", - "reference": "daa657073e55b0a78cce8fdd22682fddecc6385f", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/201baee843e0ffe8b0b956f336dd42b2a92fae4e", + "reference": "201baee843e0ffe8b0b956f336dd42b2a92fae4e", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=5.5.0", + "symfony/polyfill-ctype": "^1.8" }, "require-dev": { "psr/container": "^1.0", - "symfony/debug": "~2.7", - "symfony/phpunit-bridge": "~3.3@dev" + "symfony/debug": "^3.4|^4.2", + "symfony/phpunit-bridge": "^4.4@dev|^5.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.35-dev" + "dev-master": "1.42-dev" } }, "autoload": { @@ -418,23 +1281,73 @@ "homepage": "http://fabien.potencier.org", "role": "Lead Developer" }, + { + "name": "Twig Team", + "homepage": "https://twig.symfony.com/contributors", + "role": "Contributors" + }, { "name": "Armin Ronacher", "email": "armin.ronacher@active-4.com", "role": "Project Founder" - }, - { - "name": "Twig Team", - "homepage": "http://twig.sensiolabs.org/contributors", - "role": "Contributors" } ], "description": "Twig, the flexible, fast, and secure template language for PHP", - "homepage": "http://twig.sensiolabs.org", + "homepage": "https://twig.symfony.com", "keywords": [ "templating" ], - "time": "2017-09-27T18:06:46+00:00" + "time": "2019-08-24T12:51:03+00:00" + }, + { + "name": "webmozart/assert", + "version": "1.5.0", + "source": { + "type": "git", + "url": "https://github.com/webmozart/assert.git", + "reference": "88e6d84706d09a236046d686bbea96f07b3a34f4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webmozart/assert/zipball/88e6d84706d09a236046d686bbea96f07b3a34f4", + "reference": "88e6d84706d09a236046d686bbea96f07b3a34f4", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0", + "symfony/polyfill-ctype": "^1.8" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.36 || ^7.5.13" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3-dev" + } + }, + "autoload": { + "psr-4": { + "Webmozart\\Assert\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "Assertions to validate method input/output with nice error messages.", + "keywords": [ + "assert", + "check", + "validate" + ], + "time": "2019-08-24T08:43:50+00:00" }, { "name": "whitehat101/apr1-md5", @@ -537,24 +1450,24 @@ "time": "2015-06-14T21:17:01+00:00" }, { - "name": "mikey179/vfsStream", - "version": "v1.6.5", + "name": "mikey179/vfsstream", + "version": "v1.6.8", "source": { "type": "git", - "url": "https://github.com/mikey179/vfsStream.git", - "reference": "d5fec95f541d4d71c4823bb5e30cf9b9e5b96145" + "url": "https://github.com/bovigo/vfsStream.git", + "reference": "231c73783ebb7dd9ec77916c10037eff5a2b6efe" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/mikey179/vfsStream/zipball/d5fec95f541d4d71c4823bb5e30cf9b9e5b96145", - "reference": "d5fec95f541d4d71c4823bb5e30cf9b9e5b96145", + "url": "https://api.github.com/repos/bovigo/vfsStream/zipball/231c73783ebb7dd9ec77916c10037eff5a2b6efe", + "reference": "231c73783ebb7dd9ec77916c10037eff5a2b6efe", "shasum": "" }, "require": { "php": ">=5.3.0" }, "require-dev": { - "phpunit/phpunit": "~4.5" + "phpunit/phpunit": "^4.5|^5.0" }, "type": "library", "extra": { @@ -580,7 +1493,7 @@ ], "description": "Virtual file system to mock the real file system in unit tests.", "homepage": "http://vfs.bovigo.org/", - "time": "2017-08-01T08:02:14+00:00" + "time": "2019-10-30T15:31:00+00:00" }, { "name": "phpdocumentor/reflection-common", @@ -638,22 +1551,22 @@ }, { "name": "phpdocumentor/reflection-docblock", - "version": "3.3.2", + "version": "3.2.2", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "bf329f6c1aadea3299f08ee804682b7c45b326a2" + "reference": "4aada1f93c72c35e22fb1383b47fee43b8f1d157" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/bf329f6c1aadea3299f08ee804682b7c45b326a2", - "reference": "bf329f6c1aadea3299f08ee804682b7c45b326a2", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/4aada1f93c72c35e22fb1383b47fee43b8f1d157", + "reference": "4aada1f93c72c35e22fb1383b47fee43b8f1d157", "shasum": "" }, "require": { - "php": "^5.6 || ^7.0", - "phpdocumentor/reflection-common": "^1.0.0", - "phpdocumentor/type-resolver": "^0.4.0", + "php": ">=5.5", + "phpdocumentor/reflection-common": "^1.0@dev", + "phpdocumentor/type-resolver": "^0.3.0", "webmozart/assert": "^1.0" }, "require-dev": { @@ -679,20 +1592,20 @@ } ], "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "time": "2017-11-10T14:09:06+00:00" + "time": "2017-08-08T06:39:58+00:00" }, { "name": "phpdocumentor/type-resolver", - "version": "0.4.0", + "version": "0.3.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7" + "reference": "fb3933512008d8162b3cdf9e18dba9309b7c3773" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/9c977708995954784726e25d0cd1dddf4e65b0f7", - "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/fb3933512008d8162b3cdf9e18dba9309b7c3773", + "reference": "fb3933512008d8162b3cdf9e18dba9309b7c3773", "shasum": "" }, "require": { @@ -726,42 +1639,42 @@ "email": "me@mikevanriel.com" } ], - "time": "2017-07-14T14:27:02+00:00" + "time": "2017-06-03T08:32:36+00:00" }, { "name": "phpspec/prophecy", - "version": "1.7.5", + "version": "1.9.0", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "dfd6be44111a7c41c2e884a336cc4f461b3b2401" + "reference": "f6811d96d97bdf400077a0cc100ae56aa32b9203" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/dfd6be44111a7c41c2e884a336cc4f461b3b2401", - "reference": "dfd6be44111a7c41c2e884a336cc4f461b3b2401", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/f6811d96d97bdf400077a0cc100ae56aa32b9203", + "reference": "f6811d96d97bdf400077a0cc100ae56aa32b9203", "shasum": "" }, "require": { "doctrine/instantiator": "^1.0.2", "php": "^5.3|^7.0", - "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0", - "sebastian/comparator": "^1.1|^2.0", + "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0|^5.0", + "sebastian/comparator": "^1.1|^2.0|^3.0", "sebastian/recursion-context": "^1.0|^2.0|^3.0" }, "require-dev": { "phpspec/phpspec": "^2.5|^3.2", - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5" + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5 || ^7.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.7.x-dev" + "dev-master": "1.8.x-dev" } }, "autoload": { - "psr-0": { - "Prophecy\\": "src/" + "psr-4": { + "Prophecy\\": "src/Prophecy" } }, "notification-url": "https://packagist.org/downloads/", @@ -789,7 +1702,7 @@ "spy", "stub" ], - "time": "2018-02-19T10:16:54+00:00" + "time": "2019-10-03T11:07:50+00:00" }, { "name": "phpunit/php-code-coverage", @@ -1165,6 +2078,7 @@ "mock", "xunit" ], + "abandoned": true, "time": "2015-10-02T06:51:40+00:00" }, { @@ -1538,114 +2452,6 @@ "description": "Library that helps with managing the version number of Git-hosted PHP projects", "homepage": "https://github.com/sebastianbergmann/version", "time": "2015-06-21T13:59:46+00:00" - }, - { - "name": "symfony/yaml", - "version": "v3.4.5", - "source": { - "type": "git", - "url": "https://github.com/symfony/yaml.git", - "reference": "6af42631dcf89e9c616242c900d6c52bd53bd1bb" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/6af42631dcf89e9c616242c900d6c52bd53bd1bb", - "reference": "6af42631dcf89e9c616242c900d6c52bd53bd1bb", - "shasum": "" - }, - "require": { - "php": "^5.5.9|>=7.0.8" - }, - "conflict": { - "symfony/console": "<3.4" - }, - "require-dev": { - "symfony/console": "~3.4|~4.0" - }, - "suggest": { - "symfony/console": "For validating YAML files using the lint command" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.4-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Yaml\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Yaml Component", - "homepage": "https://symfony.com", - "time": "2018-02-16T09:50:28+00:00" - }, - { - "name": "webmozart/assert", - "version": "1.3.0", - "source": { - "type": "git", - "url": "https://github.com/webmozart/assert.git", - "reference": "0df1908962e7a3071564e857d86874dad1ef204a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/webmozart/assert/zipball/0df1908962e7a3071564e857d86874dad1ef204a", - "reference": "0df1908962e7a3071564e857d86874dad1ef204a", - "shasum": "" - }, - "require": { - "php": "^5.3.3 || ^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.6", - "sebastian/version": "^1.0.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.3-dev" - } - }, - "autoload": { - "psr-4": { - "Webmozart\\Assert\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Bernhard Schussek", - "email": "bschussek@gmail.com" - } - ], - "description": "Assertions to validate method input/output with nice error messages.", - "keywords": [ - "assert", - "check", - "validate" - ], - "time": "2018-01-29T19:49:41+00:00" } ], "aliases": [], @@ -1654,7 +2460,7 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": ">=5.4", + "php": ">=5.5", "ext-spl": "*", "ext-zlib": "*", "ext-pcre": "*", @@ -1666,6 +2472,6 @@ "ext-mbstring": "*" }, "platform-dev": { - "ext-pdo_sqlite": "*" + "ext-curl": "*" } } diff --git a/vendor/simplesamlphp/simplesamlphp/config-templates/acl.php b/vendor/simplesamlphp/simplesamlphp/config-templates/acl.php index 7dcca16535..cb760d0aa7 100644 --- a/vendor/simplesamlphp/simplesamlphp/config-templates/acl.php +++ b/vendor/simplesamlphp/simplesamlphp/config-templates/acl.php @@ -4,58 +4,56 @@ * This file defines "named" access control lists, which can * be reused in several places. */ -$config = array( - - 'adminlist' => array( - //array('allow', 'equals', 'mail', 'admin1@example.org'), - //array('allow', 'has', 'groups', 'admin'), - // The default action is to deny access. - ), - - 'example-simple' => array( - array('allow', 'equals', 'mail', 'admin1@example.org'), - array('allow', 'equals', 'mail', 'admin2@example.org'), - // The default action is to deny access. - ), - - 'example-deny-some' => array( - array('deny', 'equals', 'mail', 'eviluser@example.org'), - array('allow'), // Allow everybody else. - ), - - 'example-maildomain' => array( - array('allow', 'equals-preg', 'mail', '/@example\.org$/'), - // The default action is to deny access. - ), - - 'example-allow-employees' => array( - array('allow', 'has', 'eduPersonAffiliation', 'employee'), - // The default action is to deny access. - ), - - 'example-allow-employees-not-students' => array( - array('deny', 'has', 'eduPersonAffiliation', 'student'), - array('allow', 'has', 'eduPersonAffiliation', 'employee'), - // The default action is to deny access. - ), - - 'example-deny-student-except-one' => array( - array('deny', 'and', - array('has', 'eduPersonAffiliation', 'student'), - array('not', 'equals', 'mail', 'user@example.org'), - ), - array('allow'), - ), - - 'example-allow-or' => array( - array('allow', 'or', - array('equals', 'eduPersonAffiliation', 'student', 'member'), - array('equals', 'mail', 'someuser@example2.org'), - ), - ), - - 'example-allow-all' => array( - array('allow'), - ), - -); \ No newline at end of file +$config = [ + 'adminlist' => [ + //['allow', 'equals', 'mail', 'admin1@example.org'], + //['allow', 'has', 'groups', 'admin'], + // The default action is to deny access. + ], + + 'example-simple' => [ + ['allow', 'equals', 'mail', 'admin1@example.org'], + ['allow', 'equals', 'mail', 'admin2@example.org'], + // The default action is to deny access. + ], + + 'example-deny-some' => [ + ['deny', 'equals', 'mail', 'eviluser@example.org'], + ['allow'], // Allow everybody else. + ], + + 'example-maildomain' => [ + ['allow', 'equals-preg', 'mail', '/@example\.org$/'], + // The default action is to deny access. + ], + + 'example-allow-employees' => [ + ['allow', 'has', 'eduPersonAffiliation', 'employee'], + // The default action is to deny access. + ], + + 'example-allow-employees-not-students' => [ + ['deny', 'has', 'eduPersonAffiliation', 'student'], + ['allow', 'has', 'eduPersonAffiliation', 'employee'], + // The default action is to deny access. + ], + + 'example-deny-student-except-one' => [ + ['deny', 'and', + ['has', 'eduPersonAffiliation', 'student'], + ['not', 'equals', 'mail', 'user@example.org'], + ], + ['allow'], + ], + + 'example-allow-or' => [ + ['allow', 'or', + ['equals', 'eduPersonAffiliation', 'student', 'member'], + ['equals', 'mail', 'someuser@example2.org'], + ], + ], + + 'example-allow-all' => [ + ['allow'], + ], +]; diff --git a/vendor/simplesamlphp/simplesamlphp/config-templates/authmemcookie.php b/vendor/simplesamlphp/simplesamlphp/config-templates/authmemcookie.php index b8e8df8f98..fac0281381 100644 --- a/vendor/simplesamlphp/simplesamlphp/config-templates/authmemcookie.php +++ b/vendor/simplesamlphp/simplesamlphp/config-templates/authmemcookie.php @@ -4,72 +4,70 @@ * This is the configuration file for the Auth MemCookie example. */ -$config = array( +$config = [ + /* + * The authentication source that should be used. + * + * This must be one of the authentication sources configured in config/authsources.php. + */ + 'authsource' => 'default-sp', - /* - * The authentication source that should be used. - * - * This must be one of the authentication sources configured in config/authsources.php. - */ - 'authsource' => 'default-sp', + /* + * This is the name of the cookie we should save the session id in. The value of this option must match the + * Auth_memCookie_CookieName option in the Auth MemCookie configuration. The default value is 'AuthMemCookie'. + * + * Default: + * 'cookiename' => 'AuthMemCookie', + */ + 'cookiename' => 'AuthMemCookie', - /* - * This is the name of the cookie we should save the session id in. The value of this option must match the - * Auth_memCookie_CookieName option in the Auth MemCookie configuration. The default value is 'AuthMemCookie'. - * - * Default: - * 'cookiename' => 'AuthMemCookie', - */ - 'cookiename' => 'AuthMemCookie', + /* + * This option specifies the name of the attribute which contains the username of the user. It must be set to + * a valid attribute name. + * + * Examples: + * 'username' => 'uid', // LDAP attribute for user id. + * 'username' => 'mail', // LDAP attribute for email address. + * + * Default: + * No default value. + */ + 'username' => null, - /* - * This option specifies the name of the attribute which contains the username of the user. It must be set to - * a valid attribute name. - * - * Examples: - * 'username' => 'uid', // LDAP attribute for user id. - * 'username' => 'mail', // LDAP attribute for email address. - * - * Default: - * No default value. - */ - 'username' => NULL, + /* + * This option specifies the name of the attribute which contains the groups of the user. Set this option to + * NULL if you don't want to include any groups. + * + * Example: + * 'groups' => 'edupersonaffiliation', + * + * Default: + * 'groups' => null, + */ + 'groups' => null, - /* - * This option specifies the name of the attribute which contains the groups of the user. Set this option to - * NULL if you don't want to include any groups. - * - * Example: - * 'groups' => 'edupersonaffiliation', - * - * Default: - * 'groups' => NULL, - */ - 'groups' => NULL, + /* + * This option contains the hostnames or IP addresses of the memcache servers where we should store the + * authentication information. Separator is a comma. This option should match the address part of the + * Auth_memCookie_Memcached_AddrPort option in the Auth MemCookie configuration. + * + * Examples: + * 'memcache.host' => '192.168.93.52', + * 'memcache.host' => 'memcache.example.org', + * 'memcache.host' => 'memcache1.example.org,memcache2.example.org' + * + * Default: + * 'memcache.host' => '127.0.0.1', + */ + 'memcache.host' => '127.0.0.1', - /* - * This option contains the hostnames or IP addresses of the memcache servers where we should store the - * authentication information. Separator is a comma. This option should match the address part of the - * Auth_memCookie_Memcached_AddrPort option in the Auth MemCookie configuration. - * - * Examples: - * 'memcache.host' => '192.168.93.52', - * 'memcache.host' => 'memcache.example.org', - * 'memcache.host' => 'memcache1.example.org,memcache2.example.org' - * - * Default: - * 'memcache.host' => '127.0.0.1', - */ - 'memcache.host' => '127.0.0.1', - - /* - * This option contains the port number of the memcache server where we should store the - * authentication information. This option should match the port part of the - * Auth_memCookie_Memcached_AddrPort option in the Auth MemCookie configuration. - * - * Default: - * 'memcache.port' => 11211, - */ - 'memcache.port' => 11211, - -); + /* + * This option contains the port number of the memcache server where we should store the + * authentication information. This option should match the port part of the + * Auth_memCookie_Memcached_AddrPort option in the Auth MemCookie configuration. + * + * Default: + * 'memcache.port' => 11211, + */ + 'memcache.port' => 11211, +]; diff --git a/vendor/simplesamlphp/simplesamlphp/config-templates/authsources.php b/vendor/simplesamlphp/simplesamlphp/config-templates/authsources.php index 6afe417811..0d8da0e9c6 100644 --- a/vendor/simplesamlphp/simplesamlphp/config-templates/authsources.php +++ b/vendor/simplesamlphp/simplesamlphp/config-templates/authsources.php @@ -1,26 +1,26 @@ <?php -$config = array( +$config = [ // This is a authentication source which handles admin authentication. - 'admin' => array( + 'admin' => [ // The default is to use core:AdminPassword, but it can be replaced with // any authentication source. 'core:AdminPassword', - ), + ], // An authentication source which can authenticate against both SAML 2.0 // and Shibboleth 1.3 IdPs. - 'default-sp' => array( + 'default-sp' => [ 'saml:SP', // The entity ID of this SP. // Can be NULL/unset, in which case an entity ID is generated based on the metadata URL. 'entityID' => null, - // The entity ID of the IdP this should SP should contact. + // The entity ID of the IdP this SP should contact. // Can be NULL/unset, in which case the user will be shown a list of available IdPs. 'idp' => null, @@ -28,26 +28,6 @@ // Can be NULL/unset, in which case a builtin discovery service will be used. 'discoURL' => null, - /* - * WARNING: SHA-1 is disallowed starting January the 1st, 2014. - * - * Uncomment the following option to start using SHA-256 for your signatures. - * Currently, SimpleSAMLphp defaults to SHA-1, which has been deprecated since - * 2011, and will be disallowed by NIST as of 2014. Please refer to the following - * document for more information: - * - * http://csrc.nist.gov/publications/nistpubs/800-131A/sp800-131A.pdf - * - * If you are uncertain about identity providers supporting SHA-256 or other - * algorithms of the SHA-2 family, you can configure it individually in the - * IdP-remote metadata set for those that support it. Once you are certain that - * all your configured IdPs support SHA-2, you can safely remove the configuration - * options in the IdP-remote metadata set and uncomment the following option. - * - * Please refer to the hosted SP configuration reference for more information. - */ - //'signature.algorithm' => 'http://www.w3.org/2001/04/xmldsig-more#rsa-sha256', - /* * The attributes parameter must contain an array of desired attributes by the SP. * The attributes can be expressed as an array of names or as an associative array @@ -55,79 +35,81 @@ * The metadata will then be created as follows: * <md:RequestedAttribute FriendlyName="friendlyName" Name="name" /> */ - /*'name' => array( - 'en' => 'A service', - 'no' => 'En tjeneste', - ), + /* + 'name' => [ + 'en' => 'A service', + 'no' => 'En tjeneste', + ], - 'attributes' => array( + 'attributes' => [ 'attrname' => 'urn:oid:x.x.x.x', - ),*/ - /*'attributes.required' => array ( + ], + 'attributes.required' => [ 'urn:oid:x.x.x.x', - ),*/ - ), + ], + */ + ], /* - 'example-sql' => array( + 'example-sql' => [ 'sqlauth:SQL', 'dsn' => 'pgsql:host=sql.example.org;port=5432;dbname=simplesaml', 'username' => 'simplesaml', 'password' => 'secretpassword', - 'query' => 'SELECT uid, givenName, email, eduPersonPrincipalName FROM users WHERE uid = :username AND password = SHA2(CONCAT((SELECT salt FROM users WHERE uid = :username), :password),256);', - ), + 'query' => 'SELECT uid, givenName, email, eduPersonPrincipalName FROM users WHERE uid = :username AND password = SHA2(CONCAT((SELECT salt FROM users WHERE uid = :username), :password), 256);', + ], */ /* - 'example-static' => array( + 'example-static' => [ 'exampleauth:Static', - 'uid' => array('testuser'), - 'eduPersonAffiliation' => array('member', 'employee'), - 'cn' => array('Test User'), - ), + 'uid' => ['testuser'], + 'eduPersonAffiliation' => ['member', 'employee'], + 'cn' => ['Test User'], + ], */ /* - 'example-userpass' => array( + 'example-userpass' => [ 'exampleauth:UserPass', // Give the user an option to save their username for future login attempts // And when enabled, what should the default be, to save the username or not - //'remember.username.enabled' => FALSE, - //'remember.username.checked' => FALSE, - - 'student:studentpass' => array( - 'uid' => array('test'), - 'eduPersonAffiliation' => array('member', 'student'), - ), - 'employee:employeepass' => array( - 'uid' => array('employee'), - 'eduPersonAffiliation' => array('member', 'employee'), - ), - ), + //'remember.username.enabled' => false, + //'remember.username.checked' => false, + + 'student:studentpass' => [ + 'uid' => ['test'], + 'eduPersonAffiliation' => ['member', 'student'], + ], + 'employee:employeepass' => [ + 'uid' => ['employee'], + 'eduPersonAffiliation' => ['member', 'employee'], + ], + ], */ /* - 'crypto-hash' => array( + 'crypto-hash' => [ 'authcrypt:Hash', // hashed version of 'verysecret', made with bin/pwgen.php - 'professor:{SSHA256}P6FDTEEIY2EnER9a6P2GwHhI5JDrwBgjQ913oVQjBngmCtrNBUMowA==' => array( - 'uid' => array('prof_a'), - 'eduPersonAffiliation' => array('member', 'employee', 'board'), - ), - ), + 'professor:{SSHA256}P6FDTEEIY2EnER9a6P2GwHhI5JDrwBgjQ913oVQjBngmCtrNBUMowA==' => [ + 'uid' => ['prof_a'], + 'eduPersonAffiliation' => ['member', 'employee', 'board'], + ], + ], */ /* - 'htpasswd' => array( + 'htpasswd' => [ 'authcrypt:Htpasswd', 'htpasswd_file' => '/var/www/foo.edu/legacy_app/.htpasswd', - 'static_attributes' => array( - 'eduPersonAffiliation' => array('member', 'employee'), - 'Organization' => array('University of Foo'), - ), - ), + 'static_attributes' => [ + 'eduPersonAffiliation' => ['member', 'employee'], + 'Organization' => ['University of Foo'], + ], + ], */ /* @@ -135,68 +117,21 @@ // external authentication engine. Take a look at the comment in the beginning // of modules/exampleauth/lib/Auth/Source/External.php for a description of // how to adjust it to your own site. - 'example-external' => array( + 'example-external' => [ 'exampleauth:External', - ), + ], */ /* - 'yubikey' => array( + 'yubikey' => [ 'authYubiKey:YubiKey', 'id' => '000', // 'key' => '012345678', - ), - */ - - /* - 'openid' => array( - 'openid:OpenIDConsumer', - 'attributes.required' => array('nickname'), - 'attributes.optional' => array('fullname', 'email',), - // 'sreg.validate' => FALSE, - 'attributes.ax_required' => array('http://axschema.org/namePerson/friendly'), - 'attributes.ax_optional' => array('http://axschema.org/namePerson','http://axschema.org/contact/email'), - // Prefer HTTP redirect over POST - // 'prefer_http_redirect' => FALSE, - ), - */ - - /* - // Example of an authsource that authenticates against Google. - // See: http://code.google.com/apis/accounts/docs/OpenID.html - 'google' => array( - 'openid:OpenIDConsumer', - // Googles OpenID endpoint. - 'target' => 'https://www.google.com/accounts/o8/id', - // Custom realm - // 'realm' => 'http://*.example.org', - // Attributes that google can supply. - 'attributes.ax_required' => array( - //'http://axschema.org/namePerson/first', - //'http://axschema.org/namePerson/last', - //'http://axschema.org/contact/email', - //'http://axschema.org/contact/country/home', - //'http://axschema.org/pref/language', - ), - // custom extension arguments - 'extension.args' => array( - //'http://specs.openid.net/extensions/ui/1.0' => array( - // 'mode' => 'popup', - // 'icon' => 'true', - //), - ), - ), + ], */ /* - 'papi' => array( - 'authpapi:PAPI', - ), - */ - - - /* - 'facebook' => array( + 'facebook' => [ 'authfacebook:Facebook', // Register your Facebook application on http://www.facebook.com/developers // App ID or API key (requests with App ID should be faster; https://github.com/facebook/php-sdk/issues/214) @@ -210,79 +145,54 @@ // When empty, only the app-specific user id and name will be returned // See https://developers.facebook.com/docs/graph-api/reference/v2.6/user for the full list // 'user_fields' => 'email,birthday,third_party_id,name,first_name,last_name', - ), - */ - - /* - // LinkedIn OAuth Authentication API. - // Register your application to get an API key here: - // https://www.linkedin.com/secure/developer - // Attributes definition: - // https://developer.linkedin.com/docs/fields - 'linkedin' => array( - 'authlinkedin:LinkedIn', - 'key' => 'xxxxxxxxxxxxxxxx', - 'secret' => 'xxxxxxxxxxxxxxxx', - 'attributes' => 'id,first-name,last-name,headline,summary,specialties,picture-url,email-address', - ), + ], */ /* // Twitter OAuth Authentication API. // Register your application to get an API key here: // http://twitter.com/oauth_clients - 'twitter' => array( + 'twitter' => [ 'authtwitter:Twitter', 'key' => 'xxxxxxxxxxxxxxxx', 'secret' => 'xxxxxxxxxxxxxxxx', // Forces the user to enter their credentials to ensure the correct users account is authorized. // Details: https://dev.twitter.com/docs/api/1/get/oauth/authenticate - 'force_login' => FALSE, - ), - */ - - /* - // MySpace OAuth Authentication API. - // Register your application to get an API key here: - // http://developer.myspace.com/ - 'myspace' => array( - 'authmyspace:MySpace', - 'key' => 'xxxxxxxxxxxxxxxx', - 'secret' => 'xxxxxxxxxxxxxxxx', - ), + 'force_login' => false, + ], */ /* // Microsoft Account (Windows Live ID) Authentication API. // Register your application to get an API key here: // https://apps.dev.microsoft.com/ - 'windowslive' => array( + 'windowslive' => [ 'authwindowslive:LiveID', 'key' => 'xxxxxxxxxxxxxxxx', 'secret' => 'xxxxxxxxxxxxxxxx', - ), + ], */ /* // Example of a LDAP authentication source. - 'example-ldap' => array( + 'example-ldap' => [ 'ldap:LDAP', // Give the user an option to save their username for future login attempts // And when enabled, what should the default be, to save the username or not - //'remember.username.enabled' => FALSE, - //'remember.username.checked' => FALSE, + //'remember.username.enabled' => false, + //'remember.username.checked' => false, // The hostname of the LDAP server. 'hostname' => 'ldap.example.org', // Whether SSL/TLS should be used when contacting the LDAP server. - 'enable_tls' => TRUE, + 'enable_tls' => true, // Whether debug output from the LDAP library should be enabled. // Default is FALSE. - 'debug' => FALSE, + 'debug' => false, // The timeout for accessing the LDAP server, in seconds. // The default is 0, which means no timeout. @@ -293,12 +203,12 @@ 'port' => 389, // Set whether to follow referrals. AD Controllers may require FALSE to function. - 'referrals' => TRUE, + 'referrals' => true, // Which attributes should be retrieved from the LDAP server. // This can be an array of attribute names, or NULL, in which case // all attributes are fetched. - 'attributes' => NULL, + 'attributes' => null, // The pattern which should be used to create the users DN given the username. // %username% in this pattern will be replaced with the users username. @@ -308,7 +218,7 @@ // As an alternative to specifying a pattern for the users DN, it is possible to // search for the username in a set of attributes. This is enabled by this option. - 'search.enable' => FALSE, + 'search.enable' => false, // The DN which will be used as a base for the search. // This can be a single string, in which case only that DN is searched, or an @@ -319,40 +229,45 @@ // // This is an array with one or more attribute names. Any of the attributes in // the array may match the value the username. - 'search.attributes' => array('uid', 'mail'), + 'search.attributes' => ['uid', 'mail'], // Additional LDAP filters appended to the search attributes - 'search.filter' => '(objectclass=inetorgperson)', + //'search.filter' => '(objectclass=inetorgperson)', // The username & password the SimpleSAMLphp should bind to before searching. If // this is left as NULL, no bind will be performed before searching. - 'search.username' => NULL, - 'search.password' => NULL, + 'search.username' => null, + 'search.password' => null, // If the directory uses privilege separation, // the authenticated user may not be able to retrieve // all required attribures, a privileged entity is required // to get them. This is enabled with this option. - 'priv.read' => FALSE, + 'priv.read' => false, // The DN & password the SimpleSAMLphp should bind to before // retrieving attributes. These options are required if // 'priv.read' is set to TRUE. - 'priv.username' => NULL, - 'priv.password' => NULL, + 'priv.username' => null, + 'priv.password' => null, - ), + ], */ /* // Example of an LDAPMulti authentication source. - 'example-ldapmulti' => array( + 'example-ldapmulti' => [ 'ldap:LDAPMulti', // Give the user an option to save their username for future login attempts // And when enabled, what should the default be, to save the username or not - //'remember.username.enabled' => FALSE, - //'remember.username.checked' => FALSE, + //'remember.username.enabled' => false, + //'remember.username.checked' => false, + + // Give the user an option to save their organization choice for future login + // attempts. And when enabled, what should the default be, checked or not. + //'remember.organization.enabled' => false, + //'remember.organization.checked' => false, // The way the organization as part of the username should be handled. // Three possible values: @@ -371,7 +286,7 @@ // username will be used as the user enters it. // // The default is FALSE. - 'include_organization_in_username' => FALSE, + 'include_organization_in_username' => false, // A list of available LDAP servers. // @@ -381,7 +296,7 @@ // // The value of each element is an array in the same format as an LDAP // authentication source. - 'employees' => array( + 'employees' => [ // A short name/description for this group. Will be shown in a dropdown list // when the user logs on. // @@ -392,16 +307,14 @@ // the LDAP authentication source. 'hostname' => 'ldap.employees.example.org', 'dnpattern' => 'uid=%username%,ou=employees,dc=example,dc=org', - ), + ], - 'students' => array( + 'students' => [ 'description' => 'Students', 'hostname' => 'ldap.students.example.org', 'dnpattern' => 'uid=%username%,ou=students,dc=example,dc=org', - ), - - ), + ], + ], */ - -); +]; diff --git a/vendor/simplesamlphp/simplesamlphp/config-templates/config.php b/vendor/simplesamlphp/simplesamlphp/config-templates/config.php index a8e9c160f2..29d7a00436 100644 --- a/vendor/simplesamlphp/simplesamlphp/config-templates/config.php +++ b/vendor/simplesamlphp/simplesamlphp/config-templates/config.php @@ -1,10 +1,10 @@ <?php -/* +/* * The configuration of SimpleSAMLphp - * + * */ -$config = array( +$config = [ /******************************* | BASIC CONFIGURATION OPTIONS | @@ -33,7 +33,7 @@ * The 'application' configuration array groups a set configuration options * relative to an application protected by SimpleSAMLphp. */ - //'application' => array( + //'application' => [ /* * The 'baseURL' configuration option allows you to specify a protocol, * host and optionally a port that serves as the canonical base for all @@ -48,8 +48,8 @@ * need to compute the right URLs yourself and pass them dynamically * to SimpleSAMLphp's API. */ - //'baseURL' => 'https://example.com' - //), + //'baseURL' => 'https://example.com', + //], /* * The following settings are *filesystem paths* which define where @@ -57,10 +57,10 @@ * - 'certdir': The base directory for certificate and key material. * - 'loggingdir': Where to write logs. * - 'datadir': Storage of general data. - * - 'temdir': Saving temporary files. SimpleSAMLphp will attempt to create + * - 'tempdir': Saving temporary files. SimpleSAMLphp will attempt to create * this directory if it doesn't exist. * When specified as a relative path, this is relative to the SimpleSAMLphp - * root directory. + * root directory. */ 'certdir' => 'cert/', 'loggingdir' => 'log/', @@ -75,6 +75,13 @@ 'technicalcontact_name' => 'Administrator', 'technicalcontact_email' => 'na@example.org', + /* + * The envelope from address for outgoing emails. + * This should be in a domain that has your application's IP addresses in its SPF record + * to prevent it from being rejected by mail filters. + */ + //'sendmail_from' => 'no-reply@example.org', + /* * The timezone of the server. This option should be set to the timezone you want * SimpleSAMLphp to report the time in. The default is to guess the timezone based @@ -96,7 +103,7 @@ * 'secretsalt' can be any valid string of any length. * * A possible way to generate a random salt is by running the following command from a unix shell: - * tr -c -d '0123456789abcdefghijklmnopqrstuvwxyz' </dev/urandom | dd bs=32 count=1 2>/dev/null;echo + * LC_CTYPE=C tr -c -d '0123456789abcdefghijklmnopqrstuvwxyz' </dev/urandom | dd bs=32 count=1 2>/dev/null;echo */ 'secretsalt' => 'defaultsecretsalt', @@ -141,9 +148,9 @@ * WHAT YOU ARE DOING! * * Example: - * 'trusted.url.domains' => array('sp.example.com', 'app.example.com'), + * 'trusted.url.domains' => ['sp.example.com', 'app.example.com'], */ - 'trusted.url.domains' => array(), + 'trusted.url.domains' => [], /* * Enable regular expression matching of trusted.url.domains. @@ -169,6 +176,16 @@ */ 'enable.http_post' => false, + /* + * Set the allowed clock skew between encrypting/decrypting assertions + * + * If you have an server that is constantly out of sync, this option + * allows you to adjust the allowed clock-skew. + * + * Allowed range: 180 - 300 + * Defaults to 180. + */ + 'assertion.allowed_clock_skew' => 180, /************************ @@ -207,11 +224,11 @@ * If you want to disable debugging completely, unset this option or set it to an * empty array. */ - 'debug' => array( + 'debug' => [ 'saml' => false, 'backtraces' => true, 'validatexml' => false, - ), + ], /* * When 'showerrors' is enabled, all error messages and stack traces will be output @@ -224,11 +241,11 @@ 'errorreporting' => true, /* - * Custom error show function called from SimpleSAML_Error_Error::show. + * Custom error show function called from SimpleSAML\Error\Error::show. * See docs/simplesamlphp-errorhandling.txt for function code example. * * Example: - * 'errors.show_function' => array('sspmod_example_Error_Show', 'show'), + * 'errors.show_function' => ['SimpleSAML\Module\example\Error', 'show'], */ @@ -309,21 +326,21 @@ * This is an array of outputs. Each output has at least a 'class' option, which * selects the output. */ - 'statistics.out' => array(// Log statistics to the normal log. + 'statistics.out' => [// Log statistics to the normal log. /* - array( + [ 'class' => 'core:Log', 'level' => 'notice', - ), + ], */ // Log statistics to files in a directory. One file per day. /* - array( + [ 'class' => 'core:File', 'directory' => '/var/log/stats', - ), + ], */ - ), + ], @@ -344,7 +361,7 @@ * Example: * 'proxy.auth' = 'myuser:password' */ - 'proxy.auth' => false, + //'proxy.auth' => 'myuser:password', @@ -370,12 +387,18 @@ */ 'database.username' => 'simplesamlphp', 'database.password' => 'secret', + 'database.options' => [], /* * (Optional) Table prefix */ 'database.prefix' => '', + /* + * (Optional) Driver options + */ + 'database.driver_options' => [], + /* * True or false if you would like a persistent database connection */ @@ -389,18 +412,18 @@ * * Configuration options in the slave array are exactly the same as the * options for the master (shown above) with the exception of the table - * prefix. + * prefix and driver options. */ - 'database.slaves' => array( + 'database.slaves' => [ /* - array( + [ 'dsn' => 'mysql:host=myslave;dbname=saml', 'username' => 'simplesamlphp', 'password' => 'secret', 'persistent' => false, - ), + ], */ - ), + ], @@ -445,11 +468,11 @@ * * Example: * - * 'module.enable' => array( - * 'exampleauth' => TRUE, // Setting to TRUE enables. - * 'saml' => FALSE, // Setting to FALSE disables. - * 'core' => NULL, // Unset or NULL uses default. - * ), + * 'module.enable' => [ + * 'exampleauth' => true, // Setting to TRUE enables. + * 'saml' => false, // Setting to FALSE disables. + * 'core' => null, // Unset or NULL uses default. + * ], * */ @@ -521,6 +544,18 @@ */ 'session.cookie.secure' => false, + /* + * Set the SameSite attribute in the cookie. + * + * You can set this to the strings 'None', 'Lax', or 'Strict' to support + * the RFC6265bis SameSite cookie attribute. If set to null, no SameSite + * attribute will be sent. + * + * Example: + * 'session.cookie.samesite' => 'None', + */ + 'session.cookie.samesite' => null, + /* * Options to override the default settings for php sessions. */ @@ -555,7 +590,7 @@ * See docs/simplesamlphp-advancedfeatures.txt for function code example. * * Example: - * 'session.check_function' => array('sspmod_example_Util', 'checkSession'), + * 'session.check_function' => ['\SimpleSAML\Module\example\Util', 'checkSession'], */ @@ -593,33 +628,33 @@ * Note that sessions will be lost if one server is lost from both the * a-group and the b-group. * - * 'memcache_store.servers' => array( - * array( - * array('hostname' => 'mc_a1'), - * array('hostname' => 'mc_a2'), - * ), - * array( - * array('hostname' => 'mc_b1'), - * array('hostname' => 'mc_b2'), - * ), - * ), + * 'memcache_store.servers' => [ + * [ + * ['hostname' => 'mc_a1'], + * ['hostname' => 'mc_a2'], + * ], + * [ + * ['hostname' => 'mc_b1'], + * ['hostname' => 'mc_b2'], + * ], + * ], * * Example of simple configuration with only one memcache server, * running on the same computer as the web server: * Note that all sessions will be lost if the memcache server crashes. * - * 'memcache_store.servers' => array( - * array( - * array('hostname' => 'localhost'), - * ), - * ), + * 'memcache_store.servers' => [ + * [ + * ['hostname' => 'localhost'], + * ], + * ], * */ - 'memcache_store.servers' => array( - array( - array('hostname' => 'localhost'), - ), - ), + 'memcache_store.servers' => [ + [ + ['hostname' => 'localhost'], + ], + ], /* * This value allows you to set a prefix for memcache-keys. The default @@ -654,15 +689,48 @@ | LANGUAGE AND INTERNATIONALIZATION | *************************************/ + /* + * Language-related options. + */ + 'language' => [ + /* + * An array in the form 'language' => <list of alternative languages>. + * + * Each key in the array is the ISO 639 two-letter code for a language, + * and its value is an array with a list of alternative languages that + * can be used if the given language is not available at some point. + * Each alternative language is also specified by its ISO 639 code. + * + * For example, for the "no" language code (Norwegian), we would have: + * + * 'priorities' => [ + * 'no' => ['nb', 'nn', 'en', 'se'], + * ... + * ], + * + * establishing that if a translation for the "no" language code is + * not available, we look for translations in "nb" (Norwegian Bokmål), + * and so on, in that order. + */ + 'priorities' => [ + 'no' => ['nb', 'nn', 'en', 'se'], + 'nb' => ['no', 'nn', 'en', 'se'], + 'nn' => ['no', 'nb', 'en', 'se'], + 'se' => ['nb', 'no', 'nn', 'en'], + 'nr' => ['zu', 'en'], + 'nd' => ['zu', 'en'], + ], + ], + /* * Languages available, RTL languages, and what language is the default. */ - 'language.available' => array( - 'en', 'no', 'nn', 'se', 'da', 'de', 'sv', 'fi', 'es', 'fr', 'it', 'nl', 'lb', 'cs', - 'sl', 'lt', 'hr', 'hu', 'pl', 'pt', 'pt-br', 'tr', 'ja', 'zh', 'zh-tw', 'ru', 'et', - 'he', 'id', 'sr', 'lv', 'ro', 'eu', 'el', 'af' - ), - 'language.rtl' => array('ar', 'dv', 'fa', 'ur', 'he'), + 'language.available' => [ + 'en', 'no', 'nn', 'se', 'da', 'de', 'sv', 'fi', 'es', 'ca', 'fr', 'it', 'nl', 'lb', + 'cs', 'sl', 'lt', 'hr', 'hu', 'pl', 'pt', 'pt-br', 'tr', 'ja', 'zh', 'zh-tw', 'ru', + 'et', 'he', 'id', 'sr', 'lv', 'ro', 'eu', 'el', 'af', 'zu', 'xh', + ], + 'language.rtl' => ['ar', 'dv', 'fa', 'ur', 'he'], 'language.default' => 'en', /* @@ -680,17 +748,7 @@ 'language.cookie.secure' => false, 'language.cookie.httponly' => false, 'language.cookie.lifetime' => (60 * 60 * 24 * 900), - - /* - * Which i18n backend to use. - * - * "SimpleSAMLphp" is the home made system, valid for 1.x. - * For 2.x, only "gettext/gettext" will be possible. - * - * Home-made templates will always use "SimpleSAMLphp". - * To use twig (where avaliable), select "gettext/gettext". - */ - 'language.i18n.backend' => 'SimpleSAMLphp', + 'language.cookie.samesite' => null, /** * Custom getLanguage function called from SimpleSAML\Locale\Language::getLanguage(). @@ -701,7 +759,7 @@ * the default language for the user. * * Example: - * 'language.get_language_function' => array('sspmod_example_Template', 'getLanguage'), + * 'language.get_language_function' => ['\SimpleSAML\Module\example\Template', 'getLanguage'], */ /* @@ -741,6 +799,12 @@ */ 'theme.use' => 'default', + /* + * Set this option to the text you would like to appear at the header of each page. Set to false if you don't want + * any text to appear in the header. + */ + //'theme.header' => 'SimpleSAMLphp' + /* * Templating options * @@ -758,6 +822,18 @@ */ 'template.auto_reload' => false, + /* + * Set this option to true to indicate that your installation of SimpleSAMLphp + * is running in a production environment. This will affect the way resources + * are used, offering an optimized version when running in production, and an + * easy-to-debug one when not. Set it to false when you are testing or + * developing the software, in which case a banner will be displayed to remind + * users that they're dealing with a non-production instance. + * + * Defaults to true. + */ + 'production' => true, + /********************* @@ -799,11 +875,12 @@ * Authentication processing filters that will be executed for all IdPs * Both Shibboleth and SAML 2.0 */ - 'authproc.idp' => array( + 'authproc.idp' => [ /* Enable the authproc filter below to add URN prefixes to all attributes - 10 => array( - 'class' => 'core:AttributeMap', 'addurnprefix' - ), */ + 10 => array[ + 'class' => 'core:AttributeMap', 'addurnprefix' + ], + */ /* Enable the authproc filter below to automatically generated eduPersonTargetedID. 20 => 'core:TargetedID', */ @@ -811,11 +888,11 @@ // Adopts language from attribute to use in UI 30 => 'core:LanguageAdaptor', - 45 => array( + 45 => [ 'class' => 'core:StatisticsWithAttribute', 'attributename' => 'realm', 'type' => 'saml20-idp-SSO', - ), + ], /* When called without parameters, it will fallback to filter attributes ‹the old way› * by checking the 'attributes' parameter in metadata on IdP hosted and SP remote. @@ -824,58 +901,61 @@ /* * Search attribute "distinguishedName" for pattern and replaces if found - - 60 => array( + */ + /* + 60 => [ 'class' => 'core:AttributeAlter', 'pattern' => '/OU=studerende/', 'replacement' => 'Student', 'subject' => 'distinguishedName', '%replace', - ), - */ + ], + */ /* * Consent module is enabled (with no permanent storage, using cookies). - - 90 => array( + */ + /* + 90 => [ 'class' => 'consent:Consent', 'store' => 'consent:Cookie', 'focus' => 'yes', - 'checked' => TRUE - ), - */ + 'checked' => true + ], + */ // If language is set in Consent module it will be added as an attribute. 99 => 'core:LanguageAdaptor', - ), + ], /* * Authentication processing filters that will be executed for all SPs * Both Shibboleth and SAML 2.0 */ - 'authproc.sp' => array( + 'authproc.sp' => [ /* - 10 => array( + 10 => [ 'class' => 'core:AttributeMap', 'removeurnprefix' - ), + ], */ /* * Generate the 'group' attribute populated from other variables, including eduPersonAffiliation. - 60 => array( + 60 => [ 'class' => 'core:GenerateGroups', 'eduPersonAffiliation' - ), + ], */ /* * All users will be members of 'users' and 'members' - 61 => array( - 'class' => 'core:AttributeAdd', 'groups' => array('users', 'members') - ), + */ + /* + 61 => [ + 'class' => 'core:AttributeAdd', 'groups' => ['users', 'members'] + ], */ // Adopts language from attribute to use in UI 90 => 'core:LanguageAdaptor', - - ), + ], @@ -883,6 +963,12 @@ | METADATA CONFIGURATION | **************************/ + /* + * This option allows you to specify a directory for your metadata outside of the standard metadata directory + * included in the standard distribution of the software. + */ + 'metadatadir' => 'metadata', + /* * This option configures the metadata sources. The metadata sources is given as an array with * different metadata sources. When searching for metadata, SimpleSAMLphp will search through @@ -932,40 +1018,40 @@ * This example defines two flatfile sources. One is the default metadata directory, the other * is a metadata directory with auto-generated metadata files. * - * 'metadata.sources' => array( - * array('type' => 'flatfile'), - * array('type' => 'flatfile', 'directory' => 'metadata-generated'), - * ), + * 'metadata.sources' => [ + * ['type' => 'flatfile'], + * ['type' => 'flatfile', 'directory' => 'metadata-generated'], + * ], * * This example defines a flatfile source and an XML source. - * 'metadata.sources' => array( - * array('type' => 'flatfile'), - * array('type' => 'xml', 'file' => 'idp.example.org-idpMeta.xml'), - * ), + * 'metadata.sources' => [ + * ['type' => 'flatfile'], + * ['type' => 'xml', 'file' => 'idp.example.org-idpMeta.xml'], + * ], * * This example defines an mdq source. - * 'metadata.sources' => array( - * array( + * 'metadata.sources' => [ + * [ * 'type' => 'mdq', * 'server' => 'http://mdq.server.com:8080', * 'cachedir' => '/var/simplesamlphp/mdq-cache', * 'cachelength' => 86400 - * ) - * ), + * ] + * ], * * This example defines an pdo source. - * 'metadata.sources' => array( - * array('type' => 'pdo') - * ), + * 'metadata.sources' => [ + * ['type' => 'pdo'] + * ], * * Default: - * 'metadata.sources' => array( - * array('type' => 'flatfile') - * ), + * 'metadata.sources' => [ + * ['type' => 'flatfile'] + * ], */ - 'metadata.sources' => array( - array('type' => 'flatfile'), - ), + 'metadata.sources' => [ + ['type' => 'flatfile'], + ], /* * Should signing of generated metadata be enabled by default. @@ -988,7 +1074,7 @@ 'metadata.sign.privatekey' => null, 'metadata.sign.privatekey_pass' => null, 'metadata.sign.certificate' => null, - + 'metadata.sign.algorithm' => null, /**************************** @@ -1004,8 +1090,6 @@ * - 'redis': Key-value datastore, based on redis. * * The default datastore is 'phpsession'. - * - * (This option replaces the old 'session.handler'-option.) */ 'store.type' => 'phpsession', @@ -1038,4 +1122,4 @@ * The prefix we should use on our Redis datastore. */ 'store.redis.prefix' => 'SimpleSAMLphp', -); +]; diff --git a/vendor/simplesamlphp/simplesamlphp/dictionaries/admin.translation.json b/vendor/simplesamlphp/simplesamlphp/dictionaries/admin.translation.json index 28742f46be..7f5f18abbd 100644 --- a/vendor/simplesamlphp/simplesamlphp/dictionaries/admin.translation.json +++ b/vendor/simplesamlphp/simplesamlphp/dictionaries/admin.translation.json @@ -885,8 +885,7 @@ "sr": "Shib 1.3 Davalac Identiteta (udaljeni)", "ro": "Furnizor de identitate Shib 1.3 (distant)", "ru": "\u041f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 Shib 1.3 (\u0443\u0434\u0430\u043b\u0435\u043d\u043d\u043e\u0435 \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u0438\u0435)", - "eu": "Shib 1.3 Identitate hornitzailea (Urrunekoa)", - "eu": "\u03a0\u03ac\u03c1\u03bf\u03c7\u03bf\u03c2 \u03a4\u03b1\u03c5\u03c4\u03cc\u03c4\u03b7\u03c4\u03b1\u03c2 Shib 1.3 (\u0391\u03c0\u03bf\u03bc\u03b1\u03ba\u03c1\u03c5\u03c3\u03bc\u03ad\u03bd\u03bf\u03c2)" + "eu": "Shib 1.3 Identitate hornitzailea (Urrunekoa)" }, "metaover_group_metadata.wsfed-sp-hosted": { "no": "WS-Federation tjenesteleverand\u00f8r (intern)", diff --git a/vendor/simplesamlphp/simplesamlphp/dictionaries/attributes.definition.json b/vendor/simplesamlphp/simplesamlphp/dictionaries/attributes.definition.json index c04dcfc27d..ee88667652 100644 --- a/vendor/simplesamlphp/simplesamlphp/dictionaries/attributes.definition.json +++ b/vendor/simplesamlphp/simplesamlphp/dictionaries/attributes.definition.json @@ -47,12 +47,18 @@ "attribute_edupersontargetedid": { "en": "Persistent pseudonymous ID" }, + "attribute_pairwise_id": { + "en": "Service-specific pseudonymous ID at home organization" + }, "attribute_edupersonprincipalname": { "en": "Person's principal name at home organization" }, "attribute_edupersonuniqueid": { "en": "Person's non-reassignable, persistent pseudonymous ID at home organization" }, + "attribute_subject_id": { + "en": "Pseudonymous ID at home organization" + }, "attribute_edupersonorcid": { "en": "ORCID researcher identifiers" }, diff --git a/vendor/simplesamlphp/simplesamlphp/dictionaries/attributes.translation.json b/vendor/simplesamlphp/simplesamlphp/dictionaries/attributes.translation.json index 3e6b7cbec5..e0f652fa74 100644 --- a/vendor/simplesamlphp/simplesamlphp/dictionaries/attributes.translation.json +++ b/vendor/simplesamlphp/simplesamlphp/dictionaries/attributes.translation.json @@ -35,7 +35,9 @@ "eu": "Afiliazioa", "ca": "Afiliaci\u00f3", "af": "Affiliasie", - "el": "\u0399\u03b4\u03b9\u03cc\u03c4\u03b7\u03c4\u03b1\u002f\u03b5\u03c2" + "el": "\u0399\u03b4\u03b9\u03cc\u03c4\u03b7\u03c4\u03b1\u002f\u03b5\u03c2", + "xh": "Indima", + "zu": "Indima" }, "attribute_title": { "no": "Tittel", @@ -72,7 +74,9 @@ "ro": "Titlu\/titulatur\u0103", "ca": "Tractament", "af": "Titel", - "el": "\u03a4\u03af\u03c4\u03bb\u03bf\u03c2" + "el": "\u03a4\u03af\u03c4\u03bb\u03bf\u03c2", + "xh": "Isibizo", + "zu": "Isiqu" }, "attribute_uid": { "no": "Bruker-ID", @@ -110,7 +114,9 @@ "ro": "ID utilizator", "ca": "Identificador d'usuari", "af": "Gebruikers ID", - "el": "\u0391\u03bd\u03b1\u03b3\u03bd\u03c9\u03c1\u03b9\u03c3\u03c4\u03b9\u03ba\u03cc \u03c7\u03c1\u03ae\u03c3\u03c4\u03b7" + "el": "\u0391\u03bd\u03b1\u03b3\u03bd\u03c9\u03c1\u03b9\u03c3\u03c4\u03b9\u03ba\u03cc \u03c7\u03c1\u03ae\u03c3\u03c4\u03b7", + "xh": "I-ID yomsebenzisi", + "zu": "I-ID yomsebenzisi" }, "attribute_sn": { "no": "Etternavn", @@ -148,7 +154,9 @@ "ro": "Nume de familie", "ca": "Cognoms", "af": "Van", - "el": "\u0395\u03c0\u03ce\u03bd\u03c5\u03bc\u03bf" + "el": "\u0395\u03c0\u03ce\u03bd\u03c5\u03bc\u03bf", + "zu": "Isibongo", + "xh": "Ifani" }, "attribute_givenname": { "no": "Fornavn", @@ -186,7 +194,9 @@ "eu": "Izena", "ca": "Nom", "af": "Voornaam", - "el": "\u038c\u03bd\u03bf\u03bc\u03b1" + "el": "\u038c\u03bd\u03bf\u03bc\u03b1", + "xh": "Igama elinikiweyo", + "zu": "Igama lokuzalwa" }, "attribute_cn": { "no": "Fullt navn", @@ -224,7 +234,9 @@ "eu": "Izen arrunta (CN)", "ca": "Nom com\u00fa (CN)", "af": "Algemene naam", - "el": "\u039a\u03bf\u03b9\u03bd\u03cc \u03cc\u03bd\u03bf\u03bc\u03b1 (CN)" + "el": "\u039a\u03bf\u03b9\u03bd\u03cc \u03cc\u03bd\u03bf\u03bc\u03b1 (CN)", + "zu": "Igama elivamile", + "xh": "Igama eliqhelekileyo" }, "attribute_mail": { "no": "E-post", @@ -262,7 +274,9 @@ "ro": "Mail", "ca": "Correu electr\u00f2nic", "af": "E-pos", - "el": "Email" + "el": "Email", + "zu": "Imeyili", + "xh": "Iposi" }, "attribute_mobile": { "no": "Mobiltelefon", @@ -300,7 +314,9 @@ "ro": "Mobil", "ca": "Tel\u00e8fon m\u00f2bil", "af": "Selfoon", - "el": "\u039a\u03b9\u03bd\u03b7\u03c4\u03cc \u03c4\u03b7\u03bb\u03ad\u03c6\u03c9\u03bd\u03bf" + "el": "\u039a\u03b9\u03bd\u03b7\u03c4\u03cc \u03c4\u03b7\u03bb\u03ad\u03c6\u03c9\u03bd\u03bf", + "zu": "Imobhayili", + "xh": "Imobhayili" }, "attribute_preferredlanguage": { "no": "Foretrukket spr\u00e5k", @@ -338,7 +354,9 @@ "eu": "Hizkuntza lehenetsia", "ca": "Idioma preferit", "af": "Taal voorkeur", - "el": "\u03a0\u03c1\u03bf\u03c4\u03b9\u03bc\u03ce\u03bc\u03b5\u03bd\u03b7 \u03b3\u03bb\u03ce\u03c3\u03c3\u03b1" + "el": "\u03a0\u03c1\u03bf\u03c4\u03b9\u03bc\u03ce\u03bc\u03b5\u03bd\u03b7 \u03b3\u03bb\u03ce\u03c3\u03c3\u03b1", + "xh": "Ulwimi olukhethayo", + "zu": "Ulimi oluncanyelwayo" }, "attribute_noredupersonnin": { "no": "F\u00f8dselsnummer", @@ -376,7 +394,9 @@ "eu": "Gizarte-segurantzako zenbakia", "ca": "N\u00famero de la Seguretat Social", "af": "Identiteitsnommer", - "el": "\u0391\u03c1\u03b9\u03b8\u03bc\u03cc\u03c2 \u03c4\u03b1\u03c5\u03c4\u03cc\u03c4\u03b7\u03c4\u03b1\u03c2 \u03b1\u03c0\u03cc \u03b4\u03b7\u03bc\u03cc\u03c3\u03b9\u03b1 \u03b1\u03c1\u03c7\u03ae" + "el": "\u0391\u03c1\u03b9\u03b8\u03bc\u03cc\u03c2 \u03c4\u03b1\u03c5\u03c4\u03cc\u03c4\u03b7\u03c4\u03b1\u03c2 \u03b1\u03c0\u03cc \u03b4\u03b7\u03bc\u03cc\u03c3\u03b9\u03b1 \u03b1\u03c1\u03c7\u03ae", + "xh": "Inombolo yesazisi eyabelwe ngamagunya oluntu", + "zu": "Inombolo kamazisi eyabelwe amagunya omphakathi" }, "attribute_schachomeorganization": { "no": "Unik ID for organisasjon", @@ -413,7 +433,9 @@ "eu": "Jatorrizko erakundearen domeinu izena", "ca": "Identificador \u00fanic de l'organitzaci\u00f3 d'origen", "af": "Tuis Organisasie domein naam", - "el": "\u038c\u03bd\u03bf\u03bc\u03b1 \u03c0\u03b5\u03c1\u03b9\u03bf\u03c7\u03ae\u03c2 (domain) \u03bf\u03b9\u03ba\u03b5\u03af\u03bf\u03c5 \u03bf\u03c1\u03b3\u03b1\u03bd\u03b9\u03c3\u03bc\u03bf\u03cd" + "el": "\u038c\u03bd\u03bf\u03bc\u03b1 \u03c0\u03b5\u03c1\u03b9\u03bf\u03c7\u03ae\u03c2 (domain) \u03bf\u03b9\u03ba\u03b5\u03af\u03bf\u03c5 \u03bf\u03c1\u03b3\u03b1\u03bd\u03b9\u03c3\u03bc\u03bf\u03cd", + "zu": "Igama lesizinda senhlangano yasekhaya", + "xh": "Igama ledomeyini yombutho wekhaya" }, "attribute_organisationname": { "no": "Navn p\u00e5 organisasjon", @@ -451,7 +473,9 @@ "ro": "Denumirea institu\u021biei", "ca": "Nom de l'organitzaci\u00f3", "af": "Organisasie naam", - "el": "\u038c\u03bd\u03bf\u03bc\u03b1 \u03bf\u03c1\u03b3\u03b1\u03bd\u03b9\u03c3\u03bc\u03bf\u03cd" + "el": "\u038c\u03bd\u03bf\u03bc\u03b1 \u03bf\u03c1\u03b3\u03b1\u03bd\u03b9\u03c3\u03bc\u03bf\u03cd", + "xh": "Igama lombutho", + "zu": "Igama lenhlangano" }, "attribute_edupersonentitlement": { "no": "Rettighet", @@ -489,7 +513,9 @@ "eu": "Zerbitzuari dagokion eskubidea", "ca": "Dret relatiu al servei", "af": "Reg mbt. die diens", - "el": "\u0394\u03b9\u03ba\u03b1\u03b9\u03ce\u03bc\u03b1\u03c4\u03b1 \u03c0\u03c1\u03cc\u03c3\u03b2\u03b1\u03c3\u03b7\u03c2 \u03c3\u03c4\u03b7\u03bd \u03c5\u03c0\u03b7\u03c1\u03b5\u03c3\u03af\u03b1" + "el": "\u0394\u03b9\u03ba\u03b1\u03b9\u03ce\u03bc\u03b1\u03c4\u03b1 \u03c0\u03c1\u03cc\u03c3\u03b2\u03b1\u03c3\u03b7\u03c2 \u03c3\u03c4\u03b7\u03bd \u03c5\u03c0\u03b7\u03c1\u03b5\u03c3\u03af\u03b1", + "zu": "Ilungelo eliphathelene nesevisi", + "xh": "Ilungelo ngokuphathelele inkonzo" }, "attribute_edupersonscopedaffiliation": { "no": "Gruppetilh\u00f8righet", @@ -527,7 +553,9 @@ "eu": "Afiliazioa jatorrizko erakundean", "ca": "Afiliaci\u00f3 a l'organitzaci\u00f3 d'origen", "af": "Affiliasie by Tuis organisasie", - "el": "\u0399\u03b4\u03b9\u03cc\u03c4\u03b7\u03c4\u03b1 \u03b1\u03bd\u03ac \u03b4\u03b9\u03b1\u03c7\u03b5\u03b9\u03c1\u03b9\u03c3\u03c4\u03b9\u03ba\u03ae \u03c0\u03b5\u03c1\u03b9\u03bf\u03c7\u03ae (administrative domain)" + "el": "\u0399\u03b4\u03b9\u03cc\u03c4\u03b7\u03c4\u03b1 \u03b1\u03bd\u03ac \u03b4\u03b9\u03b1\u03c7\u03b5\u03b9\u03c1\u03b9\u03c3\u03c4\u03b9\u03ba\u03ae \u03c0\u03b5\u03c1\u03b9\u03bf\u03c7\u03ae (administrative domain)", + "zu": "Indima enhlanganweni yasekhaya", + "xh": "Indima kumbutho wasekhaya" }, "attribute_edupersontargetedid": { "no": "Persistent anonym ID", @@ -564,7 +592,12 @@ "eu": "Goitizen ID etengabea", "ca": "Identificador pseud\u00f2nim persistent", "af": "Aanhoudende anonieme ID", - "el": "\u0391\u03b4\u03b9\u03b1\u03c6\u03b1\u03bd\u03ad\u03c2 \u03b1\u03bd\u03b1\u03b3\u03bd\u03c9\u03c1\u03b9\u03c3\u03c4\u03b9\u03ba\u03cc \u03c7\u03c1\u03ae\u03c3\u03c4\u03b7 \u03bc\u03b1\u03ba\u03c1\u03ac\u03c2 \u03b4\u03b9\u03ac\u03c1\u03ba\u03b5\u03b9\u03b1\u03c2" + "el": "\u0391\u03b4\u03b9\u03b1\u03c6\u03b1\u03bd\u03ad\u03c2 \u03b1\u03bd\u03b1\u03b3\u03bd\u03c9\u03c1\u03b9\u03c3\u03c4\u03b9\u03ba\u03cc \u03c7\u03c1\u03ae\u03c3\u03c4\u03b7 \u03bc\u03b1\u03ba\u03c1\u03ac\u03c2 \u03b4\u03b9\u03ac\u03c1\u03ba\u03b5\u03b9\u03b1\u03c2", + "zu": "Isibizo esingashintshi esiqondene nesevisi", + "xh": "Igama elingelolakhe elingatshintshiyo elingqale kwinkonzo" + }, + "attribute_pairwise_id": { + "de": "Service-spezifische pseudonyme ID bei der Heimorganisation" }, "attribute_edupersonprincipalname": { "no": "Personlig ID hos organisasjonen", @@ -602,15 +635,25 @@ "eu": "Jatorrizko erakundean pertsonak duen izen nagusia", "ca": "Identificador \u00fanic de la persona a la seva organitzaci\u00f3 d'origen", "af": "Persoonlike ID by tuis organisasie", - "el": "\u0391\u03bd\u03b1\u03b3\u03bd\u03c9\u03c1\u03b9\u03c3\u03c4\u03b9\u03ba\u03cc \u03c7\u03c1\u03ae\u03c3\u03c4\u03b7 \u03c3\u03c4\u03bf\u03bd \u03bf\u03b9\u03ba\u03b5\u03af\u03bf \u03bf\u03c1\u03b3\u03b1\u03bd\u03b9\u03c3\u03bc\u03cc" + "el": "\u0391\u03bd\u03b1\u03b3\u03bd\u03c9\u03c1\u03b9\u03c3\u03c4\u03b9\u03ba\u03cc \u03c7\u03c1\u03ae\u03c3\u03c4\u03b7 \u03c3\u03c4\u03bf\u03bd \u03bf\u03b9\u03ba\u03b5\u03af\u03bf \u03bf\u03c1\u03b3\u03b1\u03bd\u03b9\u03c3\u03bc\u03cc", + "xh": "Igama elingundoqo lomntu kwinkampani yekhaya", + "zu": "Igama eliyinhloko lomuntu enhlanganweni yasekhaya" }, "attribute_edupersonuniqueid": { "zh-tw": "\u500b\u4eba\u7121\u6cd5\u91cd\u65b0\u8a2d\u7f6e\uff0c\u65bc\u6240\u5c6c\u7d44\u7e54\u7684\u6c38\u4e45\u533f\u540d ID", - "el": "\u039c\u03cc\u03bd\u03b9\u03bc\u03bf, \u03b1\u03b4\u03b9\u03b1\u03c6\u03b1\u03bd\u03ad\u03c2 \u03b1\u03bd\u03b1\u03b3\u03bd\u03c9\u03c1\u03b9\u03c3\u03c4\u03b9\u03ba\u03cc \u03c7\u03c1\u03ae\u03c3\u03c4\u03b7 \u03c3\u03c4\u03bf\u03bd \u03bf\u03b9\u03ba\u03b5\u03af\u03bf \u03bf\u03c1\u03b3\u03b1\u03bd\u03b9\u03c3\u03bc\u03cc" + "el": "\u039c\u03cc\u03bd\u03b9\u03bc\u03bf, \u03b1\u03b4\u03b9\u03b1\u03c6\u03b1\u03bd\u03ad\u03c2 \u03b1\u03bd\u03b1\u03b3\u03bd\u03c9\u03c1\u03b9\u03c3\u03c4\u03b9\u03ba\u03cc \u03c7\u03c1\u03ae\u03c3\u03c4\u03b7 \u03c3\u03c4\u03bf\u03bd \u03bf\u03b9\u03ba\u03b5\u03af\u03bf \u03bf\u03c1\u03b3\u03b1\u03bd\u03b9\u03c3\u03bc\u03cc", + "zu": "I-ID yesibizo ephikelelayo, engakwazi ukwabelwa kabusha yomuntu yenhlangano yasekhaya", + "xh": "I-ID yomntu enganakuphinda yabelwe, ebhalwe ngegama lobuxoki eqhubekayo kwinkampani yekhaya" + }, + "attribute_subject_id": { + "de": "Pseudonyme ID bei der Heimorganisation" }, "attribute_edupersonorcid": { "zh-tw": "ORCID \u7814\u7a76\u8005\u8b58\u5225\u78bc", - "el": "\u0391\u03bd\u03b1\u03b3\u03bd\u03c9\u03c1\u03b9\u03c3\u03c4\u03b9\u03ba\u03ac \u03b5\u03c1\u03b5\u03c5\u03bd\u03b7\u03c4\u03ae ORCID" + "el": "\u0391\u03bd\u03b1\u03b3\u03bd\u03c9\u03c1\u03b9\u03c3\u03c4\u03b9\u03ba\u03ac \u03b5\u03c1\u03b5\u03c5\u03bd\u03b7\u03c4\u03ae ORCID", + "af": "ORCID identifiseerder", + "zu": "Isihlonzi se-ORCID", + "xh": "Isazisi se-ORCID" }, "attribute_o": { "no": "Navn p\u00e5 organisasjon", @@ -647,7 +690,9 @@ "ro": "Denumirea institu\u021biei", "ca": "Nom de l'organitzaci\u00f3", "af": "Organisasie naam", - "el": "\u038c\u03bd\u03bf\u03bc\u03b1 \u03bf\u03c1\u03b3\u03b1\u03bd\u03b9\u03c3\u03bc\u03bf\u03cd" + "el": "\u038c\u03bd\u03bf\u03bc\u03b1 \u03bf\u03c1\u03b3\u03b1\u03bd\u03b9\u03c3\u03bc\u03bf\u03cd", + "zu": "Igama lenhlangano", + "xh": "Igama lombutho" }, "attribute_dc": { "no": "Navneledd (DC)", @@ -684,7 +729,9 @@ "eu": "Domeinuaren osagaia (DC)", "ca": "Component de domini (DC)", "af": "Domein komponent (DC)", - "el": "\u03a3\u03c5\u03c3\u03c4\u03b1\u03c4\u03b9\u03ba\u03cc \u03a4\u03bf\u03bc\u03ad\u03b1 (DC)" + "el": "\u03a3\u03c5\u03c3\u03c4\u03b1\u03c4\u03b9\u03ba\u03cc \u03a4\u03bf\u03bc\u03ad\u03b1 (DC)", + "zu": "Ingxenye yesizinda (I-DC)", + "xh": "Ikhomponenti yedomeyin (DC)" }, "attribute_displayname": { "no": "Navn som normalt vises", @@ -721,7 +768,9 @@ "eu": "Bistaratzeko izena", "ca": "Nom de visualitzaci\u00f3", "af": "Vertoon naam", - "el": "\u0395\u03bc\u03c6\u03b1\u03bd\u03b9\u03b6\u03cc\u03bc\u03b5\u03bd\u03bf \u03cc\u03bd\u03bf\u03bc\u03b1" + "el": "\u0395\u03bc\u03c6\u03b1\u03bd\u03b9\u03b6\u03cc\u03bc\u03b5\u03bd\u03bf \u03cc\u03bd\u03bf\u03bc\u03b1", + "zu": "Igama lesibonisi", + "xh": "Igama lomboniso" }, "attribute_facsimiletelephonenumber": { "no": "Faksnummer", @@ -758,7 +807,9 @@ "ro": "Num\u0103r de fax", "ca": "N\u00famero de fax", "af": "Faksnommer", - "el": "Fax" + "el": "Fax", + "zu": "Inombolo yefeksi", + "xh": "Inombolo yefeksi" }, "attribute_homephone": { "no": "Hjemmetelefon", @@ -795,7 +846,9 @@ "ro": "Telefon acas\u0103", "ca": "Tel\u00e8fon del domicili", "af": "Tuistelefoon", - "el": "\u03a4\u03b7\u03bb\u03ad\u03c6\u03c9\u03bd\u03bf \u03bf\u03b9\u03ba\u03af\u03b1\u03c2" + "el": "\u03a4\u03b7\u03bb\u03ad\u03c6\u03c9\u03bd\u03bf \u03bf\u03b9\u03ba\u03af\u03b1\u03c2", + "xh": "Umnxeba wasekhaya", + "zu": "Ucingo lwasekhaya" }, "attribute_homepostaladdress": { "no": "Postadresse hjemme", @@ -832,7 +885,9 @@ "eu": "Etxeko helbidea", "ca": "Adre\u00e7a del domicili", "af": "Tuis posadres", - "el": "\u03a4\u03b1\u03c7\u03c5\u03b4\u03c1\u03bf\u03bc\u03b9\u03ba\u03ae \u03b4\u03b9\u03b5\u03cd\u03b8\u03c5\u03bd\u03c3\u03b7 \u03bf\u03b9\u03ba\u03af\u03b1\u03c2" + "el": "\u03a4\u03b1\u03c7\u03c5\u03b4\u03c1\u03bf\u03bc\u03b9\u03ba\u03ae \u03b4\u03b9\u03b5\u03cd\u03b8\u03c5\u03bd\u03c3\u03b7 \u03bf\u03b9\u03ba\u03af\u03b1\u03c2", + "zu": "Ikheli leposi lasekhaya", + "xh": "Idilesi yeposi yasekhaya" }, "attribute_jpegphoto": { "no": "JPEG-foto", @@ -869,7 +924,9 @@ "ro": "Fotografie JPEG", "ca": "Fotografia en JPEG", "af": "JPEG Foto", - "el": "\u03a6\u03c9\u03c4\u03bf\u03b3\u03c1\u03b1\u03c6\u03af\u03b1 \u03c3\u03b5 \u03bc\u03bf\u03c1\u03c6\u03ae JPEG" + "el": "\u03a6\u03c9\u03c4\u03bf\u03b3\u03c1\u03b1\u03c6\u03af\u03b1 \u03c3\u03b5 \u03bc\u03bf\u03c1\u03c6\u03ae JPEG", + "xh": "Ifoto ye-JPEG", + "zu": "Isithombe se-JPEG" }, "attribute_l": { "no": "Sted", @@ -906,7 +963,9 @@ "eu": "Herria", "ca": "Localitat", "af": "Ligging", - "el": "\u03a4\u03bf\u03c0\u03bf\u03b8\u03b5\u03c3\u03af\u03b1" + "el": "\u03a4\u03bf\u03c0\u03bf\u03b8\u03b5\u03c3\u03af\u03b1", + "zu": "Indawo", + "xh": "Indawo" }, "attribute_labeleduri": { "no": "URI med valgfri tilleggskommentar", @@ -943,7 +1002,9 @@ "eu": "URI etiketatua", "ca": "URI etiquetat", "af": "URI", - "el": "\u0395\u03c0\u03b9\u03c3\u03b7\u03bc\u03b1\u03c3\u03bc\u03ad\u03bd\u03b1 URI" + "el": "\u0395\u03c0\u03b9\u03c3\u03b7\u03bc\u03b1\u03c3\u03bc\u03ad\u03bd\u03b1 URI", + "xh": "I-URI eneleyibheli", + "zu": "I-URI Enelebula" }, "attribute_ou": { "no": "Organisasjonsenhet", @@ -980,7 +1041,9 @@ "eu": "Antolamendu-unitatea", "ca": "Unitat organitzativa", "af": "Organisasie eenheid", - "el": "\u039f\u03c1\u03b3\u03b1\u03bd\u03c9\u03c4\u03b9\u03ba\u03ae \u03bc\u03bf\u03bd\u03ac\u03b4\u03b1" + "el": "\u039f\u03c1\u03b3\u03b1\u03bd\u03c9\u03c4\u03b9\u03ba\u03ae \u03bc\u03bf\u03bd\u03ac\u03b4\u03b1", + "zu": "Iyunithi yenhlangano", + "xh": "Iyunithi yombutho" }, "attribute_postaladdress": { "no": "Postadresse", @@ -1017,7 +1080,9 @@ "ro": "Adresa po\u0219tal\u0103", "ca": "Adre\u00e7a postal", "af": "Posadres", - "el": "\u03a4\u03b1\u03c7\u03c5\u03b4\u03c1\u03bf\u03bc\u03b9\u03ba\u03ae \u03b4\u03b9\u03b5\u03cd\u03b8\u03c5\u03bd\u03c3\u03b7" + "el": "\u03a4\u03b1\u03c7\u03c5\u03b4\u03c1\u03bf\u03bc\u03b9\u03ba\u03ae \u03b4\u03b9\u03b5\u03cd\u03b8\u03c5\u03bd\u03c3\u03b7", + "xh": "Idilesi yeposi", + "zu": "Ikheli leposi" }, "attribute_postalcode": { "no": "Postnummer", @@ -1054,7 +1119,9 @@ "ro": "Cod po\u0219tal", "ca": "Codi postal", "af": "Poskode", - "el": "\u03a4\u03b1\u03c7\u03c5\u03b4\u03c1\u03bf\u03bc\u03b9\u03ba\u03cc\u03c2 \u03ba\u03c9\u03b4\u03b9\u03ba\u03cc\u03c2" + "el": "\u03a4\u03b1\u03c7\u03c5\u03b4\u03c1\u03bf\u03bc\u03b9\u03ba\u03cc\u03c2 \u03ba\u03c9\u03b4\u03b9\u03ba\u03cc\u03c2", + "zu": "Ikhodi yeposi", + "xh": "Ikhowudi yeposi" }, "attribute_postofficebox": { "no": "Postboks", @@ -1091,7 +1158,9 @@ "ro": "Cutie po\u0219tal\u0103", "ca": "Apartat de correus", "af": "Posbus", - "el": "\u03a4\u03b1\u03c7\u03c5\u03b4\u03c1\u03bf\u03bc\u03b9\u03ba\u03ae \u03b8\u03c5\u03c1\u03af\u03b4\u03b1" + "el": "\u03a4\u03b1\u03c7\u03c5\u03b4\u03c1\u03bf\u03bc\u03b9\u03ba\u03ae \u03b8\u03c5\u03c1\u03af\u03b4\u03b1", + "zu": "Ibhokisi lehhovisi leposi", + "xh": "Ibhokisi yaseposini" }, "attribute_street": { "no": "Gate", @@ -1128,7 +1197,9 @@ "ro": "Strada", "ca": "Carrer", "af": "Straat", - "el": "\u039f\u03b4\u03cc\u03c2" + "el": "\u039f\u03b4\u03cc\u03c2", + "xh": "Istrato", + "zu": "Umgwaqo" }, "attribute_telephonenumber": { "no": "Telefon", @@ -1165,7 +1236,9 @@ "ro": "Num\u0103r de telefon", "ca": "N\u00famero de tel\u00e8fon", "af": "Telefoon nommer", - "el": "\u03a4\u03b7\u03bb\u03ad\u03c6\u03c9\u03bd\u03bf" + "el": "\u03a4\u03b7\u03bb\u03ad\u03c6\u03c9\u03bd\u03bf", + "zu": "Inombolo yocingo", + "xh": "Inombolo yomnxeba" }, "attribute_eduorghomepageuri": { "no": "Organisasjonens hjemmeside", @@ -1202,7 +1275,9 @@ "eu": "Erakundearen hasiera-orria", "ca": "P\u00e0gina inicial de l'organitzaci\u00f3", "af": "Organisasie tuisblad", - "el": "\u0394\u03b9\u03b5\u03cd\u03b8\u03c5\u03bd\u03c3\u03b7 \u03b1\u03c1\u03c7\u03b9\u03ba\u03ae\u03c2 \u03c3\u03b5\u03bb\u03af\u03b4\u03b1\u03c2 \u03bf\u03b9\u03ba\u03b5\u03af\u03bf\u03c5 \u03bf\u03c1\u03b3\u03b1\u03bd\u03b9\u03c3\u03bc\u03bf\u03cd" + "el": "\u0394\u03b9\u03b5\u03cd\u03b8\u03c5\u03bd\u03c3\u03b7 \u03b1\u03c1\u03c7\u03b9\u03ba\u03ae\u03c2 \u03c3\u03b5\u03bb\u03af\u03b4\u03b1\u03c2 \u03bf\u03b9\u03ba\u03b5\u03af\u03bf\u03c5 \u03bf\u03c1\u03b3\u03b1\u03bd\u03b9\u03c3\u03bc\u03bf\u03cd", + "xh": "Ikhasi lekhaya Lenkampani", + "zu": "Ikhasi lasekhaya lenhlangano" }, "attribute_eduorglegalname": { "no": "Foretaksnavn", @@ -1239,7 +1314,9 @@ "eu": "Erakundearen izen legala", "ca": "Nom legal de l'organitzaci\u00f3", "af": "Wettige naam", - "el": "\u0395\u03c0\u03af\u03c3\u03b7\u03bc\u03b7 \u03b5\u03c0\u03c9\u03bd\u03c5\u03bc\u03af\u03b1 \u03bf\u03b9\u03ba\u03b5\u03af\u03bf\u03c5 \u03bf\u03c1\u03b3\u03b1\u03bd\u03b9\u03c3\u03bc\u03bf\u03cd" + "el": "\u0395\u03c0\u03af\u03c3\u03b7\u03bc\u03b7 \u03b5\u03c0\u03c9\u03bd\u03c5\u03bc\u03af\u03b1 \u03bf\u03b9\u03ba\u03b5\u03af\u03bf\u03c5 \u03bf\u03c1\u03b3\u03b1\u03bd\u03b9\u03c3\u03bc\u03bf\u03cd", + "zu": "Igama elisemthethweni lenhlangano", + "xh": "Igama elisemthethweni lenkampani" }, "attribute_edupersonnickname": { "no": "Kallenavn", @@ -1276,7 +1353,9 @@ "ro": "Porecl\u0103", "ca": "\u00c0lies", "af": "Bynaam", - "el": "\u03a8\u03b5\u03c5\u03b4\u03ce\u03bd\u03c5\u03bc\u03bf \u03c7\u03c1\u03ae\u03c3\u03c4\u03b7" + "el": "\u03a8\u03b5\u03c5\u03b4\u03ce\u03bd\u03c5\u03bc\u03bf \u03c7\u03c1\u03ae\u03c3\u03c4\u03b7", + "xh": "Isiteketiso", + "zu": "Isidlaliso" }, "attribute_edupersonorgdn": { "no": "Entydig navn (DN) for brukerens vertsorganisasjon", @@ -1313,7 +1392,9 @@ "eu": "Pertsonaren jatorrizko erakundearen izen osatua (DN)", "ca": "Nom distingit (DN) de l'organitzaci\u00f3 d'origen", "af": "Kenmerkende naam (DN) van die person se tuisorganisasie", - "el": "\u0394\u03b9\u03b1\u03ba\u03b5\u03ba\u03c1\u03b9\u03bc\u03ad\u03bd\u03bf \u03cc\u03bd\u03bf\u03bc\u03b1 (DN) \u03bf\u03b9\u03ba\u03b5\u03af\u03bf\u03c5 \u03bf\u03c1\u03b3\u03b1\u03bd\u03b9\u03c3\u03bc\u03bf\u03cd" + "el": "\u0394\u03b9\u03b1\u03ba\u03b5\u03ba\u03c1\u03b9\u03bc\u03ad\u03bd\u03bf \u03cc\u03bd\u03bf\u03bc\u03b1 (DN) \u03bf\u03b9\u03ba\u03b5\u03af\u03bf\u03c5 \u03bf\u03c1\u03b3\u03b1\u03bd\u03b9\u03c3\u03bc\u03bf\u03cd", + "xh": "Igama elahlukileyo (DN) lenkampani yekhaya yomntu", + "zu": "Igama elihloniphekile (I-DN) lenhlangano yasekhaya yomuntu" }, "attribute_edupersonorgunitdn": { "no": "Entydig navn (DN) for brukerens organisasjonsenhet", @@ -1350,7 +1431,9 @@ "eu": "Pertsonaren jatorrizko erakundeko antolamendu-unitatearen izen osatua (DN)", "ca": "Nom distingit (DN) de la Unitat Organitzativa (OU) de l'organitzaci\u00f3 d'origen", "af": "Kenmerkende naam (DN) van die persoon se organisatoriese afdeling", - "el": "\u0394\u03b9\u03b1\u03ba\u03b5\u03ba\u03c1\u03b9\u03bc\u03ad\u03bd\u03bf \u03cc\u03bd\u03bf\u03bc\u03b1 (DN) \u03bf\u03b9\u03ba\u03b5\u03af\u03b1\u03c2 \u03bf\u03c1\u03b3\u03b1\u03bd\u03c9\u03c4\u03b9\u03ba\u03ae\u03c2 \u03bc\u03bf\u03bd\u03ac\u03b4\u03b1\u03c2" + "el": "\u0394\u03b9\u03b1\u03ba\u03b5\u03ba\u03c1\u03b9\u03bc\u03ad\u03bd\u03bf \u03cc\u03bd\u03bf\u03bc\u03b1 (DN) \u03bf\u03b9\u03ba\u03b5\u03af\u03b1\u03c2 \u03bf\u03c1\u03b3\u03b1\u03bd\u03c9\u03c4\u03b9\u03ba\u03ae\u03c2 \u03bc\u03bf\u03bd\u03ac\u03b4\u03b1\u03c2", + "xh": "Igama elahlukileyo (DN) leyunithi yenkampani yekhaya yomntu", + "zu": "Igama elihloniphekile (I-DN) leyunithi yenhlangano yasekhaya yomuntu" }, "attribute_edupersonprimaryaffiliation": { "no": "Prim\u00e6r tilknytning til organisasjon", @@ -1387,7 +1470,9 @@ "eu": "Lehen afiliazioa", "ca": "Afiliaci\u00f3 prim\u00e0ria", "af": "Prim\u00eare affiliasie", - "el": "\u039a\u03cd\u03c1\u03b9\u03b1 \u03b9\u03b4\u03b9\u03cc\u03c4\u03b7\u03c4\u03b1" + "el": "\u039a\u03cd\u03c1\u03b9\u03b1 \u03b9\u03b4\u03b9\u03cc\u03c4\u03b7\u03c4\u03b1", + "xh": "Indima eyintloko", + "zu": "Indima eyinhloko" }, "attribute_noreduorgnin": { "no": "Organisasjonsnummer", @@ -1424,7 +1509,9 @@ "eu": "Erakundearen zenbakia", "ca": "N\u00famero de l'organitzaci\u00f3", "af": "Organisasie nommer", - "el": "\u0391\u03c1\u03b9\u03b8\u03bc\u03cc\u03c2 \u03bf\u03b9\u03ba\u03b5\u03af\u03bf\u03c5 \u03bf\u03c1\u03b3\u03b1\u03bd\u03b9\u03c3\u03bc\u03bf\u03cd" + "el": "\u0391\u03c1\u03b9\u03b8\u03bc\u03cc\u03c2 \u03bf\u03b9\u03ba\u03b5\u03af\u03bf\u03c5 \u03bf\u03c1\u03b3\u03b1\u03bd\u03b9\u03c3\u03bc\u03bf\u03cd", + "zu": "Inombolo yenhlangano", + "xh": "Inombolo yenkampani" }, "attribute_noredupersonbirthdate": { "no": "F\u00f8dselsdato", @@ -1461,7 +1548,9 @@ "ro": "Data na\u0219terii", "ca": "Data de naixement", "af": "Geboorte datum", - "el": "\u0397\u03bc\u03b5\u03c1\u03bf\u03bc\u03b7\u03bd\u03af\u03b1 \u03b3\u03ad\u03bd\u03bd\u03b7\u03c3\u03b7\u03c2" + "el": "\u0397\u03bc\u03b5\u03c1\u03bf\u03bc\u03b7\u03bd\u03af\u03b1 \u03b3\u03ad\u03bd\u03bd\u03b7\u03c3\u03b7\u03c2", + "zu": "Usuku lokuzalwa", + "xh": "Umhla wokuzalwa" }, "attribute_noredupersonlin": { "no": "Lokalt ID-nummer", @@ -1498,7 +1587,9 @@ "eu": "Tokiko zenbaki identifikatzailea", "ca": "N\u00famero d'identificaci\u00f3 local", "af": "Identiteitsnommer", - "el": "\u0391\u03c1\u03b9\u03b8\u03bc\u03cc\u03c2 \u03c4\u03b1\u03c5\u03c4\u03cc\u03c4\u03b7\u03c4\u03b1\u03c2" + "el": "\u0391\u03c1\u03b9\u03b8\u03bc\u03cc\u03c2 \u03c4\u03b1\u03c5\u03c4\u03cc\u03c4\u03b7\u03c4\u03b1\u03c2", + "zu": "Inombolo kamazisi yasendaweni", + "xh": "Inombolo yesazisi yasekuhlaleni" }, "attribute_manager": { "no": "Overordnet", @@ -1535,7 +1626,9 @@ "eu": "Kudeatzailea", "ca": "Gestor", "af": "Bestuurder", - "el": "\u0394\u03b9\u03b1\u03ba\u03b5\u03ba\u03c1\u03b9\u03bc\u03ad\u03bd\u03bf \u03cc\u03bd\u03bf\u03bc\u03b1 (DN) \u03b4\u03b9\u03b1\u03c7\u03b5\u03b9\u03c1\u03b9\u03c3\u03c4\u03ae" + "el": "\u0394\u03b9\u03b1\u03ba\u03b5\u03ba\u03c1\u03b9\u03bc\u03ad\u03bd\u03bf \u03cc\u03bd\u03bf\u03bc\u03b1 (DN) \u03b4\u03b9\u03b1\u03c7\u03b5\u03b9\u03c1\u03b9\u03c3\u03c4\u03ae", + "xh": "Umanejala", + "zu": "Umphathi" }, "attribute_userpassword": { "no": "Hash av brukerens passord", @@ -1571,7 +1664,9 @@ "eu": "Erabiltzailearen pasahitzaren hash-a", "ca": "Clau o contrasenya i m\u00e8tode d'encriptaci\u00f3 usat", "af": "Gebruikerswagwoord", - "el": "\u039a\u03c1\u03c5\u03c0\u03c4\u03bf\u03b3\u03c1\u03b1\u03c6\u03b7\u03bc\u03ad\u03bd\u03bf\u03c2 \u03ba\u03c9\u03b4\u03b9\u03ba\u03cc\u03c2" + "el": "\u039a\u03c1\u03c5\u03c0\u03c4\u03bf\u03b3\u03c1\u03b1\u03c6\u03b7\u03bc\u03ad\u03bd\u03bf\u03c2 \u03ba\u03c9\u03b4\u03b9\u03ba\u03cc\u03c2", + "xh": "Iheshi yephaswedi yomsebenzisi", + "zu": "Uheshi wephasiwedi yomsebenzisi" }, "attribute_edupersonprimaryorgunitdn": { "no": "Entydig navn for organisasjonsenheten som brukeren prim\u00e6rt er tilknyttet", @@ -1605,7 +1700,9 @@ "eu": "Pertsonaren antolamendu-unitatearen izen osatua (DN)", "ca": "Nom distingit (DN) de l'entrada del directori que representa l'identificador", "af": "Kenmerkende naam (DN) van die persoon se prim\u00eare organisatoriese afdeling", - "el": "\u0394\u03b9\u03b1\u03ba\u03b5\u03ba\u03c1\u03b9\u03bc\u03ad\u03bd\u03bf \u03cc\u03bd\u03bf\u03bc\u03b1 (DN) \u03ba\u03cd\u03c1\u03b9\u03b1\u03c2 \u03bf\u03c1\u03b3\u03b1\u03bd\u03c9\u03c4\u03b9\u03ba\u03ae\u03c2 \u03bc\u03bf\u03bd\u03ac\u03b4\u03b1\u03c2" + "el": "\u0394\u03b9\u03b1\u03ba\u03b5\u03ba\u03c1\u03b9\u03bc\u03ad\u03bd\u03bf \u03cc\u03bd\u03bf\u03bc\u03b1 (DN) \u03ba\u03cd\u03c1\u03b9\u03b1\u03c2 \u03bf\u03c1\u03b3\u03b1\u03bd\u03c9\u03c4\u03b9\u03ba\u03ae\u03c2 \u03bc\u03bf\u03bd\u03ac\u03b4\u03b1\u03c2", + "xh": "Igama elahlukileyo (DN) leYunithi Yenkampani yokuqala yomntu", + "zu": "Igama elihloniphekile (I-DN) Leyunithi Yenhlangano eyinhloko yomuntu" }, "attribute_schacuserprivateattribute": { "no": "Private informasjonselement", @@ -1640,7 +1737,9 @@ "ca": "Elements d'informaci\u00f3 privada", "fi": "Yksil\u00f6iv\u00e4t tunnisteet", "af": "Private informasie elemente", - "el": "\u0391\u03c0\u03cc\u03c1\u03c1\u03b7\u03c4\u03b1 \u03c0\u03c1\u03bf\u03c3\u03c9\u03c0\u03b9\u03ba\u03ac \u03c3\u03c4\u03bf\u03b9\u03c7\u03b5\u03af\u03b1" + "el": "\u0391\u03c0\u03cc\u03c1\u03c1\u03b7\u03c4\u03b1 \u03c0\u03c1\u03bf\u03c3\u03c9\u03c0\u03b9\u03ba\u03ac \u03c3\u03c4\u03bf\u03b9\u03c7\u03b5\u03af\u03b1", + "zu": "Izingxenye zolwazi oluyimfihlo", + "xh": "Iimpawu zenkcazelo yangasese" }, "attribute_noredupersonlegalname": { "no": "Folkeregistrert navn", @@ -1673,7 +1772,9 @@ "ca": "Nom legal", "fi": "Virallinen nimi", "af": "Wettige naam", - "el": "\u0395\u03c0\u03af\u03c3\u03b7\u03bc\u03bf \u03cc\u03bd\u03bf\u03bc\u03b1" + "el": "\u0395\u03c0\u03af\u03c3\u03b7\u03bc\u03bf \u03cc\u03bd\u03bf\u03bc\u03b1", + "xh": "Igama elisemthethweni", + "zu": "Igama elisemthethweni" }, "attribute_edupersonassurance": { "no": "Tillitsniv\u00e5 for autentisering", @@ -1703,7 +1804,9 @@ "eu": "Bermearen profilaren identifikatzailea", "ca": "Identificador del perfil de garantia", "af": "Identiteitsversekerings profiel", - "el": "\u0395\u03c0\u03af\u03c0\u03b5\u03b4\u03bf \u03b1\u03be\u03b9\u03bf\u03c0\u03b9\u03c3\u03c4\u03af\u03b1\u03c2 \u03c4\u03b1\u03c5\u03c4\u03bf\u03c0\u03bf\u03af\u03b7\u03c3\u03b7\u03c2" + "el": "\u0395\u03c0\u03af\u03c0\u03b5\u03b4\u03bf \u03b1\u03be\u03b9\u03bf\u03c0\u03b9\u03c3\u03c4\u03af\u03b1\u03c2 \u03c4\u03b1\u03c5\u03c4\u03bf\u03c0\u03bf\u03af\u03b7\u03c3\u03b7\u03c2", + "zu": "Iphrofayela yokuqinisekisa umazisi", + "xh": "Iprofayile yokuqinisekisa isazisi" }, "attribute_ismemberof": { "es": "Membres\u00eda a grupos", @@ -1713,6 +1816,8 @@ "nl": "Groepslidmaatschap", "da": "Gruppemedlemsskab", "af": "Groeplidmaatskap", - "el": "\u03a3\u03c5\u03bc\u03bc\u03b5\u03c4\u03bf\u03c7\u03ae \u03c3\u03b5 \u03bf\u03bc\u03ac\u03b4\u03b5\u03c2" + "el": "\u03a3\u03c5\u03bc\u03bc\u03b5\u03c4\u03bf\u03c7\u03ae \u03c3\u03b5 \u03bf\u03bc\u03ac\u03b4\u03b5\u03c2", + "xh": "Ubulungu beqela", + "zu": "Ubulungu beqembu" } } diff --git a/vendor/simplesamlphp/simplesamlphp/dictionaries/disco.translation.json b/vendor/simplesamlphp/simplesamlphp/dictionaries/disco.translation.json index 8fea4c86f6..9f17c1a3e4 100644 --- a/vendor/simplesamlphp/simplesamlphp/dictionaries/disco.translation.json +++ b/vendor/simplesamlphp/simplesamlphp/dictionaries/disco.translation.json @@ -32,13 +32,15 @@ "sr": "Odaberite va\u0161eg davaoca identiteta", "ro": "Alege\u021bi furnizorul de identitate", "af": "Kies jou identiteits verskaffer", - "el": "\u0395\u03c0\u03b9\u03bb\u03bf\u03b3\u03ae \u03bf\u03b9\u03ba\u03b5\u03af\u03bf\u03c5 \u03c6\u03bf\u03c1\u03ad\u03b1" + "el": "\u0395\u03c0\u03b9\u03bb\u03bf\u03b3\u03ae \u03bf\u03b9\u03ba\u03b5\u03af\u03bf\u03c5 \u03c6\u03bf\u03c1\u03ad\u03b1", + "xh": "Khetha umboneleli wesazisi wakho", + "zu": "Khetha umhlinzeki wakho kamazisi" }, "selectidp_full": { "no": "Vennligst velg hvilken identitetsleverand\u00f8r du vil bruke for \u00e5 logge inn:", "nn": "Vel innloggingsteneste (IdP) der du \u00f8nskjer \u00e5 logga inn.", "sv": "V\u00e4lj vilken identitetsleverant\u00f6r du vill logga in med:", - "es": "Por favor, seleccione el proveedor de identidad donde desea autenticarse", + "es": "Por favor, seleccione el proveedor de identidad que desea usar para autenticarse", "fr": "S\u00e9lectionnez le fournisseur d'identit\u00e9 aupr\u00e8s duquel vous souhaitez vous authentifier :", "de": "Bitte w\u00e4hlen Sie den Identity Provider, bei dem Sie sich authentifizieren m\u00f6chten:", "nl": "Selecteer de Identity Provider waar je wil authenticeren:", @@ -67,7 +69,9 @@ "sr": "Molimo vas odaberite davaoca identiteta kod koga se \u017eelite autentifikovati:", "ro": "V\u0103 rug\u0103m s\u0103 alege\u021bi furnizorul de identitate pe care dori\u021bi s\u0103-l folosi\u021bi pentru autentificarea dumneavoastr\u0103:", "af": "Kies asb. jou identiteits verskaffer waar jy wil verifieer:", - "el": "\u0395\u03c0\u03b9\u03bb\u03ad\u03be\u03c4\u03b5 \u03bf\u03b9\u03ba\u03b5\u03af\u03bf \u03c6\u03bf\u03c1\u03ad\u03b1 \u03c0\u03bf\u03c5 \u03bc\u03c0\u03bf\u03c1\u03b5\u03af \u03bd\u03b1 \u03c0\u03b9\u03c3\u03c4\u03bf\u03c0\u03bf\u03b9\u03ae\u03c3\u03b5\u03b9 \u03c4\u03b7\u03bd \u03c4\u03b1\u03c5\u03c4\u03cc\u03c4\u03b7\u03c4\u03ac \u03c3\u03b1\u03c2" + "el": "\u0395\u03c0\u03b9\u03bb\u03ad\u03be\u03c4\u03b5 \u03bf\u03b9\u03ba\u03b5\u03af\u03bf \u03c6\u03bf\u03c1\u03ad\u03b1 \u03c0\u03bf\u03c5 \u03bc\u03c0\u03bf\u03c1\u03b5\u03af \u03bd\u03b1 \u03c0\u03b9\u03c3\u03c4\u03bf\u03c0\u03bf\u03b9\u03ae\u03c3\u03b5\u03b9 \u03c4\u03b7\u03bd \u03c4\u03b1\u03c5\u03c4\u03cc\u03c4\u03b7\u03c4\u03ac \u03c3\u03b1\u03c2", + "zu": "Sicela ukhethe umhlinzeki kamazisi lapho ofuna ukuqinisekisa khona:", + "xh": "Nceda ukhethe umboneleli wesazisi apho ufuna ukungqinisisa:" }, "select": { "no": "Velg", @@ -102,7 +106,9 @@ "sr": "Odaberi", "ro": "Selecta\u021bi", "af": "Kies", - "el": "\u0395\u03c0\u03b9\u03bb\u03bf\u03b3\u03ae" + "el": "\u0395\u03c0\u03b9\u03bb\u03bf\u03b3\u03ae", + "zu": "Khetha", + "xh": "Khetha" }, "remember": { "no": "Husk mitt valg", @@ -137,12 +143,14 @@ "sr": "Zapamti moj izbor", "ro": "Memoreaz\u0103 alegerea f\u0103cut\u0103", "af": "Onthou my keuse", - "el": "\u039d\u03b1 \u03b8\u03c5\u03bc\u03ac\u03c3\u03b1\u03b9 \u03c4\u03b7\u03bd \u03b5\u03c0\u03b9\u03bb\u03bf\u03b3\u03ae \u03bc\u03bf\u03cd" + "el": "\u039d\u03b1 \u03b8\u03c5\u03bc\u03ac\u03c3\u03b1\u03b9 \u03c4\u03b7\u03bd \u03b5\u03c0\u03b9\u03bb\u03bf\u03b3\u03ae \u03bc\u03bf\u03cd", + "zu": "Khumbula ukukhetha kwami", + "xh": "Khumbula ukhetho lwam" }, "icon_prefered_idp": { "no": "[Foretrukket valg]", "sv": "Prioriterat val", - "es": "[Opci\u00f3n preference]", + "es": "[Opci\u00f3n preferida]", "de": "[Bevorzugte Auswahl]", "nl": "[Voorkeurskeuze]", "sl": "Prioritetna izbira", @@ -172,12 +180,14 @@ "cs": "[Preferovan\u00e1 volba]", "eu": "[Aukera gogokoena]", "af": "[Verkies]", - "el": "[\u0391\u03c0\u03bf\u03b8\u03b7\u03ba\u03b5\u03c5\u03bc\u03ad\u03bd\u03b7 \u03c0\u03c1\u03bf\u03b5\u03c0\u03b9\u03bb\u03bf\u03b3\u03ae]" + "el": "[\u0391\u03c0\u03bf\u03b8\u03b7\u03ba\u03b5\u03c5\u03bc\u03ad\u03bd\u03b7 \u03c0\u03c1\u03bf\u03b5\u03c0\u03b9\u03bb\u03bf\u03b3\u03ae]", + "xh": "[Ukhetho olukhethwayo]", + "zu": "[Ukukhetha okuncanyelwayo]" }, "previous_auth": { "no": "Du har tidligere valg \u00e5 autentisere deg hos", "sv": "Du har tidigare valt att logga in med", - "es": "Previamente solicit\u00f3 autenticarse en", + "es": "Previamente eligi\u00f3 autenticarse con", "nl": "Je hebt eerder gekozen voor authenticatie bij", "sl": "Predhodnje ste se prijavljali \u017ee pri", "da": "Du har tidligere valgt at logge ind hos", @@ -206,12 +216,14 @@ "cs": "D\u0159\u00edve jste zvolil(a) ov\u011b\u0159en\u00ed u", "eu": "Lehenago, hemen kautotzea hautatu duzu", "af": "Jy het voorheen gekies om te verifieer deur:", - "el": "\u0391\u03c0\u03bf\u03b8\u03b7\u03ba\u03b5\u03c5\u03bc\u03ad\u03bd\u03b7 \u03c0\u03c1\u03bf\u03b5\u03c0\u03b9\u03bb\u03bf\u03b3\u03ae \u03bf\u03b9\u03ba\u03b5\u03af\u03bf\u03c5 \u03c6\u03bf\u03c1\u03ad\u03b1:" + "el": "\u0391\u03c0\u03bf\u03b8\u03b7\u03ba\u03b5\u03c5\u03bc\u03ad\u03bd\u03b7 \u03c0\u03c1\u03bf\u03b5\u03c0\u03b9\u03bb\u03bf\u03b3\u03ae \u03bf\u03b9\u03ba\u03b5\u03af\u03bf\u03c5 \u03c6\u03bf\u03c1\u03ad\u03b1:", + "zu": "Ngaphambilini ukhethe ukuqinisekisa kokuthi", + "xh": "Kwixesha elidlulileyo ukhethe ukungqinisisa ngo-" }, "login_at": { "no": "Logg inn hos", "sv": "Logga in med", - "es": "Identificarse en", + "es": "Iniciar sesi\u00f3n en", "nl": "Inloggen bij", "sl": "Prijavi se pri", "da": "Login hos", @@ -240,6 +252,8 @@ "cs": "P\u0159ihl\u00e1\u0161en\u00ed k", "eu": "Non identifikatu", "af": "Meld aan by", - "el": "\u0395\u03af\u03c3\u03bf\u03b4\u03bf\u03c2 \u0040" + "el": "\u0395\u03af\u03c3\u03bf\u03b4\u03bf\u03c2 \u0040", + "zu": "Ngena kokuthi", + "xh": "Ungeno ngo-" } } diff --git a/vendor/simplesamlphp/simplesamlphp/dictionaries/errors.translation.json b/vendor/simplesamlphp/simplesamlphp/dictionaries/errors.translation.json index a206080f5a..dafc78c764 100644 --- a/vendor/simplesamlphp/simplesamlphp/dictionaries/errors.translation.json +++ b/vendor/simplesamlphp/simplesamlphp/dictionaries/errors.translation.json @@ -33,7 +33,9 @@ "ru": "\u041e\u0448\u0438\u0431\u043a\u0430 SimpleSAMLphp", "ro": "Eroare SimpleSAMLphp", "af": "SimpleSAMLphp-fout", - "el": "\u03a3\u03c6\u03ac\u03bb\u03bc\u03b1 \u03c4\u03bf\u03c5 SimpleSAMLphp" + "el": "\u03a3\u03c6\u03ac\u03bb\u03bc\u03b1 \u03c4\u03bf\u03c5 SimpleSAMLphp", + "zu": "Iphutha le-SimpleSAMLphp", + "xh": "Impazamo ye-SimpleSAMLphp" }, "report_trackid": { "no": "Hvis vil rapportere denne feilen, send ogs\u00e5 med dette sporingsnummeret. Det gj\u00f8r det enklere for systemadministratorene \u00e5 finne ut hva som gikk galt:", @@ -69,7 +71,9 @@ "ro": "Dac\u0103 raporta\u021bi aceast\u0103 eroare, v\u0103 rug\u0103m s\u0103 include\u021bi urm\u0103torul num\u0103r de \u00eenregistrare care va permite localizarea sesiunii dumneavoastr\u0103 \u00een jurnalele de sistem:", "eu": "Mesedez, errore honen berri ematen baduzu, mantendu ezazu jarraipen zenbaki hau, honek sistemaren administratzaileak dituen erregistroetan zure saioa aurkitzea ahalbidetzen baitu:", "af": "Waneer jy die fout rapporteer, verskaf asb. ook die 'tracking'\/verwysings nommer wat dit moontlik maak vir die sisteem administrateur om jou sessie in die logs op te spoor:", - "el": "\u0391\u03bd \u03b1\u03bd\u03b1\u03c6\u03ad\u03c1\u03b5\u03c4\u03b5 \u03b1\u03c5\u03c4\u03cc \u03c4\u03bf \u03c3\u03c6\u03ac\u03bb\u03bc\u03b1\u002c \u03c0\u03b1\u03c1\u03b1\u03ba\u03b1\u03bb\u03bf\u03cd\u03bc\u03b5 \u03bd\u03b1 \u03c3\u03c5\u03bc\u03c0\u03b5\u03c1\u03b9\u03bb\u03ac\u03b2\u03b5\u03c4\u03b5 \u03c3\u03c4\u03b7\u03bd \u03b1\u03bd\u03b1\u03c6\u03bf\u03c1\u03ac \u03c3\u03b1\u03c2 \u03b1\u03c5\u03c4\u03cc\u03bd \u03c4\u03bf\u03bd \u03b1\u03c1\u03b9\u03b8\u03bc\u03cc \u03c0\u03c1\u03bf\u03ba\u03b5\u03b9\u03bc\u03ad\u03bd\u03bf\u03c5 \u03bd\u03b1 \u03b4\u03b9\u03b5\u03c5\u03ba\u03bf\u03bb\u03cd\u03bd\u03b5\u03c4\u03b5 \u03c4\u03b7 \u03b4\u03b9\u03b1\u03b4\u03b9\u03ba\u03b1\u03c3\u03af\u03b1 \u03b5\u03bd\u03c4\u03bf\u03c0\u03b9\u03c3\u03bc\u03bf\u03cd \u03ba\u03b1\u03b9 \u03b5\u03c0\u03af\u03bb\u03c5\u03c3\u03b7\u03c2 \u03c4\u03bf\u03c5 \u03c0\u03c1\u03bf\u03b2\u03bb\u03ae\u03bc\u03b1\u03c4\u03bf\u03c2:" + "el": "\u0391\u03bd \u03b1\u03bd\u03b1\u03c6\u03ad\u03c1\u03b5\u03c4\u03b5 \u03b1\u03c5\u03c4\u03cc \u03c4\u03bf \u03c3\u03c6\u03ac\u03bb\u03bc\u03b1\u002c \u03c0\u03b1\u03c1\u03b1\u03ba\u03b1\u03bb\u03bf\u03cd\u03bc\u03b5 \u03bd\u03b1 \u03c3\u03c5\u03bc\u03c0\u03b5\u03c1\u03b9\u03bb\u03ac\u03b2\u03b5\u03c4\u03b5 \u03c3\u03c4\u03b7\u03bd \u03b1\u03bd\u03b1\u03c6\u03bf\u03c1\u03ac \u03c3\u03b1\u03c2 \u03b1\u03c5\u03c4\u03cc\u03bd \u03c4\u03bf\u03bd \u03b1\u03c1\u03b9\u03b8\u03bc\u03cc \u03c0\u03c1\u03bf\u03ba\u03b5\u03b9\u03bc\u03ad\u03bd\u03bf\u03c5 \u03bd\u03b1 \u03b4\u03b9\u03b5\u03c5\u03ba\u03bf\u03bb\u03cd\u03bd\u03b5\u03c4\u03b5 \u03c4\u03b7 \u03b4\u03b9\u03b1\u03b4\u03b9\u03ba\u03b1\u03c3\u03af\u03b1 \u03b5\u03bd\u03c4\u03bf\u03c0\u03b9\u03c3\u03bc\u03bf\u03cd \u03ba\u03b1\u03b9 \u03b5\u03c0\u03af\u03bb\u03c5\u03c3\u03b7\u03c2 \u03c4\u03bf\u03c5 \u03c0\u03c1\u03bf\u03b2\u03bb\u03ae\u03bc\u03b1\u03c4\u03bf\u03c2:", + "zu": "Uma ubika leli phutha, sicela futhi ubike le nombolo yokulandelela eyenza kube nokwenzeka ukuthola iseshini yakho kumalogi atholakalayo kumlawuli wesistimu:", + "xh": "Ukuba ngaba uchaza le mpazamo, nceda kananjalo uchaze le nombolo yolandelelo eyenza kube lula ukufumana iseshoni yakho kwiincwadi ezifumaneka kumlawuli wesistim:" }, "debuginfo_header": { "no": "Detaljer for feils\u00f8king", @@ -105,7 +109,9 @@ "ru": "\u041e\u0442\u043b\u0430\u0434\u043e\u0447\u043d\u0430\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f", "ro": "Informa\u021bii de depanare", "af": "Ontleed informasie", - "el": "\u03a0\u03bb\u03b7\u03c1\u03bf\u03c6\u03bf\u03c1\u03af\u03b5\u03c2 \u03b5\u03bd\u03c4\u03bf\u03c0\u03b9\u03c3\u03bc\u03bf\u03cd \u03c3\u03c6\u03b1\u03bb\u03bc\u03ac\u03c4\u03c9\u03bd" + "el": "\u03a0\u03bb\u03b7\u03c1\u03bf\u03c6\u03bf\u03c1\u03af\u03b5\u03c2 \u03b5\u03bd\u03c4\u03bf\u03c0\u03b9\u03c3\u03bc\u03bf\u03cd \u03c3\u03c6\u03b1\u03bb\u03bc\u03ac\u03c4\u03c9\u03bd", + "xh": "Inkcazelo yokulungisa", + "zu": "Ulwazi lokususwa kwephutha" }, "debuginfo_text": { "no": "Detaljene nedenfor kan v\u00e6re av interesse for administratoren \/ brukerst\u00f8tte:", @@ -141,7 +147,9 @@ "ru": "\u041d\u0438\u0436\u0435\u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u0430\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u043e\u043b\u0435\u0437\u043d\u0430 \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0443 \u0441\u0438\u0441\u0442\u0435\u043c\u044b:", "ro": "Informa\u021biile de depanare de mai jos pot fi importante pentru administratorul de sistem:", "af": "Die onderstaande informasie mag van hulp wees vir die stelsel administrateur \/ hulplyn.", - "el": "\u039f\u03b9 \u03c0\u03b1\u03c1\u03b1\u03ba\u03ac\u03c4\u03c9 \u03c0\u03bb\u03b7\u03c1\u03bf\u03c6\u03bf\u03c1\u03af\u03b5\u03c2 \u03bc\u03c0\u03bf\u03c1\u03b5\u03af \u03bd\u03b1 \u03b4\u03b9\u03b5\u03c5\u03ba\u03bf\u03bb\u03cd\u03bd\u03bf\u03c5\u03bd \u03c4\u03b7 \u03b4\u03b9\u03b1\u03b4\u03b9\u03ba\u03b1\u03c3\u03af\u03b1 \u03b5\u03bd\u03c4\u03bf\u03c0\u03b9\u03c3\u03bc\u03bf\u03cd \u03ba\u03b1\u03b9 \u03b5\u03c0\u03af\u03bb\u03c5\u03c3\u03b7\u03c2 \u03c3\u03c6\u03b1\u03bb\u03bc\u03ac\u03c4\u03c9\u03bd." + "el": "\u039f\u03b9 \u03c0\u03b1\u03c1\u03b1\u03ba\u03ac\u03c4\u03c9 \u03c0\u03bb\u03b7\u03c1\u03bf\u03c6\u03bf\u03c1\u03af\u03b5\u03c2 \u03bc\u03c0\u03bf\u03c1\u03b5\u03af \u03bd\u03b1 \u03b4\u03b9\u03b5\u03c5\u03ba\u03bf\u03bb\u03cd\u03bd\u03bf\u03c5\u03bd \u03c4\u03b7 \u03b4\u03b9\u03b1\u03b4\u03b9\u03ba\u03b1\u03c3\u03af\u03b1 \u03b5\u03bd\u03c4\u03bf\u03c0\u03b9\u03c3\u03bc\u03bf\u03cd \u03ba\u03b1\u03b9 \u03b5\u03c0\u03af\u03bb\u03c5\u03c3\u03b7\u03c2 \u03c3\u03c6\u03b1\u03bb\u03bc\u03ac\u03c4\u03c9\u03bd.", + "xh": "Inkcazelo yokulungisa engezantsi isenokuba ibangela umdla kumlawuli / idesika yoncedo:", + "zu": "Ulwazi lokususwa kwephutha olungezansi lungase lukhange kumlawuli / ideski losizo:" }, "report_header": { "no": "Rapporter feil", @@ -177,7 +185,9 @@ "ru": "\u0421\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043e\u0431 \u043e\u0448\u0438\u0431\u043a\u0430\u0445", "ro": "Raporta\u021bi erorile", "af": "Rapporteer foute", - "el": "\u0391\u03bd\u03b1\u03c6\u03bf\u03c1\u03ac \u03c3\u03c6\u03ac\u03bb\u03bc\u03b1\u03c4\u03bf\u03c2" + "el": "\u0391\u03bd\u03b1\u03c6\u03bf\u03c1\u03ac \u03c3\u03c6\u03ac\u03bb\u03bc\u03b1\u03c4\u03bf\u03c2", + "zu": "Amaphutha ombiko", + "xh": "Chaza iimpazamo" }, "report_text": { "no": "Hvis du \u00f8nsker at brukerst\u00f8tte skal kunne kontakte deg igjen i forbindelse med denne feilen, m\u00e5 du oppgi e-postadressen din nedenfor:", @@ -213,7 +223,9 @@ "ro": "Op\u021bional, trece\u021bi adresa dumneavoastr\u0103 de e-mail. Administratorii de sistem vor putea s\u0103 v\u0103 contacteze pentru eventuale informa\u021bii suplimentare despre problema dumneavoastra:", "ru": "\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0430\u0434\u0440\u0435\u0441 \u0432\u0430\u0448\u0435\u0439 \u044d\u043b\u0435\u043a\u0442\u0440\u043e\u043d\u043d\u043e\u0439 \u043f\u043e\u0447\u0442\u044b, \u0447\u0442\u043e\u0431\u044b \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440 \u043c\u043e\u0433 \u0441\u0432\u044f\u0437\u0430\u0442\u044c\u0441\u044f \u0441 \u0432\u0430\u043c\u0438 \u0434\u043b\u044f \u043f\u0440\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438 (\u043d\u0435\u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e):", "af": "Voeg opsioneel jou epos adres in vir die administrateurs om jou te kontak vir meer inligting m.b.t jou probleem:", - "el": "\u03a0\u03c1\u03bf\u03b1\u03b9\u03c1\u03b5\u03c4\u03b9\u03ba\u03ac\u002c \u03b5\u03b9\u03c3\u03ac\u03b3\u03b5\u03c4\u03b5 \u03c4\u03b7 \u03b4\u03b9\u03b5\u03cd\u03b8\u03c5\u03bd\u03c3\u03b7 \u03b7\u03bb\u03b5\u03ba\u03c4\u03c1\u03bf\u03bd\u03b9\u03ba\u03bf\u03cd \u03c4\u03b1\u03c7\u03c5\u03b4\u03c1\u03bf\u03bc\u03b5\u03af\u03bf\u03c5 \u03c3\u03b1\u03c2 \u03ce\u03c3\u03c4\u03b5 \u03bd\u03b1 \u03b5\u03af\u03bc\u03b1\u03c3\u03c4\u03b5 \u03c3\u03b5 \u03b8\u03ad\u03c3\u03b7 \u03bd\u03b1 \u03ad\u03c1\u03b8\u03bf\u03c5\u03bc\u03b5 \u03c3\u03b5 \u03b5\u03c0\u03b1\u03c6\u03ae \u03bc\u03b1\u03b6\u03af \u03c3\u03b1\u03c2 \u03b3\u03b9\u03b1 \u03c0\u03b5\u03c1\u03b1\u03b9\u03c4\u03ad\u03c1\u03c9 \u03b5\u03c1\u03c9\u03c4\u03ae\u03c3\u03b5\u03b9\u03c2 \u03c3\u03c7\u03b5\u03c4\u03b9\u03ba\u03ac \u03bc\u03b5 \u03c4\u03bf \u03b8\u03ad\u03bc\u03b1 \u03c3\u03b1\u03c2:" + "el": "\u03a0\u03c1\u03bf\u03b1\u03b9\u03c1\u03b5\u03c4\u03b9\u03ba\u03ac\u002c \u03b5\u03b9\u03c3\u03ac\u03b3\u03b5\u03c4\u03b5 \u03c4\u03b7 \u03b4\u03b9\u03b5\u03cd\u03b8\u03c5\u03bd\u03c3\u03b7 \u03b7\u03bb\u03b5\u03ba\u03c4\u03c1\u03bf\u03bd\u03b9\u03ba\u03bf\u03cd \u03c4\u03b1\u03c7\u03c5\u03b4\u03c1\u03bf\u03bc\u03b5\u03af\u03bf\u03c5 \u03c3\u03b1\u03c2 \u03ce\u03c3\u03c4\u03b5 \u03bd\u03b1 \u03b5\u03af\u03bc\u03b1\u03c3\u03c4\u03b5 \u03c3\u03b5 \u03b8\u03ad\u03c3\u03b7 \u03bd\u03b1 \u03ad\u03c1\u03b8\u03bf\u03c5\u03bc\u03b5 \u03c3\u03b5 \u03b5\u03c0\u03b1\u03c6\u03ae \u03bc\u03b1\u03b6\u03af \u03c3\u03b1\u03c2 \u03b3\u03b9\u03b1 \u03c0\u03b5\u03c1\u03b1\u03b9\u03c4\u03ad\u03c1\u03c9 \u03b5\u03c1\u03c9\u03c4\u03ae\u03c3\u03b5\u03b9\u03c2 \u03c3\u03c7\u03b5\u03c4\u03b9\u03ba\u03ac \u03bc\u03b5 \u03c4\u03bf \u03b8\u03ad\u03bc\u03b1 \u03c3\u03b1\u03c2:", + "xh": "Unokhetho lokuthumela idilesi yeimeyile yakho, ukuze abalawuli bakwazi ukukuqhagamshela ukuba banemibuzo engakumbi malunga nomba wakho:", + "zu": "Faka ngokuzithandela ikheli lakho le-imeyili, ukuze abalawuli bakwazi ukukuthinta ngemibuzo eyengeziwe mayelana nenkinga yakho:" }, "report_email": { "no": "E-postadresse:", @@ -250,7 +262,9 @@ "ro": "Adresa e-mail:", "ru": "\u0410\u0434\u0440\u0435\u0441 \u0432\u0430\u0448\u0435\u0439 \u044d\u043b\u0435\u043a\u0442\u0440\u043e\u043d\u043d\u043e\u0439 \u043f\u043e\u0447\u0442\u044b:", "af": "Epos adres:", - "el": "Email:" + "el": "Email:", + "xh": "Idilesi ye-imeyile:", + "zu": "Ikheli le-imeyili:" }, "report_explain": { "no": "Forklar hva du gjorde da feilen oppsto...", @@ -286,7 +300,9 @@ "ro": "Descrie\u021bi ce opera\u021biuini executa\u021bi c\u00e2nd a ap\u0103rut aceast\u0103 eroare ...", "ru": "\u0423\u0442\u043e\u0447\u043d\u0438\u0442\u0435 \u0432\u0430\u0448\u0438 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043f\u0435\u0440\u0435\u0434 \u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u0435\u043c \u043e\u0448\u0438\u0431\u043a\u0438... ", "af": "Verduidelik wat jy gedoen het toe jy die probleem ervaar...", - "el": "\u03a0\u03b5\u03c1\u03b9\u03b3\u03c1\u03ac\u03c8\u03c4\u03b5 \u03c4\u03b9\u03c2 \u03b5\u03bd\u03ad\u03c1\u03b3\u03b5\u03b9\u03ad\u03c2 \u03c3\u03b1\u03c2 \u03cc\u03c4\u03b1\u03bd \u03c3\u03c5\u03bd\u03ad\u03b2\u03b7 \u03c4\u03bf \u03c3\u03c6\u03ac\u03bb\u03bc\u03b1..." + "el": "\u03a0\u03b5\u03c1\u03b9\u03b3\u03c1\u03ac\u03c8\u03c4\u03b5 \u03c4\u03b9\u03c2 \u03b5\u03bd\u03ad\u03c1\u03b3\u03b5\u03b9\u03ad\u03c2 \u03c3\u03b1\u03c2 \u03cc\u03c4\u03b1\u03bd \u03c3\u03c5\u03bd\u03ad\u03b2\u03b7 \u03c4\u03bf \u03c3\u03c6\u03ac\u03bb\u03bc\u03b1...", + "xh": "Cacisa ukuba wenze ntoni xa bekusenzeka le mpazamo...", + "zu": "Chaza ukuthi yini oyenzile ngenkathi kuvela leli phutha..." }, "report_submit": { "no": "Send feilrapport", @@ -322,7 +338,9 @@ "ro": "Trimite\u021bi raportul cu erorile observate", "ru": "\u0412\u044b\u0441\u043b\u0430\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043e\u0431 \u043e\u0448\u0438\u0431\u043a\u0435 ", "af": "Stuur die fout verslag", - "el": "\u0391\u03c0\u03bf\u03c3\u03c4\u03bf\u03bb\u03ae \u03b1\u03bd\u03b1\u03c6\u03bf\u03c1\u03ac\u03c2" + "el": "\u0391\u03c0\u03bf\u03c3\u03c4\u03bf\u03bb\u03ae \u03b1\u03bd\u03b1\u03c6\u03bf\u03c1\u03ac\u03c2", + "zu": "Thumela umbiko wephutha", + "xh": "Thumela ingxelo yempazamo" }, "howto_header": { "no": "Hvordan f\u00e5 hjelp", @@ -358,7 +376,9 @@ "ro": "Cum ob\u021bine\u021bi ajutor\/asisten\u021b\u0103", "ru": "\u041a\u0430\u043a \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043f\u043e\u043c\u043e\u0449\u044c", "af": "Hoe om hulp te verkry", - "el": "\u03a0\u03ce\u03c2 \u03bd\u03b1 \u03bb\u03ac\u03b2\u03b5\u03c4\u03b5 \u03b2\u03bf\u03ae\u03b8\u03b5\u03b9\u03b1" + "el": "\u03a0\u03ce\u03c2 \u03bd\u03b1 \u03bb\u03ac\u03b2\u03b5\u03c4\u03b5 \u03b2\u03bf\u03ae\u03b8\u03b5\u03b9\u03b1", + "zu": "Indlela yokuthola usizo", + "xh": "Indlela yokufumana uncedo" }, "howto_text": { "no": "Denne feilen skyldes sannsynligvis feil i oppsettet av SimpleSAMLphp eller den er en f\u00f8lge av en uforutsett hendelse. Kontakt administratoren av denne tjenesten og rapporter s\u00e5 mye som mulig ang\u00e5ende feilen.", @@ -394,7 +414,9 @@ "ru": "\u042d\u0442\u0430 \u043e\u0448\u0438\u0431\u043a\u0430 \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u0430, \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e, \u0438\u0437-\u0437\u0430 \u043d\u0435\u043f\u0440\u0435\u0434\u0432\u0438\u0434\u0435\u043d\u043d\u043e\u0439 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438 \u0438\u043b\u0438 \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0439 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 SimpleSAMLphp. \u0421\u0432\u044f\u0436\u0438\u0442\u0435\u0441\u044c \u0441 \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u043e\u043c \u044d\u0442\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u044c\u0442\u0435 \u0435\u043c\u0443 \u0432\u044b\u0448\u0435\u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043e\u0431 \u043e\u0448\u0438\u0431\u043a\u0435.", "eu": "Errore hau jazo izana SimpleSAMLphp-en ezusteko jokaera edo konfigurazio okerra izan da. Jar zaitez harremanetan identifikazio zerbitzu honen administratzailearekin eta bidal iezaiozu lehenagoko errore mezua. ", "af": "Die fout is moontlik te danke aan onverwagte gedrag of weens inkorrekte instellings in SimpleSAMLphp. Kontak die administrateur in beheer van die aanmeld diens en stuur die bostaande fout boodskap aan.", - "el": "\u0391\u03c5\u03c4\u03cc \u03c4\u03bf \u03c3\u03c6\u03ac\u03bb\u03bc\u03b1 \u03c0\u03b9\u03b8\u03b1\u03bd\u03cc\u03c4\u03b1\u03c4\u03b1 \u03bf\u03c6\u03b5\u03af\u03bb\u03b5\u03c4\u03b1\u03b9 \u03c3\u03b5 \u03ba\u03ac\u03c0\u03bf\u03b9\u03b1 \u03b1\u03c0\u03c1\u03bf\u03c3\u03b4\u03cc\u03ba\u03b7\u03c4\u03b7 \u03c3\u03c5\u03bc\u03c0\u03b5\u03c1\u03b9\u03c6\u03bf\u03c1\u03ac \u03ae \u03b5\u03c3\u03c6\u03b1\u03bb\u03bc\u03ad\u03bd\u03b7 \u03c1\u03cd\u03b8\u03bc\u03b9\u03c3\u03b7 \u03c4\u03bf\u03c5 SimpleSAMLphp. \u0395\u03c0\u03b9\u03ba\u03bf\u03b9\u03bd\u03c9\u03bd\u03ae\u03c3\u03c4\u03b5 \u03bc\u03b5 \u03c4\u03bf\u03bd \u03b4\u03b9\u03b1\u03c7\u03b5\u03b9\u03c1\u03b9\u03c3\u03c4\u03ae \u03b1\u03c5\u03c4\u03ae\u03c2 \u03c4\u03b7\u03c2 \u03c5\u03c0\u03b7\u03c1\u03b5\u03c3\u03af\u03b1\u03c2 \u03c3\u03c5\u03bc\u03c0\u03b5\u03c1\u03b9\u03bb\u03b1\u03bc\u03b2\u03ac\u03bd\u03bf\u03bd\u03c4\u03b1\u03c2 \u03c4\u03bf \u03c0\u03b1\u03c1\u03b1\u03c0\u03ac\u03bd\u03c9 \u03bc\u03ae\u03bd\u03c5\u03bc\u03b1 \u03c3\u03c6\u03ac\u03bb\u03bc\u03b1\u03c4\u03bf\u03c2." + "el": "\u0391\u03c5\u03c4\u03cc \u03c4\u03bf \u03c3\u03c6\u03ac\u03bb\u03bc\u03b1 \u03c0\u03b9\u03b8\u03b1\u03bd\u03cc\u03c4\u03b1\u03c4\u03b1 \u03bf\u03c6\u03b5\u03af\u03bb\u03b5\u03c4\u03b1\u03b9 \u03c3\u03b5 \u03ba\u03ac\u03c0\u03bf\u03b9\u03b1 \u03b1\u03c0\u03c1\u03bf\u03c3\u03b4\u03cc\u03ba\u03b7\u03c4\u03b7 \u03c3\u03c5\u03bc\u03c0\u03b5\u03c1\u03b9\u03c6\u03bf\u03c1\u03ac \u03ae \u03b5\u03c3\u03c6\u03b1\u03bb\u03bc\u03ad\u03bd\u03b7 \u03c1\u03cd\u03b8\u03bc\u03b9\u03c3\u03b7 \u03c4\u03bf\u03c5 SimpleSAMLphp. \u0395\u03c0\u03b9\u03ba\u03bf\u03b9\u03bd\u03c9\u03bd\u03ae\u03c3\u03c4\u03b5 \u03bc\u03b5 \u03c4\u03bf\u03bd \u03b4\u03b9\u03b1\u03c7\u03b5\u03b9\u03c1\u03b9\u03c3\u03c4\u03ae \u03b1\u03c5\u03c4\u03ae\u03c2 \u03c4\u03b7\u03c2 \u03c5\u03c0\u03b7\u03c1\u03b5\u03c3\u03af\u03b1\u03c2 \u03c3\u03c5\u03bc\u03c0\u03b5\u03c1\u03b9\u03bb\u03b1\u03bc\u03b2\u03ac\u03bd\u03bf\u03bd\u03c4\u03b1\u03c2 \u03c4\u03bf \u03c0\u03b1\u03c1\u03b1\u03c0\u03ac\u03bd\u03c9 \u03bc\u03ae\u03bd\u03c5\u03bc\u03b1 \u03c3\u03c6\u03ac\u03bb\u03bc\u03b1\u03c4\u03bf\u03c2.", + "zu": "Leli phutha kungenzeka ukuthi libangelwa indlela yokuziphatha engalindelwe noma umiso olungafanele lwe-SimpleSAMLphp. Thinta umlawuli wale sevisi yokungena, bese umthumela umlayezo wephutha ongenhla.", + "xh": "Le mpazamo kusenokwenzeka ingenxa yendlela yokwenza engalindelekanga okanye ulungiselelo olungachanekanga lwe-SimpleSAMLphp. Qhagamshelana nomlawuli wale nkonzo yokungena, uze umthumele umyalezo wempazamo ongentla." }, "title_CREATEREQUEST": { "no": "Feil i laging av foresp\u00f8rselen", @@ -430,7 +452,9 @@ "ro": "Eroare la crearea cererii", "ru": "\u041e\u0448\u0438\u0431\u043a\u0430 \u043f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u0430", "af": "Fout met skepping van nuwe versoek", - "el": "\u03a3\u03c6\u03ac\u03bb\u03bc\u03b1 \u03ba\u03b1\u03c4\u03ac \u03c4\u03b7 \u03b4\u03b7\u03bc\u03b9\u03bf\u03c5\u03c1\u03b3\u03af\u03b1 \u03b1\u03b9\u03c4\u03ae\u03bc\u03b1\u03c4\u03bf\u03c2" + "el": "\u03a3\u03c6\u03ac\u03bb\u03bc\u03b1 \u03ba\u03b1\u03c4\u03ac \u03c4\u03b7 \u03b4\u03b7\u03bc\u03b9\u03bf\u03c5\u03c1\u03b3\u03af\u03b1 \u03b1\u03b9\u03c4\u03ae\u03bc\u03b1\u03c4\u03bf\u03c2", + "xh": "Impazamo nokuyila isicelo", + "zu": "Iphutha lokwakha isicelo" }, "descr_CREATEREQUEST": { "no": "En feil oppstod da SAML-foresp\u00f8rselen skulle lages.", @@ -466,7 +490,9 @@ "ro": "A ap\u0103rut o eroare la crearea cererii SAML.", "ru": "\u041f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u0430 \u043e\u0448\u0438\u0431\u043a\u0430 \u043f\u0440\u0438 \u043f\u043e\u043f\u044b\u0442\u043a\u0435 \u0441\u043e\u0437\u0434\u0430\u0442\u044c SAML \u0437\u0430\u043f\u0440\u043e\u0441.", "af": "Daar was 'n fout met die skepping van die SAML versoek.", - "el": "\u03a0\u03b1\u03c1\u03bf\u03c5\u03c3\u03b9\u03ac\u03c3\u03c4\u03b7\u03ba\u03b5 \u03c3\u03c6\u03ac\u03bb\u03bc\u03b1 \u03ba\u03b1\u03c4\u03ac \u03c4\u03b7 \u03b4\u03b7\u03bc\u03b9\u03bf\u03c5\u03c1\u03b3\u03af\u03b1 \u03c4\u03bf\u03c5 \u03b1\u03b9\u03c4\u03ae\u03bc\u03b1\u03c4\u03bf\u03c2 SAML." + "el": "\u03a0\u03b1\u03c1\u03bf\u03c5\u03c3\u03b9\u03ac\u03c3\u03c4\u03b7\u03ba\u03b5 \u03c3\u03c6\u03ac\u03bb\u03bc\u03b1 \u03ba\u03b1\u03c4\u03ac \u03c4\u03b7 \u03b4\u03b7\u03bc\u03b9\u03bf\u03c5\u03c1\u03b3\u03af\u03b1 \u03c4\u03bf\u03c5 \u03b1\u03b9\u03c4\u03ae\u03bc\u03b1\u03c4\u03bf\u03c2 SAML.", + "xh": "Kwenzeke impazamo xa kuzanywa ukuyilwa isicelo se-SAML.", + "zu": "Kuvele iphutha ngenkathi izama ukwakha isicelo se-SAML." }, "title_DISCOPARAMS": { "no": "Ugyldig foresp\u00f8rsel til SAML 2.0 Discovery-tjenesten", @@ -502,7 +528,9 @@ "ru": "\u041d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u043a \u0441\u043b\u0443\u0436\u0431\u0435 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u0438\u044f", "eu": "Eskaera okerra aurkikuntza zerbitzuari", "af": "Toegangsfout by die ontdekkings diens", - "el": "\u0395\u03c3\u03c6\u03b1\u03bb\u03bc\u03ad\u03bd\u03bf \u03b1\u03af\u03c4\u03b7\u03bc\u03b1 \u03c0\u03c1\u03bf\u03c2 \u03c4\u03b7\u03bd \u03c5\u03c0\u03b7\u03c1\u03b5\u03c3\u03af\u03b1 \u03b1\u03bd\u03b5\u03cd\u03c1\u03b5\u03c3\u03b7\u03c2 \u03c0\u03b1\u03c1\u03cc\u03c7\u03bf\u03c5 \u03c4\u03b1\u03c5\u03c4\u03cc\u03c4\u03b7\u03c4\u03b1\u03c2" + "el": "\u0395\u03c3\u03c6\u03b1\u03bb\u03bc\u03ad\u03bd\u03bf \u03b1\u03af\u03c4\u03b7\u03bc\u03b1 \u03c0\u03c1\u03bf\u03c2 \u03c4\u03b7\u03bd \u03c5\u03c0\u03b7\u03c1\u03b5\u03c3\u03af\u03b1 \u03b1\u03bd\u03b5\u03cd\u03c1\u03b5\u03c3\u03b7\u03c2 \u03c0\u03b1\u03c1\u03cc\u03c7\u03bf\u03c5 \u03c4\u03b1\u03c5\u03c4\u03cc\u03c4\u03b7\u03c4\u03b1\u03c2", + "zu": "Isicelo esingalungile sesevisi yokuthola", + "xh": "Isicelo esibi kwinkonzo yofumaniso" }, "descr_DISCOPARAMS": { "no": "Parametere sendt til discovery-tjenesten var ikke i korrekt format.", @@ -538,7 +566,9 @@ "ru": "\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b, \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0435 \u0432 \u0441\u043b\u0443\u0436\u0431\u0443 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u0438\u044f, \u043d\u0435 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0442 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438.", "eu": "Aurkikuntza zerbitzuari bidalitako prametroak ez dira zehaztapenera doitzen.", "af": "Die gestuurde parameters na die ontdekkings diens was not volgens die korrekte spesifikasies nie.", - "el": "\u039f\u03b9 \u03c0\u03b1\u03c1\u03ac\u03bc\u03b5\u03c4\u03c1\u03bf\u03b9 \u03c0\u03bf\u03c5 \u03c3\u03c4\u03ac\u03bb\u03b8\u03b7\u03ba\u03b1\u03bd \u03c3\u03c4\u03b7\u03bd \u03c5\u03c0\u03b7\u03c1\u03b5\u03c3\u03af\u03b1 \u03b1\u03bd\u03b5\u03cd\u03c1\u03b5\u03c3\u03b7\u03c2 \u03c0\u03b1\u03c1\u03cc\u03c7\u03bf\u03c5 \u03c4\u03b1\u03c5\u03c4\u03cc\u03c4\u03b7\u03c4\u03b1\u03c2 \u03ae\u03c4\u03b1\u03bd \u03b5\u03c3\u03c6\u03b1\u03bb\u03bc\u03ad\u03bd\u03b5\u03c2." + "el": "\u039f\u03b9 \u03c0\u03b1\u03c1\u03ac\u03bc\u03b5\u03c4\u03c1\u03bf\u03b9 \u03c0\u03bf\u03c5 \u03c3\u03c4\u03ac\u03bb\u03b8\u03b7\u03ba\u03b1\u03bd \u03c3\u03c4\u03b7\u03bd \u03c5\u03c0\u03b7\u03c1\u03b5\u03c3\u03af\u03b1 \u03b1\u03bd\u03b5\u03cd\u03c1\u03b5\u03c3\u03b7\u03c2 \u03c0\u03b1\u03c1\u03cc\u03c7\u03bf\u03c5 \u03c4\u03b1\u03c5\u03c4\u03cc\u03c4\u03b7\u03c4\u03b1\u03c2 \u03ae\u03c4\u03b1\u03bd \u03b5\u03c3\u03c6\u03b1\u03bb\u03bc\u03ad\u03bd\u03b5\u03c2.", + "xh": "Iipharamitha ezithunyelwe kwinkonzo yofumaniso azihambelani neenkcukacha.", + "zu": "Amapharamitha athunyelwe kusevisi yokuthola abengavumelani nezici." }, "title_GENERATEAUTHNRESPONSE": { "no": "Fikk ikke svart p\u00e5 autentiserings-foresp\u00f8rsel", @@ -574,7 +604,9 @@ "ru": "\u041d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043e\u0442\u0432\u0435\u0442 \u043f\u043e \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438", "eu": "Ezin izan da kautotze erantzuna sortu", "af": "Kon nie 'n verifikasie versoek skep nie", - "el": "\u0394\u03b5\u03bd \u03ae\u03c4\u03b1\u03bd \u03b4\u03c5\u03bd\u03b1\u03c4\u03ae \u03b7 \u03b4\u03b7\u03bc\u03b9\u03bf\u03c5\u03c1\u03b3\u03af\u03b1 \u03b1\u03c0\u03cc\u03ba\u03c1\u03b9\u03c3\u03b7\u03c2 \u03c3\u03c4\u03bf \u03b1\u03af\u03c4\u03b7\u03bc\u03b1 \u03c4\u03b1\u03c5\u03c4\u03bf\u03c0\u03bf\u03af\u03b7\u03c3\u03b7\u03c2" + "el": "\u0394\u03b5\u03bd \u03ae\u03c4\u03b1\u03bd \u03b4\u03c5\u03bd\u03b1\u03c4\u03ae \u03b7 \u03b4\u03b7\u03bc\u03b9\u03bf\u03c5\u03c1\u03b3\u03af\u03b1 \u03b1\u03c0\u03cc\u03ba\u03c1\u03b9\u03c3\u03b7\u03c2 \u03c3\u03c4\u03bf \u03b1\u03af\u03c4\u03b7\u03bc\u03b1 \u03c4\u03b1\u03c5\u03c4\u03bf\u03c0\u03bf\u03af\u03b7\u03c3\u03b7\u03c2", + "zu": "Ayikwazanga ukwakha impendulo yokuqinisekisa", + "xh": "Ayikwazanga ukuyila impendulo yongqinisiso" }, "descr_GENERATEAUTHNRESPONSE": { "no": "En feil oppsto da innloggingstjenesten pr\u00f8vde \u00e5 lage et svar p\u00e5 autentiserings-foresp\u00f8rselen.", @@ -610,7 +642,9 @@ "ru": "\u041f\u0440\u0438 \u043f\u043e\u043f\u044b\u0442\u043a\u0435 \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u0430 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043e\u0442\u0432\u0435\u0442 \u043f\u043e \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u0430 \u043e\u0448\u0438\u0431\u043a\u0430.", "eu": "Identitatearen hornitzaileak errore bat antzeman du kautotze erantzuna sortzean.", "af": "Daar was 'n fout tydens die verifikasie skepping deur die Identiteits Verskaffer.", - "el": "\u03a0\u03b1\u03c1\u03bf\u03c5\u03c3\u03b9\u03ac\u03c3\u03c4\u03b7\u03ba\u03b5 \u03c3\u03c6\u03ac\u03bb\u03bc\u03b1 \u03ba\u03b1\u03c4\u03ac \u03c4\u03b7 \u03b4\u03b7\u03bc\u03b9\u03bf\u03c5\u03c1\u03b3\u03af\u03b1 \u03b1\u03c0\u03cc\u03ba\u03c1\u03b9\u03c3\u03b7\u03c2 \u03b1\u03c0\u03cc \u03c4\u03bf\u03bd \u03c0\u03ac\u03c1\u03bf\u03c7\u03bf \u03c4\u03b1\u03c5\u03c4\u03cc\u03c4\u03b7\u03c4\u03b1\u03c2." + "el": "\u03a0\u03b1\u03c1\u03bf\u03c5\u03c3\u03b9\u03ac\u03c3\u03c4\u03b7\u03ba\u03b5 \u03c3\u03c6\u03ac\u03bb\u03bc\u03b1 \u03ba\u03b1\u03c4\u03ac \u03c4\u03b7 \u03b4\u03b7\u03bc\u03b9\u03bf\u03c5\u03c1\u03b3\u03af\u03b1 \u03b1\u03c0\u03cc\u03ba\u03c1\u03b9\u03c3\u03b7\u03c2 \u03b1\u03c0\u03cc \u03c4\u03bf\u03bd \u03c0\u03ac\u03c1\u03bf\u03c7\u03bf \u03c4\u03b1\u03c5\u03c4\u03cc\u03c4\u03b7\u03c4\u03b1\u03c2.", + "zu": "Ngenkathi lo mhlinzeki kamazisi ezama ukwakha impendulo yokuqinisekisa, kuvele iphutha.", + "xh": "Xa lo mboneleli wesazisi ezama ukuyila impendulo yongqinisiso, kwenzeke impazamo." }, "title_LDAPERROR": { "no": "LDAP-feil", @@ -646,7 +680,9 @@ "ro": "Eroare LDAP", "ru": "\u041e\u0448\u0438\u0431\u043a\u0430 LDAP", "af": "LDAP Fout", - "el": "\u03a3\u03c6\u03ac\u03bb\u03bc\u03b1 LDAP" + "el": "\u03a3\u03c6\u03ac\u03bb\u03bc\u03b1 LDAP", + "xh": "Impazamo ye-LDAP", + "zu": "Iphutha le-LDAP" }, "descr_LDAPERROR": { "no": "LDAP er brukerkatalogen, og n\u00e5r du fors\u00f8ker \u00e5 logge inn pr\u00f8ver vi \u00e5 kontakten en LDAP-katalog. Da vi fors\u00f8kte det denne gangen, oppsto en feil.", @@ -682,7 +718,9 @@ "ru": "LDAP - \u044d\u0442\u043e \u0431\u0430\u0437\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439, \u043f\u0440\u0438 \u0432\u0430\u0448\u0435\u0439 \u043f\u043e\u043f\u044b\u0442\u043a\u0435 \u0432\u0445\u043e\u0434\u0430 \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0443, \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u0432\u044f\u0437\u0430\u0442\u044c\u0441\u044f \u0441 \u0431\u0430\u0437\u043e\u0439 \u0434\u0430\u043d\u043d\u044b\u0445 LDAP. \u041f\u0440\u0438 \u044d\u0442\u043e\u0439 \u043f\u043e\u043f\u044b\u0442\u043a\u0435 \u0441\u0432\u044f\u0437\u0430\u0442\u044c\u0441\u044f \u0441 LDAP \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u0430 \u043e\u0448\u0438\u0431\u043a\u0430. ", "eu": "LDAP erabiltzaileen datu basea da, eta sartzea erabakitzen duzunean beharrezkoa da harekin harremanetan jartzea. Sartze ekintza horretan errore bat jazo da.", "af": "LDAP is die gebruikers databasis en waneer jy probeer inteken moet ons die LDAP databasis kontak. Daar was 'n fout toe ons die slag probeer het.", - "el": "\u03a0\u03b1\u03c1\u03bf\u03c5\u03c3\u03b9\u03ac\u03c3\u03c4\u03b7\u03ba\u03b5 \u03c3\u03c6\u03ac\u03bb\u03bc\u03b1 \u03ba\u03b1\u03c4\u03ac \u03c4\u03b7\u03bd \u03b5\u03c0\u03b9\u03ba\u03bf\u03b9\u03bd\u03c9\u03bd\u03af\u03b1 \u03bc\u03b5 \u03c4\u03b7\u03bd \u03c5\u03c0\u03b7\u03c1\u03b5\u03c3\u03af\u03b1 \u03ba\u03b1\u03c4\u03b1\u03bb\u03cc\u03b3\u03bf\u03c5 \u03c7\u03c1\u03b7\u03c3\u03c4\u03ce\u03bd (LDAP)." + "el": "\u03a0\u03b1\u03c1\u03bf\u03c5\u03c3\u03b9\u03ac\u03c3\u03c4\u03b7\u03ba\u03b5 \u03c3\u03c6\u03ac\u03bb\u03bc\u03b1 \u03ba\u03b1\u03c4\u03ac \u03c4\u03b7\u03bd \u03b5\u03c0\u03b9\u03ba\u03bf\u03b9\u03bd\u03c9\u03bd\u03af\u03b1 \u03bc\u03b5 \u03c4\u03b7\u03bd \u03c5\u03c0\u03b7\u03c1\u03b5\u03c3\u03af\u03b1 \u03ba\u03b1\u03c4\u03b1\u03bb\u03cc\u03b3\u03bf\u03c5 \u03c7\u03c1\u03b7\u03c3\u03c4\u03ce\u03bd (LDAP).", + "xh": "I-LDAP ngumvimba wengcombolo yomsebenzisi, yaye xa uzame ukungena, kufuneka siqhagamshele uvimba wengcombolo we-LDAP. Kwenzeke impazamo xa besiyizama.", + "zu": "I-LDAP iyidathabheyisi yomsebenzisi, futhi lapho uzama ukungena, sidinga ukuthinta idathabheyisi ye-LDAP. Kuvele iphutha ngesikhathi siyizama ngalesi sikhathi." }, "title_LOGOUTREQUEST": { "no": "Feil i behandling av logout-foresp\u00f8rselen", @@ -718,7 +756,9 @@ "ro": "Eroare la procesarea cererii de deautentificare", "ru": "\u041e\u0448\u0438\u0431\u043a\u0430 \u043f\u0440\u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043d\u0430 \u0432\u044b\u0445\u043e\u0434 \u0438\u0437 \u0441\u0438\u0441\u0442\u0435\u043c\u044b ", "af": "Fout met die verwerking van die Afmeldings Versoek", - "el": "\u03a3\u03c6\u03ac\u03bb\u03bc\u03b1 \u03ba\u03b1\u03c4\u03ac \u03c4\u03b7 \u03b4\u03b9\u03b1\u03b4\u03b9\u03ba\u03b1\u03c3\u03af\u03b1 \u03b1\u03c0\u03bf\u03c3\u03cd\u03bd\u03b4\u03b5\u03c3\u03b7\u03c2" + "el": "\u03a3\u03c6\u03ac\u03bb\u03bc\u03b1 \u03ba\u03b1\u03c4\u03ac \u03c4\u03b7 \u03b4\u03b9\u03b1\u03b4\u03b9\u03ba\u03b1\u03c3\u03af\u03b1 \u03b1\u03c0\u03bf\u03c3\u03cd\u03bd\u03b4\u03b5\u03c3\u03b7\u03c2", + "xh": "Impazamo iprosesa iSicelo Sokuphuma", + "zu": "Iphutha lokucubungula Isicelo Sokuphuma" }, "descr_LOGOUTREQUEST": { "no": "En feil oppsto i behandlingen av logout-foresp\u00f8rselen.", @@ -754,7 +794,9 @@ "ro": "A ap\u0103rut o eroare la procesarea cererii de deautentificare.", "ru": "\u041e\u0448\u0438\u0431\u043a\u0430 \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u0430 \u043f\u0440\u0438 \u043f\u043e\u043f\u044b\u0442\u043a\u0435 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043d\u0430 \u0432\u044b\u0445\u043e\u0434 \u0438\u0437 \u0441\u0438\u0441\u0442\u0435\u043c\u044b", "af": "Daar was 'n probleem tydens die verwerking van die Afmelding Versoek", - "el": "\u03a0\u03b1\u03c1\u03bf\u03c5\u03c3\u03b9\u03b1\u03c3\u03c4\u03ae\u03ba\u03b5 \u03c3\u03c6\u03ac\u03bb\u03bc\u03b1 \u03ba\u03b1\u03c4\u03ac \u03c4\u03b7\u03bd \u03b5\u03c0\u03b5\u03be\u03b5\u03c1\u03b3\u03b1\u03c3\u03af\u03b1 \u03c4\u03bf\u03c5 \u03b1\u03b9\u03c4\u03ae\u03bc\u03b1\u03c4\u03bf\u03c2 \u03b1\u03c0\u03bf\u03c3\u03cd\u03bd\u03b4\u03b5\u03c3\u03b7\u03c2." + "el": "\u03a0\u03b1\u03c1\u03bf\u03c5\u03c3\u03b9\u03b1\u03c3\u03c4\u03ae\u03ba\u03b5 \u03c3\u03c6\u03ac\u03bb\u03bc\u03b1 \u03ba\u03b1\u03c4\u03ac \u03c4\u03b7\u03bd \u03b5\u03c0\u03b5\u03be\u03b5\u03c1\u03b3\u03b1\u03c3\u03af\u03b1 \u03c4\u03bf\u03c5 \u03b1\u03b9\u03c4\u03ae\u03bc\u03b1\u03c4\u03bf\u03c2 \u03b1\u03c0\u03bf\u03c3\u03cd\u03bd\u03b4\u03b5\u03c3\u03b7\u03c2.", + "zu": "Kuvele iphutha ngenkathi izama ukucubungula Isicelo Sokuphuma.", + "xh": "Kwenzeke impazamo ngoxa kuproseswa isiCelo Sokuphuma." }, "title_METADATA": { "no": "Feil ved lasting av metadata", @@ -790,7 +832,9 @@ "ru": "\u041e\u0448\u0438\u0431\u043a\u0430 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0445", "eu": "Errorea metadatuak kargatzean", "af": "Fout met die laai van die metadata", - "el": "\u03a3\u03c6\u03ac\u03bb\u03bc\u03b1 \u03ba\u03b1\u03c4\u03ac \u03c4\u03b7 \u03c6\u03cc\u03c1\u03c4\u03c9\u03c3\u03b7 \u03bc\u03b5\u03c4\u03b1\u03b4\u03b5\u03b4\u03bf\u03bc\u03ad\u03bd\u03c9\u03bd" + "el": "\u03a3\u03c6\u03ac\u03bb\u03bc\u03b1 \u03ba\u03b1\u03c4\u03ac \u03c4\u03b7 \u03c6\u03cc\u03c1\u03c4\u03c9\u03c3\u03b7 \u03bc\u03b5\u03c4\u03b1\u03b4\u03b5\u03b4\u03bf\u03bc\u03ad\u03bd\u03c9\u03bd", + "zu": "Iphutha lokulayisha imethadatha", + "xh": "Impazamo ilayisha imetadata" }, "descr_METADATA": { "no": "Det er en feil i oppsettet for din SimpleSAMLphp-installasjon. Hvis du er administrator for tjenesten, b\u00f8r du kontrollere at metadata er satt opp riktig.", @@ -826,7 +870,9 @@ "ru": "\u0412\u0430\u0448 SimpleSAMLphp \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435. \u0415\u0441\u043b\u0438 \u0432\u044b \u044f\u0432\u043b\u044f\u0435\u0442\u0435\u0441\u044c \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u043e\u043c \u0441\u0438\u0441\u0442\u0435\u043c\u044b, \u043f\u0440\u043e\u0432\u0435\u0440\u044c\u0442\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0445.", "eu": "Konfigurazio erroreak daude zure SimpleSAMLphp-ren instalazioan. Zerbitzuaren administratzailea bazara, ziurta ezazu metadatuen konfigurazioa zuzena dela.", "af": "Daar is fout met jou SimplSAMLphp installasie. Indien jy die administrateur is van di\u00e9 diens moet jy verseker dat jou metadata konfigurasie korrek is.", - "el": "\u03a5\u03c0\u03ac\u03c1\u03c7\u03b5\u03b9 \u03ba\u03ac\u03c0\u03bf\u03b9\u03bf \u03c0\u03c1\u03cc\u03b2\u03bb\u03b7\u03bc\u03b1 \u03c3\u03c4\u03b9\u03c2 \u03c1\u03c5\u03b8\u03bc\u03af\u03c3\u03b5\u03b9\u03c2 \u03c4\u03bf\u03c5 SimpleSAMLphp. \u0395\u03ac\u03bd \u03b5\u03af\u03c3\u03c4\u03b5 \u03bf \u03b4\u03b9\u03b1\u03c7\u03b5\u03b9\u03c1\u03b9\u03c3\u03c4\u03ae\u03c2 \u03c4\u03b7\u03c2 \u03c5\u03c0\u03b7\u03c1\u03b5\u03c3\u03af\u03b1\u03c2 \u03b1\u03c5\u03c4\u03ae\u03c2, \u03b2\u03b5\u03b2\u03b1\u03b9\u03c9\u03b8\u03b5\u03af\u03c4\u03b5 \u03cc\u03c4\u03b9 \u03c4\u03b1 \u03bc\u03b5\u03c4\u03b1\u03b4\u03b5\u03b4\u03bf\u03bc\u03ad\u03bd\u03b1 \u03ad\u03c7\u03bf\u03c5\u03bd \u03c1\u03c5\u03b8\u03bc\u03b9\u03c3\u03c4\u03b5\u03af \u03c3\u03c9\u03c3\u03c4\u03ac." + "el": "\u03a5\u03c0\u03ac\u03c1\u03c7\u03b5\u03b9 \u03ba\u03ac\u03c0\u03bf\u03b9\u03bf \u03c0\u03c1\u03cc\u03b2\u03bb\u03b7\u03bc\u03b1 \u03c3\u03c4\u03b9\u03c2 \u03c1\u03c5\u03b8\u03bc\u03af\u03c3\u03b5\u03b9\u03c2 \u03c4\u03bf\u03c5 SimpleSAMLphp. \u0395\u03ac\u03bd \u03b5\u03af\u03c3\u03c4\u03b5 \u03bf \u03b4\u03b9\u03b1\u03c7\u03b5\u03b9\u03c1\u03b9\u03c3\u03c4\u03ae\u03c2 \u03c4\u03b7\u03c2 \u03c5\u03c0\u03b7\u03c1\u03b5\u03c3\u03af\u03b1\u03c2 \u03b1\u03c5\u03c4\u03ae\u03c2, \u03b2\u03b5\u03b2\u03b1\u03b9\u03c9\u03b8\u03b5\u03af\u03c4\u03b5 \u03cc\u03c4\u03b9 \u03c4\u03b1 \u03bc\u03b5\u03c4\u03b1\u03b4\u03b5\u03b4\u03bf\u03bc\u03ad\u03bd\u03b1 \u03ad\u03c7\u03bf\u03c5\u03bd \u03c1\u03c5\u03b8\u03bc\u03b9\u03c3\u03c4\u03b5\u03af \u03c3\u03c9\u03c3\u03c4\u03ac.", + "xh": "Kukho ulungiselelo olungachanekanga oluthile lofakelo lwakho lwe-SimpleSAMLphp. Ukuba ngaba ungumlawuli wale nkonzo, ufanele uqinisekise ulungiselelo lwakho lweempawu-ngcaciso zefayile lusetwe ngokuchanekileyo.", + "zu": "Kukhona umiso olungafanele kukufaka kwakho kwe-SimpleSAMLphp. Uma ungumlawuli wale sevisi, kufanele wenze isiqiniseko sokuthi umiso lwakho lwemethadatha lumiswe ngendlela efanele." }, "title_NOACCESS": { "no": "Ingen tilgang", @@ -862,7 +908,9 @@ "ru": "\u041e\u0442\u043a\u0430\u0437 \u0432 \u0434\u043e\u0441\u0442\u0443\u043f\u0435", "eu": "Sarrera zehaztu gabe", "af": "Geen toegang", - "el": "\u03a3\u03c6\u03ac\u03bb\u03bc\u03b1 \u03ba\u03b1\u03c4\u03ac \u03c4\u03b7\u03bd \u03c0\u03c1\u03cc\u03c3\u03b2\u03b1\u03c3\u03b7" + "el": "\u03a3\u03c6\u03ac\u03bb\u03bc\u03b1 \u03ba\u03b1\u03c4\u03ac \u03c4\u03b7\u03bd \u03c0\u03c1\u03cc\u03c3\u03b2\u03b1\u03c3\u03b7", + "zu": "Akukho ukufinyelela", + "xh": "Akukho fikelelo" }, "descr_NOACCESS": { "no": "Dette endepunktet er ikke aktivert. Sjekk aktiveringsopsjonene i ditt SimpleSAMLphp-oppsett.", @@ -898,7 +946,9 @@ "ru": "\u0414\u0430\u043d\u043d\u0430\u044f \u043a\u043e\u043d\u0435\u0447\u043d\u0430\u044f \u0442\u043e\u0447\u043a\u0430 \u043d\u0435 \u0430\u043a\u0442\u0438\u0432\u0438\u0440\u043e\u0432\u0430\u043d\u0430. \u041f\u0440\u043e\u0432\u0435\u0440\u044c\u0442\u0435 \u043e\u043f\u0446\u0438\u0438 \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0432\u0430\u0448\u0435\u0433\u043e SimpleSAMLphp.", "eu": "Sarbide puntu hau ez dago gaituta. Egiazta itzazu SimpleSAMLphp-aren konfigurazioan gaitze aukerak.", "af": "Die eindpunt is nie beskikbaar nie. Gaan die staat opsies in jou opset van SimpleSAMLphp na.", - "el": "\u0391\u03c5\u03c4\u03cc \u03c4\u03bf \u03c4\u03b5\u03bb\u03b9\u03ba\u03cc \u03c3\u03b7\u03bc\u03b5\u03af\u03bf \u03c3\u03cd\u03bd\u03b4\u03b5\u03c3\u03b7\u03c2 (endpoint) \u03b4\u03b5\u03bd \u03b5\u03af\u03bd\u03b1\u03b9 \u03b5\u03bd\u03b5\u03c1\u03b3\u03bf\u03c0\u03bf\u03b9\u03b7\u03bc\u03ad\u03bd\u03bf. \u0395\u03ac\u03bd \u03b5\u03af\u03c3\u03c4\u03b5 \u03bf \u03b4\u03b9\u03b1\u03c7\u03b5\u03b9\u03c1\u03b9\u03c3\u03c4\u03ae\u03c2 \u03c4\u03b7\u03c2 \u03c5\u03c0\u03b7\u03c1\u03b5\u03c3\u03af\u03b1\u03c2, \u03b5\u03bb\u03ad\u03b3\u03be\u03c4\u03b5 \u03c4\u03b9\u03c2 \u03c1\u03c5\u03b8\u03bc\u03af\u03c3\u03b5\u03b9\u03c2 \u03c4\u03bf\u03c5 SimpleSAMLphp." + "el": "\u0391\u03c5\u03c4\u03cc \u03c4\u03bf \u03c4\u03b5\u03bb\u03b9\u03ba\u03cc \u03c3\u03b7\u03bc\u03b5\u03af\u03bf \u03c3\u03cd\u03bd\u03b4\u03b5\u03c3\u03b7\u03c2 (endpoint) \u03b4\u03b5\u03bd \u03b5\u03af\u03bd\u03b1\u03b9 \u03b5\u03bd\u03b5\u03c1\u03b3\u03bf\u03c0\u03bf\u03b9\u03b7\u03bc\u03ad\u03bd\u03bf. \u0395\u03ac\u03bd \u03b5\u03af\u03c3\u03c4\u03b5 \u03bf \u03b4\u03b9\u03b1\u03c7\u03b5\u03b9\u03c1\u03b9\u03c3\u03c4\u03ae\u03c2 \u03c4\u03b7\u03c2 \u03c5\u03c0\u03b7\u03c1\u03b5\u03c3\u03af\u03b1\u03c2, \u03b5\u03bb\u03ad\u03b3\u03be\u03c4\u03b5 \u03c4\u03b9\u03c2 \u03c1\u03c5\u03b8\u03bc\u03af\u03c3\u03b5\u03b9\u03c2 \u03c4\u03bf\u03c5 SimpleSAMLphp.", + "xh": "Le ndawo yokuphela ayenziwanga yasebenza. Jonga ukhetho lokwenza isebenze kulungiselelo lwakho lwe-SimpleSAMLphp.", + "zu": "Lesi siphetho asivunyelwe. Hlola izinketho zokuvumela kumiso lwakho lwe-SimpleSAMLphp." }, "title_NORELAYSTATE": { "no": "Spesifikasjon av RelayState mangler", @@ -934,7 +984,9 @@ "ru": "\u041e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 RelayState", "eu": "RelayState zehaztu gabe", "af": "Geen aflos staat('RelayState')", - "el": "\u03a3\u03c6\u03ac\u03bb\u03bc\u03b1 \u03c0\u03b1\u03c1\u03b1\u03bc\u03ad\u03c4\u03c1\u03bf\u03c5 'RelayState'" + "el": "\u03a3\u03c6\u03ac\u03bb\u03bc\u03b1 \u03c0\u03b1\u03c1\u03b1\u03bc\u03ad\u03c4\u03c1\u03bf\u03c5 'RelayState'", + "zu": "Ayikho I-RelayState", + "xh": "Akukho RelayState" }, "descr_NORELAYSTATE": { "no": "Kilden til denne foresp\u00f8rselen har ikke angitt noen RelayState-parameter som angir hvor vi skal fortsette etterp\u00e5.", @@ -970,7 +1022,9 @@ "ru": "\u0418\u043d\u0438\u0446\u0438\u0430\u0442\u043e\u0440 \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043d\u0435 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u043b \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 RelayState \u0441 \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0442\u043e\u0447\u043a\u0438 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0430.", "eu": "Eskaera honen abiarazleak ez du ematen ondoren nora joan adierazten duen RelayState parametroa", "af": "Die inisieerder van hierdie versoek het nie 'n aflos staat('RelayState') parameter wat aandui waarheen om volgende te gaan nie.", - "el": "\u0397 \u03c0\u03b1\u03c1\u03ac\u03bc\u03b5\u03c4\u03c1\u03bf\u03c2 'RelayState' \u03c4\u03bf\u03c5 \u03c0\u03c1\u03c9\u03c4\u03bf\u03ba\u03cc\u03bb\u03bb\u03bf\u03c5 SAML \u03b4\u03b5\u03bd \u03b2\u03c1\u03ad\u03b8\u03b7\u03ba\u03b5 \u03ae \u03b4\u03b5\u03bd \u03b5\u03af\u03bd\u03b1\u03b9 \u03ad\u03b3\u03ba\u03c5\u03c1\u03b7 \u03bc\u03b5 \u03b1\u03c0\u03bf\u03c4\u03ad\u03bb\u03b5\u03c3\u03bc\u03b1 \u03bd\u03b1 \u03bc\u03b7\u03bd \u03b5\u03af\u03bd\u03b1\u03b9 \u03b4\u03c5\u03bd\u03b1\u03c4\u03ae \u03b7 \u03bc\u03b5\u03c4\u03ac\u03b2\u03b1\u03c3\u03b7 \u03c3\u03b5 \u03ba\u03ac\u03c0\u03bf\u03b9\u03bf\u03bd \u03c0\u03cc\u03c1\u03bf \u03c4\u03bf\u03c5 \u03c0\u03b1\u03c1\u03cc\u03c7\u03bf\u03c5 \u03c5\u03c0\u03b7\u03c1\u03b5\u03c3\u03b9\u03ce\u03bd0." + "el": "\u0397 \u03c0\u03b1\u03c1\u03ac\u03bc\u03b5\u03c4\u03c1\u03bf\u03c2 'RelayState' \u03c4\u03bf\u03c5 \u03c0\u03c1\u03c9\u03c4\u03bf\u03ba\u03cc\u03bb\u03bb\u03bf\u03c5 SAML \u03b4\u03b5\u03bd \u03b2\u03c1\u03ad\u03b8\u03b7\u03ba\u03b5 \u03ae \u03b4\u03b5\u03bd \u03b5\u03af\u03bd\u03b1\u03b9 \u03ad\u03b3\u03ba\u03c5\u03c1\u03b7 \u03bc\u03b5 \u03b1\u03c0\u03bf\u03c4\u03ad\u03bb\u03b5\u03c3\u03bc\u03b1 \u03bd\u03b1 \u03bc\u03b7\u03bd \u03b5\u03af\u03bd\u03b1\u03b9 \u03b4\u03c5\u03bd\u03b1\u03c4\u03ae \u03b7 \u03bc\u03b5\u03c4\u03ac\u03b2\u03b1\u03c3\u03b7 \u03c3\u03b5 \u03ba\u03ac\u03c0\u03bf\u03b9\u03bf\u03bd \u03c0\u03cc\u03c1\u03bf \u03c4\u03bf\u03c5 \u03c0\u03b1\u03c1\u03cc\u03c7\u03bf\u03c5 \u03c5\u03c0\u03b7\u03c1\u03b5\u03c3\u03b9\u03ce\u03bd0.", + "xh": "Umqalisi wesi sicelo akanikelanga ngepharamitha ye-RelayState apho kufanele kuyiwe khona.", + "zu": "Umqalisi walesi sicelo akazange ahlinzeke ngepharamitha ye-RelayState ebonisa ukuthi kufanele uye kuphi ngokulandelayo." }, "title_PROCESSASSERTION": { "no": "Feil i behandling av svar fra innloggingstjenesten", @@ -1006,7 +1060,9 @@ "ru": "\u041e\u0448\u0438\u0431\u043a\u0430 \u043f\u0440\u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u043e\u0442\u043a\u043b\u0438\u043a\u0430 \u043e\u0442 \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u0430 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438", "eu": "Errorea IdP-tik datorren erantzuna prozesatzean", "af": "Fout in die Identiteits Verskaffer(IdP) versoek", - "el": "\u0395\u03c3\u03c6\u03b1\u03bb\u03bc\u03ad\u03bd\u03b7 \u03b1\u03c0\u03cc\u03ba\u03c1\u03b9\u03c3\u03b7 \u03b1\u03c0\u03cc \u03c4\u03bf\u03bd \u03c0\u03ac\u03c1\u03bf\u03c7\u03bf \u03c4\u03b1\u03c5\u03c4\u03cc\u03c4\u03b7\u03c4\u03b1\u03c2" + "el": "\u0395\u03c3\u03c6\u03b1\u03bb\u03bc\u03ad\u03bd\u03b7 \u03b1\u03c0\u03cc\u03ba\u03c1\u03b9\u03c3\u03b7 \u03b1\u03c0\u03cc \u03c4\u03bf\u03bd \u03c0\u03ac\u03c1\u03bf\u03c7\u03bf \u03c4\u03b1\u03c5\u03c4\u03cc\u03c4\u03b7\u03c4\u03b1\u03c2", + "xh": "Impazamo iprosesa impendulo esuka kuMboneleli Wesazisi", + "zu": "Iphutha lokucubungula impendulo esuka Kumhlinzeki Kamazisi" }, "descr_PROCESSASSERTION": { "no": "Svaret mottatt fra innloggingstjenesten kan ikke aksepteres.", @@ -1042,7 +1098,9 @@ "ru": "\u041e\u0442\u043a\u043b\u0438\u043a \u043e\u0442 \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u0430 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0435\u043d.", "eu": "Ezin izan da identitatearen hornitzaileak bidalitako erantzuna onartu.", "af": "Die antwoord vanaf die Indentiteits Verskaffer is nie aanvaar nie.", - "el": "\u03a0\u03b1\u03c1\u03bf\u03c5\u03c3\u03b9\u03ac\u03c3\u03c4\u03b7\u03ba\u03b5 \u03c3\u03c6\u03ac\u03bb\u03bc\u03b1 \u03ba\u03b1\u03c4\u03ac \u03c4\u03b7\u03bd \u03b5\u03c0\u03b5\u03be\u03b5\u03c1\u03b3\u03b1\u03c3\u03af\u03b1 \u03c4\u03b7\u03c2 \u03b1\u03c0\u03ac\u03bd\u03c4\u03b7\u03c3\u03b7\u03c2 \u03b1\u03c0\u03cc \u03c4\u03bf\u03bd \u03c0\u03ac\u03c1\u03bf\u03c7\u03bf \u03c4\u03b1\u03c5\u03c4\u03cc\u03c4\u03b7\u03c4\u03b1\u03c2." + "el": "\u03a0\u03b1\u03c1\u03bf\u03c5\u03c3\u03b9\u03ac\u03c3\u03c4\u03b7\u03ba\u03b5 \u03c3\u03c6\u03ac\u03bb\u03bc\u03b1 \u03ba\u03b1\u03c4\u03ac \u03c4\u03b7\u03bd \u03b5\u03c0\u03b5\u03be\u03b5\u03c1\u03b3\u03b1\u03c3\u03af\u03b1 \u03c4\u03b7\u03c2 \u03b1\u03c0\u03ac\u03bd\u03c4\u03b7\u03c3\u03b7\u03c2 \u03b1\u03c0\u03cc \u03c4\u03bf\u03bd \u03c0\u03ac\u03c1\u03bf\u03c7\u03bf \u03c4\u03b1\u03c5\u03c4\u03cc\u03c4\u03b7\u03c4\u03b1\u03c2.", + "zu": "Asizange samukele impendulo ethunyelwe ukusuka Kumhlinzeki Kamazisi.", + "xh": "Asiyamkelanga impendulo ethunyelwe ukusuka kuMboneleli Wesazisi." }, "title_PROCESSAUTHNREQUEST": { "no": "Feil ved behandling av foresp\u00f8rsel fra SP", @@ -1078,7 +1136,9 @@ "ru": "\u041e\u0448\u0438\u0431\u043a\u0430 \u043f\u0440\u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043e\u0442 \u0441\u0435\u0440\u0432\u0438\u0441 \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u0430", "eu": "Errorea zerbitzu hornitzailearen eskaera prozesatean ", "af": "Fout in Diens Verskaffer versoek proses", - "el": "\u0395\u03c3\u03c6\u03b1\u03bb\u03bc\u03ad\u03bd\u03bf \u03b1\u03af\u03c4\u03b7\u03bc\u03b1 \u03b1\u03c0\u03cc \u03c4\u03bf\u03bd \u03c0\u03ac\u03c1\u03bf\u03c7\u03bf \u03c5\u03c0\u03b7\u03c1\u03b5\u03c3\u03b9\u03ce\u03bd" + "el": "\u0395\u03c3\u03c6\u03b1\u03bb\u03bc\u03ad\u03bd\u03bf \u03b1\u03af\u03c4\u03b7\u03bc\u03b1 \u03b1\u03c0\u03cc \u03c4\u03bf\u03bd \u03c0\u03ac\u03c1\u03bf\u03c7\u03bf \u03c5\u03c0\u03b7\u03c1\u03b5\u03c3\u03b9\u03ce\u03bd", + "xh": "Impazamo iprosesa isicelo esisuka kuMboneleli Wenkonzo", + "zu": "Iphutha lokucubungula isicelo esisuka Kumhlinzeki Wesevisi" }, "descr_PROCESSAUTHNREQUEST": { "no": "Innloggingstjenesten mottok en autentiserings-foresp\u00f8rsel fra en tjeneste, men en feil oppsto i behandling av foresp\u00f8rselen.", @@ -1114,7 +1174,9 @@ "ru": "\u041f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u043b \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e \u043e\u0442 \u0441\u0435\u0440\u0432\u0438\u0441 \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u0430, \u043d\u043e \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u0430 \u043e\u0448\u0438\u0431\u043a\u0430 \u043f\u0440\u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430.", "eu": "IdP honek zerbitzu hornitzaile baten kautotze eskaera jaso du baina errore bat jazo da hau prozesatzen saiatzean.", "af": "Die Identiteits Verskaffer het 'n Verifikasie Versoek ontvang vanaf 'n Diens Verskaffer maar 'n fout het voorgekom tydens die verwerking van die versoek.", - "el": "\u03a0\u03b1\u03c1\u03bf\u03c5\u03c3\u03b9\u03ac\u03c3\u03c4\u03b7\u03ba\u03b5 \u03c3\u03c6\u03ac\u03bb\u03bc\u03b1 \u03ba\u03b1\u03c4\u03ac \u03c4\u03b7\u03bd \u03b5\u03c0\u03b5\u03be\u03b5\u03c1\u03b3\u03b1\u03c3\u03af\u03b1 \u03c4\u03bf\u03c5 \u03b1\u03b9\u03c4\u03ae\u03bc\u03b1\u03c4\u03bf\u03c2 \u03c4\u03b1\u03c5\u03c4\u03bf\u03c0\u03bf\u03af\u03b7\u03c3\u03b7\u03c2 \u03c0\u03bf\u03c5 \u03ad\u03bb\u03b1\u03b2\u03b5 \u03bf \u03c0\u03ac\u03c1\u03bf\u03c7\u03bf\u03c2 \u03c4\u03b1\u03c5\u03c4\u03cc\u03c4\u03b7\u03c4\u03b1\u03c2 \u03b1\u03c0\u03cc \u03c4\u03bf\u03bd \u03c0\u03ac\u03c1\u03bf\u03c7\u03bf \u03c5\u03c0\u03b7\u03c1\u03b5\u03c3\u03b9\u03ce\u03bd." + "el": "\u03a0\u03b1\u03c1\u03bf\u03c5\u03c3\u03b9\u03ac\u03c3\u03c4\u03b7\u03ba\u03b5 \u03c3\u03c6\u03ac\u03bb\u03bc\u03b1 \u03ba\u03b1\u03c4\u03ac \u03c4\u03b7\u03bd \u03b5\u03c0\u03b5\u03be\u03b5\u03c1\u03b3\u03b1\u03c3\u03af\u03b1 \u03c4\u03bf\u03c5 \u03b1\u03b9\u03c4\u03ae\u03bc\u03b1\u03c4\u03bf\u03c2 \u03c4\u03b1\u03c5\u03c4\u03bf\u03c0\u03bf\u03af\u03b7\u03c3\u03b7\u03c2 \u03c0\u03bf\u03c5 \u03ad\u03bb\u03b1\u03b2\u03b5 \u03bf \u03c0\u03ac\u03c1\u03bf\u03c7\u03bf\u03c2 \u03c4\u03b1\u03c5\u03c4\u03cc\u03c4\u03b7\u03c4\u03b1\u03c2 \u03b1\u03c0\u03cc \u03c4\u03bf\u03bd \u03c0\u03ac\u03c1\u03bf\u03c7\u03bf \u03c5\u03c0\u03b7\u03c1\u03b5\u03c3\u03b9\u03ce\u03bd.", + "zu": "Lo Mhlinzeki Kamazisi uthole Isicelo Sokuqinisekisa ukusuka Kumhlinzeki Wesevisi, kodw,a kuvele iphutha ngenkathi ezama ukucubungula isicelo.", + "xh": "Lo Mboneleli Wesazisi ufumene Isicelo Songqinisiso esisuka kuMboneleli Wenkonzo, kodwa kwenzeke impazamo xa kuzanywa ukuprosesa isicelo." }, "title_SLOSERVICEPARAMS": { "no": "Ingen SAML-melding angitt", @@ -1150,7 +1212,9 @@ "ru": "\u041e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0443\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u0435 SAML ", "eu": "SAML mezua falta da", "af": "Geen SAML boodskap gevind nie", - "el": "\u03a3\u03c6\u03ac\u03bb\u03bc\u03b1 \u03ba\u03b1\u03c4\u03ac \u03c4\u03b7\u03bd \u03c0\u03c1\u03cc\u03c3\u03b2\u03b1\u03c3\u03b7 \u03c3\u03c4\u03b7 \u03b4\u03b9\u03b5\u03c0\u03b1\u03c6\u03ae SingleLogoutService" + "el": "\u03a3\u03c6\u03ac\u03bb\u03bc\u03b1 \u03ba\u03b1\u03c4\u03ac \u03c4\u03b7\u03bd \u03c0\u03c1\u03cc\u03c3\u03b2\u03b1\u03c3\u03b7 \u03c3\u03c4\u03b7 \u03b4\u03b9\u03b5\u03c0\u03b1\u03c6\u03ae SingleLogoutService", + "zu": "Awukho umlayezo we-SAML onikeziwe", + "xh": "Akukho myalezo we-SAML unikelweyo" }, "descr_SLOSERVICEPARAMS": { "no": "Du brukte SingleLogoutService-grensesnittet uten \u00e5 angi enten en SAML LogoutRequest eller en LogoutResponse.", @@ -1186,7 +1250,9 @@ "ru": "\u0412\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0443 SingleLogoutService, \u043d\u043e \u043d\u0435 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u043b\u0438 SAML LogoutRequest \u0438\u043b\u0438 LogoutResponse \u0443\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u044f.", "eu": "SingleLogoutService interfazera sartu zara baina ez duzu erantsi SAML LogoutRequest edo LogoutResponse mezurik", "af": "Jy het toegang verkry na die SingleLogoutService koppelvlak('interface'), maar het geen SAML LogoutRequest of LogoutResponse gestuur nie.", - "el": "\u039a\u03b1\u03c4\u03ac \u03c4\u03b7\u03bd \u03c0\u03c1\u03cc\u03c3\u03b2\u03b1\u03c3\u03ae \u03c3\u03b1\u03c2 \u03c3\u03c4\u03b7 \u03b4\u03b9\u03b5\u03c0\u03b1\u03c6\u03ae SingleLogoutService \u03c0\u03b1\u03c1\u03b1\u03bb\u03b5\u03af\u03c8\u03b1\u03c4\u03b5 \u03bd\u03b1 \u03c3\u03c5\u03bc\u03c0\u03b5\u03c1\u03b9\u03bb\u03ac\u03b2\u03b5\u03c4\u03b5 \u03bc\u03ae\u03bd\u03c5\u03bc\u03b1 LogoutRequest \u03ae LogoutResponse \u03c4\u03bf\u03c5 \u03c0\u03c1\u03c9\u03c4\u03bf\u03ba\u03cc\u03bb\u03bb\u03bf\u03c5 SAML. \u03a3\u03b7\u03bc\u03b5\u03b9\u03ce\u03c3\u03c4\u03b5 \u03cc\u03c4\u03b9 \u03b1\u03c5\u03c4\u03cc \u03c4\u03bf \u03c4\u03b5\u03bb\u03b9\u03ba\u03cc \u03c3\u03b7\u03bc\u03b5\u03af\u03bf (endpoint) \u03b4\u03b5\u03bd \u03c0\u03c1\u03bf\u03bf\u03c1\u03af\u03b6\u03b5\u03c4\u03b1\u03b9 \u03bd\u03b1 \u03b5\u03af\u03bd\u03b1\u03b9 \u03ac\u03bc\u03b5\u03c3\u03b1 \u03c0\u03c1\u03bf\u03c3\u03b2\u03ac\u03c3\u03b9\u03bc\u03bf." + "el": "\u039a\u03b1\u03c4\u03ac \u03c4\u03b7\u03bd \u03c0\u03c1\u03cc\u03c3\u03b2\u03b1\u03c3\u03ae \u03c3\u03b1\u03c2 \u03c3\u03c4\u03b7 \u03b4\u03b9\u03b5\u03c0\u03b1\u03c6\u03ae SingleLogoutService \u03c0\u03b1\u03c1\u03b1\u03bb\u03b5\u03af\u03c8\u03b1\u03c4\u03b5 \u03bd\u03b1 \u03c3\u03c5\u03bc\u03c0\u03b5\u03c1\u03b9\u03bb\u03ac\u03b2\u03b5\u03c4\u03b5 \u03bc\u03ae\u03bd\u03c5\u03bc\u03b1 LogoutRequest \u03ae LogoutResponse \u03c4\u03bf\u03c5 \u03c0\u03c1\u03c9\u03c4\u03bf\u03ba\u03cc\u03bb\u03bb\u03bf\u03c5 SAML. \u03a3\u03b7\u03bc\u03b5\u03b9\u03ce\u03c3\u03c4\u03b5 \u03cc\u03c4\u03b9 \u03b1\u03c5\u03c4\u03cc \u03c4\u03bf \u03c4\u03b5\u03bb\u03b9\u03ba\u03cc \u03c3\u03b7\u03bc\u03b5\u03af\u03bf (endpoint) \u03b4\u03b5\u03bd \u03c0\u03c1\u03bf\u03bf\u03c1\u03af\u03b6\u03b5\u03c4\u03b1\u03b9 \u03bd\u03b1 \u03b5\u03af\u03bd\u03b1\u03b9 \u03ac\u03bc\u03b5\u03c3\u03b1 \u03c0\u03c1\u03bf\u03c3\u03b2\u03ac\u03c3\u03b9\u03bc\u03bf.", + "zu": "Ufinyelele ukusebenzisana kwe-SingleLogoutService, kodwa awuzange uhlinzeke nge-SAML LogoutRequest noma i-LogoutResponse. Sicela uphawule ukuthi isiphetho asihloselwe ukufinyelelwa ngokuqondile.", + "xh": "Ufikelele i-intafeyisi ye-SingleLogoutService, kodwa awukhange unikele i-SAML LogoutRequest okanye i-LogoutResponse. Nceda uqaphele ukuba le ndawo yokuphela ayilungiselelwanga ukuba ifikelelwe ngokuthe ngqo." }, "title_ACSPARAMS": { "no": "Ingen SAML-respons angitt", @@ -1222,7 +1288,9 @@ "ru": "\u041e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 SAML \u043e\u0442\u043a\u043b\u0438\u043a", "eu": "SAML erantzuna falta da", "af": "Geen SAML versoek gevind nie", - "el": "\u03a3\u03c6\u03ac\u03bb\u03bc\u03b1 \u03ba\u03b1\u03c4\u03ac \u03c4\u03b7\u03bd \u03c0\u03c1\u03cc\u03c3\u03b2\u03b1\u03c3\u03b7 \u03c3\u03c4\u03b7 \u03b4\u03b9\u03b5\u03c0\u03b1\u03c6\u03ae AssertionConsumerService" + "el": "\u03a3\u03c6\u03ac\u03bb\u03bc\u03b1 \u03ba\u03b1\u03c4\u03ac \u03c4\u03b7\u03bd \u03c0\u03c1\u03cc\u03c3\u03b2\u03b1\u03c3\u03b7 \u03c3\u03c4\u03b7 \u03b4\u03b9\u03b5\u03c0\u03b1\u03c6\u03ae AssertionConsumerService", + "zu": "Ayikho impendulo ye-SAML enikeziwe", + "xh": "Akukho mpendulo ye-SAML inikelweyo" }, "descr_ACSPARAMS": { "no": "Du brukte AssertionConsumerService-grensesnittet uten \u00e5 angi en SAML AuthenticationResponse.", @@ -1258,19 +1326,30 @@ "ru": "\u0412\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0443 Assertion Consumer Service, \u043d\u043e \u043d\u0435 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u043b\u0438 \u043e\u0442\u043a\u043b\u0438\u043a SAML \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438.", "eu": "Baieztapen kontsumitzailearen interfazera sartu zara baina ez duzu SAML kautotze erantzun bat erantsi.", "af": "Jy het aansoek gedoen vir toegang na die Assertion Consumer Service koppelvlak, maar geen SAML Verifikasie Versoek is saam gestuur nie.", - "el": "\u039a\u03b1\u03c4\u03ac \u03c4\u03b7\u03bd \u03c0\u03c1\u03cc\u03c3\u03b2\u03b1\u03c3\u03ae \u03c3\u03b1\u03c2 \u03c3\u03c4\u03b7 \u03b4\u03b9\u03b5\u03c0\u03b1\u03c6\u03ae AssertionConsumerService \u03c0\u03b1\u03c1\u03b1\u03bb\u03b5\u03af\u03c8\u03b1\u03c4\u03b5 \u03bd\u03b1 \u03c3\u03c5\u03bc\u03c0\u03b5\u03c1\u03b9\u03bb\u03ac\u03b2\u03b5\u03c4\u03b5 \u03b1\u03c0\u03ac\u03bd\u03c4\u03b7\u03c3\u03b7 \u03c3\u03b5 \u03b1\u03af\u03c4\u03b7\u03bc\u03b1 \u03c4\u03b1\u03c5\u03c4\u03bf\u03c0\u03bf\u03af\u03b7\u03c3\u03b7\u03c2 \u03c4\u03bf\u03c5 \u03c0\u03c1\u03c9\u03c4\u03bf\u03ba\u03cc\u03bb\u03bb\u03bf\u03c5 SAML. \u03a3\u03b7\u03bc\u03b5\u03b9\u03ce\u03c3\u03c4\u03b5 \u03cc\u03c4\u03b9 \u03b1\u03c5\u03c4\u03cc \u03c4\u03bf \u03c4\u03b5\u03bb\u03b9\u03ba\u03cc \u03c3\u03b7\u03bc\u03b5\u03af\u03bf (endpoint) \u03b4\u03b5\u03bd \u03c0\u03c1\u03bf\u03bf\u03c1\u03af\u03b6\u03b5\u03c4\u03b1\u03b9 \u03bd\u03b1 \u03b5\u03af\u03bd\u03b1\u03b9 \u03ac\u03bc\u03b5\u03c3\u03b1 \u03c0\u03c1\u03bf\u03c3\u03b2\u03ac\u03c3\u03b9\u03bc\u03bf." + "el": "\u039a\u03b1\u03c4\u03ac \u03c4\u03b7\u03bd \u03c0\u03c1\u03cc\u03c3\u03b2\u03b1\u03c3\u03ae \u03c3\u03b1\u03c2 \u03c3\u03c4\u03b7 \u03b4\u03b9\u03b5\u03c0\u03b1\u03c6\u03ae AssertionConsumerService \u03c0\u03b1\u03c1\u03b1\u03bb\u03b5\u03af\u03c8\u03b1\u03c4\u03b5 \u03bd\u03b1 \u03c3\u03c5\u03bc\u03c0\u03b5\u03c1\u03b9\u03bb\u03ac\u03b2\u03b5\u03c4\u03b5 \u03b1\u03c0\u03ac\u03bd\u03c4\u03b7\u03c3\u03b7 \u03c3\u03b5 \u03b1\u03af\u03c4\u03b7\u03bc\u03b1 \u03c4\u03b1\u03c5\u03c4\u03bf\u03c0\u03bf\u03af\u03b7\u03c3\u03b7\u03c2 \u03c4\u03bf\u03c5 \u03c0\u03c1\u03c9\u03c4\u03bf\u03ba\u03cc\u03bb\u03bb\u03bf\u03c5 SAML. \u03a3\u03b7\u03bc\u03b5\u03b9\u03ce\u03c3\u03c4\u03b5 \u03cc\u03c4\u03b9 \u03b1\u03c5\u03c4\u03cc \u03c4\u03bf \u03c4\u03b5\u03bb\u03b9\u03ba\u03cc \u03c3\u03b7\u03bc\u03b5\u03af\u03bf (endpoint) \u03b4\u03b5\u03bd \u03c0\u03c1\u03bf\u03bf\u03c1\u03af\u03b6\u03b5\u03c4\u03b1\u03b9 \u03bd\u03b1 \u03b5\u03af\u03bd\u03b1\u03b9 \u03ac\u03bc\u03b5\u03c3\u03b1 \u03c0\u03c1\u03bf\u03c3\u03b2\u03ac\u03c3\u03b9\u03bc\u03bf.", + "zu": "Ufinyelele ukusebenzisana Kwesevisi Yomthengi Yesimemezelo, kodwa awuzange uhlinzeke Ngempendulo Yokuqinisekisa ye-SAML. Sicela uphawule ukuthi isiphetho asihloselwe ukufinyelelwa ngokuqondile.", + "xh": "Ufikelele i-intafeyisi ye-Assertion Consumer Service, kodwa awukhange unikele iMpendulo Yongqinisiso ye-SAML. Nceda uqaphele ukuba le ndawo yokuphela ayilungiselelwanga ukuba ifikelelwe ngokuthe ngqo." }, "title_SSOPARAMS": { - "zh-tw": "\u672a\u63d0\u4f9b SAML \u8acb\u6c42" + "zh-tw": "\u672a\u63d0\u4f9b SAML \u8acb\u6c42", + "zu": "Asikho isicelo se-SAML esinikeziwe", + "xh": "Akukho sicelo se-SAML sinikelweyo" }, "descr_SSOPARAMS": { - "zh-tw": "\u60a8\u9023\u7d50\u55ae\u4e00\u7c3d\u5165\u670d\u52d9\u4ecb\u9762\uff0c\u4f46\u672a\u63d0\u4f9b\u4e00\u500b SAML \u9a57\u8b49\u8acb\u6c42\u3002\u8acb\u6ce8\u610f\uff0c\u8a72\u7aef\u9ede\u4e26\u975e\u76f4\u63a5\u9023\u7dda\u3002" + "zh-tw": "\u60a8\u9023\u7d50\u55ae\u4e00\u7c3d\u5165\u670d\u52d9\u4ecb\u9762\uff0c\u4f46\u672a\u63d0\u4f9b\u4e00\u500b SAML \u9a57\u8b49\u8acb\u6c42\u3002\u8acb\u6ce8\u610f\uff0c\u8a72\u7aef\u9ede\u4e26\u975e\u76f4\u63a5\u9023\u7dda\u3002", + "xh": "Ufikelele i-intafeyisi ye-Single Sign On Service, kodwa awukhange unikele iMpendulo Yongqinisiso ye-SAML. Nceda uqaphele ukuba le ndawo yokuphela ayilungiselelwanga ukuba ifikelelwe ngokuthe ngqo.", + "zu": "Ufinyelele ukusebenzisana Kwesevisi Yokubhalisa Okukodwa, kodwa awuzange uhlinzeke Ngempendulo Yokuqinisekisa ye-SAML. Sicela uphawule ukuthi isiphetho asihloselwe ukufinyelelwa ngokuqondile." }, "title_ARSPARAMS": { - "zh-tw": "\u672a\u63d0\u4f9b SAML \u8a0a\u606f" + "zh-tw": "\u672a\u63d0\u4f9b SAML \u8a0a\u606f", + "zu": "Awukho umlayezo we-SAML onikeziwe", + "xh": "Akukho myalezo we-SAML unikelweyo" }, "descr_ARSPARAMS": { - "zh-tw": "\u60a8\u9023\u7d50\u4eba\u5de5\u8655\u7406\u670d\u52d9\u4ecb\u9762\uff0c\u4f46\u672a\u63d0\u4f9b SAML \u4eba\u5de5\u8655\u7406\u670d\u52d9\u8a0a\u606f\u3002\u8acb\u6ce8\u610f\uff0c\u8a72\u7aef\u9ede\u4e26\u975e\u76f4\u63a5\u9023\u7dda\u3002" + "zh-tw": "\u60a8\u9023\u7d50\u4eba\u5de5\u8655\u7406\u670d\u52d9\u4ecb\u9762\uff0c\u4f46\u672a\u63d0\u4f9b SAML \u4eba\u5de5\u8655\u7406\u670d\u52d9\u8a0a\u606f\u3002\u8acb\u6ce8\u610f\uff0c\u8a72\u7aef\u9ede\u4e26\u975e\u76f4\u63a5\u9023\u7dda\u3002", + "xh": "Ufikelele i-intafeyisi ye-Artifact Resolution Service, kodwa awukhange unikrele umyalezo we-SAML ArtifactResolve. Nceda uqaphele ukuba le ndawo yokuphela ayilungiselelwanga ukuba ifikelelwe ngokuthe ngqo.", + "zu": "Ufinyelele ukusebenzisana Kwesevisi Yokucaciswa Kobuciko, kodwa awuzange uhlinzeke umlayezo we-SAML ArtifactResolve. Sicela uphawule ukuthi isiphetho asihloselwe ukufinyelelwa ngokuqondile." + }, "title_CASERROR": { "no": "CAS-feil", @@ -1306,7 +1385,9 @@ "ru": "\u041e\u0448\u0438\u0431\u043a\u0430 CAS", "eu": "CAS Errorea", "af": "CAS Fout", - "el": "\u03a3\u03c6\u03ac\u03bb\u03bc\u03b1 CAS" + "el": "\u03a3\u03c6\u03ac\u03bb\u03bc\u03b1 CAS", + "xh": "Impazamo ye-CAS", + "zu": "Iphutha Le-CAS" }, "descr_CASERROR": { "no": "Feil i kommunikasjonen med CAS-tjeneren.", @@ -1342,7 +1423,9 @@ "ru": "\u041f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u0430 \u043e\u0448\u0438\u0431\u043a\u0430 \u043f\u0440\u0438 \u043e\u0431\u043c\u0435\u043d\u0435 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0441 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c CAS.", "eu": "Errorea CAS zerbitzariarekin komunikatzen saiatzean", "af": "Fout tydens kommunikasie met die CAS bediener.", - "el": "\u03a0\u03b1\u03c1\u03bf\u03c5\u03c3\u03b9\u03ac\u03c3\u03c4\u03b7\u03ba\u03b5 \u03c3\u03c6\u03ac\u03bb\u03bc\u03b1 \u03ba\u03b1\u03c4\u03ac \u03c4\u03b7\u03bd \u03b5\u03c0\u03b9\u03ba\u03bf\u03b9\u03bd\u03c9\u03bd\u03af\u03b1 \u03bc\u03b5 \u03c4\u03bf\u03bd \u03b5\u03be\u03c5\u03c0\u03b7\u03c1\u03b5\u03c4\u03b7\u03c4\u03ae CAS." + "el": "\u03a0\u03b1\u03c1\u03bf\u03c5\u03c3\u03b9\u03ac\u03c3\u03c4\u03b7\u03ba\u03b5 \u03c3\u03c6\u03ac\u03bb\u03bc\u03b1 \u03ba\u03b1\u03c4\u03ac \u03c4\u03b7\u03bd \u03b5\u03c0\u03b9\u03ba\u03bf\u03b9\u03bd\u03c9\u03bd\u03af\u03b1 \u03bc\u03b5 \u03c4\u03bf\u03bd \u03b5\u03be\u03c5\u03c0\u03b7\u03c1\u03b5\u03c4\u03b7\u03c4\u03ae CAS.", + "zu": "Iphutha ngenkathi kuxhunyanwa neseva ye-CAS.", + "xh": "Impazamo xa kunxibelelwana neseva ye-CAS." }, "title_CONFIG": { "no": "Feil i oppsettet", @@ -1378,7 +1461,9 @@ "ru": "\u041e\u0448\u0438\u0431\u043a\u0430 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438", "eu": "Konfigurazio errorea", "af": "Instellings fout", - "el": "\u03a3\u03c6\u03ac\u03bb\u03bc\u03b1 \u03c1\u03c5\u03b8\u03bc\u03af\u03c3\u03b5\u03c9\u03bd" + "el": "\u03a3\u03c6\u03ac\u03bb\u03bc\u03b1 \u03c1\u03c5\u03b8\u03bc\u03af\u03c3\u03b5\u03c9\u03bd", + "zu": "Iphutha lomiso", + "xh": "Impazamo yolungiselelo" }, "descr_CONFIG": { "no": "Det virker som det er en feil i oppsettet av SimpleSAMLphp.", @@ -1414,7 +1499,9 @@ "ru": "\u0412\u0438\u0434\u0438\u043c\u043e, SimpleSAMLphp \u0441\u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e.", "eu": "Badirudi errore bat jazo dela SimpleSAMLphp-en konfigurazioan", "af": "SimpleSAMLphp is nie korrek ingestel nie", - "el": "\u03a0\u03b1\u03c1\u03bf\u03c5\u03c3\u03b9\u03ac\u03c3\u03c4\u03b7\u03ba\u03b5 \u03c3\u03c6\u03ac\u03bb\u03bc\u03b1 \u03c1\u03c5\u03b8\u03bc\u03af\u03c3\u03b5\u03c9\u03bd \u03c4\u03bf\u03c5 SimpleSAMLphp. \u0395\u03c0\u03b9\u03ba\u03bf\u03b9\u03bd\u03c9\u03bd\u03ae\u03c3\u03c4\u03b5 \u03bc\u03b5 \u03c4\u03bf\u03bd \u03b4\u03b9\u03b1\u03c7\u03b5\u03b9\u03c1\u03b9\u03c3\u03c4\u03ae \u03c4\u03b7\u03c2 \u03c5\u03c0\u03b7\u03c1\u03b5\u03c3\u03af\u03b1\u03c2." + "el": "\u03a0\u03b1\u03c1\u03bf\u03c5\u03c3\u03b9\u03ac\u03c3\u03c4\u03b7\u03ba\u03b5 \u03c3\u03c6\u03ac\u03bb\u03bc\u03b1 \u03c1\u03c5\u03b8\u03bc\u03af\u03c3\u03b5\u03c9\u03bd \u03c4\u03bf\u03c5 SimpleSAMLphp. \u0395\u03c0\u03b9\u03ba\u03bf\u03b9\u03bd\u03c9\u03bd\u03ae\u03c3\u03c4\u03b5 \u03bc\u03b5 \u03c4\u03bf\u03bd \u03b4\u03b9\u03b1\u03c7\u03b5\u03b9\u03c1\u03b9\u03c3\u03c4\u03ae \u03c4\u03b7\u03c2 \u03c5\u03c0\u03b7\u03c1\u03b5\u03c3\u03af\u03b1\u03c2.", + "xh": "I-SimpleSAMLphp ibonakala ingalungiselelwanga kakuhle.", + "zu": "I-SimpleSAMLphp ibonakala ingamisiwe ngendlela efanele." }, "title_NOTSET": { "no": "Passordet er ikke satt", @@ -1450,7 +1537,9 @@ "ru": "\u041f\u0430\u0440\u043e\u043b\u044c \u043d\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d", "eu": "Pasahitzik ez da ezarrii", "af": "Wagwoord nie opgestel nie", - "el": "\u03a3\u03c6\u03ac\u03bb\u03bc\u03b1 \u03ba\u03c9\u03b4\u03b9\u03ba\u03bf\u03cd \u03c0\u03c1\u03cc\u03c3\u03b2\u03b1\u03c3\u03b7\u03c2" + "el": "\u03a3\u03c6\u03ac\u03bb\u03bc\u03b1 \u03ba\u03c9\u03b4\u03b9\u03ba\u03bf\u03cd \u03c0\u03c1\u03cc\u03c3\u03b2\u03b1\u03c3\u03b7\u03c2", + "xh": "Iphaswedi ayisetwanga", + "zu": "Iphasiwedi ayisethiwe" }, "descr_NOTSET": { "no": "Admin passordet i konfigurasjonen (auth.adminpassword) er ikke satt til noe annet enn default verdien. Bytt passord i config.php.", @@ -1486,7 +1575,9 @@ "ru": "\u041f\u0430\u0440\u043e\u043b\u044c \u0432 \u0444\u0430\u0439\u043b\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 (auth.adminpassword) \u043d\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d \u043e\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e. \u041f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u043e\u0442\u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u0443\u0439\u0442\u0435 \u0444\u0430\u0439\u043b \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438.", "eu": "Ez da aldatu konfigurazio fitxategiaren pasahitzaren (auth.adminpassword) balio lehenetsia. Mesedez, edita ezazu fitxategia", "af": "Die wagwoord in die konfigurasie (auth.adminpassword) is nie aangepas nie. Redigeer asb die konfigurasie le\u00ebr.", - "el": "\u03a7\u03c1\u03b7\u03c3\u03b9\u03bc\u03bf\u03c0\u03bf\u03b9\u03b5\u03af\u03c4\u03b1\u03b9 \u03b7 \u03c0\u03c1\u03bf\u03ba\u03b1\u03b8\u03bf\u03c1\u03b9\u03c3\u03bc\u03ad\u03bd\u03b7 \u03c4\u03b9\u03bc\u03ae \u03c4\u03bf\u03c5 \u03ba\u03c9\u03b4\u03b9\u03ba\u03bf\u03cd \u03c0\u03c1\u03cc\u03c3\u03b2\u03b1\u03c3\u03b7\u03c2. \u03a0\u03b1\u03c1\u03b1\u03ba\u03b1\u03bb\u03bf\u03cd\u03bc\u03b5 \u03b5\u03c0\u03b5\u03be\u03b5\u03c1\u03b3\u03b1\u03c3\u03c4\u03b5\u03af\u03c4\u03b5 \u03c4\u03bf \u03b1\u03c1\u03c7\u03b5\u03af\u03bf \u03c1\u03c5\u03b8\u03bc\u03af\u03c3\u03b5\u03c9\u03bd." + "el": "\u03a7\u03c1\u03b7\u03c3\u03b9\u03bc\u03bf\u03c0\u03bf\u03b9\u03b5\u03af\u03c4\u03b1\u03b9 \u03b7 \u03c0\u03c1\u03bf\u03ba\u03b1\u03b8\u03bf\u03c1\u03b9\u03c3\u03bc\u03ad\u03bd\u03b7 \u03c4\u03b9\u03bc\u03ae \u03c4\u03bf\u03c5 \u03ba\u03c9\u03b4\u03b9\u03ba\u03bf\u03cd \u03c0\u03c1\u03cc\u03c3\u03b2\u03b1\u03c3\u03b7\u03c2. \u03a0\u03b1\u03c1\u03b1\u03ba\u03b1\u03bb\u03bf\u03cd\u03bc\u03b5 \u03b5\u03c0\u03b5\u03be\u03b5\u03c1\u03b3\u03b1\u03c3\u03c4\u03b5\u03af\u03c4\u03b5 \u03c4\u03bf \u03b1\u03c1\u03c7\u03b5\u03af\u03bf \u03c1\u03c5\u03b8\u03bc\u03af\u03c3\u03b5\u03c9\u03bd.", + "xh": "Iphaswedi ekulungiselelo (auth.adminpassword) ayitshintshwanga ukusuka kwixabiso lesiseko. Nceda uhlele ifayile yolungiselelo.", + "zu": "Iphasiwedi kumiso (auth.adminpassword) ayishintshiwe kunani elizenzakalelayo. Sicela uhlele ifayela lomiso." }, "title_NOTVALIDCERT": { "no": "Ugyldig sertifikat", @@ -1522,7 +1613,9 @@ "ru": "\u041d\u0435\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442", "eu": "Ziurtagiri balio gabea", "af": "Ongeldige sertifikaat", - "el": "\u039c\u03b7 \u03ad\u03b3\u03ba\u03c5\u03c1\u03bf \u03c0\u03b9\u03c3\u03c4\u03bf\u03c0\u03bf\u03b9\u03b7\u03c4\u03b9\u03ba\u03cc" + "el": "\u039c\u03b7 \u03ad\u03b3\u03ba\u03c5\u03c1\u03bf \u03c0\u03b9\u03c3\u03c4\u03bf\u03c0\u03bf\u03b9\u03b7\u03c4\u03b9\u03ba\u03cc", + "xh": "Isatifikethi esingasebenziyo", + "zu": "Isitifiketi esingalungile" }, "descr_NOTVALIDCERT": { "no": "Du presenterte ikke et gyldig sertifikat", @@ -1558,7 +1651,9 @@ "ru": "\u0412\u044b \u043d\u0435 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u043b\u0438 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442.", "eu": "Ez duzu baliozko ziurtagiririk aurkeztu ", "af": "Jy het nie 'n geldige sertifikaat gestuur nie.", - "el": "\u03a0\u03b1\u03c1\u03bf\u03c5\u03c3\u03b9\u03ac\u03c3\u03c4\u03b7\u03ba\u03b5 \u03c3\u03c6\u03ac\u03bb\u03bc\u03b1 \u03bb\u03cc\u03b3\u03c9 \u03bc\u03b7 \u03ad\u03b3\u03ba\u03c5\u03c1\u03bf\u03c5 \u03c0\u03b9\u03c3\u03c4\u03bf\u03c0\u03bf\u03b9\u03b7\u03c4\u03b9\u03ba\u03bf\u03cd." + "el": "\u03a0\u03b1\u03c1\u03bf\u03c5\u03c3\u03b9\u03ac\u03c3\u03c4\u03b7\u03ba\u03b5 \u03c3\u03c6\u03ac\u03bb\u03bc\u03b1 \u03bb\u03cc\u03b3\u03c9 \u03bc\u03b7 \u03ad\u03b3\u03ba\u03c5\u03c1\u03bf\u03c5 \u03c0\u03b9\u03c3\u03c4\u03bf\u03c0\u03bf\u03b9\u03b7\u03c4\u03b9\u03ba\u03bf\u03cd.", + "zu": "Awuzange wethule isitifiketi esilungile.", + "xh": "Awukhange uzise isatifikethi esisebenzayo." }, "errorreport_header": { "no": "Feilrapport sent", @@ -1593,7 +1688,9 @@ "ro": "Raportul cu erori a fost trimis", "ru": "\u0421\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043e\u0431 \u043e\u0448\u0438\u0431\u043a\u0435 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043e", "af": "Foutmeldingsverslag gestuur", - "el": "\u0397 \u03b1\u03bd\u03b1\u03c6\u03bf\u03c1\u03ac \u03c3\u03c6\u03ac\u03bb\u03bc\u03b1\u03c4\u03bf\u03c2 \u03c3\u03c4\u03ac\u03bb\u03b8\u03b7\u03ba\u03b5" + "el": "\u0397 \u03b1\u03bd\u03b1\u03c6\u03bf\u03c1\u03ac \u03c3\u03c6\u03ac\u03bb\u03bc\u03b1\u03c4\u03bf\u03c2 \u03c3\u03c4\u03ac\u03bb\u03b8\u03b7\u03ba\u03b5", + "zu": "Umbiko wephutha uthunyelwe", + "xh": "Ingxelo yempazamo ithunyelwe" }, "errorreport_text": { "no": "Feilrapport er sent til administrator.", @@ -1628,7 +1725,9 @@ "ro": "Raportul cu erori a fost trimis c\u0103tre administratori.", "ru": "\u0421\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043e\u0431 \u043e\u0448\u0438\u0431\u043a\u0435 \u0431\u044b\u043b\u043e \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043e \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0430\u043c.", "af": "Die foutmeldings verslag is gestuur na die administrateurs.", - "el": "\u0397 \u03b1\u03c0\u03bf\u03c3\u03c4\u03bf\u03bb\u03ae \u03c4\u03b7\u03c2 \u03b1\u03bd\u03b1\u03c6\u03bf\u03c1\u03ac\u03c2 \u03c3\u03c6\u03ac\u03bb\u03bc\u03b1\u03c4\u03bf\u03c2 \u03c3\u03c4\u03bf\u03c5\u03c2 \u03b4\u03b9\u03b1\u03c7\u03b5\u03b9\u03c1\u03b9\u03c3\u03c4\u03ad\u03c2 \u03bf\u03bb\u03bf\u03ba\u03bb\u03b7\u03c1\u03ce\u03b8\u03b7\u03ba\u03b5." + "el": "\u0397 \u03b1\u03c0\u03bf\u03c3\u03c4\u03bf\u03bb\u03ae \u03c4\u03b7\u03c2 \u03b1\u03bd\u03b1\u03c6\u03bf\u03c1\u03ac\u03c2 \u03c3\u03c6\u03ac\u03bb\u03bc\u03b1\u03c4\u03bf\u03c2 \u03c3\u03c4\u03bf\u03c5\u03c2 \u03b4\u03b9\u03b1\u03c7\u03b5\u03b9\u03c1\u03b9\u03c3\u03c4\u03ad\u03c2 \u03bf\u03bb\u03bf\u03ba\u03bb\u03b7\u03c1\u03ce\u03b8\u03b7\u03ba\u03b5.", + "xh": "Ingxelo yempazamo ithunyelwe kubalawuli.", + "zu": "Umbiko wephutha uthunyelwe kubalawuli." }, "title_LOGOUTINFOLOST": { "no": "Informasjon om utlogging er tapt", @@ -1663,7 +1762,9 @@ "ru": "\u041f\u043e\u0442\u0435\u0440\u044f\u043d\u0430 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u0432\u044b\u0445\u043e\u0434\u0435.", "eu": "Saioa ixteko informazioa galdu da", "af": "Afmelding informasie verlore", - "el": "\u03a3\u03c6\u03ac\u03bb\u03bc\u03b1 \u03b1\u03c0\u03bf\u03c3\u03cd\u03bd\u03b4\u03b5\u03c3\u03b7\u03c2" + "el": "\u03a3\u03c6\u03ac\u03bb\u03bc\u03b1 \u03b1\u03c0\u03bf\u03c3\u03cd\u03bd\u03b4\u03b5\u03c3\u03b7\u03c2", + "zu": "Ulwazi lokuphuma lulahlekile", + "xh": "Inkcazelo yokuphuma ilahlekile" }, "descr_LOGOUTINFOLOST": { "no": "Informasjonen om den n\u00e5v\u00e6rende utloggingen har g\u00e5tt tapt. Du b\u00f8r g\u00e5 tilbake til den opprinnelige tjesesten og pr\u00f8ve \u00e5 logge ut p\u00e5 nytt. Informasjon om utloggingsoperasjoner er kun lagret i en begrenset tid - vanligvis noen timer. Dette er lengere tid enn en vanlig utlogging skal ta, s\u00e5 denne feilen kan tyde p\u00e5 at noe er galt med oppsettet. Ta kontakt med tjenesteyteren hvis problemet gjentar seg.", @@ -1698,7 +1799,9 @@ "ru": "\u0418\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0432\u044b\u0445\u043e\u0434\u0430 \u0431\u044b\u043b\u0430 \u043f\u043e\u0442\u0435\u0440\u044f\u043d\u0430. \u0412\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0432\u0435\u0440\u043d\u0443\u0442\u044c\u0441\u044f \u043d\u0430 \u0441\u043b\u0443\u0436\u0431\u0443, \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0432\u044b \u043f\u044b\u0442\u0430\u043b\u0438\u0441\u044c \u0432\u044b\u0439\u0442\u0438 \u0438 \u043f\u043e\u043f\u044b\u0442\u0430\u0442\u044c\u0441\u044f \u0432\u044b\u0439\u0442\u0438 \u0441\u043d\u043e\u0432\u0430. \u042d\u0442\u0430 \u043e\u0448\u0438\u0431\u043a\u0430 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0432\u044b\u0437\u0432\u0430\u043d\u0430 \u0443\u0441\u0442\u0430\u0440\u0435\u0432\u0430\u043d\u0438\u0435\u043c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e \u0432\u044b\u0445\u043e\u0434\u0435. \u0418\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u0432\u044b\u0445\u043e\u0434\u0435 \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u0432 \u0442\u0435\u0447\u0435\u043d\u0438\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043d\u043e\u0433\u043e \u043e\u0442\u0440\u0435\u0437\u043a\u0430 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 - \u043e\u0431\u044b\u0447\u043d\u043e \u0434\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e\u0438\u0445 \u0447\u0430\u0441\u043e\u0432. \u042d\u0442\u043e \u0431\u043e\u043b\u044c\u0448\u0435, \u0447\u0435\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u043b\u044e\u0431\u043e\u0439 \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e\u0439 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0432\u044b\u0445\u043e\u0434\u0430, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u044d\u0442\u0430 \u043e\u0448\u0438\u0431\u043a\u0430 \u043c\u043e\u0436\u0435\u0442 \u043e\u0437\u043d\u0430\u0447\u0430\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u0440\u0443\u0433\u0438\u0435 \u043e\u0448\u0438\u0431\u043a\u0438 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438. \u0415\u0441\u043b\u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u043d\u0435 \u0443\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u0430, \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u0435\u0441\u044c \u043a \u0441\u0435\u0440\u0432\u0438\u0441 \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u0443.", "eu": "Saioa ixteko eragiketari buruzko informazioa galdu da. Irten nahi duzun zerbitzura itzuli eta saioa berriz ixten saitu behar duzu. Saioa ixteko informazioa denbora mugatu batean gordetzen da, orokorrean saio ixteko eragiketak iraun beharko lukeen denbora baino gehiago, beraz errore hau konfigurazioan erroreren bat jazo delako gerta liteke. Errorea etengabea bada, jar zaitez harremanetan zerbitzuaren hornitzailearekin.", "af": "Die inligting vir die huidige uiteken sessie is verlore. Jy moet terugkeer na die diens waarvan jy probeer afmeld het en probeer om weer af te meld. Di\u00e9 fout kan voorkom weens verstreke afmelding inligting. Die afmelding inligting word gestoor vir 'n beperkte tydperk - gewoonlik 'n paar ure. Dit is langer as wat 'n normale afmelding sessie moet vat, so die fout mag 'n indikasie wees van 'n probleem met die stellings. Kontak jou diens verskaffer sou die probleem voortduur.", - "el": "\u039f\u03b9 \u03c0\u03bb\u03b7\u03c1\u03bf\u03c6\u03bf\u03c1\u03af\u03b5\u03c2 \u03c3\u03c7\u03b5\u03c4\u03b9\u03ba\u03ac \u03bc\u03b5 \u03c4\u03b7\u03bd \u03b1\u03c0\u03bf\u03c3\u03cd\u03bd\u03b4\u03b5\u03c3\u03b7 \u03ad\u03c7\u03bf\u03c5\u03bd \u03c7\u03b1\u03b8\u03b5\u03af. \u0398\u03b1 \u03c0\u03c1\u03ad\u03c0\u03b5\u03b9 \u03bd\u03b1 \u03b5\u03c0\u03b9\u03c3\u03c4\u03c1\u03ad\u03c8\u03b5\u03c4\u03b5 \u03c3\u03c4\u03b7\u03bd \u03c5\u03c0\u03b7\u03c1\u03b5\u03c3\u03af\u03b1 \u03b1\u03c0\u03cc \u03c4\u03b7\u03bd \u03bf\u03c0\u03bf\u03af\u03b1 \u03c0\u03c1\u03bf\u03c3\u03c0\u03b1\u03b8\u03b5\u03af\u03c4\u03b5 \u03bd\u03b1 \u03b1\u03c0\u03bf\u03c3\u03c5\u03bd\u03b4\u03b5\u03b8\u03b5\u03af\u03c4\u03b5 \u03ba\u03b1\u03b9 \u03bd\u03b1 \u03c0\u03c1\u03bf\u03c3\u03c0\u03b1\u03b8\u03ae\u03c3\u03b5\u03c4\u03b5 \u03b5\u03ba \u03bd\u03ad\u03bf\u03c5. \u0391\u03c5\u03c4\u03cc \u03c4\u03bf \u03c3\u03c6\u03ac\u03bb\u03bc\u03b1 \u03bc\u03c0\u03bf\u03c1\u03b5\u03af \u03bd\u03b1 \u03c0\u03b1\u03c1\u03bf\u03c5\u03c3\u03b9\u03b1\u03c3\u03c4\u03b5\u03af \u03b1\u03bd \u03b7 \u03b9\u03c3\u03c7\u03cd\u03c2 \u03c4\u03c9\u03bd \u03c0\u03bb\u03b7\u03c1\u03bf\u03c6\u03bf\u03c1\u03b9\u03ce\u03bd \u03c3\u03c7\u03b5\u03c4\u03b9\u03ba\u03ac \u03bc\u03b5 \u03c4\u03b7\u03bd \u03b1\u03c0\u03bf\u03c3\u03cd\u03bd\u03b4\u03b5\u03c3\u03b7 \u03ad\u03c7\u03b5\u03b9 \u03bb\u03ae\u03be\u03b5\u03b9. \u039f\u03b9 \u03c0\u03bb\u03b7\u03c1\u03bf\u03c6\u03bf\u03c1\u03af\u03b5\u03c2 \u03b1\u03c5\u03c4\u03ad\u03c2 \u03b1\u03c0\u03bf\u03b8\u03b7\u03ba\u03b5\u03cd\u03b5\u03c4\u03b1\u03b9 \u03b3\u03b9\u03b1 \u03c0\u03b5\u03c1\u03b9\u03bf\u03c1\u03b9\u03c3\u03bc\u03ad\u03bd\u03bf \u03c7\u03c1\u03bf\u03bd\u03b9\u03ba\u03cc \u03b4\u03b9\u03ac\u03c3\u03c4\u03b7\u03bc\u03b1 - \u03c3\u03c5\u03bd\u03ae\u03b8\u03c9\u03c2 \u03bc\u03b5\u03c1\u03b9\u03ba\u03ce\u03bd \u03c9\u03c1\u03ce\u03bd. \u0391\u03c5\u03c4\u03cc \u03c3\u03c5\u03bd\u03ae\u03b8\u03c9\u03c2 \u03b5\u03c0\u03b1\u03c1\u03ba\u03b5\u03af \u03b3\u03b9\u03b1 \u03bc\u03b9\u03b1 \u03ba\u03b1\u03bd\u03bf\u03bd\u03b9\u03ba\u03ae \u03bb\u03b5\u03b9\u03c4\u03bf\u03c5\u03c1\u03b3\u03af\u03b1 \u03b1\u03c0\u03bf\u03c3\u03cd\u03bd\u03b4\u03b5\u03c3\u03b7\u03c2, \u03c3\u03c5\u03bd\u03b5\u03c0\u03ce\u03c2 \u03c3\u03c4\u03b7\u03bd \u03c0\u03c1\u03bf\u03ba\u03b5\u03b9\u03bc\u03ad\u03bd\u03b7 \u03c0\u03b5\u03c1\u03af\u03c0\u03c4\u03c9\u03c3\u03b7 \u03c4\u03bf \u03c3\u03c6\u03ac\u03bb\u03bc\u03b1 \u03bc\u03c0\u03bf\u03c1\u03b5\u03af \u03bd\u03b1 \u03c5\u03c0\u03bf\u03b4\u03b5\u03b9\u03ba\u03bd\u03cd\u03b5\u03b9 \u03ba\u03ac\u03c0\u03bf\u03b9\u03bf \u03ac\u03bb\u03bb\u03bf \u03b8\u03ad\u03bc\u03b1 \u03bc\u03b5 \u03c4\u03b9\u03c2 \u03c1\u03c5\u03b8\u03bc\u03af\u03c3\u03b5\u03b9\u03c2. \u0395\u03ac\u03bd \u03c4\u03bf \u03c0\u03c1\u03cc\u03b2\u03bb\u03b7\u03bc\u03b1 \u03c0\u03b1\u03c1\u03b1\u03bc\u03ad\u03bd\u03b5\u03b9, \u03b5\u03c0\u03b9\u03ba\u03bf\u03b9\u03bd\u03c9\u03bd\u03ae\u03c3\u03c4\u03b5 \u03bc\u03b5 \u03c4\u03bf\u03bd \u03c0\u03ac\u03c1\u03bf\u03c7\u03bf \u03c5\u03c0\u03b7\u03c1\u03b5\u03c3\u03b9\u03ce\u03bd." + "el": "\u039f\u03b9 \u03c0\u03bb\u03b7\u03c1\u03bf\u03c6\u03bf\u03c1\u03af\u03b5\u03c2 \u03c3\u03c7\u03b5\u03c4\u03b9\u03ba\u03ac \u03bc\u03b5 \u03c4\u03b7\u03bd \u03b1\u03c0\u03bf\u03c3\u03cd\u03bd\u03b4\u03b5\u03c3\u03b7 \u03ad\u03c7\u03bf\u03c5\u03bd \u03c7\u03b1\u03b8\u03b5\u03af. \u0398\u03b1 \u03c0\u03c1\u03ad\u03c0\u03b5\u03b9 \u03bd\u03b1 \u03b5\u03c0\u03b9\u03c3\u03c4\u03c1\u03ad\u03c8\u03b5\u03c4\u03b5 \u03c3\u03c4\u03b7\u03bd \u03c5\u03c0\u03b7\u03c1\u03b5\u03c3\u03af\u03b1 \u03b1\u03c0\u03cc \u03c4\u03b7\u03bd \u03bf\u03c0\u03bf\u03af\u03b1 \u03c0\u03c1\u03bf\u03c3\u03c0\u03b1\u03b8\u03b5\u03af\u03c4\u03b5 \u03bd\u03b1 \u03b1\u03c0\u03bf\u03c3\u03c5\u03bd\u03b4\u03b5\u03b8\u03b5\u03af\u03c4\u03b5 \u03ba\u03b1\u03b9 \u03bd\u03b1 \u03c0\u03c1\u03bf\u03c3\u03c0\u03b1\u03b8\u03ae\u03c3\u03b5\u03c4\u03b5 \u03b5\u03ba \u03bd\u03ad\u03bf\u03c5. \u0391\u03c5\u03c4\u03cc \u03c4\u03bf \u03c3\u03c6\u03ac\u03bb\u03bc\u03b1 \u03bc\u03c0\u03bf\u03c1\u03b5\u03af \u03bd\u03b1 \u03c0\u03b1\u03c1\u03bf\u03c5\u03c3\u03b9\u03b1\u03c3\u03c4\u03b5\u03af \u03b1\u03bd \u03b7 \u03b9\u03c3\u03c7\u03cd\u03c2 \u03c4\u03c9\u03bd \u03c0\u03bb\u03b7\u03c1\u03bf\u03c6\u03bf\u03c1\u03b9\u03ce\u03bd \u03c3\u03c7\u03b5\u03c4\u03b9\u03ba\u03ac \u03bc\u03b5 \u03c4\u03b7\u03bd \u03b1\u03c0\u03bf\u03c3\u03cd\u03bd\u03b4\u03b5\u03c3\u03b7 \u03ad\u03c7\u03b5\u03b9 \u03bb\u03ae\u03be\u03b5\u03b9. \u039f\u03b9 \u03c0\u03bb\u03b7\u03c1\u03bf\u03c6\u03bf\u03c1\u03af\u03b5\u03c2 \u03b1\u03c5\u03c4\u03ad\u03c2 \u03b1\u03c0\u03bf\u03b8\u03b7\u03ba\u03b5\u03cd\u03b5\u03c4\u03b1\u03b9 \u03b3\u03b9\u03b1 \u03c0\u03b5\u03c1\u03b9\u03bf\u03c1\u03b9\u03c3\u03bc\u03ad\u03bd\u03bf \u03c7\u03c1\u03bf\u03bd\u03b9\u03ba\u03cc \u03b4\u03b9\u03ac\u03c3\u03c4\u03b7\u03bc\u03b1 - \u03c3\u03c5\u03bd\u03ae\u03b8\u03c9\u03c2 \u03bc\u03b5\u03c1\u03b9\u03ba\u03ce\u03bd \u03c9\u03c1\u03ce\u03bd. \u0391\u03c5\u03c4\u03cc \u03c3\u03c5\u03bd\u03ae\u03b8\u03c9\u03c2 \u03b5\u03c0\u03b1\u03c1\u03ba\u03b5\u03af \u03b3\u03b9\u03b1 \u03bc\u03b9\u03b1 \u03ba\u03b1\u03bd\u03bf\u03bd\u03b9\u03ba\u03ae \u03bb\u03b5\u03b9\u03c4\u03bf\u03c5\u03c1\u03b3\u03af\u03b1 \u03b1\u03c0\u03bf\u03c3\u03cd\u03bd\u03b4\u03b5\u03c3\u03b7\u03c2, \u03c3\u03c5\u03bd\u03b5\u03c0\u03ce\u03c2 \u03c3\u03c4\u03b7\u03bd \u03c0\u03c1\u03bf\u03ba\u03b5\u03b9\u03bc\u03ad\u03bd\u03b7 \u03c0\u03b5\u03c1\u03af\u03c0\u03c4\u03c9\u03c3\u03b7 \u03c4\u03bf \u03c3\u03c6\u03ac\u03bb\u03bc\u03b1 \u03bc\u03c0\u03bf\u03c1\u03b5\u03af \u03bd\u03b1 \u03c5\u03c0\u03bf\u03b4\u03b5\u03b9\u03ba\u03bd\u03cd\u03b5\u03b9 \u03ba\u03ac\u03c0\u03bf\u03b9\u03bf \u03ac\u03bb\u03bb\u03bf \u03b8\u03ad\u03bc\u03b1 \u03bc\u03b5 \u03c4\u03b9\u03c2 \u03c1\u03c5\u03b8\u03bc\u03af\u03c3\u03b5\u03b9\u03c2. \u0395\u03ac\u03bd \u03c4\u03bf \u03c0\u03c1\u03cc\u03b2\u03bb\u03b7\u03bc\u03b1 \u03c0\u03b1\u03c1\u03b1\u03bc\u03ad\u03bd\u03b5\u03b9, \u03b5\u03c0\u03b9\u03ba\u03bf\u03b9\u03bd\u03c9\u03bd\u03ae\u03c3\u03c4\u03b5 \u03bc\u03b5 \u03c4\u03bf\u03bd \u03c0\u03ac\u03c1\u03bf\u03c7\u03bf \u03c5\u03c0\u03b7\u03c1\u03b5\u03c3\u03b9\u03ce\u03bd.", + "zu": "Ulwazi olumayelana nomsebenzi wokuphuma wamanje lulahlekile. Kufanele ubuyele kusevisi obuzama ukuphuma kuyo futhi uzame ukuphuma futhi. Leli phutha lingabangelwa ukuphelelwa isikhathi kolwazi lokuphuma. Ulwazi lokuphuma lugcinwa isikhathi esilinganiselwe - ngokuvamile amahora ambalwa. Lokhu kude kunanoma yimuphi umsebenzi wokuphuma ovamile, ngakho leli phutha lingase libonise elinye iphutha ngomiso. Uma inkinga iphikelela, thinta umhlinzeki wakho wesevisi.", + "xh": "Inkcazelo malunga nomsebenzi wokuphuma wangoku ilahlekile. Ufanele ubuyele kwinkonzo ubuzama ukuphuma kuyo uzame ukuphuma kwakhona. Le mpazamo inokubangelwa kukuphelelwa kwenkcazelo yokuphuma. Inkcazelo yokuphuma igcinwa ixesha elithile - ngokuqhelekileyo iiyure eziliqela. Oku kuthatha ixesha elide kunawo nawuphi na umsebenzi wokuphuma ofanele ulithathe, ngoko le mpazamo isenokubonisa enye impazamo ngolungiselelo. Ukuba ingxaki iyaqhubeka, qhagamshela umboneleli wenkonzo wakho." }, "title_UNHANDLEDEXCEPTION": { "no": "Uh\u00e5ndtert feil", @@ -1733,7 +1836,9 @@ "eu": "Kudeatu gabeko salbuespena", "fi": "K\u00e4sittelem\u00e4t\u00f6n poikkeus", "af": "Onverwagte foutmelding", - "el": "\u0391\u03bd\u03b5\u03c0\u03af\u03bb\u03c5\u03c4\u03b7 \u03b5\u03be\u03b1\u03af\u03c1\u03b5\u03c3\u03b7" + "el": "\u0391\u03bd\u03b5\u03c0\u03af\u03bb\u03c5\u03c4\u03b7 \u03b5\u03be\u03b1\u03af\u03c1\u03b5\u03c3\u03b7", + "xh": "Isinxaxhi esingasingathwanga", + "zu": "Okuhlukile okungasingathiwe" }, "descr_UNHANDLEDEXCEPTION": { "no": "En uventet feilsituasjon oppstod", @@ -1768,7 +1873,9 @@ "eu": "Kudeatu gabeko salbuespen bat abiarazi da", "fi": "K\u00e4sittelem\u00e4t\u00f6n poikkeus heitetty", "af": "'n Onverwagte foutmelding is aangetoon", - "el": "\u03a0\u03b1\u03c1\u03bf\u03c5\u03c3\u03b9\u03ac\u03c3\u03c4\u03b7\u03ba\u03b5 \u03b1\u03bd\u03b5\u03c0\u03af\u03bb\u03c5\u03c4\u03b7 \u03b5\u03be\u03b1\u03af\u03c1\u03b5\u03c3\u03b7" + "el": "\u03a0\u03b1\u03c1\u03bf\u03c5\u03c3\u03b9\u03ac\u03c3\u03c4\u03b7\u03ba\u03b5 \u03b1\u03bd\u03b5\u03c0\u03af\u03bb\u03c5\u03c4\u03b7 \u03b5\u03be\u03b1\u03af\u03c1\u03b5\u03c3\u03b7", + "xh": "Isinxaxhi esingasingathwanga silahliwe.", + "zu": "Okuhlukile okungasingathiwe kulahliwe." }, "title_NOTFOUND": { "no": "Kan ikke finne siden", @@ -1803,7 +1910,9 @@ "ru": "\u0421\u0442\u0440\u0430\u043d\u0438\u0446\u0430 \u043d\u0435 \u043d\u0430\u0439\u0434\u0435\u043d\u0430", "eu": "Ez da orria aurkitu", "af": "Bladsy nie gevind nie", - "el": "\u0397 \u03c3\u03b5\u03bb\u03af\u03b4\u03b1 \u03b4\u03b5\u03bd \u03b2\u03c1\u03ad\u03b8\u03b7\u03ba\u03b5" + "el": "\u0397 \u03c3\u03b5\u03bb\u03af\u03b4\u03b1 \u03b4\u03b5\u03bd \u03b2\u03c1\u03ad\u03b8\u03b7\u03ba\u03b5", + "xh": "Ikhasi alifunyenwanga", + "zu": "Ikhasi alitholakali" }, "descr_NOTFOUND": { "no": "Den angitte siden finnes ike. URLen var: %URL%", @@ -1838,7 +1947,9 @@ "ru": "\u0417\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u043c\u0430\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430 \u043d\u0435 \u043d\u0430\u0439\u0434\u0435\u043d\u0430. \u0421\u0441\u044b\u043b\u043a\u0430 \u0431\u044b\u043b\u0430: %URL%", "eu": "Ez da aurkitu adierazi duzun orria. URLa hau da: %URL%", "af": "Die bladsy bestaan nie. Die URL was: %URL%", - "el": "\u0397 \u03c3\u03b5\u03bb\u03af\u03b4\u03b1 \u03c0\u03bf\u03c5 \u03b6\u03b7\u03c4\u03ae\u03c3\u03b1\u03c4\u03b5 \u03c3\u03c4\u03b7 \u03b4\u03b9\u03b5\u03cd\u03b8\u03c5\u03bd\u03c3\u03b7 %URL% \u03b4\u03b5\u03bd \u03b2\u03c1\u03ad\u03b8\u03b7\u03ba\u03b5." + "el": "\u0397 \u03c3\u03b5\u03bb\u03af\u03b4\u03b1 \u03c0\u03bf\u03c5 \u03b6\u03b7\u03c4\u03ae\u03c3\u03b1\u03c4\u03b5 \u03c3\u03c4\u03b7 \u03b4\u03b9\u03b5\u03cd\u03b8\u03c5\u03bd\u03c3\u03b7 %URL% \u03b4\u03b5\u03bd \u03b2\u03c1\u03ad\u03b8\u03b7\u03ba\u03b5.", + "zu": "Ikhasi elinikeziwe alitholakalanga. I-URL ibithi: %URL%", + "xh": "Ikhasi elinikelweyo alifunyenwanga. I-URL ngu: %URL%" }, "title_NOTFOUNDREASON": { "no": "Kan ikke finne siden", @@ -1873,7 +1984,9 @@ "ru": "\u0421\u0442\u0440\u0430\u043d\u0438\u0446\u0430 \u043d\u0435 \u043d\u0430\u0439\u0434\u0435\u043d\u0430", "eu": "Ez da orria aurkitu", "af": "Bladsy nie gevind nie", - "el": "\u0397 \u03c3\u03b5\u03bb\u03af\u03b4\u03b1 \u03b4\u03b5\u03bd \u03b2\u03c1\u03ad\u03b8\u03b7\u03ba\u03b5" + "el": "\u0397 \u03c3\u03b5\u03bb\u03af\u03b4\u03b1 \u03b4\u03b5\u03bd \u03b2\u03c1\u03ad\u03b8\u03b7\u03ba\u03b5", + "xh": "Ikhasi alifunyenwanga", + "zu": "Ikhasi alitholakali" }, "descr_NOTFOUNDREASON": { "no": "Den angitte siden finnes ikke. Grunnen er: %REASON%. URLen var: %URL%", @@ -1908,7 +2021,9 @@ "ru": "\u0417\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u043c\u0430\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430 \u043d\u0435 \u043d\u0430\u0439\u0434\u0435\u043d\u0430. \u041f\u0440\u0438\u0447\u0438\u043d\u0430: %REASON% \u0421\u0441\u044b\u043b\u043a\u0430: %URL%", "eu": "Ez da aurkitu adierazi duzun orria. Arrazoia hau da: %REASON% URL hau da: %URL%", "af": "Die gegewe bladsy is nie gevind nie. Die rede was: %REASON%. Die URL was: %URL%", - "el": "\u0397 \u03c3\u03b5\u03bb\u03af\u03b4\u03b1 \u03c0\u03bf\u03c5 \u03b6\u03b7\u03c4\u03ae\u03c3\u03b1\u03c4\u03b5 \u03c3\u03c4\u03b7 \u03b4\u03b9\u03b5\u03cd\u03b8\u03c5\u03bd\u03c3\u03b7 %URL% \u03b4\u03b5\u03bd \u03b2\u03c1\u03ad\u03b8\u03b7\u03ba\u03b5: %REASON%" + "el": "\u0397 \u03c3\u03b5\u03bb\u03af\u03b4\u03b1 \u03c0\u03bf\u03c5 \u03b6\u03b7\u03c4\u03ae\u03c3\u03b1\u03c4\u03b5 \u03c3\u03c4\u03b7 \u03b4\u03b9\u03b5\u03cd\u03b8\u03c5\u03bd\u03c3\u03b7 %URL% \u03b4\u03b5\u03bd \u03b2\u03c1\u03ad\u03b8\u03b7\u03ba\u03b5: %REASON%", + "zu": "Ikhasi elinikeziwe alitholakalanga. Isizathu besithi: %REASON% I-URL ibithi: %URL%", + "xh": "Ikhasi elinikelweyo alifunyenwanga. Isizathu sesi: %REASON% I-URL ngu: %URL%" }, "title_BADREQUEST": { "no": "Feil foresp\u00f8rsel motatt", @@ -1943,7 +2058,9 @@ "ru": "\u041f\u043e\u043b\u0443\u0447\u0435\u043d \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 \u043e\u0442\u043a\u043b\u0438\u043a", "eu": "Eskaera oker bat jaso da.", "af": "Foutiewe versoek ontvang", - "el": "\u0395\u03c3\u03c6\u03b1\u03bb\u03bc\u03ad\u03bd\u03bf \u03b1\u03af\u03c4\u03b7\u03bc\u03b1" + "el": "\u0395\u03c3\u03c6\u03b1\u03bb\u03bc\u03ad\u03bd\u03bf \u03b1\u03af\u03c4\u03b7\u03bc\u03b1", + "zu": "Kutholwe umlayezo ongalungile", + "xh": "Kufunyenwe isicelo esibi" }, "descr_BADREQUEST": { "no": "En feil oppsto i foresp\u00f8rselen til denne siden. Grunnen var: %REASON%", @@ -1977,7 +2094,9 @@ "ru": "\u041e\u0448\u0438\u0431\u043a\u0430 \u0432 \u0437\u0430\u043f\u0440\u043e\u0441\u0435 \u043a \u044d\u0442\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435. \u041f\u0440\u0438\u0447\u0438\u043d\u0430: %REASON%", "eu": "Errore bat dago orri honen eskaeran. Arrazoia hau da: %REASON%", "af": "Daar is 'n fout in die versoek na die bladsy. Die rede is: %REASON%", - "el": "\u03a0\u03b1\u03c1\u03bf\u03c5\u03c3\u03b9\u03ac\u03c3\u03c4\u03b7\u03ba\u03b5 \u03c3\u03c6\u03ac\u03bb\u03bc\u03b1 \u03ba\u03b1\u03c4\u03ac \u03c4\u03b7\u03bd \u03b5\u03c0\u03b5\u03be\u03b5\u03c1\u03b3\u03b1\u03c3\u03af\u03b1 \u03c4\u03bf\u03c5 \u03b1\u03b9\u03c4\u03ae\u03bc\u03b1\u03c4\u03bf\u03c2: %REASON%" + "el": "\u03a0\u03b1\u03c1\u03bf\u03c5\u03c3\u03b9\u03ac\u03c3\u03c4\u03b7\u03ba\u03b5 \u03c3\u03c6\u03ac\u03bb\u03bc\u03b1 \u03ba\u03b1\u03c4\u03ac \u03c4\u03b7\u03bd \u03b5\u03c0\u03b5\u03be\u03b5\u03c1\u03b3\u03b1\u03c3\u03af\u03b1 \u03c4\u03bf\u03c5 \u03b1\u03b9\u03c4\u03ae\u03bc\u03b1\u03c4\u03bf\u03c2: %REASON%", + "zu": "Kukhona iphutha kusicelo saleli khasi. Isizathu besithi: %REASON%", + "xh": "Kukho impazamo kwisicelo kweli khasi. Isizathu sesi: %REASON%" }, "title_WRONGUSERPASS": { "no": "Feil brukernavn og passord", @@ -2012,7 +2131,9 @@ "ru": "\u041d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0435 \u0438\u043c\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0438\u043b\u0438 \u043f\u0430\u0440\u043e\u043b\u044c", "eu": "Erabiltzaile-izena edo pasahitz okerra", "af": "Inkorrekte gebruikersnaam of wagwoord", - "el": "\u03a4\u03bf \u03cc\u03bd\u03bf\u03bc\u03b1 \u03c7\u03c1\u03ae\u03c3\u03c4\u03b7 \u03ae \u03bf \u03ba\u03c9\u03b4\u03b9\u03ba\u03cc\u03c2 \u03c0\u03c1\u03cc\u03c3\u03b2\u03b1\u03c3\u03b7\u03c2 \u03b5\u03af\u03bd\u03b1\u03b9 \u03bb\u03ac\u03b8\u03bf\u03c2" + "el": "\u03a4\u03bf \u03cc\u03bd\u03bf\u03bc\u03b1 \u03c7\u03c1\u03ae\u03c3\u03c4\u03b7 \u03ae \u03bf \u03ba\u03c9\u03b4\u03b9\u03ba\u03cc\u03c2 \u03c0\u03c1\u03cc\u03c3\u03b2\u03b1\u03c3\u03b7\u03c2 \u03b5\u03af\u03bd\u03b1\u03b9 \u03bb\u03ac\u03b8\u03bf\u03c2", + "zu": "Igama lomsebenzisi elingalungile noma iphasiwedi", + "xh": "Igama lomsebenzisi okanye iphaswedi engachanekanga" }, "descr_WRONGUSERPASS": { "no": "Enten var brukernavnet, eller kombinasjonen med brukernavn og passord feil. Sjekk brukernavn og passord og pr\u00f8v igjen.", @@ -2046,8 +2167,9 @@ "ru": "\u041b\u0438\u0431\u043e \u043d\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0441 \u0434\u0430\u043d\u043d\u044b\u043c \u0438\u043c\u0435\u043d\u0435\u043c, \u043b\u0438\u0431\u043e \u043d\u0435\u0432\u0435\u0440\u043d\u044b\u0439 \u043f\u0430\u0440\u043e\u043b\u044c.\u041f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u043f\u0440\u043e\u0432\u0435\u0440\u044c\u0442\u0435 \u0438\u043c\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0438 \u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u0441\u043d\u043e\u0432\u0430.", "eu": "Ez dago erabiltzailerik adierazitako identifikadorearekin, edo adierazitako pasahitza okerra da. Mesedez, berrikusi ezazu erabiltzaile-identifikadorea eta saia zaiztez berriro.", "af": "Die gegewe gebruikersnaam bestaan nie, of die wagwoord wat jy verskaf het is verkeerd. Bevestig die gebruikersnaam en probeer weer.", - "el": "\u039f \u03c3\u03c5\u03bd\u03b4\u03c5\u03b1\u03c3\u03bc\u03cc\u03c2 \u03bf\u03bd\u03cc\u03bc\u03b1\u03c4\u03bf\u03c2 \u03c7\u03c1\u03ae\u03c3\u03c4\u03b7 \u03ba\u03b1\u03b9 \u03ba\u03c9\u03b4\u03b9\u03ba\u03bf\u03cd \u03c0\u03c1\u03cc\u03c3\u03b2\u03b1\u03c3\u03b7\u03c2 \u03b4\u03b5\u03bd \u03b5\u03af\u03bd\u03b1\u03b9 \u03c3\u03c9\u03c3\u03c4\u03cc\u03c2. \u03a0\u03b1\u03c1\u03b1\u03ba\u03b1\u03bb\u03ce \u03b5\u03bb\u03ad\u03b3\u03be\u03c4\u03b5 \u03c4\u03b7\u03bd \u03bf\u03c1\u03b8\u03cc\u03c4\u03b7\u03c4\u03b1 \u03c4\u03c9\u03bd \u03c3\u03c4\u03bf\u03b9\u03c7\u03b5\u03af\u03c9\u03bd \u03c3\u03b1\u03c2 \u03ba\u03b1\u03b9 \u03c0\u03c1\u03bf\u03c3\u03c0\u03b1\u03b8\u03ae\u03c3\u03c4\u03b5 \u03be\u03b1\u03bd\u03ac." - + "el": "\u039f \u03c3\u03c5\u03bd\u03b4\u03c5\u03b1\u03c3\u03bc\u03cc\u03c2 \u03bf\u03bd\u03cc\u03bc\u03b1\u03c4\u03bf\u03c2 \u03c7\u03c1\u03ae\u03c3\u03c4\u03b7 \u03ba\u03b1\u03b9 \u03ba\u03c9\u03b4\u03b9\u03ba\u03bf\u03cd \u03c0\u03c1\u03cc\u03c3\u03b2\u03b1\u03c3\u03b7\u03c2 \u03b4\u03b5\u03bd \u03b5\u03af\u03bd\u03b1\u03b9 \u03c3\u03c9\u03c3\u03c4\u03cc\u03c2. \u03a0\u03b1\u03c1\u03b1\u03ba\u03b1\u03bb\u03ce \u03b5\u03bb\u03ad\u03b3\u03be\u03c4\u03b5 \u03c4\u03b7\u03bd \u03bf\u03c1\u03b8\u03cc\u03c4\u03b7\u03c4\u03b1 \u03c4\u03c9\u03bd \u03c3\u03c4\u03bf\u03b9\u03c7\u03b5\u03af\u03c9\u03bd \u03c3\u03b1\u03c2 \u03ba\u03b1\u03b9 \u03c0\u03c1\u03bf\u03c3\u03c0\u03b1\u03b8\u03ae\u03c3\u03c4\u03b5 \u03be\u03b1\u03bd\u03ac.", + "zu": "Kungenzeka ukuthi akekho umsebenzisi onegama lomsebenzisi otholiwe, noma iphasiwedi oyinikezile ayilungile. Sicela uhlole igama lomsebenzisi bese uzame futhi.", + "xh": "Kusenokwenzeka akukho msebenzisi unegama lomsebenzisi elinikelweyo ofunyenweyo, okanye iphaswedi oyinikeleyo ayichanekanga. Nceda ujonge igama lomsebenzisi uzame kwakhona." }, "title_RESPONSESTATUSNOSUCCESS": { "no": "Feilmelding mottatt fra innloggingstjenesten", @@ -2082,7 +2204,9 @@ "ru": "\u041e\u0442 \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u0430 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0430 \u043e\u0448\u0438\u0431\u043a\u0430", "eu": "Errore bat jazo da IdP-aren aldetik", "af": "Foutmelding ontvang vanaf die Identiteits Verskaffer", - "el": "\u039b\u03ae\u03c8\u03b7 \u03ba\u03c9\u03b4\u03b9\u03ba\u03bf\u03cd \u03c3\u03c6\u03ac\u03bb\u03bc\u03b1\u03c4\u03bf\u03c2 \u03b1\u03c0\u03cc \u03c4\u03bf\u03bd \u03c0\u03ac\u03c1\u03bf\u03c7\u03bf \u03c4\u03b1\u03c5\u03c4\u03cc\u03c4\u03b7\u03c4\u03b1\u03c2" + "el": "\u039b\u03ae\u03c8\u03b7 \u03ba\u03c9\u03b4\u03b9\u03ba\u03bf\u03cd \u03c3\u03c6\u03ac\u03bb\u03bc\u03b1\u03c4\u03bf\u03c2 \u03b1\u03c0\u03cc \u03c4\u03bf\u03bd \u03c0\u03ac\u03c1\u03bf\u03c7\u03bf \u03c4\u03b1\u03c5\u03c4\u03cc\u03c4\u03b7\u03c4\u03b1\u03c2", + "zu": "Iphutha litholwe ukusuka Kumhlinzeki Kamazisi", + "xh": "Impazamo efunyenwe kuMboneleli Wesazisi" }, "descr_RESPONSESTATUSNOSUCCESS": { "no": "Innloggingstjenesten svarte med en feilmelding. (Statuskoden i SAML-svaret var noe annet enn OK)", @@ -2117,7 +2241,9 @@ "ru": "\u041f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0441\u043e\u043e\u0431\u0449\u0430\u0435\u0442 \u043e\u0431 \u043e\u0448\u0438\u0431\u043a\u0435. (\u041a\u043e\u0434 \u0441\u0442\u0430\u0442\u0443\u0441 \u0432 \u043e\u0442\u043a\u043b\u0438\u043a\u0435 SAML \u0441\u043e\u043e\u0431\u0449\u0430\u0435\u0442 \u043e \u043d\u0435\u0443\u0441\u043f\u0435\u0448\u043d\u043e\u0439 \u043f\u043e\u043f\u044b\u0442\u043a\u0435)", "eu": "Idp-ak errore batekin erantzun dio eskaerari. (SAML erantzunean egoera kodea ez da arrakastatsua izan)", "af": "Die Identiteits Verskaffer reageer met 'n fout. (Die status kode in die SAML reaksie was onsuksesvol)", - "el": "\u039f \u03ba\u03c9\u03b4\u03b9\u03ba\u03cc\u03c2 \u03ba\u03b1\u03c4\u03ac\u03c3\u03c4\u03b1\u03c3\u03b7\u03c2 \u03c0\u03bf\u03c5 \u03c0\u03b5\u03c1\u03b9\u03ad\u03c7\u03b5\u03b9 \u03b7 \u03b1\u03c0\u03ac\u03bd\u03c4\u03b7\u03c3\u03b7 \u03c4\u03bf\u03c5 \u03c0\u03b1\u03c1\u03cc\u03c7\u03bf\u03c5 \u03c4\u03b1\u03c5\u03c4\u03cc\u03c4\u03b7\u03c4\u03b1\u03c2 \u03c5\u03c0\u03bf\u03b4\u03b5\u03b9\u03ba\u03bd\u03cd\u03b5\u03b9 \u03c3\u03c6\u03ac\u03bb\u03bc\u03b1." + "el": "\u039f \u03ba\u03c9\u03b4\u03b9\u03ba\u03cc\u03c2 \u03ba\u03b1\u03c4\u03ac\u03c3\u03c4\u03b1\u03c3\u03b7\u03c2 \u03c0\u03bf\u03c5 \u03c0\u03b5\u03c1\u03b9\u03ad\u03c7\u03b5\u03b9 \u03b7 \u03b1\u03c0\u03ac\u03bd\u03c4\u03b7\u03c3\u03b7 \u03c4\u03bf\u03c5 \u03c0\u03b1\u03c1\u03cc\u03c7\u03bf\u03c5 \u03c4\u03b1\u03c5\u03c4\u03cc\u03c4\u03b7\u03c4\u03b1\u03c2 \u03c5\u03c0\u03bf\u03b4\u03b5\u03b9\u03ba\u03bd\u03cd\u03b5\u03b9 \u03c3\u03c6\u03ac\u03bb\u03bc\u03b1.", + "xh": "Umboneleli Wesazisi uphendule ngempazamo. (Ikhowudi yobume kwiMpendulo ye-SAML ayiphumelelanga)", + "zu": "Umhlinzeki Womazisi uphendule ngephutha. (Ikhodi yesimo Sempendulo ye-SAML ayizange iphumelele)" }, "title_NOCERT": { "fr": "Aucun certificat pr\u00e9sent\u00e9", @@ -2150,7 +2276,9 @@ "eu": "Ziurtagiri gabe", "fi": "Ei sertifikaattia", "af": "Geen sertifikaat", - "el": "\u0394\u03b5\u03bd \u03c5\u03c0\u03ac\u03c1\u03c7\u03b5\u03b9 \u03c0\u03b9\u03c3\u03c4\u03bf\u03c0\u03bf\u03b9\u03b7\u03c4\u03b9\u03ba\u03cc" + "el": "\u0394\u03b5\u03bd \u03c5\u03c0\u03ac\u03c1\u03c7\u03b5\u03b9 \u03c0\u03b9\u03c3\u03c4\u03bf\u03c0\u03bf\u03b9\u03b7\u03c4\u03b9\u03ba\u03cc", + "xh": "Akukho satifikethi", + "zu": "Asikho isitifiketi" }, "descr_NOCERT": { "fr": "\u00c9chec de l'authentification : votre navigateur n'a pas pr\u00e9sent\u00e9 de certificat", @@ -2182,7 +2310,9 @@ "ru": "\u041e\u0448\u0438\u0431\u043a\u0430 \u043f\u0440\u0438 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438: \u0432\u0430\u0448 \u0431\u0440\u0430\u0443\u0437\u0435\u0440 \u043d\u0435 \u0432\u044b\u0441\u043b\u0430\u043b \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442", "eu": "Kautotze okerra: zure nabigatzaileak ez du bidali ziurtagiririk ", "af": "Verifikasie het misluk: Jou webblaaier het geen sertifikaat gestuur nie", - "el": "\u0397 \u03c4\u03b1\u03c5\u03c4\u03bf\u03c0\u03bf\u03af\u03b7\u03c3\u03b7 \u03b1\u03c0\u03ad\u03c4\u03c5\u03c7\u03b5: \u03a4\u03bf \u03c0\u03c1\u03cc\u03b3\u03c1\u03b1\u03bc\u03bc\u03b1 \u03c0\u03b5\u03c1\u03b9\u03ae\u03b3\u03b7\u03c3\u03b7\u03c2 \u03b9\u03c3\u03c4\u03bf\u03cd \u03c0\u03bf\u03c5 \u03c7\u03c1\u03b7\u03c3\u03b9\u03bc\u03bf\u03c0\u03bf\u03b9\u03b5\u03af\u03c4\u03b5 \u03b4\u03b5\u03bd \u03ad\u03c3\u03c4\u03b5\u03b9\u03bb\u03b5 \u03c0\u03b9\u03c3\u03c4\u03bf\u03c0\u03bf\u03b9\u03b7\u03c4\u03b9\u03ba\u03cc." + "el": "\u0397 \u03c4\u03b1\u03c5\u03c4\u03bf\u03c0\u03bf\u03af\u03b7\u03c3\u03b7 \u03b1\u03c0\u03ad\u03c4\u03c5\u03c7\u03b5: \u03a4\u03bf \u03c0\u03c1\u03cc\u03b3\u03c1\u03b1\u03bc\u03bc\u03b1 \u03c0\u03b5\u03c1\u03b9\u03ae\u03b3\u03b7\u03c3\u03b7\u03c2 \u03b9\u03c3\u03c4\u03bf\u03cd \u03c0\u03bf\u03c5 \u03c7\u03c1\u03b7\u03c3\u03b9\u03bc\u03bf\u03c0\u03bf\u03b9\u03b5\u03af\u03c4\u03b5 \u03b4\u03b5\u03bd \u03ad\u03c3\u03c4\u03b5\u03b9\u03bb\u03b5 \u03c0\u03b9\u03c3\u03c4\u03bf\u03c0\u03bf\u03b9\u03b7\u03c4\u03b9\u03ba\u03cc.", + "zu": "Ukuqinisekisa kuhlulekile: isiphequluli sakho asizange sithumele noma yisiphi isitifiketi", + "xh": "Ungqinisiso lusilele: ibhrawuza yakho ayithumelanga nasiphi na isatifikethi" }, "title_INVALIDCERT": { "fr": "Certificat invalide", @@ -2215,7 +2345,9 @@ "eu": "Ziurtagiri baliogabea", "fi": "Virheellinen sertifikaatti", "af": "Ongeldige sertifikaat", - "el": "\u039c\u03b7 \u03ad\u03b3\u03ba\u03c5\u03c1\u03bf \u03c0\u03b9\u03c3\u03c4\u03bf\u03c0\u03bf\u03b9\u03b7\u03c4\u03b9\u03ba\u03cc" + "el": "\u039c\u03b7 \u03ad\u03b3\u03ba\u03c5\u03c1\u03bf \u03c0\u03b9\u03c3\u03c4\u03bf\u03c0\u03bf\u03b9\u03b7\u03c4\u03b9\u03ba\u03cc", + "xh": "Isatifikethi esingasebenziyo", + "zu": "Isifiketi esingalungile" }, "descr_INVALIDCERT": { "fr": "\u00c9chec de l'authentification : le certificat pr\u00e9sent\u00e9 par votre navigateur est invalide ou illisible", @@ -2247,7 +2379,9 @@ "ru": "\u041e\u0448\u0438\u0431\u043a\u0430 \u043f\u0440\u0438 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438: \u0432\u0430\u0448 \u0431\u0440\u0430\u0443\u0437\u0435\u0440 \u0432\u044b\u0441\u043b\u0430\u043b \u043d\u0435\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0438\u043b\u0438 \u043d\u0435\u0447\u0438\u0442\u0430\u0435\u043c\u044b\u0439 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442", "eu": "Kautotze okerra: Zure nabigatzaileak bidalitako ziurtagiria baliogabea da edo ezin da irakurri", "af": "Verifikasie het misluk: Jou webblaaier het 'n ongeldige of korrupte sertifikaat gestuur", - "el": "\u0397 \u03c4\u03b1\u03c5\u03c4\u03bf\u03c0\u03bf\u03af\u03b7\u03c3\u03b7 \u03b1\u03c0\u03ad\u03c4\u03c5\u03c7\u03b5: \u03a4\u03bf \u03c0\u03b9\u03c3\u03c4\u03bf\u03c0\u03bf\u03b9\u03b7\u03c4\u03b9\u03ba\u03cc \u03c0\u03bf\u03c5 \u03ad\u03c3\u03c4\u03b5\u03b9\u03bb\u03b5 \u03c4\u03bf \u03c0\u03c1\u03cc\u03b3\u03c1\u03b1\u03bc\u03bc\u03b1 \u03c0\u03b5\u03c1\u03b9\u03ae\u03b3\u03b7\u03c3\u03b7\u03c2 \u03b9\u03c3\u03c4\u03bf\u03cd \u03c0\u03bf\u03c5 \u03c7\u03c1\u03b7\u03c3\u03b9\u03bc\u03bf\u03c0\u03bf\u03b9\u03b5\u03af\u03c4\u03b5 \u03b4\u03b5\u03bd \u03b5\u03af\u03bd\u03b1\u03b9 \u03ad\u03b3\u03ba\u03c5\u03c1\u03bf \u03ae \u03b4\u03b5\u03bd \u03ae\u03c4\u03b1\u03bd \u03b4\u03c5\u03bd\u03b1\u03c4\u03ae \u03b7 \u03b1\u03bd\u03ac\u03b3\u03bd\u03c9\u03c3\u03ae \u03c4\u03bf\u03c5." + "el": "\u0397 \u03c4\u03b1\u03c5\u03c4\u03bf\u03c0\u03bf\u03af\u03b7\u03c3\u03b7 \u03b1\u03c0\u03ad\u03c4\u03c5\u03c7\u03b5: \u03a4\u03bf \u03c0\u03b9\u03c3\u03c4\u03bf\u03c0\u03bf\u03b9\u03b7\u03c4\u03b9\u03ba\u03cc \u03c0\u03bf\u03c5 \u03ad\u03c3\u03c4\u03b5\u03b9\u03bb\u03b5 \u03c4\u03bf \u03c0\u03c1\u03cc\u03b3\u03c1\u03b1\u03bc\u03bc\u03b1 \u03c0\u03b5\u03c1\u03b9\u03ae\u03b3\u03b7\u03c3\u03b7\u03c2 \u03b9\u03c3\u03c4\u03bf\u03cd \u03c0\u03bf\u03c5 \u03c7\u03c1\u03b7\u03c3\u03b9\u03bc\u03bf\u03c0\u03bf\u03b9\u03b5\u03af\u03c4\u03b5 \u03b4\u03b5\u03bd \u03b5\u03af\u03bd\u03b1\u03b9 \u03ad\u03b3\u03ba\u03c5\u03c1\u03bf \u03ae \u03b4\u03b5\u03bd \u03ae\u03c4\u03b1\u03bd \u03b4\u03c5\u03bd\u03b1\u03c4\u03ae \u03b7 \u03b1\u03bd\u03ac\u03b3\u03bd\u03c9\u03c3\u03ae \u03c4\u03bf\u03c5.", + "xh": "Ungqinisiso lusilele: isatifikethi esithunyelwe yibhrawuza yakho asisebenzi okanye asikwazi ukufundwa", + "zu": "Ukuqinisekisa kuhlulekile: isitifiketi esithunyelwe isiphequluli sakho asivumelekile noma asikwazi ukufundwa" }, "title_UNKNOWNCERT": { "fr": "Certificat inconnu", @@ -2280,7 +2414,9 @@ "eu": "Ziurtagiri ezezaguna", "fi": "Tuntematon sertifikaatti", "af": "Onbekende sertifikaat", - "el": "\u0386\u03b3\u03bd\u03c9\u03c3\u03c4\u03bf \u03c0\u03b9\u03c3\u03c4\u03bf\u03c0\u03bf\u03b9\u03b7\u03c4\u03b9\u03ba\u03cc" + "el": "\u0386\u03b3\u03bd\u03c9\u03c3\u03c4\u03bf \u03c0\u03b9\u03c3\u03c4\u03bf\u03c0\u03bf\u03b9\u03b7\u03c4\u03b9\u03ba\u03cc", + "zu": "Isitifiketi esingaziwa", + "xh": "Isatifikethi esingaziwayo" }, "descr_UNKNOWNCERT": { "fr": "\u00c9chec de l'authentification : le certificat pr\u00e9sent\u00e9 par votre navigateur n'est pas connu", @@ -2312,7 +2448,9 @@ "ru": "\u041e\u0448\u0438\u0431\u043a\u0430 \u043f\u0440\u0438 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438: \u0432\u0430\u0448 \u0431\u0440\u0430\u0443\u0437\u0435\u0440 \u0432\u044b\u0441\u043b\u0430\u043b \u043d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0439 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442", "eu": "Kautotze okerra: zure nabigatzaileak bidalitako ziurtagiria ezezaguna da", "af": "Verifikasie het misluk: die sertifikaat wat jou webblaaier gestuur het is onbekend", - "el": "\u0397 \u03c4\u03b1\u03c5\u03c4\u03bf\u03c0\u03bf\u03af\u03b7\u03c3\u03b7 \u03b1\u03c0\u03ad\u03c4\u03c5\u03c7\u03b5: \u03a4\u03bf \u03c0\u03b9\u03c3\u03c4\u03bf\u03c0\u03bf\u03b9\u03b7\u03c4\u03b9\u03ba\u03cc \u03c0\u03bf\u03c5 \u03ad\u03c3\u03c4\u03b5\u03b9\u03bb\u03b5 \u03c4\u03bf \u03c0\u03c1\u03cc\u03b3\u03c1\u03b1\u03bc\u03bc\u03b1 \u03c0\u03b5\u03c1\u03b9\u03ae\u03b3\u03b7\u03c3\u03b7\u03c2 \u03b9\u03c3\u03c4\u03bf\u03cd \u03c0\u03bf\u03c5 \u03c7\u03c1\u03b7\u03c3\u03b9\u03bc\u03bf\u03c0\u03bf\u03b9\u03b5\u03af\u03c4\u03b5 \u03b4\u03b5\u03bd \u03ae\u03c4\u03b1\u03bd \u03b4\u03c5\u03bd\u03b1\u03c4\u03cc \u03bd\u03b1 \u03b1\u03bd\u03b1\u03b3\u03bd\u03c9\u03c1\u03b9\u03c3\u03c4\u03b5\u03af." + "el": "\u0397 \u03c4\u03b1\u03c5\u03c4\u03bf\u03c0\u03bf\u03af\u03b7\u03c3\u03b7 \u03b1\u03c0\u03ad\u03c4\u03c5\u03c7\u03b5: \u03a4\u03bf \u03c0\u03b9\u03c3\u03c4\u03bf\u03c0\u03bf\u03b9\u03b7\u03c4\u03b9\u03ba\u03cc \u03c0\u03bf\u03c5 \u03ad\u03c3\u03c4\u03b5\u03b9\u03bb\u03b5 \u03c4\u03bf \u03c0\u03c1\u03cc\u03b3\u03c1\u03b1\u03bc\u03bc\u03b1 \u03c0\u03b5\u03c1\u03b9\u03ae\u03b3\u03b7\u03c3\u03b7\u03c2 \u03b9\u03c3\u03c4\u03bf\u03cd \u03c0\u03bf\u03c5 \u03c7\u03c1\u03b7\u03c3\u03b9\u03bc\u03bf\u03c0\u03bf\u03b9\u03b5\u03af\u03c4\u03b5 \u03b4\u03b5\u03bd \u03ae\u03c4\u03b1\u03bd \u03b4\u03c5\u03bd\u03b1\u03c4\u03cc \u03bd\u03b1 \u03b1\u03bd\u03b1\u03b3\u03bd\u03c9\u03c1\u03b9\u03c3\u03c4\u03b5\u03af.", + "zu": "Ukuqinisekisa kuhlulekile: isitifiketi esithunyelwe isiphequluli sakho asaziwa", + "xh": "Ungqinisiso lusilele: isatifikerthi esithunyelwe yibhrawuza yakho asaziwa" }, "title_USERABORTED": { "da": "Autentificering aubrudt", @@ -2344,7 +2482,9 @@ "ru": "\u0410\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f \u043f\u0440\u0435\u0440\u0432\u0430\u043d\u0430", "eu": "Kautotzea bertan behera utzia", "af": "Verifikasie gestop", - "el": "\u0397 \u03c4\u03b1\u03c5\u03c4\u03bf\u03c0\u03bf\u03af\u03b7\u03c3\u03b7 \u03bc\u03b1\u03c4\u03b1\u03b9\u03ce\u03b8\u03b7\u03ba\u03b5" + "el": "\u0397 \u03c4\u03b1\u03c5\u03c4\u03bf\u03c0\u03bf\u03af\u03b7\u03c3\u03b7 \u03bc\u03b1\u03c4\u03b1\u03b9\u03ce\u03b8\u03b7\u03ba\u03b5", + "zu": "Ukuqinisekisa kuyekisiwe", + "xh": "Ungqinisiso luyekiwe" }, "descr_USERABORTED": { "da": "Autentificering blev afbrudt af brugeren", @@ -2376,7 +2516,9 @@ "ru": "\u0410\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f \u043f\u0440\u0435\u0440\u0432\u0430\u043d\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c", "eu": "Kautotzea bertan behera utzi du erabiltzaileak", "af": "Die verifikasie is gestop deur die gebruiker", - "el": "\u0397 \u03c4\u03b1\u03c5\u03c4\u03bf\u03c0\u03bf\u03af\u03b7\u03c3\u03b7 \u03bc\u03b1\u03c4\u03b1\u03b9\u03ce\u03b8\u03b7\u03ba\u03b5 \u03b1\u03c0\u03cc \u03c4\u03bf\u03bd \u03c7\u03c1\u03ae\u03c3\u03c4\u03b7." + "el": "\u0397 \u03c4\u03b1\u03c5\u03c4\u03bf\u03c0\u03bf\u03af\u03b7\u03c3\u03b7 \u03bc\u03b1\u03c4\u03b1\u03b9\u03ce\u03b8\u03b7\u03ba\u03b5 \u03b1\u03c0\u03cc \u03c4\u03bf\u03bd \u03c7\u03c1\u03ae\u03c3\u03c4\u03b7.", + "zu": "Ukuqinisekisa kuyekiswe umsebenzisi", + "xh": "Ungqinisiso luyekiswe ngumsebenzisi" }, "title_NOSTATE": { "da": "State information tabt", @@ -2408,7 +2550,9 @@ "eu": "Egoera informazioa galdua", "af": "Toestandsinformasie verlore", "pt-br": "Informa\u00e7\u00f5es de estado perdidas", - "el": "\u0394\u03b5\u03bd \u03b2\u03c1\u03ad\u03b8\u03b7\u03ba\u03b1\u03bd \u03c0\u03bb\u03b7\u03c1\u03bf\u03c6\u03bf\u03c1\u03af\u03b5\u03c2 \u03c3\u03c7\u03b5\u03c4\u03b9\u03ba\u03ac \u03bc\u03b5 \u03c4\u03b7\u03bd \u03ba\u03b1\u03c4\u03ac\u03c3\u03c4\u03b1\u03c3\u03b7 \u03c4\u03bf\u03c5 \u03b1\u03b9\u03c4\u03ae\u03bc\u03b1\u03c4\u03bf\u03c2" + "el": "\u0394\u03b5\u03bd \u03b2\u03c1\u03ad\u03b8\u03b7\u03ba\u03b1\u03bd \u03c0\u03bb\u03b7\u03c1\u03bf\u03c6\u03bf\u03c1\u03af\u03b5\u03c2 \u03c3\u03c7\u03b5\u03c4\u03b9\u03ba\u03ac \u03bc\u03b5 \u03c4\u03b7\u03bd \u03ba\u03b1\u03c4\u03ac\u03c3\u03c4\u03b1\u03c3\u03b7 \u03c4\u03bf\u03c5 \u03b1\u03b9\u03c4\u03ae\u03bc\u03b1\u03c4\u03bf\u03c2", + "xh": "Inkcazelo yobume ilahlekile", + "zu": "Ulwazi lwesifunda lulahlekile" }, "descr_NOSTATE": { "da": "State information er tabt og der er ikke muligt at gentage forsp\u00f8rgelsen", @@ -2440,7 +2584,9 @@ "eu": "Egoera informazioa galdua eta ez dago modurik eskaera berrabiarazteko", "af": "Toestandsinformasie verlore en daar is geen manier om die versoek weer te stuur nie", "pt-br": "Informa\u00e7\u00f5es de estado perdidas, e n\u00e3o \u00e9 poss\u00edvel reiniciar a requisi\u00e7\u00e3o", - "el": "\u0394\u03b5\u03bd \u03ae\u03c4\u03b1\u03bd \u03b4\u03c5\u03bd\u03b1\u03c4\u03cc \u03bd\u03b1 \u03b5\u03be\u03c5\u03c0\u03b7\u03c1\u03b5\u03c4\u03b7\u03b8\u03b5\u03af \u03c4\u03bf \u03b1\u03af\u03c4\u03b7\u03bc\u03ac \u03c3\u03b1\u03c2 \u03ba\u03b1\u03b8\u03ce\u03c2 \u03b4\u03b5\u03bd \u03b2\u03c1\u03ad\u03b8\u03b7\u03ba\u03b1\u03bd \u03c0\u03bb\u03b7\u03c1\u03bf\u03c6\u03bf\u03c1\u03af\u03b5\u03c2 \u03c3\u03c7\u03b5\u03c4\u03b9\u03ba\u03ac \u03bc\u03b5 \u03c4\u03b7\u03bd \u03ba\u03b1\u03c4\u03ac\u03c3\u03c4\u03b1\u03c3\u03ae \u03c4\u03bf\u03c5" + "el": "\u0394\u03b5\u03bd \u03ae\u03c4\u03b1\u03bd \u03b4\u03c5\u03bd\u03b1\u03c4\u03cc \u03bd\u03b1 \u03b5\u03be\u03c5\u03c0\u03b7\u03c1\u03b5\u03c4\u03b7\u03b8\u03b5\u03af \u03c4\u03bf \u03b1\u03af\u03c4\u03b7\u03bc\u03ac \u03c3\u03b1\u03c2 \u03ba\u03b1\u03b8\u03ce\u03c2 \u03b4\u03b5\u03bd \u03b2\u03c1\u03ad\u03b8\u03b7\u03ba\u03b1\u03bd \u03c0\u03bb\u03b7\u03c1\u03bf\u03c6\u03bf\u03c1\u03af\u03b5\u03c2 \u03c3\u03c7\u03b5\u03c4\u03b9\u03ba\u03ac \u03bc\u03b5 \u03c4\u03b7\u03bd \u03ba\u03b1\u03c4\u03ac\u03c3\u03c4\u03b1\u03c3\u03ae \u03c4\u03bf\u03c5", + "xh": "Inkcazelo yobume ilahlekile, yaye akukho ndlela yokuqalisa isicelo", + "zu": "Ulwazi lwesifunda lulahlekile, futhi ayikho indlela yokuqala kabusha isicelo" }, "title_METADATANOTFOUND": { "da": "Metadata ikke fundet", @@ -2472,7 +2618,9 @@ "eu": "Ez dira metadatuak aurkitu", "af": "Metadata nie gevind nie", "pt-br": "Metadado n\u00e3o encontrado", - "el": "\u0394\u03b5\u03bd \u03b2\u03c1\u03ad\u03b8\u03b7\u03ba\u03b1\u03bd \u03bc\u03b5\u03c4\u03b1\u03b4\u03b5\u03b4\u03bf\u03bc\u03ad\u03bd\u03b1" + "el": "\u0394\u03b5\u03bd \u03b2\u03c1\u03ad\u03b8\u03b7\u03ba\u03b1\u03bd \u03bc\u03b5\u03c4\u03b1\u03b4\u03b5\u03b4\u03bf\u03bc\u03ad\u03bd\u03b1", + "zu": "Imethadatha ayitholakalanga", + "xh": "Imetadata ayifunyenwanga" }, "descr_METADATANOTFOUND": { "da": "Kan ikke finde metadata for %ENTITYID%", @@ -2504,7 +2652,9 @@ "eu": "Ezin da aurkitu metadaturik %ENTITYID%-(a)rentzat", "af": "Kan geen metadata vind vir %ENTITYID%", "pt-br": "N\u00e3o foi poss\u00edvel localizar os metadados de %ENTITYID%", - "el": "\u0394\u03b5\u03bd \u03ae\u03c4\u03b1\u03bd \u03b4\u03c5\u03bd\u03b1\u03c4\u03cc \u03bd\u03b1 \u03b2\u03c1\u03b5\u03b8\u03bf\u03cd\u03bd \u03bc\u03b5\u03c4\u03b1\u03b4\u03b5\u03b4\u03bf\u03bc\u03ad\u03bd\u03b1 \u03b3\u03b9\u03b1 \u03c4\u03b7\u03bd \u03bf\u03bd\u03c4\u03cc\u03c4\u03b7\u03c4\u03b1 %ENTITYID%" + "el": "\u0394\u03b5\u03bd \u03ae\u03c4\u03b1\u03bd \u03b4\u03c5\u03bd\u03b1\u03c4\u03cc \u03bd\u03b1 \u03b2\u03c1\u03b5\u03b8\u03bf\u03cd\u03bd \u03bc\u03b5\u03c4\u03b1\u03b4\u03b5\u03b4\u03bf\u03bc\u03ad\u03bd\u03b1 \u03b3\u03b9\u03b1 \u03c4\u03b7\u03bd \u03bf\u03bd\u03c4\u03cc\u03c4\u03b7\u03c4\u03b1 %ENTITYID%", + "xh": "Ayikwazi ukufumana iimpawu-ngcaciso zefayile ze-%ENTITYID%", + "zu": "Ayikwazi ukuthola imethadatha yokuthi %ENTITYID%" }, "title_AUTHSOURCEERROR": { "hr": "Gre\u0161ka u autentifikacijskom modulu", @@ -2536,7 +2686,9 @@ "eu": "Errorea kautotze jatorrian", "af": "Fout in verifikasie bron", "pt-br": "Erro na fonte de autentica\u00e7\u00e3o", - "el": "\u03a3\u03c6\u03ac\u03bb\u03bc\u03b1 \u03bc\u03b5 \u03c4\u03b7\u03bd \u03c0\u03b7\u03b3\u03ae \u03c4\u03b1\u03c5\u03c4\u03bf\u03c0\u03bf\u03af\u03b7\u03c3\u03b7\u03c2" + "el": "\u03a3\u03c6\u03ac\u03bb\u03bc\u03b1 \u03bc\u03b5 \u03c4\u03b7\u03bd \u03c0\u03b7\u03b3\u03ae \u03c4\u03b1\u03c5\u03c4\u03bf\u03c0\u03bf\u03af\u03b7\u03c3\u03b7\u03c2", + "zu": "Iphutha lomthombo wokuqinisekisa", + "xh": "Impazamo yomthombo wongqinisiso" }, "descr_AUTHSOURCEERROR": { "hr": "Do\u0161lo je do gre\u0161ke u autentifikacijskom modulu %AUTHSOURCE%. Razlog: %REASON%", @@ -2568,14 +2720,20 @@ "eu": "Errorea kautotze jatorrian %AUTHSOURCE%. Arrazoia hau da: %REASON%", "af": "Fout in verifikasie bron %AUTHSOURCE%. Die rede was %REASON%", "pt-br": "Erro de autentica\u00e7\u00e3o na origem %AUTHSOURCE%. O motivo foi:%REASON%", - "el": "\u03a0\u03b1\u03c1\u03bf\u03c5\u03c3\u03b9\u03ac\u03c3\u03c4\u03b7\u03ba\u03b5 \u03c3\u03c6\u03ac\u03bb\u03bc\u03b1 \u03ba\u03b1\u03c4\u03ac \u03c4\u03b7\u03bd \u03b5\u03c0\u03b9\u03ba\u03bf\u03b9\u03bd\u03c9\u03bd\u03af\u03b1 \u03bc\u03b5 \u03c4\u03b7\u03bd \u03c0\u03b7\u03b3\u03ae \u03c4\u03b1\u03c5\u03c4\u03bf\u03c0\u03bf\u03af\u03b7\u03c3\u03b7\u03c2 %AUTHSOURCE%: %REASON%" + "el": "\u03a0\u03b1\u03c1\u03bf\u03c5\u03c3\u03b9\u03ac\u03c3\u03c4\u03b7\u03ba\u03b5 \u03c3\u03c6\u03ac\u03bb\u03bc\u03b1 \u03ba\u03b1\u03c4\u03ac \u03c4\u03b7\u03bd \u03b5\u03c0\u03b9\u03ba\u03bf\u03b9\u03bd\u03c9\u03bd\u03af\u03b1 \u03bc\u03b5 \u03c4\u03b7\u03bd \u03c0\u03b7\u03b3\u03ae \u03c4\u03b1\u03c5\u03c4\u03bf\u03c0\u03bf\u03af\u03b7\u03c3\u03b7\u03c2 %AUTHSOURCE%: %REASON%", + "zu": "Iphutha lokuqinisekisa kumthombo othi %AUTHSOURCE%. Isizathu besithi: %REASON%", + "xh": "Impazamo yongqinisiso kumthombo %AUTHSOURCE%. Isizathu sesi: %REASON%" }, "title_MEMCACHEDOWN": { "zh-tw": "\u7121\u6cd5\u53d6\u5f97\u9023\u7dda Session \u8cc7\u8a0a", - "el": "\u0394\u03b5\u03bd \u03b5\u03af\u03bd\u03b1\u03b9 \u03b4\u03c5\u03bd\u03b1\u03c4\u03ae \u03b7 \u03b1\u03bd\u03ac\u03ba\u03c4\u03b7\u03c3\u03b7 \u03b4\u03b5\u03b4\u03bf\u03bc\u03ad\u03bd\u03c9\u03bd \u03c3\u03c5\u03bd\u03b5\u03b4\u03c1\u03af\u03b1\u03c2" + "el": "\u0394\u03b5\u03bd \u03b5\u03af\u03bd\u03b1\u03b9 \u03b4\u03c5\u03bd\u03b1\u03c4\u03ae \u03b7 \u03b1\u03bd\u03ac\u03ba\u03c4\u03b7\u03c3\u03b7 \u03b4\u03b5\u03b4\u03bf\u03bc\u03ad\u03bd\u03c9\u03bd \u03c3\u03c5\u03bd\u03b5\u03b4\u03c1\u03af\u03b1\u03c2", + "xh": "Ayikwazi ukubuyisela ingcombolo yeseshoni", + "zu": "Ayikwazi ukubuyisela idatha yeseshini" }, "descr_MEMCACHEDOWN": { "zh-tw": "\u60a8\u7684\u9023\u7dda Session \u8cc7\u8a0a\u56e0\u70ba\u6280\u8853\u56f0\u96e3\u73fe\u5728\u7121\u6cd5\u53d6\u5f97\uff0c\u8acb\u7a0d\u5f85\u5e7e\u5206\u9418\u5f8c\u518d\u91cd\u8a66", - "el": "\u0394\u03b5\u03bd \u03b5\u03af\u03bd\u03b1\u03b9 \u03b4\u03c5\u03bd\u03b1\u03c4\u03ae \u03b7 \u03b1\u03bd\u03ac\u03ba\u03c4\u03b7\u03c3\u03b7 \u03b4\u03b5\u03b4\u03bf\u03bc\u03ad\u03bd\u03c9\u03bd \u03c3\u03c5\u03bd\u03b5\u03b4\u03c1\u03af\u03b1\u03c2 \u03bb\u03cc\u03b3\u03c9 \u03c4\u03b5\u03c7\u03bd\u03b9\u03ba\u03ce\u03bd \u03b4\u03c5\u03c3\u03ba\u03bf\u03bb\u03b9\u03ce\u03bd. \u03a0\u03b1\u03c1\u03b1\u03ba\u03b1\u03bb\u03bf\u03cd\u03bc\u03b5 \u03b4\u03bf\u03ba\u03b9\u03bc\u03ac\u03c3\u03c4\u03b5 \u03be\u03b1\u03bd\u03ac \u03b1\u03c1\u03b3\u03cc\u03c4\u03b5\u03c1\u03b1" + "el": "\u0394\u03b5\u03bd \u03b5\u03af\u03bd\u03b1\u03b9 \u03b4\u03c5\u03bd\u03b1\u03c4\u03ae \u03b7 \u03b1\u03bd\u03ac\u03ba\u03c4\u03b7\u03c3\u03b7 \u03b4\u03b5\u03b4\u03bf\u03bc\u03ad\u03bd\u03c9\u03bd \u03c3\u03c5\u03bd\u03b5\u03b4\u03c1\u03af\u03b1\u03c2 \u03bb\u03cc\u03b3\u03c9 \u03c4\u03b5\u03c7\u03bd\u03b9\u03ba\u03ce\u03bd \u03b4\u03c5\u03c3\u03ba\u03bf\u03bb\u03b9\u03ce\u03bd. \u03a0\u03b1\u03c1\u03b1\u03ba\u03b1\u03bb\u03bf\u03cd\u03bc\u03b5 \u03b4\u03bf\u03ba\u03b9\u03bc\u03ac\u03c3\u03c4\u03b5 \u03be\u03b1\u03bd\u03ac \u03b1\u03c1\u03b3\u03cc\u03c4\u03b5\u03c1\u03b1", + "zu": "Idatha yeseshini yakho ayikwazi ukubuyiswa njengamanje ngenxa yezinkinga zobuchwepheshe. Sicela uzame futhi emizuzwini embalwa.", + "xh": "Ingcombolo yeseshoni yakho ayikwazi ukubuyiselwa okwangoku ngenxa yeengxaki zobugcisa. Nceda uzame kwakhona kwimizuzu embalwa." } } diff --git a/vendor/simplesamlphp/simplesamlphp/dictionaries/general.translation.json b/vendor/simplesamlphp/simplesamlphp/dictionaries/general.translation.json index 8d36241bce..299ea9f16c 100644 --- a/vendor/simplesamlphp/simplesamlphp/dictionaries/general.translation.json +++ b/vendor/simplesamlphp/simplesamlphp/dictionaries/general.translation.json @@ -33,7 +33,9 @@ "ro": "Da", "eu": "Bai", "af": "Ja", - "el": "\u039d\u03b1\u03af" + "el": "\u039d\u03b1\u03af", + "zu": "Yebo", + "xh": "Ewe" }, "no": { "no": "Nei", @@ -69,13 +71,15 @@ "ro": "Nu", "eu": "Ez", "af": "Nee", - "el": "\u038c\u03c7\u03b9" + "el": "\u038c\u03c7\u03b9", + "xh": "Hayi", + "zu": "Cha" }, "remember": { "no": "Godta ogs\u00e5 for fremtiden", "nn": "Godta ogs\u00e5 for framtida", "sv": "Spara samtycke", - "es": "Recordar el consentimiento", + "es": "Recordar", "fr": "Se souvenir du consentement", "de": "Zustimmung merken", "nl": "Bewaar toestemming", @@ -105,13 +109,15 @@ "ro": "\u021aine minte", "eu": "Onespena gogoratu", "af": "Onthou", - "el": "\u039d\u03b1 \u03b8\u03c5\u03bc\u03ac\u03c3\u03b1\u03b9 \u03c4\u03b7\u03bd \u03b5\u03c0\u03b9\u03bb\u03bf\u03b3\u03ae \u03bc\u03bf\u03c5" + "el": "\u039d\u03b1 \u03b8\u03c5\u03bc\u03ac\u03c3\u03b1\u03b9 \u03c4\u03b7\u03bd \u03b5\u03c0\u03b9\u03bb\u03bf\u03b3\u03ae \u03bc\u03bf\u03c5", + "zu": "Khumbula", + "xh": "Khumbula" }, "yes_continue": { "no": "Ja, fortsett", "nn": "Ja, fortsett", "sv": "Ja", - "es": "S\u00ed", + "es": "S\u00ed, continuar", "fr": "Oui", "de": "Ja, ich stimme zu", "nl": "Ja, ik ga akkoord", @@ -141,13 +147,15 @@ "ro": "Da, continu\u0103", "eu": "Bai, jarraitu", "af": "Ja, voortgaan", - "el": "\u0391\u03c0\u03bf\u03b4\u03bf\u03c7\u03ae" + "el": "\u0391\u03c0\u03bf\u03b4\u03bf\u03c7\u03ae", + "xh": "Ewe, qhubeka", + "zu": "Yebo, qhubeka" }, "no_cancel": { "no": "Nei, avbryt", "nn": "Nei, avbryt", "sv": "Nej", - "es": "No", + "es": "No, cancelar", "fr": "Non", "de": "Nein, ich stimme nicht zu", "nl": "Nee, ik weiger", @@ -177,7 +185,9 @@ "ro": "Nu, renun\u021b", "eu": "Ez, utzi", "af": "Nee, kanselleer", - "el": "\u0391\u03c0\u03cc\u03c1\u03c1\u03b9\u03c8\u03b7" + "el": "\u0391\u03c0\u03cc\u03c1\u03c1\u03b9\u03c8\u03b7", + "xh": "Hayi, rhoxisa", + "zu": "Cha, khansela" }, "service_provider": { "no": "Tjenesteleverand\u00f8r", @@ -213,6 +223,8 @@ "ro": "Furnizor de servicii", "eu": "Zerbitzu hornitzailea", "af": "Diens Verskaffer", - "el": "\u03a0\u03ac\u03c1\u03bf\u03c7\u03bf\u03c2 \u03c5\u03c0\u03b7\u03c1\u03b5\u03c3\u03af\u03b1\u03c2" + "el": "\u03a0\u03ac\u03c1\u03bf\u03c7\u03bf\u03c2 \u03c5\u03c0\u03b7\u03c1\u03b5\u03c3\u03af\u03b1\u03c2", + "xh": "Umboneleli Wenkonzo", + "zu": "Umhlinzeki Wesevisi" } } diff --git a/vendor/simplesamlphp/simplesamlphp/dictionaries/login.definition.json b/vendor/simplesamlphp/simplesamlphp/dictionaries/login.definition.json index be3b12d4ed..61e5dddf6c 100644 --- a/vendor/simplesamlphp/simplesamlphp/dictionaries/login.definition.json +++ b/vendor/simplesamlphp/simplesamlphp/dictionaries/login.definition.json @@ -1,68 +1,71 @@ { - "error_header": { - "en": "Error" - }, - "user_pass_header": { - "en": "Enter your username and password" - }, - "user_pass_text": { - "en": "A service has requested you to authenticate yourself. Please enter your username and password in the form below." - }, - "login_button": { - "en": "Login" - }, - "processing": { - "en": "Processing..." - }, - "username": { - "en": "Username" - }, - "organization": { - "en": "Organization" - }, - "password": { - "en": "Password" - }, - "help_header": { - "en": "Help! I don't remember my password." - }, - "help_text": { - "en": "Without your username and password you cannot authenticate yourself for access to the service. There may be someone that can help you. Consult the help desk at your organization!" - }, - "error_nopassword": { - "en": "You sent something to the login page, but for some reason the password was not sent. Try again please." - }, - "error_wrongpassword": { - "en": "Incorrect username or password." - }, - "select_home_org": { - "en": "Choose your home organization" - }, - "next": { - "en": "Next" - }, - "change_home_org_title": { - "en": "Change your home organization" - }, - "change_home_org_text": { - "en": "You have chosen <b>%HOMEORG%<\/b> as your home organization. If this is wrong you may choose another one." - }, - "change_home_org_button": { - "en": "Choose home organization" - }, - "help_desk_link": { - "en": "Help desk homepage" - }, - "help_desk_email": { - "en": "Send e-mail to help desk" - }, - "contact_info": { - "en": "Contact information:" - }, - "remember_username": { - "en": "Remember my username" - }, + "error_header": { + "en": "Error" + }, + "user_pass_header": { + "en": "Enter your username and password" + }, + "user_pass_text": { + "en": "A service has requested you to authenticate yourself. Please enter your username and password in the form below." + }, + "login_button": { + "en": "Login" + }, + "processing": { + "en": "Processing..." + }, + "username": { + "en": "Username" + }, + "organization": { + "en": "Organization" + }, + "password": { + "en": "Password" + }, + "help_header": { + "en": "Help! I don't remember my password." + }, + "help_text": { + "en": "Without your username and password you cannot authenticate yourself for access to the service. There may be someone that can help you. Consult the help desk at your organization!" + }, + "error_nopassword": { + "en": "You sent something to the login page, but for some reason the password was not sent. Try again please." + }, + "error_wrongpassword": { + "en": "Incorrect username or password." + }, + "select_home_org": { + "en": "Choose your home organization" + }, + "next": { + "en": "Next" + }, + "change_home_org_title": { + "en": "Change your home organization" + }, + "change_home_org_text": { + "en": "You have chosen <b>%HOMEORG%<\/b> as your home organization. If this is wrong you may choose another one." + }, + "change_home_org_button": { + "en": "Choose home organization" + }, + "help_desk_link": { + "en": "Help desk homepage" + }, + "help_desk_email": { + "en": "Send e-mail to help desk" + }, + "contact_info": { + "en": "Contact information:" + }, + "remember_username": { + "en": "Remember my username" + }, "remember_me": { "en": "Remember me" + }, + "remember_organization": { + "en": "Remember my organization" } } diff --git a/vendor/simplesamlphp/simplesamlphp/dictionaries/login.translation.json b/vendor/simplesamlphp/simplesamlphp/dictionaries/login.translation.json index ac03e326cc..fd7f860605 100644 --- a/vendor/simplesamlphp/simplesamlphp/dictionaries/login.translation.json +++ b/vendor/simplesamlphp/simplesamlphp/dictionaries/login.translation.json @@ -3,7 +3,7 @@ "no": "Feil", "nn": "Feil", "sv": "Fel", - "es": "Los datos que ha suministrado no son v\u00e1lidos", + "es": "Error", "fr": "Erreur", "de": "Fehler", "nl": "Fout", @@ -32,17 +32,18 @@ "lv": "K\u013c\u016bda", "sr": "Gre\u0161ka", "ro": "Eroare", - "xh": "Imposiso", "af": "Fout", - "el": "\u03a3\u03c6\u03ac\u03bb\u03bc\u03b1" + "el": "\u03a3\u03c6\u03ac\u03bb\u03bc\u03b1", + "zu": "Iphutha", + "xh": "Impazamo" }, "user_pass_header": { "no": "Skriv inn brukernavn og passord", "nn": "Skriv inn brukarnamn og passord", "sv": "Ange ditt anv\u00e4ndarnamn och l\u00f6senord", - "es": "Indique su nombre de usuario y clave de acceso", + "es": "Introduzca su nombre de usuario y contrase\u00f1a", "fr": "Entrez votre identifiant et votre mot de passe", - "de": "Bitten geben Sie ihren Nutzernamen und Passwort ein", + "de": "Bitte geben Sie Ihren Nutzernamen und Ihr Passwort ein", "nl": "Geef je gebruikersnaam en wachtwoord", "lb": "Gid w.e.g Aeren Benotzernumm an d Passwuert an", "sl": "Vnesite svoje uporabni\u0161ko ime in geslo", @@ -71,13 +72,14 @@ "ro": "V\u0103 rug\u0103m s\u0103 completa\u021bi numele de utilizator \u0219i parola", "xh": "Nceda ngenisa igama lakho lomsebenzisi kunye negama lokugqithisa", "af": "Voer jou gebruikersnaam en wagwoord in", - "el": "\u0395\u03b9\u03c3\u03ac\u03b3\u03b5\u03c4\u03b5 \u03cc\u03bd\u03bf\u03bc\u03b1 \u03c7\u03c1\u03ae\u03c3\u03c4\u03b7 \u03ba\u03b1\u03b9 \u03ba\u03c9\u03b4\u03b9\u03ba\u03cc \u03c0\u03c1\u03cc\u03c3\u03b2\u03b1\u03c3\u03b7\u03c2" + "el": "\u0395\u03b9\u03c3\u03ac\u03b3\u03b5\u03c4\u03b5 \u03cc\u03bd\u03bf\u03bc\u03b1 \u03c7\u03c1\u03ae\u03c3\u03c4\u03b7 \u03ba\u03b1\u03b9 \u03ba\u03c9\u03b4\u03b9\u03ba\u03cc \u03c0\u03c1\u03cc\u03c3\u03b2\u03b1\u03c3\u03b7\u03c2", + "zu": "Faka igama lakho lomsebenzisi nephasiwedi" }, "user_pass_text": { "no": "En tjeneste har bedt om bekreftelse p\u00e5 din identitet. Skriv inn ditt brukernavn og passord for \u00e5 autentisere deg.", "nn": "Ei webteneste har spurt etter autentisering av deg. Skriv inn brukarnamnet ditt og passordet ditt for \u00e5 autentisera deg.", "sv": "En webbtj\u00e4nst har beg\u00e4rt att du ska logga in. Detta betyder att du beh\u00f6ver ange ditt anv\u00e4ndarnamn och ditt l\u00f6senord i formul\u00e4ret nedan.", - "es": "Un servicio solicita que se autentique. Esto significa que debe indicar su nombre de usuario y su clave de acceso en el siguiente formulario.", + "es": "Un servicio solicita que se autentique. Por favor, introduzca su nombre de usuario y contrase\u00f1a en el siguiente formulario.", "fr": "Un service a demand\u00e9 \u00e0 ce que vous vous authentifiez. Cela signifie que vous devez entrer votre identifiant et votre mot de passe dans le formulaire ci-dessous.", "de": "Um diesen Dienst zu nutzen, m\u00fcssen Sie sich authentifizieren. Bitte geben sie daher unten Nutzernamen und Passwort ein.", "nl": "Voor deze dienst is authenticatie vereist. Geef je gebruikersnaam en wachtwoord in onderstaand formulier.", @@ -107,13 +109,15 @@ "ro": "Un serviciu a solicitat autentificarea dumneavoastr\u0103. V\u0103 rug\u0103m s\u0103 completa\u021bi numele de utilizator \u0219i parola \u00een c\u00e2mpurile de mai jos.", "eu": "Zerbitzu batek kautotu zaitezen eskatzen du. Mesedez, zure erabiltzaile-izena eta pasahitza honako formulario honetan sartu itzazu.", "af": "'n Diens vereis dat jy jouself identifiseer. Voer jou gebruikersnaam en wagwoord in die onderstaande vorm in.", - "el": "\u039c\u03b9\u03b1 \u03c5\u03c0\u03b7\u03c1\u03b5\u03c3\u03af\u03b1 \u03ad\u03c7\u03b5\u03b9 \u03b6\u03b7\u03c4\u03ae\u03c3\u03b5\u03b9 \u03c4\u03b7\u03bd \u03c4\u03b1\u03c5\u03c4\u03bf\u03c0\u03bf\u03af\u03b7\u03c3\u03ae \u03c3\u03b1\u03c2. \u03a0\u03b1\u03c1\u03b1\u03ba\u03b1\u03bb\u03ce \u03b5\u03b9\u03c3\u03ac\u03b3\u03b5\u03c4\u03b5 \u03c4\u03bf \u03cc\u03bd\u03bf\u03bc\u03b1 \u03c7\u03c1\u03ae\u03c3\u03c4\u03b7 \u03ba\u03b1\u03b9 \u03c4\u03bf\u03bd \u03ba\u03c9\u03b4\u03b9\u03ba\u03cc \u03c0\u03c1\u03cc\u03c3\u03b2\u03b1\u03c3\u03ae\u03c2 \u03c3\u03b1\u03c2 \u03c3\u03c4\u03b7\u03bd \u03c0\u03b1\u03c1\u03b1\u03ba\u03ac\u03c4\u03c9 \u03c6\u03cc\u03c1\u03bc\u03b1." + "el": "\u039c\u03b9\u03b1 \u03c5\u03c0\u03b7\u03c1\u03b5\u03c3\u03af\u03b1 \u03ad\u03c7\u03b5\u03b9 \u03b6\u03b7\u03c4\u03ae\u03c3\u03b5\u03b9 \u03c4\u03b7\u03bd \u03c4\u03b1\u03c5\u03c4\u03bf\u03c0\u03bf\u03af\u03b7\u03c3\u03ae \u03c3\u03b1\u03c2. \u03a0\u03b1\u03c1\u03b1\u03ba\u03b1\u03bb\u03ce \u03b5\u03b9\u03c3\u03ac\u03b3\u03b5\u03c4\u03b5 \u03c4\u03bf \u03cc\u03bd\u03bf\u03bc\u03b1 \u03c7\u03c1\u03ae\u03c3\u03c4\u03b7 \u03ba\u03b1\u03b9 \u03c4\u03bf\u03bd \u03ba\u03c9\u03b4\u03b9\u03ba\u03cc \u03c0\u03c1\u03cc\u03c3\u03b2\u03b1\u03c3\u03ae\u03c2 \u03c3\u03b1\u03c2 \u03c3\u03c4\u03b7\u03bd \u03c0\u03b1\u03c1\u03b1\u03ba\u03ac\u03c4\u03c9 \u03c6\u03cc\u03c1\u03bc\u03b1.", + "zu": "Isevisi icele ukuthi uziqinisekise. Sicela ufake igama lakho lomsebenzisi nephasiwedi ngohlobo olungezansi.", + "xh": "Inkonzo icele ukuba uzingqinisise. Nceda ungenise igama lomsebenzisi nephaswedi yakho kwifomu ngezantsi." }, "login_button": { "no": "Logg inn", "nn": "Logg inn", "sv": "Logga in", - "es": "Login", + "es": "Iniciar sesi\u00f3n", "fr": "S'identifier", "de": "Anmelden", "nl": "Inloggen", @@ -145,10 +149,15 @@ "ro": "Autentificare", "xh": "Ngena", "af": "Meld aan", - "el": "\u0395\u03af\u03c3\u03bf\u03b4\u03bf\u03c2" + "el": "\u0395\u03af\u03c3\u03bf\u03b4\u03bf\u03c2", + "zu": "Ngena" }, "processing": { - "zh-tw": "\u8655\u7406\u4e2d..." + "es": "Procesando...", + "sl": "Procesiranje...", + "zh-tw": "\u8655\u7406\u4e2d...", + "zu": "Iyacubungula...", + "xh": "Iyaprosesa..." }, "username": { "no": "Brukernavn", @@ -186,7 +195,8 @@ "ro": "Nume de utilizator", "xh": "Igama lomsebenzisi", "af": "Gebruikersnaam", - "el": "\u038c\u03bd\u03bf\u03bc\u03b1 \u03a7\u03c1\u03ae\u03c3\u03c4\u03b7" + "el": "\u038c\u03bd\u03bf\u03bc\u03b1 \u03a7\u03c1\u03ae\u03c3\u03c4\u03b7", + "zu": "Igama lomsebenzisi" }, "organization": { "no": "Organisasjon", @@ -224,13 +234,14 @@ "ro": "Institu\u021bie", "xh": "Umbutho", "af": "Organisasie", - "el": "\u039f\u03c1\u03b3\u03b1\u03bd\u03b9\u03c3\u03bc\u03cc\u03c2" + "el": "\u039f\u03c1\u03b3\u03b1\u03bd\u03b9\u03c3\u03bc\u03cc\u03c2", + "zu": "Inhlangano" }, "password": { "no": "Passord", "nn": "Passord", "sv": "L\u00f6senord", - "es": "Clave de acceso", + "es": "Contrase\u00f1a", "fr": "Mot de passe", "de": "Passwort", "nl": "Wachtwoord", @@ -262,13 +273,14 @@ "ro": "Parola", "xh": "Igama lokugqithisa", "af": "Wagwoord", - "el": "\u039a\u03c9\u03b4\u03b9\u03ba\u03cc\u03c2" + "el": "\u039a\u03c9\u03b4\u03b9\u03ba\u03cc\u03c2", + "zu": "Iphasiwedi" }, "help_header": { "no": "Hjelp! Jeg har glemt passordet mitt.", "nn": "Hjelp! Eg har gl\u00f8ymd passordet mitt", "sv": "Hj\u00e4lp! Jag kommer inte ih\u00e5g mitt l\u00f6senord.", - "es": "¡Socorro! Se me ha olvidado mi clave de acceso.", + "es": "\u00a1Ayuda! Se me ha olvidado la contrase\u00f1a.", "fr": "\u00c0 l'aide! Je ne me souviens plus de mon mot de passe.", "de": "Hilfe, ich habe mein Passwort vergessen.", "nl": "Help! Ik weet mijn wachtwoord niet meer.", @@ -298,13 +310,15 @@ "sr": "Upomo\u0107! Zaboravio\/la sam svoju lozinku.", "ro": "Nu mai \u0219tiu parola.", "af": "Hulp! Ek het nie my wagwoord onthou nie.", - "el": "\u0392\u03bf\u03ae\u03b8\u03b5\u03b9\u03b1! \u0394\u03b5 \u03b8\u03c5\u03bc\u03ac\u03bc\u03b1\u03b9 \u03c4\u03bf\u03bd \u03ba\u03c9\u03b4\u03b9\u03ba\u03cc \u03bc\u03bf\u03c5." + "el": "\u0392\u03bf\u03ae\u03b8\u03b5\u03b9\u03b1! \u0394\u03b5 \u03b8\u03c5\u03bc\u03ac\u03bc\u03b1\u03b9 \u03c4\u03bf\u03bd \u03ba\u03c9\u03b4\u03b9\u03ba\u03cc \u03bc\u03bf\u03c5.", + "zu": "Siza! Angiyikhumbuli iphasiwedi yami.", + "xh": "Ncedani! Andiyikhumbuli iphaswedi yam." }, "help_text": { "no": "Synd! - Uten riktig brukernavn og passord kan du ikke autentisere deg. Det kan v\u00e6re noen som kan hjelpe deg. Fors\u00f8k \u00e5 kontakt brukerst\u00f8tte ved din vertsorganisasjon.", "nn": "Synd! - Utan riktig brukarnamn og passord kan du ikkje autentisera deg. Ta kontakt med brukarst\u00f8tte hos din organisasjon.", "sv": "Tyv\u00e4rr kan du inte logga in i tj\u00e4nsten om du inte har ditt anv\u00e4ndarnamn och ditt l\u00f6senord. Ta kontakt med din organisations support eller helpdesk f\u00f6r att f\u00e5 hj\u00e4lp.", - "es": "¡Muy mal! - Sin su nombre de usuario y su clave de acceso usted no se puede identificar y acceder al servicio. A lo mejor hay alguien que puede ayudarle. ¡Póngase en contacto con el centro de ayuda de su universidad!", + "es": "Sin su nombre de usuario y contrase\u00f1a no se puede identificar y acceder al servicio. Quiz\u00e1s haya alguien que pueda ayudarle. \u00a1Contacte con el centro de atenci\u00f3n al usuario de su organizaci\u00f3n!", "fr": "Pas de chance! Sans votre identifiant et votre mot de passe vous ne pouvez pas vous authentifier et acc\u00e9der au service. Il y a peut-\u00eatre quelqu'un pour vous aider. Contactez le help desk de votre universit\u00e9!", "de": "Tut uns leid - Ohne Nutzername und Passwort k\u00f6nnen Sie sich nicht authentifizieren und somit den Dienst nicht nutzen. M\u00f6glicherweise kann ihnen jemand helfen, kontaktieren Sie dazu den Helpdesk ihrer Einrichtung.", "nl": "Zonder je gebruikersnaam en wachtwoord kun je je niet authenticeren en dus niet gebruikmaken van deze dienst.", @@ -334,13 +348,15 @@ "ro": "Din p\u0103cate f\u0103r\u0103 nume de utilizator \u0219i parol\u0103 nu v\u0103 pute\u021bi autentifica pentru accesul la acest serviciu. Contacta\u021bi echipa de suport tehnic de la universitatea dumneavoastr\u0103.", "eu": "Zeinen txarto! - Zure erabiltziale-izena eta pasahitza gabe ezin zara identifikatu ezta zerbitzuan sartu ere. Agian bada norbait lagun diezazukeena. Jar zaitez harremanetan erakundeko laguntza zentroarekin!", "af": "Jammer! - Sonder jou gebruikersnaam en wagwoord kan jy jouself nie vir toegang tot die diens identifiseer nie. Dalk is daar iemand wat jou kan help. Raadpleeg die hulplyn by jou organisasie!", - "el": "\u039b\u03c5\u03c0\u03bf\u03cd\u03bc\u03b1\u03c3\u03c4\u03b5. \u03a7\u03c9\u03c1\u03af\u03c2 \u03c4\u03bf \u03cc\u03bd\u03bf\u03bc\u03b1 \u03c7\u03c1\u03ae\u03c3\u03c4\u03b7 \u03ba\u03b1\u03b9 \u03c4\u03bf\u03bd \u03ba\u03c9\u03b4\u03b9\u03ba\u03cc \u03c3\u03b1\u03c2, \u03b4\u03b5\u03bd \u03bc\u03c0\u03bf\u03c1\u03b5\u03af\u03c4\u03b5 \u03bd\u03b1 \u03c4\u03b1\u03c5\u03c4\u03bf\u03c0\u03bf\u03b9\u03b7\u03b8\u03b5\u03af\u03c4\u03b5 \u03ce\u03c3\u03c4\u03b5 \u03bd\u03b1 \u03b1\u03c0\u03bf\u03ba\u03c4\u03ae\u03c3\u03b5\u03c4\u03b5 \u03c0\u03c1\u03cc\u03c3\u03b2\u03b1\u03c3\u03b7 \u03c3\u03c4\u03b7\u03bd \u03c5\u03c0\u03b7\u03c1\u03b5\u03c3\u03af\u03b1. \u03a3\u03c5\u03bc\u03b2\u03bf\u03c5\u03bb\u03b5\u03c5\u03c4\u03b5\u03af\u03c4\u03b5 \u03c4\u03b7\u03bd \u03c5\u03c0\u03b7\u03c1\u03b5\u03c3\u03af\u03b1 \u03b1\u03c1\u03c9\u03b3\u03ae\u03c2 \u03c7\u03c1\u03b7\u03c3\u03c4\u03ce\u03bd \u0028\u0068\u0065\u006c\u0070 \u0064\u0065\u0073\u006b\u0029 \u03c4\u03bf\u03c5 \u03bf\u03c1\u03b3\u03b1\u03bd\u03b9\u03c3\u03bc\u03bf\u03cd \u03c3\u03b1\u03c2." + "el": "\u039b\u03c5\u03c0\u03bf\u03cd\u03bc\u03b1\u03c3\u03c4\u03b5. \u03a7\u03c9\u03c1\u03af\u03c2 \u03c4\u03bf \u03cc\u03bd\u03bf\u03bc\u03b1 \u03c7\u03c1\u03ae\u03c3\u03c4\u03b7 \u03ba\u03b1\u03b9 \u03c4\u03bf\u03bd \u03ba\u03c9\u03b4\u03b9\u03ba\u03cc \u03c3\u03b1\u03c2, \u03b4\u03b5\u03bd \u03bc\u03c0\u03bf\u03c1\u03b5\u03af\u03c4\u03b5 \u03bd\u03b1 \u03c4\u03b1\u03c5\u03c4\u03bf\u03c0\u03bf\u03b9\u03b7\u03b8\u03b5\u03af\u03c4\u03b5 \u03ce\u03c3\u03c4\u03b5 \u03bd\u03b1 \u03b1\u03c0\u03bf\u03ba\u03c4\u03ae\u03c3\u03b5\u03c4\u03b5 \u03c0\u03c1\u03cc\u03c3\u03b2\u03b1\u03c3\u03b7 \u03c3\u03c4\u03b7\u03bd \u03c5\u03c0\u03b7\u03c1\u03b5\u03c3\u03af\u03b1. \u03a3\u03c5\u03bc\u03b2\u03bf\u03c5\u03bb\u03b5\u03c5\u03c4\u03b5\u03af\u03c4\u03b5 \u03c4\u03b7\u03bd \u03c5\u03c0\u03b7\u03c1\u03b5\u03c3\u03af\u03b1 \u03b1\u03c1\u03c9\u03b3\u03ae\u03c2 \u03c7\u03c1\u03b7\u03c3\u03c4\u03ce\u03bd \u0028\u0068\u0065\u006c\u0070 \u0064\u0065\u0073\u006b\u0029 \u03c4\u03bf\u03c5 \u03bf\u03c1\u03b3\u03b1\u03bd\u03b9\u03c3\u03bc\u03bf\u03cd \u03c3\u03b1\u03c2.", + "xh": "Ngaphandle kwegama lomsebenzisi nephaswedi yakho awukwazi ukuzingqinisisa ukuze ufumane ufikelelo kwinkonzo. Kusenokuba ukho umntu onokukunceda. Qhagamshelana nedesika yoncedo kumbutho wakho!", + "zu": "Ngaphandle kwegama lakho lomsebenzisi nephasiwedi awukwazi ukuziqinisekisa ukuze ufinyelele isevisi. Kungase kube khona ozokusiza. Thinta ideski losizo enhlanganweni yakho!" }, "error_nopassword": { "no": "Du kontaktet loginsiden, men passordet ble ikke sendt med. Fors\u00f8k igjen.", "nn": "Passordet blei ikkje sendt. Pr\u00f8v p\u00e5 nytt.", "sv": "Du skicka in en inloggningsf\u00f6rfr\u00e5gan men det verkar som om ditt l\u00f6senord inte fanns med i f\u00f6rfr\u00e5gan. F\u00f6rs\u00f6k igen!", - "es": "Usted envi\u00f3 algo a la p\u00e1gina de acceso pero, por alg\u00fan motivo, la clave no fue enviada. Int\u00e9ntelo de nuevo, por favor.", + "es": "Usted envi\u00f3 algo a la p\u00e1gina de acceso pero, por alguna raz\u00f3n, no se envi\u00f3 la contrase\u00f1a. Int\u00e9ntelo de nuevo, por favor.", "fr": "Vous avez envoy\u00e9 quelque chose sur la page d'identification mais pour une raison inconnue votre mot de passe n'a pas \u00e9t\u00e9 transmis. Veuillez r\u00e9essayer.", "de": "Sie haben etwas an die Anmeldeseite geschickt, aber aus irgendeinem Grund ist das Passwort nicht \u00fcbermittelt worden. Bitte versuchen Sie es erneut.", "nl": "Je hebt wel iets ingetikt, maar blijkbaar is je wachtwoord niet verstuurd. Probeer het opnieuw AUB.", @@ -370,13 +386,15 @@ "ro": "A\u021bi trimis informa\u021bii c\u0103tre pagina de autentificare dar din motive necunoscute parola nu a fost trimis\u0103. V\u0103 rug\u0103m s\u0103 \u00eencerca\u021bi din nou.", "eu": "Sarrera orrira zerbait bidali duzu baina, arrazoiren bategatik, pasahitza ez da bidali.Saia zaitez berriro, mesedez.", "af": "Jy het probeer aanmeld maar jou wagwoord is nie verstuur nie, probeer asb. weer.", - "el": "\u039f \u03ba\u03c9\u03b4\u03b9\u03ba\u03cc\u03c2 \u03c0\u03c1\u03cc\u03c3\u03b2\u03b1\u03c3\u03b7\u03c2 \u03b4\u03b5\u03bd \u03b5\u03c3\u03c4\u03ac\u03bb\u03b7. \u03a0\u03b1\u03c1\u03b1\u03ba\u03b1\u03bb\u03ce, \u03c0\u03c1\u03bf\u03c3\u03c0\u03b1\u03b8\u03ae\u03c3\u03c4\u03b5 \u03be\u03b1\u03bd\u03ac." + "el": "\u039f \u03ba\u03c9\u03b4\u03b9\u03ba\u03cc\u03c2 \u03c0\u03c1\u03cc\u03c3\u03b2\u03b1\u03c3\u03b7\u03c2 \u03b4\u03b5\u03bd \u03b5\u03c3\u03c4\u03ac\u03bb\u03b7. \u03a0\u03b1\u03c1\u03b1\u03ba\u03b1\u03bb\u03ce, \u03c0\u03c1\u03bf\u03c3\u03c0\u03b1\u03b8\u03ae\u03c3\u03c4\u03b5 \u03be\u03b1\u03bd\u03ac.", + "zu": "Uthumele okuthile ekhasini lokungena, kodwa ngasizathu simbe iphasiwedi ayizange ithunyelwe. Sicela uzame futhi.", + "xh": "Uthumele into kwikhasi lokungena, kodwa ngesizathu esithile iphaswedi ayithunyelwanga. Nceda uzame kwakhona." }, "error_wrongpassword": { "no": "Feil brukernavn eller passord.", "nn": "Feil brukarnamn eller passord.", "sv": "Fel anv\u00e4ndarnamn eller l\u00f6senord.", - "es": "Nombre de usuario o contrase\u00f1a err\u00f3neos", + "es": "Nombre de usuario o contrase\u00f1a incorrectos", "fr": "Mauvais identifiant ou mot de passe.", "de": "Falscher Nutzername oder Passwort.", "nl": "Gebruikersnaam of wachtwoord niet bekend.", @@ -408,7 +426,8 @@ "ro": "Nume de utilizator incorect sau parola incorect\u0103.", "xh": "Awungenanga ngoba igama olisebenzisayo okanye isigqithisi asifakwanga kakuhle.", "af": "Verkeerde gebruikersnaam of wagwoord.", - "el": "\u03a4\u03bf \u03cc\u03bd\u03bf\u03bc\u03b1 \u03c7\u03c1\u03ae\u03c3\u03c4\u03b7 \u03ae \u03bf \u03ba\u03c9\u03b4\u03b9\u03ba\u03cc\u03c2 \u03c0\u03c1\u03cc\u03c3\u03b2\u03b1\u03c3\u03b7\u03c2 \u03b5\u03af\u03bd\u03b1\u03b9 \u03bb\u03ac\u03b8\u03bf\u03c2." + "el": "\u03a4\u03bf \u03cc\u03bd\u03bf\u03bc\u03b1 \u03c7\u03c1\u03ae\u03c3\u03c4\u03b7 \u03ae \u03bf \u03ba\u03c9\u03b4\u03b9\u03ba\u03cc\u03c2 \u03c0\u03c1\u03cc\u03c3\u03b2\u03b1\u03c3\u03b7\u03c2 \u03b5\u03af\u03bd\u03b1\u03b9 \u03bb\u03ac\u03b8\u03bf\u03c2.", + "zu": "Igama lomsebenzisi noma iphasiwedi engalungile." }, "contact_info": { "no": "Kontaktinformasjon:", @@ -443,13 +462,15 @@ "sr": "Kontakt podaci:", "ro": "Informa\u021bii de contact:", "af": "Kontak detail:", - "el": "\u03a3\u03c4\u03bf\u03b9\u03c7\u03b5\u03af\u03b1 \u03b5\u03c0\u03b9\u03ba\u03bf\u03b9\u03bd\u03c9\u03bd\u03af\u03b1\u03c2:" + "el": "\u03a3\u03c4\u03bf\u03b9\u03c7\u03b5\u03af\u03b1 \u03b5\u03c0\u03b9\u03ba\u03bf\u03b9\u03bd\u03c9\u03bd\u03af\u03b1\u03c2:", + "zu": "Ulwazi lokuxhumana:", + "xh": "Inkcazelo yoqhagamshelwano:" }, "select_home_org": { "no": "Velg vertsorganisasjon", "nn": "Vel vertsorganisasjon", "sv": "V\u00e4lj vilken organisation du kommer ifr\u00e5n", - "es": "Seleccione su organizaci\u00f3n origen", + "es": "Seleccione su organizaci\u00f3n de origen", "fr": "Choisissez votre fournisseur.", "de": "W\u00e4hlen sie die Einrichtung, von der Sie ihre Zugangsdaten beziehen", "nl": "Kies je organisatie", @@ -478,13 +499,15 @@ "ro": "Alege\u021bi institu\u021bia de origine", "eu": "Hautatu zure jatorrizko erakundea", "af": "Kies jou tuisorganisasie", - "el": "\u0395\u03c0\u03b9\u03bb\u03bf\u03b3\u03ae \u03bf\u03b9\u03ba\u03b5\u03af\u03bf\u03c5 \u03c6\u03bf\u03c1\u03ad\u03b1" + "el": "\u0395\u03c0\u03b9\u03bb\u03bf\u03b3\u03ae \u03bf\u03b9\u03ba\u03b5\u03af\u03bf\u03c5 \u03c6\u03bf\u03c1\u03ad\u03b1", + "xh": "Khetha umbutho wakho wekhaya", + "zu": "Khetha inhlangano yakho yasekhaya" }, "change_home_org_title": { "no": "Endre din vertsorganisasjon", "nn": "Endra vertsorganisasjon", "sv": "\u00c4ndra vilken organisation du kommer ifr\u00e5n", - "es": "Cambiar su organizaci\u00f3n origen", + "es": "Cambiar la organizaci\u00f3n de origen", "fr": "Changez votre fournisseur", "de": "Eine andere Einrichtung, von der Sie Zugangsdaten erhalten, ausw\u00e4hlen", "nl": "Verander je organisatie", @@ -513,13 +536,15 @@ "ro": "Modifica\u021bi institu\u021bia de origine", "eu": "Zure jatorrizko erakundea aldatu", "af": "Verander jou tuisorganisasie", - "el": "\u0391\u03bb\u03bb\u03b1\u03b3\u03ae \u03bf\u03b9\u03ba\u03b5\u03af\u03bf\u03c5 \u03c6\u03bf\u03c1\u03ad\u03b1" + "el": "\u0391\u03bb\u03bb\u03b1\u03b3\u03ae \u03bf\u03b9\u03ba\u03b5\u03af\u03bf\u03c5 \u03c6\u03bf\u03c1\u03ad\u03b1", + "xh": "Tshintsha umbutho wakho wekhaya", + "zu": "Shintsha inhlangano yakho yasekhaya" }, "change_home_org_text": { "no": "Du har valgt <b>%HOMEORG%<\/b> som din vertsorganisasjon. Dersom dette er feil kan du velge en annen.", "nn": "Du har vald <b>%HOMEORG%<\/b> som din vertsorganisasjon. Dersom dette er feil, kan du velja ein annan organisasjon fr\u00e5 menyen.", "sv": "Du har valt <b>%HOMEORG%<\/b> som organisation du kommer ifr\u00e5n. Om detta \u00e4r fel s\u00e5 kan du v\u00e4lja en annan.", - "es": "Ha seleccionado <b>%HOMEORG%<\/b> como organizaci\u00f3n origen. Si esta informaci\u00f3n es incorrecta puede seleccionar otra.", + "es": "Ha seleccionado <b>%HOMEORG%<\/b> como organizaci\u00f3n de origen. Si esta informaci\u00f3n es incorrecta, puede seleccionar otra.", "fr": "Vous avez choisi <b>%HOMEORG%<\/b> comme votre fournisseur. Si ce n'est pas correct, vous pouvez le changer.", "de": "Sie haben <b>%HOMEORG%<\/b> als ihre Einrichtung gew\u00e4hlt, k\u00f6nnen diese Auswahl aber noch \u00e4ndern.", "nl": "Je hebt <b>%HOMEORG%<\/b> gekozen als je organisatie. Als dit niet correct is kun je een andere keuze maken.", @@ -548,13 +573,15 @@ "ro": "A\u021bi ales ca institu\u021bie de origine<b>%HOMEORG%<\/b>. Dac\u0103 nu este corect v\u0103 rug\u0103m s\u0103 alege\u021bi alt\u0103 institu\u021bie.", "eu": "<b>%HOMEORG%<\/b> hautatu duzu zure jatorrizko erakunde bezala. Informazio hau okerra bada beste bat hautatu dezakezu.", "af": "Jy het <b>%HOMEORG%<\/b> gekies as jou tuisorganisasie. As dit is verkeerd jy kan 'n ander een te kies.", - "el": "\u0395\u03c0\u03b9\u03bb\u03b5\u03b3\u03bc\u03ad\u03bd\u03bf\u03c2 \u03bf\u03b9\u03ba\u03b5\u03af\u03bf\u03c2 \u03c6\u03bf\u03c1\u03ad\u03b1\u03c2: <b>%HOMEORG%<\/b>." + "el": "\u0395\u03c0\u03b9\u03bb\u03b5\u03b3\u03bc\u03ad\u03bd\u03bf\u03c2 \u03bf\u03b9\u03ba\u03b5\u03af\u03bf\u03c2 \u03c6\u03bf\u03c1\u03ad\u03b1\u03c2: <b>%HOMEORG%<\/b>.", + "zu": "Ukhethe okuthi <b>%HOMEORG%</b> njengenhlangano yakho yasekhaya. Uma lokhu kungalungile ungase ukhethe enye.", + "xh": "Uye wakhetha u-<b>%HOMEORG%</b> njengombutho wakho wekhaya. Ukuba oku akuchanekanga usenokukhetha omnye." }, "change_home_org_button": { "no": "Velg vertsorganisasjon", "nn": "Vel vertsorganisasjon", "sv": "\u00c4ndra organisation", - "es": "Seleccionar la organizaci\u00f3n origen", + "es": "Seleccione su organizaci\u00f3n de origen", "fr": "Choisissez votre fournisseur.", "de": "Einrichtung ausw\u00e4hlen", "nl": "Kies je organisatie", @@ -583,13 +610,15 @@ "ro": "Alege\u021bi institu\u021bia de origine", "eu": "Jatorrizko erakundea hautatu", "af": "Kies tuisorganisasie", - "el": "\u0395\u03c0\u03b9\u03bb\u03bf\u03b3\u03ae \u03bf\u03b9\u03ba\u03b5\u03af\u03bf\u03c5 \u03c6\u03bf\u03c1\u03ad\u03b1" + "el": "\u0395\u03c0\u03b9\u03bb\u03bf\u03b3\u03ae \u03bf\u03b9\u03ba\u03b5\u03af\u03bf\u03c5 \u03c6\u03bf\u03c1\u03ad\u03b1", + "xh": "Khetha umbutho wekhaya", + "zu": "Khetha inhlangano yasekhaya" }, "help_desk_link": { "no": "Hjemmesiden til brukerst\u00f8tte", "nn": "Heimeside for brukarst\u00f8tte", "sv": "Hemsida f\u00f6r helpdesk", - "es": "P\u00e1gina de soporte t\u00e9cnico", + "es": "P\u00e1gina del centro de atenci\u00f3n al usuario", "fr": "Page web de l'assistance technique", "de": "Seite des Helpdesk", "nl": "Helpdesk homepage", @@ -618,13 +647,15 @@ "ro": "Pagina echipei de suport tehnic", "eu": "Laguntza teknikoaren orria ", "af": "Hulplyn-tuisblad", - "el": "\u03a3\u03b5\u03bb\u03af\u03b4\u03b1 \u03c5\u03c0\u03b7\u03c1\u03b5\u03c3\u03af\u03b1\u03c2 \u03b1\u03c1\u03c9\u03b3\u03ae\u03c2 \u03c7\u03c1\u03b7\u03c3\u03c4\u03ce\u03bd" + "el": "\u03a3\u03b5\u03bb\u03af\u03b4\u03b1 \u03c5\u03c0\u03b7\u03c1\u03b5\u03c3\u03af\u03b1\u03c2 \u03b1\u03c1\u03c9\u03b3\u03ae\u03c2 \u03c7\u03c1\u03b7\u03c3\u03c4\u03ce\u03bd", + "zu": "Ikhasi lasekhaya ledeski losizo", + "xh": "Ikhasi lekhaya ledesika yoncedo" }, "help_desk_email": { "no": "Send e-post til brukerst\u00f8tte", "nn": "Send epost til brukarst\u00f8tte", "sv": "Skicka e-post till helpdesk", - "es": "Enviar correo electr\u00f3nico al soporte t\u00e9cnico", + "es": "Enviar correo electr\u00f3nico al centro de atenci\u00f3n al usuario", "fr": "Assistance technique par courriel", "de": "Email an den Helpdesk senden", "nl": "Stuur een e-mail naar de helpdesk", @@ -653,7 +684,9 @@ "ro": "Trimite\u021bi un mesaj la echipa de suport tehnic", "eu": "Bidali posta laguntza teknikoari ", "af": "Stuur e-pos aan hulplyn", - "el": "\u0391\u03c0\u03bf\u03c3\u03c4\u03bf\u03bb\u03ae \u0065\u006d\u0061\u0069\u006c \u03c3\u03c4\u03b7\u03bd \u03c5\u03c0\u03b7\u03c1\u03b5\u03c3\u03af\u03b1 \u03b1\u03c1\u03c9\u03b3\u03ae\u03c2 \u03c7\u03c1\u03b7\u03c3\u03c4\u03ce\u03bd" + "el": "\u0391\u03c0\u03bf\u03c3\u03c4\u03bf\u03bb\u03ae \u0065\u006d\u0061\u0069\u006c \u03c3\u03c4\u03b7\u03bd \u03c5\u03c0\u03b7\u03c1\u03b5\u03c3\u03af\u03b1 \u03b1\u03c1\u03c9\u03b3\u03ae\u03c2 \u03c7\u03c1\u03b7\u03c3\u03c4\u03ce\u03bd", + "xh": "Thumela i-imeyile kwidesika yoncedo", + "zu": "Thumela i-imeyili edeskini losizo" }, "next": { "no": "Fortsett", @@ -689,7 +722,8 @@ "eu": "Hurrengoa", "xh": "Olandelayo", "af": "Volgende", - "el": "\u0395\u03c0\u03cc\u03bc\u03b5\u03bd\u03bf" + "el": "\u0395\u03c0\u03cc\u03bc\u03b5\u03bd\u03bf", + "zu": "Okulandelayo" }, "remember_username": { "es": "Recordar mi nombre de usuario", @@ -700,7 +734,10 @@ "da": "Husk mit brugernavn", "af": "Onthou my gebruikersnaam", "pt-br": "Lembrar meu nome de usu\u00e1rio", - "el": "\u039d\u03b1 \u03b8\u03c5\u03bc\u03ac\u03c3\u03b1\u03b9 \u03c4\u03bf \u03cc\u03bd\u03bf\u03bc\u03b1 \u03c7\u03c1\u03ae\u03c3\u03c4\u03b7" + "el": "\u039d\u03b1 \u03b8\u03c5\u03bc\u03ac\u03c3\u03b1\u03b9 \u03c4\u03bf \u03cc\u03bd\u03bf\u03bc\u03b1 \u03c7\u03c1\u03ae\u03c3\u03c4\u03b7", + "zu": "Khumbula igama lami lomsebenzisi", + "xh": "Khumbula igama lomsebenzisi lam", + "sl": "Zapomni si moje uporabniško ime" }, "remember_me": { "es": "Recordarme", @@ -711,6 +748,9 @@ "da": "Husk mig", "af": "Onthou my", "pt-br": "Lembre-me", - "el": "\u039d\u03b1 \u03bc\u03b5 \u03b8\u03c5\u03bc\u03ac\u03c3\u03b1\u03b9" + "el": "\u039d\u03b1 \u03bc\u03b5 \u03b8\u03c5\u03bc\u03ac\u03c3\u03b1\u03b9", + "xh": "Ndikhumbule", + "zu": "Ngikhumbule", + "sl": "Zapomni si me" } } diff --git a/vendor/simplesamlphp/simplesamlphp/dictionaries/logout.translation.json b/vendor/simplesamlphp/simplesamlphp/dictionaries/logout.translation.json index dd7e2ead5e..d17a234a88 100644 --- a/vendor/simplesamlphp/simplesamlphp/dictionaries/logout.translation.json +++ b/vendor/simplesamlphp/simplesamlphp/dictionaries/logout.translation.json @@ -3,7 +3,7 @@ "no": "Utlogget", "nn": "Utlogga", "sv": "Utloggad", - "es": "Desconectado", + "es": "Sesión cerrada", "fr": "D\u00e9connect\u00e9", "de": "Abgemeldet", "nl": "Uitgelogd", @@ -32,13 +32,15 @@ "ro": "Ie\u0219ire din sistem (deautentificare)", "ru": "\u0423\u0441\u043f\u0435\u0448\u043d\u044b\u0439 \u0432\u044b\u0445\u043e\u0434", "af": "Afgemeld", - "el": "\u0391\u03c0\u03bf\u03c3\u03c5\u03bd\u03b4\u03b5\u03b4\u03b5\u03bc\u03ad\u03bd\u03bf\u03c2/\u03b7" + "el": "\u0391\u03c0\u03bf\u03c3\u03c5\u03bd\u03b4\u03b5\u03b4\u03b5\u03bc\u03ad\u03bd\u03bf\u03c2/\u03b7", + "xh": "Uphumile", + "zu": "Uphume ngemvume" }, "logged_out_text": { "no": "Du er n\u00e5 utlogget.", "nn": "Du har blitt logga ut. Takk for at du brukte denne tenesta.", "sv": "Du har blivit uloggad. Tack f\u00f6r att du anv\u00e4nde denna tj\u00e4nst.", - "es": "Ha sido desconectado. Gracias por usar este servicio.", + "es": "Se ha cerrado la sesión.", "fr": "Vous avez \u00e9t\u00e9 d\u00e9connect\u00e9. Merci d'avoir utilis\u00e9 ce service.", "de": "Sie wurden abgemeldet. Danke, dass Sie diesen Dienst verwendet haben.", "nl": "U bent uitgelogd. Dank u voor het gebruiken van deze dienst.", @@ -67,7 +69,9 @@ "ro": "A\u021bi fost deautentificat", "ru": "\u0412\u044b \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0432\u044b\u0448\u043b\u0438 \u0438\u0437 \u0441\u0438\u0441\u0442\u0435\u043c\u044b", "af": "Jy is afgemeld.", - "el": "\u0388\u03c7\u03b5\u03c4\u03b5 \u03b1\u03c0\u03bf\u03c3\u03c5\u03bd\u03b4\u03b5\u03b8\u03b5\u03af." + "el": "\u0388\u03c7\u03b5\u03c4\u03b5 \u03b1\u03c0\u03bf\u03c3\u03c5\u03bd\u03b4\u03b5\u03b8\u03b5\u03af.", + "zu": "Usuphumile.", + "xh": "Uphumile." }, "default_link_text": { "no": "G\u00e5 tilbake til SimpleSAMLphp installasjonen sin startside.", @@ -102,7 +106,9 @@ "ru": "\u0412\u0435\u0440\u043d\u0443\u0442\u044c\u0441\u044f \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 SimpleSAMLphp", "eu": "Itzuli SimpleSAMLphp instalazio orrira ", "af": "Gaan terug na die SimpleSAMLphp installasie bladsy", - "el": "\u0395\u03c0\u03b9\u03c3\u03c4\u03c1\u03bf\u03c6\u03ae \u03c3\u03c4\u03b7\u03bd \u03b1\u03c1\u03c7\u03b9\u03ba\u03ae \u03c3\u03b5\u03bb\u03af\u03b4\u03b1" + "el": "\u0395\u03c0\u03b9\u03c3\u03c4\u03c1\u03bf\u03c6\u03ae \u03c3\u03c4\u03b7\u03bd \u03b1\u03c1\u03c7\u03b9\u03ba\u03ae \u03c3\u03b5\u03bb\u03af\u03b4\u03b1", + "xh": "Buyela emva kwikhasi lofakelo le-SimpleSAMLphp", + "zu": "Buyela emuva ekhasini lokufaka le-SimpleSAMLphp" }, "hold": { "no": "P\u00e5 vent", @@ -137,7 +143,9 @@ "ru": "\u0412 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438 \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u044f", "eu": "Itxaroten", "af": "Hou die verbinding", - "el": "\u03a3\u03b5 \u03b1\u03bd\u03b1\u03bc\u03bf\u03bd\u03ae" + "el": "\u03a3\u03b5 \u03b1\u03bd\u03b1\u03bc\u03bf\u03bd\u03ae", + "xh": "Ibanjiwe", + "zu": "Imisiwe" }, "completed": { "no": "Fullf\u00f8rt", @@ -172,13 +180,15 @@ "ru": "\u0412\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u043e", "eu": "Amaitua", "af": "Voltooid", - "el": "\u039f\u03bb\u03bf\u03ba\u03bb\u03b7\u03c1\u03ce\u03b8\u03b7\u03ba\u03b5" + "el": "\u039f\u03bb\u03bf\u03ba\u03bb\u03b7\u03c1\u03ce\u03b8\u03b7\u03ba\u03b5", + "xh": "Igqityiwe", + "zu": "Kuqedile" }, "progress": { "no": "Logger ut...", "nn": "Loggar ut...", "sv": "Loggar ut...", - "es": "Desconectando...", + "es": "Cerrando la sesi\u00f3n...", "fr": "D\u00e9connexion...", "de": "Abmeldung l\u00e4uft...", "nl": "Uitloggen...", @@ -207,13 +217,15 @@ "ro": "Deautentificare ...", "ru": "\u0412\u044b\u0445\u043e\u0434 \u0438\u0437 \u0441\u0438\u0441\u0442\u0435\u043c\u044b...", "af": "Besig om af te meld?", - "el": "\u0393\u03af\u03bd\u03b5\u03c4\u03b1\u03b9 \u03b1\u03c0\u03bf\u03c3\u03cd\u03bd\u03b4\u03b5\u03c3\u03b7..." + "el": "\u0393\u03af\u03bd\u03b5\u03c4\u03b1\u03b9 \u03b1\u03c0\u03bf\u03c3\u03cd\u03bd\u03b4\u03b5\u03c3\u03b7...", + "zu": "Iyaphuma...", + "xh": "Iyaphuma..." }, "failed": { "no": "Utlogging feilet", "nn": "Utlogging feila", "sv": "Utloggning misslyckades", - "es": "Proceso de desconexi\u00f3n fallido", + "es": "El cierre de sesi\u00f3n ha fallado", "fr": "\u00c9chec de la d\u00e9connexion", "de": "Abmeldung fehlgeschlagen", "nl": "Uitloggen mislukt", @@ -242,7 +254,9 @@ "ru": "\u0412\u044b\u0445\u043e\u0434 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d \u043d\u0435\u0443\u0434\u0430\u0447\u043d\u043e", "eu": "Saioa ixteko prozesuak huts egin du", "af": "Afmelding misluk", - "el": "\u0397 \u03b1\u03c0\u03bf\u03c3\u03cd\u03bd\u03b4\u03b5\u03c3\u03b7 \u03b1\u03c0\u03ad\u03c4\u03c5\u03c7\u03b5" + "el": "\u0397 \u03b1\u03c0\u03bf\u03c3\u03cd\u03bd\u03b4\u03b5\u03c3\u03b7 \u03b1\u03c0\u03ad\u03c4\u03c5\u03c7\u03b5", + "xh": "Ukuphuma kusilele", + "zu": "Ukuphuma kuhlulekile" }, "return": { "no": "Tilbake til tjenesten", @@ -277,13 +291,15 @@ "ro": "\u00centoarcere la serviciu", "ru": "\u0412\u0435\u0440\u043d\u0443\u0442\u044c\u0441\u044f \u043a \u0441\u043b\u0443\u0436\u0431\u0435", "af": "Terug na diens", - "el": "\u0395\u03c0\u03b9\u03c3\u03c4\u03c1\u03bf\u03c6\u03ae \u03c3\u03c4\u03b7\u03bd \u03c5\u03c0\u03b7\u03c1\u03b5\u03c3\u03af\u03b1" + "el": "\u0395\u03c0\u03b9\u03c3\u03c4\u03c1\u03bf\u03c6\u03ae \u03c3\u03c4\u03b7\u03bd \u03c5\u03c0\u03b7\u03c1\u03b5\u03c3\u03af\u03b1", + "xh": "Buyela kwinkonzo", + "zu": "Buyela kusevisi" }, "success": { "no": "Du har nå logget ut fra alle tjenestene listet ovenfor.", "nn": "Du er ferdig utlogga fr\u00e5 alle tenestene", "sv": "Du har loggat ut fr\u00e5n alla nedanst\u00e5ende tj\u00e4nster.", - "es": "Ha sido correctamente desconectado de todo los servicios listados a continuaci\u00f3n", + "es": "Ha cerrado las sesiones de todos los servicios listados m\u00e1s arriba", "fr": "Vous avez \u00e9t\u00e9 d\u00e9connect\u00e9 avec succ\u00e8s des services list\u00e9s ci dessus", "de": "Sie haben sich erfolgreich von allen obenstehenden Diensten abgemeldet.", "nl": "Je bent succesvol uitgelogd van de bovenvermelde services.", @@ -312,13 +328,15 @@ "ru": "\u0412\u044b \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0432\u044b\u0448\u043b\u0438 \u0438\u0437 \u0432\u0441\u0435\u0445 \u0441\u043b\u0443\u0436\u0431 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u0445 \u0432\u044b\u0448\u0435.", "eu": "Hemen adierazten den zerrendako zerbitzu guztietako saioak zuzen itxi dira", "af": "Jy het suksesvol afgemeld.", - "el": "\u0388\u03c7\u03b5\u03c4\u03b5 \u03b1\u03c0\u03bf\u03c3\u03c5\u03bd\u03b4\u03b5\u03b8\u03b5\u03af \u03bc\u03b5 \u03b5\u03c0\u03b9\u03c4\u03c5\u03c7\u03af\u03b1 \u03b1\u03c0\u03cc \u03cc\u03bb\u03b5\u03c2 \u03c4\u03b9\u03c2 \u03c5\u03c0\u03b7\u03c1\u03b5\u03c3\u03af\u03b5\u03c2 \u03c0\u03bf\u03c5 \u03b1\u03bd\u03b1\u03c6\u03ad\u03c1\u03bf\u03bd\u03c4\u03b1\u03b9 \u03c0\u03b1\u03c1\u03b1\u03c0\u03ac\u03bd\u03c9." + "el": "\u0388\u03c7\u03b5\u03c4\u03b5 \u03b1\u03c0\u03bf\u03c3\u03c5\u03bd\u03b4\u03b5\u03b8\u03b5\u03af \u03bc\u03b5 \u03b5\u03c0\u03b9\u03c4\u03c5\u03c7\u03af\u03b1 \u03b1\u03c0\u03cc \u03cc\u03bb\u03b5\u03c2 \u03c4\u03b9\u03c2 \u03c5\u03c0\u03b7\u03c1\u03b5\u03c3\u03af\u03b5\u03c2 \u03c0\u03bf\u03c5 \u03b1\u03bd\u03b1\u03c6\u03ad\u03c1\u03bf\u03bd\u03c4\u03b1\u03b9 \u03c0\u03b1\u03c1\u03b1\u03c0\u03ac\u03bd\u03c9.", + "xh": "Uphume ngokuyimpumelelo kuzo zonke iinkonzo ezidweliswe ngasentla.", + "zu": "Uphume ngempumelelo kuwo wonke amasevisi abhalwe ngenhla." }, "loggedoutfrom": { "no": "Du er n\u00e5 logget ut fra %SP%.", "nn": "Du er ferdig utlogga fr\u00e5 %SP%.", "sv": "Du har nu loggat ut fr\u00e5n %SP%.", - "es": "Ha sido desconectado correctamente de %SP%.", + "es": "Ha cerrado correctamente la sesión en %SP%.", "fr": "Vous avez \u00e9t\u00e9 d\u00e9connect\u00e9 de %SP%.", "de": "Sie wurden nun erfolgreich von %SP% abgemeldet", "nl": "Je bent nu succesvol uitgelogd van %SP%.", @@ -347,7 +365,9 @@ "ru": "\u0412\u044b \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0432\u044b\u0448\u043b\u0438 \u0438\u0437 \u0441\u043b\u0443\u0436\u0431\u044b %SP%.", "eu": "%SP% saioa zuzen itxi da.", "af": "Jy is suksesvol afgemeld van %SP% af.", - "el": "\u0388\u03c7\u03b5\u03c4\u03b5 \u03b1\u03c0\u03bf\u03c3\u03c5\u03bd\u03b4\u03b5\u03b8\u03b5\u03af \u03bc\u03b5 \u03b5\u03c0\u03b9\u03c4\u03c5\u03c7\u03af\u03b1 \u03b1\u03c0\u03cc \u03c4\u03b7\u03bd \u03c5\u03c0\u03b7\u03c1\u03b5\u03c3\u03af\u03b1 %SP%." + "el": "\u0388\u03c7\u03b5\u03c4\u03b5 \u03b1\u03c0\u03bf\u03c3\u03c5\u03bd\u03b4\u03b5\u03b8\u03b5\u03af \u03bc\u03b5 \u03b5\u03c0\u03b9\u03c4\u03c5\u03c7\u03af\u03b1 \u03b1\u03c0\u03cc \u03c4\u03b7\u03bd \u03c5\u03c0\u03b7\u03c1\u03b5\u03c3\u03af\u03b1 %SP%.", + "xh": "Ngoku uphume ngokuyimpumelelo kwi-%SP%.", + "zu": "Usuphume ngempumelelo kokuthi %SP%." }, "also_from": { "no": "Du er ogs\u00e5 logget inn p\u00e5 disse tjenestene:", @@ -382,13 +402,15 @@ "ru": "\u0412\u044b \u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u044b \u043a \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u0441\u043b\u0443\u0436\u0431\u0430\u043c:", "eu": "Zerbitzu hauetan ere kautotuta zaude:", "af": "Jy is ook by di\u00e9 dienste aangemeld:", - "el": "\u0395\u03af\u03c3\u03c4\u03b5 \u03b5\u03c0\u03af\u03c3\u03b7\u03c2 \u03c3\u03c5\u03bd\u03b4\u03b5\u03b4\u03b5\u03bc\u03ad\u03bd\u03bf\u03c2 \u03c3\u03b5 \u03b1\u03c5\u03c4\u03ad\u03c2 \u03c4\u03b9\u03c2 \u03c5\u03c0\u03b7\u03c1\u03b5\u03c3\u03af\u03b5\u03c2:" + "el": "\u0395\u03af\u03c3\u03c4\u03b5 \u03b5\u03c0\u03af\u03c3\u03b7\u03c2 \u03c3\u03c5\u03bd\u03b4\u03b5\u03b4\u03b5\u03bc\u03ad\u03bd\u03bf\u03c2 \u03c3\u03b5 \u03b1\u03c5\u03c4\u03ad\u03c2 \u03c4\u03b9\u03c2 \u03c5\u03c0\u03b7\u03c1\u03b5\u03c3\u03af\u03b5\u03c2:", + "zu": "Ungenile futhi kulawa masevisi:", + "xh": "Kananjalo ungene kwezi nkonzo:" }, "logout_all_question": { "no": "Vil du logge ut fra alle tjenestene ovenfor?", "nn": "Vil du logga ut fr\u00e5 alle tenestene?", "sv": "Vill du logga ut fr\u00e5n alla ovanst\u00e5ende tj\u00e4nster?", - "es": "\u00bfDesea desconectarse de todos los servicios que se muestran m\u00e1s arriba?", + "es": "\u00bfDesea cerrar las sesiones de todos los servicios que se muestran m\u00e1s arriba?", "fr": "Voulez vous r\u00e9ellement terminer les connexions \u00e0 tout ces services?", "de": "Wollen Sie sich von allen obenstehenden Diensten abmelden?", "nl": "Wil je uitloggen van alle bovenvermelde diensten?", @@ -417,13 +439,15 @@ "ro": "Dori\u021bi s\u0103 v\u0103 deautentifica\u021bi de la toate serviciile de mai sus ?", "ru": "\u0412\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u0432\u044b\u0439\u0442\u0438 \u0438\u0437 \u0432\u0441\u0435\u0445 \u0441\u043b\u0443\u0436\u0431, \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u0445 \u0432\u044b\u0448\u0435?", "af": "Wil jy van alle bogenoemde dienste afmeld?", - "el": "\u0395\u03c0\u03b9\u03b8\u03c5\u03bc\u03b5\u03af\u03c4\u03b5 \u03bd\u03b1 \u03b1\u03c0\u03bf\u03c3\u03c5\u03bd\u03b4\u03b5\u03b8\u03b5\u03af\u03c4\u03b5 \u03b1\u03c0\u03cc \u03cc\u03bb\u03b5\u03c2 \u03c4\u03b9\u03c2 \u03c0\u03b1\u03c1\u03b1\u03c0\u03ac\u03bd\u03c9 \u03c5\u03c0\u03b7\u03c1\u03b5\u03c3\u03af\u03b5\u03c2\u003b" + "el": "\u0395\u03c0\u03b9\u03b8\u03c5\u03bc\u03b5\u03af\u03c4\u03b5 \u03bd\u03b1 \u03b1\u03c0\u03bf\u03c3\u03c5\u03bd\u03b4\u03b5\u03b8\u03b5\u03af\u03c4\u03b5 \u03b1\u03c0\u03cc \u03cc\u03bb\u03b5\u03c2 \u03c4\u03b9\u03c2 \u03c0\u03b1\u03c1\u03b1\u03c0\u03ac\u03bd\u03c9 \u03c5\u03c0\u03b7\u03c1\u03b5\u03c3\u03af\u03b5\u03c2\u003b", + "xh": "Ngaba ufuna ukuphuma kuzo zonke iinkonzo ezingasentla?", + "zu": "Ingabe ufuna ukuphuma kuwo wonke amasevisi angenhla?" }, "logout_all": { "no": "Ja, alle tjenestene over", "nn": "Ja, logg ut fr\u00e5 alle", "sv": "Ja, alla tj\u00e4nster", - "es": "Si, todos los servicios", + "es": "S\u00ed, de todos los servicios", "fr": "Oui, de tous les services", "de": "Ja, alle Dienste", "nl": "Ja, alle diensten", @@ -452,13 +476,15 @@ "ro": "Da, toate serviciile", "ru": "\u0414\u0430, \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u0441\u043b\u0443\u0436\u0431", "af": "Ja, alle dienste", - "el": "\u039d\u03b1\u03b9, \u03cc\u03bb\u03b5\u03c2 \u03c4\u03b9\u03c2 \u03c5\u03c0\u03b7\u03c1\u03b5\u03c3\u03af\u03b5\u03c2" + "el": "\u039d\u03b1\u03b9, \u03cc\u03bb\u03b5\u03c2 \u03c4\u03b9\u03c2 \u03c5\u03c0\u03b7\u03c1\u03b5\u03c3\u03af\u03b5\u03c2", + "zu": "Yebo, wonke amasevisi", + "xh": "Ewe, zonke iinkonzo" }, "logout_only": { "no": "Nei, bare %SP%", "nn": "Nei, logg berre ut fr\u00e5 %SP%", "sv": "Nej, endast %SP%", - "es": "No, s\u00f3lo %SPS", + "es": "No, s\u00f3lo de %SP%", "fr": "Non, seulement de %SP%", "de": "Nein, nur %SP%", "nl": "Nee, alleen %SP%", @@ -487,13 +513,15 @@ "ro": "Nu, doar %SP%", "ru": "\u041d\u0435\u0442, \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u0441\u043b\u0443\u0436\u0431\u044b %SP%", "af": "Nee, net %SP%", - "el": "\u038c\u03c7\u03b9, \u03bc\u03cc\u03bd\u03bf \u03b1\u03c0\u03cc \u03c4\u03b7\u03bd \u03c5\u03c0\u03b7\u03c1\u03b5\u03c3\u03af\u03b1 %SP%" + "el": "\u038c\u03c7\u03b9, \u03bc\u03cc\u03bd\u03bf \u03b1\u03c0\u03cc \u03c4\u03b7\u03bd \u03c5\u03c0\u03b7\u03c1\u03b5\u03c3\u03af\u03b1 %SP%", + "zu": "Cha, ku-%SP% kuphela", + "xh": "Hayi, kuphela %SP%" }, "incapablesps": { "no": "En eller flere av tjenestene du er logget inn p\u00e5 <i>st\u00f8tter ikke logout<\/i>. Lukk nettleseren, dersom du \u00f8nsker \u00e5 logge ut fra disse tjenestene.", "nn": "Ei eller fleire av tenestene du er innlogga p\u00e5 <i>st\u00f8tter ikkje utlogging<\/i>. Lukk weblesaren din for \u00e5 sikra at alle sesjonar blir lukka", "sv": "En eller flera av tj\u00e4nsterna du \u00e4r inloggad i <i>kan inte hantera utloggning<\/i>. F\u00f6r att s\u00e4kerst\u00e4lla att du inte l\u00e4ngre \u00e4r inloggad i n\u00e5gon tj\u00e4nst ska du <i>st\u00e4nga din webbl\u00e4sare<\/i>.", - "es": "Uno o m\u00e1s de los servicios en los que est\u00e1 autenticado <i>no permite desconexi\u00f3n<\/i>. Para asegurarse de que todas sus sesiones se cierran, se le recomienda que <i>cierre todas las ventanas de su navegador<\/i>.", + "es": "Uno o m\u00e1s de los servicios en los que est\u00e1 autenticado <i>no permite desconexi\u00f3n<\/i>. Para asegurarse de que todas sus sesiones se cierran, se le recomienda que <i>cierre su navegador<\/i>.", "fr": "Un ou plusieurs des services auxquels vous \u00eates connect\u00e9 <i>ne g\u00e8rent pas la d\u00e9connexion<\/i>. Pour terminer les sessions sur ces services, vous devrez <i>fermer votre navigateur<\/i>.", "de": "Einer oder mehrere Dienste an denen Sie angemeldet sind, <i>unterst\u00fctzen keine Abmeldung<\/i>. Um sicherzustellen, dass Sie abgemeldet sind, <i>schlie\u00dfen Sie bitte Ihren Webbrowser<\/i>.", "nl": "Een of meer diensten waarop je bent inlogd hebben <i>geen ondersteuning voor uitloggen<\/i>. Om er zeker van te zijn dat al je sessies zijn be\u00ebindigd, kun je het beste <i>je webbrowser afsluiten<\/i>.", @@ -522,7 +550,9 @@ "ru": "\u041d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u043b\u0443\u0436\u0431\u044b, \u043a \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0432\u044b \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u044b, <i>\u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0436\u0438\u0432\u0430\u044e\u0442 \u0432\u044b\u0445\u043e\u0434 \u0438\u0437 \u0441\u0438\u0441\u0442\u0435\u043c\u044b<\/i>. \u0414\u043b\u044f \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u0438\u044f \u0437\u0430\u043a\u0440\u044b\u0442\u0438\u044f \u0432\u0441\u0435\u0445 \u0441\u0435\u0441\u0441\u0438\u0439, <i>\u0437\u0430\u043a\u0440\u043e\u0439\u0442\u0435 \u0432\u0430\u0448 \u0431\u0440\u0430\u0443\u0437\u0435\u0440<\/i>.", "eu": "Kautotuta zauden zerbitzu bat edo batzuk <i>ez dute uzten saioa ixten<\/i>. Zure saio guztiak ixten direla ziurtatzeko, <i>zure nabigatzaileko leiho guztiak ixtea<\/i> gomendatzen da.", "af": "Een of meerdere dienste waarby jy aangemeld het, <i>ondersteun nie afmelding nie<\/i>. Om seker te wees datal jou sessies afgesluit word, is dit beter om jou <i>webblaaier toe te maak<\/i>.", - "el": "\u039c\u03af\u03b1 \u03ae \u03c0\u03b5\u03c1\u03b9\u03c3\u03c3\u03cc\u03c4\u03b5\u03c1\u03b5\u03c2 \u03c5\u03c0\u03b7\u03c1\u03b5\u03c3\u03af\u03b5\u03c2 \u03bc\u03b5 \u03c4\u03b9\u03c2 \u03bf\u03c0\u03bf\u03af\u03b5\u03c2 \u03b5\u03af\u03c3\u03c4\u03b5 \u03c3\u03c5\u03bd\u03b4\u03b5\u03b4\u03b5\u03bc\u03ad\u03bd\u03bf\u03c2\u002f\u03b7 \u03b4\u03b5\u03bd \u03c5\u03c0\u03bf\u03c3\u03c4\u03b7\u03c1\u03af\u03b6\u03bf\u03c5\u03bd \u03b1\u03c0\u03bf\u03c3\u03cd\u03bd\u03b4\u03b5\u03c3\u03b7\u002e \u0393\u03b9\u03b1 \u03c4\u03bf \u03ba\u03bb\u03b5\u03af\u03c3\u03b9\u03bc\u03bf \u03cc\u03bb\u03c9\u03bd \u03c4\u03c9\u03bd \u03c3\u03c5\u03bd\u03b5\u03b4\u03c1\u03b9\u03ce\u03bd \u03c3\u03b1\u03c2 (sessions), \u03c3\u03b1\u03c2 \u03c3\u03c5\u03bd\u03b9\u03c3\u03c4\u03bf\u03cd\u03bc\u03b5 \u03bd\u03b1 <i>\u03ba\u03bb\u03b5\u03af\u03c3\u03b5\u03c4\u03b5<\/i> \u03c4\u03bf \u03c0\u03c1\u03cc\u03b3\u03c1\u03b1\u03bc\u03bc\u03b1 \u03c0\u03bb\u03bf\u03ae\u03b3\u03b7\u03c3\u03b7\u03c2 (web browser)." + "el": "\u039c\u03af\u03b1 \u03ae \u03c0\u03b5\u03c1\u03b9\u03c3\u03c3\u03cc\u03c4\u03b5\u03c1\u03b5\u03c2 \u03c5\u03c0\u03b7\u03c1\u03b5\u03c3\u03af\u03b5\u03c2 \u03bc\u03b5 \u03c4\u03b9\u03c2 \u03bf\u03c0\u03bf\u03af\u03b5\u03c2 \u03b5\u03af\u03c3\u03c4\u03b5 \u03c3\u03c5\u03bd\u03b4\u03b5\u03b4\u03b5\u03bc\u03ad\u03bd\u03bf\u03c2\u002f\u03b7 \u03b4\u03b5\u03bd \u03c5\u03c0\u03bf\u03c3\u03c4\u03b7\u03c1\u03af\u03b6\u03bf\u03c5\u03bd \u03b1\u03c0\u03bf\u03c3\u03cd\u03bd\u03b4\u03b5\u03c3\u03b7\u002e \u0393\u03b9\u03b1 \u03c4\u03bf \u03ba\u03bb\u03b5\u03af\u03c3\u03b9\u03bc\u03bf \u03cc\u03bb\u03c9\u03bd \u03c4\u03c9\u03bd \u03c3\u03c5\u03bd\u03b5\u03b4\u03c1\u03b9\u03ce\u03bd \u03c3\u03b1\u03c2 (sessions), \u03c3\u03b1\u03c2 \u03c3\u03c5\u03bd\u03b9\u03c3\u03c4\u03bf\u03cd\u03bc\u03b5 \u03bd\u03b1 <i>\u03ba\u03bb\u03b5\u03af\u03c3\u03b5\u03c4\u03b5<\/i> \u03c4\u03bf \u03c0\u03c1\u03cc\u03b3\u03c1\u03b1\u03bc\u03bc\u03b1 \u03c0\u03bb\u03bf\u03ae\u03b3\u03b7\u03c3\u03b7\u03c2 (web browser).", + "zu": "Isevisi eyodwa noma ngaphezulu ongene kuyo <i>ayikusekeli ukuphuma</i>. Ukuze wenze isiqiniseko sokuthi wonke amaseshini akho avaliwe, ukhuthazwa ukuthi <i>uvale isiphequluli sakho sewebhu</i>.", + "xh": "Inkonzo enye okanye ezingakumbi ongeneyo kuzo <i>azikuxhasi ukuphuma</i>. Ukuqinisekisa zonke iiseshoni zakho zivaliwe, ukhuthazwa <i>uvale ibhrawuza yewebhu</i>." }, "no": { "no": "Nei", @@ -557,7 +587,9 @@ "ro": "Nu", "ru": "\u041d\u0435\u0442", "af": "Nee", - "el": "\u038c\u03c7\u03b9" + "el": "\u038c\u03c7\u03b9", + "xh": "Hayi", + "zu": "Cha" }, "logging_out_from": { "sl": "Odjava iz naslednjih storitev:", @@ -571,7 +603,7 @@ "fr": "D\u00e9connexion des services suivants :", "lt": "Vyksta atjungimas nuo \u0161i\u0173 paslaug\u0173:", "it": "Disconnessione in corso dai seguenti servizi:", - "es": "Desconectarse de los siguientes servicios:", + "es": "Cerrando las sesiones de los siguientes servicios:", "hu": "Kil\u00e9p\u00e9s az al\u00e1bbi szolg\u00e1ltat\u00e1sokb\u00f3l:", "ja": "\u4ee5\u4e0b\u306e\u30b5\u30fc\u30d3\u30b9\u304b\u3089\u30ed\u30b0\u30a2\u30a6\u30c8\u3057\u307e\u3057\u305f:", "nl": "Uitloggen van de volgende diensten:", @@ -591,7 +623,9 @@ "eu": "Honako zerbitzu hauen saioak itxi:", "fi": "Kirjaudutaan ulos seuraavista palveluista:", "af": "Afmelding van die volgende dienste:", - "el": "Γίνεται αποσύνδεση από τις ακόλουθες υπηρεσίες:" + "el": "Γίνεται αποσύνδεση από τις ακόλουθες υπηρεσίες:", + "zu": "Iyaphuma kumasevisi alandelayo:", + "xh": "Iphuma kwezi nkonzo zilandelayo:" }, "failedsps": { "sl": "Odjava z ene ali ve\u010d storitev ni uspela. Odjavo dokon\u010dajte tako, da <i>zaprete spletni brskalnik<\/i>.", @@ -605,7 +639,7 @@ "fr": "Impossible de se d\u00e9connecter d'un ou plusieurs services. Pour \u00eatre certain de clore vos sessions, il vous est recommand\u00e9 de <i>fermer votre navigateur<\/i>.", "lt": "Nepavyksta atsijungti nuo vienos ar daugiau paslaug\u0173. Siekiant u\u017etikrinti s\u0117kming\u0105 darbo pabaig\u0105, rekomenduojame <i>u\u017edaryti nar\u0161ykl\u0119<\/i>.", "it": "Impossibile disconnettersi da uno o pi\u00f9 servizi. Per assicurarsi di chiudere tutte le sessioni si consiglia di <i>chiudere il browser<\/i>", - "es": "Imposible desconectarse de uno o m\u00e1s servicios. Para asegurar que todas sus sesiones han sido cerradas, se recomienda que <i>cierre su navegador web<\/i>.", + "es": "No fue posible desconectarse de uno o m\u00e1s servicios. Para garantizar que todas sus sesiones han sido cerradas, se recomienda que <i>cierre su navegador web<\/i>.", "hu": "Legal\u00e1bb egy szolg\u00e1ltat\u00e1sb\u00f3l nem siker\u00fclt kil\u00e9pni. Ahhoz, hogy biztosan lez\u00e1rja a megkezdett munkamenetet, k\u00e9rj\u00fck, <i>z\u00e1rja be b\u00f6ng\u00e9sz\u0151j\u00e9t<\/i>.", "ja": "\u4e00\u3064\u4ee5\u4e0a\u306e\u30b5\u30fc\u30d3\u30b9\u304b\u305f\u30ed\u30b0\u30a2\u30a6\u30c8\u51fa\u6765\u307e\u305b\u3093\u3067\u3057\u305f\u3002\u78ba\u5b9f\u306b\u30bb\u30c3\u30b7\u30e7\u30f3\u3092\u7d42\u4e86\u3055\u305b\u308b\u306b\u306f\u3001<i>WEB\u30d6\u30e9\u30a6\u30b6\u3092\u9589\u3058\u308b<\/i>\u4e8b\u3092\u63a8\u5968\u3057\u307e\u3059\u3002", "nl": "Het was niet mogelijk bij een of meerdere diensten uit te loggen. Om alle sessies te sluiten, raden wij u aan uw <i>webbrowser te af te sluiten<\/i>.", @@ -624,6 +658,8 @@ "eu": "Ezinezkoa da zerbitzu bat edo batzuen saioak ixtea. Zure saio guztiak itxi direla ziurtatzeko, <i>zure web nabigatzailea ixtea<\/i> gomendatzen da. ", "fi": "Uloskirjautuminen yhdest\u00e4 tai useammasta palvelusta ep\u00e4onnistui. <i>Sulje web-selaimesi<\/i> varmistaaksesi, ett\u00e4 kaikki istuntosi sulkeutuvat.", "af": "Dit was nie moontlik om van een of meer dienste af te meld nie. Om seker te wees dat al jou sessies afgesluit word, is dit beter om jou <i>webblaaier toe te maak<\/i>.", - "el": "\u0394\u03b5\u03bd \u03ae\u03c4\u03b1\u03bd \u03b4\u03c5\u03bd\u03b1\u03c4\u03ae \u03b7 \u03b1\u03c0\u03bf\u03c3\u03cd\u03bd\u03b4\u03b5\u03c3\u03b7 \u03b1\u03c0\u03cc \u03bc\u03af\u03b1 \u03ae \u03c0\u03b5\u03c1\u03b9\u03c3\u03c3\u03cc\u03c4\u03b5\u03c1\u03b5\u03c2 \u03c5\u03c0\u03b7\u03c1\u03b5\u03c3\u03af\u03b5\u03c2\u002e \u0393\u03b9\u03b1 \u03c4\u03bf \u03ba\u03bb\u03b5\u03af\u03c3\u03b9\u03bc\u03bf \u03cc\u03bb\u03c9\u03bd \u03c4\u03c9\u03bd \u03c3\u03c5\u03bd\u03b5\u03b4\u03c1\u03b9\u03ce\u03bd \u03c3\u03b1\u03c2 (sessions), \u03c3\u03b1\u03c2 \u03c3\u03c5\u03bd\u03b9\u03c3\u03c4\u03bf\u03cd\u03bc\u03b5 \u03bd\u03b1 <i>\u03ba\u03bb\u03b5\u03af\u03c3\u03b5\u03c4\u03b5<\/i> \u03c4\u03bf \u03c0\u03c1\u03cc\u03b3\u03c1\u03b1\u03bc\u03bc\u03b1 \u03c0\u03bb\u03bf\u03ae\u03b3\u03b7\u03c3\u03b7\u03c2 (web browser)." + "el": "\u0394\u03b5\u03bd \u03ae\u03c4\u03b1\u03bd \u03b4\u03c5\u03bd\u03b1\u03c4\u03ae \u03b7 \u03b1\u03c0\u03bf\u03c3\u03cd\u03bd\u03b4\u03b5\u03c3\u03b7 \u03b1\u03c0\u03cc \u03bc\u03af\u03b1 \u03ae \u03c0\u03b5\u03c1\u03b9\u03c3\u03c3\u03cc\u03c4\u03b5\u03c1\u03b5\u03c2 \u03c5\u03c0\u03b7\u03c1\u03b5\u03c3\u03af\u03b5\u03c2\u002e \u0393\u03b9\u03b1 \u03c4\u03bf \u03ba\u03bb\u03b5\u03af\u03c3\u03b9\u03bc\u03bf \u03cc\u03bb\u03c9\u03bd \u03c4\u03c9\u03bd \u03c3\u03c5\u03bd\u03b5\u03b4\u03c1\u03b9\u03ce\u03bd \u03c3\u03b1\u03c2 (sessions), \u03c3\u03b1\u03c2 \u03c3\u03c5\u03bd\u03b9\u03c3\u03c4\u03bf\u03cd\u03bc\u03b5 \u03bd\u03b1 <i>\u03ba\u03bb\u03b5\u03af\u03c3\u03b5\u03c4\u03b5<\/i> \u03c4\u03bf \u03c0\u03c1\u03cc\u03b3\u03c1\u03b1\u03bc\u03bc\u03b1 \u03c0\u03bb\u03bf\u03ae\u03b3\u03b7\u03c3\u03b7\u03c2 (web browser).", + "xh": "Awukwazi ukuphuma kwinkonzo enye okanye ezingakumbi. Ukuqinisekisa zonke iiseshoni zakho zivaliwe, ukhuthazwa <i>uvale ibhrawuza yewebhu</i>.", + "zu": "Ayikwazi ukuphuma kusevisi eyodwa noma ngaphezulu. Ukuze wenze isiqiniseko sokuthi wonke amaseshini akho avaliwe, ukhuthazwa ukuthi <i>uvale isiphequluli sakho sewebhu</i>." } } diff --git a/vendor/simplesamlphp/simplesamlphp/dictionaries/status.definition.json b/vendor/simplesamlphp/simplesamlphp/dictionaries/status.definition.json index 57030aaab4..a82c97fcbe 100644 --- a/vendor/simplesamlphp/simplesamlphp/dictionaries/status.definition.json +++ b/vendor/simplesamlphp/simplesamlphp/dictionaries/status.definition.json @@ -37,5 +37,11 @@ }, "logout": { "en": "Logout" + }, + "authData_header": { + "en": "AuthData" + }, + "authData_summary": { + "en": "Click to view AuthData" } } diff --git a/vendor/simplesamlphp/simplesamlphp/dictionaries/status.translation.json b/vendor/simplesamlphp/simplesamlphp/dictionaries/status.translation.json index a78f1e1e46..8131661d85 100644 --- a/vendor/simplesamlphp/simplesamlphp/dictionaries/status.translation.json +++ b/vendor/simplesamlphp/simplesamlphp/dictionaries/status.translation.json @@ -31,7 +31,9 @@ "sr": "SAML 2.0 SP Demo Primer", "ro": "Exemplu demonstrativ de furnizor de servicii SAML 2.0", "ru": "\u0414\u0435\u043c\u043e \u043f\u0440\u0438\u043c\u0435\u0440 \u0441\u0435\u0440\u0432\u0438\u0441 \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u0430 SAML 2.0 SP", - "el": "\u0394\u03bf\u03ba\u03b9\u03bc\u03b1\u03c3\u03c4\u03b9\u03ba\u03cc\u03c2 \u03a0\u03b1\u03c1\u03bf\u03c7\u03ad\u03b1\u03c2 \u03a5\u03c0\u03b7\u03c1\u03b5\u03c3\u03b9\u03ce\u03bd SAML 2.0" + "el": "\u0394\u03bf\u03ba\u03b9\u03bc\u03b1\u03c3\u03c4\u03b9\u03ba\u03cc\u03c2 \u03a0\u03b1\u03c1\u03bf\u03c7\u03ad\u03b1\u03c2 \u03a5\u03c0\u03b7\u03c1\u03b5\u03c3\u03b9\u03ce\u03bd SAML 2.0", + "zu": "Isampula Ledemo Ye-SAML 2.0 SP", + "xh": "Umzekelo weDemo we-SAML 2.0 SP" }, "header_shib": { "no": "Shibboleth Demo", @@ -65,7 +67,9 @@ "sr": "Shibboleth Demo", "ro": "Demo Shibboleth", "ru": "Shibboleth \u0434\u0435\u043c\u043e", - "el": "\u0394\u03bf\u03ba\u03b9\u03bc\u03b1\u03c3\u03c4\u03b9\u03ba\u03cc\u03c2 \u03a0\u03b1\u03c1\u03bf\u03c7\u03ad\u03b1\u03c2 \u03a5\u03c0\u03b7\u03c1\u03b5\u03c3\u03b9\u03ce\u03bd Shibboleth" + "el": "\u0394\u03bf\u03ba\u03b9\u03bc\u03b1\u03c3\u03c4\u03b9\u03ba\u03cc\u03c2 \u03a0\u03b1\u03c1\u03bf\u03c7\u03ad\u03b1\u03c2 \u03a5\u03c0\u03b7\u03c1\u03b5\u03c3\u03b9\u03ce\u03bd Shibboleth", + "xh": "Idemo ye-Shibboleth", + "zu": "Idemo ye-Shibboleth" }, "header_wsfed": { "no": "WS-Fed SP Demo Eksempel", @@ -99,7 +103,9 @@ "sr": "WS-Fed SP Demo Primer", "ro": "Exemplu demonstrativ de WS-Fed", "ru": "\u0414\u0435\u043c\u043e \u043f\u0440\u0438\u043c\u0435\u0440 \u0441\u0435\u0440\u0432\u0438\u0441 \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u0430 WS-Fed SP", - "el": "\u0394\u03bf\u03ba\u03b9\u03bc\u03b1\u03c3\u03c4\u03b9\u03ba\u03cc\u03c2 \u03a0\u03b1\u03c1\u03bf\u03c7\u03ad\u03b1\u03c2 \u03a5\u03c0\u03b7\u03c1\u03b5\u03c3\u03b9\u03ce\u03bd WS-Fed" + "el": "\u0394\u03bf\u03ba\u03b9\u03bc\u03b1\u03c3\u03c4\u03b9\u03ba\u03cc\u03c2 \u03a0\u03b1\u03c1\u03bf\u03c7\u03ad\u03b1\u03c2 \u03a5\u03c0\u03b7\u03c1\u03b5\u03c3\u03b9\u03ce\u03bd WS-Fed", + "zu": "Isibonelo Sedemo ye-WS-Fed SP", + "xh": "Umzekelo weDemo we-WS-Fed SP" }, "header_diagnostics": { "no": "SimpleSAMLphp diagnostikk", @@ -133,7 +139,9 @@ "sr": "SimpleSAMLphp Dijagnostika", "ro": "Diagnostic SimpleSAMLphp", "ru": "\u0414\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u043a\u0430 SimpleSAMLphp", - "el": "\u0394\u03b9\u03b1\u03b3\u03bd\u03c9\u03c3\u03c4\u03b9\u03ba\u03ac SimpleSAMLphp" + "el": "\u0394\u03b9\u03b1\u03b3\u03bd\u03c9\u03c3\u03c4\u03b9\u03ba\u03ac SimpleSAMLphp", + "zu": "Ukuhlonzwa Kwe-SimpleSAMLphp", + "xh": "Uhlalutyo lwe-SimpleSAMLphp" }, "some_error_occurred": { "no": "En feil har oppst\u00e5tt", @@ -167,7 +175,9 @@ "sr": "Desila se gre\u0161ka", "ro": "A ap\u0103rut o eroare", "ru": "\u041f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u0430 \u043e\u0448\u0438\u0431\u043a\u0430", - "el": "\u03a3\u03c5\u03bd\u03ad\u03b2\u03b7 \u03c3\u03c6\u03ac\u03bb\u03bc\u03b1" + "el": "\u03a3\u03c5\u03bd\u03ad\u03b2\u03b7 \u03c3\u03c6\u03ac\u03bb\u03bc\u03b1", + "zu": "Kuvele iphutha elithile", + "xh": "Kwenzeke impazamo ethile" }, "intro": { "no": "Hei, dette er en statusside p\u00e5 SimpleSAMLphp. Her kan du se om sesjonen din er timet ut, hvor lenge det er til den timer ut og attributter som er knyttet til din sesjon.", @@ -201,7 +211,9 @@ "ro": "Aceasta este pagina de stare pentru SimpleSAMLphp. Aici pute\u021bi verifica dac\u0103 sesiunea dumneavoastr\u0103 a expirat, c\u00e2t timp mai este p\u00e2n\u0103 la expirarea sesiunii precum \u0219i toate atributele ata\u0219ate sesiunii dumneavoastr\u0103.", "ru": "\u042d\u0442\u043e \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430 \u0441\u043e \u0441\u0442\u0430\u0442\u0443\u0441\u043e\u043c SimpleSAMLphp. \u041c\u043e\u0436\u043d\u043e \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u0442\u044c \u0441\u043b\u0443\u0447\u0430\u0438 \u043e\u043a\u043e\u043d\u0447\u0430\u043d\u0438\u044f \u0441\u0435\u0441\u0441\u0438\u0438, \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0441\u0435\u0441\u0441\u0438\u0438 \u0434\u043e \u0438\u0441\u0442\u0435\u0447\u0435\u043d\u0438\u044f \u0441\u0440\u043e\u043a\u0430 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0438 \u0432\u0441\u0435 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b \u0432 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0435\u0441\u0441\u0438\u0438.", "eu": "Kaixo, hau SimpleSAMLphp-ren egoera orria da. Hemendik ikus dezakezu zure saioa iraungi den, zenbat denbora geratzen den hau gerta dadin eta zure saioan dauden atributu guztiak.", - "el": "\u03a7\u03b1\u03af\u03c1\u03b5\u03c4\u03b5, \u03b1\u03c5\u03c4\u03ae \u03b5\u03af\u03bd\u03b1\u03b9 \u03b7 \u03c3\u03b5\u03bb\u03af\u03b4\u03b1 \u03ba\u03b1\u03c4\u03ac\u03c3\u03c4\u03b1\u03c3\u03b7\u03c2 \u03c4\u03bf\u03c5 SimpleSAMLphp. \u0395\u03b4\u03ce \u03bc\u03c0\u03bf\u03c1\u03b5\u03af\u03c4\u03b5 \u03bd\u03b1 \u03b4\u03b5\u03af\u03c4\u03b5 \u03b1\u03bd \u03b7 \u03c3\u03c5\u03bd\u03b5\u03b4\u03c1\u03af\u03b1 \u03c3\u03b1\u03c2 \u0028\u0073\u0065\u0073\u0073\u0069\u006f\u006e\u0029 \u03ad\u03c7\u03b5\u03b9 \u03bb\u03ae\u03be\u03b5\u03b9\u002c \u03c4\u03bf \u03c7\u03c1\u03bf\u03bd\u03b9\u03ba\u03cc \u03b4\u03b9\u03ac\u03c3\u03c4\u03b7\u03bc\u03b1 \u03c0\u03bf\u03c5 \u03b4\u03b9\u03b1\u03c1\u03ba\u03b5\u03af \u03ad\u03c9\u03c2 \u03cc\u03c4\u03bf\u03c5 \u03bb\u03ae\u03be\u03b5\u03b9\u002c \u03ba\u03b1\u03b8\u03ce\u03c2 \u03ba\u03b1\u03b9 \u03cc\u03bb\u03b5\u03c2 \u03c4\u03b9\u03c2 \u03c0\u03bb\u03b7\u03c1\u03bf\u03c6\u03bf\u03c1\u03af\u03b5\u03c2 \u03c0\u03bf\u03c5 \u03c3\u03c5\u03bd\u03b4\u03ad\u03bf\u03bd\u03c4\u03b1\u03b9 \u03bc\u03b5 \u03c4\u03b7 \u03c3\u03c5\u03bd\u03b5\u03b4\u03c1\u03af\u03b1 \u03c3\u03b1\u03c2." + "el": "\u03a7\u03b1\u03af\u03c1\u03b5\u03c4\u03b5, \u03b1\u03c5\u03c4\u03ae \u03b5\u03af\u03bd\u03b1\u03b9 \u03b7 \u03c3\u03b5\u03bb\u03af\u03b4\u03b1 \u03ba\u03b1\u03c4\u03ac\u03c3\u03c4\u03b1\u03c3\u03b7\u03c2 \u03c4\u03bf\u03c5 SimpleSAMLphp. \u0395\u03b4\u03ce \u03bc\u03c0\u03bf\u03c1\u03b5\u03af\u03c4\u03b5 \u03bd\u03b1 \u03b4\u03b5\u03af\u03c4\u03b5 \u03b1\u03bd \u03b7 \u03c3\u03c5\u03bd\u03b5\u03b4\u03c1\u03af\u03b1 \u03c3\u03b1\u03c2 \u0028\u0073\u0065\u0073\u0073\u0069\u006f\u006e\u0029 \u03ad\u03c7\u03b5\u03b9 \u03bb\u03ae\u03be\u03b5\u03b9\u002c \u03c4\u03bf \u03c7\u03c1\u03bf\u03bd\u03b9\u03ba\u03cc \u03b4\u03b9\u03ac\u03c3\u03c4\u03b7\u03bc\u03b1 \u03c0\u03bf\u03c5 \u03b4\u03b9\u03b1\u03c1\u03ba\u03b5\u03af \u03ad\u03c9\u03c2 \u03cc\u03c4\u03bf\u03c5 \u03bb\u03ae\u03be\u03b5\u03b9\u002c \u03ba\u03b1\u03b8\u03ce\u03c2 \u03ba\u03b1\u03b9 \u03cc\u03bb\u03b5\u03c2 \u03c4\u03b9\u03c2 \u03c0\u03bb\u03b7\u03c1\u03bf\u03c6\u03bf\u03c1\u03af\u03b5\u03c2 \u03c0\u03bf\u03c5 \u03c3\u03c5\u03bd\u03b4\u03ad\u03bf\u03bd\u03c4\u03b1\u03b9 \u03bc\u03b5 \u03c4\u03b7 \u03c3\u03c5\u03bd\u03b5\u03b4\u03c1\u03af\u03b1 \u03c3\u03b1\u03c2.", + "zu": "Sawubona, leli ikhasi lesimo se-SimpleSAMLphp. Lapha ungakwazi ukubona ukuthi iseshini yakho iphelelwe isikhathi yini, ukuthi ihlala isikhathi eside kangakanani ngaphambi kokuthi iphelelwe isikhathi kanye nazo zonke izici ezihambisana neseshini yakho.", + "xh": "Molo, eli likhasi lobume be-SimpleSAMLphp. Apha ungabona ukuba ngaba iseshoni yakho iphelelwe lixesha, iza kuhlala ixesha elide kangakanani ngaphambi kokuba iphelelwe nazo zonke iimpawu ezincanyathiselweyo kwiseshoni yakho." }, "validfor": { "no": "Din sesjon er gyldig i %SECONDS% sekunder fra n\u00e5.", @@ -235,7 +247,9 @@ "ro": "Sesiunea dumneavoastr\u0103 mai este valid\u0103 \u00eenc\u0103 %SECONDS%.", "ru": "\u0412\u0430\u0448\u0430 \u0441\u0435\u0441\u0441\u0438\u044f \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u0430 \u0432 \u0442\u0435\u0447\u0435\u043d\u0438\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 %SECONDS% \u0441\u0435\u043a\u0443\u043d\u0434.", "eu": "Zure saioa %SECONDS% segundoz izango da baliagarri.", - "el": "\u0391\u03c0\u03bf\u03bc\u03ad\u03bd\u03bf\u03c5\u03bd %SECONDS% \u03b4\u03b5\u03c5\u03c4\u03b5\u03c1\u03cc\u03bb\u03b5\u03c0\u03c4\u03b1 \u03bc\u03ad\u03c7\u03c1\u03b9 \u03c4\u03b7 \u03bb\u03ae\u03be\u03b7 \u03c4\u03b7\u03c2 \u03c3\u03c5\u03bd\u03b5\u03b4\u03c1\u03af\u03b1\u03c2 \u03c3\u03b1\u03c2." + "el": "\u0391\u03c0\u03bf\u03bc\u03ad\u03bd\u03bf\u03c5\u03bd %SECONDS% \u03b4\u03b5\u03c5\u03c4\u03b5\u03c1\u03cc\u03bb\u03b5\u03c0\u03c4\u03b1 \u03bc\u03ad\u03c7\u03c1\u03b9 \u03c4\u03b7 \u03bb\u03ae\u03be\u03b7 \u03c4\u03b7\u03c2 \u03c3\u03c5\u03bd\u03b5\u03b4\u03c1\u03af\u03b1\u03c2 \u03c3\u03b1\u03c2.", + "xh": "Iseshoni yakho iza kusebenza kangangemizuzu e-%SECONDS% ukususela ngoku.", + "zu": "Iseshini yakho isebenza imizuzwana engu-%SECONDS% ukusuka manje." }, "sessionsize": { "no": "Sesjons st\u00f8rrelse: %SIZE%", @@ -269,7 +283,9 @@ "id": "Ukuran session: %SIZE%", "sr": "Veli\u010dina sesije: %SIZE%", "ro": "Dimensiunea sesiunii: %SIZE%", - "el": "\u039c\u03ad\u03b3\u03b5\u03b8\u03bf\u03c2 \u03c3\u03c5\u03bd\u03b5\u03b4\u03c1\u03af\u03b1\u03c2: %SIZE%" + "el": "\u039c\u03ad\u03b3\u03b5\u03b8\u03bf\u03c2 \u03c3\u03c5\u03bd\u03b5\u03b4\u03c1\u03af\u03b1\u03c2: %SIZE%", + "xh": "Ubukhulu beseshoni: %SIZE%", + "zu": "Usayizi weseshini: %SIZE%" }, "attributes_header": { "no": "Dine attributter", @@ -303,7 +319,9 @@ "id": "Attribut Anda", "sr": "Va\u0161i atributi", "ro": "Atributele dumneavoastr\u0103", - "el": "\u03a0\u03bb\u03b7\u03c1\u03bf\u03c6\u03bf\u03c1\u03af\u03b5\u03c2" + "el": "\u03a0\u03bb\u03b7\u03c1\u03bf\u03c6\u03bf\u03c1\u03af\u03b5\u03c2", + "zu": "Izici zakho", + "xh": "Iimpawu zakho" }, "logout": { "no": "Logg ut", @@ -337,7 +355,9 @@ "id": "Logout", "sr": "Odjava", "ro": "Deautentificare", - "el": "\u0391\u03c0\u03bf\u03c3\u03cd\u03bd\u03b4\u03b5\u03c3\u03b7" + "el": "\u0391\u03c0\u03bf\u03c3\u03cd\u03bd\u03b4\u03b5\u03c3\u03b7", + "xh": "Phuma", + "zu": "Phuma" }, "subject_header": { "es": "Identificador SAML", @@ -345,7 +365,9 @@ "zh-tw": "SAML \u4e3b\u984c", "nl": "SAML Subject", "da": "SAML emne", - "el": "\u03a5\u03c0\u03bf\u03ba\u03b5\u03af\u03bc\u03b5\u03bd\u03bf (subject) SAML" + "el": "\u03a5\u03c0\u03bf\u03ba\u03b5\u03af\u03bc\u03b5\u03bd\u03bf (subject) SAML", + "zu": "Isihloko Se-SAML", + "xh": "Umbandela we-SAML" }, "subject_notset": { "es": "sin valor", @@ -353,7 +375,9 @@ "zh-tw": "\u672a\u8a2d\u5b9a", "nl": "niet aanwezig", "da": "ikke angivet", - "el": "\u03b4\u03b5\u03bd \u03ad\u03c7\u03b5\u03b9 \u03bf\u03c1\u03b9\u03c3\u03c4\u03b5\u03af" + "el": "\u03b4\u03b5\u03bd \u03ad\u03c7\u03b5\u03b9 \u03bf\u03c1\u03b9\u03c3\u03c4\u03b5\u03af", + "xh": "ayikasetwa", + "zu": "akusethiwe" }, "subject_format": { "es": "Formato", @@ -361,6 +385,16 @@ "zh-tw": "\u683c\u5f0f", "nl": "Formaat", "da": "Format", - "el": "\u039c\u03bf\u03c1\u03c6\u03ae (format)" + "el": "\u039c\u03bf\u03c1\u03c6\u03ae (format)", + "zu": "Ifomethi", + "xh": "Ufomatho" + }, + "authData_header": { + "xh": "Ungqinisiso lweNgcombolo", + "zu": "I-AuthData" + }, + "authData_summary": { + "xh": "Cofa ukuze ubone uNgqinisiso lweNgcombolo", + "zu": "Qhafaza ukuze ubuke i-AuthData" } } diff --git a/vendor/simplesamlphp/simplesamlphp/docs/index.md b/vendor/simplesamlphp/simplesamlphp/docs/index.md index 8bb3cea222..c7df4fe4c5 100644 --- a/vendor/simplesamlphp/simplesamlphp/docs/index.md +++ b/vendor/simplesamlphp/simplesamlphp/docs/index.md @@ -2,6 +2,8 @@ SimpleSAMLphp Documentation =========================== * [Installing SimpleSAMLphp](simplesamlphp-install) + * [Upgrade notes for version 1.17](simplesamlphp-upgrade-notes-1.17) + * [Upgrade notes for version 1.16](simplesamlphp-upgrade-notes-1.16) * [Upgrade notes for version 1.15](simplesamlphp-upgrade-notes-1.15) * [Upgrade notes for version 1.14](simplesamlphp-upgrade-notes-1.14) * [Upgrade notes for version 1.13](simplesamlphp-upgrade-notes-1.13) @@ -18,7 +20,6 @@ SimpleSAMLphp Documentation * [Using SimpleSAMLphp as a SAML Service Provider](simplesamlphp-sp) * [Hosted SP Configuration Reference](./saml:sp) * [IdP remote reference](simplesamlphp-reference-idp-remote) - * [Upgrading - migration to use the SAML authentication source](simplesamlphp-sp-migration) * [Configuring HTTP-Artifact](./simplesamlphp-artifact-sp) * [Using scoping](./simplesamlphp-scoping) * [Holder-of-Key profile](simplesamlphp-hok-sp) diff --git a/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-advancedfeatures.md b/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-advancedfeatures.md index 71abf8f560..a1ee444dd3 100644 --- a/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-advancedfeatures.md +++ b/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-advancedfeatures.md @@ -41,9 +41,9 @@ In `metadata/saml20-idp-hosted.php`: In `config/authsources.php`: - 'default-sp' => array( + 'default-sp' => [ 'saml:SP', - ), + ], @@ -93,11 +93,12 @@ SimpleSAMLphp supports signing of the metadata it generates. Metadata signing is - `metadata.sign.privatekey`: Name of the file with the private key which should be used to sign the metadata. This file must exist in in the `cert` directory. - `metadata.sign.privatekey_pass`: Passphrase which should be used to open the private key. This parameter is optional, and should be left out if the private key is unencrypted. - `metadata.sign.certificate`: Name of the file with the certificate which matches the private key. This file must exist in in the `cert` directory. -- `metadata.sign.algorithm`: The algorithm to use when signing metadata for this entity. Defaults to RSA-SHA1. Possible values: +- `metadata.sign.algorithm`: The algorithm to use when signing metadata for this entity. Defaults to RSA-SHA256. Possible values: * `http://www.w3.org/2000/09/xmldsig#rsa-sha1` *Note*: the use of SHA1 is **deprecated** and will be disallowed in the future. * `http://www.w3.org/2001/04/xmldsig-more#rsa-sha256` + The default. * `http://www.w3.org/2001/04/xmldsig-more#rsa-sha384` * `http://www.w3.org/2001/04/xmldsig-more#rsa-sha512` @@ -126,7 +127,7 @@ Example code for the function with GeoIP country check: } if ($init) { - $session->setData($data_type, $data_key, $remote_addr, SimpleSAML_Session::DATA_TIMEOUT_SESSION_END); + $session->setData($data_type, $data_key, $remote_addr, \SimpleSAML\Session::DATA_TIMEOUT_SESSION_END); return; } @@ -146,7 +147,7 @@ Example code for the function with GeoIP country check: if ($country_a === $country_b) { if ($stored_remote_addr !== $remote_addr) { - $session->setData($data_type, $data_key, $remote_addr, SimpleSAML_Session::DATA_TIMEOUT_SESSION_END); + $session->setData($data_type, $data_key, $remote_addr, \SimpleSAML\Session::DATA_TIMEOUT_SESSION_END); } return TRUE; diff --git a/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-artifact-idp.md b/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-artifact-idp.md index 4db281c494..fcbf0079d1 100644 --- a/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-artifact-idp.md +++ b/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-artifact-idp.md @@ -26,7 +26,7 @@ The default configuration on Debian is for the memcache server to be accessible Once the memcache server is configured, you can configure simplesamlphp to use it to store sessions. -You can do this by setting the `session.handler` option in `config.php` to `memcache`. +You can do this by setting the `store.type` option in `config.php` to `memcache`. If you are running memcache on a different server than the IdP, you must also change the `memcache_store.servers` option in `config.php`. @@ -35,11 +35,11 @@ Enabling artifact on the IdP To enable the IdP to send artifacts, you must add the `saml20.sendartifact` option to the `saml20-idp-hosted` metadata file: - $metadata['__DYNAMIC:1__'] = array( + $metadata['__DYNAMIC:1__'] = [ [....] 'auth' => 'example-userpass', 'saml20.sendartifact' => TRUE, - ); + ]; Add new metadata to SPs @@ -49,13 +49,13 @@ After enabling the Artifact binding, your IdP metadata will change to add a Arti You therefore need to update the metadata for your IdP at your SPs. `saml20-idp-remote` metadata for SimpleSAMLphp SPs should contain something like: - 'ArtifactResolutionService' => array( - array( + 'ArtifactResolutionService' => [ + [ 'index' => 0, 'Location' => 'https://idp.example.org/simplesaml/saml2/idp/ArtifactResolutionService.php', 'Binding' => 'urn:oasis:names:tc:SAML:2.0:bindings:SOAP', - ), - ), + ], + ], SP metadata on the IdP @@ -66,16 +66,16 @@ This means that you must use the complex endpoint format in `saml20-sp-remote` m In general, that should look something like: 'AssertionConsumerService' => array ( - array( + [ 'Binding' => 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST', 'Location' => 'https://sp.example.org/simplesaml/module.php/saml/sp/saml2-acs.php/default-sp', 'index' => 0, - ), - array( + ], + [ 'Binding' => 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Artifact', 'Location' => 'https://sp.example.org/simplesaml/module.php/saml/sp/saml2-acs.php/default-sp', 'index' => 2, - ), + ], ), (The specific values of the various fields will vary depending on the SP.) @@ -89,9 +89,9 @@ You may therefore have to add the webserver certificate to the metadata that you To do this, you need to set the `https.certificate` option in the `saml20-idp-hosted` metadata file. That option should refer to a file containing the webserver certificate. - $metadata['__DYNAMIC:1__'] = array( + $metadata['__DYNAMIC:1__'] = [ [....] 'auth' => 'example-userpass', 'saml20.sendartifact' => TRUE, 'https.certificate' => '/etc/apache2/webserver.crt', - ); + ]; diff --git a/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-artifact-sp.md b/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-artifact-sp.md index 6b18119ce8..3e2e48e858 100644 --- a/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-artifact-sp.md +++ b/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-artifact-sp.md @@ -11,7 +11,7 @@ This is used for SSL client authentication when contacting the IdP. To generate a private key and certificate, you may use the `openssl` commandline utility: - openssl req -newkey rsa:2048 -new -x509 -days 3652 -nodes -out sp.example.org.crt -keyout sp.example.org.pem + openssl req -newkey rsa:3072 -new -x509 -days 3652 -nodes -out sp.example.org.crt -keyout sp.example.org.pem You can then add the private key and certificate to the SP configuration. When this is done, you can add the metadata of your SP to the IdP, and test the authentication. @@ -19,11 +19,11 @@ When this is done, you can add the metadata of your SP to the IdP, and test the Example configuration --------------------- - 'artifact-sp' => array( + 'artifact-sp' => [ 'saml:SP', 'ProtocolBinding' => 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Artifact', 'privatekey' => 'sp.example.org.pem', 'certificate' => 'sp.example.org.crt', - ), + ], See the [SP configuration reference](./saml:sp) for a description of the options. diff --git a/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-authproc.md b/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-authproc.md index d8523d10dd..20c1eb53b4 100644 --- a/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-authproc.md +++ b/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-authproc.md @@ -23,7 +23,7 @@ Examples of neat things to do using Authentication Processing Filters: * Ask the user for consent, before the user is sent back to a service. * Implement basic Access Control on the IdP (not neccessarily a good idea), limiting access for some users to some SPs. -Be aware that Authentication Proccessing Filters do replace some of the preivous features in SimpleSAMLphp, named: +Be aware that Authentication Proccessing Filters do replace some of the previous features in SimpleSAMLphp, named: * `attributemap` * `attributealter` @@ -44,24 +44,24 @@ How to configure Auth Proc Filters The configuration of *Auth Proc Filters* is a list of filters with priority as *index*. Here is an example of *Auth Proc Filters* configured in `config.php`: - 'authproc.idp' => array( - 10 => array( + 'authproc.idp' => [ + 10 => [ 'class' => 'core:AttributeMap', 'addurnprefix' - ), + ], 20 => 'core:TargetedID', 50 => 'core:AttributeLimit', - 90 => array( + 90 => [ 'class' => 'consent:Consent', 'store' => 'consent:Cookie', 'focus' => 'yes', 'checked' => TRUE - ), - ), + ], + ], This configuration will execute *Auth Proc Filters* one by one, with the priority value in increasing order. When *Auth Proc Filters* is configured in multiple places, in example both globally, in the hosted IdP and remote SP metadata, then the list is interleaved sorted by priority. -The most important parameter of each item on the list is the *class* of the *Auth Proc Filter*. The syntax of the class is `modulename:classname`. As an example the class definition `core:AttributeLimit` will be expanded to look for the class `sspmod_core_Auth_Process_AttributeLimit`. The location of this class file *must* then be: `modules/core/lib/Auth/Process/AttributeLimit.php`. +The most important parameter of each item on the list is the *class* of the *Auth Proc Filter*. The syntax of the class is `modulename:classname`. As an example the class definition `core:AttributeLimit` will be expanded to look for the class `\SimpleSAML\Module\core\Auth\Process\AttributeLimit`. The location of this class file *must* then be: `modules/core/lib/Auth/Process/AttributeLimit.php`. You will see that a bunch of useful filters is included in the `core` module. In addition the `consent` module that is included in the SimpleSAMLphp distribution implements a filter. Beyond that, you are encouraged to create your own filters and share with the community. If you have created a cool *Auth Proc Filter* that does something useful, let us know, and we may share it on the [SimpleSAMLphp web site][]. @@ -73,18 +73,18 @@ When you know the class definition of a filter, and the priority, the simple way This is analogous to: - 20 => array( + 20 => [ 'class' => 'core:TargetedID' - ), + ], Some *Auth Proc Filters* have optional or required *parameters*. To send parameters to *Auth Proc Filters*, you need to choose the second of the two alernatives above. Here is an example of provided parameters to the consent module: - 90 => array( + 90 => [ 'class' => 'consent:Consent', 'store' => 'consent:Cookie', 'focus' => 'yes', 'checked' => TRUE - ), + ], ### Filters in `config.php` @@ -105,15 +105,15 @@ The filters in `authproc.sp` will be executed at the SP side regardless of which Filters can be added both in `hosted` and `remote` metadata. Here is an example of a filter added in a metadata file: - '__DYNAMIC:1__' => array( + '__DYNAMIC:1__' => [ 'host' => '__DEFAULT_', 'privatekey' => 'example.org.pem', 'certificate' => 'example.org.crt', 'auth' => 'feide', - 'authproc' => array( - 40 => 'preprodwarning:Warning', - ), - ) + 'authproc' => [ + 40 => 'core:TargetedID', + ], + ] The example above is in `saml20-idp-hosted`. @@ -132,6 +132,8 @@ The following filters are included in the SimpleSAMLphp distribution: - [`core:AttributeLimit`](./core:authproc_attributelimit): Limit the attributes in the response. - [`core:AttributeMap`](./core:authproc_attributemap): Change the name of the attributes. - [`core:AttributeRealm`](./core:authproc_attributerealm): (deprecated) Create an attribute with the realm of the user. +- [`core:Cardinality`](./core:authproc_cardinality): Ensure the number of attribute values is within the specified multiplicity. +- [`core:CardinalitySingle`](./core:authproc_cardinalitysingle): Ensure the correct cardinality of single-valued attributes. - [`core:GenerateGroups`](./core:authproc_generategroups): Generate a `group` attribute for the user. - [`core:LanguageAdaptor`](./core:authproc_languageadaptor): Transfering language setting from IdP to SP. - [`core:PHP`](./core:authproc_php): Modify attributes with custom PHP code. @@ -141,8 +143,8 @@ The following filters are included in the SimpleSAMLphp distribution: - [`core:TargetedID`](./core:authproc_targetedid): Generate the `eduPersonTargetedID` attribute. - [`core:WarnShortSSOInterval`](./core:authproc_warnshortssointerval): Give a warning if the user logs into the same SP twice within a few seconds. - [`expirycheck:ExpiryDate`](./expirycheck:expirycheck): Block access to accounts that have expired. -- [`preprodwarning:Warning`](./preprodwarning:warning): Warn the user about accessing a test IdP. - [`saml:AttributeNameID`](./saml:nameid): Generate custom NameID with the value of an attribute. +- [`saml:AuthnContextClassRef`](./saml:authproc_authncontextclassref): Set the authentication context in the response. - [`saml:ExpectedAuthnContextClassRef`](./saml:authproc_expectedauthncontextclassref): Verify the user's authentication context. - [`saml:FilterScopes`](./saml:filterscopes): Filter attribute values with scopes forbidden for an IdP. - [`saml:NameIDAttribute`](./saml:nameidattribute): Create an attribute based on the NameID we receive from the IdP. @@ -151,6 +153,8 @@ The following filters are included in the SimpleSAMLphp distribution: - [`saml:TransientNameID`](./saml:nameid): Generate transient NameID. - [`smartattributes:SmartID`](./smartattributes:smartattributes): Generate user ID attribute based on several attributes. +See the [Third-party modules](https://simplesamlphp.org/modules) page on the SimpleSAMLphp website +for externally hosted modules that may provide a processing filter. Writing your own Auth Proc Filter @@ -158,18 +162,20 @@ Writing your own Auth Proc Filter Look at the included *Auth Proc Filters* as examples. Copy the classes into your own module and start playing around. -Authentication processing filters are created by creating a class under `Auth/Process/` in a module. This class is expected to subclass `SimpleSAML_Auth_ProcessingFilter`. A filter must implement at least one function - the `process(&$request)`-function. This function can access the `$request`-array to add, delete and modify attributes, and can also do more advanced processing based on the SP/IdP metadata (which is also included in the `$request`-array). When this function returns, it is assumed that the filter has finished processing. +Authentication processing filters are created by creating a class under `Auth/Process/` in a module. This class is expected to subclass `\SimpleSAML\Auth\ProcessingFilter`. A filter must implement at least one function - the `process(&$request)`-function. This function can access the `$request`-array to add, delete and modify attributes, and can also do more advanced processing based on the SP/IdP metadata (which is also included in the `$request`-array). When this function returns, it is assumed that the filter has finished processing. -If a filter for some reason needs to redirect the user, for example to show a web page, it should save the current request. Upon completion it should retrieve the request, update it with the changes it is going to make, and call `SimpleSAML_Auth_ProcessingChain::resumeProcessing`. This function will continue processing the next configured filter. +If a filter for some reason needs to redirect the user, for example to show a web page, it should save the current request. Upon completion it should retrieve the request, update it with the changes it is going to make, and call `\SimpleSAML\Auth\ProcessingChain::resumeProcessing`. This function will continue processing the next configured filter. Requirements for authentication processing filters: - - Must be derived from the `SimpleSAML_Auth_ProcessingFilter`-class. + - Must be derived from the `\SimpleSAML\Auth\ProcessingFilter`-class. - If a constructor is implemented, it must first call the parent constructor, passing along all parameters, before accessing any of the parameters. In general, only the $config parameter should be accessed. - The `process(&$request)`-function must be implemented. If this function completes, it is assumed that processing is completed, and that the $request array has been updated. - - If the `process`-function does not return, it must at a later time call `SimpleSAML_Auth_ProcessingChain::resumeProcessing` with the new request state. The request state must be an update of the array passed to the `process`-function. + - If the `process`-function does not return, it must at a later time call `\SimpleSAML\Auth\ProcessingChain::resumeProcessing` with the new request state. The request state must be an update of the array passed to the `process`-function. - No pages may be shown to the user from the `process`-function. Instead, the request state should be saved, and the user should be redirected to a new page. This must be done to prevent unpredictable events if the user for example reloads the page. - No state information should be stored in the filter object. It must instead be stored in the request state array. Any changes to variables in the filter object may be lost. - The filter object must be serializable. It may be serialized between being constructed and the call to the `process`-function. This means that, for example, no database connections should be created in the constructor and later used in the `process`-function. +*Note*: An Auth Proc Filter will not work in the "Test authentication sources" option in the web UI of a SimpleSAMLphp IdP. It will only be triggered in conjunction with an actual SP. So you need to set up an IdP *and* and SP when testing your filter. + Don't hestitate to ask on the SimpleSAMLphp mailinglist if you have problems or questions, or want to share your *Auth Proc Filter* with others. diff --git a/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-authsource.md b/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-authsource.md index 514b96f361..0734aaa371 100644 --- a/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-authsource.md +++ b/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-authsource.md @@ -1,8 +1,8 @@ Creating authentication sources =============================== -All authentication sources are located in the `lib/Auth/Source/` directory in a module, and the class name is `sspmod_<module>_Auth_Source_<name>`. -The authentication source must extend the `SimpleSAML_Auth_Source` class or one of its subclasses. +All authentication sources are located in the `lib/Auth/Source/` directory in a module, and the class name is `\SimpleSAML\Module\<module>\Auth\Source\<name>`. +The authentication source must extend the `\SimpleSAML\Auth\Source` class or one of its subclasses. The "entry point" of an authentication source is the `authenticate()`-function. Once that function is called, the authentication module can do whatever it wishes to do. @@ -13,18 +13,18 @@ There are only two requirements: - Return control to SimpleSAMLphp after authenticating the user. If the module is able to authenticate the user without doing any redirects, it should just update the state-array and return. - If the module does a redirect, it must call `SimpleSAML_Auth_Source::completeAuth()` with the updated state array. + If the module does a redirect, it must call `\SimpleSAML\Auth\Source::completeAuth()` with the updated state array. Everything else is up to the module. If the module needs to redirect the user, for example because it needs to show the user a page asking for credentials, it needs to save the state array. -For that we have the `SimpleSAML_Auth_State` class. +For that we have the `\SimpleSAML\Auth\State` class. This is only a convenience class, and you are not required to use it (but its use is encouraged, since it handles some potential pitfalls). Saving state ------------ -The `SimpleSAML_Auth_State` class has two functions that you should use: +The `\SimpleSAML\Auth\State` class has two functions that you should use: `saveState($state, $stage)`, and `loadState($id, $stage)`. The `$stage` parameter must be an unique identifier for the current position in the authentication. It is used to prevent a malicious user from taking a state you save in one location, and give it to a different location. @@ -36,13 +36,13 @@ Username/password authentication -------------------------------- Since username/password authentication is quite a common operation, a base class has been created for this. -This is the `sspmod_core_Auth_UserPassBase` class, which is can be found as `modules/core/lib/Auth/UserPassBase.php`. +This is the `\SimpleSAML\Module\core\Auth\UserPassBase` class, which is can be found as `modules/core/lib/Auth/UserPassBase.php`. The only function you need to implement is the `login($username, $password)`-function. This function receives the username and password the user entered, and is expected to return the attributes of that user. If the username or password is incorrect, it should throw an error saying so: - throw new SimpleSAML_Error_Error('WRONGUSERPASS'); + throw new \SimpleSAML\Error\Error('WRONGUSERPASS'); "[Implementing custom username/password authentication](./simplesamlphp-customauth)" describes how to implement username/password authentication using that base class. @@ -51,7 +51,7 @@ Generic rules & requirements ---------------------------- - - Must be derived from the `SimpleSAML_Auth_Source`-class. + Must be derived from the `\SimpleSAML\Auth\Source`-class. **Rationale**: - Deriving all authentication sources from a single base class allows us extend all authentication sources by extending the base class. @@ -62,7 +62,7 @@ Generic rules & requirements **Rationale**: - PHP doesn't automatically call any parent constructor, so it needs to be done manually. - - The `$info`-array is used to provide information to the `SimpleSAML_Auth_Source` base class, and therefore needs to be included. + - The `$info`-array is used to provide information to the `\SimpleSAML\Auth\Source` base class, and therefore needs to be included. - Including the `$config`-array makes it possible to add generic configuration options that are valid for all authentication sources. - @@ -74,7 +74,7 @@ Generic rules & requirements This can be used if the authentication doesn't require user input, for example if the authentication can be done based on the IP-address of the user. - - If the `authenticate`-function does not return, it must at a later time call `SimpleSAML_Auth_Source::completeAuth` with the new state array. + If the `authenticate`-function does not return, it must at a later time call `\SimpleSAML\Auth\Source::completeAuth` with the new state array. The state array must be an update of the array passed to the `authenticate`-function. **Rationale**: diff --git a/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-automated_metadata.md b/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-automated_metadata.md index 54eba45109..cc40de2ceb 100644 --- a/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-automated_metadata.md +++ b/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-automated_metadata.md @@ -68,43 +68,43 @@ Now we are going to proceed to configure the metarefresh module. First, edit the Here's an example of a possible configuration for both the Kalmar Federation and UK Access Management Federation: - $config = array( - 'sets' => array( - 'kalmar' => array( - 'cron' => array('hourly'), - 'sources' => array( - array( + $config = [ + 'sets' => [ + 'kalmar' => [ + 'cron' => ['hourly'], + 'sources' => [ + [ 'src' => 'https://kalmar.feide.no/simplesaml/module.php/aggregator/?id=kalmarcentral&mimetype=text/plain&exclude=norway', - 'certificates' => array( + 'certificates' => [ 'current.crt', 'rollover.crt', - ), - 'template' => array( - 'tags' => array('kalmar'), - 'authproc' => array( - 51 => array('class' => 'core:AttributeMap', 'oid2name'), - ), - ), - ), - ), + ], + 'template' => [ + 'tags' => ['kalmar'], + 'authproc' => [ + 51 => ['class' => 'core:AttributeMap', 'oid2name'], + ], + ], + ], + ], 'expireAfter' => 60*60*24*4, // Maximum 4 days cache time. 'outputDir' => 'metadata/metarefresh-kalmar/', 'outputFormat' => 'flatfile', - ), - 'uk' => array( - 'cron' => array('hourly'), - 'sources' => array( - array( + ], + 'uk' => [ + 'cron' => ['hourly'], + 'sources' => [ + [ 'src' => 'http://metadata.ukfederation.org.uk/ukfederation-metadata.xml', 'validateFingerprint' => 'D0:E8:40:25:F0:B1:2A:CC:74:22:ED:C3:87:04:BC:29:BB:7B:9A:40', - ), - ), + ], + ], 'expireAfter' => 60*60*24*4, // Maximum 4 days cache time. 'outputDir' => 'metadata/metarefresh-ukaccess/', 'outputFormat' => 'serialize', - ), - ) - ); + ], + ] + ]; The configuration consists of one or more metadata sets. Each metadata set has its own configuration, representing a metadata set of sources. @@ -180,11 +180,11 @@ web-server write access to the output directories. Following the previous exampl Now you can configure SimpleSAMLphp to use the metadata fetched by metarefresh. Edit the main config.php file, and modify the `metadata.sources` directive accordingly: - 'metadata.sources' => array( - array('type' => 'flatfile'), - array('type' => 'flatfile', 'directory' => 'metadata/metarefresh-kalmar'), - array('type' => 'serialize', 'directory' => 'metadata/metarefresh-ukaccess'), - ), + 'metadata.sources' => [ + ['type' => 'flatfile'], + ['type' => 'flatfile', 'directory' => 'metadata/metarefresh-kalmar'], + ['type' => 'serialize', 'directory' => 'metadata/metarefresh-ukaccess'], + ], Remember that the `type` parameter here must match the `outputFormat` in the configuration of the module. diff --git a/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-changelog.md b/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-changelog.md index 3822f979f3..940d49ff65 100644 --- a/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-changelog.md +++ b/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-changelog.md @@ -6,6 +6,298 @@ SimpleSAMLphp changelog This document lists the changes between versions of SimpleSAMLphp. See the upgrade notes for specific information about upgrading. +## Version 1.17.8 + +Released 2019-11-20 + + * Resolved a security issue that exposed host information to unauthenticated users. See + [SSPSA 201911-02](https://simplesamlphp.org/security/201911-02). + +### consentAdmin + + * Fixed an issue with CSS and Javascript not loading for the module in the new user + interface. + +## Version 1.17.7 + +Released 2019-11-06 + + * Resolved a security issue that allows to bypass signature validation. See + [SSPSA 201911-01](https://simplesamlphp.org/security/201911-01). + +## Version 1.17.6 + +Released 2019-08-29 + + * Fixed a regression with logout database initialization when using MySQL (#1177). + * Fixed an issue with logout when using iframes (#1191). + * Fixed an issue causing log entries to be logged with incorrect relative order (#1107). + +## Version 1.17.5 + +Released 2019-08-02 + + * Fixed a bug in the SP API where NameID objects weren't taken care of (introduced in 1.17.0). + * Fixed a regression where MetaDataStorageHandlerPdo::getMetaData() would not return a value (#1165). + * Fixed an issue with table indexes (#1089). + * Fixed an issue with table migrations on SQlite (#1169). + * Fixed an issue with generated eduPersonTargetedID lacking a format specified (#1135). + * Updated composer dependencies. + +## Version 1.17.4 + +Released 2019-07-11 + + * Fix an issue introduced in 1.17.3 with `enable.http_post`. + +## Version 1.17.3 + +Released 2019-07-10 + + * Resolved a security issue that could lead to a reflected XSS. See + [SSPSA 201907-01](https://simplesamlphp.org/security/201907-01). + * Add new options `session.cookie.samesite` and `language.cookie.samesite` that can be + used to set a specific value for the cookies' SameSite attribute. The default it not + to set it. + * Upgraded jQuery to version 3.4. + * HHVM is no longer supported. + * Fixed a bug (#926) where dynamic metadata records where not loaded from a database. + * Fixed an issue when an error occurs during a passive authentication request. + * Handle duplicate insertions for SQL Server. + * Fix a bug in Short SSO Interval warning filter. + * Apply a workaround for SIGSEGVs during session creation with PHP-FPM 7.3. + +### adfs + * Fixed a missing option to supply a passphrase for the ADFS IDP signing certificate. + +### authlinkedin + * This module has been removed now that LinkedIn no longer supports OAuth1. + If you relied on this module, you may consider migrating to the + [authoauth2 module](https://github.com/cirrusidentity/simplesamlphp-module-authoauth2). + A migration guide for LinkedIn authentication is included in their README. + +## Version 1.17.2 + +Released 2019-04-02 + + * Fixed that generated metadata was missing some information + when PHP's zend.assertions option is set to < 1. + * Fixed that MDUI Keywords and Logo were not parsed from metadata. + * Fixed DiscoPower module tab display. + * Fixed use group name in Attribute Add Users Groups filter. + * Add metadatadir setting to the default config template. + * Fixed exception processing in loadExceptionState(). + * Fixed preferredidp in built-in 'links'-style discovery. + +## Version 1.17.1 + +Released 2019-03-07 + + * Fixed an issue with composer that made it impossible to install modules + if SimpleSAMLphp was installed itself with the provided package (tar.gz file). + +## Version 1.17.0 + +Released 2019-03-07 + + * Introduce a new experimental user interface based on Twig templates. + The new Twig templates co-exist next to the old ones and come + with a new look-and-feel for SimpleSAMLphp and independent interfaces for + users and administrators. This new interface uses also a new build system + to generate bundled assets. + * Introduce Symfony-style routing and dependency injection(#966). + * Generate session IDs complying with PHP config settings when using the PHP + session handler (#569). + * Update OpenSSL RSA bit length in docs (#993). + * Update all code, configuration templates and documentation to PHP + short array syntax. + * All classes moved to namespaces and code reformatted to PSR-2. + * Use bcrypt for new password hashes, old ones will remain working (#996). + * Many code cleanups. + * Update the SAML2 library dependency to 3.2.5. + * Update the Clipboard.JS library dependency to 2.0.4. + * Translated to Zulu and Xhosa. + * Multiple bug fixes and corrections. + +### Interoperability + * The minimum PHP version required is now 5.5. + * Fixed compatibility with PHP 7.3 and HVVM. + * SimpleSAMLphp can now be used with applications that use Twig 2 and/or Symfony 4. + * The SAML2 library now uses getters/setters to manipulate objects properties. + +### authfacebook + * Fix facebook compatibility (query parameters). + +### authorize + * Add the possibility to configure a custom rejecttion message. + +### consent + * The module is now disabled by default. + +### core + * Allow `core:PHP` to manipulate the entire state array. + * IdP initiated login: add compatibility with Shibboleth parameters. + +### multiauth + * Added a `preselect` configuration option to skip authsource selection (#1005). + +### negotiate + * The `keytab` setting now allows for relative paths too. + +### preprodwarning + * This module is now deprecated. Use the `production` configuration + option instead; set it to `false` to show a pre-production warning + before authentication. + +### saml + * Add initial support for SAML Subject ID Attributes. + * Allow to specify multiple supported NameIdFormats in IdP hosted and SP + remote metadata. + * Allow to specify NameIDPolicy Format and AllowCreate in hosted SP + and remote IdP configuration. Restore the possibility to omit it from + AuthnRequests entirely (#984). + * Add a `assertion.allowed_clock_skew` setting to influence how lenient + we should be with the timestamps in received SAML messages. + * If the Issuer of a SAML response does not match the entity we sent the + request to, log a warning instead of bailing out with an exception. + * Allow setting the AudienceRestriction in SAML2 requests (#998). + * Allow disabling the Scoping element in SP and remote IdP configuration with + the `disable_scoping` option, for compatibility with ADFS which does not + accept the element (#985). + * Receiving an eduPersonTargetedID in string form will no longer break + parsing of the assertion. + +### sanitycheck + * Translated into several languages. + +## Version 1.16.3 + +Released 2018-12-20 + + * Resolved a security issue that could expose the user's credentials locally. See + [SSPSA 201812-01](https://simplesamlphp.org/security/201812-01). + * Downgraded the level of log messages regarding the `userid.attribute` configuration option + from _warning_ to _debug_. + * Make the `attr` configuration option of the _negotiate_ allow both a string and an array. + * Look for the _keytab_ file used by the _negotiate_ module in the `cert` directory, accepting + both absolute and relative paths. + * Fixed some broken links. + * Other minor bugfixes. + +## Version 1.16.2 + +Released 2018-09-28 + + * Fixed an issue with PHP sessions in PHP 7.2. + * Fixed a bug in the OAuth module. + * Make schema validation work again. + * Properly document the `saml:AuthnContextClassRef` authentication processing filter. + * Fixed an issue that made it impossible to install the software with composer using the + "stable" minimum-stability setting. + * Changed the default authentication context class to "PasswordProtectedTransport" by default + when authentication happened on an HTTPS exchange. + +## Version 1.16.1 + +Released 2018-09-07 + + * Fix a bug preventing the consent page from showing. + * Add Catalan to the list of available languages. + +## Version 1.16.0 + +Released 2018-09-06 + +### Changes + * Default signature algorithm is now RSA-SHA256. + * Renamed class `SimpleSAML_Error_BadUserInnput` to `SimpleSAML_Error_BadUserInput` + * PHP 7.2 compatibility, including removing deprecated use of assert with string. + * Avoid logging database credentials in backtraces. + * Fix edge case in getServerPort. + * Updated Spanish translation. + * Improvements to documentation, testsuite, code quality and coding style. + +### New features + * Added support for SAML "Enhanced Client or Proxy" (ECP) protocol, + IdP side with HTTP Basic Authentication as authentication method. + See the [ECP IdP documentation](./simplesamlphp-ecp-idp) for details. + * New option `sendmail_from`, the from address for email sent by SSP. + * New option `options` for PDO database connections, e.g. for TLS setup. + * New option `search.scope` for LDAP authsources. + * Add support for the DiscoHints IPHint metadata property. + * Add support to specify metadata XML in config with the `xml` parameter, + next to the exising `file` and `url` options. + * Also support CGI/RewriteRule setups that set the `REDIRECT_SIMPLESAMLPHP_CONFIG_DIR` + environment variable next to regular `SIMPLESAMLPHP_CONFIG_DIR`. + * Support creating an AuthSource via factory, for example useful in tests. + * Support preloading of a virtual config file via `SimpleSAML_Configuration::setPreLoadedConfig` + to allow for dynamic population of authsources.php. + * Add basic documentation on Nginx configuration. + * Test authentication: optionally show AuthData array. + * Improve performance of PDO Metadata Storage handler entity lookup. + +### adfs + * Make signature algorithm configurable with `signature.algorithm`. + * Use configuration assertion lifetime when available. + * Use `adfs:wreply` parameter when available. + +### authmyspace + * Module removed because service is no longer available. + +### cas + * Respect all LDAP options in LDAP call. + +### casserver + * Module removed; superseded by externally hosted module. + +### consent + * Sort attribute values for consent. + * Fix table layout for MySQL > 5.6. + * Rename `noconsentattributes` to `attributes.exclude`; the former + is now considered deprecated. + +### consentAdmin + * Work better with TargetedIDs when operating as a proxy. + * Add `attributes.exclude` option to correspond to the same option + in the Consent module. + +### core + * StatisticsWithAttribute: add `passive-` prefix when logging passive + requests, set new option `skipPassive` to skip logging these altogether. + * Replace deprecated `create_function` with an anonymous function. + * New authproc filter Cardinality to enforce attribute cardinality. + * SQLPermanentStorage: proper expiration of stored values. + * AttributeLimit: new options `regex` and `ignoreCase`. + * AttributeMap: prevent possible infinite loop with some PHP versions. + +### ldap + * AttributeAddUsersGroups: if `attribute.groupname` is set, use the + configured attribute as the group name rather than the DN. + * Also base64encode the `ms-ds-consistencyguid` attribute. + +### metarefresh + * Return XML parser error for better debugging of problems. + * Only actually parse metadata types that have been enabled. + * Fix missing translation. + +### Oauth + * Make module HTTP proxy-aware. + * Remove unused demo app. + +### saml + * AttributeConsumingService: allow to set isDefault and index options. + * Encrypted attributes in an assertion are now decrypted correctly. + * Prefer the HTTP-Redirect binding for AuthnRequests if available. + +### smartattributes + * Fix to make the `add_authority` option work. + +### sqlauth + * The module is now disabled by default. + +### statistics + * Show a decent error message when no data is available. + ## Version 1.15.4 Released 2018-03-02 @@ -171,6 +463,9 @@ Released 2017-11-20 * Make sure we log the user out before reauthenticating. * More robust handling of IDPList support in proxy mode. * Increased `_authSource` field length in Logout Store. + * We now send the eduPersonTargetedID attribute in the correct + NameID XML form, instead of the incorrect simple string. We will also + refuse to parse an assertion with an eduPersonTargetedID in 'string' format. ### `smartattributes` * Fix SmartName authproc that failed to load. @@ -1442,7 +1737,7 @@ Updates to `config.php`. Please check for updates in your local modified configu * Verification of the Receipient attribute in the response. Will improve security if for some reason an IdP is not includeding sufficient Audience restrictions. * Added hook to let modules tell about themself moduleinfo hook. * Improved cron mails - * Improved santity check exception handling + * Improved sanity check exception handling * Preserver line breaks in stack trace UI * Improvements to WS-Federation support: dynamic realms, logout etc. * Better handling of presentation of JPEG photos as attributes. diff --git a/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-customauth.md b/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-customauth.md index 8f7c30f9fd..ac9b04e245 100644 --- a/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-customauth.md +++ b/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-customauth.md @@ -1,7 +1,7 @@ Implementing custom username/password authentication ==================================================== -This is a step-by-step guide for creating a custom username/password [authentication source](./simplesamlphp-authsource) for SimpleSAMLphp. +This is a step-by-step guide for creating a custom username/password [authentication source](./simplesamlphp-authsource.md) for SimpleSAMLphp. An authentication source is responsible for authenticating the user, typically by getting a username and password, and looking it up in some sort of database. <!-- {{TOC}} --> @@ -9,7 +9,7 @@ An authentication source is responsible for authenticating the user, typically b Create a custom module ---------------------- -All custom code for SimpleSAMLphp should be contained in a [module](./simplesamlphp-modules). +All custom code for SimpleSAMLphp should be contained in a [module](./simplesamlphp-modules.md). This ensures that you can upgrade your SimpleSAMLphp installation without overwriting your own code. In this example, we will call the module `mymodule`. It will be located under `modules/mymodule`. @@ -40,31 +40,31 @@ To begin with, we will create a very simple authentication source, where the use Create the file `modules/mymodule/lib/Auth/Source/MyAuth.php` with the following contents: <?php - class sspmod_mymodule_Auth_Source_MyAuth extends sspmod_core_Auth_UserPassBase { + class MyAuth extends \SimpleSAML\Module\core\Auth\UserPassBase { protected function login($username, $password) { if ($username !== 'theusername' || $password !== 'thepassword') { - throw new SimpleSAML_Error_Error('WRONGUSERPASS'); + throw new \SimpleSAML\Error\Error('WRONGUSERPASS'); } - return array( - 'uid' => array('theusername'), - 'displayName' => array('Some Random User'), - 'eduPersonAffiliation' => array('member', 'employee'), - ); + return [ + 'uid' => ['theusername'], + 'displayName' => ['Some Random User'], + 'eduPersonAffiliation' => ['member', 'employee'], + ]; } } Some things to note: - - The classname is `sspmod_mymodule_Auth_Source_MyAuth`. + - The classname is `\SimpleSAML\Module\mymodule\Auth\Source\MyAuth`. This tells SimpleSAMLphp to look for the class in `modules/mymodule/lib/Auth/Source/MyAuth.php`. - - Our authentication source subclassese `sspmod_core_Auth_UserPassBase`. + - Our authentication source subclassese `\SimpleSAML\Module\core\Auth\UserPassBase`. This is a helper-class that implements much of the common code needed for username/password authentication. - The `login` function receives the username and password the user enters. It is expected to authenticate the user. If the username or password is correct, it must return a set of attributes for the user. - Otherwise, it must throw the `SimpleSAML_Error_Error('WRONGUSERPASS');` exception. + Otherwise, it must throw the `\SimpleSAML\Error\Error('WRONGUSERPASS');` exception. - Attributes are returned as an associative array of `name => values` pairs. All attributes can have multiple values, so the values are always stored in an array. @@ -78,26 +78,26 @@ Before we can test our authentication source, we must add an entry for it in `co The entry looks like this: - 'myauthinstance' => array( + 'myauthinstance' => [ 'mymodule:MyAuth', - ), + ], You can add it to the beginning of the list, so that the file looks something like this: <?php - $config = array( - 'myauthinstance' => array( + $config = [ + 'myauthinstance' => [ 'mymodule:MyAuth', - ), + ], /* Other authentication sources follow. */ - ); + ]; `myauthinstance` is the name of this instance of the authentication source. (You are allowed to have multiple instances of an authentication source with different configuration.) The instance name is used to refer to this authentication source in other configuration files. The first element of the configuration of the authentication source must be `'mymodule:MyAuth'`. -This tells SimpleSAMLphp to look for the `sspmod_mymodule_Auth_Source_MyAuth` class. +This tells SimpleSAMLphp to look for the `\SimpleSAML\Module\mymodule\Auth\Source\MyAuth` class. Testing our authentication source @@ -124,7 +124,7 @@ In that file you should locate the `auth`-option for your IdP, and change it to <?php /* ... */ - $metadata['__DYNAMIC:1__'] = array( + $metadata['__DYNAMIC:1__'] = [ /* ... */ /* * Authentication source to use. Must be one that is configured in @@ -132,7 +132,7 @@ In that file you should locate the `auth`-option for your IdP, and change it to */ 'auth' => 'myauthinstance', /* ... */ - ); + ]; You can then test logging in to the IdP. If you have logged in previously, you may need to log out first. @@ -168,7 +168,7 @@ We can then use the properties in the `login` function. The complete class file should look like this: <?php - class sspmod_mymodule_Auth_Source_MyAuth extends sspmod_core_Auth_UserPassBase { + class MyAuth extends \SimpleSAML\Module\core\Auth\UserPassBase { private $username; private $password; @@ -187,24 +187,24 @@ The complete class file should look like this: protected function login($username, $password) { if ($username !== $this->username || $password !== $this->password) { - throw new SimpleSAML_Error_Error('WRONGUSERPASS'); + throw new \SimpleSAML\Error\Error('WRONGUSERPASS'); } - return array( - 'uid' => array($this->username), - 'displayName' => array('Some Random User'), - 'eduPersonAffiliation' => array('member', 'employee'), - ); + return [ + 'uid' => [$this->username], + 'displayName' => ['Some Random User'], + 'eduPersonAffiliation' => ['member', 'employee'], + ]; } } We can then update our entry in `config/authsources.php` with the configuration options: - 'myauthinstance' => array( + 'myauthinstance' => [ 'mymodule:MyAuth', 'username' => 'theconfigusername', 'password' => 'theconfigpassword', - ), + ], Next, you should go to the "Test configured authentication sources" page again, and test logging in. Note that we have updated the username & password to "theconfigusername" and "theconfigpassword". @@ -214,7 +214,7 @@ Note that we have updated the username & password to "theconfigusername" and "th A more complete example - custom database authentication -------------------------------------------------------- -The [sqlauth:SQL](./sqlauth:sql) authentication source can do simple authentication against SQL databases. +The [sqlauth:SQL](../modules/sqlauth/docs/sql.md) authentication source can do simple authentication against SQL databases. However, in some cases it cannot be used, for example because the database layout is too complex, or because the password validation routines cannot be implemented in SQL. What follows is an example of an authentication source that fetches an user from a database, and validates the password using a custom function. @@ -245,7 +245,7 @@ A SSHA password is created like this: The class follows: <?php - class sspmod_mymodule_Auth_Source_MyAuth extends sspmod_core_Auth_UserPassBase { + class MyAuth extends \SimpleSAML\Module\core\Auth\UserPassBase { /* The database DSN. * See the documentation for the various database drivers for information about the syntax: @@ -253,9 +253,10 @@ The class follows: */ private $dsn; - /* The database username & password. */ + /* The database username, password & options. */ private $username; private $password; + private $options; public function __construct($info, $config) { parent::__construct($info, $config); @@ -272,6 +273,12 @@ The class follows: throw new Exception('Missing or invalid password option in config.'); } $this->password = $config['password']; + if (isset($config['options']) { + if (!is_array($config['options])) { + throw new Exception('Missing or invalid options option in config.'); + } + $this->options = $config['options']; + } } /** @@ -294,7 +301,7 @@ The class follows: protected function login($username, $password) { /* Connect to the database. */ - $db = new PDO($this->dsn, $this->username, $this->password); + $db = new PDO($this->dsn, $this->username, $this->password, $this->options); $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); /* Ensure that we are operating with UTF-8 encoding. @@ -307,7 +314,7 @@ The class follows: */ $st = $db->prepare('SELECT username, password_hash, full_name FROM userdb WHERE username=:username'); - if (!$st->execute(array('username' => $username))) { + if (!$st->execute(['username' => $username])) { throw new Exception('Failed to query database for user.'); } @@ -316,22 +323,22 @@ The class follows: if (!$row) { /* User not found. */ SimpleSAML\Logger::warning('MyAuth: Could not find user ' . var_export($username, TRUE) . '.'); - throw new SimpleSAML_Error_Error('WRONGUSERPASS'); + throw new \SimpleSAML\Error\Error('WRONGUSERPASS'); } /* Check the password. */ if (!$this->checkPassword($row['password_hash'], $password)) { /* Invalid password. */ SimpleSAML\Logger::warning('MyAuth: Wrong password for user ' . var_export($username, TRUE) . '.'); - throw new SimpleSAML_Error_Error('WRONGUSERPASS'); + throw new \SimpleSAML\Error\Error('WRONGUSERPASS'); } /* Create the attribute array of the user. */ - $attributes = array( - 'uid' => array($username), - 'displayName' => array($row['full_name']), - 'eduPersonAffiliation' => array('member', 'employee'), - ); + $attributes = [ + 'uid' => [$username], + 'displayName' => [$row['full_name']], + 'eduPersonAffiliation' => ['member', 'employee'], + ]; /* Return the attributes. */ return $attributes; @@ -341,10 +348,10 @@ The class follows: And configured in `config/authsources.php`: - 'myauthinstance' => array( + 'myauthinstance' => [ 'mymodule:MyAuth', 'dsn' => 'mysql:host=sql.example.org;dbname=userdatabase', 'username' => 'db_username', 'password' => 'secret_db_password', - ), + ], diff --git a/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-database.md b/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-database.md index 663fdce150..b9a797a00b 100644 --- a/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-database.md +++ b/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-database.md @@ -20,12 +20,12 @@ Getting Started --------------- If you are just using the already configured database, which would normally be the case, all you need to do is get the global instance of the Database class. - $db = SimpleSAML\Database::getInstance(); + $db = \SimpleSAML\Database::getInstance(); If there is a requirement to connect to an alternate database server (ex. authenticating users that exist on a different SQL server or database) you can specify an alternate configuration. - $config = new SimpleSAML_Configuration($myconfigarray, "mymodule/lib/Auth/Source/myauth.php"); - $db = SimpleSAML\Database::getInstance($config); + $config = new \SimpleSAML\Configuration($myconfigarray, "mymodule/lib/Auth/Source/myauth.php"); + $db = \SimpleSAML\Database::getInstance($config); That will create a new instance of the database, separate from the global instance, specific to the configuration defined in $myconfigarray. If you are going to specify an alternate config, your configuration array must contain the same keys that exist in the master config (database.dsn, database.username, database.password, database.prefix, etc). @@ -47,20 +47,20 @@ Since the database class allows administrators to configure master and slave dat The write function takes 2 parameters: SQL, params. $table = $db->applyPrefix("test"); - $values = array( + $values = [ 'id' => 20, 'data' => 'Some data', - ); + ]; $query = $db->write("INSERT INTO $table (id, data) VALUES (:id, :data)", $values); The values specified in the $values array will be bound to the placeholders and will be executed on the master. By default, values are binded as PDO::PARAM_STR. If you need to override this, you can specify it in the values array. $table = $db->applyPrefix("test"); - $values = array( - 'id' => array(20, PDO::PARAM_INT), + $values = [ + 'id' => [20, PDO::PARAM_INT], 'data' => 'Some data', - ); + ]; $query = $db->write("INSERT INTO $table (id, data) VALUES (:id, :data)", $values); @@ -75,17 +75,17 @@ Since the database class allows administrators to configure master and slave dat The read function takes 2 parameters: SQL, params. $table = $db->applyPrefix("test"); - $values = array( + $values = [ 'id' => 20, - ); + ]; $query = $db->read("SELECT * FROM $table WHERE id = :id", $values); The values specified in the $values array will be bound to the placeholders and will be executed on the selected slave. By default, values are binded as PDO::PARAM_STR. If you need to override this, you can specify it in the values array. $table = $db->applyPrefix("test"); - $values = array( - 'id' => array(20, PDO::PARAM_INT), - ); + $values = [ + 'id' => [20, PDO::PARAM_INT], + ]; $query = $db->read("SELECT * FROM $table WHERE id = :id", $values); diff --git a/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-ecp-idp.md b/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-ecp-idp.md new file mode 100644 index 0000000000..566df182d6 --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-ecp-idp.md @@ -0,0 +1,74 @@ +Adding Enhanced Client or Proxy (ECP) Profile support to the IdP +=============================================================== + +This document describes the necessary steps to enable support for the [SAML V2.0 Enhanced Client or Proxy Profile Version 2.0](http://docs.oasis-open.org/security/saml/Post2.0/saml-ecp/v2.0/cs01/saml-ecp-v2.0-cs01.pdf) on a simpleSAMLphp Identity Provider (IdP). + +The SAML V2.0 Enhanced Client or Proxy (ECP) profile is a SSO profile for use with HTTP, and clients with the capability to directly contact a principal's identity provider(s) without requiring discovery and redirection by the service provider, as in the case of a browser. It is particularly useful for desktop or server-side HTTP clients. + +Limitations +----------- +* Authentication must be done via [HTTP Basic authentication](https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication#Basic_authentication_scheme). +* Authentication must not require user interaction (e.g. auth filters that require user input). +* Channel Bindings are unsupported. +* "Holder of Key" Subject Confirmation is unsupported. + +This feature has been tested to work with Microsoft Office 365, but other service providers may require features of the ECP profile that are currently unsupported! + +Enabling ECP Profile on the IdP +----------------------------------- + +To enable the IdP to send ECP assertions you must add the `saml20.ecp` option to the `saml20-idp-hosted` metadata file: + + $metadata['__DYNAMIC:1__'] = [ + [....] + 'auth' => 'example-userpass', + 'saml20.ecp' => true, + ]; + +Note: authentication filters that require interaction with the user will not work with ECP. + +Add new metadata to SPs +----------------------- + +After enabling the ECP Profile your IdP metadata will change. An additional ECP `SingleSignOnService` endpoint is added. +You therefore need to update the metadata for your IdP at your SPs. +The `saml20-idp-remote` metadata for simpleSAMLphp SPs should contain something like the following code: + + 'SingleSignOnService' => + array ( + 0 => + array ( + 'Binding' => 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect', + 'Location' => 'https://idp.example.org/simplesaml/saml2/idp/SSOService.php', + ), + 1 => + array ( + 'index' => 0, + 'Location' => 'https://didp.example.org/simplesaml/saml2/idp/SSOService.php', + 'Binding' => 'urn:oasis:names:tc:SAML:2.0:bindings:SOAP', + ), + ), + +SP metadata on the IdP +---------------------- + +A SP using the ECP Profile must have an `AssertionConsumerService` endpoint supporting that profile. +This means that you have to use the complex endpoint format in `saml20-sp-remote` metadata. +In general, this should look like the following code: + + 'AssertionConsumerService' => + array ( + 0 => + array ( + 'Binding' => 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST', + 'Location' => 'https://sp.example.org/Shibboleth.sso/SAML2/POST', + 'index' => 1, + ), + 1 => + array ( + 'Binding' => 'urn:oasis:names:tc:SAML:2.0:bindings:PAOS', + 'Location' => 'https://sp.example.org/ECP', + 'index' => 2, + ), + ), + diff --git a/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-errorhandling.md b/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-errorhandling.md index 278cad2c24..f7251550b6 100644 --- a/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-errorhandling.md +++ b/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-errorhandling.md @@ -14,7 +14,7 @@ This document describes the way errors and exceptions are handled in authenticat The basic goal is to be able to throw an exception during authentication, and then have that exception transported back to the SP in a way that the SP understands. This means that internal SimpleSAMLphp exceptions must be mapped to transport specific error codes for the various transports that are supported by SimpleSAMLphp. -E.g.: When a `SimpleSAML_Error_NoPassive` error is thrown by an authentication processing filter in a SAML 2.0 IdP, we want to map that exception to the `urn:oasis:names:tc:SAML:2.0:status:NoPassive` status code. +E.g.: When a `\SimpleSAML\Error\NoPassive` error is thrown by an authentication processing filter in a SAML 2.0 IdP, we want to map that exception to the `urn:oasis:names:tc:SAML:2.0:status:NoPassive` status code. That status code should then be returned to the SP. @@ -26,34 +26,34 @@ The simplest case is if you want to throw it during the `authenticate()`-method In those methods, you can just throw an exception: public function process(&$state) { - if ($state['something'] === FALSE) { - throw new SimpleSAML_Error_Exception('Something is wrong...'); + if ($state['something'] === false) { + throw new \SimpleSAML\Error\Exception('Something is wrong...'); } } Exceptions thrown at this stage will be caught and delivered to the appropriate error handler. -If you want to throw an exception outside of those methods, i.e. after you have done a redirect, you need to use the `SimpleSAML_Auth_State::throwException()` function: +If you want to throw an exception outside of those methods, i.e. after you have done a redirect, you need to use the `\SimpleSAML\Auth\State::throwException()` function: <?php $id = $_REQUEST['StateId']; - $state = SimpleSAML_Auth_State::loadState($id, 'somestage...'); - SimpleSAML_Auth_State::throwException($state, - new SimpleSAML_Error_Exception('Something is wrong...')); + $state = \SimpleSAML\Auth\State::loadState($id, 'somestage...'); + \SimpleSAML\Auth\State::throwException($state, + new \SimpleSAML\Error\Exception('Something is wrong...')); ?> -The `SimpleSAML_Auth_State::throwException` function will then transfer your exception to the appropriate error handler. +The `\SimpleSAML\Auth\State::throwException` function will then transfer your exception to the appropriate error handler. ### Note -Note that we use the `SimpleSAML_Error_Exception` class in both cases. +Note that we use the `\SimpleSAML\Error\Exception` class in both cases. This is because the delivery of the exception may require a redirect to a different web page. In those cases, the exception needs to be serialized. The normal `Exception` class in PHP isn't always serializable. -If you throw an exception that isn't a subclass of the `SimpleSAML_Error_Exception` class, your exception will be converted to an instance of `SimpleSAML_Error_UnserializableException`. -The `SimpleSAML_Auth_State::throwException` function does not accept any exceptions that does not subclass the `SimpleSAML_Error_Exception` class. +If you throw an exception that isn't a subclass of the `\SimpleSAML\Error\Exception` class, your exception will be converted to an instance of `\SimpleSAML\Error\UnserializableException`. +The `\SimpleSAML\Auth\State::throwException` function does not accept any exceptions that does not subclass the `\SimpleSAML\Error\Exception` class. Returning specific SAML 2 errors @@ -61,24 +61,24 @@ Returning specific SAML 2 errors By default, all thrown exceptions will be converted to a generic SAML 2 error. In some cases, you may want to convert the exception to a specific SAML 2 status code. -For example, the `SimpleSAML_Error_NoPassive` exception should be converted to a SAML 2 status code with the following properties: +For example, the `\SimpleSAML\Error\NoPassive` exception should be converted to a SAML 2 status code with the following properties: * The top-level status code should be `urn:oasis:names:tc:SAML:2.0:status:Responder`. * The second-level status code should be `urn:oasis:names:tc:SAML:2.0:status:NoPassive`. * The status message should contain the cause of the exception. -The `sspmod_saml_Error` class represents SAML 2 errors. +The `\SimpleSAML\Module\saml\Error` class represents SAML 2 errors. It represents a SAML 2 status code with three elements: the top-level status code, the second-level status code and the status message. The second-level status code and the status message is optional, and can be `NULL`. -The `sspmod_saml_Error` class contains a helper function named `fromException`. +The `\SimpleSAML\Module\saml\Error` class contains a helper function named `fromException`. The `fromException()` function is used by `www/saml2/idp/SSOService.php` to return SAML 2 errors to the SP. The function contains a list which maps various exceptions to specific SAML 2 errors. If it is unable to convert the exception, it will return a generic SAML 2 error describing the original exception in its status message. To return a specific SAML 2 error, you should: -* Create a new exception class for your error. This exception class must subclass `SimpleSAML_Error_Exception`. +* Create a new exception class for your error. This exception class must subclass `\SimpleSAML\Error\Exception`. * Add that exception to the list in `fromException()`. * Consider adding the exception to `toException()` in the same file. (See the next section.) @@ -93,11 +93,11 @@ Converting SAML 2 errors to normal exceptions --------------------------------------------- On the SP side, we want to convert SAML 2 errors to SimpleSAMLphp exceptions again. -This is handled by the `toException()` method in `sspmod_saml_Error`. +This is handled by the `toException()` method in `\SimpleSAML\Module\saml\Error`. The assertion consumer script of the SAML 2 authentication source (`modules/saml2/sp/acs.php`) uses this method. The result is that generic exceptions are thrown from that authentication source. -For example, `NoPassive` errors will be converted back to instances of `SimpleSAML_Error_NoPassive`. +For example, `NoPassive` errors will be converted back to instances of `\SimpleSAML\Error\NoPassive`. Other protocols @@ -113,9 +113,9 @@ Technical details This section attempts to describe the internals of the error handling framework. -### `SimpleSAML_Error_Exception` +### `\SimpleSAML\Error\Exception` -The `SimpleSAML_Error_Exception` class extends the normal PHP `Exception` class. +The `\SimpleSAML\Error\Exception` class extends the normal PHP `Exception` class. It makes the exceptions serializable by overriding the `__sleep()` method. The `__sleep()` method returns all variables in the class which should be serialized when saving the class. @@ -136,7 +136,7 @@ This may be confusing since the new stack trace leads into the `unserialize()` f It is therefore recommended to use the getBacktrace() method. -### `SimpleSAML_Auth_State` +### `\SimpleSAML\Auth\State` There are two methods in this class that deals with exceptions: @@ -147,44 +147,44 @@ There are two methods in this class that deals with exceptions: #### `throwException` This method delivers the exception to the code that initialized the exception handling in the authentication state. -That would be `SimpleSAML_Auth_Default` for authtentication sources, and `www/saml2/idp/SSOService.php` for processing filters. +That would be `\SimpleSAML\Auth\DefaultAuth` for authtentication sources, and `www/saml2/idp/SSOService.php` for processing filters. To configure how and where the exception should be delivered, there are two fields in the state-array which can be set: -* `SimpleSAML_Auth_State::EXCEPTION_HANDLER_FUNC`, in which case the exception will be delivered by a function call to the function specified in that field. -* `SimpleSAML_Auth_State::EXCEPTION_HANDLER_URL`, in which case the exception will be delivered by a redirect to the URL specified in that field. +* `\SimpleSAML\Auth\State::EXCEPTION_HANDLER_FUNC`, in which case the exception will be delivered by a function call to the function specified in that field. +* `\SimpleSAML\Auth\State::EXCEPTION_HANDLER_URL`, in which case the exception will be delivered by a redirect to the URL specified in that field. If the exception is delivered by a function call, the function will be called with two parameters: The exception and the state array. -If the exception is delivered by a redirect, SimpleSAML_Auth_State will save the exception in a field in the state array, pass a parameter with the id of the state array to the URL. -The `SimpleSAML_Auth_State::EXCEPTION_PARAM` constant contains the name of that parameter, while the `SimpleSAML_Auth_State::EXCEPTION_DATA` constant holds the name of the field where the exception is saved. +If the exception is delivered by a redirect, \SimpleSAML\Auth\State will save the exception in a field in the state array, pass a parameter with the id of the state array to the URL. +The `\SimpleSAML\Auth\State::EXCEPTION_PARAM` constant contains the name of that parameter, while the `\SimpleSAML\Auth\State::EXCEPTION_DATA` constant holds the name of the field where the exception is saved. #### `loadException` -To retrieve the exception, the application should check for the state parameter in the request, and then retrieve the state array by calling `SimpleSAML_Auth_State::loadExceptionState()`. -The exception can be located in a field named `SimpleSAML_Auth_State::EXCEPTION_DATA`. +To retrieve the exception, the application should check for the state parameter in the request, and then retrieve the state array by calling `\SimpleSAML\Auth\State::loadExceptionState()`. +The exception can be located in a field named `\SimpleSAML\Auth\State::EXCEPTION_DATA`. The following code illustrates this behaviour: - if (array_key_exists(SimpleSAML_Auth_State::EXCEPTION_PARAM, $_REQUEST)) { - $state = SimpleSAML_Auth_State::loadExceptionState(); - $exception = $state[SimpleSAML_Auth_State::EXCEPTION_DATA]; + if (array_key_exists(\SimpleSAML\Auth\State::EXCEPTION_PARAM, $_REQUEST)) { + $state = \SimpleSAML\Auth\State::loadExceptionState(); + $exception = $state[\SimpleSAML\Auth\State::EXCEPTION_DATA]; /* Process exception. */ } -### `SimpleSAML_Auth_Default` +### `\SimpleSAML\Auth\DefaultAuth` This class accepts an `$errorURL` parameter to the `initLogin()` function. -This parameter is stored in the `SimpleSAML_Auth_State::EXCEPTION_HANDLER_URL` of the state array. +This parameter is stored in the `\SimpleSAML\Auth\State::EXCEPTION_HANDLER_URL` of the state array. Exceptions thrown by the authentication source will be delivered to that URL. It also wraps the call to the `authenticate()` function inside a try-catch block. Any exceptions thrown during that function call will be delivered to the URL specified in the `$errorURL` parameter. -This is done for consistency, since `SimpleSAML_Auth_Default` never transfers control back to the caller by returning. +This is done for consistency, since `\SimpleSAML\Auth\DefaultAuth` never transfers control back to the caller by returning. -### `SimpleSAML_Auth_ProcessingChain` +### `\SimpleSAML\Auth\ProcessingChain` This class requires the caller to add the error handler to the state array before calling the `processState()` function. Exceptions thrown by the processing filters will be delivered directly to the caller of `processState()` if possible. @@ -195,9 +195,9 @@ The result will be delivered directly if it is possible, but if not, it will be The code for handling this becomes something like: - if (array_key_exists(SimpleSAML_Auth_State::EXCEPTION_PARAM, $_REQUEST)) { - $state = SimpleSAML_Auth_State::loadExceptionState(); - $exception = $state[SimpleSAML_Auth_State::EXCEPTION_DATA]; + if (array_key_exists(\SimpleSAML\Auth\State::EXCEPTION_PARAM, $_REQUEST)) { + $state = \SimpleSAML\Auth\State::loadExceptionState(); + $exception = $state[\SimpleSAML\Auth\State::EXCEPTION_DATA]; /* Handle exception... */ [...] @@ -205,15 +205,15 @@ The code for handling this becomes something like: $procChain = [...]; - $state = array( - 'ReturnURL' => SimpleSAML_Utilities::selfURLNoQuery(), - SimpleSAML_Auth_State::EXCEPTION_HANDLER_URL => SimpleSAML_Utilities::selfURLNoQuery(), + $state = [ + 'ReturnURL' => \SimpleSAML\Utils\HTTP::getSelfURLNoQuery(), + \SimpleSAML\Auth\State::EXCEPTION_HANDLER_URL => \SimpleSAML\Utils\HTTP::getSelfURLNoQuery(), [...], - ) + ] try { $procChain->processState($state); - } catch (SimpleSAML_Error_Exception $e) { + } catch (\SimpleSAML\Error\Exception $e) { /* Handle exception. */ [...]; } @@ -221,7 +221,7 @@ The code for handling this becomes something like: #### Note -An exception which isn't a subclass of `SimpleSAML_Error_Exception` will be converted to the `SimpleSAML_Error_UnserializedException` class. +An exception which isn't a subclass of `\SimpleSAML\Error\Exception` will be converted to the `\SimpleSAML\Error\UnserializedException` class. This happens regardless of whether the exception is delivered directly or through the error handler. This is done to be consistent in what the application receives - now it will always receive the same exception, regardless of whether it is delivered directly or through a redirect. @@ -229,12 +229,12 @@ This is done to be consistent in what the application receives - now it will alw Custom error show function -------------------------- -Optional custom error show function, called from SimpleSAML_Error_Error::show, is defined with 'errors.show_function' in config.php. +Optional custom error show function, called from \SimpleSAML\Error\Error::show, is defined with 'errors.show_function' in config.php. -Example code for this function, which implements the same functionality as SimpleSAML_Error_Error::show, looks something like: +Example code for this function, which implements the same functionality as \SimpleSAML\Error\Error::show, looks something like: - public static function show(SimpleSAML_Configuration $config, array $data) { - $t = new SimpleSAML_XHTML_Template($config, 'error.php', 'errors'); + public static function show(\SimpleSAML\Configuration $config, array $data) { + $t = new \SimpleSAML\XHTML\Template($config, 'error.php', 'errors'); $t->data = array_merge($t->data, $data); $t->show(); exit; diff --git a/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-googleapps.md b/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-googleapps.md index 3eba11a6a6..30cab47945 100644 --- a/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-googleapps.md +++ b/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-googleapps.md @@ -42,7 +42,7 @@ Edit `config.php`, and enable the SAML 2.0 IdP: You must generate a certificate for your IdP. Here is an example of an openssl command to generate a new key and a self signed certificate to use for signing SAML messages: - openssl req -newkey rsa:2048 -new -x509 -days 3652 -nodes -out googleappsidp.crt -keyout googleappsidp.pem + openssl req -newkey rsa:3072 -new -x509 -days 3652 -nodes -out googleappsidp.crt -keyout googleappsidp.pem The certificate above will be valid for 10 years. @@ -100,17 +100,17 @@ The next step is to create an authentication source with this module. An authent In this example we will use `example-userpass`, and hence that section is what matters and will be used. <?php - $config = array( - 'example-userpass' => array( + $config = [ + 'example-userpass' => [ 'exampleauth:UserPass', - 'student:studentpass' => array( - 'uid' => array('student'), - ), - 'employee:employeepass' => array( - 'uid' => array('employee'), - ), - ), - ); + 'student:studentpass' => [ + 'uid' => ['student'], + ], + 'employee:employeepass' => [ + 'uid' => ['employee'], + ], + ], + ]; ?> This configuration creates two users - `student` and `employee`, with the passwords `studentpass` and `employeepass`. The username and password are stored in the array index `student:studentpass` for the `student`-user. The attributes (only `uid` in this example) will be returned by the IdP when the user logs on. @@ -127,7 +127,7 @@ If you want to setup a SAML 2.0 IdP for Google Apps, you need to configure two m This is the configuration of the IdP itself. Here is some example config: // The SAML entity ID is the index of this config. Dynamic:X will automatically generate an entity ID (recommended) - $metadata['__DYNAMIC:1__'] => array( + $metadata['__DYNAMIC:1__'] => [ // The hostname of the server (VHOST) that this SAML entity will use. 'host' => '__DEFAULT__', @@ -137,7 +137,7 @@ This is the configuration of the IdP itself. Here is some example config: 'certificate' => 'googleappsidp.crt', 'auth' => 'example-userpass', - ) + ] **Note**: You can only have one entry in the file with host equal to `__DEFAULT__`, therefore you should replace the existing entry with this one, instead of adding this entry as a new entry in the file. @@ -152,12 +152,12 @@ In the `saml20-sp-remote.php` file we will configure an entry for G Suite (Googl * at G Suite. E.g. if your google account is foo.com, and you have a user with email john@foo.com, then you * must set the simplesaml.nameidattribute to be the name of an attribute that for this user has the value of 'john'. */ - $metadata['https://www.google.com/a/g.feide.no'] => array( + $metadata['https://www.google.com/a/g.feide.no'] => [ 'AssertionConsumerService' => 'https://www.google.com/a/g.feide.no/acs', 'NameIDFormat' => 'urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress', 'simplesaml.nameidattribute' => 'uid', 'simplesaml.attributes' => false - ); + ]; You must also map some attributes received from the authentication module into email field sent to Google Apps. In this example, the `uid` attribute is set. When you later configure the IdP to connect to a LDAP directory or some other authentication source, make sure that the `uid` attribute is set properly, or you can configure another attribute to use here. The `uid` attribute contains the local part of the user name. diff --git a/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-hok-idp.md b/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-hok-idp.md index e34a6b827d..a2315bf748 100644 --- a/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-hok-idp.md +++ b/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-hok-idp.md @@ -29,11 +29,11 @@ Enabling HoK SSO Profile on the IdP To enable the IdP to send HoK assertions you must add the `saml20.hok.assertion` option to the `saml20-idp-hosted` metadata file: - $metadata['__DYNAMIC:1__'] = array( + $metadata['__DYNAMIC:1__'] = [ [....] 'auth' => 'example-userpass', 'saml20.hok.assertion' => TRUE, - ); + ]; Add new metadata to SPs ----------------------- @@ -62,16 +62,16 @@ This means that you have to use the complex endpoint format in `saml20-sp-remote In general, this should look like the following code: 'AssertionConsumerService' => array ( - array( + [ 'Binding' => 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST', 'Location' => 'https://sp.example.org/simplesaml/module.php/saml/sp/saml2-acs.php/default-sp', 'index' => 0, - ), - array( + ], + [ 'Binding' => 'urn:oasis:names:tc:SAML:2.0:profiles:holder-of-key:SSO:browser', 'Location' => 'https://sp.example.org/simplesaml/module.php/saml/sp/saml2-acs.php/default-sp', 'index' => 4, - ), + ], ), (The specific values of the various fields will vary depending on the SP.) diff --git a/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-hok-sp.md b/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-hok-sp.md index a687896c52..4b12a113af 100644 --- a/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-hok-sp.md +++ b/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-hok-sp.md @@ -31,10 +31,10 @@ To enable support for the HoK SSO Profile in the SP, the `saml20.hok.assertion` This option can also be enabled in the `saml20-idp-remote` metadata file, but in that case the endpoint will not be added to the SP metadata. You must also send authentication requests specifying the Holder-of-Key profile to the IdP. This is controlled by the `ProtocolBinding` option in the SP configuration. - 'hok-sp' => array( + 'hok-sp' => [ 'saml:SP', 'saml20.hok.assertion' => TRUE, 'ProtocolBinding' => 'urn:oasis:names:tc:SAML:2.0:profiles:holder-of-key:SSO:browser', - ), + ], When this is done, you can add the metadata of your SP to the IdP and test the authentication. diff --git a/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-idp-more.md b/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-idp-more.md index fe61e17096..bb5ead1ac8 100644 --- a/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-idp-more.md +++ b/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-idp-more.md @@ -45,11 +45,16 @@ Here is an example of such a URL: https://idp.example.org/simplesaml/saml2/idp/SSOService.php?spentityid=urn:mace:feide.no:someservice -You can also add a RelayState parameter to the IdP-first URL: +You can also add a `RelayState` parameter to the IdP-first URL: https://idp.example.org/simplesaml/saml2/idp/SSOService.php?spentityid=urn:mace:feide.no:someservice&RelayState=https://sp.example.org/somepage -The RelayState parameter is often uset do carry the URL the SP should redirect to after authentication. +The `RelayState` parameter is often used to carry the URL the SP should redirect to after authentication. It is also possible to specify the Assertion +Consumer URL with the `ConsumerURL` parameter. + +For compatibility with certain SPs, SimpleSAMLphp will also accept the +`providerId`, `target` and `shire` parameters as aliases for `spentityid`, +`RelayState` and `ConsumerURL`, respectively. ### IdP first with SAML 1.1 diff --git a/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-idp.md b/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-idp.md index f720ee66e2..2a8cd83ff8 100644 --- a/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-idp.md +++ b/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-idp.md @@ -16,10 +16,9 @@ This guide will describe how to configure SimpleSAMLphp as an identity provider Enabling the Identity Provider functionality -------------------------------------------- -The first that must be done is to enable the identity provider functionality. This is done by editing `config/config.php`. The options `enable.saml20-idp` and `enable.shib13-idp` controls whether SAML 2.0 and Shibboleth 1.3 support is enabled. Enable one or both of those by assigning `true` to them: +The first that must be done is to enable the identity provider functionality. This is done by editing `config/config.php`. The option `enable.saml20-idp` controls whether SAML 2.0 IdP support is enabled. Enable it by assigning `true` to them: 'enable.saml20-idp' => true, - 'enable.shib13-idp' => true, Authentication module @@ -97,26 +96,26 @@ The next step is to create an authentication source with this module. An authent In this setup, this file should contain a single entry: <?php - $config = array( - 'example-userpass' => array( + $config = [ + 'example-userpass' => [ 'exampleauth:UserPass', - 'student:studentpass' => array( - 'uid' => array('student'), - 'eduPersonAffiliation' => array('member', 'student'), - ), - 'employee:employeepass' => array( - 'uid' => array('employee'), - 'eduPersonAffiliation' => array('member', 'employee'), - ), - ), - ); + 'student:studentpass' => [ + 'uid' => ['student'], + 'eduPersonAffiliation' => ['member', 'student'], + ], + 'employee:employeepass' => [ + 'uid' => ['employee'], + 'eduPersonAffiliation' => ['member', 'employee'], + ], + ], + ]; This configuration creates two users - `student` and `employee`, with the passwords `studentpass` and `employeepass`. The username and password is stored in the array index (`student:studentpass` for the `student`-user. The attributes for each user is configured in the array referenced by the index. For the student user, these are: - array( - 'uid' => array('student'), - 'eduPersonAffiliation' => array('member', 'student'), - ), + [ + 'uid' => ['student'], + 'eduPersonAffiliation' => ['member', 'student'], + ], The attributes will be returned by the IdP when the user logs on. @@ -128,7 +127,7 @@ Here is an example of an `openssl`-command which can be used to generate a new p This key and certificate can be used to sign SAML messages: - openssl req -newkey rsa:2048 -new -x509 -days 3652 -nodes -out example.org.crt -keyout example.org.pem + openssl req -newkey rsa:3072 -new -x509 -days 3652 -nodes -out example.org.crt -keyout example.org.pem The certificate above will be valid for 10 years. @@ -141,12 +140,12 @@ SimpleSAMLphp will only work with RSA certificates. DSA certificates are not sup Configuring the IdP ------------------- -The IdP is configured by the metadata stored in -`metadata/saml20-idp-hosted.php` and `metadata/shib13-idp-hosted.php`. -This is a minimal configuration of a SAML 2.0 IdP: +The SAML 2.0 IdP is configured by the metadata stored in +`metadata/saml20-idp-hosted.php`. +This is a minimal configuration: <?php - $metadata['__DYNAMIC:1__'] = array( + $metadata['__DYNAMIC:1__'] = [ /* * The hostname for this IdP. This makes it possible to run multiple * IdPs from the same configuration. '__DEFAULT__' means that this one @@ -166,7 +165,7 @@ This is a minimal configuration of a SAML 2.0 IdP: * user. This must match one of the entries in config/authsources.php. */ 'auth' => 'example-userpass', - ); + ]; For more information about available options in the idp-hosted metadata files, see the [IdP hosted reference](simplesamlphp-reference-idp-hosted). @@ -175,29 +174,29 @@ files, see the [IdP hosted reference](simplesamlphp-reference-idp-hosted). Using the `uri` NameFormat on attributes ---------------------------------------- -The [interoperable SAML 2 profile](http://saml2int.org/profile/current) specifies that attributes should be delivered using the `urn:oasis:names:tc:SAML:2.0:attrname-format:uri` NameFormat. +The [interoperable SAML 2 profile](https://kantarainitiative.github.io/SAMLprofiles/saml2int.html) specifies that attributes should be delivered using the `urn:oasis:names:tc:SAML:2.0:attrname-format:uri` NameFormat. We therefore recommended enabling this in new installations. This can be done by adding the following to the saml20-idp-hosted configuration: 'attributes.NameFormat' => 'urn:oasis:names:tc:SAML:2.0:attrname-format:uri', - 'authproc' => array( + 'authproc' => [ // Convert LDAP names to oids. - 100 => array('class' => 'core:AttributeMap', 'name2oid'), - ), + 100 => ['class' => 'core:AttributeMap', 'name2oid'], + ], Adding SPs to the IdP --------------------- The identity provider you are configuring needs to know about the service providers you are going to connect to it. -This is configured by metadata stored in `metadata/saml20-sp-remote.php` and `metadata/shib13-sp-remote.php`. +This is configured by metadata stored in `metadata/saml20-sp-remote.php`. This is a minimal example of a `metadata/saml20-sp-remote.php` metadata file for a SimpleSAMLphp SP: <?php - $metadata['https://sp.example.org/simplesaml/module.php/saml/sp/metadata.php/default-sp'] = array( + $metadata['https://sp.example.org/simplesaml/module.php/saml/sp/metadata.php/default-sp'] = [ 'AssertionConsumerService' => 'https://sp.example.org/simplesaml/module.php/saml/sp/saml2-acs.php/default-sp', 'SingleLogoutService' => 'https://sp.example.org/simplesaml/module.php/saml/sp/saml2-logout.php/default-sp', - ); + ]; Note that the URI in the entityID and the URLs to the AssertionConsumerService and SingleLogoutService endpoints change between different service providers. If you have the metadata of the remote SP as an XML file, you can use the built-in XML to SimpleSAMLphp metadata converter, which by default is available as `/admin/metadata-converter.php` in your SimpleSAMLphp installation. @@ -208,7 +207,7 @@ For more information about available options in the sp-remote metadata files, se Adding this IdP to other SPs ---------------------------- -The method for adding this IdP to a SP varies between different types of SPs. In general, most SPs need some metadata from the IdP. This should be available from `/saml2/idp/metadata.php` and `/shib13/idp/metadata.php`. +The method for adding this IdP to a SP varies between different types of SPs. In general, most SPs need some metadata from the IdP. This should be available from `/saml2/idp/metadata.php`. Testing the IdP @@ -253,7 +252,7 @@ To send the RelayState parameter from a SimpleSAMLphp IdP, specify it in the que To set it in the SP configuration, add it to `authsources.php`: - 'default-sp' => array( + 'default-sp' => [ 'saml:SP', 'RelayState' => 'https://sp.example.org/welcome.php', - ), + ], diff --git a/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-install-repo.md b/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-install-repo.md index c27fc94602..0de258dcd6 100644 --- a/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-install-repo.md +++ b/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-install-repo.md @@ -3,8 +3,8 @@ Installing SimpleSAMLphp from the repository These are some notes about running SimpleSAMLphp from the repository. -Installing from github ----------------------- +Installing from git +------------------- Go to the directory where you want to install SimpleSAMLphp: @@ -20,10 +20,16 @@ Initialize configuration and metadata: cp -r config-templates/* config/ cp -r metadata-templates/* metadata/ -Install the external dependencies with Composer (you can refer to [getcomposer.org](http://getcomposer.org/) to get detailed -instructions on how to install Composer itself): +Install the external dependencies with Composer (you can refer to +[getcomposer.org](https://getcomposer.org/) to get detailed +instructions on how to install Composer itself) and npm: php composer.phar install + npm install + +Build the assets: + + npm run build Upgrading @@ -38,21 +44,8 @@ Ask git to update to the latest version: git fetch origin git pull origin master -Install or upgrade the external dependencies with Composer ([get composer](http://getcomposer.org/)): +Install or upgrade the external dependencies with Composer and npm: php composer.phar install - - -Migrating from Subversion -------------------------- - -If you installed SimpleSAMLphp from subversion, and want to keep updated on the development, you will have to migrate -your installation to git. First, follow the steps to get a fresh install from github in a different directory. Skip the -steps regarding configuration and metadata initialization, and copy all the files you might have modified instead (not -only configuration and metadata, but also any custom modules or templates). Finally, proceed to install Composer and -install all the dependencies with it. You may want to add all your custom files to the '.gitignore' file. - -If you really want to use subversion instead of git, or it is impossible for you to migrate (you cannot install git, for -example), you might want to do a fresh install like the one described here, but using github's subversion interface. -Refer to [github's documentation](https://help.github.com/articles/support-for-subversion-clients) for detailed -instructions on how to do that. + npm install + npm run build diff --git a/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-install.md b/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-install.md index 0c4ba9c485..231d27cf92 100644 --- a/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-install.md +++ b/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-install.md @@ -2,17 +2,15 @@ SimpleSAMLphp Installation and Configuration ============================================ <!-- - This file is written in Markdown syntax. - For more information about how to use the Markdown syntax, read here: - http://daringfireball.net/projects/markdown/syntax +This file is written in Markdown syntax. +For more information about how to use the Markdown syntax, read here: +http://daringfireball.net/projects/markdown/syntax --> <!-- {{TOC}} --> -SimpleSAMLphp news and documentation ------------------------------------- This document is part of the SimpleSAMLphp documentation suite. @@ -20,27 +18,25 @@ This document is part of the SimpleSAMLphp documentation suite. * [SimpleSAMLphp homepage](https://simplesamlphp.org) -Development version --------------------- - -This document is about the latest stable version of SimpleSAMLphp. -If you want to install the development version, look at the instructions for [installing SimpleSAMLphp from the repository](simplesamlphp-install-repo). +This document covers the installation of the latest stable version of SimpleSAMLphp. +If you want to install the development version, take a look at the instructions for [installing SimpleSAMLphp from the +repository](simplesamlphp-install-repo). Prerequisites ------------- - * Some webserver capable of executing PHP scripts. - * PHP version >= 5.4.0. + * A web server capable of executing PHP scripts. + * PHP version >= 5.5.0. * Support for the following PHP extensions: * Always required: `date`, `dom`, `hash`, `libxml`, `openssl`, `pcre`, `SPL`, `zlib`, `json`, `mbstring` * When automatically checking for latest versions, and used by some modules: `cURL` - * When authenticating against LDAP server: `ldap` - * When authenticating against RADIUS server: `radius` - * When using native PHP session handler: `session` + * When authenticating against an LDAP server: `ldap` + * When authenticating against a RADIUS server: `radius` + * When using the native PHP session handler: `session` * When saving session information to a memcache server: `memcache` * When using databases: - * Always: `PDO` + * Always required: `PDO` * Database driver: (`mysql`, `pgsql`, ...) * Support for the following PHP packages: * When saving session information to a Redis server: `predis` @@ -51,70 +47,90 @@ What actual packages are required for the various extensions varies between diff Download and install SimpleSAMLphp ---------------------------------- -The most recent release of SimpleSAMLphp is found at [https://simplesamlphp.org/download](https://simplesamlphp.org/download). +The most recent release of SimpleSAMLphp can always be found at +[https://simplesamlphp.org/download](https://simplesamlphp.org/download). -Go to the directory where you want to install SimpleSAMLphp, and extract the archive file you just downloaded: +Go to the directory where you want to install SimpleSAMLphp and extract the archive file you just downloaded: +``` cd /var - tar xzf simplesamlphp-1.x.y.tar.gz - mv simplesamlphp-1.x.y simplesamlphp + tar xzf simplesamlphp-x.y.z.tar.gz + mv simplesamlphp-x.y.z simplesamlphp +``` ## Upgrading from a previous version of SimpleSAMLphp Extract the new version: +``` cd /var - tar xzf simplesamlphp-1.x.y.tar.gz + tar xzf simplesamlphp-x.y.z.tar.gz +``` Copy the configuration files from the previous version (in case the configuration directory is inside SimpleSAMLphp, keep reading for other alternatives): - cd /var/simplesamlphp-1.x.y +``` + cd /var/simplesamlphp-x.y.z rm -rf config metadata cp -rv ../simplesamlphp/config config cp -rv ../simplesamlphp/metadata metadata +``` Replace the old version with the new version: +``` cd /var mv simplesamlphp simplesamlphp.old - mv simplesamlphp-1.x.y simplesamlphp - + mv simplesamlphp-x.y.z simplesamlphp +``` -If the format of the config files or metadata has changed from your previous version of SimpleSAMLphp (check the revision log), you may have to update your configuration and metadata after updating the SimpleSAMLphp code: +If the format of the config files or metadata has changed from your previous version of SimpleSAMLphp (check the +upgrade notes), you may have to update your configuration and metadata after updating the SimpleSAMLphp code. ### Upgrading configuration files -A good approach is to run a `diff` between your previous `config.php` file and the new `config.php` file located in `config-templates/config.php`, and apply relevant modifications to the new template. -This will ensure that all new entries in the latest version of config.php are included, as well as preserve your local modifications. +A good approach is to run a `diff` between your previous `config.php` file and the new `config.php` file located in +`config-templates/config.php`, and apply relevant modifications to the new template. This will ensure that all new +entries in the latest version of config.php are included, as well as preserve your local modifications. ### Upgrading metadata files -Most likely the metadata format is backwards compatible. If not, you should receive a very clear error message at startup indicating how and what you need to update. You should look through the metadata in the metadata-templates directory after the upgrade to see whether recommended defaults have been changed. +Most likely the metadata format is backwards compatible. If not, you should receive a very clear error message at +startup indicating how and what you need to update. You should look through the metadata in the `metadata-templates` +directory after the upgrade to see whether recommended defaults have been changed. + ### Alternative location for configuration files By default, SimpleSAMLphp looks for its configuration in the `config` directory in the root of its own directory. This -has some drawbacks, like making it harder to use SimpleSAMLphp as a composer dependency, or to package it for different -operating systems. +has some drawbacks, like making it harder to update SimpleSAMLphp or to install it as a composer dependency, or to +package it for different operating systems. -However, it is now possible to specify an alternate location for the configuration directory by setting an environment -variable with this location. This way, the configuration directory doesn't need to be inside the library's directory, -making it easier to manage and to update. The simplest way to set this environment variable is to set it in your web -server's configuration. See the next section for more information. +In order to avoid this limitations, it is possible to specify an alternative location for the configuration directory +by setting the `SIMPLESAMLPHP_CONFIG_DIR` environment variable to point to this location. This way, the configuration +directory doesn't need to be inside the library's directory, making it easier to manage and to update. The simplest way +to set this environment variable is to set it in your web server's configuration. See the next section for more +information. Configuring Apache ------------------ -Examples below assume that SimpleSAMLphp is installed in the default location, `/var/simplesamlphp`. You may choose another location, but this requires a path update in a few files. See Appendix for details ‹Installing SimpleSAMLphp in alternative locations›. +Examples below assume that SimpleSAMLphp is installed in the default location, `/var/simplesamlphp`. You may choose +another location, but this requires a path update in a few files. See Appendix _Installing SimpleSAMLphp +in alternative locations_ for more details. -The only subdirectory of `SimpleSAMLphp` that needs to be accessible from the web is `www`. There are several ways of exposing SimpleSAMLphp depending on the way web sites are structured on your Apache web server. The following is just one possible configuration. +The only subdirectory of `SimpleSAMLphp` that needs to be accessible from the web is `www`. There are several ways of +exposing SimpleSAMLphp depending on the way web sites are structured on your Apache web server. The following is just +one possible configuration. -Find the Apache configuration file for the virtual hosts where you want to run SimpleSAMLphp. The configuration may look like this: +Find the Apache configuration file for the virtual hosts where you want to run SimpleSAMLphp. The configuration may +look like this: +```apacheconfig <VirtualHost *> ServerName service.example.com DocumentRoot /var/www/service.example.com @@ -135,67 +151,150 @@ Find the Apache configuration file for the virtual hosts where you want to run S </IfModule> </Directory> </VirtualHost> - -Note the `Alias` directive, which gives control to SimpleSAMLphp for all urls matching `http(s)://service.example.com/simplesaml/*`. SimpleSAMLphp makes several SAML interfaces available on the web; all of them are included in the `www` subdirectory of your SimpleSAMLphp installation. You can name the alias whatever you want, but the name must be specified in the `config.php` file of SimpleSAMLphp as described in [the section called “SimpleSAMLphp configuration: config.php”](#sect.config "SimpleSAMLphp configuration: config.php"). Here is an example of how this configuration may look like in `config.php`: - - $config = array ( +``` + +Note the `Alias` directive, which gives control to SimpleSAMLphp for all urls matching +`http(s)://service.example.com/simplesaml/*`. SimpleSAMLphp makes several SAML interfaces available on the web; all of +them are accessible through the `www` subdirectory of your SimpleSAMLphp installation. You can name the alias +whatever you want, but the name must be specified in the `baseurlpath` configuration option in the `config.php` file of +SimpleSAMLphp as described in +[the section called “SimpleSAMLphp configuration: config.php”](#sect.config "SimpleSAMLphp configuration: config.php"). +Here is an example of how this configuration may look like in `config.php`: + +```php +$config = [ + [...] + 'baseurlpath' => 'simplesaml/', [...] - 'baseurlpath' => 'simplesaml/', +] +``` + -Note also the `SetEnv` directive. It sets the `SIMPLESAMLPHP_CONFIG_DIR` environment variable, in this case, to the -default location for the configuration directory. You can omit this environment variable, and SimpleSAMLphp will -then look for the `config` directory inside its own directory. If you need to move your configuration to a different -location, you can use this environment variable to tell SimpleSAMLphp where to look for configuration files. -This works only for the `config` directory. If you need your metadata to be in a different directory too, use the -`metadatadir` configuration option to specify the location. +Note also the `SetEnv` directive in the Apache configuration. It sets the `SIMPLESAMLPHP_CONFIG_DIR` environment +variable, in this case, to the default location for the configuration directory. You can omit this environment +variable, and SimpleSAMLphp will then look for the `config` directory inside its own directory. If you need to move +your configuration to a different location, you can use this environment variable to tell SimpleSAMLphp where to look +for configuration files. This works only for the `config` directory. If you need your metadata to be in a different +directory too, use the `metadatadir` configuration option to specify the location. This is just the basic configuration to get things working. For a checklist further completing your documentation, please see -[Maintenance and configuration: Apache](simplesamlphp-maintenance#section_4). +[Maintenance and configuration: Apache](simplesamlphp-maintenance.md#apache-configuration). + + +Configuring Nginx +------------------ +Examples below assume that SimpleSAMLphp is installed in the default location, `/var/simplesamlphp`. You may choose +another location, but this requires a path update in a few files. See Appendix _Installing SimpleSAMLphp +in alternative locations_ for more details. + +The only subdirectory of `SimpleSAMLphp` that needs to be accessible from the web is `www`. There are several ways of +exposing SimpleSAMLphp depending on the way web sites are structured on your Nginx web server. The following is just +one possible configuration. + +Find the Nginx configuration file for the virtual hosts where you want to run SimpleSAMLphp. The configuration may +look like this: + +``` + server { + listen 443 ssl; + server_name idp.example.com; + + ssl_certificate /etc/pki/tls/certs/idp.example.com.crt; + ssl_certificate_key /etc/pki/tls/private/idp.example.com.key; + ssl_protocols TLSv1.1 TLSv1.2; + ssl_ciphers HIGH:!aNULL:!MD5; + + location ^~ /simplesaml { + alias /var/simplesamlphp/www; + + location ~ \.php(/|$) { + root /var/simplesamlphp/www; + fastcgi_pass 127.0.0.1:9000; + fastcgi_index index.php; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + fastcgi_split_path_info ^(.+?\.php)(/.*)$; + fastcgi_param PATH_INFO $fastcgi_path_info; + include fastcgi_params; + } + } + } +``` SimpleSAMLphp configuration: config.php --------------------------------------- -There is a few steps that you should edit in the main configuration -file, `config.php`, right away: +There are a few steps that you should complete in the main configuration file, `config.php`, right away: + +- Set the `baseurlpath` configuration option. Make it point to the canonical URL of your deployment, where + SimpleSAMLphp can be reached: + + ```php + 'baseurlpath' => 'https://your.canonical.host.name/simplesaml/', + ``` + + Please note that your canonical URL should always use HTTPS in order to protect your users. Additionally, if you + are running behind a **reverse proxy** and you are offloading TLS to it, the proper way to tell SimpleSAMLphp that + its base URL should use HTTPS is to set the `baseurlpath` configuration option properly. SimpleSAMLphp deliberately + **ignores** the `X-Forwarded-*` set of headers that your proxy might be setting, so **do not rely on those**. + +- Set an administrator password. This is needed to access some of the pages in your SimpleSAMLphp installation web + interface. + + Hashed passwords can also be used here. See the [`authcrypt`](../modules/authcrypt/docs/authcrypt.md) documentation + for more information. -- Set a administrator password. This is needed to access some of the pages in your SimpleSAMLphp installation web interface. + ```php + 'auth.adminpassword' => 'setnewpasswordhere', + ``` - 'auth.adminpassword' => 'setnewpasswordhere', +- Set a secret salt. This should be a random string. Some parts of the SimpleSAMLphp needs this salt to generate + cryptographically secure hashes. SimpleSAMLphp will give an error if the salt is not changed from the default value. + The command below can help you to generated a random string on (some) unix systems: - Hashed passwords can also be used here. See the [`authcrypt`](./authcrypt:authcrypt) documentation for more information. + ``` + tr -c -d '0123456789abcdefghijklmnopqrstuvwxyz' </dev/urandom | dd bs=32 count=1 2>/dev/null;echo + ``` -- Set a secret salt. This should be a random string. Some parts of the SimpleSAMLphp needs this salt to generate cryptographically secure hashes. SimpleSAMLphp will give an error if the salt is not changed from the default value. The command below can help you to generated a random string on (some) unix systems: + Here is an example of the configuration option: - tr -c -d '0123456789abcdefghijklmnopqrstuvwxyz' </dev/urandom | dd bs=32 count=1 2>/dev/null;echo + ```php + 'secretsalt' => 'randombytesinsertedhere', + ``` - Here is an example of the config option: + **Please note that changing the secret salt may break access to services for your users**. - 'secretsalt' => 'randombytesinsertedhere', +- Configure your data storage. You can do this by editing the `store.type` configuration option, and setting it to + one of the supported values. Now configure the backend of your choice with the relevant options, if needed. + +- Configure your sessions. You have to configure your sessions with the appropriate parameters so that the cookies + used by SimpleSAMLphp to track users are always delivered to the software. You may do this by editing the + `session.*` configuration options. Note that if you are using the `phpsession` data storage, the cookie-related + configuration options are configured in the `session.phpsession.*` options. -- - Set technical contact information. This information will be - available in the generated metadata. The e-mail address will also - be used for receiving error reports sent automatically by - SimpleSAMLphp. Here is an example: +- Set technical contact information. This information will be available in the generated metadata. The e-mail address + will also be used for receiving error reports sent automatically by SimpleSAMLphp. Here is an example: - 'technicalcontact_name' => 'John Smith', - 'technicalcontact_email' => 'john.smith@example.com', + ```php + 'technicalcontact_name' => 'John Smith', + 'technicalcontact_email' => 'john.smith@example.com', + ``` -- - If you use SimpleSAMLphp in a country where English is not - widespread, you may want to change the default language from - English to something else: +- If you use SimpleSAMLphp in a country where English is not widespread, you may want to change the default language + from English to something else: - 'language.default' => 'no', + ```php + 'language.default' => 'no', + ``` -- - Set the timezone which you use: +- Set your timezone - 'timezone' => 'Europe/Oslo', + ```php + 'timezone' => 'Europe/Oslo', + ``` - * [List of Supported Timezones at php.net](http://php.net/manual/en/timezones.php) + You can see [a list of Supported Timezones at php.net](http://php.net/manual/en/timezones.php). Configuring PHP @@ -203,161 +302,181 @@ Configuring PHP ### Sending e-mails from PHP -Some parts of SimpleSAMLphp will allow you to send e-mails. In example sending error reports to technical admin, as well as sending in metadata to the federation administrators. If you want to make use of this functionality, you should make sure your PHP installation is configured to be able to send e-mails. It's a common problem that PHP is not configured to send e-mails properly. The configuration differs from system to system. On UNIX, PHP is using sendmail, on Windows SMTP. +Some parts of SimpleSAMLphp will allow you to send e-mails. For example, sending error reports to technical admin. If +you want to make use of this functionality, you should make sure your PHP installation is configured to be able to +send e-mails. It's a common problem that PHP is not configured to send e-mails properly. The configuration differs +from system to system. On UNIX, PHP is using sendmail, on Windows SMTP. -Enable modules --------------- +Enabling and disabling modules +------------------------------ -If you want to enable some of the modules that are installed with SimpleSAMLphp, but are disabled by default, you should create an empty file in the module directory named `enable`. +If you want to enable some of the modules that are installed with SimpleSAMLphp, but are disabled by default, you +can do that in the configuration: - # Enabling the consent module - cd modules - ls -l - cd consent +```php + 'module.enable' => [ + 'exampleauth' => true, // Setting to TRUE enables. + 'saml' => false, // Setting to FALSE disables. + 'core' => null, // Unset or NULL uses default for this module. + ], +``` + +Set to `true` the modules you want to enable, and to `false` those that you want to disable. + +Alternatively, you can enable or disable modules by setting empty files with given names in the module's root +directory. For example, in order to enable the _consent_ module: + +``` + cd modules/consent touch enable +``` -If you later want to disable the module, rename the `enable` file -to `disable`. +If you later want to disable the module, you can rename the `enable` file to `disable`. +``` cd modules/consent mv enable disable +``` +This is the traditional way of enabling and disabling modules, but it is **deprecated**. Please do not rely on this in +new installations of the software. -The SimpleSAMLphp installation webpage --------------------------------------- - -After installing SimpleSAMLphp, you can access the homepage of your installation, which contains some information and a few links to the test services. The URL of an installation can be e.g.: +The SimpleSAMLphp installation web page +--------------------------------------- - https://service.example.org/simplesaml/ +After installing SimpleSAMLphp, you can access the homepage of your installation, which contains some information and +a few links to the test services. The URL of an installation can be e.g.: -The exact link depends on how you set it up with Apache, and of course on your hostname. + https://service.example.org/simplesaml/ -### Warning +The exact URL depends on how you set it up with your web server, and of course on your hostname. -Don't click on any of the links yet, because they require you to -either have setup SimpleSAMLphp as an Service Provider or as an -Identity Provider. +**Warning**: before you can actually use SimpleSAMLphp for something useful, you need to configure it either as a +Service Provider or as an Identity Provider, depending on your use case. -Here is an example screenshot of what the SimpleSAMLphp page looks -like: +Here is an example screenshot of what the SimpleSAMLphp page looks like:  ### Check your PHP environment -At the bottom of the installation page are some green lights. simpleSAML runs some tests to see whether required and recommended prerequisites are met. If any of the lights are red, you may have to add some extensions or modules to PHP, e.g. you need the PHP LDAP extension to use the LDAP authentication module. +At the bottom of the installation page there are some green lights. SimpleSAMLphp runs some tests to see whether the +required and recommended prerequisites are met. If any of the lights are red, you may have to install some PHP +extensions or external PHP packages (e.g. you need the PHP LDAP extension to use the LDAP authentication module). ## Next steps -You have now successfully installed SimpleSAMLphp, and the next steps depends on whether you want to setup a service provider, to protect a website by authentication or if you want to setup an identity provider and connect it to a user catalog. Documentation on bridging between federation protocols is found in a separate document. +You have now successfully installed SimpleSAMLphp, and the next steps depend on whether you want to setup a Service +Provider (in order to protect access to an existing application) or an Identity Provider (which you would connect to +a user database where your users can authenticate). Documentation on bridging between federation protocols is found +in a separate document. - * [Using SimpleSAMLphp as a SAML Service Provider](simplesamlphp-sp) - * [Hosted SP Configuration Reference](./saml:sp) - * [IdP remote reference](simplesamlphp-reference-idp-remote) - * [Connecting SimpleSAMLphp as a SP to UK Access Federation or InCommon](simplesamlphp-ukaccess) - * [Upgrading - migration to use the SAML authentication source](simplesamlphp-sp-migration) - * [Identity Provider QuickStart](simplesamlphp-idp) - * [IdP hosted reference](simplesamlphp-reference-idp-hosted) - * [SP remote reference](simplesamlphp-reference-sp-remote) - * [Use case: Setting up an IdP for G Suite (Google Apps)](simplesamlphp-googleapps) - * [Identity Provider Advanced Topics](simplesamlphp-idp-more) - * [Automated Metadata Management](simplesamlphp-automated_metadata) - * [Maintenance and configuration](simplesamlphp-maintenance) + - [Using SimpleSAMLphp as a Service Provider (SP)](simplesamlphp-sp) + + [Remote IdP reference](simplesamlphp-reference-idp-remote) + + [Connecting to the UK Access Federation or InCommon](simplesamlphp-ukaccess) + - [Using SimpleSAMLphp as an Identity Provider (IdP)](simplesamlphp-idp) + + [Hosted IdP reference](simplesamlphp-reference-idp-hosted) + + [Remote SP reference](simplesamlphp-reference-sp-remote) + + [Setting up an IdP for G Suite (Google Apps)](simplesamlphp-googleapps) + + [Advanced Topics](simplesamlphp-idp-more) + - [Automated Metadata Management](simplesamlphp-automated_metadata) + - [Maintenance and configuration](simplesamlphp-maintenance) Support ------- -If you need help to make this work, or want to discuss SimpleSAMLphp with other users of the software, you are fortunate: Around SimpleSAMLphp there is a great Open source community, and you are welcome to join! The forums are open for you to ask questions, contribute answers other further questions, request improvements or contribute with code or plugins of your own. - -- [SimpleSAMLphp homepage](https://simplesamlphp.org) -- [List of all available SimpleSAMLphp documentation](https://simplesamlphp.org/docs/) -- [Join the SimpleSAMLphp user's mailing list](https://simplesamlphp.org/lists) - +If you need help to make this work, or want to discuss SimpleSAMLphp with other users of the software, you are +in luck: there is a great Open Source community around SimpleSAMLphp, and you are welcome to join! The forums are open +for you to ask questions, help others by answering their questions, request improvements or contribute with +code or plugins of your own. +- [Homepage](https://simplesamlphp.org) +- [Documentation](https://simplesamlphp.org/docs/) +- [Mailing lists](https://simplesamlphp.org/lists) -Installing SimpleSAMLphp in alternative locations +Appendix: Installing SimpleSAMLphp in alternative locations ------------------------------------------------- -There may be several reasons why you want to install SimpleSAMLphp -in an alternative way. +There may be several reasons why you want to install SimpleSAMLphp in an alternative way. -1. You are installing SimpleSAMLphp in a hosted environment where you - do not have root access, and cannot change Apache configuration. - Still you can install SimpleSAMLphp - keep on reading. +- You are installing SimpleSAMLphp in a hosted environment where you do not have root access, and cannot change + Apache configuration. You can still install SimpleSAMLphp, keep on reading! -2. You have full permissions to the server, but cannot edit Apache - configuration for some reason, politics, policy or whatever. +- You have full permissions to the server, but cannot edit web server configuration for some reason like internal +policies. - -The SimpleSAMLphp code contains one folder named `simplesamlphp`. In this folder there are a lot of subfolders for library, metadata, configuration and much more. One of these folders is named `www`. This and *only this* folder should be exposed on the web. The recommended configuration is to put the whole `simplesamlphp` folder outside the webroot, and then link in the `www` folder by using the `Alias` directive, as described in [the section called “Configuring Apache”](#sect.apacheconfig "Configuring Apache"). But this is not the only possible way. +The SimpleSAMLphp package contains one folder named `simplesamlphp-x.y.z` (where `x.y.z` is the version number). In +this folder there are a lot of subfolders for library, metadata, configuration, etc. One of these folders is named +`www`. **Only this folder should be exposed on the web**. The recommended configuration is to put the whole +`simplesamlphp` folder outside the web root, and then link to the `www` folder by using the `Alias` directive, as +described in [the section called “Configuring Apache”](#sect.apacheconfig "Configuring Apache"). This is not the only +possible way, though. As an example, let's see how you can install SimpleSAMLphp in your home directory on a shared hosting server. -Extract the SimpleSAMLphp archive in your home directory: - - cd ~ - tar xzf simplesamlphp-1.x.y.tar.gz - mv simplesamlphp-1.x.y simplesamlphp +1. Extract the SimpleSAMLphp archive in your home directory: -Then you can try to make a symlink into the `public\_html` directory. - - cd ~/public_html - ln -s ../simplesamlphp/www simplesaml + ``` + cd ~ + tar xzf simplesamlphp-1.x.y.tar.gz + mv simplesamlphp-1.x.y simplesamlphp + ``` -Next, you need to update the configuration of paths in `simplesamlphp/config/config.php`: +2. Then you can try to make a symlink into the `public_html` directory. -And, then we need to set the `baseurlpath` parameter to match the base path of the URLs to the content of your `www` folder: + ``` + cd ~/public_html + ln -s ../simplesamlphp/www simplesaml + ``` - 'baseurlpath' => '/simplesaml/', +3. Next, you need to set the `baseurlpath` configuration option with the URL pointing to the `simplesaml` link you +just created in your `public_html` directory. For example, if your home directory is reachable in +`https://host.example/~myaccount/`, set the base URL path accordingly: + + ```php + 'baseurlpath' => 'https://host.example/~myaccount/simplesaml/', + ``` -Now, you can go to the URL of your installation and check if things work: + Now, you can go to the URL of your installation and check if things work: - http://yourcompany.com/simplesaml/ + https://host.example/~myaccount/simplesaml/ -### Tip +#### Tip -Symlinking may fail, because some Apache configurations do not allow you to link in files from outside the public\_html folder. If so, move the folder instead of symlinking: +Symlinking may fail, because some Apache configurations do not allow you to link to files from outside the +`public_html` folder. If so, you can move the `www` folder instead of symlinking it: +``` cd ~/public_html mv ../simplesamlphp/www simplesaml +``` Now you have the following directory structure. -- `~/simplesamlphp` +- `~/simplesamlphp` -- - `~/public_html/simplesaml` where `simplesaml` is the `www` - directory from the `simplesamlphp` installation directory, either - moved or a symlink. +- `~/public_html/simplesaml` where `simplesaml` is the `www` directory from the `simplesamlphp` installation directory, + either moved or a symlink. - -Now, we need to make a few configuration changes. First, let's edit -`~/public_html/simplesaml/_include.php`: +Now, we need to make a few configuration changes. First, let's edit `~/public_html/simplesaml/_include.php`: Change the two lines from: +```php require_once(dirname(dirname(__FILE__)) . '/lib/_autoload.php'); +``` to something like: - require_once('/var/www/simplesamlphp/lib/_autoload.php'); - -And then at the end of the file, you need to change another line -from: - - $configdir = dirname(dirname(__FILE__)) . '/config'; - -to: - - $configdir = '/var/www/simplesamlphp/config'; - - - -### Note +```php + require_once(dirname(dirname(dirname(__FILE__))) . '/lib/_autoload.php'); +``` -In a future version of SimpleSAMLphp we'll make this a bit easier, and let you only change the path one place, instead of three as described above. +**Warning**: note that this will make upgrading SimpleSAMLphp much more difficult, since you will need to move the +`www` directory and manually edit files every time you upgrade. It is also possible that this method does not work in +future versions of SimpleSAMLphp, and therefore it is discouraged and should be used only as a last resort. diff --git a/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-maintenance.md b/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-maintenance.md index ab38566e94..1d99f19f77 100644 --- a/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-maintenance.md +++ b/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-maintenance.md @@ -52,7 +52,7 @@ SimpleSAMLphp as an Identity Provider, or any other applications using it are no settings by leaving these options unset or setting them to `null`. If you need to restore your session's application after calling SimpleSAMLphp, you can do it by calling the `cleanup()` method of the -`SimpleSAML_Session` class, like described [here](simplesamlphp-sp#section_6). +`\SimpleSAML\Session` class, like described [here](simplesamlphp-sp#section_6). ### Configuring memcache @@ -96,26 +96,26 @@ Here are two examples of configuration of memcache session handling: Example of redundant configuration with load balancing: This configuration makes it possible to lose both servers in the a-group or both servers in the b-group without losing any sessions. Note that sessions will be lost if one server is lost from both the a-group and the b-group. - 'memcache_store.servers' => array( - array( - array('hostname' => 'mc_a1'), - array('hostname' => 'mc_a2'), - ), - array( - array('hostname' => 'mc_b1'), - array('hostname' => 'mc_b2'), - ), - ), + 'memcache_store.servers' => [ + [ + ['hostname' => 'mc_a1'], + ['hostname' => 'mc_a2'], + ], + [ + ['hostname' => 'mc_b1'], + ['hostname' => 'mc_b2'], + ], + ], **Example 2. Example of simple configuration with only one memcache server** Example of simple configuration with only one memcache server, running on the same computer as the web server: Note that all sessions will be lost if the memcache server crashes. - 'memcache_store.servers' => array( - array( - array('hostname' => 'localhost'), - ), - ), + 'memcache_store.servers' => [ + [ + ['hostname' => 'localhost'], + ], + ], The expiration value (`memcache_store.expires`) is the duration for which data should be retained in memcache. Data are dropped from the memcache servers when this time expires. The time will be reset every time the data is written to the memcache servers. @@ -161,7 +161,7 @@ The required tables are created automatically. If you are storing data from mult To store sessions in Redis, set the `store.type` option to `redis`. -By default SimpleSAMLphp will attempt to connect to Redis on the `localhost` at port `6379`. These can be configured via the `store.redis.host` and `store.redis.port` options, respectively. You may also set a key prefix with the `store.redis.prefix` option. +By default SimpleSAMLphp will attempt to connect to Redis on the `localhost` at port `6379`. These can be configured via the `store.redis.host` and `store.redis.port` options, respectively. You may also set a key prefix with the `store.redis.prefix` option. For Redis instances that [require authentication](https://redis.io/commands/auth), use the `store.redis.password` option. ## Metadata storage @@ -170,15 +170,15 @@ Several metadata storage backends are available by default, including `flatfile` example configuration of different metadata sources in use at the same time: ``` -'metadata.sources' => array( - array('type' => 'flatfile'), - array('type' => 'flatfile', 'directory' => 'metadata/metarefresh-kalmar'), - array('type' => 'serialize', 'directory' => 'metadata/metarefresh-ukaccess'), -), +'metadata.sources' => [ + ['type' => 'flatfile'], + ['type' => 'flatfile', 'directory' => 'metadata/metarefresh-kalmar'], + ['type' => 'serialize', 'directory' => 'metadata/metarefresh-ukaccess'], +], ``` You may also implement your own metadata storage handler, in a very similar way to how you would implement -your own session handler. Your class **must** extend the `SimpleSAML_Metadata_MetaDataStorageSource` class +your own session handler. Your class **must** extend the `\SimpleSAML\Metadata\MetaDataStorageSource` class and override the methods needed to change the backend used. This class **must** also be located in the `lib/MetadataStore/` directory of your custom module. @@ -190,7 +190,7 @@ module is named _mymodule_ and your class is named _MyMetadataHandler_, you shou <?php namespace SimpleSAML\Module\mymodule\MetadataStore; -class MyMetadataHandler extends SimpleSAML_Metadata_MetaDataStorageSource +class MyMetadataHandler extends \SimpleSAML\Metadata\MetaDataStorageSource { ... ``` @@ -245,7 +245,7 @@ To add support for a new language, add your new language to the `language.availa /* * Languages available and which language is default */ - 'language.available' => array('en', 'no', 'da', 'es', 'xx'), + 'language.available' => ['en', 'no', 'da', 'es', 'xx'], 'language.default' => 'en', Please use the standardized two-character @@ -255,11 +255,11 @@ You also can set the default language. You should ensure that the default langua All strings that can be localized are found in the files `dictionaries/`. Add a new entry for each string, with your language code, like this: - 'user_pass_header' => array( + 'user_pass_header' => [ 'en' => 'Enter your username and password', 'no' => 'Skriv inn brukernavn og passord', 'xx' => 'Pooa jujjique jamba', - ), + ], You can translate as many of the texts as you would like; a full translation is not required unless you want to make this the default language. From the end users point of view, it looks best if all text fragments used in a given screen or form is in one single language. diff --git a/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-metadata-endpoints.md b/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-metadata-endpoints.md index 9bca9088db..7200c9187d 100644 --- a/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-metadata-endpoints.md +++ b/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-metadata-endpoints.md @@ -32,10 +32,10 @@ It can be used when there is only a single endpoint that uses the default bindin Array of strings ---------------- - 'AssertionConsumerService' => array( + 'AssertionConsumerService' => [ 'https://site1.example.org/ACS', 'https://site2.example.org/ACS', - ), + ], This endpoint format can be used to represent multiple endpoints, all of which use the default binding. @@ -43,28 +43,28 @@ This endpoint format can be used to represent multiple endpoints, all of which u Array of arrays --------------- - 'AssertionConsumerService' => array( - array( + 'AssertionConsumerService' => [ + [ 'index' => 1, 'isDefault' => TRUE, 'Location' => 'https://sp.example.org/ACS', 'Binding' => 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST', - ), - array( + ], + [ 'index' => 2, 'Location' => 'https://sp.example.org/ACS', 'Binding' => 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Artifact', - ), - ), + ], + ], This endpoint format allows for specifying multiple endpoints with different bindings. It can also be used to specify the ResponseLocation attribute on endpoints, e.g. on `SingleLogoutService`: - 'SingleLogoutService' => array( - array( + 'SingleLogoutService' => [ + [ 'Location' => 'https://sp.example.org/LogoutRequest', 'ResponseLocation' => 'https://sp.example.org/LogoutResponse', 'Binding' => 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect', - ), - ), + ], + ], diff --git a/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-metadata-extensions-attributes.md b/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-metadata-extensions-attributes.md index 7e3c1c0bcc..832bc9c7d9 100644 --- a/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-metadata-extensions-attributes.md +++ b/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-metadata-extensions-attributes.md @@ -19,14 +19,14 @@ The `metadata/saml20-idp-hosted.php` entries are used to define the metadata extension items. An example of this is: <?php - $metadata['entity-id-1'] = array( + $metadata['entity-id-1'] = [ /* ... */ - 'EntityAttributes' => array( - 'urn:simplesamlphp:v1:simplesamlphp' => array('is', 'really', 'cool'), - '{urn:simplesamlphp:v1}foo' => array('bar'), - ), + 'EntityAttributes' => [ + 'urn:simplesamlphp:v1:simplesamlphp' => ['is', 'really', 'cool'], + '{urn:simplesamlphp:v1}foo' => ['bar'], + ], /* ... */ - ); + ]; The OASIS specification primarily defines how to include arbitrary `Attribute` and `Assertion` elements within the metadata for an IdP. @@ -43,9 +43,9 @@ metadata. Each item in the `EntityAttributes` array defines a new array. Each item in this array produces a separte `<AttributeValue>` element within the `<Attribute>` element. - 'EntityAttributes' => array( - 'urn:simplesamlphp:v1:simplesamlphp' => array('is', 'really', 'cool'), - ), + 'EntityAttributes' => [ + 'urn:simplesamlphp:v1:simplesamlphp' => ['is', 'really', 'cool'], + ], This generates: @@ -58,9 +58,9 @@ This generates: Each `<Attribute>` element requires a `NameFormat` attribute. This is specified using curly braces at the beginning of the key name: - 'EntityAttributes' => array( - '{urn:simplesamlphp:v1}foo' => array('bar'), - ), + 'EntityAttributes' => [ + '{urn:simplesamlphp:v1}foo' => ['bar'], + ], This generates: @@ -76,17 +76,17 @@ Generated XML Metadata Examples If given the following configuration... - $metadata['https://www.example.com/saml/saml2/idp/metadata.php'] = array( + $metadata['https://www.example.com/saml/saml2/idp/metadata.php'] = [ 'host' => 'www.example.com', 'certificate' => 'example.com.crt', 'privatekey' => 'example.com.pem', 'auth' => 'example-userpass', - 'EntityAttributes' => array( - 'urn:simplesamlphp:v1:simplesamlphp' => array('is', 'really', 'cool'), - '{urn:simplesamlphp:v1}foo' => array('bar'), - ), - ); + 'EntityAttributes' => [ + 'urn:simplesamlphp:v1:simplesamlphp' => ['is', 'really', 'cool'], + '{urn:simplesamlphp:v1}foo' => ['bar'], + ], + ]; ... will generate the following XML metadata: diff --git a/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-metadata-extensions-rpi.md b/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-metadata-extensions-rpi.md index 4799de19bb..a6dc868e77 100644 --- a/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-metadata-extensions-rpi.md +++ b/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-metadata-extensions-rpi.md @@ -59,54 +59,54 @@ Examples Service Provider: - 'default-sp' => array( + 'default-sp' => [ 'saml:SP', 'entityID' => NULL, ... - 'RegistrationInfo' => array( + 'RegistrationInfo' => [ 'authority' => 'urn:mace:sp.example.org', 'instant' => '2008-01-17T11:28:03.577Z', - 'policies' => array('en' => 'http://sp.example.org/policy', 'es' => 'http://sp.example.org/politica'), - ), - ), + 'policies' => ['en' => 'http://sp.example.org/policy', 'es' => 'http://sp.example.org/politica'], + ], + ], Identity Provider: - $metadata['__DYNAMIC:1__'] = array( + $metadata['__DYNAMIC:1__'] = [ 'host' => '__DEFAULT__', ... - 'RegistrationInfo' => array( + 'RegistrationInfo' => [ 'authority' => 'urn:mace:idp.example.org', 'instant' => '2008-01-17T11:28:03.577Z', - ), - ); + ], + ]; `aggregator` module: - $config = array( - 'aggregators' => array( + $config = [ + 'aggregators' => [ ... - ), + ], 'maxDuration' => 60*60*24*5, 'reconstruct' => FALSE, ... - 'RegistrationInfo' => array( + 'RegistrationInfo' => [ 'authority' => 'urn:mace:example.federation', 'instant' => '2008-01-17T11:28:03Z', - 'policies' => array('en' => 'http://example.org/federation_policy', 'es' => 'https://example.org/politica_federacion'), - ), - ); + 'policies' => ['en' => 'http://example.org/federation_policy', 'es' => 'https://example.org/politica_federacion'], + ], + ]; `aggregator2` module: - $config = array( - 'example.org' => array( - 'sources' => array( + $config = [ + 'example.org' => [ + 'sources' => [ ... - ), - 'RegistrationInfo' => array( + ], + 'RegistrationInfo' => [ 'authority' => 'urn:mace:example.federation', - 'policies' => array('en' => 'http://example.org/federation_policy', 'es' => 'https://example.org/politica_federacion'), - ), - ), - ); + 'policies' => ['en' => 'http://example.org/federation_policy', 'es' => 'https://example.org/politica_federacion'], + ], + ], + ]; diff --git a/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-metadata-extensions-ui.md b/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-metadata-extensions-ui.md index 94a855d845..10dd3aba08 100644 --- a/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-metadata-extensions-ui.md +++ b/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-metadata-extensions-ui.md @@ -23,72 +23,72 @@ the relevant entry in `authsources.php`. An example for an IdP: <?php - $metadata['entity-id-1'] = array( + $metadata['entity-id-1'] = [ /* ... */ - 'UIInfo' => array( - 'DisplayName' => array( + 'UIInfo' => [ + 'DisplayName' => [ 'en' => 'English name', 'es' => 'Nombre en Español', - ), - 'Description' => array( + ], + 'Description' => [ 'en' => 'English description', 'es' => 'Descripción en Español', - ), - 'InformationURL' => array( + ], + 'InformationURL' => [ 'en' => 'http://example.com/info/en', 'es' => 'http://example.com/info/es', - ), - 'PrivacyStatementURL' => array( + ], + 'PrivacyStatementURL' => [ 'en' => 'http://example.com/privacy/en', 'es' => 'http://example.com/privacy/es', - ), - 'Keywords' => array( - 'en' => array('communication', 'federated session'), - 'es' => array('comunicación', 'sesión federated'), - ), - 'Logo' => array( - array( + ], + 'Keywords' => [ + 'en' => ['communication', 'federated session'], + 'es' => ['comunicación', 'sesión federated'], + ], + 'Logo' => [ + [ 'url' => 'http://example.com/logo1.png', 'height' => 200, 'width' => 400, 'lang' => 'en', - ), - array( + ], + [ 'url' => 'http://example.com/logo2.png', 'height' => 201, 'width' => 401, - ), - ), - ), - 'DiscoHints' => array( - 'IPHint' => array('130.59.0.0/16', '2001:620::0/96'), - 'DomainHint' => array('example.com', 'www.example.com'), - 'GeolocationHint' => array('geo:47.37328,8.531126', 'geo:19.34343,12.342514'), - ), + ], + ], + ], + 'DiscoHints' => [ + 'IPHint' => ['130.59.0.0/16', '2001:620::0/96'], + 'DomainHint' => ['example.com', 'www.example.com'], + 'GeolocationHint' => ['geo:47.37328,8.531126', 'geo:19.34343,12.342514'], + ], /* ... */ - ); + ]; And for an SP it could look like this: <?php - $config = array( + $config = [ - 'default-sp' => array( + 'default-sp' => [ 'saml:SP', - 'UIInfo' => array( - 'DisplayName' => array( + 'UIInfo' => [ + 'DisplayName' => [ 'en' => 'English name', 'es' => 'Nombre en Español' - ), - 'Description' => array( + ], + 'Description' => [ 'en' => 'English description', - 'es' => 'Descripción en Español - ), - ), + 'es' => 'Descripción en Español' + ], + ], /* ... */ - ), - ); + ], + ]; The OASIS specification primarily defines how an entity can communicate metadata related to IdP or service discovery and identification. There @@ -106,52 +106,52 @@ about an IdP or SP. These properties are all children of the `UIInfo` key. *Note*: Most elements are localized strings that specify the language using the array key as the language-code: - 'DisplayName' => array( + 'DisplayName' => [ 'en' => 'English name', 'es' => 'Nombre en Español', - ), + ], `DisplayName` : The localized list of names for this entity - 'DisplayName' => array( + 'DisplayName' => [ 'en' => 'English name', 'es' => 'Nombre en Español', - ), + ], `Description` : The localized list of statements used to describe this entity - 'Description' => array( + 'Description' => [ 'en' => 'English description', 'es' => 'Descripción en Español', - ), + ], `InformationURL` : A localized list of URLs where more information about the entity is located. - 'InformationURL' => array( + 'InformationURL' => [ 'en' => 'http://example.com/info/en', 'es' => 'http://example.com/info/es', - ), + ], `PrivacyStatementURL` : A localized list of URLs where the entity's privacy statement is located. - 'PrivacyStatementURL' => array( + 'PrivacyStatementURL' => [ 'en' => 'http://example.com/privacy/en', 'es' => 'http://example.com/privacy/es', - ), + ], `Keywords` : A localized list of keywords used to describe the entity - 'Keywords' => array( - 'en' => array('communication', 'federated session'), - 'es' => array('comunicación', 'sesión federated'), - ), + 'Keywords' => [ + 'en' => ['communication', 'federated session'], + 'es' => ['comunicación', 'sesión federated'], + ], : *Note*: The `+` (plus) character is forbidden by specification from being part of a Keyword. @@ -159,19 +159,19 @@ using the array key as the language-code: `Logo` : The logos used to represent the entity - 'Logo' => array( - array( + 'Logo' => [ + [ 'url' => 'http://example.com/logo1.png', 'height' => 200, 'width' => 400, 'lang' => 'en', - ), - array( + ], + [ 'url' => 'http://example.com/logo2.png', 'height' => 201, 'width' => 401, - ), - ), + ], + ], : An optional `lang` key containing a language-code is supported for localized logos. @@ -188,20 +188,20 @@ key. : This is a list of both IPv4 and IPv6 addresses in CIDR notation services by or associated with this entity. - 'IPHint' => array('130.59.0.0/16', '2001:620::0/96'), + 'IPHint' => ['130.59.0.0/16', '2001:620::0/96'], `DomainHint` : This specifies a list of domain names serviced by or associated with this entity. - 'DomainHint' => array('example.com', 'www.example.com'), + 'DomainHint' => ['example.com', 'www.example.com'], `GeolocationHint` : This specifies a list of geographic coordinates associated with, or serviced by, the entity. Coordinates are given in URI form using the geo URI scheme [RFC5870](http://www.ietf.org/rfc/rfc5870.txt). - 'GeolocationHint' => array('geo:47.37328,8.531126', 'geo:19.34343,12.342514'), + 'GeolocationHint' => ['geo:47.37328,8.531126', 'geo:19.34343,12.342514'], Generated XML Metadata Examples @@ -209,52 +209,52 @@ Generated XML Metadata Examples If given the following configuration... - $metadata['https://www.example.com/saml/saml2/idp/metadata.php'] = array( + $metadata['https://www.example.com/saml/saml2/idp/metadata.php'] = [ 'host' => 'www.example.com', 'certificate' => 'example.com.crt', 'privatekey' => 'example.com.pem', 'auth' => 'example-userpass', - 'UIInfo' => array( - 'DisplayName' => array( + 'UIInfo' => [ + 'DisplayName' => [ 'en' => 'English name', 'es' => 'Nombre en Español', - ), - 'Description' => array( + ], + 'Description' => [ 'en' => 'English description', 'es' => 'Descripción en Español', - ), - 'InformationURL' => array( + ], + 'InformationURL' => [ 'en' => 'http://example.com/info/en', 'es' => 'http://example.com/info/es', - ), - 'PrivacyStatementURL' => array( + ], + 'PrivacyStatementURL' => [ 'en' => 'http://example.com/privacy/en', 'es' => 'http://example.com/privacy/es', - ), - 'Keywords' => array( - 'en' => array('communication', 'federated session'), - 'es' => array('comunicación', 'sesión federated'), - ), - 'Logo' => array( - array( + ], + 'Keywords' => [ + 'en' => ['communication', 'federated session'], + 'es' => ['comunicación', 'sesión federated'], + ], + 'Logo' => [ + [ 'url' => 'http://example.com/logo1.png', 'height' => 200, 'width' => 400, - ), - array( + ], + [ 'url' => 'http://example.com/logo2.png', 'height' => 201, 'width' => 401, - ), - ), - ), - 'DiscoHints' => array( - 'IPHint' => array('130.59.0.0/16', '2001:620::0/96'), - 'DomainHint' => array('example.com', 'www.example.com'), - 'GeolocationHint' => array('geo:47.37328,8.531126', 'geo:19.34343,12.342514'), - ), - ); + ], + ], + ], + 'DiscoHints' => [ + 'IPHint' => ['130.59.0.0/16', '2001:620::0/96'], + 'DomainHint' => ['example.com', 'www.example.com'], + 'GeolocationHint' => ['geo:47.37328,8.531126', 'geo:19.34343,12.342514'], + ], + ]; ... will generate the following XML metadata: diff --git a/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-metadata-pdostoragehandler.md b/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-metadata-pdostoragehandler.md index 82656fb09b..9724a6d2e0 100644 --- a/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-metadata-pdostoragehandler.md +++ b/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-metadata-pdostoragehandler.md @@ -35,10 +35,10 @@ You will first need to configure a PDO metadata source. Here is an example of flatfile plus PDO: - 'metadata.sources' => array( - array('type' => 'flatfile'), - array('type' => 'pdo'), - ), + 'metadata.sources' => [ + ['type' => 'flatfile'], + ['type' => 'pdo'], + ], diff --git a/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-modules.md b/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-modules.md index ccbb851c81..ed0df99828 100644 --- a/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-modules.md +++ b/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-modules.md @@ -66,7 +66,7 @@ dictionaries : It is also possible to specify `<module name>:<dictionary name>` as the default - dictionary when instantiating the `SimpleSAML_XHTML_Template` + dictionary when instantiating the `\SimpleSAML\XHTML\Template` class. hooks @@ -77,20 +77,20 @@ hooks lib : This directory contains classes which belong to this module. All classes must be named in the following pattern: - `sspmod_<module name>_<class name>` When looking up the filename of + `\SimpleSAML\Module\<module name>\<class name>` When looking up the filename of a class, SimpleSAMLphp will search for `<class name>` in the `lib` directory. Underscores in the class name will be translated into slashes. : Thus, if SimpleSAMLphp needs to load a class named - `sspmod_example_Auth_Source_Example`, it will load the file named + `\SimpleSAML\Module\example\Auth\Source\Example`, it will load the file named `modules/example/lib/Auth/Source/Example.php`. templates : These are module-specific templates. To use one of these templates, specify `<module name>:<template file>.php` as the template file in the constructor of - `SimpleSAML_XHTML_Template`. For example, `example:login-form.php` + `\SimpleSAML\XHTML\Template`. For example, `example:login-form.php` is translated to the file `modules/example/templates/default/login-form.php`. Note that `default` in the previous example is defined by the `theme.use` @@ -150,26 +150,26 @@ authentication source. A typical configuration entry for an authentication source looks like this: - 'example-static' => array( + 'example-static' => [ /* This maps to modules/exampleauth/lib/Auth/Source/Static.php */ 'exampleauth:Static', /* The following is configuration which is passed on to * the exampleauth:Static authentication source. */ 'uid' => 'testuser', - 'eduPersonAffiliation' => array('member', 'employee'), - 'cn' => array('Test User'), - ), + 'eduPersonAffiliation' => ['member', 'employee'], + 'cn' => ['Test User'], + ], To use this authentication source in a SAML 2.0 IdP, set the `auth`-option of the IdP to `'example-static'`: - '__DYNAMIC:1__' => array( + '__DYNAMIC:1__' => [ 'host' => '__DEFAULT__', 'privatekey' => 'example.org.pem', 'certificate' => 'example.org.crt', 'auth' => 'example-static', - ), + ], ### Creating authentication sources diff --git a/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-nostate.md b/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-nostate.md index 6d0535fb18..208d9d5773 100644 --- a/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-nostate.md +++ b/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-nostate.md @@ -1,7 +1,7 @@ Debugging "State Information Lost" errors ========================================= -**"State Information Lost"** (`SimpleSAML_Error_NoState: NOSTATE`) +**"State Information Lost"** (`\SimpleSAML\Error\NoState: NOSTATE`) This is one of the most common errors that you can encounter when configuring SimpleSAMLphp. Unfortunately, it is also a generic error that can have many diff --git a/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-reference-idp-hosted.md b/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-reference-idp-hosted.md index 0e5cb6298e..276d9b7f66 100644 --- a/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-reference-idp-hosted.md +++ b/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-reference-idp-hosted.md @@ -9,14 +9,14 @@ Both files have the following format: <?php /* The index of the array is the entity ID of this IdP. */ - $metadata['entity-id-1'] = array( + $metadata['entity-id-1'] = [ 'host' => 'idp.example.org', /* Configuration options for the first IdP. */ - ); - $metadata['entity-id-2'] = array( + ]; + $metadata['entity-id-2'] = [ 'host' => '__DEFAULT__', /* Configuration options for the default IdP. */ - ); + ]; /* ... */ The entity ID should be an URI. It can, also be on the form @@ -50,6 +50,38 @@ Common options : Certificate file which should be used by this IdP, in PEM format. The filename is relative to the `cert/`-directory. +`contacts` +: Specify contacts in addition to the technical contact configured through config/config.php. + For example, specifying a support contact: + + 'contacts' => [ + [ + 'contactType' => 'support', + 'emailAddress' => 'support@example.org', + 'givenName' => 'John', + 'surName' => 'Doe', + 'telephoneNumber' => '+31(0)12345678', + 'company' => 'Example Inc.', + ], + ], + +: If you have support for a trust framework that requires extra attributes on the contact person element in your IdP metadata (for example, SIRTFI), you can specify an array of attributes on a contact. + + 'contacts' => [ + [ + 'contactType' => 'other', + 'emailAddress' => 'mailto:abuse@example.org', + 'givenName' => 'John', + 'surName' => 'Doe', + 'telephoneNumber' => '+31(0)12345678', + 'company' => 'Example Inc.', + 'attributes' => [ + 'xmlns:remd' => 'http://refeds.org/metadata', + 'remd:contactType' => 'http://refeds.org/metadata/contactType/security', + ], + ], + ], + `host` : The hostname for this IdP. One IdP can also have the `host`-option set to `__DEFAULT__`, and that IdP will be used when no other @@ -64,10 +96,10 @@ Common options : This option can be translated into multiple languages by specifying the value as an array of language-code to translated name: - 'OrganizationName' => array( + 'OrganizationName' => [ 'en' => 'Example organization', 'no' => 'Eksempel organisation', - ), + ], : *Note*: If you specify this option, you must also specify the `OrganizationURL` option. @@ -123,37 +155,6 @@ Common options any value in the SP-remote metadata overrides the one configured in the IdP metadata. -`contacts` -: Specify contacts in addition to the technical contact configured through config/config.php. - For example, specifying a support contact: - - 'contacts' => array( - array( - 'contactType' => 'support', - 'emailAddress' => 'support@example.org', - 'givenName' => 'John', - 'surName' => 'Doe', - 'telephoneNumber' => '+31(0)12345678', - 'company' => 'Example Inc.', - ), - ), - -: If you have support for a trust framework that requires extra attributes on the contact person element in your IdP metadata (for example, SIRTFI), you can specify an array of attributes on a contact. - - 'contacts' => array( - array( - 'contactType' => 'other', - 'emailAddress' => 'mailto:abuse@example.org', - 'givenName' => 'John', - 'surName' => 'Doe', - 'telephoneNumber' => '+31(0)12345678', - 'company' => 'Example Inc.', - 'attributes' => array( - 'xmlns:remd' => 'http://refeds.org/metadata', - 'remd:contactType' => 'http://refeds.org/metadata/contactType/security', - ), - ), - ), SAML 2.0 options ---------------- @@ -221,8 +222,11 @@ The following SAML 2.0 options are available: : Note that this option can be set for each SP in the [SP-remote metadata](./simplesamlphp-reference-sp-remote). `NameIDFormat` -: The format of the NameID supported by this IdP. Defaults to the `transient` format if unspecified. - This parameter can be configured in multiple places, and the actual value used is fetched from metadata with +: The format(s) of the NameID supported by this IdP, as either an array or a string. If an array is given, the first + value is used as the default if the incoming request does not specify a preference. Defaults to the `transient` + format if unspecified. + +: This parameter can be configured in multiple places, and the actual value used is fetched from metadata with the following priority: : 1. SP Remote Metadata @@ -242,7 +246,7 @@ The following SAML 2.0 options are available: you should configure [NameID generation filters](./saml:nameid) on your IdP. -: Note that the value set here will be added to the metadata generated for this IdP, +: Note that the value(s) set here will be added to the metadata generated for this IdP, in the `NameIDFormat` element. `RegistrationInfo` @@ -255,6 +259,10 @@ The following SAML 2.0 options are available: : Note that this requires a configured memcache server. +`saml20.ecp` +: Set to `true` to enable the IdP to recieve authnrequests and send responses according the Enhanced Client or Proxy (ECP) Profile. Note: authentication filters that require interaction with the user will not work with ECP. + Defaults to `false`. + `saml20.hok.assertion` : Set to `TRUE` to enable the IdP to send responses according the [Holder-of-Key Web Browser SSO Profile](./simplesamlphp-hok-idp). Defaults to `FALSE`. @@ -325,12 +333,13 @@ The following SAML 2.0 options are available: the default one. `signature.algorithm` -: The algorithm to use when signing any message generated by this identity provider. Defaults to RSA-SHA1. +: The algorithm to use when signing any message generated by this identity provider. Defaults to RSA-SHA256. : Possible values: * `http://www.w3.org/2000/09/xmldsig#rsa-sha1` *Note*: the use of SHA1 is **deprecated** and will be disallowed in the future. * `http://www.w3.org/2001/04/xmldsig-more#rsa-sha256` + The default. * `http://www.w3.org/2001/04/xmldsig-more#rsa-sha384` * `http://www.w3.org/2001/04/xmldsig-more#rsa-sha512` @@ -421,7 +430,7 @@ These are some examples of IdP metadata * We use the '__DYNAMIC:1__' entity ID so that the entity ID * will be autogenerated. */ - $metadata['__DYNAMIC:1__'] = array( + $metadata['__DYNAMIC:1__'] = [ /* * We use '__DEFAULT__' as the hostname so we won't have to * enter a hostname. @@ -437,4 +446,4 @@ These are some examples of IdP metadata * from config/authsources.php. */ 'auth' => 'example-userpass', - ); + ]; diff --git a/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-reference-idp-remote.md b/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-reference-idp-remote.md index 89526fdfde..0859495d56 100644 --- a/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-reference-idp-remote.md +++ b/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-reference-idp-remote.md @@ -7,12 +7,12 @@ This is a reference for metadata options available for `metadata/saml20-idp-remo <?php /* The index of the array is the entity ID of this IdP. */ - $metadata['entity-id-1'] = array( + $metadata['entity-id-1'] = [ /* Configuration options for the first IdP. */ - ); - $metadata['entity-id-2'] = array( + ]; + $metadata['entity-id-2'] = [ /* Configuration options for the second IdP. */ - ); + ]; /* ... */ @@ -50,10 +50,10 @@ The following options are common between both the SAML 2.0 protocol and Shibbole : This option can be translated into multiple languages by specifying the value as an array of language-code to translated name: - 'OrganizationName' => array( + 'OrganizationName' => [ 'en' => 'Example organization', 'no' => 'Eksempel organisation', - ), + ], : *Note*: If you specify this option, you must also specify the `OrganizationURL` option. @@ -80,10 +80,10 @@ The following options are common between both the SAML 2.0 protocol and Shibbole : This option can be translated into multiple languages by specifying the value as an array of language-code to translated name: - 'name' => array( + 'name' => [ 'en' => 'A service', 'no' => 'En tjeneste', - ), + ], `scope` : An array with scopes valid for this IdP. @@ -104,6 +104,15 @@ SAML 2.0 options The following SAML 2.0 options are available: +`disable_scoping` +: Whether sending of samlp:Scoping elements in authentication requests should be suppressed. The default value is `FALSE`. + When set to `TRUE`, no scoping elements will be sent. This does not comply with the SAML2 specification, but allows + interoperability with ADFS which [does not support Scoping elements](https://docs.microsoft.com/en-za/azure/active-directory/develop/active-directory-single-sign-on-protocol-reference#scoping). + +: Note that this option also exists in the SP configuration. This + entry in the IdP-remote metadata overrides the option in the + [SP configuration](./saml:sp). + `encryption.blacklisted-algorithms` : Blacklisted encryption algorithms. This is an array containing the algorithm identifiers. @@ -120,6 +129,9 @@ The following SAML 2.0 options are available: `hide.from.discovery` : Whether to hide hide this IdP from the local discovery or not. Set to true to hide it. Defaults to false. +`IDPList` +: The IdP is allowed to respond to an `AuthNRequest` originally sent to entityIDs in this list. + `nameid.encryption` : Whether NameIDs sent to this IdP should be encrypted. The default value is `FALSE`. @@ -128,6 +140,15 @@ The following SAML 2.0 options are available: entry in the IdP-remote metadata overrides the option in the [SP configuration](./saml:sp). +`NameIDPolicy` +: The format of the NameID we request from this IdP: an array in the form of + `[ 'Format' => the format, 'AllowCreate' => true or false ]`. + Set to `false` instead of an array to omit sending any specific NameIDPolicy + in the AuthnRequest. + +: For compatibility purposes, `null` is equivalent to Transient and a format + can be defined as a string instead of an array. These variants are deprecated. + `sign.authnrequest` : Whether to sign authentication requests sent to this IdP. @@ -149,7 +170,7 @@ The following SAML 2.0 options are available: : Endpoint URL for logout responses. Overrides the `SingleLogoutService`-option for responses. `signature.algorithm` -: The algorithm to use when signing any message sent to this specific identity provider. Defaults to RSA-SHA1. +: The algorithm to use when signing any message sent to this specific identity provider. Defaults to RSA-SHA256. : Note that this option also exists in the SP configuration. This value in the IdP remote metadata overrides the value in the SP configuration. : Possible values: @@ -157,6 +178,7 @@ The following SAML 2.0 options are available: * `http://www.w3.org/2000/09/xmldsig#rsa-sha1` *Note*: the use of SHA1 is **deprecated** and will be disallowed in the future. * `http://www.w3.org/2001/04/xmldsig-more#rsa-sha256` + The default. * `http://www.w3.org/2001/04/xmldsig-more#rsa-sha384` * `http://www.w3.org/2001/04/xmldsig-more#rsa-sha512` diff --git a/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-reference-sp-remote.md b/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-reference-sp-remote.md index 943c862626..6d858beb9c 100644 --- a/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-reference-sp-remote.md +++ b/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-reference-sp-remote.md @@ -9,12 +9,12 @@ Both files have the following format: <?php /* The index of the array is the entity ID of this SP. */ - $metadata['entity-id-1'] = array( + $metadata['entity-id-1'] = [ /* Configuration options for the first SP. */ - ); - $metadata['entity-id-2'] = array( + ]; + $metadata['entity-id-2'] = [ /* Configuration options for the second SP. */ - ); + ]; /* ... */ @@ -54,10 +54,10 @@ and Shibboleth 1.3 protocol: : This option can be translated into multiple languages by specifying the value as an array of language-code to translated name: - 'name' => array( + 'name' => [ 'en' => 'A service', 'no' => 'En tjeneste', - ), + ], `OrganizationName` : The name of the organization responsible for this SPP. @@ -65,10 +65,10 @@ and Shibboleth 1.3 protocol: : This option can be translated into multiple languages by specifying the value as an array of language-code to translated name: - 'OrganizationName' => array( + 'OrganizationName' => [ 'en' => 'Example organization', 'no' => 'Eksempel organisation', - ), + ], : *Note*: If you specify this option, you must also specify the `OrganizationURL` option. @@ -174,8 +174,9 @@ The following SAML 2.0 options are available: `FALSE`. `NameIDFormat` -: The `NameIDFormat` this SP should receive. The three most commonly - used values are: +: The `NameIDFormat` this SP should receive. This may be specified as either a string or an array. + +: The three most commonly used values are: : 1. `urn:oasis:names:tc:SAML:2.0:nameid-format:transient` 2. `urn:oasis:names:tc:SAML:2.0:nameid-format:persistent` @@ -238,7 +239,7 @@ The following SAML 2.0 options are available: The value in the SP-remote metadata overrides the value in the IdP-hosted metadata. `signature.algorithm` -: The algorithm to use when signing any message sent to this specific service provider. Defaults to RSA-SHA1. +: The algorithm to use when signing any message sent to this specific service provider. Defaults to RSA-SHA256. : Note that this option also exists in the IdP-hosted metadata. The value in the SP-remote metadata overrides the value in the IdP-hosted metadata. : Possible values: @@ -246,6 +247,7 @@ The following SAML 2.0 options are available: * `http://www.w3.org/2000/09/xmldsig#rsa-sha1` *Note*: the use of SHA1 is **deprecated** and will be disallowed in the future. * `http://www.w3.org/2001/04/xmldsig-more#rsa-sha256` + The default. * `http://www.w3.org/2001/04/xmldsig-more#rsa-sha384` * `http://www.w3.org/2001/04/xmldsig-more#rsa-sha512` @@ -269,6 +271,7 @@ The following SAML 2.0 options are available: the `attributes` array). For more advanced control over `NameID`, including the ability to specify any attribute regardless of the set sent to the SP, see the [NameID processing filters](./saml:nameid). + Note that the value of the attribute is collected **after** authproc-filters have run. : Typical values can be `mail` for when using the `email` format, and `eduPersonTargetedID` when using the `persistent` format. @@ -370,12 +373,13 @@ relevant for this sp. The final list is the concatenation of the list given as parameter to InitSSO (at the sp), the list configured at the sp and the list configured at the ipd (here) for this sp. The intersection of the final list and the idps configured at the at this idp will be -presented to the user at the discovery service if neccessary. If only one +presented to the user at the discovery service if neccessary. If only one idp is in the intersection the discoveryservice will go directly to the idp. **Example: Configuration for scoping** - 'IDPList' => array('https://idp1.wayf.dk', 'https://idp2.wayf.dk'), + + 'IDPList' => ['https://idp1.wayf.dk', 'https://idp2.wayf.dk'], Shibboleth 1.3 options diff --git a/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-scoping.md b/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-scoping.md index 3124122ed0..c821b30e79 100644 --- a/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-scoping.md +++ b/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-scoping.md @@ -55,11 +55,11 @@ The ProxyCount and IDPList option can be specified in the following places: Example configuration: # Add the IDPList - 'IDPList' => array( + 'IDPList' => [ 'IdPEntityID1', 'IdPEntityID2', 'IdPEntityID3', - ), + ], # Set ProxyCount 'ProxyCount' => 2, diff --git a/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-sp-api.md b/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-sp-api.md index 2de1b509a6..07c851f9d2 100644 --- a/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-sp-api.md +++ b/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-sp-api.md @@ -42,7 +42,7 @@ Check whether the user is authenticated with this authentication source. `requireAuth` ------------- - void requireAuth(array $params = array()) + void requireAuth(array $params = []) Make sure that the user is authenticated. This function will only return if the user is authenticated. @@ -65,17 +65,17 @@ See the documentation for the `login`-function for a description of the paramete * Return the user to the frontpage after authentication, don't post * the current POST data. */ - $auth->requireAuth(array( + $auth->requireAuth([ 'ReturnTo' => 'https://sp.example.org/', 'KeepPost' => FALSE, - )); + ]); print("Hello, authenticated user!"); `login` ------------- - void login(array $params = array()) + void login(array $params = []) Start a login operation. This function will always start a new authentication process. @@ -108,10 +108,10 @@ The [`saml:SP`](./saml:sp) authentication source also defines some parameters. ### Example # Send a passive authentication request. - $auth->login(array( + $auth->login([ 'isPassive' => TRUE, 'ErrorURL' => 'https://.../error_handler.php', - )); + ]); `logout` @@ -149,15 +149,15 @@ Logout, and redirect to the specified URL. Same as the previous, but check the result of the logout operation afterwards. - $auth->logout(array( + $auth->logout([ 'ReturnTo' => 'https://sp.example.org/logged_out.php', 'ReturnStateParam' => 'LogoutState', 'ReturnStateStage' => 'MyLogoutState', - )); + ]); And in logged_out.php: - $state = SimpleSAML_Auth_State::loadState((string)$_REQUEST['LogoutState'], 'MyLogoutState'); + $state = \SimpleSAML\Auth\State::loadState((string)$_REQUEST['LogoutState'], 'MyLogoutState'); $ls = $state['saml:sp:LogoutStatus']; /* Only works for SAML SP */ if ($ls['Code'] === 'urn:oasis:names:tc:SAML:2.0:status:Success' && !isset($ls['SubCode'])) { /* Successful logout. */ @@ -178,10 +178,10 @@ If the user isn't authenticated, an empty array will be returned. The attributes will be returned as an associative array with the name of the attribute as the key and the value as an array of one or more strings: - array( - 'uid' => array('testuser'), - 'eduPersonAffiliation' => array('student', 'member'), - ) + [ + 'uid' => ['testuser'], + 'eduPersonAffiliation' => ['student', 'member'], + ] ### Example diff --git a/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-sp-migration.md b/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-sp-migration.md deleted file mode 100644 index ae3303cf81..0000000000 --- a/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-sp-migration.md +++ /dev/null @@ -1,286 +0,0 @@ -Migrating to the `saml` module -============================== - -<!-- {{TOC}} --> - -This document describes how you can migrate your code to use the `saml` module for authentication against SAML 2.0 and SAML 1.1 IdPs. -It assumes that you have previously set up a SP by using redirects to `saml2/sp/initSSO.php`. - -The steps we are going to follow are: - -1. Create a new authentication source. -2. Add the metadata for this authentication source to the IdP. -3. Test the new authentication source. -4. Convert the application to use the new API. -5. Test the application. -6. Remove the old metadata from the IdP. -7. Disable the old SAML 2 SP. - - -Create a new authentication source ----------------------------------- - -In this step we are going to create an authentication source which uses the `saml` module for authentication. -To do this, we open `config/authsources.php`. Create the file if it does not exist. -If you create the file, it should look like this: - - <?php - $config = array( - /* Here we can add entries for authentication sources we want to use. */ - ); - - -We are going to add an entry to this file. -The entry should look something like this: - - 'default-sp' => array( - 'saml:SP', - - /* - * The entity ID of this SP. - * Can be NULL/unset, in which case an entity ID is generated based on the metadata URL. - */ - 'entityID' => NULL, - - /* - * The entity ID of the IdP this should SP should contact. - * Can be NULL/unset, in which case the user will be shown a list of available IdPs. - */ - 'idp' => NULL, - - /* Here you can add other options to the SP. */ - ), - -`default-sp` is the name of the authentication source. -It is used to refer to this authentication source when we use it. -`saml:SP` tells SimpleSAMLphp that authentication with this authentication source is handled by the `saml` module. - -The `idp` option should be set to the same value that is set in `default-saml20-idp` in `config.php`. - -To ease migration, you probably want the entity ID on the new SP to be different than on the old SP. -This makes it possible to have both the old and the new SP active on the IdP at the same time. - -You can also add other options this authentication source. -See the [`saml:SP`](./saml:sp) documentation for more information. - - -Add the metadata for this authentication source to the IdP ----------------------------------------------------------- - -After adding the authentication source on the SP, you need to register the metadata on the IdP. -To retrieve the metadata, open the frontpage of your SimpleSAMLphp installation, and go to the federation tab. -You should have a list of metadata entries, and one will be marked with the name of the new authentication source. -In our case, that was `default-sp`. - -Click the `Show metadata` link, and you will arrive on a web page with the metadata for that service provider. -How you proceed from here depends on which IdP you are connecting to. - -If you use a SimpleSAMLphp IdP, you can use the metadata in the flat file format at the bottom of the page. -That metadata should be added to `saml20-sp-remote.php` on the IdP. -For other IdPs you probably want to use the XML metadata. - - -Test the new authentication source ----------------------------------- - -You should now be able to log in using the new authentication source. -Go to the frontpage of your SimpleSAMLphp installation and open the authentication tab. -There you will find a link to test authentication sources. -Click that link, and select the name of your authentication source (`default-sp` in our case). - -You should be able to log in using that authentication source, and receive the attributes from the IdP. - - -Convert the application to use the new API ------------------------------------------- - -This section will go through some common changes that you need to do when you are using SimpleSAMLphp from a different application. - -### `_include.php` - -You should also no longer include `.../simplesamlphp/www/_include.php`. -Instead, you should include `.../simplesamlphp/lib/_autoload.php`. - -This means that you replace lines like: - - require_once('.../simplesamlphp/www/_include.php'); - -with: - - require_once('.../simplesamlphp/lib/_autoload.php'); - -`_autoload.php` will register an autoloader function for the SimpleSAMLphp classes. -This makes it possible to access the classes from your application. -`_include.php` does the same, but also has some side-effects that you may not want in your application. - -If you load any SimpleSAMLphp class files directly, you should remove those lines. -That means that you should remove lines like the following: - - require_once('SimpleSAML/Utilities.php'); - require_once('SimpleSAML/Session.php'); - require_once('SimpleSAML/XHTML/Template.php'); - - -### Authentication API - -There is a new authentication API in SimpleSAMLphp which can be used to authenticate against authentication sources. -This API is designed to handle the common operations. - - -#### Overview - -This is a quick overview of the API: - - /* Get a reference to our authentication source. */ - $as = new \SimpleSAML\Auth\Simple('default-sp'); - - /* Require the user to be authentcated. */ - $as->requireAuth(); - /* When that function returns, we have an authenticated user. */ - - /* - * Retrieve attributes of the user. - * - * Note: If the user isn't authenticated when getAttributes() is - * called, an empty array will be returned. - */ - $attributes = $as->getAttributes(); - - /* Log the user out. */ - $as->logout(); - - -#### `$config` and `$session` - -Generally, if you have: - - $config = SimpleSAML_Configuration::getInstance(); - $session = SimpleSAML_Session::getSessionFromRequest(); - -you should replace it with this single line: - - $as = new \SimpleSAML\Auth\Simple('default-sp'); - - -#### Requiring authentication - -Blocks of code like the following: - - /* Check if valid local session exists.. */ - if (!isset($session) || !$session->isValid('saml2') ) { - SimpleSAML_Utilities::redirect( - '/' . $config->getBaseURL() . - 'saml2/sp/initSSO.php', - array('RelayState' => SimpleSAML_Utilities::selfURL()) - ); - } - -should be replaced with a single call to `requireAuth()`: - - $as->requireAuth(); - - -#### Fetching attributes - -Where you previously called: - - $session->getAttributes(); - -you should now call: - - $as->getAttributes(); - - -#### Logging out - -Redirecting to the initSLO-script: - - SimpleSAML_Utilities::redirect( - '/' . $config->getBaseURL() . - 'saml2/sp/initSLO.php', - array('RelayState' => SimpleSAML_Utilities::selfURL()) - ); - -should be replaced with a call to `logout()`: - - $as->logout(); - -If you want to return to a specific URL after logging out, you should include that URL as a parameter to the logout function: - - $as->logout('https://example.org/'); - -Please make sure the URL is trusted. If you obtain the URL from the user input, make sure it is trusted before -calling $as->logout(), by using the SimpleSAML_Utilities::checkURLAllowed() method. - - -#### Login link - -If you have any links to the initSSO-script, those links must be replaced with links to a new script. -The URL to the new script is `https://.../simplesaml/module.php/core/as_login.php`. -It has two mandatory parameters: - - * `AuthId`: The id of the authentication source. - * `ReturnTo`: The URL the user should be redirected to after authentication. - - -#### Logout link - -Any links to the initSLO-script must be replaced with links to a new script. -The URL to the new script is `https://.../simplesaml/module.php/core/as_logout.php`. -It has two mandatory parameters: - - * `AuthId`: The id of the authentication source. - * `ReturnTo`: The URL the user should be redirected to after logout. - - -Test the application --------------------- - -How you test the application is highly dependent on the application, but here are the elements you should test: - - -### SP initiated login - -Make sure that it is still possible to log into the application. - - -### IdP initiated login - -If you use a SimpleSAMLphp IdP, and you want users to be able to bookmark the login page, you need to test IdP initiated login. -To test IdP initiated login from a SimpleSAMLphp IdP, you can access: - - https://.../simplesaml/saml2/idp/SSOService.php?spentityid=<entity ID of your SP>&RelayState=<URL the user should be sent to after login> - -Note that the RelayState parameter is only supported if the IdP runs version 1.5 of SimpleSAMLphp. -If it isn't supported by the IdP, you need to configure the `RelayState` option in the authentication source configuration. - - -### SP initiated logout - -Make sure that logging out of your application also logs out of the IdP. -If this does not work, users who log out of your application can log in again without entering any username or password. - - -### IdP initiated logout - -This is used by the IdP if the user logs out of a different SP connected to the IdP. -In this case, the user should also be logged out of your application. - -The easiest way to test this is if you have two SPs connected to the IdP. -You can then log out of one SP and check that you are also logged out of the other. - - -Remove the old metadata from the IdP ------------------------------------- - -Once the new SP works correctly, you can remove the metadata for the old SP from the IdP. -How you do that depends on the IdP. -If you are running a SimpleSAMLphp IdP, you can remove the entry for the old SP in `metadata/saml20-sp-remote.php`. - - -Disable the old SAML 2 SP -------------------------- - -You may also want to disable the old SP code in SimpleSAMLphp. -To do that, open `config/config.php`, and change the `enable.saml20-sp` option to `FALSE`. - diff --git a/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-sp.md b/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-sp.md index dd50adab9a..7fc47ee941 100644 --- a/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-sp.md +++ b/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-sp.md @@ -22,26 +22,26 @@ The SP is configured by an entry in `config/authsources.php`. This is a minimal `authsources.php` for a SP: <?php - $config = array( + $config = [ /* This is the name of this authentication source, and will be used to access it later. */ - 'default-sp' => array( + 'default-sp' => [ 'saml:SP', - ), - ); + ], + ]; For more information about additional options available for the SP, see the [`saml:SP` reference](./saml:sp). If you want multiple Service Providers in the same site and installation, you can add more entries in the `authsources.php` configuration. If so remember to set the EntityID explicitly. Here is an example: - 'sp1' => array( + 'sp1' => [ 'saml:SP', 'entityID' => 'https://sp1.example.org/', - ), - 'sp2' => array( + ], + 'sp2' => [ 'saml:SP', 'entityID' => 'https://sp2.example.org/', - ), + ], ### Enabling a certificate for your Service Provider @@ -50,16 +50,16 @@ Some Identity Providers / Federations may require that your Service Providers ho Create a self-signed certificate in the `cert/` directory. cd cert - openssl req -newkey rsa:2048 -new -x509 -days 3652 -nodes -out saml.crt -keyout saml.pem + openssl req -newkey rsa:3072 -new -x509 -days 3652 -nodes -out saml.crt -keyout saml.pem Then edit your `authsources.php` entry, and add references to your certificate: - 'default-sp' => array( + 'default-sp' => [ 'saml:SP', 'privatekey' => 'saml.pem', 'certificate' => 'saml.crt', - ), + ], Adding IdPs to the SP @@ -69,11 +69,11 @@ The service provider you are configuring needs to know about the identity provid This is a minimal example of a `metadata/saml20-idp-remote.php` metadata file: <?php - $metadata['https://example.com'] = array( + $metadata['https://example.com'] = [ 'SingleSignOnService' => 'https://example.com/simplesaml/saml2/idp/SSOService.php', 'SingleLogoutService' => 'https://example.com/simplesaml/saml2/idp/SingleLogoutService.php', 'certificate' => 'example.pem', - ); + ]; `example.pem` under your `cert/` directory contains the certificate the identity provider uses for signing assertions. @@ -91,9 +91,9 @@ An option in the authentication source allows you to configure which IdP should This is the `idp` option. <?php - $config = array( + $config = [ - 'default-sp' => array( + 'default-sp' => [ 'saml:SP', /* @@ -101,8 +101,8 @@ This is the `idp` option. * Can be NULL/unset, in which case the user will be shown a list of available IdPs. */ 'idp' => 'https://idp.example.com', - ), - ); + ], + ]; Exchange metadata with the IdP @@ -180,9 +180,9 @@ Each attribute name can be used as an index into $attributes to obtain the value We can also request authentication with a specific IdP: - $as->login(array( + $as->login([ 'saml:idp' => 'https://idp.example.org/', - )); + ]); Other options are also available. Take a look in the documentation for the [SP module](./saml:sp) for a list of all parameters. @@ -191,7 +191,7 @@ If we are using PHP sessions in SimpleSAMLphp and in the application we are prot existing session when invoked for the first time, and its own session will prevail afterwards. If you want to restore your own session after calling SimpleSAMLphp, you can do so by cleaning up the session like this: - $session = SimpleSAML_Session::getSessionFromRequest(); + $session = \SimpleSAML\Session::getSessionFromRequest(); $session->cleanup(); If you don't cleanup SimpleSAMLphp's session and try to use $_SESSION afterwards, you won't be using your own session diff --git a/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-theming.md b/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-theming.md index 0c66fbde91..51cbe65b5b 100644 --- a/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-theming.md +++ b/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-theming.md @@ -107,10 +107,29 @@ modules Reference these resources in your custom PHP templates under `themes/fancytheme` by using a generator for the URL: ```php -<?php echo SimpleSAML_Module::getModuleURL('mymodule/logo.png'); ?> +<?php echo SimpleSAML\Module::getModuleURL('mymodule/logo.png'); ?> ``` Example for a custom CSS stylesheet file: ```html -<link rel="stylesheet" type="text/css" href="<?php echo SimpleSAML_Module::getModuleURL('mymodule/style.css'); ?>" /> +<link rel="stylesheet" type="text/css" href="<?php echo SimpleSAML\Module::getModuleURL('mymodule/style.css'); ?>" /> ``` + +Migrating to Twig templates +--------------------------- + +In version 1.15, a new templating system based on [Twig](https://twig.symfony.com/) was introduced. As modules migrate, it will become necessary for themes to include both the old templating style described above and new Twig-based templates. + +Twig works by extending a base template, which can itself include other partial templates. Some of the content of the old `includes/header.php` template is now located in a separate `_header.twig` file. This can be customized by copying it from the base template: + + cp templates/_header.twig modules/mymodule/themes/fancytheme/default/ + +If you need to make more extensive customizations to the base template, you should copy it from the base theme: + + cp templates/base.twig modules/mymodule/themes/fancytheme/default/ + +Any references to `$this->data['baseurlpath']` in old-style templates can be replaced with `{{baseurlpath}}` in Twig templates. Likewise, references to `\SimpleSAML\Module::getModuleURL()` can be replaced with `{{baseurlpath}}module.php/mymodule/...` + +See the [Twig documentation](https://twig.symfony.com/doc/1.x/templates.html) for more information on using variables and expressions in Twig templates, and the SimpleSAMLphp wiki for [our conventions](https://github.com/simplesamlphp/simplesamlphp/wiki/Twig-conventions). + +The wiki also includes some information on [migrating translations](https://github.com/simplesamlphp/simplesamlphp/wiki/Migrating-translation-in-Twig) and [migrating templates](https://github.com/simplesamlphp/simplesamlphp/wiki/Twig:-Migrating-templates). diff --git a/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-upgrade-notes-1.15.md b/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-upgrade-notes-1.15.md index ecb4e7522e..f540193fb4 100644 --- a/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-upgrade-notes-1.15.md +++ b/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-upgrade-notes-1.15.md @@ -5,7 +5,9 @@ The minimum required PHP version is now 5.4. The dependency on mcrypt has been dropped. A new templating system based on Twig has been introduced. The old templating -system is still available but should be considered deprecated. +system is still available but should be considered deprecated. Custom themes +may need to be updated to include Twig-style templates as well. See the +[theming documentation](simplesamlphp-theming). A new internationalization system based on Gettext has been introduced. While old templates can use either the old or the new system (refer to the @@ -25,20 +27,6 @@ full certificate in `certData` instead. The `core:AttributeRealm` authproc filter has been deprecated. Please use `core:ScopeFromAttribute`, which is a generalised version of this. -The following modules are no longer shipped with the SimpleSAMLphp: - -* `aggregator` -* `aggregator2` -* `aselect` -* `autotest` -* `consentSimpleAdmin` -* `discojuice` -* `InfoCard` -* `logpeek` -* `metaedit` -* `modinfo` -* `papi` -* `openid` -* `openidProvider` -* `saml2debug` -* `themefeidernd` +simpleSAMLphp will now send the eduPersonTargetedID attribute in the correct +NameID XML form, instead of the incorrect simple string. It will also refuse +to parse an assertion with an eduPersonTargetedID in 'string' format. diff --git a/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-upgrade-notes-1.16.md b/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-upgrade-notes-1.16.md new file mode 100644 index 0000000000..b7f225947a --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-upgrade-notes-1.16.md @@ -0,0 +1,25 @@ +Upgrade notes for SimpleSAMLphp 1.16 +==================================== + +The default signature algoritm is now SHA-256 (SHA-1 has been considered +obsolete since 2014). For entities that need it, you can switch back to +SHA-1 by setting the `signature.algorithm` option in the remote entity +metadata. + +In the Consent module, the `noconsentattributes` has been renamed to +`attributes.exclude`. The old name continues to work but is considered +deprecated. + +The class `SimpleSAML_Error_BadUserInnput` has been renamed to +`SimpleSAML_Error_BadUserInput`. + +The `authmyspace` module has been removed since the service is no longer +available. + +The `casserver` module has been removed because it was an outdated version, +the up to date module is maintained in the +[simplesamlphp-module-casserver](https://github.com/simplesamlphp/simplesamlphp-module-casserver) +repository. It can be installed with composer: +``` +composer require simplesamlphp/simplesamlphp-module-casserver +``` diff --git a/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-upgrade-notes-1.17.md b/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-upgrade-notes-1.17.md new file mode 100644 index 0000000000..0a07a7c26a --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/docs/simplesamlphp-upgrade-notes-1.17.md @@ -0,0 +1,49 @@ +Upgrade notes for SimpleSAMLphp 1.17 +==================================== + +The minimum PHP version required is now PHP 5.5. + +All (remaining) classes have been changed to use namespaces. There are mappings +from the legacy names so calling code should keep working. Custom code +(e.g. modules) that test for class names explicitly, e.g. when catching specific +exceptions, may need to be changed. + +The possibility to omit sending a NameIDPolicy in authentication requests has +been reintroduced by setting `NameIDPolicy` to `false`. The preferred way is +to configure it as an array `[ 'Format' => format, 'AllowCreate' => true/false ]`, +which is now also the format used in the `saml:NameIDPolicy` variable +in the state array. + +Code, config and documentation have switched to using the modern PHP +array syntax. This should not have an impact as both will remain working +equally, but the code examples and config templates look slightly different. +The following are equivalent: + + // Old style array syntax + $config = array( + 'authproc' => array( + 60 => 'class:etc' + ), + 'other example' => 1 + ); + + // Current style array syntax + $config = [ + 'authproc' => [ + 60 => 'class:etc' + ], + 'other example' => 1 + ]; + +Finally, a new experimental user interface has been introduced. The interface +is split in two: + +* A user interface targeted at end users, which allows them to authenticate and + see their information, as well as manage any options relevant to them. +* An admin interface with most of the pages in the current web interface. This + new interface is implemented in an admin module that can be disabled, effectively + removing the administrator interface completely. + +In order to test this new user interface, a temporary configuration option +`usenewui` needs to be set to `true`. This configuration option will disappear +in SimpleSAMLphp 2.0, where the new user interface will be the only one available. \ No newline at end of file diff --git a/vendor/simplesamlphp/simplesamlphp/extra/simplesamlphp.spec b/vendor/simplesamlphp/simplesamlphp/extra/simplesamlphp.spec index 478b531e95..996258f76e 100644 --- a/vendor/simplesamlphp/simplesamlphp/extra/simplesamlphp.spec +++ b/vendor/simplesamlphp/simplesamlphp/extra/simplesamlphp.spec @@ -1,6 +1,6 @@ %define name simplesamlphp %define summary SAML IDP/SP written in PHP -%define version 1.15.4 +%define version 1.17.8 %define release 1 %define license LGPL 2.1 %define group Networking/WWW diff --git a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Auth/AuthenticationFactory.php b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Auth/AuthenticationFactory.php new file mode 100644 index 0000000000..7335bc2d56 --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Auth/AuthenticationFactory.php @@ -0,0 +1,37 @@ +<?php + +namespace SimpleSAML\Auth; + +/** + * Factory class to get instances of \SimpleSAML\Auth\Simple for a given authentication source. + */ +class AuthenticationFactory +{ + + /** @var \SimpleSAML\Configuration */ + protected $config; + + /** @var \SimpleSAML\Session */ + protected $session; + + + public function __construct(\SimpleSAML\Configuration $config, \SimpleSAML\Session $session) + { + $this->config = $config; + $this->session = $session; + } + + + /** + * Create a new instance of \SimpleSAML\Auth\Simple for the given authentication source. + * + * @param string $as The identifier of the authentication source, as indexed in the authsources.php configuration + * file. + * + * @return \SimpleSAML\Auth\Simple + */ + public function create($as) + { + return new Simple($as, $this->config, $this->session); + } +} \ No newline at end of file diff --git a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Auth/Default.php b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Auth/Default.php index 3e7814b4d0..86c7465cd5 100644 --- a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Auth/Default.php +++ b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Auth/Default.php @@ -1,5 +1,7 @@ <?php +namespace SimpleSAML\Auth; + /** * Implements the default behaviour for authentication. * @@ -11,116 +13,127 @@ * * @deprecated This class will be removed in SSP 2.0. */ -class SimpleSAML_Auth_Default { - - - /** - * @deprecated This method will be removed in SSP 2.0. Use SimpleSAML_Auth_Source::initLogin() instead. - */ - public static function initLogin($authId, $return, $errorURL = NULL, - array $params = array()) { - - $as = self::getAuthSource($authId); - $as->initLogin($return, $errorURL, $params); - } - - - /** - * @deprecated This method will be removed in SSP 2.0. Please use - * SimpleSAML_Auth_State::getPersistentAuthData() instead. - */ - public static function extractPersistentAuthState(array &$state) { - - return SimpleSAML_Auth_State::getPersistentAuthData($state); - } - - - /** - * @deprecated This method will be removed in SSP 2.0. Please use SimpleSAML_Auth_Source::loginCompleted() instead. - */ - public static function loginCompleted($state) { - SimpleSAML_Auth_Source::loginCompleted($state); - } - - - /** - * @deprecated This method will be removed in SSP 2.0. - */ - public static function initLogoutReturn($returnURL, $authority) { - assert('is_string($returnURL)'); - assert('is_string($authority)'); - - $session = SimpleSAML_Session::getSessionFromRequest(); - - $state = $session->getAuthData($authority, 'LogoutState'); - $session->doLogout($authority); - - $state['SimpleSAML_Auth_Default.ReturnURL'] = $returnURL; - $state['LogoutCompletedHandler'] = array(get_class(), 'logoutCompleted'); - - $as = SimpleSAML_Auth_Source::getById($authority); - if ($as === NULL) { - // The authority wasn't an authentication source... - self::logoutCompleted($state); - } - - $as->logout($state); - } - - - /** - * @deprecated This method will be removed in SSP 2.0. - */ - public static function initLogout($returnURL, $authority) { - assert('is_string($returnURL)'); - assert('is_string($authority)'); - - self::initLogoutReturn($returnURL, $authority); - - \SimpleSAML\Utils\HTTP::redirectTrustedURL($returnURL); - } - - - /** - * @deprecated This method will be removed in SSP 2.0. - */ - public static function logoutCompleted($state) { - assert('is_array($state)'); - assert('array_key_exists("SimpleSAML_Auth_Default.ReturnURL", $state)'); - - \SimpleSAML\Utils\HTTP::redirectTrustedURL($state['SimpleSAML_Auth_Default.ReturnURL']); - } - - - /** - * @deprecated This method will be removed in SSP 2.0. Please use SimpleSAML_Auth_Source::logoutCallback() instead. - */ - public static function logoutCallback($state) { - SimpleSAML_Auth_Source::logoutCallback($state); - } - - - /** - * @deprecated This method will be removed in SSP 2.0. Please use - * sspmod_saml_Auth_Source_SP::handleUnsolicitedAuth() instead. - */ - public static function handleUnsolicitedAuth($authId, array $state, $redirectTo) { - sspmod_saml_Auth_Source_SP::handleUnsolicitedAuth($authId, $state, $redirectTo); - } - - /** - * Return an authentication source by ID. - * - * @param string $id The id of the authentication source. - * @return SimpleSAML_Auth_Source The authentication source. - * @throws Exception If the $id does not correspond with an authentication source. - */ - private static function getAuthSource($id) { - $as = SimpleSAML_Auth_Source::getById($id); - if ($as === null) { - throw new Exception('Invalid authentication source: ' . $id); - } - return $as; - } +class DefaultAuth +{ + /** + * @deprecated This method will be removed in SSP 2.0. Use Source::initLogin() instead. + */ + public static function initLogin( + $authId, + $return, + $errorURL = null, + array $params = [] + ) { + + $as = self::getAuthSource($authId); + $as->initLogin($return, $errorURL, $params); + } + + + /** + * @deprecated This method will be removed in SSP 2.0. Please use + * State::getPersistentAuthData() instead. + */ + public static function extractPersistentAuthState(array &$state) + { + return State::getPersistentAuthData($state); + } + + + /** + * @deprecated This method will be removed in SSP 2.0. Please use Source::loginCompleted() instead. + */ + public static function loginCompleted($state) + { + Source::loginCompleted($state); + } + + + /** + * @deprecated This method will be removed in SSP 2.0. + */ + public static function initLogoutReturn($returnURL, $authority) + { + assert(is_string($returnURL)); + assert(is_string($authority)); + + $session = \SimpleSAML\Session::getSessionFromRequest(); + + $state = $session->getAuthData($authority, 'LogoutState'); + $session->doLogout($authority); + + $state['\SimpleSAML\Auth\DefaultAuth.ReturnURL'] = $returnURL; + $state['LogoutCompletedHandler'] = [get_class(), 'logoutCompleted']; + + $as = Source::getById($authority); + if ($as === null) { + // The authority wasn't an authentication source... + self::logoutCompleted($state); + } + + $as->logout($state); + } + + + /** + * @deprecated This method will be removed in SSP 2.0. + */ + public static function initLogout($returnURL, $authority) + { + assert(is_string($returnURL)); + assert(is_string($authority)); + + self::initLogoutReturn($returnURL, $authority); + + \SimpleSAML\Utils\HTTP::redirectTrustedURL($returnURL); + } + + + /** + * @deprecated This method will be removed in SSP 2.0. + */ + public static function logoutCompleted($state) + { + assert(is_array($state)); + assert(array_key_exists('\SimpleSAML\Auth\DefaultAuth.ReturnURL', $state)); + + \SimpleSAML\Utils\HTTP::redirectTrustedURL($state['\SimpleSAML\Auth\DefaultAuth.ReturnURL']); + } + + + /** + * @deprecated This method will be removed in SSP 2.0. Please use Source::logoutCallback() instead. + */ + public static function logoutCallback($state) + { + Source::logoutCallback($state); + } + + + /** + * @deprecated This method will be removed in SSP 2.0. Please use + * \SimpleSAML\Module\saml\Auth\Source\SP::handleUnsolicitedAuth() instead. + */ + public static function handleUnsolicitedAuth($authId, array $state, $redirectTo) + { + \SimpleSAML\Module\saml\Auth\Source\SP::handleUnsolicitedAuth($authId, $state, $redirectTo); + } + + + /** + * Return an authentication source by ID. + * + * @param string $id The id of the authentication source. + * @return Source The authentication source. + * @throws \Exception If the $id does not correspond with an authentication source. + */ + private static function getAuthSource($id) + { + $as = Source::getById($id); + if ($as === null) { + throw new \Exception('Invalid authentication source: '.$id); + } + return $as; + } } diff --git a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Auth/LDAP.php b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Auth/LDAP.php index 0aa5304c0b..c83d221f9c 100644 --- a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Auth/LDAP.php +++ b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Auth/LDAP.php @@ -1,8 +1,14 @@ <?php +namespace SimpleSAML\Auth; + +use SimpleSAML\Error; +use SimpleSAML\Logger; + /** * Constants defining possible errors */ + define('ERR_INTERNAL', 1); define('ERR_NO_USER', 2); define('ERR_WRONG_PW', 3); @@ -22,7 +28,8 @@ * @author Anders Lund, UNINETT AS. <anders.lund@uninett.no> * @package SimpleSAMLphp */ -class SimpleSAML_Auth_LDAP + +class LDAP { /** * LDAP link identifier. @@ -53,17 +60,21 @@ class SimpleSAML_Auth_LDAP * @param int $port * @param bool $referrals */ - // TODO: Flesh out documentation - public function __construct($hostname, $enable_tls = true, $debug = false, $timeout = 0, $port = 389, $referrals = true) - { - + public function __construct( + $hostname, + $enable_tls = true, + $debug = false, + $timeout = 0, + $port = 389, + $referrals = true + ) { // Debug - SimpleSAML\Logger::debug('Library - LDAP __construct(): Setup LDAP with ' . - 'host=\'' . $hostname . - '\', tls=' . var_export($enable_tls, true) . - ', debug=' . var_export($debug, true) . - ', timeout=' . var_export($timeout, true) . - ', referrals=' . var_export($referrals, true)); + Logger::debug('Library - LDAP __construct(): Setup LDAP with '. + 'host=\''.$hostname. + '\', tls='.var_export($enable_tls, true). + ', debug='.var_export($debug, true). + ', timeout='.var_export($timeout, true). + ', referrals='.var_export($referrals, true)); /* * Set debug level before calling connect. Note that this passes @@ -72,26 +83,36 @@ public function __construct($hostname, $enable_tls = true, $debug = false, $time * OpenLDAP 2.x.x or Netscape Directory SDK x.x needed for this option. */ if ($debug && !ldap_set_option(null, LDAP_OPT_DEBUG_LEVEL, 7)) { - SimpleSAML\Logger::warning('Library - LDAP __construct(): Unable to set debug level (LDAP_OPT_DEBUG_LEVEL) to 7'); + Logger::warning('Library - LDAP __construct(): Unable to set debug level (LDAP_OPT_DEBUG_LEVEL) to 7'); } /* * Prepare a connection for to this LDAP server. Note that this function * doesn't actually connect to the server. */ - $this->ldap = @ldap_connect($hostname, $port); - if ($this->ldap === false) { - throw $this->makeException('Library - LDAP __construct(): Unable to connect to \'' . $hostname . '\'', ERR_INTERNAL); + $resource = @ldap_connect($hostname, $port); + if ($resource === false) { + throw $this->makeException( + 'Library - LDAP __construct(): Unable to connect to \''.$hostname.'\'', + ERR_INTERNAL + ); } + $this->ldap = $resource; // Enable LDAP protocol version 3 if (!@ldap_set_option($this->ldap, LDAP_OPT_PROTOCOL_VERSION, 3)) { - throw $this->makeException('Library - LDAP __construct(): Failed to set LDAP Protocol version (LDAP_OPT_PROTOCOL_VERSION) to 3', ERR_INTERNAL); + throw $this->makeException( + 'Library - LDAP __construct(): Failed to set LDAP Protocol version (LDAP_OPT_PROTOCOL_VERSION) to 3', + ERR_INTERNAL + ); } // Set referral option if (!@ldap_set_option($this->ldap, LDAP_OPT_REFERRALS, $referrals)) { - throw $this->makeException('Library - LDAP __construct(): Failed to set LDAP Referrals (LDAP_OPT_REFERRALS) to '.$referrals, ERR_INTERNAL); + throw $this->makeException( + 'Library - LDAP __construct(): Failed to set LDAP Referrals (LDAP_OPT_REFERRALS) to '.$referrals, + ERR_INTERNAL + ); } // Set timeouts, if supported @@ -99,17 +120,22 @@ public function __construct($hostname, $enable_tls = true, $debug = false, $time $this->timeout = $timeout; if ($timeout > 0) { if (!@ldap_set_option($this->ldap, LDAP_OPT_NETWORK_TIMEOUT, $timeout)) { - SimpleSAML\Logger::warning('Library - LDAP __construct(): Unable to set timeouts (LDAP_OPT_NETWORK_TIMEOUT) to ' . $timeout); + Logger::warning( + 'Library - LDAP __construct(): Unable to set timeouts (LDAP_OPT_NETWORK_TIMEOUT) to '.$timeout + ); } if (!@ldap_set_option($this->ldap, LDAP_OPT_TIMELIMIT, $timeout)) { - SimpleSAML\Logger::warning('Library - LDAP __construct(): Unable to set timeouts (LDAP_OPT_TIMELIMIT) to ' . $timeout); + Logger::warning( + 'Library - LDAP __construct(): Unable to set timeouts (LDAP_OPT_TIMELIMIT) to '.$timeout + ); } } // Enable TLS, if needed - if (stripos($hostname, "ldaps:") === false and $enable_tls) { + if (stripos($hostname, "ldaps:") === false && $enable_tls) { if (!@ldap_start_tls($this->ldap)) { - throw $this->makeException('Library - LDAP __construct(): Unable to force TLS', ERR_INTERNAL); + throw $this->makeException('Library - LDAP __construct():'. + ' Unable to force TLS', ERR_INTERNAL); } } } @@ -121,7 +147,7 @@ public function __construct($hostname, $enable_tls = true, $debug = false, $time * * @param string $description * The exception's description - * @return Exception + * @return \Exception */ private function makeException($description, $type = null) { @@ -129,7 +155,7 @@ private function makeException($description, $type = null) // Log LDAP code and description, if possible if (empty($this->ldap)) { - SimpleSAML\Logger::error($description); + Logger::error($description); } else { $errNo = @ldap_errno($this->ldap); } @@ -138,45 +164,48 @@ private function makeException($description, $type = null) if ($type) { if ($errNo !== 0) { // Only log real LDAP errors; not success - SimpleSAML\Logger::error($description . '; cause: \'' . ldap_error($this->ldap) . '\' (0x' . dechex($errNo) . ')'); + Logger::error($description.'; cause: \''.ldap_error($this->ldap).'\' (0x'.dechex($errNo).')'); } else { - SimpleSAML\Logger::error($description); + Logger::error($description); } switch ($type) { case ERR_INTERNAL:// 1 - ExInternal - return new SimpleSAML_Error_Exception($description, $errNo); + return new Error\Exception($description, $errNo); case ERR_NO_USER:// 2 - ExUserNotFound - return new SimpleSAML_Error_UserNotFound($description, $errNo); + return new Error\UserNotFound($description, $errNo); case ERR_WRONG_PW:// 3 - ExInvalidCredential - return new SimpleSAML_Error_InvalidCredential($description, $errNo); + return new Error\InvalidCredential($description, $errNo); case ERR_AS_DATA_INCONSIST:// 4 - ExAsDataInconsist - return new SimpleSAML_Error_AuthSource('ldap', $description); + return new Error\AuthSource('ldap', $description); case ERR_AS_INTERNAL:// 5 - ExAsInternal - return new SimpleSAML_Error_AuthSource('ldap', $description); + return new Error\AuthSource('ldap', $description); } } else { if ($errNo !== 0) { - $description .= '; cause: \'' . ldap_error($this->ldap) . '\' (0x' . dechex($errNo) . ')'; - if (@ldap_get_option($this->ldap, LDAP_OPT_DIAGNOSTIC_MESSAGE, $extendedError) && !empty($extendedError)) { - $description .= '; additional: \'' . $extendedError . '\''; + $description .= '; cause: \''.ldap_error($this->ldap).'\' (0x'.dechex($errNo).')'; + if (@ldap_get_option($this->ldap, LDAP_OPT_DIAGNOSTIC_MESSAGE, $extendedError) + && !empty($extendedError) + ) { + $description .= '; additional: \''.$extendedError.'\''; } } switch ($errNo) { case 0x20://LDAP_NO_SUCH_OBJECT - SimpleSAML\Logger::warning($description); - return new SimpleSAML_Error_UserNotFound($description, $errNo); + Logger::warning($description); + return new Error\UserNotFound($description, $errNo); case 0x31://LDAP_INVALID_CREDENTIALS - SimpleSAML\Logger::info($description); - return new SimpleSAML_Error_InvalidCredential($description, $errNo); + Logger::info($description); + return new Error\InvalidCredential($description, $errNo); case -1://NO_SERVER_CONNECTION - SimpleSAML\Logger::error($description); - return new SimpleSAML_Error_AuthSource('ldap', $description); + Logger::error($description); + return new Error\AuthSource('ldap', $description); default: - SimpleSAML\Logger::error($description); - return new SimpleSAML_Error_AuthSource('ldap', $description); + Logger::error($description); + return new Error\AuthSource('ldap', $description); } } + return new \Exception('Unknown LDAP error.'); } @@ -189,42 +218,54 @@ private function makeException($description, $type = null) * The attribute name(s) to search for. * @param string $value * The attribute value to search for. + * Additional search filter + * @param string|null $searchFilter + * The scope of the search + * @param string $scope * @return string * The DN of the resulting found element. - * @throws SimpleSAML_Error_Exception if: + * @throws Error\Exception if: * - Attribute parameter is wrong type - * @throws SimpleSAML_Error_AuthSource if: + * @throws Error\AuthSource if: * - Not able to connect to LDAP server * - False search result * - Count return false * - Searche found more than one result * - Failed to get first entry from result * - Failed to get DN for entry - * @throws SimpleSAML_Error_UserNotFound if: + * @throws Error\UserNotFound if: * - Zero entries were found */ - private function search($base, $attribute, $value, $searchFilter = null) + private function search($base, $attribute, $value, $searchFilter = null, $scope = "subtree") { // Create the search filter $attribute = self::escape_filter_value($attribute, false); - $value = self::escape_filter_value($value); + $value = self::escape_filter_value($value, true); $filter = ''; foreach ($attribute as $attr) { - $filter .= '(' . $attr . '=' . $value. ')'; + $filter .= '('.$attr.'='.$value.')'; } - $filter = '(|' . $filter . ')'; + $filter = '(|'.$filter.')'; // Append LDAP filters if defined - if ($searchFilter != null) { + if ($searchFilter !== null) { $filter = "(&".$filter."".$searchFilter.")"; } // Search using generated filter - SimpleSAML\Logger::debug('Library - LDAP search(): Searching base \'' . $base . '\' for \'' . $filter . '\''); - // TODO: Should aliases be dereferenced? - $result = @ldap_search($this->ldap, $base, $filter, array(), 0, 0, $this->timeout); + Logger::debug('Library - LDAP search(): Searching base ('.$scope.') \''.$base.'\' for \''.$filter.'\''); + if ($scope === 'base') { + $result = @ldap_read($this->ldap, $base, $filter, [], 0, 0, $this->timeout, LDAP_DEREF_NEVER); + } elseif ($scope === 'onelevel') { + $result = @ldap_list($this->ldap, $base, $filter, [], 0, 0, $this->timeout, LDAP_DEREF_NEVER); + } else { + $result = @ldap_search($this->ldap, $base, $filter, [], 0, 0, $this->timeout, LDAP_DEREF_NEVER); + } + if ($result === false) { - throw $this->makeException('Library - LDAP search(): Failed search on base \'' . $base . '\' for \'' . $filter . '\''); + throw $this->makeException( + 'Library - LDAP search(): Failed search on base \''.$base.'\' for \''.$filter.'\'' + ); } // Sanity checks on search results @@ -233,23 +274,33 @@ private function search($base, $attribute, $value, $searchFilter = null) throw $this->makeException('Library - LDAP search(): Failed to get number of entries returned'); } elseif ($count > 1) { // More than one entry is found. External error - throw $this->makeException('Library - LDAP search(): Found ' . $count . ' entries searching base \'' . $base . '\' for \'' . $filter . '\'', ERR_AS_DATA_INCONSIST); + throw $this->makeException( + 'Library - LDAP search(): Found '.$count.' entries searching base \''.$base.'\' for \''.$filter.'\'', + ERR_AS_DATA_INCONSIST + ); } elseif ($count === 0) { // No entry is fond => wrong username is given (or not registered in the catalogue). User error - throw $this->makeException('Library - LDAP search(): Found no entries searching base \'' . $base . '\' for \'' . $filter . '\'', ERR_NO_USER); + throw $this->makeException( + 'Library - LDAP search(): Found no entries searching base \''.$base.'\' for \''.$filter.'\'', + ERR_NO_USER + ); } // Resolve the DN from the search result $entry = @ldap_first_entry($this->ldap, $result); if ($entry === false) { - throw $this->makeException('Library - LDAP search(): Unable to retrieve result after searching base \'' . $base . '\' for \'' . $filter . '\''); + throw $this->makeException( + 'Library - LDAP search(): Unable to retrieve result after searching base \''. + $base.'\' for \''.$filter.'\'' + ); } $dn = @ldap_get_dn($this->ldap, $entry); if ($dn === false) { - throw $this->makeException('Library - LDAP search(): Unable to get DN after searching base \'' . $base . '\' for \'' . $filter . '\''); + throw $this->makeException( + 'Library - LDAP search(): Unable to get DN after searching base \''.$base.'\' for \''.$filter.'\'' + ); } - // FIXME: Are we now sure, if no excepton has been thrown, that we are returning a DN? return $dn; } @@ -266,45 +317,54 @@ private function search($base, $attribute, $value, $searchFilter = null) * @param bool $allowZeroHits * Determines if the method will throw an exception if no hits are found. * Defaults to FALSE. + * @param string|null $searchFilter + * Additional searchFilter to be added to the (attribute=value) filter + * @param string $scope + * The scope of the search * @return string * The DN of the matching element, if found. If no element was found and * $allowZeroHits is set to FALSE, an exception will be thrown; otherwise * NULL will be returned. - * @throws SimpleSAML_Error_AuthSource if: + * @throws Error\AuthSource if: * - LDAP search encounter some problems when searching cataloge * - Not able to connect to LDAP server - * @throws SimpleSAML_Error_UserNotFound if: + * @throws Error\UserNotFound if: * - $allowZeroHits is FALSE and no result is found * */ - public function searchfordn($base, $attribute, $value, $allowZeroHits = false, $searchFilter = null) - { + public function searchfordn( + $base, + $attribute, + $value, + $allowZeroHits = false, + $searchFilter = null, + $scope = 'subtree' + ) { // Traverse all search bases, returning DN if found - $bases = SimpleSAML\Utils\Arrays::arrayize($base); - $result = null; + $bases = \SimpleSAML\Utils\Arrays::arrayize($base); foreach ($bases as $current) { try { // Single base search - $result = $this->search($current, $attribute, $value, $searchFilter); + $result = $this->search($current, $attribute, $value, $searchFilter, $scope); // We don't hawe to look any futher if user is found if (!empty($result)) { return $result; } // If search failed, attempt the other base DNs - } catch (SimpleSAML_Error_UserNotFound $e) { + } catch (Error\UserNotFound $e) { // Just continue searching } } // Decide what to do for zero entries - SimpleSAML\Logger::debug('Library - LDAP searchfordn(): No entries found'); + Logger::debug('Library - LDAP searchfordn(): No entries found'); if ($allowZeroHits) { // Zero hits allowed return null; } else { // Zero hits not allowed - throw $this->makeException('Library - LDAP searchfordn(): LDAP search returned zero entries for filter \'(' . - $attribute . ' = ' . $value . ')\' on base(s) \'(' . join(' & ', $bases) . ')\'', 2); + throw $this->makeException('Library - LDAP searchfordn(): LDAP search returned zero entries for'. + ' filter \'('.join(' | ', $attribute).' = '.$value.')\' on base(s) \'('.join(' & ', $bases).')\'', 2); } } @@ -313,16 +373,24 @@ public function searchfordn($base, $attribute, $value, $allowZeroHits = false, $ * This method was created specifically for the ldap:AttributeAddUsersGroups->searchActiveDirectory() * method, but could be used for other LDAP search needs. It will search LDAP and return all the entries. * - * @throws Exception + * @throws \Exception * @param string|array $bases - * @param string|array $filters Array of 'attribute' => 'values' to be combined into the filter, or a raw filter string + * @param string|array $filters Array of 'attribute' => 'values' to be combined into the filter, + * or a raw filter string * @param string|array $attributes Array of attributes requested from LDAP * @param bool $and If multiple filters defined, then either bind them with & or | * @param bool $escape Weather to escape the filter values or not + * @param string $scope The scope of the search * @return array */ - public function searchformultiple($bases, $filters, $attributes = array(), $and = true, $escape = true) - { + public function searchformultiple( + $bases, + $filters, + $attributes = [], + $and = true, + $escape = true, + $scope = 'subtree' + ) { // Escape the filter values, if requested if ($escape) { $filters = $this->escape_filter_value($filters, false); @@ -335,7 +403,7 @@ public function searchformultiple($bases, $filters, $attributes = array(), $and $filter .= "($attribute=$value)"; } if (count($filters) > 1) { - $filter = ($and ? '(&' : '(|') . $filter . ')'; + $filter = ($and ? '(&' : '(|').$filter.')'; } } elseif (is_string($filters)) { $filter = $filters; @@ -355,7 +423,14 @@ public function searchformultiple($bases, $filters, $attributes = array(), $and // Search each base until result is found $result = false; foreach ($bases as $base) { - $result = @ldap_search($this->ldap, $base, $filter, $attributes, 0, 0, $this->timeout); + if ($scope === 'base') { + $result = @ldap_read($this->ldap, $base, $filter, $attributes, 0, 0, $this->timeout); + } elseif ($scope === 'onelevel') { + $result = @ldap_list($this->ldap, $base, $filter, $attributes, 0, 0, $this->timeout); + } else { + $result = @ldap_search($this->ldap, $base, $filter, $attributes, 0, 0, $this->timeout); + } + if ($result !== false && @ldap_count_entries($this->ldap, $result) > 0) { break; } @@ -364,14 +439,14 @@ public function searchformultiple($bases, $filters, $attributes = array(), $and // Verify that a result was found in one of the bases if ($result === false) { throw $this->makeException( - 'ldap:LdapConnection->search_manual : Failed to search LDAP using base(s) [' . - implode('; ', $bases) . '] with filter [' . $filter . ']. LDAP error [' . - ldap_error($this->ldap) . ']' + 'ldap:LdapConnection->search_manual : Failed to search LDAP using base(s) ['. + implode('; ', $bases).'] with filter ['.$filter.']. LDAP error ['. + ldap_error($this->ldap).']' ); } elseif (@ldap_count_entries($this->ldap, $result) < 1) { throw $this->makeException( - 'ldap:LdapConnection->search_manual : No entries found in LDAP using base(s) [' . - implode('; ', $bases) . '] with filter [' . $filter . ']', + 'ldap:LdapConnection->search_manual : No entries found in LDAP using base(s) ['. + implode('; ', $bases).'] with filter ['.$filter.']', ERR_NO_USER ); } @@ -423,12 +498,10 @@ public function searchformultiple($bases, $filters, $attributes = array(), $and * Returns TRUE if successful, FALSE if * LDAP_INVALID_CREDENTIALS, LDAP_X_PROXY_AUTHZ_FAILURE, * LDAP_INAPPROPRIATE_AUTH, LDAP_INSUFFICIENT_ACCESS - * @throws SimpleSAML_Error_Exception on other errors + * @throws Error\Exception on other errors */ public function bind($dn, $password, array $sasl_args = null) { - $authz_id = null; - if ($sasl_args != null) { if (!function_exists('ldap_sasl_bind')) { $ex_msg = 'Library - missing SASL support'; @@ -437,12 +510,16 @@ public function bind($dn, $password, array $sasl_args = null) // SASL Bind, with error handling $authz_id = $sasl_args['authz_id']; - $error = @ldap_sasl_bind($this->ldap, $dn, $password, + $error = @ldap_sasl_bind( + $this->ldap, + $dn, + $password, $sasl_args['mech'], $sasl_args['realm'], $sasl_args['authc_id'], $sasl_args['authz_id'], - $sasl_args['props']); + $sasl_args['props'] + ); } else { // Simple Bind, with error handling $authz_id = $dn; @@ -452,7 +529,7 @@ public function bind($dn, $password, array $sasl_args = null) if ($error === true) { // Good $this->authz_id = $authz_id; - SimpleSAML\Logger::debug('Library - LDAP bind(): Bind successful with DN \'' . $dn . '\''); + Logger::debug('Library - LDAP bind(): Bind successful with DN \''.$dn.'\''); return true; } @@ -475,7 +552,7 @@ public function bind($dn, $password, array $sasl_args = null) } // Bad - throw $this->makeException('Library - LDAP bind(): Bind failed with DN \'' . $dn . '\''); + throw $this->makeException('Library - LDAP bind(): Bind failed with DN \''.$dn.'\''); } @@ -492,16 +569,16 @@ public function setOption($option, $value) // Attempt to set the LDAP option if (!@ldap_set_option($this->ldap, $option, $value)) { throw $this->makeException( - 'ldap:LdapConnection->setOption : Failed to set LDAP option [' . - $option . '] with the value [' . $value . '] error: ' . ldap_error($this->ldap), + 'ldap:LdapConnection->setOption : Failed to set LDAP option ['. + $option.'] with the value ['.$value.'] error: '.ldap_error($this->ldap), ERR_INTERNAL ); } // Log debug message - SimpleSAML\Logger::debug( - 'ldap:LdapConnection->setOption : Set the LDAP option [' . - $option . '] with the value [' . $value . ']' + Logger::debug( + 'ldap:LdapConnection->setOption : Set the LDAP option ['. + $option.'] with the value ['.$value.']' ); } @@ -527,65 +604,67 @@ public function getAttributes($dn, $attributes = null, $maxsize = null) // Preparations, including a pretty debug message... $description = 'all attributes'; if (is_array($attributes)) { - $description = '\'' . join(',', $attributes) . '\''; + $description = '\''.join(',', $attributes).'\''; } else { // Get all attributes... // TODO: Verify that this originally was the intended behaviour. Could $attributes be a string? - $attributes = array(); + $attributes = []; } - SimpleSAML\Logger::debug('Library - LDAP getAttributes(): Getting ' . $description . ' from DN \'' . $dn . '\''); + Logger::debug('Library - LDAP getAttributes(): Getting '.$description.' from DN \''.$dn.'\''); // Attempt to get attributes // TODO: Should aliases be dereferenced? $result = @ldap_read($this->ldap, $dn, 'objectClass=*', $attributes, 0, 0, $this->timeout); if ($result === false) { - throw $this->makeException('Library - LDAP getAttributes(): Failed to get attributes from DN \'' . $dn . '\''); + throw $this->makeException('Library - LDAP getAttributes(): Failed to get attributes from DN \''.$dn.'\''); } $entry = @ldap_first_entry($this->ldap, $result); if ($entry === false) { - throw $this->makeException('Library - LDAP getAttributes(): Could not get first entry from DN \'' . $dn . '\''); + throw $this->makeException('Library - LDAP getAttributes(): Could not get first entry from DN \''.$dn.'\''); } - $attributes = @ldap_get_attributes($this->ldap, $entry); // Recycling $attributes... Possibly bad practice. + $attributes = @ldap_get_attributes($this->ldap, $entry); // Recycling $attributes... Possibly bad practice. if ($attributes === false) { - throw $this->makeException('Library - LDAP getAttributes(): Could not get attributes of first entry from DN \'' . $dn . '\''); + throw $this->makeException( + 'Library - LDAP getAttributes(): Could not get attributes of first entry from DN \''.$dn.'\'' + ); } // Parsing each found attribute into our result set - $result = array(); // Recycling $result... Possibly bad practice. + $result = []; // Recycling $result... Possibly bad practice. for ($i = 0; $i < $attributes['count']; $i++) { - // Ignore attributes that exceed the maximum allowed size $name = $attributes[$i]; $attribute = $attributes[$name]; // Deciding whether to base64 encode - $values = array(); + $values = []; for ($j = 0; $j < $attribute['count']; $j++) { $value = $attribute[$j]; - if (!empty($maxsize) && strlen($value) >= $maxsize) { + if (!empty($maxsize) && strlen($value) > $maxsize) { // Ignoring and warning - SimpleSAML\Logger::warning('Library - LDAP getAttributes(): Attribute \'' . - $name . '\' exceeded maximum allowed size by ' + ($maxsize - strlen($value))); + Logger::warning('Library - LDAP getAttributes(): Attribute \''. + $name.'\' exceeded maximum allowed size by '.(strlen($value) - $maxsize)); continue; } // Base64 encode binary attributes - if (strtolower($name) === 'jpegphoto' || strtolower($name) === 'objectguid') { + if (strtolower($name) === 'jpegphoto' + || strtolower($name) === 'objectguid' + || strtolower($name) === 'ms-ds-consistencyguid' + ) { $values[] = base64_encode($value); } else { $values[] = $value; } - } // Adding $result[$name] = $values; - } // We're done - SimpleSAML\Logger::debug('Library - LDAP getAttributes(): Found attributes \'(' . join(',', array_keys($result)) . ')\''); + Logger::debug('Library - LDAP getAttributes(): Found attributes \'('.join(',', array_keys($result)).')\''); return $result; } @@ -593,12 +672,11 @@ public function getAttributes($dn, $attributes = null, $maxsize = null) /** * Enter description here... * - * @param string $config + * @param array $config * @param string $username * @param string $password * @return array|bool */ - // TODO: Documentation; only cleared up exception/log messages public function validate($config, $username, $password = null) { /* Escape any characters with a special meaning in LDAP. The following @@ -617,11 +695,14 @@ public function validate($config, $username, $password = null) $dn = $this->searchfordn($config['searchbase'], $config['searchattributes'], $username); } - if ($password !== null) { // checking users credentials ... assuming below that she may read her own attributes ... + if ($password !== null) { + // checking users credentials ... assuming below that she may read her own attributes ... // escape characters with a special meaning, also in the password $password = addcslashes($password, ',+"\\<>;*'); if (!$this->bind($dn, $password)) { - SimpleSAML\Logger::info('Library - LDAP validate(): Failed to authenticate \''. $username . '\' using DN \'' . $dn . '\''); + Logger::info( + 'Library - LDAP validate(): Failed to authenticate \''.$username.'\' using DN \''.$dn.'\'' + ); return false; } } @@ -631,7 +712,6 @@ public function validate($config, $username, $password = null) */ $attributes = $this->getAttributes($dn, $config['attributes']); return $attributes; - } @@ -645,28 +725,26 @@ public function validate($config, $username, $password = null) * backslash followed by two hex digits representing the hexadecimal value of the character. * * @static - * @param array $values Array of values to escape + * @param string|array $values Array of values to escape * @return array Array $values, but escaped */ - public static function escape_filter_value($values = array(), $singleValue = true) + public static function escape_filter_value($values = [], $singleValue = true) { // Parameter validation - if (!is_array($values)) { - $values = array($values); - } + $values = \SimpleSAML\Utils\Arrays::arrayize($values); foreach ($values as $key => $val) { // Escaping of filter meta characters $val = str_replace('\\', '\5c', $val); - $val = str_replace('*', '\2a', $val); - $val = str_replace('(', '\28', $val); - $val = str_replace(')', '\29', $val); + $val = str_replace('*', '\2a', $val); + $val = str_replace('(', '\28', $val); + $val = str_replace(')', '\29', $val); // ASCII < 32 escaping $val = self::asc2hex32($val); if (null === $val) { - $val = '\0'; // apply escaped "null" if string is empty + $val = '\0'; // apply escaped "null" if string is empty } $values[$key] = $val; @@ -706,15 +784,18 @@ public static function asc2hex32($string) /** * Convert SASL authz_id into a DN */ - private function authzid_to_dn($searchBase, $searchAttributes, $authz_id) + private function authzidToDn($searchBase, $searchAttributes, $authz_id) { if (preg_match("/^dn:/", $authz_id)) { return preg_replace("/^dn:/", "", $authz_id); } if (preg_match("/^u:/", $authz_id)) { - return $this->searchfordn($searchBase, $searchAttributes, - preg_replace("/^u:/", "", $authz_id)); + return $this->searchfordn( + $searchBase, + $searchAttributes, + preg_replace("/^u:/", "", $authz_id) + ); } return $authz_id; } @@ -726,15 +807,14 @@ private function authzid_to_dn($searchBase, $searchAttributes, $authz_id) * ldap_exop_whoami() has been provided as a third party patch that * waited several years to get its way upstream: * http://cvsweb.netbsd.org/bsdweb.cgi/pkgsrc/databases/php-ldap/files - * + * * When it was integrated into PHP repository, the function prototype - * was changed, The new prototype was used in third party patch for + * was changed, The new prototype was used in third party patch for * PHP 7.0 and 7.1, hence the version test below. */ public function whoami($searchBase, $searchAttributes) { $authz_id = ''; - if (function_exists('ldap_exop_whoami')) { if (version_compare(phpversion(), '7', '<')) { if (ldap_exop_whoami($this->ldap, $authz_id) !== true) { @@ -749,7 +829,7 @@ public function whoami($searchBase, $searchAttributes) $authz_id = $this->authz_id; } - $dn = $this->authzid_to_dn($searchBase, $searchAttributes, $authz_id); + $dn = $this->authzidToDn($searchBase, $searchAttributes, $authz_id); if (!isset($dn) || ($dn == '')) { throw $this->makeException('Cannot figure userID'); diff --git a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Auth/ProcessingChain.php b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Auth/ProcessingChain.php index 361d81f9d9..a82d51334a 100644 --- a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Auth/ProcessingChain.php +++ b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Auth/ProcessingChain.php @@ -1,5 +1,7 @@ <?php +namespace SimpleSAML\Auth; + /** * Class for implementing authentication processing chains for IdPs. * @@ -10,351 +12,361 @@ * @author Olav Morken, UNINETT AS. * @package SimpleSAMLphp */ -class SimpleSAML_Auth_ProcessingChain { - - - /** - * The list of remaining filters which should be applied to the state. - */ - const FILTERS_INDEX = 'SimpleSAML_Auth_ProcessingChain.filters'; - - - /** - * The stage we use for completed requests. - */ - const COMPLETED_STAGE = 'SimpleSAML_Auth_ProcessingChain.completed'; - - - /** - * The request parameter we will use to pass the state identifier when we redirect after - * having completed processing of the state. - */ - const AUTHPARAM = 'AuthProcId'; - - - /** - * All authentication processing filters, in the order they should be applied. - */ - private $filters; - - - /** - * Initialize an authentication processing chain for the given service provider - * and identity provider. - * - * @param array $idpMetadata The metadata for the IdP. - * @param array $spMetadata The metadata for the SP. - */ - public function __construct($idpMetadata, $spMetadata, $mode = 'idp') { - assert('is_array($idpMetadata)'); - assert('is_array($spMetadata)'); - - $this->filters = array(); - - $config = SimpleSAML_Configuration::getInstance(); - $configauthproc = $config->getArray('authproc.' . $mode, NULL); - - if (!empty($configauthproc)) { - $configfilters = self::parseFilterList($configauthproc); - self::addFilters($this->filters, $configfilters); - } - - if (array_key_exists('authproc', $idpMetadata)) { - $idpFilters = self::parseFilterList($idpMetadata['authproc']); - self::addFilters($this->filters, $idpFilters); - } - - if (array_key_exists('authproc', $spMetadata)) { - $spFilters = self::parseFilterList($spMetadata['authproc']); - self::addFilters($this->filters, $spFilters); - } - - - SimpleSAML\Logger::debug('Filter config for ' . $idpMetadata['entityid'] . '->' . - $spMetadata['entityid'] . ': ' . str_replace("\n", '', var_export($this->filters, TRUE))); - - } - - - /** - * Sort & merge filter configuration - * - * Inserts unsorted filters into sorted filter list. This sort operation is stable. - * - * @param array &$target Target filter list. This list must be sorted. - * @param array $src Source filters. May be unsorted. - */ - private static function addFilters(&$target, $src) { - assert('is_array($target)'); - assert('is_array($src)'); - - foreach ($src as $filter) { - $fp = $filter->priority; - - // Find insertion position for filter - for($i = count($target)-1; $i >= 0; $i--) { - if ($target[$i]->priority <= $fp) { - // The new filter should be inserted after this one - break; - } - } - /* $i now points to the filter which should preceede the current filter. */ - array_splice($target, $i+1, 0, array($filter)); - } - - } - - - /** - * Parse an array of authentication processing filters. - * - * @param array $filterSrc Array with filter configuration. - * @return array Array of SimpleSAML_Auth_ProcessingFilter objects. - */ - private static function parseFilterList($filterSrc) { - assert('is_array($filterSrc)'); - - $parsedFilters = array(); - - foreach ($filterSrc as $priority => $filter) { - - if (is_string($filter)) { - $filter = array('class' => $filter); - } - - if (!is_array($filter)) { - throw new Exception('Invalid authentication processing filter configuration: ' . - 'One of the filters wasn\'t a string or an array.'); - } - - $parsedFilters[] = self::parseFilter($filter, $priority); - } - - return $parsedFilters; - } - - - /** - * Parse an authentication processing filter. - * - * @param array $config Array with the authentication processing filter configuration. - * @param int $priority The priority of the current filter, (not included in the filter - * definition.) - * @return SimpleSAML_Auth_ProcessingFilter The parsed filter. - */ - private static function parseFilter($config, $priority) { - assert('is_array($config)'); - - if (!array_key_exists('class', $config)) - throw new Exception('Authentication processing filter without name given.'); - - $className = SimpleSAML\Module::resolveClass($config['class'], 'Auth_Process', 'SimpleSAML_Auth_ProcessingFilter'); - $config['%priority'] = $priority; - unset($config['class']); - return new $className($config, NULL); - } - - - /** - * Process the given state. - * - * This function will only return if processing completes. If processing requires showing - * a page to the user, we will not be able to return from this function. There are two ways - * this can be handled: - * - Redirect to a URL: We will redirect to the URL set in $state['ReturnURL']. - * - Call a function: We will call the function set in $state['ReturnCall']. - * - * If an exception is thrown during processing, it should be handled by the caller of - * this function. If the user has redirected to a different page, the exception will be - * returned through the exception handler defined on the state array. See - * SimpleSAML_Auth_State for more information. - * - * @see SimpleSAML_Auth_State - * @see SimpleSAML_Auth_State::EXCEPTION_HANDLER_URL - * @see SimpleSAML_Auth_State::EXCEPTION_HANDLER_FUNC - * - * @param array &$state The state we are processing. - */ - public function processState(&$state) { - assert('is_array($state)'); - assert('array_key_exists("ReturnURL", $state) || array_key_exists("ReturnCall", $state)'); - assert('!array_key_exists("ReturnURL", $state) || !array_key_exists("ReturnCall", $state)'); - - $state[self::FILTERS_INDEX] = $this->filters; - - try { - - // TODO: remove this in SSP 2.0 - if (!array_key_exists('UserID', $state)) { - // No unique user ID present. Attempt to add one. - self::addUserID($state); - } - - while (count($state[self::FILTERS_INDEX]) > 0) { - $filter = array_shift($state[self::FILTERS_INDEX]); - $filter->process($state); - } - - } catch (SimpleSAML_Error_Exception $e) { - // No need to convert the exception - throw $e; - } catch (Exception $e) { - /* - * To be consistent with the exception we return after an redirect, - * we convert this exception before returning it. - */ - throw new SimpleSAML_Error_UnserializableException($e); - } - - // Completed - } - - - /** - * Continues processing of the state. - * - * This function is used to resume processing by filters which for example needed to show - * a page to the user. - * - * This function will never return. Exceptions thrown during processing will be passed - * to whatever exception handler is defined in the state array. - * - * @param array $state The state we are processing. - */ - public static function resumeProcessing($state) { - assert('is_array($state)'); - - while (count($state[self::FILTERS_INDEX]) > 0) { - $filter = array_shift($state[self::FILTERS_INDEX]); - try { - $filter->process($state); - } catch (SimpleSAML_Error_Exception $e) { - SimpleSAML_Auth_State::throwException($state, $e); - } catch (Exception $e) { - $e = new SimpleSAML_Error_UnserializableException($e); - SimpleSAML_Auth_State::throwException($state, $e); - } - } - - // Completed - - assert('array_key_exists("ReturnURL", $state) || array_key_exists("ReturnCall", $state)'); - assert('!array_key_exists("ReturnURL", $state) || !array_key_exists("ReturnCall", $state)'); - - - if (array_key_exists('ReturnURL', $state)) { - /* - * Save state information, and redirect to the URL specified - * in $state['ReturnURL']. - */ - $id = SimpleSAML_Auth_State::saveState($state, self::COMPLETED_STAGE); - \SimpleSAML\Utils\HTTP::redirectTrustedURL($state['ReturnURL'], array(self::AUTHPARAM => $id)); - } else { - /* Pass the state to the function defined in $state['ReturnCall']. */ - - // We are done with the state array in the session. Delete it. - SimpleSAML_Auth_State::deleteState($state); - - $func = $state['ReturnCall']; - assert('is_callable($func)'); - - call_user_func($func, $state); - assert(FALSE); - } - } - - - /** - * Process the given state passivly. - * - * Modules with user interaction are expected to throw an SimpleSAML_Error_NoPassive exception - * which are silently ignored. Exceptions of other types are passed further up the call stack. - * - * This function will only return if processing completes. - * - * @param array &$state The state we are processing. - */ - public function processStatePassive(&$state) { - assert('is_array($state)'); - // Should not be set when calling this method - assert('!array_key_exists("ReturnURL", $state)'); - - // Notify filters about passive request - $state['isPassive'] = TRUE; - - $state[self::FILTERS_INDEX] = $this->filters; - - // TODO: remove this in SSP 2.0 - if (!array_key_exists('UserID', $state)) { - // No unique user ID present. Attempt to add one. - self::addUserID($state); - } - - while (count($state[self::FILTERS_INDEX]) > 0) { - $filter = array_shift($state[self::FILTERS_INDEX]); - try { - $filter->process($state); - - // Ignore SimpleSAML_Error_NoPassive exceptions - } catch (SimpleSAML_Error_NoPassive $e) { } - } - } - - /** - * Retrieve a state which has finished processing. - * - * @param string $id The state identifier. - * @see SimpleSAML_Auth_State::parseStateID() - * @return Array The state referenced by the $id parameter. - */ - public static function fetchProcessedState($id) { - assert('is_string($id)'); - - return SimpleSAML_Auth_State::loadState($id, self::COMPLETED_STAGE); - } - - - /** - * @deprecated This method will be removed in SSP 2.0. - */ - private static function addUserID(&$state) { - assert('is_array($state)'); - assert('array_key_exists("Attributes", $state)'); - - if (isset($state['Destination']['userid.attribute'])) { - $attributeName = $state['Destination']['userid.attribute']; - SimpleSAML\Logger::warning("The 'userid.attribute' option has been deprecated."); - } elseif (isset($state['Source']['userid.attribute'])) { - $attributeName = $state['Source']['userid.attribute']; - SimpleSAML\Logger::warning("The 'userid.attribute' option has been deprecated."); - } else { - // Default attribute - $attributeName = 'eduPersonPrincipalName'; - } - - if (!array_key_exists($attributeName, $state['Attributes'])) { - return; - } - - $uid = $state['Attributes'][$attributeName]; - if (count($uid) === 0) { - SimpleSAML\Logger::warning('Empty user id attribute [' . $attributeName . '].'); - return; - } - - if (count($uid) > 1) { - SimpleSAML\Logger::warning('Multiple attribute values for user id attribute [' . $attributeName . '].'); - return; - } - - // TODO: the attribute value should be trimmed - $uid = $uid[0]; - - if (empty($uid)) { - SimpleSAML\Logger::warning('Empty value in attribute '.$attributeName.". on user. Cannot set UserID."); - return; - } - $state['UserID'] = $uid; - } +class ProcessingChain +{ + /** + * The list of remaining filters which should be applied to the state. + */ + const FILTERS_INDEX = '\SimpleSAML\Auth\ProcessingChain.filters'; + + + /** + * The stage we use for completed requests. + */ + const COMPLETED_STAGE = '\SimpleSAML\Auth\ProcessingChain.completed'; + + + /** + * The request parameter we will use to pass the state identifier when we redirect after + * having completed processing of the state. + */ + const AUTHPARAM = 'AuthProcId'; + + + /** + * All authentication processing filters, in the order they should be applied. + */ + private $filters; + + + /** + * Initialize an authentication processing chain for the given service provider + * and identity provider. + * + * @param array $idpMetadata The metadata for the IdP. + * @param array $spMetadata The metadata for the SP. + */ + public function __construct($idpMetadata, $spMetadata, $mode = 'idp') + { + assert(is_array($idpMetadata)); + assert(is_array($spMetadata)); + + $this->filters = []; + + $config = \SimpleSAML\Configuration::getInstance(); + $configauthproc = $config->getArray('authproc.'.$mode, null); + + if (!empty($configauthproc)) { + $configfilters = self::parseFilterList($configauthproc); + self::addFilters($this->filters, $configfilters); + } + + if (array_key_exists('authproc', $idpMetadata)) { + $idpFilters = self::parseFilterList($idpMetadata['authproc']); + self::addFilters($this->filters, $idpFilters); + } + + if (array_key_exists('authproc', $spMetadata)) { + $spFilters = self::parseFilterList($spMetadata['authproc']); + self::addFilters($this->filters, $spFilters); + } + + \SimpleSAML\Logger::debug('Filter config for '.$idpMetadata['entityid'].'->'. + $spMetadata['entityid'].': '.str_replace("\n", '', var_export($this->filters, true))); + } + + + /** + * Sort & merge filter configuration + * + * Inserts unsorted filters into sorted filter list. This sort operation is stable. + * + * @param array &$target Target filter list. This list must be sorted. + * @param array $src Source filters. May be unsorted. + */ + private static function addFilters(&$target, $src) + { + assert(is_array($target)); + assert(is_array($src)); + + foreach ($src as $filter) { + $fp = $filter->priority; + + // Find insertion position for filter + for ($i = count($target) - 1; $i >= 0; $i--) { + if ($target[$i]->priority <= $fp) { + // The new filter should be inserted after this one + break; + } + } + /* $i now points to the filter which should preceede the current filter. */ + array_splice($target, $i + 1, 0, [$filter]); + } + } + + + /** + * Parse an array of authentication processing filters. + * + * @param array $filterSrc Array with filter configuration. + * @return array Array of ProcessingFilter objects. + */ + private static function parseFilterList($filterSrc) + { + assert(is_array($filterSrc)); + + $parsedFilters = []; + + foreach ($filterSrc as $priority => $filter) { + if (is_string($filter)) { + $filter = ['class' => $filter]; + } + + if (!is_array($filter)) { + throw new \Exception('Invalid authentication processing filter configuration: '. + 'One of the filters wasn\'t a string or an array.'); + } + + $parsedFilters[] = self::parseFilter($filter, $priority); + } + + return $parsedFilters; + } + + + /** + * Parse an authentication processing filter. + * + * @param array $config Array with the authentication processing filter configuration. + * @param int $priority The priority of the current filter, (not included in the filter + * definition.) + * @return ProcessingFilter The parsed filter. + */ + private static function parseFilter($config, $priority) + { + assert(is_array($config)); + + if (!array_key_exists('class', $config)) { + throw new \Exception('Authentication processing filter without name given.'); + } + + $className = \SimpleSAML\Module::resolveClass( + $config['class'], + 'Auth\Process', + '\SimpleSAML\Auth\ProcessingFilter' + ); + $config['%priority'] = $priority; + unset($config['class']); + return new $className($config, null); + } + + + /** + * Process the given state. + * + * This function will only return if processing completes. If processing requires showing + * a page to the user, we will not be able to return from this function. There are two ways + * this can be handled: + * - Redirect to a URL: We will redirect to the URL set in $state['ReturnURL']. + * - Call a function: We will call the function set in $state['ReturnCall']. + * + * If an exception is thrown during processing, it should be handled by the caller of + * this function. If the user has redirected to a different page, the exception will be + * returned through the exception handler defined on the state array. See + * State for more information. + * + * @see State + * @see State::EXCEPTION_HANDLER_URL + * @see State::EXCEPTION_HANDLER_FUNC + * + * @param array &$state The state we are processing. + */ + public function processState(&$state) + { + assert(is_array($state)); + assert(array_key_exists('ReturnURL', $state) || array_key_exists('ReturnCall', $state)); + assert(!array_key_exists('ReturnURL', $state) || !array_key_exists('ReturnCall', $state)); + + $state[self::FILTERS_INDEX] = $this->filters; + + try { + // TODO: remove this in SSP 2.0 + if (!array_key_exists('UserID', $state)) { + // No unique user ID present. Attempt to add one. + self::addUserID($state); + } + + while (count($state[self::FILTERS_INDEX]) > 0) { + $filter = array_shift($state[self::FILTERS_INDEX]); + $filter->process($state); + } + } catch (\SimpleSAML\Error\Exception $e) { + // No need to convert the exception + throw $e; + } catch (\Exception $e) { + /* + * To be consistent with the exception we return after an redirect, + * we convert this exception before returning it. + */ + throw new \SimpleSAML\Error\UnserializableException($e); + } + + // Completed + } + + + /** + * Continues processing of the state. + * + * This function is used to resume processing by filters which for example needed to show + * a page to the user. + * + * This function will never return. Exceptions thrown during processing will be passed + * to whatever exception handler is defined in the state array. + * + * @param array $state The state we are processing. + */ + public static function resumeProcessing($state) + { + assert(is_array($state)); + + while (count($state[self::FILTERS_INDEX]) > 0) { + $filter = array_shift($state[self::FILTERS_INDEX]); + try { + $filter->process($state); + } catch (\SimpleSAML\Error\Exception $e) { + State::throwException($state, $e); + } catch (\Exception $e) { + $e = new \SimpleSAML\Error\UnserializableException($e); + State::throwException($state, $e); + } + } + + // Completed + + assert(array_key_exists('ReturnURL', $state) || array_key_exists('ReturnCall', $state)); + assert(!array_key_exists('ReturnURL', $state) || !array_key_exists('ReturnCall', $state)); + + + if (array_key_exists('ReturnURL', $state)) { + /* + * Save state information, and redirect to the URL specified + * in $state['ReturnURL']. + */ + $id = State::saveState($state, self::COMPLETED_STAGE); + \SimpleSAML\Utils\HTTP::redirectTrustedURL($state['ReturnURL'], [self::AUTHPARAM => $id]); + } else { + /* Pass the state to the function defined in $state['ReturnCall']. */ + + // We are done with the state array in the session. Delete it. + State::deleteState($state); + + $func = $state['ReturnCall']; + assert(is_callable($func)); + + call_user_func($func, $state); + assert(false); + } + } + + + /** + * Process the given state passivly. + * + * Modules with user interaction are expected to throw an \SimpleSAML\Module\saml\Error\NoPassive exception + * which are silently ignored. Exceptions of other types are passed further up the call stack. + * + * This function will only return if processing completes. + * + * @param array &$state The state we are processing. + */ + public function processStatePassive(&$state) + { + assert(is_array($state)); + // Should not be set when calling this method + assert(!array_key_exists('ReturnURL', $state)); + + // Notify filters about passive request + $state['isPassive'] = true; + + $state[self::FILTERS_INDEX] = $this->filters; + + // TODO: remove this in SSP 2.0 + if (!array_key_exists('UserID', $state)) { + // No unique user ID present. Attempt to add one. + self::addUserID($state); + } + + while (count($state[self::FILTERS_INDEX]) > 0) { + $filter = array_shift($state[self::FILTERS_INDEX]); + try { + $filter->process($state); + } catch (\SimpleSAML\Error\NoPassive $e) { + // @deprecated will be removed in 2.0 + // Ignore \SimpleSAML\Error\NoPassive exceptions + } catch (\SimpleSAML\Module\saml\Error\NoPassive $e) { + // Ignore \SimpleSAML\Module\saml\Error\NoPassive exceptions + } + } + } + + /** + * Retrieve a state which has finished processing. + * + * @param string $id The state identifier. + * @see State::parseStateID() + * @return array The state referenced by the $id parameter. + */ + public static function fetchProcessedState($id) + { + assert(is_string($id)); + + return State::loadState($id, self::COMPLETED_STAGE); + } + + + /** + * @deprecated This method will be removed in SSP 2.0. + */ + private static function addUserID(&$state) + { + assert(is_array($state)); + assert(array_key_exists('Attributes', $state)); + + if (isset($state['Destination']['userid.attribute'])) { + $attributeName = $state['Destination']['userid.attribute']; + \SimpleSAML\Logger::debug("The 'userid.attribute' option has been deprecated."); + } elseif (isset($state['Source']['userid.attribute'])) { + $attributeName = $state['Source']['userid.attribute']; + \SimpleSAML\Logger::debug("The 'userid.attribute' option has been deprecated."); + } else { + // Default attribute + $attributeName = 'eduPersonPrincipalName'; + } + + if (!array_key_exists($attributeName, $state['Attributes'])) { + return; + } + + $uid = $state['Attributes'][$attributeName]; + if (count($uid) === 0) { + \SimpleSAML\Logger::warning('Empty user id attribute ['.$attributeName.'].'); + return; + } + + if (count($uid) > 1) { + \SimpleSAML\Logger::warning('Multiple attribute values for user id attribute ['.$attributeName.'].'); + return; + } + + // TODO: the attribute value should be trimmed + $uid = $uid[0]; + + if (empty($uid)) { + \SimpleSAML\Logger::warning('Empty value in attribute '.$attributeName.". on user. Cannot set UserID."); + return; + } + $state['UserID'] = $uid; + } } diff --git a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Auth/ProcessingFilter.php b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Auth/ProcessingFilter.php index 2e576ff403..8c01b1d7b8 100644 --- a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Auth/ProcessingFilter.php +++ b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Auth/ProcessingFilter.php @@ -1,5 +1,6 @@ <?php +namespace SimpleSAML\Auth; /** * Base class for authentication processing filters. @@ -18,49 +19,50 @@ * @author Olav Morken, UNINETT AS. * @package SimpleSAMLphp */ -abstract class SimpleSAML_Auth_ProcessingFilter { - /** - * Priority of this filter. - * - * Used when merging IdP and SP processing chains. - * The priority can be any integer. The default for most filters is 50. Filters may however - * specify their own default, if they typically should be amongst the first or the last filters. - * - * The prioroty can also be overridden by the user by specifying the '%priority' option. - */ - public $priority = 50; +abstract class ProcessingFilter +{ + /** + * Priority of this filter. + * + * Used when merging IdP and SP processing chains. + * The priority can be any integer. The default for most filters is 50. Filters may however + * specify their own default, if they typically should be amongst the first or the last filters. + * + * The prioroty can also be overridden by the user by specifying the '%priority' option. + */ + public $priority = 50; - /** - * Constructor for a processing filter. - * - * Any processing filter which implements its own constructor must call this - * constructor first. - * - * @param array &$config Configuration for this filter. - * @param mixed $reserved For future use. - */ - public function __construct(&$config, $reserved) { - assert('is_array($config)'); + /** + * Constructor for a processing filter. + * + * Any processing filter which implements its own constructor must call this + * constructor first. + * + * @param array &$config Configuration for this filter. + * @param mixed $reserved For future use. + */ + public function __construct(&$config, $reserved) + { + assert(is_array($config)); - if(array_key_exists('%priority', $config)) { - $this->priority = $config['%priority']; - if(!is_int($this->priority)) { - throw new Exception('Invalid priority: ' . var_export($this->priority, TRUE)); - } - unset($config['%priority']); - } - } + if (array_key_exists('%priority', $config)) { + $this->priority = $config['%priority']; + if (!is_int($this->priority)) { + throw new \Exception('Invalid priority: '.var_export($this->priority, true)); + } + unset($config['%priority']); + } + } - /** - * Process a request. - * - * When a filter returns from this function, it is assumed to have completed its task. - * - * @param array &$request The request we are currently processing. - */ - abstract public function process(&$request); - + /** + * Process a request. + * + * When a filter returns from this function, it is assumed to have completed its task. + * + * @param array &$request The request we are currently processing. + */ + abstract public function process(&$request); } diff --git a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Auth/Simple.php b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Auth/Simple.php index b95a0d4c9f..ffaa0cc92a 100644 --- a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Auth/Simple.php +++ b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Auth/Simple.php @@ -2,12 +2,10 @@ namespace SimpleSAML\Auth; -use \SimpleSAML_Auth_Source as Source; -use \SimpleSAML_Auth_State as State; -use \SimpleSAML_Configuration as Configuration; -use \SimpleSAML_Error_AuthSource as AuthSourceError; +use \SimpleSAML\Configuration; +use \SimpleSAML\Error\AuthSource as AuthSourceError; use \SimpleSAML\Module; -use \SimpleSAML_Session as Session; +use \SimpleSAML\Session; use \SimpleSAML\Utils\HTTP; /** @@ -15,9 +13,9 @@ * * @package SimpleSAMLphp */ + class Simple { - /** * The id of the authentication source we are accessing. * @@ -25,31 +23,43 @@ class Simple */ protected $authSource; - /** - * @var \SimpleSAML_Configuration|null - */ + /** @var \SimpleSAML\Configuration */ protected $app_config; + /** @var \SimpleSAML\Session */ + protected $session; + + /** * Create an instance with the specified authsource. * * @param string $authSource The id of the authentication source. + * @param \SimpleSAML\Configuration|null $config Optional configuration to use. + * @param \SimpleSAML\Session|null $session Optional session to use. */ - public function __construct($authSource) + public function __construct($authSource, Configuration $config = null, Session $session = null) { - assert('is_string($authSource)'); + assert(is_string($authSource)); + if ($config === null) { + $config = Configuration::getInstance(); + } $this->authSource = $authSource; - $this->app_config = Configuration::getInstance()->getConfigItem('application', null); + $this->app_config = $config->getConfigItem('application', null); + + if ($session === null) { + $session = Session::getSessionFromRequest(); + } + $this->session = $session; } /** * Retrieve the implementing authentication source. * - * @return \SimpleSAML_Auth_Source The authentication source. + * @return Source The authentication source. * - * @throws \SimpleSAML_Error_AuthSource If the requested auth source is unknown. + * @throws AuthSourceError If the requested auth source is unknown. */ public function getAuthSource() { @@ -71,9 +81,7 @@ public function getAuthSource() */ public function isAuthenticated() { - $session = Session::getSessionFromRequest(); - - return $session->isValid($this->authSource); + return $this->session->isValid($this->authSource); } @@ -90,12 +98,9 @@ public function isAuthenticated() * * @param array $params Various options to the authentication request. See the documentation. */ - public function requireAuth(array $params = array()) + public function requireAuth(array $params = []) { - - $session = Session::getSessionFromRequest(); - - if ($session->isValid($this->authSource)) { + if ($this->session->isValid($this->authSource)) { // Already authenticated return; } @@ -118,9 +123,8 @@ public function requireAuth(array $params = array()) * * @param array $params Various options to the authentication request. */ - public function login(array $params = array()) + public function login(array $params = []) { - if (array_key_exists('KeepPost', $params)) { $keepPost = (bool) $params['KeepPost']; } else { @@ -159,7 +163,7 @@ public function login(array $params = array()) $as = $this->getAuthSource(); $as->initLogin($returnTo, $errorURL, $params); - assert('false'); + assert(false); } @@ -180,35 +184,34 @@ public function login(array $params = array()) */ public function logout($params = null) { - assert('is_array($params) || is_string($params) || is_null($params)'); + assert(is_array($params) || is_string($params) || $params === null); if ($params === null) { $params = HTTP::getSelfURL(); } if (is_string($params)) { - $params = array( + $params = [ 'ReturnTo' => $params, - ); + ]; } - assert('is_array($params)'); - assert('isset($params["ReturnTo"]) || isset($params["ReturnCallback"])'); + assert(is_array($params)); + assert(isset($params['ReturnTo']) || isset($params['ReturnCallback'])); if (isset($params['ReturnStateParam']) || isset($params['ReturnStateStage'])) { - assert('isset($params["ReturnStateParam"]) && isset($params["ReturnStateStage"])'); + assert(isset($params['ReturnStateParam'], $params['ReturnStateStage'])); } - $session = Session::getSessionFromRequest(); - if ($session->isValid($this->authSource)) { - $state = $session->getAuthData($this->authSource, 'LogoutState'); + if ($this->session->isValid($this->authSource)) { + $state = $this->session->getAuthData($this->authSource, 'LogoutState'); if ($state !== null) { $params = array_merge($state, $params); } - $session->doLogout($this->authSource); + $this->session->doLogout($this->authSource); - $params['LogoutCompletedHandler'] = array(get_class(), 'logoutCompleted'); + $params['LogoutCompletedHandler'] = [get_class(), 'logoutCompleted']; $as = Source::getById($this->authSource); if ($as !== null) { @@ -229,20 +232,20 @@ public function logout($params = null) */ public static function logoutCompleted($state) { - assert('is_array($state)'); - assert('isset($state["ReturnTo"]) || isset($state["ReturnCallback"])'); + assert(is_array($state)); + assert(isset($state['ReturnTo']) || isset($state['ReturnCallback'])); if (isset($state['ReturnCallback'])) { call_user_func($state['ReturnCallback'], $state); - assert('false'); + assert(false); } else { - $params = array(); + $params = []; if (isset($state['ReturnStateParam']) || isset($state['ReturnStateStage'])) { - assert('isset($state["ReturnStateParam"]) && isset($state["ReturnStateStage"])'); + assert(isset($state['ReturnStateParam'], $state['ReturnStateStage'])); $stateID = State::saveState($state, $state['ReturnStateStage']); $params[$state['ReturnStateParam']] = $stateID; } - \SimpleSAML\Utils\HTTP::redirectTrustedURL($state['ReturnTo'], $params); + HTTP::redirectTrustedURL($state['ReturnTo'], $params); } } @@ -257,15 +260,13 @@ public static function logoutCompleted($state) */ public function getAttributes() { - if (!$this->isAuthenticated()) { // Not authenticated - return array(); + return []; } // Authenticated - $session = Session::getSessionFromRequest(); - return $session->getAuthData($this->authSource, 'Attributes'); + return $this->session->getAuthData($this->authSource, 'Attributes'); } @@ -278,14 +279,13 @@ public function getAttributes() */ public function getAuthData($name) { - assert('is_string($name)'); + assert(is_string($name)); if (!$this->isAuthenticated()) { return null; } - $session = Session::getSessionFromRequest(); - return $session->getAuthData($this->authSource, $name); + return $this->session->getAuthData($this->authSource, $name); } @@ -296,13 +296,11 @@ public function getAuthData($name) */ public function getAuthDataArray() { - if (!$this->isAuthenticated()) { return null; } - $session = Session::getSessionFromRequest(); - return $session->getAuthState($this->authSource); + return $this->session->getAuthState($this->authSource); } @@ -316,16 +314,16 @@ public function getAuthDataArray() */ public function getLoginURL($returnTo = null) { - assert('is_null($returnTo) || is_string($returnTo)'); + assert($returnTo === null || is_string($returnTo)); if ($returnTo === null) { $returnTo = HTTP::getSelfURL(); } - $login = Module::getModuleURL('core/as_login.php', array( + $login = Module::getModuleURL('core/as_login.php', [ 'AuthId' => $this->authSource, 'ReturnTo' => $returnTo, - )); + ]); return $login; } @@ -341,16 +339,16 @@ public function getLoginURL($returnTo = null) */ public function getLogoutURL($returnTo = null) { - assert('is_null($returnTo) || is_string($returnTo)'); + assert($returnTo === null || is_string($returnTo)); if ($returnTo === null) { $returnTo = HTTP::getSelfURL(); } - $logout = Module::getModuleURL('core/as_logout.php', array( + $logout = Module::getModuleURL('core/as_logout.php', [ 'AuthId' => $this->authSource, 'ReturnTo' => $returnTo, - )); + ]); return $logout; } @@ -373,14 +371,14 @@ protected function getProcessedURL($url = null) } $scheme = parse_url($url, PHP_URL_SCHEME); - $host = parse_url($url, PHP_URL_HOST) ?: HTTP::getSelfHost(); - $port = parse_url($url, PHP_URL_PORT) ?: ( + $host = parse_url($url, PHP_URL_HOST) ? : HTTP::getSelfHost(); + $port = parse_url($url, PHP_URL_PORT) ? : ( $scheme ? '' : trim(HTTP::getServerPort(), ':') ); - $scheme = $scheme ?: (HTTP::getServerHTTPS() ? 'https' : 'http'); - $path = parse_url($url, PHP_URL_PATH) ?: '/'; - $query = parse_url($url, PHP_URL_QUERY) ?: ''; - $fragment = parse_url($url, PHP_URL_FRAGMENT) ?: ''; + $scheme = $scheme ? : (HTTP::getServerHTTPS() ? 'https' : 'http'); + $path = parse_url($url, PHP_URL_PATH) ? : '/'; + $query = parse_url($url, PHP_URL_QUERY) ? : ''; + $fragment = parse_url($url, PHP_URL_FRAGMENT) ? : ''; $port = !empty($port) ? ':'.$port : ''; if (($scheme === 'http' && $port === ':80') || ($scheme === 'https' && $port === ':443')) { @@ -392,7 +390,7 @@ protected function getProcessedURL($url = null) return $scheme.'://'.$host.$port.$path.($query ? '?'.$query : '').($fragment ? '#'.$fragment : ''); } - $base = trim($this->app_config->getString( + $base = trim($this->app_config->getString( 'baseURL', $scheme.'://'.$host.$port ), '/'); diff --git a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Auth/Source.php b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Auth/Source.php index 122263ea3d..d24f6e774f 100644 --- a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Auth/Source.php +++ b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Auth/Source.php @@ -1,5 +1,6 @@ <?php +namespace SimpleSAML\Auth; /** * This class defines a base class for authentication source. @@ -9,10 +10,9 @@ * @author Olav Morken, UNINETT AS. * @package SimpleSAMLphp */ -abstract class SimpleSAML_Auth_Source -{ - +abstract class Source +{ /** * The authentication source identifier. This identifier can be used to look up this object, for example when * returning from a login form. @@ -33,10 +33,10 @@ abstract class SimpleSAML_Auth_Source */ public function __construct($info, &$config) { - assert('is_array($info)'); - assert('is_array($config)'); + assert(is_array($info)); + assert(is_array($config)); - assert('array_key_exists("AuthId", $info)'); + assert(array_key_exists('AuthId', $info)); $this->authId = $info['AuthId']; } @@ -46,16 +46,16 @@ public function __construct($info, &$config) * * @param string $type The type of the authentication source. * - * @return SimpleSAML_Auth_Source[] Array of SimpleSAML_Auth_Source objects of the specified type. + * @return Source[] Array of \SimpleSAML\Auth\Source objects of the specified type. * @throws Exception If the authentication source is invalid. */ public static function getSourcesOfType($type) { - assert('is_string($type)'); + assert(is_string($type)); - $config = SimpleSAML_Configuration::getConfig('authsources.php'); + $config = \SimpleSAML\Configuration::getConfig('authsources.php'); - $ret = array(); + $ret = []; $sources = $config->getOptions(); foreach ($sources as $id) { @@ -112,10 +112,10 @@ abstract public function authenticate(&$state); */ public function reauthenticate(array &$state) { - assert('isset($state["ReturnCallback"])'); + assert(isset($state['ReturnCallback'])); // the default implementation just copies over the previous authentication data - $session = SimpleSAML_Session::getSessionFromRequest(); + $session = \SimpleSAML\Session::getSessionFromRequest(); $data = $session->getAuthState($this->authId); foreach ($data as $k => $v) { $state[$k] = $v; @@ -134,13 +134,13 @@ public function reauthenticate(array &$state) */ public static function completeAuth(&$state) { - assert('is_array($state)'); - assert('array_key_exists("LoginCompletedHandler", $state)'); + assert(is_array($state)); + assert(array_key_exists('LoginCompletedHandler', $state)); - SimpleSAML_Auth_State::deleteState($state); + State::deleteState($state); $func = $state['LoginCompletedHandler']; - assert('is_callable($func)'); + assert(is_callable($func)); call_user_func($func, $state); assert(false); @@ -160,42 +160,42 @@ public static function completeAuth(&$state) * @param array $params Extra information about the login. Different authentication requestors may provide different * information. Optional, will default to an empty array. */ - public function initLogin($return, $errorURL = null, array $params = array()) + public function initLogin($return, $errorURL = null, array $params = []) { - assert('is_string($return) || is_array($return)'); - assert('is_string($errorURL) || is_null($errorURL)'); - - $state = array_merge($params, array( - 'SimpleSAML_Auth_Default.id' => $this->authId, // TODO: remove in 2.0 - 'SimpleSAML_Auth_Source.id' => $this->authId, - 'SimpleSAML_Auth_Default.Return' => $return, // TODO: remove in 2.0 - 'SimpleSAML_Auth_Source.Return' => $return, - 'SimpleSAML_Auth_Default.ErrorURL' => $errorURL, // TODO: remove in 2.0 - 'SimpleSAML_Auth_Source.ErrorURL' => $errorURL, - 'LoginCompletedHandler' => array(get_class(), 'loginCompleted'), - 'LogoutCallback' => array(get_class(), 'logoutCallback'), - 'LogoutCallbackState' => array( - 'SimpleSAML_Auth_Default.logoutSource' => $this->authId, // TODO: remove in 2.0 - 'SimpleSAML_Auth_Source.logoutSource' => $this->authId, - ), - )); + assert(is_string($return) || is_array($return)); + assert(is_string($errorURL) || $errorURL === null); + + $state = array_merge($params, [ + '\SimpleSAML\Auth\DefaultAuth.id' => $this->authId, // TODO: remove in 2.0 + '\SimpleSAML\Auth\Source.id' => $this->authId, + '\SimpleSAML\Auth\DefaultAuth.Return' => $return, // TODO: remove in 2.0 + '\SimpleSAML\Auth\Source.Return' => $return, + '\SimpleSAML\Auth\DefaultAuth.ErrorURL' => $errorURL, // TODO: remove in 2.0 + '\SimpleSAML\Auth\Source.ErrorURL' => $errorURL, + 'LoginCompletedHandler' => [get_class(), 'loginCompleted'], + 'LogoutCallback' => [get_class(), 'logoutCallback'], + 'LogoutCallbackState' => [ + '\SimpleSAML\Auth\DefaultAuth.logoutSource' => $this->authId, // TODO: remove in 2.0 + '\SimpleSAML\Auth\Source.logoutSource' => $this->authId, + ], + ]); if (is_string($return)) { - $state['SimpleSAML_Auth_Default.ReturnURL'] = $return; // TODO: remove in 2.0 - $state['SimpleSAML_Auth_Source.ReturnURL'] = $return; + $state['\SimpleSAML\Auth\DefaultAuth.ReturnURL'] = $return; // TODO: remove in 2.0 + $state['\SimpleSAML\Auth\Source.ReturnURL'] = $return; } if ($errorURL !== null) { - $state[SimpleSAML_Auth_State::EXCEPTION_HANDLER_URL] = $errorURL; + $state[State::EXCEPTION_HANDLER_URL] = $errorURL; } try { $this->authenticate($state); - } catch (SimpleSAML_Error_Exception $e) { - SimpleSAML_Auth_State::throwException($state, $e); - } catch (Exception $e) { - $e = new SimpleSAML_Error_UnserializableException($e); - SimpleSAML_Auth_State::throwException($state, $e); + } catch (\SimpleSAML\Error\Exception $e) { + State::throwException($state, $e); + } catch (\Exception $e) { + $e = new \SimpleSAML\Error\UnserializableException($e); + State::throwException($state, $e); } self::loginCompleted($state); } @@ -210,25 +210,26 @@ public function initLogin($return, $errorURL = null, array $params = array()) */ public static function loginCompleted($state) { - assert('is_array($state)'); - assert('array_key_exists("SimpleSAML_Auth_Source.Return", $state)'); - assert('array_key_exists("SimpleSAML_Auth_Source.id", $state)'); - assert('array_key_exists("Attributes", $state)'); - assert('!array_key_exists("LogoutState", $state) || is_array($state["LogoutState"])'); + assert(is_array($state)); + assert(array_key_exists('\SimpleSAML\Auth\Source.Return', $state)); + assert(array_key_exists('\SimpleSAML\Auth\Source.id', $state)); + assert(array_key_exists('Attributes', $state)); + assert(!array_key_exists('LogoutState', $state) || is_array($state['LogoutState'])); - $return = $state['SimpleSAML_Auth_Source.Return']; + $return = $state['\SimpleSAML\Auth\Source.Return']; // save session state - $session = SimpleSAML_Session::getSessionFromRequest(); - $authId = $state['SimpleSAML_Auth_Source.id']; - $session->doLogin($authId, SimpleSAML_Auth_State::getPersistentAuthData($state)); + $session = \SimpleSAML\Session::getSessionFromRequest(); + $authId = $state['\SimpleSAML\Auth\Source.id']; + $session->doLogin($authId, State::getPersistentAuthData($state)); - if (is_string($return)) { // redirect... + if (is_string($return)) { + // redirect... \SimpleSAML\Utils\HTTP::redirectTrustedURL($return); } else { call_user_func($return, $state); } - assert('false'); + assert(false); } @@ -247,7 +248,7 @@ public static function loginCompleted($state) */ public function logout(&$state) { - assert('is_array($state)'); + assert(is_array($state)); // default logout handler which doesn't do anything } @@ -263,13 +264,13 @@ public function logout(&$state) */ public static function completeLogout(&$state) { - assert('is_array($state)'); - assert('array_key_exists("LogoutCompletedHandler", $state)'); + assert(is_array($state)); + assert(array_key_exists('LogoutCompletedHandler', $state)); - SimpleSAML_Auth_State::deleteState($state); + State::deleteState($state); $func = $state['LogoutCompletedHandler']; - assert('is_callable($func)'); + assert(is_callable($func)); call_user_func($func, $state); assert(false); @@ -285,21 +286,40 @@ public static function completeLogout(&$state) * @param string $authId The authentication source identifier. * @param array $config The configuration. * - * @return SimpleSAML_Auth_Source The parsed authentication source. - * @throws Exception If the authentication source is invalid. + * @return Source The parsed authentication source. + * @throws \Exception If the authentication source is invalid. */ private static function parseAuthSource($authId, $config) { - assert('is_string($authId)'); - assert('is_array($config)'); + assert(is_string($authId)); + assert(is_array($config)); self::validateSource($config, $authId); - $className = SimpleSAML\Module::resolveClass($config[0], 'Auth_Source', 'SimpleSAML_Auth_Source'); + $id = $config[0]; + $info = ['AuthId' => $authId]; + $authSource = null; - $info = array('AuthId' => $authId); unset($config[0]); - return new $className($info, $config); + + try { + // Check whether or not there's a factory responsible for instantiating our Auth Source instance + $factoryClass = \SimpleSAML\Module::resolveClass( + $id, + 'Auth\Source\Factory', + '\SimpleSAML\Auth\SourceFactory' + ); + + /** @var SourceFactory $factory */ + $factory = new $factoryClass; + $authSource = $factory->create($info, $config); + } catch (\Exception $e) { + // If not, instantiate the Auth Source here + $className = \SimpleSAML\Module::resolveClass($id, 'Auth\Source', '\SimpleSAML\Auth\Source'); + $authSource = new $className($info, $config); + } + + return $authSource; } @@ -317,22 +337,22 @@ private static function parseAuthSource($authId, $config) * @param string $authId The authentication source identifier. * @param string|NULL $type The type of authentication source. If NULL, any type will be accepted. * - * @return SimpleSAML_Auth_Source|NULL The AuthSource object, or NULL if no authentication + * @return Source|NULL The AuthSource object, or NULL if no authentication * source with the given identifier is found. - * @throws SimpleSAML_Error_Exception If no such authentication source is found or it is invalid. + * @throws \SimpleSAML\Error\Exception If no such authentication source is found or it is invalid. */ public static function getById($authId, $type = null) { - assert('is_string($authId)'); - assert('is_null($type) || is_string($type)'); + assert(is_string($authId)); + assert($type === null || is_string($type)); // for now - load and parse config file - $config = SimpleSAML_Configuration::getConfig('authsources.php'); + $config = \SimpleSAML\Configuration::getConfig('authsources.php'); $authConfig = $config->getArray($authId, null); if ($authConfig === null) { if ($type !== null) { - throw new SimpleSAML_Error_Exception( + throw new \SimpleSAML\Error\Exception( 'No authentication source with id '. var_export($authId, true).' found.' ); @@ -347,7 +367,7 @@ public static function getById($authId, $type = null) } // the authentication source doesn't have the correct type - throw new SimpleSAML_Error_Exception( + throw new \SimpleSAML\Error\Exception( 'Invalid type of authentication source '. var_export($authId, true).'. Was '.var_export(get_class($ret), true). ', should be '.var_export($type, true).'.' @@ -362,14 +382,14 @@ public static function getById($authId, $type = null) */ public static function logoutCallback($state) { - assert('is_array($state)'); - assert('array_key_exists("SimpleSAML_Auth_Source.logoutSource", $state)'); + assert(is_array($state)); + assert(array_key_exists('\SimpleSAML\Auth\Source.logoutSource', $state)); - $source = $state['SimpleSAML_Auth_Source.logoutSource']; + $source = $state['\SimpleSAML\Auth\Source.logoutSource']; - $session = SimpleSAML_Session::getSessionFromRequest(); + $session = \SimpleSAML\Session::getSessionFromRequest(); if (!$session->isValid($source)) { - SimpleSAML\Logger::warning( + \SimpleSAML\Logger::warning( 'Received logout from an invalid authentication source '. var_export($source, true) ); @@ -394,8 +414,8 @@ public static function logoutCallback($state) */ protected function addLogoutCallback($assoc, $state) { - assert('is_string($assoc)'); - assert('is_array($state)'); + assert(is_string($assoc)); + assert(is_array($state)); if (!array_key_exists('LogoutCallback', $state)) { // the authentication requester doesn't have a logout callback @@ -406,22 +426,22 @@ protected function addLogoutCallback($assoc, $state) if (array_key_exists('LogoutCallbackState', $state)) { $callbackState = $state['LogoutCallbackState']; } else { - $callbackState = array(); + $callbackState = []; } $id = strlen($this->authId).':'.$this->authId.$assoc; - $data = array( + $data = [ 'callback' => $callback, 'state' => $callbackState, - ); + ]; - $session = SimpleSAML_Session::getSessionFromRequest(); + $session = \SimpleSAML\Session::getSessionFromRequest(); $session->setData( - 'SimpleSAML_Auth_Source.LogoutCallbacks', + '\SimpleSAML\Auth\Source.LogoutCallbacks', $id, $data, - SimpleSAML_Session::DATA_TIMEOUT_SESSION_END + \SimpleSAML\Session::DATA_TIMEOUT_SESSION_END ); } @@ -438,13 +458,13 @@ protected function addLogoutCallback($assoc, $state) */ protected function callLogoutCallback($assoc) { - assert('is_string($assoc)'); + assert(is_string($assoc)); $id = strlen($this->authId).':'.$this->authId.$assoc; - $session = SimpleSAML_Session::getSessionFromRequest(); + $session = \SimpleSAML\Session::getSessionFromRequest(); - $data = $session->getData('SimpleSAML_Auth_Source.LogoutCallbacks', $id); + $data = $session->getData('\SimpleSAML\Auth\Source.LogoutCallbacks', $id); if ($data === null) { // FIXME: fix for IdP-first flow (issue 397) -> reevaluate logout callback infrastructure $session->doLogout($this->authId); @@ -452,14 +472,14 @@ protected function callLogoutCallback($assoc) return; } - assert('is_array($data)'); - assert('array_key_exists("callback", $data)'); - assert('array_key_exists("state", $data)'); + assert(is_array($data)); + assert(array_key_exists('callback', $data)); + assert(array_key_exists('state', $data)); $callback = $data['callback']; $callbackState = $data['state']; - $session->deleteData('SimpleSAML_Auth_Source.LogoutCallbacks', $id); + $session->deleteData('\SimpleSAML\Auth\Source.LogoutCallbacks', $id); call_user_func($callback, $callbackState); } @@ -471,7 +491,7 @@ protected function callLogoutCallback($assoc) */ public static function getSources() { - $config = SimpleSAML_Configuration::getOptionalConfig('authsources.php'); + $config = \SimpleSAML\Configuration::getOptionalConfig('authsources.php'); return $config->getOptions(); } @@ -483,12 +503,12 @@ public static function getSources() * @param array $source An array with the auth source configuration. * @param string $id The auth source identifier. * - * @throws Exception If the first element of $source is not an identifier for the auth source. + * @throws \Exception If the first element of $source is not an identifier for the auth source. */ protected static function validateSource($source, $id) { if (!array_key_exists(0, $source) || !is_string($source[0])) { - throw new Exception( + throw new \Exception( 'Invalid authentication source \''.$id. '\': First element must be a string which identifies the authentication source.' ); diff --git a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Auth/SourceFactory.php b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Auth/SourceFactory.php new file mode 100644 index 0000000000..9f5fdfafbe --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Auth/SourceFactory.php @@ -0,0 +1,13 @@ +<?php + +namespace SimpleSAML\Auth; + +interface SourceFactory +{ + /** + * @param array $info + * @param array $config + * @return Source + */ + public function create(array $info, array $config); +} diff --git a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Auth/State.php b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Auth/State.php index 447f9619eb..6afd183ca1 100644 --- a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Auth/State.php +++ b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Auth/State.php @@ -1,15 +1,16 @@ <?php +namespace SimpleSAML\Auth; /** * This is a helper class for saving and loading state information. * * The state must be an associative array. This class will add additional keys to this - * array. These keys will always start with 'SimpleSAML_Auth_State.'. + * array. These keys will always start with '\SimpleSAML\Auth\State.'. * * It is also possible to add a restart URL to the state. If state information is lost, for * example because it timed out, or the user loaded a bookmarked page, the loadState function - * will redirect to this URL. To use this, set $state[SimpleSAML_Auth_State::RESTART] to this + * will redirect to this URL. To use this, set $state[\SimpleSAML\Auth\State::RESTART] to this * URL. * * Both the saveState and the loadState function takes in a $stage parameter. This parameter is @@ -28,63 +29,64 @@ * @author Olav Morken, UNINETT AS. * @package SimpleSAMLphp */ -class SimpleSAML_Auth_State -{ - +class State +{ /** * The index in the state array which contains the identifier. */ - const ID = 'SimpleSAML_Auth_State.id'; + const ID = '\SimpleSAML\Auth\State.id'; /** * The index in the cloned state array which contains the identifier of the * original state. */ - const CLONE_ORIGINAL_ID = 'SimpleSAML_Auth_State.cloneOriginalId'; + const CLONE_ORIGINAL_ID = '\SimpleSAML\Auth\State.cloneOriginalId'; /** * The index in the state array which contains the current stage. */ - const STAGE = 'SimpleSAML_Auth_State.stage'; + const STAGE = '\SimpleSAML\Auth\State.stage'; /** * The index in the state array which contains the restart URL. */ - const RESTART = 'SimpleSAML_Auth_State.restartURL'; + const RESTART = '\SimpleSAML\Auth\State.restartURL'; /** * The index in the state array which contains the exception handler URL. */ - const EXCEPTION_HANDLER_URL = 'SimpleSAML_Auth_State.exceptionURL'; + const EXCEPTION_HANDLER_URL = '\SimpleSAML\Auth\State.exceptionURL'; /** * The index in the state array which contains the exception handler function. */ - const EXCEPTION_HANDLER_FUNC = 'SimpleSAML_Auth_State.exceptionFunc'; + const EXCEPTION_HANDLER_FUNC = '\SimpleSAML\Auth\State.exceptionFunc'; /** * The index in the state array which contains the exception data. */ - const EXCEPTION_DATA = 'SimpleSAML_Auth_State.exceptionData'; + const EXCEPTION_DATA = '\SimpleSAML\Auth\State.exceptionData'; /** * The stage of a state with an exception. */ - const EXCEPTION_STAGE = 'SimpleSAML_Auth_State.exceptionStage'; + const EXCEPTION_STAGE = '\SimpleSAML\Auth\State.exceptionStage'; /** * The URL parameter which contains the exception state id. + * Note that this does not contain a "." since it's used in the + * _REQUEST superglobal that does not allow dots. */ - const EXCEPTION_PARAM = 'SimpleSAML_Auth_State_exceptionId'; + const EXCEPTION_PARAM = '\SimpleSAML\Auth\State_exceptionId'; /** @@ -103,7 +105,7 @@ class SimpleSAML_Auth_State public static function getPersistentAuthData(array $state) { // save persistent authentication data - $persistent = array(); + $persistent = []; if (array_key_exists('PersistentAuthData', $state)) { foreach ($state['PersistentAuthData'] as $key) { @@ -114,14 +116,14 @@ public static function getPersistentAuthData(array $state) } // add those that should always be included - $mandatory = array( + $mandatory = [ 'Attributes', 'Expire', 'LogoutState', 'AuthInstant', 'RememberMe', 'saml:sp:NameID' - ); + ]; foreach ($mandatory as $key) { if (isset($state[$key])) { $persistent[$key] = $state[$key]; @@ -144,11 +146,11 @@ public static function getPersistentAuthData(array $state) */ public static function getStateId(&$state, $rawId = false) { - assert('is_array($state)'); - assert('is_bool($rawId)'); + assert(is_array($state)); + assert(is_bool($rawId)); if (!array_key_exists(self::ID, $state)) { - $state[self::ID] = SimpleSAML\Utils\Random::generateID(); + $state[self::ID] = \SimpleSAML\Utils\Random::generateID(); } $id = $state[self::ID]; @@ -171,7 +173,7 @@ public static function getStateId(&$state, $rawId = false) private static function getStateTimeout() { if (self::$stateTimeout === null) { - $globalConfig = SimpleSAML_Configuration::getInstance(); + $globalConfig = \SimpleSAML\Configuration::getInstance(); self::$stateTimeout = $globalConfig->getInteger('session.state.timeout', 60 * 60); } @@ -193,9 +195,9 @@ private static function getStateTimeout() */ public static function saveState(&$state, $stage, $rawId = false) { - assert('is_array($state)'); - assert('is_string($stage)'); - assert('is_bool($rawId)'); + assert(is_array($state)); + assert(is_string($stage)); + assert(is_bool($rawId)); $return = self::getStateId($state, $rawId); $id = $state[self::ID]; @@ -205,10 +207,10 @@ public static function saveState(&$state, $stage, $rawId = false) // Save state $serializedState = serialize($state); - $session = SimpleSAML_Session::getSessionFromRequest(); - $session->setData('SimpleSAML_Auth_State', $id, $serializedState, self::getStateTimeout()); + $session = \SimpleSAML\Session::getSessionFromRequest(); + $session->setData('\SimpleSAML\Auth\State', $id, $serializedState, self::getStateTimeout()); - SimpleSAML\Logger::debug('Saved state: '.var_export($return, true)); + \SimpleSAML\Logger::debug('Saved state: '.var_export($return, true)); return $return; } @@ -231,9 +233,9 @@ public static function cloneState(array $state) $clonedState[self::CLONE_ORIGINAL_ID] = $state[self::ID]; unset($clonedState[self::ID]); - SimpleSAML\Logger::debug('Cloned state: '.var_export($state[self::ID], true)); + \SimpleSAML\Logger::debug('Cloned state: '.var_export($state[self::ID], true)); } else { - SimpleSAML\Logger::debug('Cloned state with undefined id.'); + \SimpleSAML\Logger::debug('Cloned state with undefined id.'); } return $clonedState; @@ -251,22 +253,22 @@ public static function cloneState(array $state) * @param string $stage The stage the state should have been saved in. * @param bool $allowMissing Whether to allow the state to be missing. * - * @throws SimpleSAML_Error_NoState If we couldn't find the state and there's no URL defined to redirect to. - * @throws Exception If the stage of the state is invalid and there's no URL defined to redirect to. + * @throws \SimpleSAML\Error\NoState If we couldn't find the state and there's no URL defined to redirect to. + * @throws \Exception If the stage of the state is invalid and there's no URL defined to redirect to. * * @return array|NULL State information, or null if the state is missing and $allowMissing is true. */ public static function loadState($id, $stage, $allowMissing = false) { - assert('is_string($id)'); - assert('is_string($stage)'); - assert('is_bool($allowMissing)'); - SimpleSAML\Logger::debug('Loading state: '.var_export($id, true)); + assert(is_string($id)); + assert(is_string($stage)); + assert(is_bool($allowMissing)); + \SimpleSAML\Logger::debug('Loading state: '.var_export($id, true)); $sid = self::parseStateID($id); - $session = SimpleSAML_Session::getSessionFromRequest(); - $state = $session->getData('SimpleSAML_Auth_State', $sid['id']); + $session = \SimpleSAML\Session::getSessionFromRequest(); + $state = $session->getData('\SimpleSAML\Auth\State', $sid['id']); if ($state === null) { // Could not find saved data @@ -275,16 +277,16 @@ public static function loadState($id, $stage, $allowMissing = false) } if ($sid['url'] === null) { - throw new SimpleSAML_Error_NoState(); + throw new \SimpleSAML\Error\NoState(); } \SimpleSAML\Utils\HTTP::redirectUntrustedURL($sid['url']); } $state = unserialize($state); - assert('is_array($state)'); - assert('array_key_exists(self::ID, $state)'); - assert('array_key_exists(self::STAGE, $state)'); + assert(is_array($state)); + assert(array_key_exists(self::ID, $state)); + assert(array_key_exists(self::STAGE, $state)); // Verify stage if ($state[self::STAGE] !== $stage) { @@ -296,10 +298,10 @@ public static function loadState($id, $stage, $allowMissing = false) $msg = 'Wrong stage in state. Was \''.$state[self::STAGE]. '\', should be \''.$stage.'\'.'; - SimpleSAML\Logger::warning($msg); + \SimpleSAML\Logger::warning($msg); if ($sid['url'] === null) { - throw new Exception($msg); + throw new \Exception($msg); } \SimpleSAML\Utils\HTTP::redirectUntrustedURL($sid['url']); @@ -318,17 +320,17 @@ public static function loadState($id, $stage, $allowMissing = false) */ public static function deleteState(&$state) { - assert('is_array($state)'); + assert(is_array($state)); if (!array_key_exists(self::ID, $state)) { // This state hasn't been saved return; } - SimpleSAML\Logger::debug('Deleting state: '.var_export($state[self::ID], true)); + \SimpleSAML\Logger::debug('Deleting state: '.var_export($state[self::ID], true)); - $session = SimpleSAML_Session::getSessionFromRequest(); - $session->deleteData('SimpleSAML_Auth_State', $state[self::ID]); + $session = \SimpleSAML\Session::getSessionFromRequest(); + $session->deleteData('\SimpleSAML\Auth\State', $state[self::ID]); } @@ -336,16 +338,15 @@ public static function deleteState(&$state) * Throw exception to the state exception handler. * * @param array $state The state array. - * @param SimpleSAML_Error_Exception $exception The exception. + * @param \SimpleSAML\Error\Exception $exception The exception. * - * @throws SimpleSAML_Error_Exception If there is no exception handler defined, it will just throw the $exception. + * @throws \SimpleSAML\Error\Exception If there is no exception handler defined, it will just throw the $exception. */ - public static function throwException($state, SimpleSAML_Error_Exception $exception) + public static function throwException($state, \SimpleSAML\Error\Exception $exception) { - assert('is_array($state)'); + assert(is_array($state)); if (array_key_exists(self::EXCEPTION_HANDLER_URL, $state)) { - // Save the exception $state[self::EXCEPTION_DATA] = $exception; $id = self::saveState($state, self::EXCEPTION_STAGE); @@ -353,12 +354,12 @@ public static function throwException($state, SimpleSAML_Error_Exception $except // Redirect to the exception handler \SimpleSAML\Utils\HTTP::redirectTrustedURL( $state[self::EXCEPTION_HANDLER_URL], - array(self::EXCEPTION_PARAM => $id) + [self::EXCEPTION_PARAM => $id] ); } elseif (array_key_exists(self::EXCEPTION_HANDLER_FUNC, $state)) { // Call the exception handler $func = $state[self::EXCEPTION_HANDLER_FUNC]; - assert('is_callable($func)'); + assert(is_callable($func)); call_user_func($func, $exception, $state); assert(false); @@ -380,7 +381,7 @@ public static function throwException($state, SimpleSAML_Error_Exception $except */ public static function loadExceptionState($id = null) { - assert('is_string($id) || is_null($id)'); + assert(is_string($id) || $id === null); if ($id === null) { if (!array_key_exists(self::EXCEPTION_PARAM, $_REQUEST)) { @@ -391,7 +392,7 @@ public static function loadExceptionState($id = null) } $state = self::loadState($id, self::EXCEPTION_STAGE); - assert('array_key_exists(self::EXCEPTION_DATA, $state)'); + assert(array_key_exists(self::EXCEPTION_DATA, $state)); return $state; } @@ -416,6 +417,6 @@ public static function parseStateID($stateId) if (count($tmp) === 2) { $url = $tmp[1]; } - return array('id' => $id, 'url' => $url); + return ['id' => $id, 'url' => $url]; } } diff --git a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Auth/TimeLimitedToken.php b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Auth/TimeLimitedToken.php index 920dd2d126..eb6620d5ec 100644 --- a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Auth/TimeLimitedToken.php +++ b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Auth/TimeLimitedToken.php @@ -5,9 +5,9 @@ /** * A class that generates and verifies time-limited tokens. */ + class TimeLimitedToken { - /** * @var string */ diff --git a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/AuthMemCookie.php b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/AuthMemCookie.php index 33944677e4..6b4455400c 100644 --- a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/AuthMemCookie.php +++ b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/AuthMemCookie.php @@ -1,5 +1,6 @@ <?php +namespace SimpleSAML; /** * This is a helper class for the Auth MemCookie module. @@ -10,17 +11,17 @@ * * @deprecated This class has been deprecated and will be removed in SSP 2.0. Use the memcookie module instead. */ -class SimpleSAML_AuthMemCookie -{ +class AuthMemCookie +{ /** - * @var SimpleSAML_AuthMemCookie This is the singleton instance of this class. + * @var AuthMemCookie This is the singleton instance of this class. */ private static $instance = null; /** - * @var SimpleSAML_Configuration The configuration for Auth MemCookie. + * @var Configuration The configuration for Auth MemCookie. */ private $amcConfig; @@ -28,12 +29,12 @@ class SimpleSAML_AuthMemCookie /** * This function is used to retrieve the singleton instance of this class. * - * @return SimpleSAML_AuthMemCookie The singleton instance of this class. + * @return AuthMemCookie The singleton instance of this class. */ public static function getInstance() { if (self::$instance === null) { - self::$instance = new SimpleSAML_AuthMemCookie(); + self::$instance = new AuthMemCookie(); } return self::$instance; @@ -46,7 +47,7 @@ public static function getInstance() private function __construct() { // load AuthMemCookie configuration - $this->amcConfig = SimpleSAML_Configuration::getConfig('authmemcookie.php'); + $this->amcConfig = Configuration::getConfig('authmemcookie.php'); } @@ -71,7 +72,7 @@ public function getCookieName() { $cookieName = $this->amcConfig->getString('cookiename', 'AuthMemCookie'); if (!is_string($cookieName) || strlen($cookieName) === 0) { - throw new Exception( + throw new \Exception( "Configuration option 'cookiename' contains an invalid value. This option should be a string." ); } @@ -109,17 +110,19 @@ public function getGroupsAttr() /** * This function creates and initializes a Memcache object from our configuration. * - * @return Memcache A Memcache object initialized from our configuration. - * @throws Exception If the servers configuration is invalid. + * @return \Memcache A Memcache object initialized from our configuration. + * @throws \Exception If the servers configuration is invalid. */ public function getMemcache() { $memcacheHost = $this->amcConfig->getString('memcache.host', '127.0.0.1'); $memcachePort = $this->amcConfig->getInteger('memcache.port', 11211); - $class = class_exists('Memcache') ? 'Memcache' : (class_exists('Memcached') ? 'Memcached' : FALSE); + $class = class_exists('Memcache') ? '\Memcache' : (class_exists('Memcached') ? '\Memcached' : false); if (!$class) { - throw new Exception('Missing Memcached implementation. You must install either the Memcache or Memcached extension.'); + throw new \Exception( + 'Missing Memcached implementation. You must install either the Memcache or Memcached extension.' + ); } // Create the Memcache(d) object. diff --git a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Bindings/Shib13/Artifact.php b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Bindings/Shib13/Artifact.php index df23ffd9ca..3ce30d977f 100644 --- a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Bindings/Shib13/Artifact.php +++ b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Bindings/Shib13/Artifact.php @@ -9,6 +9,7 @@ namespace SimpleSAML\Bindings\Shib13; use SAML2\DOMDocumentFactory; +use SimpleSAML\Error; use SimpleSAML\Utils\Config; use SimpleSAML\Utils\HTTP; use SimpleSAML\Utils\Random; @@ -18,7 +19,6 @@ class Artifact { - /** * Parse the query string, and extract the SAMLart parameters. * @@ -29,11 +29,11 @@ class Artifact */ private static function getArtifacts() { - assert('array_key_exists("QUERY_STRING", $_SERVER)'); + assert(array_key_exists('QUERY_STRING', $_SERVER)); // We need to process the query string manually, to capture all SAMLart parameters - $artifacts = array(); + $artifacts = []; $elements = explode('&', $_SERVER['QUERY_STRING']); foreach ($elements as $element) { @@ -58,20 +58,20 @@ private static function getArtifacts() */ private static function buildRequest(array $artifacts) { - $msg = '<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">' . - '<SOAP-ENV:Body>' . - '<samlp:Request xmlns:samlp="urn:oasis:names:tc:SAML:1.0:protocol"' . - ' RequestID="' . Random::generateID() . '"' . - ' MajorVersion="1" MinorVersion="1"' . - ' IssueInstant="' . Time::generateTimestamp() . '"' . + $msg = '<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">'. + '<SOAP-ENV:Body>'. + '<samlp:Request xmlns:samlp="urn:oasis:names:tc:SAML:1.0:protocol"'. + ' RequestID="'.Random::generateID().'"'. + ' MajorVersion="1" MinorVersion="1"'. + ' IssueInstant="'.Time::generateTimestamp().'"'. '>'; foreach ($artifacts as $a) { - $msg .= '<samlp:AssertionArtifact>' . htmlspecialchars($a) . '</samlp:AssertionArtifact>'; + $msg .= '<samlp:AssertionArtifact>'.htmlspecialchars($a).'</samlp:AssertionArtifact>'; } - $msg .= '</samlp:Request>' . - '</SOAP-ENV:Body>' . + $msg .= '</samlp:Request>'. + '</SOAP-ENV:Body>'. '</SOAP-ENV:Envelope>'; return $msg; @@ -83,33 +83,33 @@ private static function buildRequest(array $artifacts) * * @param string $soapResponse The SOAP response. * @return string The <saml1p:Response> element, as a string. - * @throws \SimpleSAML_Error_Exception + * @throws Error\Exception */ private static function extractResponse($soapResponse) { - assert('is_string($soapResponse)'); + assert(is_string($soapResponse)); try { $doc = DOMDocumentFactory::fromString($soapResponse); } catch (\Exception $e) { - throw new \SimpleSAML_Error_Exception('Error parsing SAML 1 artifact response.'); + throw new Error\Exception('Error parsing SAML 1 artifact response.'); } $soapEnvelope = $doc->firstChild; if (!XML::isDOMNodeOfType($soapEnvelope, 'Envelope', 'http://schemas.xmlsoap.org/soap/envelope/')) { - throw new \SimpleSAML_Error_Exception('Expected artifact response to contain a <soap:Envelope> element.'); + throw new Error\Exception('Expected artifact response to contain a <soap:Envelope> element.'); } $soapBody = XML::getDOMChildren($soapEnvelope, 'Body', 'http://schemas.xmlsoap.org/soap/envelope/'); if (count($soapBody) === 0) { - throw new \SimpleSAML_Error_Exception('Couldn\'t find <soap:Body> in <soap:Envelope>.'); + throw new Error\Exception('Couldn\'t find <soap:Body> in <soap:Envelope>.'); } $soapBody = $soapBody[0]; $responseElement = XML::getDOMChildren($soapBody, 'Response', 'urn:oasis:names:tc:SAML:1.0:protocol'); if (count($responseElement) === 0) { - throw new \SimpleSAML_Error_Exception('Couldn\'t find <saml1p:Response> in <soap:Body>.'); + throw new Error\Exception('Couldn\'t find <saml1p:Response> in <soap:Body>.'); } $responseElement = $responseElement[0]; @@ -128,19 +128,22 @@ private static function extractResponse($soapResponse) /** * This function receives a SAML 1.1 artifact. * - * @param \SimpleSAML_Configuration $spMetadata The metadata of the SP. - * @param \SimpleSAML_Configuration $idpMetadata The metadata of the IdP. + * @param \SimpleSAML\Configuration $spMetadata The metadata of the SP. + * @param \SimpleSAML\Configuration $idpMetadata The metadata of the IdP. * @return string The <saml1p:Response> element, as an XML string. - * @throws \SimpleSAML_Error_Exception + * @throws Error\Exception */ - public static function receive(\SimpleSAML_Configuration $spMetadata, \SimpleSAML_Configuration $idpMetadata) + public static function receive(\SimpleSAML\Configuration $spMetadata, \SimpleSAML\Configuration $idpMetadata) { $artifacts = self::getArtifacts(); $request = self::buildRequest($artifacts); XML::debugSAMLMessage($request, 'out'); - $url = $idpMetadata->getDefaultEndpoint('ArtifactResolutionService', array('urn:oasis:names:tc:SAML:1.0:bindings:SOAP-binding')); + $url = $idpMetadata->getDefaultEndpoint( + 'ArtifactResolutionService', + ['urn:oasis:names:tc:SAML:1.0:bindings:SOAP-binding'] + ); $url = $url['Location']; $peerPublicKeys = $idpMetadata->getPublicKeys('signing', true); @@ -149,33 +152,33 @@ public static function receive(\SimpleSAML_Configuration $spMetadata, \SimpleSAM if ($key['type'] !== 'X509Certificate') { continue; } - $certData .= "-----BEGIN CERTIFICATE-----\n" . - chunk_split($key['X509Certificate'], 64) . + $certData .= "-----BEGIN CERTIFICATE-----\n". + chunk_split($key['X509Certificate'], 64). "-----END CERTIFICATE-----\n"; } - $file = System::getTempDir() . DIRECTORY_SEPARATOR . sha1($certData) . '.crt'; + $file = System::getTempDir().DIRECTORY_SEPARATOR.sha1($certData).'.crt'; if (!file_exists($file)) { System::writeFile($file, $certData); } $spKeyCertFile = Config::getCertPath($spMetadata->getString('privatekey')); - $opts = array( - 'ssl' => array( + $opts = [ + 'ssl' => [ 'verify_peer' => true, 'cafile' => $file, 'local_cert' => $spKeyCertFile, 'capture_peer_cert' => true, 'capture_peer_chain' => true, - ), - 'http' => array( + ], + 'http' => [ 'method' => 'POST', 'content' => $request, - 'header' => 'SOAPAction: http://www.oasis-open.org/committees/security' . "\r\n" . + 'header' => 'SOAPAction: http://www.oasis-open.org/committees/security'."\r\n". 'Content-Type: text/xml', - ), - ); + ], + ]; // Fetch the artifact $response = HTTP::fetch($url, $opts); diff --git a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Bindings/Shib13/HTTPPost.php b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Bindings/Shib13/HTTPPost.php index 58824747e3..893682c1b8 100644 --- a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Bindings/Shib13/HTTPPost.php +++ b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Bindings/Shib13/HTTPPost.php @@ -19,14 +19,13 @@ class HTTPPost { - /** - * @var \SimpleSAML_Configuration + * @var \SimpleSAML\Configuration */ private $configuration = null; /** - * @var \SimpleSAML_Metadata_MetaDataStorageHandler + * @var \SimpleSAML\Metadata\MetaDataStorageHandler */ private $metadata = null; @@ -34,12 +33,12 @@ class HTTPPost /** * Constructor for the \SimpleSAML\Bindings\Shib13\HTTPPost class. * - * @param \SimpleSAML_Configuration $configuration The configuration to use. - * @param \SimpleSAML_Metadata_MetaDataStorageHandler $metadatastore A store where to find metadata. + * @param \SimpleSAML\Configuration $configuration The configuration to use. + * @param \SimpleSAML\Metadata\MetaDataStorageHandler $metadatastore A store where to find metadata. */ public function __construct( - \SimpleSAML_Configuration $configuration, - \SimpleSAML_Metadata_MetaDataStorageHandler $metadatastore + \SimpleSAML\Configuration $configuration, + \SimpleSAML\Metadata\MetaDataStorageHandler $metadatastore ) { $this->configuration = $configuration; $this->metadata = $metadatastore; @@ -50,15 +49,15 @@ public function __construct( * Send an authenticationResponse using HTTP-POST. * * @param string $response The response which should be sent. - * @param \SimpleSAML_Configuration $idpmd The metadata of the IdP which is sending the response. - * @param \SimpleSAML_Configuration $spmd The metadata of the SP which is receiving the response. + * @param \SimpleSAML\Configuration $idpmd The metadata of the IdP which is sending the response. + * @param \SimpleSAML\Configuration $spmd The metadata of the SP which is receiving the response. * @param string|null $relayState The relaystate for the SP. * @param string $shire The shire which should receive the response. */ public function sendResponse( $response, - \SimpleSAML_Configuration $idpmd, - \SimpleSAML_Configuration $spmd, + \SimpleSAML\Configuration $idpmd, + \SimpleSAML\Configuration $spmd, $relayState, $shire ) { @@ -89,11 +88,11 @@ public function sendResponse( $signResponse = true; } - $signer = new Signer(array( + $signer = new Signer([ 'privatekey_array' => $privatekey, 'publickey_array' => $publickey, 'id' => ($signResponse ? 'ResponseID' : 'AssertionID'), - )); + ]); if ($idpmd->hasValue('certificatechain')) { $signer->addCertificate($idpmd->getString('certificatechain')); @@ -103,7 +102,7 @@ public function sendResponse( // sign the response - this must be done after encrypting the assertion // we insert the signature before the saml2p:Status element $statusElements = XML::getDOMChildren($responseroot, 'Status', '@saml1p'); - assert('count($statusElements) === 1'); + assert(count($statusElements) === 1); $signer->sign($responseroot, $responseroot, $statusElements[0]); } else { // Sign the assertion @@ -114,10 +113,10 @@ public function sendResponse( XML::debugSAMLMessage($response, 'out'); - HTTP::submitPOSTData($shire, array( + HTTP::submitPOSTData($shire, [ 'TARGET' => $relayState, 'SAMLResponse' => base64_encode($response), - )); + ]); } @@ -130,7 +129,7 @@ public function sendResponse( */ public function decodeResponse($post) { - assert('is_array($post)'); + assert(is_array($post)); if (!array_key_exists('SAMLResponse', $post)) { throw new \Exception('Missing required SAMLResponse parameter.'); diff --git a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Configuration.php b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Configuration.php index 8283f7d69b..7c575ff875 100644 --- a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Configuration.php +++ b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Configuration.php @@ -1,5 +1,8 @@ <?php +namespace SimpleSAML; + +use SimpleSAML\Utils\System; /** * Configuration of SimpleSAMLphp @@ -7,9 +10,8 @@ * @author Andreas Aakre Solberg, UNINETT AS. <andreas.solberg@uninett.no> * @package SimpleSAMLphp */ -class SimpleSAML_Configuration implements \SimpleSAML\Utils\ClearableState +class Configuration implements Utils\ClearableState { - /** * A default value which means that the given option is required. * @@ -23,7 +25,7 @@ class SimpleSAML_Configuration implements \SimpleSAML\Utils\ClearableState * * @var array */ - private static $instance = array(); + private static $instance = []; /** @@ -34,7 +36,7 @@ class SimpleSAML_Configuration implements \SimpleSAML\Utils\ClearableState * * @var array */ - private static $configDirs = array(); + private static $configDirs = []; /** @@ -44,7 +46,7 @@ class SimpleSAML_Configuration implements \SimpleSAML\Utils\ClearableState * * @var array */ - private static $loadedConfigs = array(); + private static $loadedConfigs = []; /** @@ -87,29 +89,28 @@ class SimpleSAML_Configuration implements \SimpleSAML\Utils\ClearableState */ public function __construct($config, $location) { - assert('is_array($config)'); - assert('is_string($location)'); + assert(is_array($config)); + assert(is_string($location)); $this->configuration = $config; $this->location = $location; } - /** * Load the given configuration file. * * @param string $filename The full path of the configuration file. * @param bool $required Whether the file is required. * - * @return SimpleSAML_Configuration The configuration file. An exception will be thrown if the + * @return \SimpleSAML\Configuration The configuration file. An exception will be thrown if the * configuration file is missing. * - * @throws Exception If the configuration file is invalid or missing. + * @throws \Exception If the configuration file is invalid or missing. */ private static function loadFromFile($filename, $required) { - assert('is_string($filename)'); - assert('is_bool($required)'); + assert(is_string($filename)); + assert(is_bool($required)); if (array_key_exists($filename, self::$loadedConfigs)) { return self::$loadedConfigs[$filename]; @@ -120,12 +121,12 @@ private static function loadFromFile($filename, $required) // the file initializes a variable named '$config' ob_start(); - if (interface_exists('Throwable')) { + if (interface_exists('Throwable', false)) { try { require($filename); - } catch (ParseError $e) { - self::$loadedConfigs[$filename] = self::loadFromArray(array(), '[ARRAY]', 'simplesaml'); - throw new SimpleSAML\Error\ConfigurationError($e->getMessage(), $filename, array()); + } catch (\ParseError $e) { + self::$loadedConfigs[$filename] = self::loadFromArray([], '[ARRAY]', 'simplesaml'); + throw new Error\ConfigurationError($e->getMessage(), $filename, []); } } else { require($filename); @@ -136,7 +137,7 @@ private static function loadFromFile($filename, $required) // check that $config exists if (!isset($config)) { - throw new \SimpleSAML\Error\ConfigurationError( + throw new Error\ConfigurationError( '$config is not defined in the configuration file.', $filename ); @@ -144,7 +145,7 @@ private static function loadFromFile($filename, $required) // check that $config is initialized to an array if (!is_array($config)) { - throw new \SimpleSAML\Error\ConfigurationError( + throw new Error\ConfigurationError( '$config is not an array.', $filename ); @@ -152,28 +153,28 @@ private static function loadFromFile($filename, $required) // check that $config is not empty if (empty($config)) { - throw new \SimpleSAML\Error\ConfigurationError( + throw new Error\ConfigurationError( '$config is empty.', $filename ); } } elseif ($required) { // file does not exist, but is required - throw new \SimpleSAML\Error\ConfigurationError('Missing configuration file', $filename); + throw new Error\ConfigurationError('Missing configuration file', $filename); } else { // file does not exist, but is optional, so return an empty configuration object without saving it - $cfg = new SimpleSAML_Configuration(array(), $filename); + $cfg = new Configuration([], $filename); $cfg->filename = $filename; return $cfg; } - $cfg = new SimpleSAML_Configuration($config, $filename); + $cfg = new Configuration($config, $filename); $cfg->filename = $filename; self::$loadedConfigs[$filename] = $cfg; if ($spurious_output) { - SimpleSAML\Logger::warning( + Logger::warning( "The configuration file '$filename' generates output. Please review your configuration." ); } @@ -190,12 +191,44 @@ private static function loadFromFile($filename, $required) */ public static function setConfigDir($path, $configSet = 'simplesaml') { - assert('is_string($path)'); - assert('is_string($configSet)'); + assert(is_string($path)); + assert(is_string($configSet)); self::$configDirs[$configSet] = $path; } + /** + * Store a pre-initialized configuration. + * + * Allows consumers to create configuration objects without having them + * loaded from a file. + * + * @param \SimpleSAML\Configuration $config The configuration object to store + * @param string $filename The name of the configuration file. + * @param string $configSet The configuration set. Optional, defaults to 'simplesaml'. + */ + public static function setPreLoadedConfig( + Configuration $config, + $filename = 'config.php', + $configSet = 'simplesaml' + ) { + assert(is_string($filename)); + assert(is_string($configSet)); + + if (!array_key_exists($configSet, self::$configDirs)) { + if ($configSet !== 'simplesaml') { + throw new \Exception('Configuration set \''.$configSet.'\' not initialized.'); + } else { + self::$configDirs['simplesaml'] = dirname(dirname(dirname(__FILE__))).'/config'; + } + } + + $dir = self::$configDirs[$configSet]; + $filePath = $dir.'/'.$filename; + + self::$loadedConfigs[$filePath] = $config; + } + /** * Load a configuration file from a configuration set. @@ -203,19 +236,19 @@ public static function setConfigDir($path, $configSet = 'simplesaml') * @param string $filename The name of the configuration file. * @param string $configSet The configuration set. Optional, defaults to 'simplesaml'. * - * @return SimpleSAML_Configuration The SimpleSAML_Configuration object. - * @throws Exception If the configuration set is not initialized. + * @return \SimpleSAML\Configuration The Configuration object. + * @throws \Exception If the configuration set is not initialized. */ public static function getConfig($filename = 'config.php', $configSet = 'simplesaml') { - assert('is_string($filename)'); - assert('is_string($configSet)'); + assert(is_string($filename)); + assert(is_string($configSet)); if (!array_key_exists($configSet, self::$configDirs)) { if ($configSet !== 'simplesaml') { - throw new Exception('Configuration set \''.$configSet.'\' not initialized.'); + throw new \Exception('Configuration set \''.$configSet.'\' not initialized.'); } else { - self::$configDirs['simplesaml'] = SimpleSAML\Utils\Config::getConfigDir(); + self::$configDirs['simplesaml'] = Utils\Config::getConfigDir(); } } @@ -233,19 +266,19 @@ public static function getConfig($filename = 'config.php', $configSet = 'simples * @param string $filename The name of the configuration file. * @param string $configSet The configuration set. Optional, defaults to 'simplesaml'. * - * @return SimpleSAML_Configuration A configuration object. - * @throws Exception If the configuration set is not initialized. + * @return \SimpleSAML\Configuration A configuration object. + * @throws \Exception If the configuration set is not initialized. */ public static function getOptionalConfig($filename = 'config.php', $configSet = 'simplesaml') { - assert('is_string($filename)'); - assert('is_string($configSet)'); + assert(is_string($filename)); + assert(is_string($configSet)); if (!array_key_exists($configSet, self::$configDirs)) { if ($configSet !== 'simplesaml') { - throw new Exception('Configuration set \''.$configSet.'\' not initialized.'); + throw new \Exception('Configuration set \''.$configSet.'\' not initialized.'); } else { - self::$configDirs['simplesaml'] = SimpleSAML\Utils\Config::getConfigDir(); + self::$configDirs['simplesaml'] = Utils\Config::getConfigDir(); } } @@ -264,14 +297,14 @@ public static function getOptionalConfig($filename = 'config.php', $configSet = * instance with that name will be kept for it to be retrieved later with getInstance($instance). If null, the * configuration will not be kept for later use. Defaults to null. * - * @return SimpleSAML_Configuration The configuration object. + * @return \SimpleSAML\Configuration The configuration object. */ public static function loadFromArray($config, $location = '[ARRAY]', $instance = null) { - assert('is_array($config)'); - assert('is_string($location)'); + assert(is_array($config)); + assert(is_string($location)); - $c = new SimpleSAML_Configuration($config, $location); + $c = new Configuration($config, $location); if ($instance !== null) { self::$instance[$instance] = $c; } @@ -290,13 +323,13 @@ public static function loadFromArray($config, $location = '[ARRAY]', $instance = * * @param string $instancename The instance name of the configuration file. Deprecated. * - * @return SimpleSAML_Configuration The configuration object. + * @return \SimpleSAML\Configuration The configuration object. * - * @throws Exception If the configuration with $instancename name is not initialized. + * @throws \Exception If the configuration with $instancename name is not initialized. */ public static function getInstance($instancename = 'simplesaml') { - assert('is_string($instancename)'); + assert(is_string($instancename)); // check if the instance exists already if (array_key_exists($instancename, self::$instance)) { @@ -306,12 +339,12 @@ public static function getInstance($instancename = 'simplesaml') if ($instancename === 'simplesaml') { try { return self::getConfig(); - } catch (SimpleSAML\Error\ConfigurationError $e) { - throw \SimpleSAML\Error\CriticalConfigurationError::fromException($e); + } catch (Error\ConfigurationError $e) { + throw Error\CriticalConfigurationError::fromException($e); } } - throw new \SimpleSAML\Error\CriticalConfigurationError( + throw new Error\CriticalConfigurationError( 'Configuration with name '.$instancename.' is not initialized.' ); } @@ -331,9 +364,9 @@ public static function getInstance($instancename = 'simplesaml') */ public static function init($path, $instancename = 'simplesaml', $configfilename = 'config.php') { - assert('is_string($path)'); - assert('is_string($instancename)'); - assert('is_string($configfilename)'); + assert(is_string($path)); + assert(is_string($instancename)); + assert(is_string($configfilename)); if ($instancename === 'simplesaml') { // for backwards compatibility @@ -363,9 +396,9 @@ public static function init($path, $instancename = 'simplesaml', $configfilename */ public function copyFromBase($instancename, $filename) { - assert('is_string($instancename)'); - assert('is_string($filename)'); - assert('$this->filename !== NULL'); + assert(is_string($instancename)); + assert(is_string($filename)); + assert($this->filename !== null); // check if we already have loaded the given config - return the existing instance if we have if (array_key_exists($instancename, self::$instance)) { @@ -386,7 +419,7 @@ public function copyFromBase($instancename, $filename) */ public function getVersion() { - return '1.15.4'; + return '1.17.8'; } @@ -395,19 +428,19 @@ public function getVersion() * * @param string $name Name of the configuration option. * @param mixed $default Default value of the configuration option. This parameter will default to null if not - * specified. This can be set to SimpleSAML_Configuration::REQUIRED_OPTION, which will + * specified. This can be set to \SimpleSAML\Configuration::REQUIRED_OPTION, which will * cause an exception to be thrown if the option isn't found. * * @return mixed The configuration option with name $name, or $default if the option was not found. * - * @throws Exception If the required option cannot be retrieved. + * @throws \Exception If the required option cannot be retrieved. */ public function getValue($name, $default = null) { // return the default value if the option is unset if (!array_key_exists($name, $this->configuration)) { if ($default === self::REQUIRED_OPTION) { - throw new Exception( + throw new \Exception( $this->location.': Could not retrieve the required option '. var_export($name, true) ); @@ -459,7 +492,7 @@ public function hasValueOneOf($names) * * @return string The absolute path relative to the root of the website. * - * @throws SimpleSAML\Error\CriticalConfigurationError If the format of 'baseurlpath' is incorrect. + * @throws \SimpleSAML\Error\CriticalConfigurationError If the format of 'baseurlpath' is incorrect. * * @deprecated This method will be removed in SimpleSAMLphp 2.0. Please use getBasePath() instead. */ @@ -467,13 +500,13 @@ public function getBaseURL() { if (!$this->deprecated_base_url_used) { $this->deprecated_base_url_used = true; - SimpleSAML\Logger::warning( - "SimpleSAML_Configuration::getBaseURL() is deprecated, please use getBasePath() instead." + Logger::warning( + "\SimpleSAML\Configuration::getBaseURL() is deprecated, please use getBasePath() instead." ); } if (preg_match('/^\*(.*)$/D', $this->getString('baseurlpath', 'simplesaml/'), $matches)) { // deprecated behaviour, will be removed in the future - return \SimpleSAML\Utils\HTTP::getFirstPathElement(false).$matches[1]; + return Utils\HTTP::getFirstPathElement(false).$matches[1]; } return ltrim($this->getBasePath(), '/'); } @@ -486,7 +519,7 @@ public function getBaseURL() * * @return string The absolute path where SimpleSAMLphp can be reached in the web server. * - * @throws SimpleSAML\Error\CriticalConfigurationError If the format of 'baseurlpath' is incorrect. + * @throws \SimpleSAML\Error\CriticalConfigurationError If the format of 'baseurlpath' is incorrect. */ public function getBasePath() { @@ -511,8 +544,8 @@ public function getBasePath() * with the configuration. Use a guessed base path instead of the one provided. */ $c = $this->toArray(); - $c['baseurlpath'] = SimpleSAML\Utils\HTTP::guessBasePath(); - throw new SimpleSAML\Error\CriticalConfigurationError( + $c['baseurlpath'] = Utils\HTTP::guessBasePath(); + throw new Error\CriticalConfigurationError( 'Incorrect format for option \'baseurlpath\'. Value is: "'. $this->getString('baseurlpath', 'simplesaml/').'". Valid format is in the form'. ' [(http|https)://(hostname|fqdn)[:port]]/[path/to/simplesaml/].', @@ -539,21 +572,9 @@ public function resolvePath($path) return null; } - assert('is_string($path)'); + assert(is_string($path)); - /* Prepend path with basedir if it doesn't start with a slash or a Windows drive letter (e.g. "C:\"). We assume - * getBaseDir ends with a slash. - */ - if ($path[0] !== '/' && - !(preg_match('@^[a-z]:[\\\\/]@i', $path, $matches) && is_dir($matches[0])) - ) { - $path = $this->getBaseDir().$path; - } - - // remove trailing slashes - $path = rtrim($path, '/'); - - return $path; + return System::resolvePath($path, $this->getBaseDir()); } @@ -612,13 +633,13 @@ public function getBaseDir() // the directory wasn't set in the configuration file, path is <base directory>/lib/SimpleSAML/Configuration.php $dir = __FILE__; - assert('basename($dir) === "Configuration.php"'); + assert(basename($dir) === 'Configuration.php'); $dir = dirname($dir); - assert('basename($dir) === "SimpleSAML"'); + assert(basename($dir) === 'SimpleSAML'); $dir = dirname($dir); - assert('basename($dir) === "lib"'); + assert(basename($dir) === 'lib'); $dir = dirname($dir); @@ -643,11 +664,11 @@ public function getBaseDir() * @return boolean|mixed The option with the given name, or $default if the option isn't found and $default is * specified. * - * @throws Exception If the option is not boolean. + * @throws \Exception If the option is not boolean. */ public function getBoolean($name, $default = self::REQUIRED_OPTION) { - assert('is_string($name)'); + assert(is_string($name)); $ret = $this->getValue($name, $default); @@ -657,7 +678,7 @@ public function getBoolean($name, $default = self::REQUIRED_OPTION) } if (!is_bool($ret)) { - throw new Exception( + throw new \Exception( $this->location.': The option '.var_export($name, true). ' is not a valid boolean value.' ); @@ -681,11 +702,11 @@ public function getBoolean($name, $default = self::REQUIRED_OPTION) * @return string|mixed The option with the given name, or $default if the option isn't found and $default is * specified. * - * @throws Exception If the option is not a string. + * @throws \Exception If the option is not a string. */ public function getString($name, $default = self::REQUIRED_OPTION) { - assert('is_string($name)'); + assert(is_string($name)); $ret = $this->getValue($name, $default); @@ -695,7 +716,7 @@ public function getString($name, $default = self::REQUIRED_OPTION) } if (!is_string($ret)) { - throw new Exception( + throw new \Exception( $this->location.': The option '.var_export($name, true). ' is not a valid string value.' ); @@ -719,11 +740,11 @@ public function getString($name, $default = self::REQUIRED_OPTION) * @return int|mixed The option with the given name, or $default if the option isn't found and $default is * specified. * - * @throws Exception If the option is not an integer. + * @throws \Exception If the option is not an integer. */ public function getInteger($name, $default = self::REQUIRED_OPTION) { - assert('is_string($name)'); + assert(is_string($name)); $ret = $this->getValue($name, $default); @@ -733,7 +754,7 @@ public function getInteger($name, $default = self::REQUIRED_OPTION) } if (!is_int($ret)) { - throw new Exception( + throw new \Exception( $this->location.': The option '.var_export($name, true). ' is not a valid integer value.' ); @@ -761,13 +782,13 @@ public function getInteger($name, $default = self::REQUIRED_OPTION) * @return int|mixed The option with the given name, or $default if the option isn't found and $default is * specified. * - * @throws Exception If the option is not in the range specified. + * @throws \Exception If the option is not in the range specified. */ public function getIntegerRange($name, $minimum, $maximum, $default = self::REQUIRED_OPTION) { - assert('is_string($name)'); - assert('is_int($minimum)'); - assert('is_int($maximum)'); + assert(is_string($name)); + assert(is_int($minimum)); + assert(is_int($maximum)); $ret = $this->getInteger($name, $default); @@ -777,7 +798,7 @@ public function getIntegerRange($name, $minimum, $maximum, $default = self::REQU } if ($ret < $minimum || $ret > $maximum) { - throw new Exception( + throw new \Exception( $this->location.': Value of option '.var_export($name, true). ' is out of range. Value is '.$ret.', allowed range is [' .$minimum.' - '.$maximum.']' @@ -807,12 +828,12 @@ public function getIntegerRange($name, $minimum, $maximum, $default = self::REQU * * @return mixed The option with the given name, or $default if the option isn't found and $default is given. * - * @throws Exception If the option does not have any of the allowed values. + * @throws \Exception If the option does not have any of the allowed values. */ public function getValueValidate($name, $allowedValues, $default = self::REQUIRED_OPTION) { - assert('is_string($name)'); - assert('is_array($allowedValues)'); + assert(is_string($name)); + assert(is_array($allowedValues)); $ret = $this->getValue($name, $default); if ($ret === $default) { @@ -821,13 +842,13 @@ public function getValueValidate($name, $allowedValues, $default = self::REQUIRE } if (!in_array($ret, $allowedValues, true)) { - $strValues = array(); + $strValues = []; foreach ($allowedValues as $av) { $strValues[] = var_export($av, true); } $strValues = implode(', ', $strValues); - throw new Exception( + throw new \Exception( $this->location.': Invalid value given for the option '. var_export($name, true).'. It should have one of the following values: '. $strValues.'; but it had the following value: '.var_export($ret, true) @@ -852,11 +873,11 @@ public function getValueValidate($name, $allowedValues, $default = self::REQUIRE * @return array|mixed The option with the given name, or $default if the option isn't found and $default is * specified. * - * @throws Exception If the option is not an array. + * @throws \Exception If the option is not an array. */ public function getArray($name, $default = self::REQUIRED_OPTION) { - assert('is_string($name)'); + assert(is_string($name)); $ret = $this->getValue($name, $default); @@ -866,7 +887,7 @@ public function getArray($name, $default = self::REQUIRED_OPTION) } if (!is_array($ret)) { - throw new Exception($this->location.': The option '.var_export($name, true).' is not an array.'); + throw new \Exception($this->location.': The option '.var_export($name, true).' is not an array.'); } return $ret; @@ -887,7 +908,7 @@ public function getArray($name, $default = self::REQUIRED_OPTION) */ public function getArrayize($name, $default = self::REQUIRED_OPTION) { - assert('is_string($name)'); + assert(is_string($name)); $ret = $this->getValue($name, $default); @@ -897,7 +918,7 @@ public function getArrayize($name, $default = self::REQUIRED_OPTION) } if (!is_array($ret)) { - $ret = array($ret); + $ret = [$ret]; } return $ret; @@ -916,11 +937,11 @@ public function getArrayize($name, $default = self::REQUIRED_OPTION) * * @return array The option with the given name, or $default if the option isn't found and $default is specified. * - * @throws Exception If the option is not a string or an array of strings. + * @throws \Exception If the option is not a string or an array of strings. */ public function getArrayizeString($name, $default = self::REQUIRED_OPTION) { - assert('is_string($name)'); + assert(is_string($name)); $ret = $this->getArrayize($name, $default); @@ -931,7 +952,7 @@ public function getArrayizeString($name, $default = self::REQUIRED_OPTION) foreach ($ret as $value) { if (!is_string($value)) { - throw new Exception( + throw new \Exception( $this->location.': The option '.var_export($name, true). ' must be a string or an array of strings.' ); @@ -943,9 +964,9 @@ public function getArrayizeString($name, $default = self::REQUIRED_OPTION) /** - * Retrieve an array as a SimpleSAML_Configuration object. + * Retrieve an array as a \SimpleSAML\Configuration object. * - * This function will load the value of an option into a SimpleSAML_Configuration object. The option must contain + * This function will load the value of an option into a \SimpleSAML\Configuration object. The option must contain * an array. * * An exception will be thrown if this option isn't an array, or if this option isn't found, and no default value @@ -958,11 +979,11 @@ public function getArrayizeString($name, $default = self::REQUIRED_OPTION) * * @return mixed The option with the given name, or $default if the option isn't found and $default is specified. * - * @throws Exception If the option is not an array. + * @throws \Exception If the option is not an array. */ public function getConfigItem($name, $default = self::REQUIRED_OPTION) { - assert('is_string($name)'); + assert(is_string($name)); $ret = $this->getValue($name, $default); @@ -972,7 +993,7 @@ public function getConfigItem($name, $default = self::REQUIRED_OPTION) } if (!is_array($ret)) { - throw new Exception( + throw new \Exception( $this->location.': The option '.var_export($name, true). ' is not an array.' ); @@ -983,11 +1004,11 @@ public function getConfigItem($name, $default = self::REQUIRED_OPTION) /** - * Retrieve an array of arrays as an array of SimpleSAML_Configuration objects. + * Retrieve an array of arrays as an array of \SimpleSAML\Configuration objects. * * This function will retrieve an option containing an array of arrays, and create an array of - * SimpleSAML_Configuration objects from that array. The indexes in the new array will be the same as the original - * indexes, but the values will be SimpleSAML_Configuration objects. + * \SimpleSAML\Configuration objects from that array. The indexes in the new array will be the same as the original + * indexes, but the values will be \SimpleSAML\Configuration objects. * * An exception will be thrown if this option isn't an array of arrays, or if this option isn't found, and no * default value is given. @@ -999,11 +1020,11 @@ public function getConfigItem($name, $default = self::REQUIRED_OPTION) * * @return mixed The option with the given name, or $default if the option isn't found and $default is specified. * - * @throws Exception If the value of this element is not an array. + * @throws \Exception If the value of this element is not an array. */ public function getConfigList($name, $default = self::REQUIRED_OPTION) { - assert('is_string($name)'); + assert(is_string($name)); $ret = $this->getValue($name, $default); @@ -1013,18 +1034,18 @@ public function getConfigList($name, $default = self::REQUIRED_OPTION) } if (!is_array($ret)) { - throw new Exception( + throw new \Exception( $this->location.': The option '.var_export($name, true). ' is not an array.' ); } - $out = array(); + $out = []; foreach ($ret as $index => $config) { $newLoc = $this->location.'['.var_export($name, true).']['. var_export($index, true).']'; if (!is_array($config)) { - throw new Exception($newLoc.': The value of this element was expected to be an array.'); + throw new \Exception($newLoc.': The value of this element was expected to be an array.'); } $out[$index] = self::loadFromArray($config, $newLoc); } @@ -1068,11 +1089,11 @@ public function toArray() * * @return string The default binding. * - * @throws Exception If the default binding is missing for this endpoint type. + * @throws \Exception If the default binding is missing for this endpoint type. */ private function getDefaultBinding($endpointType) { - assert('is_string($endpointType)'); + assert(is_string($endpointType)); $set = $this->getString('metadata-set'); switch ($set.':'.$endpointType) { @@ -1089,7 +1110,7 @@ private function getDefaultBinding($endpointType) case 'shib13-sp-remote:AssertionConsumerService': return 'urn:oasis:names:tc:SAML:1.0:profiles:browser-post'; default: - throw new Exception('Missing default binding for '.$endpointType.' in '.$set); + throw new \Exception('Missing default binding for '.$endpointType.' in '.$set); } } @@ -1101,26 +1122,26 @@ private function getDefaultBinding($endpointType) * * @return array Array of endpoints of the given type. * - * @throws Exception If any element of the configuration options for this endpoint type is incorrect. + * @throws \Exception If any element of the configuration options for this endpoint type is incorrect. */ public function getEndpoints($endpointType) { - assert('is_string($endpointType)'); + assert(is_string($endpointType)); $loc = $this->location.'['.var_export($endpointType, true).']:'; if (!array_key_exists($endpointType, $this->configuration)) { // no endpoints of the given type - return array(); + return []; } $eps = $this->configuration[$endpointType]; if (is_string($eps)) { // for backwards-compatibility - $eps = array($eps); + $eps = [$eps]; } elseif (!is_array($eps)) { - throw new Exception($loc.': Expected array or string.'); + throw new \Exception($loc.': Expected array or string.'); } @@ -1129,41 +1150,41 @@ public function getEndpoints($endpointType) if (is_string($ep)) { // for backwards-compatibility - $ep = array( + $ep = [ 'Location' => $ep, 'Binding' => $this->getDefaultBinding($endpointType), - ); + ]; $responseLocation = $this->getString($endpointType.'Response', null); if ($responseLocation !== null) { $ep['ResponseLocation'] = $responseLocation; } } elseif (!is_array($ep)) { - throw new Exception($iloc.': Expected a string or an array.'); + throw new \Exception($iloc.': Expected a string or an array.'); } if (!array_key_exists('Location', $ep)) { - throw new Exception($iloc.': Missing Location.'); + throw new \Exception($iloc.': Missing Location.'); } if (!is_string($ep['Location'])) { - throw new Exception($iloc.': Location must be a string.'); + throw new \Exception($iloc.': Location must be a string.'); } if (!array_key_exists('Binding', $ep)) { - throw new Exception($iloc.': Missing Binding.'); + throw new \Exception($iloc.': Missing Binding.'); } if (!is_string($ep['Binding'])) { - throw new Exception($iloc.': Binding must be a string.'); + throw new \Exception($iloc.': Binding must be a string.'); } if (array_key_exists('ResponseLocation', $ep)) { if (!is_string($ep['ResponseLocation'])) { - throw new Exception($iloc.': ResponseLocation must be a string.'); + throw new \Exception($iloc.': ResponseLocation must be a string.'); } } if (array_key_exists('index', $ep)) { if (!is_int($ep['index'])) { - throw new Exception($iloc.': index must be an integer.'); + throw new \Exception($iloc.': index must be an integer.'); } } } @@ -1182,11 +1203,11 @@ public function getEndpoints($endpointType) * * @return array|null The default endpoint, or null if no acceptable endpoints are used. * - * @throws Exception If no supported endpoint is found. + * @throws \Exception If no supported endpoint is found. */ public function getEndpointPrioritizedByBinding($endpointType, array $bindings, $default = self::REQUIRED_OPTION) { - assert('is_string($endpointType)'); + assert(is_string($endpointType)); $endpoints = $this->getEndpoints($endpointType); @@ -1200,7 +1221,7 @@ public function getEndpointPrioritizedByBinding($endpointType, array $bindings, if ($default === self::REQUIRED_OPTION) { $loc = $this->location.'['.var_export($endpointType, true).']:'; - throw new Exception($loc.'Could not find a supported '.$endpointType.' endpoint.'); + throw new \Exception($loc.'Could not find a supported '.$endpointType.' endpoint.'); } return $default; @@ -1217,22 +1238,22 @@ public function getEndpointPrioritizedByBinding($endpointType, array $bindings, * * @return array|null The default endpoint, or null if no acceptable endpoints are used. * - * @throws Exception If no supported endpoint is found. + * @throws \Exception If no supported endpoint is found. */ public function getDefaultEndpoint($endpointType, array $bindings = null, $default = self::REQUIRED_OPTION) { - assert('is_string($endpointType)'); + assert(is_string($endpointType)); $endpoints = $this->getEndpoints($endpointType); - $defaultEndpoint = \SimpleSAML\Utils\Config\Metadata::getDefaultEndpoint($endpoints, $bindings); + $defaultEndpoint = Utils\Config\Metadata::getDefaultEndpoint($endpoints, $bindings); if ($defaultEndpoint !== null) { return $defaultEndpoint; } if ($default === self::REQUIRED_OPTION) { $loc = $this->location.'['.var_export($endpointType, true).']:'; - throw new Exception($loc.'Could not find a supported '.$endpointType.' endpoint.'); + throw new \Exception($loc.'Could not find a supported '.$endpointType.' endpoint.'); } return $default; @@ -1250,11 +1271,11 @@ public function getDefaultEndpoint($endpointType, array $bindings = null, $defau * * @return array Associative array with language => string pairs. * - * @throws Exception If the translation is not an array or a string, or its index or value are not strings. + * @throws \Exception If the translation is not an array or a string, or its index or value are not strings. */ public function getLocalizedString($name, $default = self::REQUIRED_OPTION) { - assert('is_string($name)'); + assert(is_string($name)); $ret = $this->getValue($name, $default); if ($ret === $default) { @@ -1265,19 +1286,19 @@ public function getLocalizedString($name, $default = self::REQUIRED_OPTION) $loc = $this->location.'['.var_export($name, true).']'; if (is_string($ret)) { - $ret = array('en' => $ret,); + $ret = ['en' => $ret]; } if (!is_array($ret)) { - throw new Exception($loc.': Must be an array or a string.'); + throw new \Exception($loc.': Must be an array or a string.'); } foreach ($ret as $k => $v) { if (!is_string($k)) { - throw new Exception($loc.': Invalid language code: '.var_export($k, true)); + throw new \Exception($loc.': Invalid language code: '.var_export($k, true)); } if (!is_string($v)) { - throw new Exception($loc.'['.var_export($v, true).']: Must be a string.'); + throw new \Exception($loc.'['.var_export($v, true).']: Must be a string.'); } } @@ -1294,19 +1315,19 @@ public function getLocalizedString($name, $default = self::REQUIRED_OPTION) * @param string $prefix The prefix which should be used when reading from the metadata * array. Defaults to ''. * - * @return array|null Public key data, or null if no public key or was found. + * @return array Public key data, or empty array if no public key or was found. * - * @throws Exception If the certificate or public key cannot be loaded from a file. - * @throws SimpleSAML_Error_Exception If the file does not contain a valid PEM-encoded certificate, or there is no + * @throws \Exception If the certificate or public key cannot be loaded from a file. + * @throws \SimpleSAML\Error\Exception If the file does not contain a valid PEM-encoded certificate, or there is no * certificate in the metadata. */ public function getPublicKeys($use = null, $required = false, $prefix = '') { - assert('is_bool($required)'); - assert('is_string($prefix)'); + assert(is_bool($required)); + assert(is_string($prefix)); if ($this->hasValue($prefix.'keys')) { - $ret = array(); + $ret = []; foreach ($this->getArray($prefix.'keys') as $key) { if ($use !== null && isset($key[$use]) && !$key[$use]) { continue; @@ -1317,52 +1338,48 @@ public function getPublicKeys($use = null, $required = false, $prefix = '') } $ret[] = $key; } - if (!empty($ret)) { - return $ret; - } + return $ret; } elseif ($this->hasValue($prefix.'certData')) { $certData = $this->getString($prefix.'certData'); $certData = preg_replace('/\s+/', '', $certData); - return array( - array( + return [ + [ 'encryption' => true, 'signing' => true, 'type' => 'X509Certificate', 'X509Certificate' => $certData, - ), - ); + ], + ]; } elseif ($this->hasValue($prefix.'certificate')) { $file = $this->getString($prefix.'certificate'); - $file = \SimpleSAML\Utils\Config::getCertPath($file); + $file = Utils\Config::getCertPath($file); $data = @file_get_contents($file); if ($data === false) { - throw new Exception($this->location.': Unable to load certificate/public key from file "'.$file.'".'); + throw new \Exception($this->location.': Unable to load certificate/public key from file "'.$file.'".'); } // extract certificate data (if this is a certificate) $pattern = '/^-----BEGIN CERTIFICATE-----([^-]*)^-----END CERTIFICATE-----/m'; if (!preg_match($pattern, $data, $matches)) { - throw new SimpleSAML_Error_Exception( + throw new \SimpleSAML\Error\Exception( $this->location.': Could not find PEM encoded certificate in "'.$file.'".' ); } $certData = preg_replace('/\s+/', '', $matches[1]); - return array( - array( + return [ + [ 'encryption' => true, 'signing' => true, 'type' => 'X509Certificate', 'X509Certificate' => $certData, - ), - ); - } - - if ($required) { - throw new SimpleSAML_Error_Exception($this->location.': Missing certificate in metadata.'); + ], + ]; + } elseif ($required === true) { + throw new \SimpleSAML\Error\Exception($this->location.': Missing certificate in metadata.'); } else { - return null; + return []; } } @@ -1373,8 +1390,8 @@ public function getPublicKeys($use = null, $required = false, $prefix = '') */ public static function clearInternalState() { - self::$configDirs = array(); - self::$instance = array(); - self::$loadedConfigs = array(); + self::$configDirs = []; + self::$instance = []; + self::$loadedConfigs = []; } } diff --git a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Database.php b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Database.php index f0b3444ea1..94c9b788f1 100644 --- a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Database.php +++ b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Database.php @@ -1,4 +1,5 @@ <?php + namespace SimpleSAML; /** @@ -18,11 +19,10 @@ class Database { - /** * This variable holds the instance of the session - Singleton approach. */ - private static $instance = array(); + private static $instance = []; /** * PDO Object for the Master database server @@ -32,7 +32,7 @@ class Database /** * Array of PDO Objects for configured database slaves */ - private $dbSlaves = array(); + private $dbSlaves = []; /** * Prefix to apply to the tables @@ -48,13 +48,13 @@ class Database /** * Retrieves the current database instance. Will create a new one if there isn't an existing connection. * - * @param \SimpleSAML_Configuration $altConfig Optional: Instance of a SimpleSAML_Configuration class + * @param \SimpleSAML\Configuration $altConfig Optional: Instance of a \SimpleSAML\Configuration class * * @return \SimpleSAML\Database The shared database connection. */ public static function getInstance($altConfig = null) { - $config = ($altConfig) ? $altConfig : \SimpleSAML_Configuration::getInstance(); + $config = ($altConfig) ? $altConfig : Configuration::getInstance(); $instanceId = self::generateInstanceId($config); // check if we already have initialized the session @@ -71,13 +71,13 @@ public static function getInstance($altConfig = null) /** * Private constructor that restricts instantiation to getInstance(). * - * @param \SimpleSAML_Configuration $config Instance of the SimpleSAML_Configuration class + * @param \SimpleSAML\Configuration $config Instance of the \SimpleSAML\Configuration class */ private function __construct($config) { - $driverOptions = $config->getArray('database.driver_options', array()); + $driverOptions = $config->getArray('database.driver_options', []); if ($config->getBoolean('database.persistent', true)) { - $driverOptions = array(\PDO::ATTR_PERSISTENT => true); + $driverOptions = [\PDO::ATTR_PERSISTENT => true]; } // connect to the master @@ -89,19 +89,17 @@ private function __construct($config) ); // connect to any configured slaves - $slaves = $config->getArray('database.slaves', array()); - if (count($slaves >= 1)) { - foreach ($slaves as $slave) { - array_push( - $this->dbSlaves, - $this->connect( - $slave['dsn'], - $slave['username'], - $slave['password'], - $driverOptions - ) - ); - } + $slaves = $config->getArray('database.slaves', []); + foreach ($slaves as $slave) { + array_push( + $this->dbSlaves, + $this->connect( + $slave['dsn'], + $slave['username'], + $slave['password'], + $driverOptions + ) + ); } $this->tablePrefix = $config->getString('database.prefix', ''); @@ -111,22 +109,22 @@ private function __construct($config) /** * Generate an Instance ID based on the database configuration. * - * @param \SimpleSAML_Configuration $config Configuration class + * @param \SimpleSAML\Configuration $config Configuration class * * @return string $instanceId */ private static function generateInstanceId($config) { - $assembledConfig = array( - 'master' => array( + $assembledConfig = [ + 'master' => [ 'database.dsn' => $config->getString('database.dsn'), 'database.username' => $config->getString('database.username', null), 'database.password' => $config->getString('database.password', null), 'database.prefix' => $config->getString('database.prefix', ''), 'database.persistent' => $config->getBoolean('database.persistent', false), - ), - 'slaves' => $config->getArray('database.slaves', array()), - ); + ], + 'slaves' => $config->getArray('database.slaves', []), + ]; return sha1(serialize($assembledConfig)); } @@ -194,13 +192,13 @@ public function applyPrefix($table) * @param array $params Parameters * * @throws \Exception If an error happens while trying to execute the query. - * @return \PDOStatement object + * @return bool|\PDOStatement object */ private function query($db, $stmt, $params) { - assert('is_object($db)'); - assert('is_string($stmt)'); - assert('is_array($params)'); + assert(is_object($db)); + assert(is_string($stmt)); + assert(is_array($params)); try { $query = $db->prepare($stmt); @@ -234,8 +232,8 @@ private function query($db, $stmt, $params) */ private function exec($db, $stmt) { - assert('is_object($db)'); - assert('is_string($stmt)'); + assert(is_object($db)); + assert(is_string($stmt)); try { return $db->exec($stmt); @@ -254,7 +252,7 @@ private function exec($db, $stmt) * * @return int The number of rows affected by the query. */ - public function write($stmt, $params = array()) + public function write($stmt, $params = []) { $db = $this->dbMaster; @@ -273,9 +271,9 @@ public function write($stmt, $params = array()) * @param string $stmt Prepared SQL statement * @param array $params Parameters * - * @return \PDOStatement object + * @return \PDOStatement|bool object */ - public function read($stmt, $params = array()) + public function read($stmt, $params = []) { $db = $this->getSlave(); diff --git a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Error/Assertion.php b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Error/Assertion.php index cac8607dd8..c16f61164c 100644 --- a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Error/Assertion.php +++ b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Error/Assertion.php @@ -1,81 +1,86 @@ <?php +namespace SimpleSAML\Error; + /** * Class for creating exceptions from assertion failures. * * @author Olav Morken, UNINETT AS. * @package SimpleSAMLphp */ -class SimpleSAML_Error_Assertion extends SimpleSAML_Error_Exception { - - - /** - * The assertion which failed, or NULL if only an expression was passed to the - * assert-function. - */ - private $assertion; - - - /** - * Constructor for the assertion exception. - * - * Should only be called from the onAssertion handler. - * - * @param string|NULL $assertion The assertion which failed, or NULL if the assert-function was - * given an expression. - */ - public function __construct($assertion = NULL) { - assert('is_null($assertion) || is_string($assertion)'); - - $msg = 'Assertion failed: ' . var_export($assertion, TRUE); - parent::__construct($msg); - - $this->assertion = $assertion; - } - - - /** - * Retrieve the assertion which failed. - * - * @return string|NULL The assertion which failed, or NULL if the assert-function was called with an expression. - */ - public function getAssertion() { - return $this->assertion; - } - - - /** - * Install this assertion handler. - * - * This function will register this assertion handler. If will not enable assertions if they are - * disabled. - */ - public static function installHandler() { - - assert_options(ASSERT_WARNING, 0); - assert_options(ASSERT_QUIET_EVAL, 0); - assert_options(ASSERT_CALLBACK, array('SimpleSAML_Error_Assertion', 'onAssertion')); - } - - - /** - * Handle assertion. - * - * This function handles an assertion. - * - * @param string $file The file assert was called from. - * @param int $line The line assert was called from. - * @param mixed $message The expression which was passed to the assert-function. - */ - public static function onAssertion($file, $line, $message) { - - if(!empty($message)) { - $exception = new self($message); - } else { - $exception = new self(); - } - - $exception->logError(); - } +class Assertion extends Exception +{ + /** + * The assertion which failed, or null if only an expression was passed to the + * assert-function. + */ + private $assertion; + + + /** + * Constructor for the assertion exception. + * + * Should only be called from the onAssertion handler. + * + * @param string|null $assertion The assertion which failed, or null if the assert-function was + * given an expression. + */ + public function __construct($assertion = null) + { + assert($assertion === null || is_string($assertion)); + + $msg = 'Assertion failed: '.var_export($assertion, true); + parent::__construct($msg); + + $this->assertion = $assertion; + } + + + /** + * Retrieve the assertion which failed. + * + * @return string|null The assertion which failed, or null if the assert-function was called with an expression. + */ + public function getAssertion() + { + return $this->assertion; + } + + + /** + * Install this assertion handler. + * + * This function will register this assertion handler. If will not enable assertions if they are + * disabled. + */ + public static function installHandler() + { + + assert_options(ASSERT_WARNING, 0); + assert_options(ASSERT_QUIET_EVAL, 0); + assert_options(ASSERT_CALLBACK, ['\SimpleSAML\Error\Assertion', 'onAssertion']); + } + + + /** + * Handle assertion. + * + * This function handles an assertion. + * + * @param string $file The file assert was called from. + * @param int $line The line assert was called from. + * @param mixed $message The expression which was passed to the assert-function. + */ + public static function onAssertion($file, $line, $message) + { + + if (!empty($message)) { + $exception = new self($message); + } else { + $exception = new self(); + } + + $exception->logError(); + } } diff --git a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Error/AuthSource.php b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Error/AuthSource.php index 48e28daccd..e075aa7bc4 100644 --- a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Error/AuthSource.php +++ b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Error/AuthSource.php @@ -1,68 +1,72 @@ <?php + +namespace SimpleSAML\Error; + /** * Baseclass for auth source exceptions. - * + * * @package SimpleSAMLphp_base * */ -class SimpleSAML_Error_AuthSource extends SimpleSAML_Error_Error { - - - /** - * Authsource module name. - */ - private $authsource; +class AuthSource extends Error +{ + /** + * Authsource module name. + */ + private $authsource; - /** - * Reason why this request was invalid. - */ - private $reason; + /** + * Reason why this request was invalid. + */ + private $reason; - /** - * Create a new AuthSource error. - * - * @param string $authsource Authsource module name from where this error was thrown. - * @param string $reason Description of the error. - */ - public function __construct($authsource, $reason, $cause = NULL) { - assert('is_string($authsource)'); - assert('is_string($reason)'); - $this->authsource = $authsource; - $this->reason = $reason; - parent::__construct( - array( - 'AUTHSOURCEERROR', - '%AUTHSOURCE%' => htmlspecialchars(var_export($this->authsource, TRUE)), - '%REASON%' => htmlspecialchars(var_export($this->reason, TRUE)) - ), - $cause - ); + /** + * Create a new AuthSource error. + * + * @param string $authsource Authsource module name from where this error was thrown. + * @param string $reason Description of the error. + */ + public function __construct($authsource, $reason, $cause = null) + { + assert(is_string($authsource)); + assert(is_string($reason)); - $this->message = "Error with authentication source '$authsource': $reason"; - } + $this->authsource = $authsource; + $this->reason = $reason; + parent::__construct( + [ + 'AUTHSOURCEERROR', + '%AUTHSOURCE%' => htmlspecialchars(var_export($this->authsource, true)), + '%REASON%' => htmlspecialchars(var_export($this->reason, true)) + ], + $cause + ); + $this->message = "Error with authentication source '$authsource': $reason"; + } - /** - * Retrieve the authsource module name from where this error was thrown. - * - * @return string Authsource module name. - */ - public function getAuthSource() { - return $this->authsource; - } + /** + * Retrieve the authsource module name from where this error was thrown. + * + * @return string Authsource module name. + */ + public function getAuthSource() + { + return $this->authsource; + } - /** - * Retrieve the reason why the request was invalid. - * - * @return string The reason why the request was invalid. - */ - public function getReason() { - return $this->reason; - } - + /** + * Retrieve the reason why the request was invalid. + * + * @return string The reason why the request was invalid. + */ + public function getReason() + { + return $this->reason; + } } diff --git a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Error/BadRequest.php b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Error/BadRequest.php index a16164969c..1deb08c0bf 100644 --- a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Error/BadRequest.php +++ b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Error/BadRequest.php @@ -1,5 +1,7 @@ <?php +namespace SimpleSAML\Error; + /** * Exception which will show a 400 Bad Request error page. * @@ -9,36 +11,37 @@ * @author Olav Morken, UNINETT AS. * @package SimpleSAMLphp */ -class SimpleSAML_Error_BadRequest extends SimpleSAML_Error_Error { - - - /** - * Reason why this request was invalid. - */ - private $reason; - - - /** - * Create a new BadRequest error. - * - * @param string $reason Description of why the request was unacceptable. - */ - public function __construct($reason) { - assert('is_string($reason)'); - - $this->reason = $reason; - parent::__construct(array('BADREQUEST', '%REASON%' => $this->reason)); - $this->httpCode = 400; - } - - - /** - * Retrieve the reason why the request was invalid. - * - * @return string The reason why the request was invalid. - */ - public function getReason() { - return $this->reason; - } +class BadRequest extends Error +{ + /** + * Reason why this request was invalid. + */ + private $reason; + + + /** + * Create a new BadRequest error. + * + * @param string $reason Description of why the request was unacceptable. + */ + public function __construct($reason) + { + assert(is_string($reason)); + + $this->reason = $reason; + parent::__construct(['BADREQUEST', '%REASON%' => $this->reason]); + $this->httpCode = 400; + } + + + /** + * Retrieve the reason why the request was invalid. + * + * @return string The reason why the request was invalid. + */ + public function getReason() + { + return $this->reason; + } } diff --git a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Error/BadUserInnput.php b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Error/BadUserInput.php similarity index 66% rename from vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Error/BadUserInnput.php rename to vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Error/BadUserInput.php index 48386c16ec..5f94dcc049 100644 --- a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Error/BadUserInnput.php +++ b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Error/BadUserInput.php @@ -1,11 +1,15 @@ <?php + +namespace SimpleSAML\Error; + /** * Exception indicating illegal innput from user. - * + * * @author Thomas Graff <thomas.graff@uninett.no> * @package SimpleSAMLphp_base * */ -class SimpleSAML_Error_BadUserInnput extends SimpleSAML_Error_User{ - + +class BadUserInput extends User +{ } diff --git a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Error/CannotSetCookie.php b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Error/CannotSetCookie.php index 31a25b0c53..70287404f9 100644 --- a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Error/CannotSetCookie.php +++ b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Error/CannotSetCookie.php @@ -1,4 +1,7 @@ <?php + +namespace SimpleSAML\Error; + /** * Exception to indicate that we cannot set a cookie. * @@ -6,12 +9,8 @@ * @package SimpleSAMLphp */ -namespace SimpleSAML\Error; - - -class CannotSetCookie extends \SimpleSAML_Error_Exception +class CannotSetCookie extends Exception { - /** * The exception was thrown for unknown reasons. * diff --git a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Error/ConfigurationError.php b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Error/ConfigurationError.php index 15eb30f366..128093dad5 100644 --- a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Error/ConfigurationError.php +++ b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Error/ConfigurationError.php @@ -1,4 +1,7 @@ <?php + +namespace SimpleSAML\Error; + /** * This exception represents a configuration error. * @@ -6,12 +9,8 @@ * @package SimpleSAMLphp */ -namespace SimpleSAML\Error; - - -class ConfigurationError extends \SimpleSAML_Error_Error +class ConfigurationError extends Error { - /** * The reason for this exception. * @@ -38,7 +37,7 @@ public function __construct($reason = null, $file = null, array $config = null) { $file_str = ''; $reason_str = '.'; - $params = array('CONFIG'); + $params = ['CONFIG']; if ($file !== null) { $params['%FILE%'] = $file; $basepath = dirname(dirname(dirname(dirname(__FILE__)))).'/'; diff --git a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Error/CriticalConfigurationError.php b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Error/CriticalConfigurationError.php index 76af87ff8a..d41367fbf0 100644 --- a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Error/CriticalConfigurationError.php +++ b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Error/CriticalConfigurationError.php @@ -1,4 +1,7 @@ <?php + +namespace SimpleSAML\Error; + /** * This exception represents a configuration error that we cannot recover from. * @@ -18,23 +21,19 @@ * @package SimpleSAMLphp */ -namespace SimpleSAML\Error; - - class CriticalConfigurationError extends ConfigurationError { - /** * This is the bare minimum configuration that we can use. * * @var array */ - private static $minimum_config = array( + private static $minimum_config = [ 'logging.handler' => 'errorlog', 'logging.level' => \SimpleSAML\Logger::DEBUG, 'errorreporting' => false, 'debug' => true, - ); + ]; /** @@ -42,7 +41,7 @@ class CriticalConfigurationError extends ConfigurationError * * @param string|null $reason The reason for this critical error. * @param string|null $file The configuration file that originated this error. - * @param array|null The configuration array that led to this problem. + * @param array|null $config The configuration array that led to this problem. */ public function __construct($reason = null, $file = null, $config = null) { @@ -51,7 +50,7 @@ public function __construct($reason = null, $file = null, $config = null) $config['baseurlpath'] = \SimpleSAML\Utils\HTTP::guessBasePath(); } - \SimpleSAML_Configuration::loadFromArray( + \SimpleSAML\Configuration::loadFromArray( $config, '', 'simplesaml' @@ -61,7 +60,7 @@ public function __construct($reason = null, $file = null, $config = null) /** - * @param \Exception $exception + * @param ConfigurationError $exception * * @return CriticalConfigurationError */ diff --git a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Error/Error.php b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Error/Error.php index 75804b4dd3..615da09c01 100644 --- a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Error/Error.php +++ b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Error/Error.php @@ -1,5 +1,6 @@ <?php +namespace SimpleSAML\Error; /** * Class that wraps SimpleSAMLphp errors in exceptions. @@ -7,10 +8,9 @@ * @author Olav Morken, UNINETT AS. * @package SimpleSAMLphp */ -class SimpleSAML_Error_Error extends SimpleSAML_Error_Exception -{ - +class Error extends Exception +{ /** * The error code. * @@ -18,7 +18,6 @@ class SimpleSAML_Error_Error extends SimpleSAML_Error_Exception */ private $errorCode; - /** * The http code. * @@ -26,7 +25,6 @@ class SimpleSAML_Error_Error extends SimpleSAML_Error_Exception */ protected $httpCode = 500; - /** * The error title tag in dictionary. * @@ -34,7 +32,6 @@ class SimpleSAML_Error_Error extends SimpleSAML_Error_Exception */ private $dictTitle; - /** * The error description tag in dictionary. * @@ -42,7 +39,6 @@ class SimpleSAML_Error_Error extends SimpleSAML_Error_Exception */ private $dictDescr; - /** * The name of module that threw the error. * @@ -50,7 +46,6 @@ class SimpleSAML_Error_Error extends SimpleSAML_Error_Exception */ private $module = null; - /** * The parameters for the error. * @@ -58,7 +53,6 @@ class SimpleSAML_Error_Error extends SimpleSAML_Error_Exception */ private $parameters; - /** * Name of custom include template for the error. * @@ -66,7 +60,6 @@ class SimpleSAML_Error_Error extends SimpleSAML_Error_Exception */ protected $includeTemplate = null; - /** * Constructor for this error. * @@ -74,19 +67,19 @@ class SimpleSAML_Error_Error extends SimpleSAML_Error_Exception * (with index 0), is the error code, while the other elements are replacements for the error text. * * @param mixed $errorCode One of the error codes defined in the errors dictionary. - * @param Exception $cause The exception which caused this fatal error (if any). Optional. + * @param \Exception $cause The exception which caused this fatal error (if any). Optional. * @param int|null $httpCode The HTTP response code to use. Optional. */ - public function __construct($errorCode, Exception $cause = null, $httpCode = null) + public function __construct($errorCode, \Exception $cause = null, $httpCode = null) { - assert('is_string($errorCode) || is_array($errorCode)'); + assert(is_string($errorCode) || is_array($errorCode)); if (is_array($errorCode)) { $this->parameters = $errorCode; unset($this->parameters[0]); $this->errorCode = $errorCode[0]; } else { - $this->parameters = array(); + $this->parameters = []; $this->errorCode = $errorCode; } @@ -94,15 +87,8 @@ public function __construct($errorCode, Exception $cause = null, $httpCode = nul $this->httpCode = $httpCode; } - $moduleCode = explode(':', $this->errorCode, 2); - if (count($moduleCode) === 2) { - $this->module = $moduleCode[0]; - $this->dictTitle = '{'.$this->module.':errors:title_'.$moduleCode[1].'}'; - $this->dictDescr = '{'.$this->module.':errors:descr_'.$moduleCode[1].'}'; - } else { - $this->dictTitle = SimpleSAML\Error\ErrorCodes::getErrorCodeTitle($this->errorCode); - $this->dictDescr = SimpleSAML\Error\ErrorCodes::getErrorCodeDescription($this->errorCode); - } + $this->dictTitle = ErrorCodes::getErrorCodeTitle($this->errorCode); + $this->dictDescr = ErrorCodes::getErrorCodeDescription($this->errorCode); if (!empty($this->parameters)) { $msg = $this->errorCode.'('; @@ -172,30 +158,7 @@ public function getDictDescr() */ protected function setHTTPCode() { - // Some mostly used HTTP codes - $httpCodesMap = array( - 400 => 'HTTP/1.0 400 Bad Request', - 403 => 'HTTP/1.0 403 Forbidden', - 404 => 'HTTP/1.0 404 Not Found', - 405 => 'HTTP/1.0 405 Method Not Allowed', - 500 => 'HTTP/1.0 500 Internal Server Error', - 501 => 'HTTP/1.0 501 Method Not Implemented', - 503 => 'HTTP/1.0 503 Service Temporarily Unavailable', - ); - - $httpCode = $this->httpCode; - - if (function_exists('http_response_code')) { - http_response_code($httpCode); - return; - } - - if (!array_key_exists($this->httpCode, $httpCodesMap)) { - $httpCode = 500; - SimpleSAML\Logger::warning('HTTP response code not defined: '.var_export($this->httpCode, true)); - } - - header($httpCodesMap[$httpCode]); + http_response_code($this->httpCode); } @@ -211,10 +174,10 @@ protected function saveError() $etrace = implode("\n", $data); $reportId = bin2hex(openssl_random_pseudo_bytes(4)); - SimpleSAML\Logger::error('Error report with id '.$reportId.' generated.'); + \SimpleSAML\Logger::error('Error report with id '.$reportId.' generated.'); - $config = SimpleSAML_Configuration::getInstance(); - $session = SimpleSAML_Session::getSessionFromRequest(); + $config = \SimpleSAML\Configuration::getInstance(); + $session = \SimpleSAML\Session::getSessionFromRequest(); if (isset($_SERVER['HTTP_REFERER'])) { $referer = $_SERVER['HTTP_REFERER']; @@ -226,7 +189,7 @@ protected function saveError() } else { $referer = 'unknown'; } - $errorData = array( + $errorData = [ 'exceptionMsg' => $emsg, 'exceptionTrace' => $etrace, 'reportId' => $reportId, @@ -234,7 +197,7 @@ protected function saveError() 'url' => \SimpleSAML\Utils\HTTP::getSelfURLNoQuery(), 'version' => $config->getVersion(), 'referer' => $referer, - ); + ]; $session->setData('core:errorreport', $reportId, $errorData); return $errorData; @@ -254,9 +217,9 @@ public function show() $this->logError(); $errorData = $this->saveError(); + $config = \SimpleSAML\Configuration::getInstance(); - $config = SimpleSAML_Configuration::getInstance(); - + $data = []; $data['showerrors'] = $config->getBoolean('showerrors', true); $data['error'] = $errorData; $data['errorCode'] = $this->errorCode; @@ -277,7 +240,7 @@ public function show() } $data['email'] = ''; - $session = SimpleSAML_Session::getSessionFromRequest(); + $session = \SimpleSAML\Session::getSessionFromRequest(); $authorities = $session->getAuthorities(); foreach ($authorities as $authority) { $attributes = $session->getAuthData($authority, 'Attributes'); @@ -289,11 +252,11 @@ public function show() $show_function = $config->getArray('errors.show_function', null); if (isset($show_function)) { - assert('is_callable($show_function)'); + assert(is_callable($show_function)); call_user_func($show_function, $config, $data); - assert('FALSE'); + assert(false); } else { - $t = new SimpleSAML_XHTML_Template($config, 'error.php', 'errors'); + $t = new \SimpleSAML\XHTML\Template($config, 'error.php', 'errors'); $t->data = array_merge($t->data, $data); $t->data['dictTitleTranslated'] = $t->getTranslator()->t($t->data['dictTitle']); $t->data['dictDescrTranslated'] = $t->getTranslator()->t($t->data['dictDescr'], $t->data['parameters']); diff --git a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Error/ErrorCodes.php b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Error/ErrorCodes.php index 3563a2d3d8..d15f8c46ff 100644 --- a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Error/ErrorCodes.php +++ b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Error/ErrorCodes.php @@ -1,4 +1,7 @@ <?php + +namespace SimpleSAML\Error; + /** * Class that maps SimpleSAMLphp error codes to translateable strings. * @@ -6,8 +9,6 @@ * @package SimpleSAMLphp */ -namespace SimpleSAML\Error; - class ErrorCodes { /** @@ -17,7 +18,7 @@ class ErrorCodes */ final public static function defaultGetAllErrorCodeTitles() { - return array( + return [ 'ACSPARAMS' => \SimpleSAML\Locale\Translate::noop('{errors:title_ACSPARAMS}'), 'ARSPARAMS' => \SimpleSAML\Locale\Translate::noop('{errors:title_ARSPARAMS}'), 'AUTHSOURCEERROR' => \SimpleSAML\Locale\Translate::noop('{errors:title_AUTHSOURCEERROR}'), @@ -51,7 +52,7 @@ final public static function defaultGetAllErrorCodeTitles() 'UNKNOWNCERT' => \SimpleSAML\Locale\Translate::noop('{errors:title_UNKNOWNCERT}'), 'USERABORTED' => \SimpleSAML\Locale\Translate::noop('{errors:title_USERABORTED}'), 'WRONGUSERPASS' => \SimpleSAML\Locale\Translate::noop('{errors:title_WRONGUSERPASS}'), - ); + ]; } @@ -71,11 +72,11 @@ public static function getAllErrorCodeTitles() /** * Fetch all default translation strings for error code descriptions. * - * @return string A map from error code to error code description + * @return array A map from error code to error code description */ final public static function defaultGetAllErrorCodeDescriptions() { - return array( + return [ 'ACSPARAMS' => \SimpleSAML\Locale\Translate::noop('{errors:descr_ACSPARAMS}'), 'ARSPARAMS' => \SimpleSAML\Locale\Translate::noop('{errors:descr_ARSPARAMS}'), 'AUTHSOURCEERROR' => \SimpleSAML\Locale\Translate::noop('{errors:descr_AUTHSOURCEERROR}'), @@ -109,7 +110,7 @@ final public static function defaultGetAllErrorCodeDescriptions() 'UNKNOWNCERT' => \SimpleSAML\Locale\Translate::noop('{errors:descr_UNKNOWNCERT}'), 'USERABORTED' => \SimpleSAML\Locale\Translate::noop('{errors:descr_USERABORTED}'), 'WRONGUSERPASS' => \SimpleSAML\Locale\Translate::noop('{errors:descr_WRONGUSERPASS}'), - ); + ]; } /** @@ -117,7 +118,7 @@ final public static function defaultGetAllErrorCodeDescriptions() * * Extend this to add error codes. * - * @return string A map from error code to error code description + * @return array A map from error code to error code description */ public static function getAllErrorCodeDescriptions() { @@ -134,10 +135,10 @@ public static function getAllErrorCodeDescriptions() */ public static function getAllErrorCodeMessages() { - return array( + return [ 'title' => self::getAllErrorCodeTitles(), 'descr' => self::getAllErrorCodeDescriptions(), - ); + ]; } @@ -180,9 +181,9 @@ public static function getErrorCodeDescription($errorCode) */ public static function getErrorCodeMessage($errorCode) { - return array( + return [ 'title' => self::getErrorCodeTitle($errorCode), 'descr' => self::getErrorCodeDescription($errorCode), - ); + ]; } } diff --git a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Error/Exception.php b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Error/Exception.php index 2227d52480..5ab59f4821 100644 --- a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Error/Exception.php +++ b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Error/Exception.php @@ -1,5 +1,6 @@ <?php +namespace SimpleSAML\Error; /** * Base class for SimpleSAMLphp Exceptions @@ -9,9 +10,9 @@ * @author Thomas Graff <thomas.graff@uninett.no> * @package SimpleSAMLphp */ -class SimpleSAML_Error_Exception extends Exception -{ +class Exception extends \Exception +{ /** * The backtrace for this exception. * @@ -26,7 +27,7 @@ class SimpleSAML_Error_Exception extends Exception /** * The cause of this exception. * - * @var SimpleSAML_Error_Exception + * @var Exception */ private $cause; @@ -34,60 +35,57 @@ class SimpleSAML_Error_Exception extends Exception /** * Constructor for this error. * - * Note that the cause will be converted to a SimpleSAML_Error_UnserializableException unless it is a subclass of - * SimpleSAML_Error_Exception. + * Note that the cause will be converted to a SimpleSAML\Error\UnserializableException unless it is a subclass of + * SimpleSAML\Error\Exception. * * @param string $message Exception message * @param int $code Error code - * @param Exception|null $cause The cause of this exception. + * @param \Exception|null $cause The cause of this exception. */ - public function __construct($message, $code = 0, Exception $cause = null) + public function __construct($message, $code = 0, \Exception $cause = null) { - assert('is_string($message)'); - assert('is_int($code)'); + assert(is_string($message)); + assert(is_int($code)); parent::__construct($message, $code); $this->initBacktrace($this); if ($cause !== null) { - $this->cause = SimpleSAML_Error_Exception::fromException($cause); + $this->cause = Exception::fromException($cause); } } /** - * Convert any exception into a SimpleSAML_Error_Exception. + * Convert any exception into a \SimpleSAML\Error\Exception. * - * @param Exception $e The exception. + * @param \Exception $e The exception. * - * @return SimpleSAML_Error_Exception The new exception. + * @return Exception The new exception. */ - public static function fromException(Exception $e) + public static function fromException(\Exception $e) { - - if ($e instanceof SimpleSAML_Error_Exception) { + if ($e instanceof Exception) { return $e; } - return new SimpleSAML_Error_UnserializableException($e); + return new UnserializableException($e); } /** * Load the backtrace from the given exception. * - * @param Exception $exception The exception we should fetch the backtrace from. + * @param \Exception $exception The exception we should fetch the backtrace from. */ - protected function initBacktrace(Exception $exception) + protected function initBacktrace(\Exception $exception) { - - $this->backtrace = array(); + $this->backtrace = []; // position in the top function on the stack $pos = $exception->getFile().':'.$exception->getLine(); foreach ($exception->getTrace() as $t) { - $function = $t['function']; if (array_key_exists('class', $t)) { $function = $t['class'].'::'.$function; @@ -120,7 +118,7 @@ public function getBacktrace() /** * Retrieve the cause of this exception. * - * @return SimpleSAML_Error_Exception|null The cause of this exception. + * @return Exception|null The cause of this exception. */ public function getCause() { @@ -150,9 +148,9 @@ public function getClass() */ public function format($anonymize = false) { - $ret = array( + $ret = [ $this->getClass().': '.$this->getMessage(), - ); + ]; return array_merge($ret, $this->formatBacktrace($anonymize)); } @@ -168,8 +166,8 @@ public function format($anonymize = false) */ public function formatBacktrace($anonymize = false) { - $ret = array(); - $basedir = SimpleSAML_Configuration::getInstance()->getBaseDir(); + $ret = []; + $basedir = \SimpleSAML\Configuration::getInstance()->getBaseDir(); $e = $this; do { @@ -199,25 +197,26 @@ public function formatBacktrace($anonymize = false) protected function logBacktrace($level = \SimpleSAML\Logger::DEBUG) { // see if debugging is enabled for backtraces - $debug = SimpleSAML_Configuration::getInstance()->getArrayize('debug', array('backtraces' => false)); + $debug = \SimpleSAML\Configuration::getInstance()->getArrayize('debug', ['backtraces' => false]); if (!(in_array('backtraces', $debug, true) // implicitly enabled - || (array_key_exists('backtraces', $debug) && $debug['backtraces'] === true) // explicitly set - // TODO: deprecate the old style and remove it in 2.0 - || (array_key_exists(0, $debug) && $debug[0] === true) // old style 'debug' configuration option + || (array_key_exists('backtraces', $debug) && $debug['backtraces'] === true) + // explicitly set + // TODO: deprecate the old style and remove it in 2.0 + || (array_key_exists(0, $debug) && $debug[0] === true) // old style 'debug' configuration option )) { return; } $backtrace = $this->formatBacktrace(); - $callback = array('\SimpleSAML\Logger'); - $functions = array( + $callback = ['\SimpleSAML\Logger']; + $functions = [ \SimpleSAML\Logger::ERR => 'error', \SimpleSAML\Logger::WARNING => 'warning', \SimpleSAML\Logger::INFO => 'info', \SimpleSAML\Logger::DEBUG => 'debug', - ); + ]; $callback[] = $functions[$level]; foreach ($backtrace as $line) { @@ -235,13 +234,13 @@ protected function logBacktrace($level = \SimpleSAML\Logger::DEBUG) */ public function log($default_level) { - $fn = array( - SimpleSAML\Logger::ERR => 'logError', - SimpleSAML\Logger::WARNING => 'logWarning', - SimpleSAML\Logger::INFO => 'logInfo', - SimpleSAML\Logger::DEBUG => 'logDebug', - ); - call_user_func(array($this, $fn[$default_level]), $default_level); + $fn = [ + \SimpleSAML\Logger::ERR => 'logError', + \SimpleSAML\Logger::WARNING => 'logWarning', + \SimpleSAML\Logger::INFO => 'logInfo', + \SimpleSAML\Logger::DEBUG => 'logDebug', + ]; + call_user_func([$this, $fn[$default_level]], $default_level); } @@ -252,7 +251,7 @@ public function log($default_level) */ public function logError() { - SimpleSAML\Logger::error($this->getClass().': '.$this->getMessage()); + \SimpleSAML\Logger::error($this->getClass().': '.$this->getMessage()); $this->logBacktrace(\SimpleSAML\Logger::ERR); } @@ -264,7 +263,7 @@ public function logError() */ public function logWarning() { - SimpleSAML\Logger::warning($this->getClass().': '.$this->getMessage()); + \SimpleSAML\Logger::warning($this->getClass().': '.$this->getMessage()); $this->logBacktrace(\SimpleSAML\Logger::WARNING); } @@ -276,7 +275,7 @@ public function logWarning() */ public function logInfo() { - SimpleSAML\Logger::info($this->getClass().': '.$this->getMessage()); + \SimpleSAML\Logger::info($this->getClass().': '.$this->getMessage()); $this->logBacktrace(\SimpleSAML\Logger::INFO); } @@ -288,7 +287,7 @@ public function logInfo() */ public function logDebug() { - SimpleSAML\Logger::debug($this->getClass().': '.$this->getMessage()); + \SimpleSAML\Logger::debug($this->getClass().': '.$this->getMessage()); $this->logBacktrace(\SimpleSAML\Logger::DEBUG); } @@ -303,7 +302,6 @@ public function logDebug() */ public function __sleep() { - $ret = array_keys((array) $this); foreach ($ret as $i => $e) { diff --git a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Error/InvalidCredential.php b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Error/InvalidCredential.php index 5a3f7d8a4f..98d3b85d7b 100644 --- a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Error/InvalidCredential.php +++ b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Error/InvalidCredential.php @@ -1,11 +1,15 @@ <?php + +namespace SimpleSAML\Error; + /** * Exception indicating wrong password given by user. - * + * * @author Thomas Graff <thomas.graff@uninett.no> * @package SimpleSAMLphp_base * */ -class SimpleSAML_Error_InvalidCredential extends SimpleSAML_Error_User{ - + +class InvalidCredential extends User +{ } diff --git a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Error/MetadataNotFound.php b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Error/MetadataNotFound.php index 467d039230..47636bc215 100644 --- a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Error/MetadataNotFound.php +++ b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Error/MetadataNotFound.php @@ -1,26 +1,28 @@ <?php +namespace SimpleSAML\Error; + /** * Error for missing metadata. * * @package SimpleSAMLphp */ -class SimpleSAML_Error_MetadataNotFound extends SimpleSAML_Error_Error { - - - /** - * Create the error - * - * @param string $entityId The entityID we were unable to locate. - */ - public function __construct($entityId) { - assert('is_string($entityId)'); - $this->includeTemplate = 'core:no_metadata.tpl.php'; - parent::__construct(array( - 'METADATANOTFOUND', - '%ENTITYID%' => htmlspecialchars(var_export($entityId, TRUE)) - )); - } +class MetadataNotFound extends Error +{ + /** + * Create the error + * + * @param string $entityId The entityID we were unable to locate. + */ + public function __construct($entityId) + { + assert(is_string($entityId)); + $this->includeTemplate = 'core:no_metadata.tpl.php'; + parent::__construct([ + 'METADATANOTFOUND', + '%ENTITYID%' => htmlspecialchars(var_export($entityId, true)) + ]); + } } diff --git a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Error/NoPassive.php b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Error/NoPassive.php index 8966dc8b52..43b42cf46b 100644 --- a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Error/NoPassive.php +++ b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Error/NoPassive.php @@ -1,14 +1,16 @@ <?php +namespace SimpleSAML\Error; /** - * Class SimpleSAML_Error_NoPassive + * Class NoPassive * * @deprecated This class has been deprecated and will be removed in SimpleSAMLphp 2.0. Please use - * SimpleSAML\Module\saml\Error\NoPassive instead. + * \SimpleSAML\Module\saml\Error\NoPassive instead. * * @see \SimpleSAML\Module\saml\Error\NoPassive */ -class SimpleSAML_Error_NoPassive extends SimpleSAML_Error_Exception { +class NoPassive extends Exception +{ } diff --git a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Error/NoState.php b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Error/NoState.php index 1c92da9272..d0281beb01 100644 --- a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Error/NoState.php +++ b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Error/NoState.php @@ -1,20 +1,22 @@ <?php +namespace SimpleSAML\Error; + /** * Exception which will show a page telling the user * that we don't know what to do. * * @package SimpleSAMLphp */ -class SimpleSAML_Error_NoState extends SimpleSAML_Error_Error { - - - /** - * Create the error - */ - public function __construct() { - $this->includeTemplate = 'core:no_state.tpl.php'; - parent::__construct('NOSTATE'); - } +class NoState extends Error +{ + /** + * Create the error + */ + public function __construct() + { + $this->includeTemplate = 'core:no_state.tpl.php'; + parent::__construct('NOSTATE'); + } } diff --git a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Error/NotFound.php b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Error/NotFound.php index 6c0dfd2d68..0e61852696 100644 --- a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Error/NotFound.php +++ b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Error/NotFound.php @@ -1,5 +1,7 @@ <?php +namespace SimpleSAML\Error; + /** * Exception which will show a 404 Not Found error page. * @@ -9,60 +11,62 @@ * @author Olav Morken, UNINETT AS. * @package SimpleSAMLphp */ -class SimpleSAML_Error_NotFound extends SimpleSAML_Error_Error { - - - /** - * Reason why the given page could not be found. - */ - private $reason; +class NotFound extends Error +{ + /** + * Reason why the given page could not be found. + */ + private $reason; - /** - * Create a new NotFound error - * - * @param string $reason Optional description of why the given page could not be found. - */ - public function __construct($reason = NULL) { - assert('is_null($reason) || is_string($reason)'); + /** + * Create a new NotFound error + * + * @param string $reason Optional description of why the given page could not be found. + */ + public function __construct($reason = null) + { + assert($reason === null || is_string($reason)); - $url = \SimpleSAML\Utils\HTTP::getSelfURL(); + $url = \SimpleSAML\Utils\HTTP::getSelfURL(); - if($reason === NULL) { - parent::__construct(array('NOTFOUND', '%URL%' => $url)); - $this->message = "The requested page '$url' could not be found."; - } else { - parent::__construct(array('NOTFOUNDREASON', '%URL%' => $url, '%REASON%' => $reason)); - $this->message = "The requested page '$url' could not be found. ".$reason; - } + if ($reason === null) { + parent::__construct(['NOTFOUND', '%URL%' => $url]); + $this->message = "The requested page '$url' could not be found."; + } else { + parent::__construct(['NOTFOUNDREASON', '%URL%' => $url, '%REASON%' => $reason]); + $this->message = "The requested page '$url' could not be found. ".$reason; + } - $this->reason = $reason; - $this->httpCode = 404; - } + $this->reason = $reason; + $this->httpCode = 404; + } - /** - * Retrieve the reason why the given page could not be found. - * - * @return string|NULL The reason why the page could not be found. - */ - public function getReason() { - return $this->reason; - } + /** + * Retrieve the reason why the given page could not be found. + * + * @return string|null The reason why the page could not be found. + */ + public function getReason() + { + return $this->reason; + } - /** - * NotFound exceptions don't need to display a backtrace, as they are very simple and the trace is usually trivial, - * so just log the message without any backtrace at all. - * - * @param bool $anonymize Whether to anonymize the trace or not. - * - * @return array - */ - public function format($anonymize = false) { - return array( - $this->getClass().': '.$this->getMessage(), - ); - } + /** + * NotFound exceptions don't need to display a backtrace, as they are very simple and the trace is usually trivial, + * so just log the message without any backtrace at all. + * + * @param bool $anonymize Whether to anonymize the trace or not. + * + * @return array + */ + public function format($anonymize = false) + { + return [ + $this->getClass().': '.$this->getMessage(), + ]; + } } diff --git a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Error/ProxyCountExceeded.php b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Error/ProxyCountExceeded.php index 0af64d51e7..6b325f3b61 100644 --- a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Error/ProxyCountExceeded.php +++ b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Error/ProxyCountExceeded.php @@ -1,14 +1,16 @@ <?php +namespace SimpleSAML\Error; /** - * Class SimpleSAML_Error_ProxyCountExceeded + * Class ProxyCountExceeded * * @deprecated This class has been deprecated and will be removed in SimpleSAMLphp 2.0. Please use - * SimpleSAML\Module\saml\Error\ProxyCountExceeded instead. + * \SimpleSAML\Module\saml\Error\ProxyCountExceeded instead. * * @see \SimpleSAML\Module\saml\Error\ProxyCountExceeded */ -class SimpleSAML_Error_ProxyCountExceeded extends SimpleSAML_Error_Exception { +class ProxyCountExceeded extends Exception +{ } diff --git a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Error/UnserializableException.php b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Error/UnserializableException.php index 6c55bece13..54f4eb34fe 100644 --- a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Error/UnserializableException.php +++ b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Error/UnserializableException.php @@ -1,55 +1,59 @@ <?php +namespace SimpleSAML\Error; + /** * Class for saving normal exceptions for serialization. * - * This class is used by the SimpleSAML_Auth_State class when it needs + * This class is used by the \SimpleSAML\Auth\State class when it needs * to serialize an exception which doesn't subclass the - * SimpleSAML_Error_Exception class. + * \SimpleSAML\Error\Exception class. * * It creates a new exception which contains the backtrace and message * of the original exception. * * @package SimpleSAMLphp */ -class SimpleSAML_Error_UnserializableException extends SimpleSAML_Error_Exception { - - /** - * The classname of the original exception. - * - * @var string - */ - private $class; - - - /** - * Create a serializable exception representing an unserializable exception. - * - * @param Exception $original The original exception. - */ - public function __construct(Exception $original) { - - $this->class = get_class($original); - $msg = $original->getMessage(); - $code = $original->getCode(); - - if (!is_int($code)) { - // PDOException uses a string as the code. Filter it out here. - $code = -1; - } - - parent::__construct($msg, $code); - $this->initBacktrace($original); - } - - - /** - * Retrieve the class of this exception. - * - * @return string The classname. - */ - public function getClass() { - return $this->class; - } +class UnserializableException extends Exception +{ + /** + * The classname of the original exception. + * + * @var string + */ + private $class; + + + /** + * Create a serializable exception representing an unserializable exception. + * + * @param \Exception $original The original exception. + */ + public function __construct(\Exception $original) + { + + $this->class = get_class($original); + $msg = $original->getMessage(); + $code = $original->getCode(); + + if (!is_int($code)) { + // PDOException uses a string as the code. Filter it out here. + $code = -1; + } + + parent::__construct($msg, $code); + $this->initBacktrace($original); + } + + + /** + * Retrieve the class of this exception. + * + * @return string The classname. + */ + public function getClass() + { + return $this->class; + } } diff --git a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Error/User.php b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Error/User.php index 2f674be18f..b2da0e47e1 100644 --- a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Error/User.php +++ b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Error/User.php @@ -1,13 +1,16 @@ <?php +namespace SimpleSAML\Error; + /** * Baseclass for user error exceptions - * - * + * + * * @author Thomas Graff <thomas.graff@uninett.no> * @package SimpleSAMLphp_base * */ -class SimpleSAML_Error_User extends SimpleSAML_Error_Exception{ - + +class User extends Exception +{ } diff --git a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Error/UserAborted.php b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Error/UserAborted.php index 6bd2762afa..7be00d20ee 100644 --- a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Error/UserAborted.php +++ b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Error/UserAborted.php @@ -1,19 +1,22 @@ <?php +namespace SimpleSAML\Error; + /** * Exception indicating user aborting the authentication process. * * @package SimpleSAMLphp */ -class SimpleSAML_Error_UserAborted extends SimpleSAML_Error_Error { - - /** - * Create the error - * - * @param Exception|NULL $cause The exception that caused this error. - */ - public function __construct(Exception $cause = NULL) { - parent::__construct('USERABORTED', $cause); - } +class UserAborted extends Error +{ + /** + * Create the error + * + * @param \Exception|null $cause The exception that caused this error. + */ + public function __construct(\Exception $cause = null) + { + parent::__construct('USERABORTED', $cause); + } } diff --git a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Error/UserNotFound.php b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Error/UserNotFound.php index c536f72430..14e5507864 100644 --- a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Error/UserNotFound.php +++ b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Error/UserNotFound.php @@ -1,12 +1,15 @@ <?php +namespace SimpleSAML\Error; + /** * Exception indicating user not found by authsource. - * + * * @author Thomas Graff <thomas.graff@uninett.no> * @package SimpleSAMLphp_base * */ -class SimpleSAML_Error_UserNotFound extends SimpleSAML_Error_User{ - + +class UserNotFound extends User +{ } diff --git a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/HTTP/Router.php b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/HTTP/Router.php new file mode 100644 index 0000000000..e537092a9e --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/HTTP/Router.php @@ -0,0 +1,127 @@ +<?php + +namespace SimpleSAML\HTTP; + +use SimpleSAML\Configuration; +use SimpleSAML\Session; + +use Symfony\Component\EventDispatcher\EventDispatcher; +use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\HttpFoundation\RequestStack; +use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\HttpKernel\Controller\ArgumentResolver; +use Symfony\Component\HttpKernel\HttpKernel; +use Symfony\Component\Routing\RequestContext; + +/** + * Class that routes requests to responses. + * + * @package SimpleSAML + */ +class Router +{ + + protected $arguments; + + /** @var \SimpleSAML\Configuration */ + protected $config; + + /** @var RequestContext */ + protected $context; + + /** @var EventDispatcher */ + protected $dispatcher; + + /** @var Request */ + protected $request; + + /** @var \SimpleSAML\Module\ControllerResolver */ + protected $resolver; + + /** @var \SimpleSAML\Session */ + protected $session; + + /** @var RequestStack */ + protected $stack; + + + /** + * Router constructor. + * + * @param string $module + */ + public function __construct($module) + { + $this->arguments = new ArgumentResolver(); + $this->context = new RequestContext(); + $this->resolver = new \SimpleSAML\Module\ControllerResolver($module); + $this->dispatcher = new EventDispatcher(); + } + + + /** + * Process a given request. + * + * If no specific arguments are given, the default instances will be used (configuration, session, etc). + * + * @param Request|null $request The request to process. Defaults to the current one. + * + * @return Response A response suitable for the given request. + * + * @throws \Exception If an error occurs. + */ + public function process(Request $request = null) + { + if ($this->config === null) { + $this->setConfiguration(Configuration::getInstance()); + } + if ($this->session === null) { + $this->setSession(Session::getSessionFromRequest()); + } + $this->request = $request; + if ($request === null) { + $this->request = Request::createFromGlobals(); + } + $stack = new RequestStack(); + $stack->push($this->request); + $this->context->fromRequest($this->request); + $kernel = new HttpKernel($this->dispatcher, $this->resolver, $stack, $this->resolver); + return $kernel->handle($this->request); + } + + + /** + * Send a given response to the browser. + * + * @param Response $response The response to send. + */ + public function send(Response $response) + { + $response->prepare($this->request); + $response->send(); + } + + + /** + * Set the configuration to use by the controller. + * + * @param \SimpleSAML\Configuration $config + */ + public function setConfiguration(Configuration $config) + { + $this->config = $config; + $this->resolver->setConfiguration($config); + } + + + /** + * Set the session to use by the controller. + * + * @param \SimpleSAML\Session $session + */ + public function setSession(Session $session) + { + $this->session = $session; + $this->resolver->setSession($session); + } +} diff --git a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/HTTP/RunnableResponse.php b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/HTTP/RunnableResponse.php new file mode 100644 index 0000000000..ab9fc6c5f1 --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/HTTP/RunnableResponse.php @@ -0,0 +1,69 @@ +<?php + +namespace SimpleSAML\HTTP; + +use Symfony\Component\HttpFoundation\Response; + +/** + * Class modelling a response that consists on running some function. + * + * This is a helper class that allows us to have the new and the old architecture coexist. This way, classes and files + * that aren't PSR-7-aware can still be plugged into a PSR-7-compatible environment. + * + * @package SimpleSAML + */ +class RunnableResponse extends Response +{ + /** @var array */ + protected $arguments; + + /** @var callable */ + protected $callable; + + + /** + * RunnableResponse constructor. + * + * @param callable $callable A callable that we should run as part of this response. + * @param array $args An array of arguments to be passed to the callable. Note that each element of the array + */ + public function __construct(callable $callable, $args = []) + { + $this->arguments = $args; + $this->callable = $callable; + parent::__construct(); + } + + + /** + * Get the callable for this response. + * + * @return callable + */ + public function getCallable() + { + return $this->callable; + } + + + /** + * Get the arguments to the callable. + * + * @return array + */ + public function getArguments() + { + return $this->arguments; + } + + + /** + * "Send" this response by actually running the callable. + * + * @return mixed + */ + public function send() + { + return call_user_func_array($this->callable, $this->arguments); + } +} diff --git a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/IdP.php b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/IdP.php index 7fa5fed3f4..8c7f219926 100644 --- a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/IdP.php +++ b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/IdP.php @@ -1,5 +1,10 @@ <?php +namespace SimpleSAML; + +use SAML2\Constants as SAML2; + +use SimpleSAML\Error\Exception; /** * IdP class. @@ -8,16 +13,15 @@ * * @package SimpleSAMLphp */ -class SimpleSAML_IdP -{ +class IdP +{ /** * A cache for resolving IdP id's. * * @var array */ - private static $idpCache = array(); - + private static $idpCache = []; /** * The identifier for this IdP. @@ -26,7 +30,6 @@ class SimpleSAML_IdP */ private $id; - /** * The "association group" for this IdP. * @@ -37,52 +40,49 @@ class SimpleSAML_IdP */ private $associationGroup; - /** * The configuration for this IdP. * - * @var SimpleSAML_Configuration + * @var Configuration */ private $config; - /** * Our authsource. * - * @var \SimpleSAML\Auth\Simple + * @var Auth\Simple */ private $authSource; - /** * Initialize an IdP. * * @param string $id The identifier of this IdP. * - * @throws SimpleSAML_Error_Exception If the IdP is disabled or no such auth source was found. + * @throws Exception If the IdP is disabled or no such auth source was found. */ private function __construct($id) { - assert('is_string($id)'); + assert(is_string($id)); $this->id = $id; - $metadata = SimpleSAML_Metadata_MetaDataStorageHandler::getMetadataHandler(); - $globalConfig = SimpleSAML_Configuration::getInstance(); + $metadata = Metadata\MetaDataStorageHandler::getMetadataHandler(); + $globalConfig = Configuration::getInstance(); if (substr($id, 0, 6) === 'saml2:') { if (!$globalConfig->getBoolean('enable.saml20-idp', false)) { - throw new SimpleSAML_Error_Exception('enable.saml20-idp disabled in config.php.'); + throw new Exception('enable.saml20-idp disabled in config.php.'); } $this->config = $metadata->getMetaDataConfig(substr($id, 6), 'saml20-idp-hosted'); } elseif (substr($id, 0, 6) === 'saml1:') { if (!$globalConfig->getBoolean('enable.shib13-idp', false)) { - throw new SimpleSAML_Error_Exception('enable.shib13-idp disabled in config.php.'); + throw new Exception('enable.shib13-idp disabled in config.php.'); } $this->config = $metadata->getMetaDataConfig(substr($id, 6), 'shib13-idp-hosted'); } elseif (substr($id, 0, 5) === 'adfs:') { if (!$globalConfig->getBoolean('enable.adfs-idp', false)) { - throw new SimpleSAML_Error_Exception('enable.adfs-idp disabled in config.php.'); + throw new Exception('enable.adfs-idp disabled in config.php.'); } $this->config = $metadata->getMetaDataConfig(substr($id, 5), 'adfs-idp-hosted'); @@ -90,7 +90,7 @@ private function __construct($id) // this makes the ADFS IdP use the same SP associations as the SAML 2.0 IdP $saml2EntityId = $metadata->getMetaDataCurrentEntityID('saml20-idp-hosted'); $this->associationGroup = 'saml2:'.$saml2EntityId; - } catch (Exception $e) { + } catch (\Exception $e) { // probably no SAML 2 IdP configured for this host. Ignore the error } } else { @@ -102,10 +102,10 @@ private function __construct($id) } $auth = $this->config->getString('auth'); - if (SimpleSAML_Auth_Source::getById($auth) !== null) { - $this->authSource = new \SimpleSAML\Auth\Simple($auth); + if (Auth\Source::getById($auth) !== null) { + $this->authSource = new Auth\Simple($auth); } else { - throw new SimpleSAML_Error_Exception('No such "'.$auth.'" auth source found.'); + throw new Exception('No such "'.$auth.'" auth source found.'); } } @@ -126,11 +126,11 @@ public function getId() * * @param string $id The identifier of the IdP. * - * @return SimpleSAML_IdP The IdP. + * @return IdP The IdP. */ public static function getById($id) { - assert('is_string($id)'); + assert(is_string($id)); if (isset(self::$idpCache[$id])) { return self::$idpCache[$id]; @@ -147,11 +147,11 @@ public static function getById($id) * * @param array &$state The state array. * - * @return SimpleSAML_IdP The IdP. + * @return IdP The IdP. */ public static function getByState(array &$state) { - assert('isset($state["core:IdP"])'); + assert(isset($state['core:IdP'])); return self::getById($state['core:IdP']); } @@ -160,7 +160,7 @@ public static function getByState(array &$state) /** * Retrieve the configuration for this IdP. * - * @return SimpleSAML_Configuration The configuration object. + * @return Configuration The configuration object. */ public function getConfig() { @@ -177,19 +177,19 @@ public function getConfig() */ public function getSPName($assocId) { - assert('is_string($assocId)'); + assert(is_string($assocId)); $prefix = substr($assocId, 0, 4); $spEntityId = substr($assocId, strlen($prefix) + 1); - $metadata = SimpleSAML_Metadata_MetaDataStorageHandler::getMetadataHandler(); + $metadata = Metadata\MetaDataStorageHandler::getMetadataHandler(); if ($prefix === 'saml') { try { $spMetadata = $metadata->getMetaDataConfig($spEntityId, 'saml20-sp-remote'); - } catch (Exception $e) { + } catch (\Exception $e) { try { $spMetadata = $metadata->getMetaDataConfig($spEntityId, 'shib13-sp-remote'); - } catch (Exception $e) { + } catch (\Exception $e) { return null; } } @@ -206,7 +206,7 @@ public function getSPName($assocId) } elseif ($spMetadata->hasValue('OrganizationDisplayName')) { return $spMetadata->getLocalizedString('OrganizationDisplayName'); } else { - return array('en' => $spEntityId); + return ['en' => $spEntityId]; } } @@ -218,12 +218,12 @@ public function getSPName($assocId) */ public function addAssociation(array $association) { - assert('isset($association["id"])'); - assert('isset($association["Handler"])'); + assert(isset($association['id'])); + assert(isset($association['Handler'])); $association['core:IdP'] = $this->id; - $session = SimpleSAML_Session::getSessionFromRequest(); + $session = Session::getSessionFromRequest(); $session->addAssociation($this->associationGroup, $association); } @@ -235,7 +235,7 @@ public function addAssociation(array $association) */ public function getAssociations() { - $session = SimpleSAML_Session::getSessionFromRequest(); + $session = Session::getSessionFromRequest(); return $session->getAssociations($this->associationGroup); } @@ -247,9 +247,9 @@ public function getAssociations() */ public function terminateAssociation($assocId) { - assert('is_string($assocId)'); + assert(is_string($assocId)); - $session = SimpleSAML_Session::getSessionFromRequest(); + $session = Session::getSessionFromRequest(); $session->terminateAssociation($this->associationGroup, $assocId); } @@ -272,20 +272,20 @@ public function isAuthenticated() */ public static function postAuthProc(array $state) { - assert('is_callable($state["Responder"])'); + assert(is_callable($state['Responder'])); if (isset($state['core:SP'])) { - $session = SimpleSAML_Session::getSessionFromRequest(); + $session = \SimpleSAML\Session::getSessionFromRequest(); $session->setData( 'core:idp-ssotime', $state['core:IdP'].';'.$state['core:SP'], time(), - SimpleSAML_Session::DATA_TIMEOUT_SESSION_END + Session::DATA_TIMEOUT_SESSION_END ); } call_user_func($state['Responder'], $state); - assert('FALSE'); + assert(false); } @@ -294,14 +294,14 @@ public static function postAuthProc(array $state) * * @param array $state The authentication request state array. * - * @throws SimpleSAML_Error_Exception If we are not authenticated. + * @throws Exception If we are not authenticated. */ public static function postAuth(array $state) { - $idp = SimpleSAML_IdP::getByState($state); + $idp = IdP::getByState($state); if (!$idp->isAuthenticated()) { - throw new SimpleSAML_Error_Exception('Not authenticated.'); + throw new Exception('Not authenticated.'); } $state['Attributes'] = $idp->authSource->getAttributes(); @@ -309,11 +309,11 @@ public static function postAuth(array $state) if (isset($state['SPMetadata'])) { $spMetadata = $state['SPMetadata']; } else { - $spMetadata = array(); + $spMetadata = []; } if (isset($state['core:SP'])) { - $session = SimpleSAML_Session::getSessionFromRequest(); + $session = Session::getSessionFromRequest(); $previousSSOTime = $session->getData('core:idp-ssotime', $state['core:IdP'].';'.$state['core:SP']); if ($previousSSOTime !== null) { $state['PreviousSSOTimestamp'] = $previousSSOTime; @@ -322,9 +322,9 @@ public static function postAuth(array $state) $idpMetadata = $idp->getConfig()->toArray(); - $pc = new SimpleSAML_Auth_ProcessingChain($idpMetadata, $spMetadata, 'idp'); + $pc = new Auth\ProcessingChain($idpMetadata, $spMetadata, 'idp'); - $state['ReturnCall'] = array('SimpleSAML_IdP', 'postAuthProc'); + $state['ReturnCall'] = ['\SimpleSAML\IdP', 'postAuthProc']; $state['Destination'] = $spMetadata; $state['Source'] = $idpMetadata; @@ -341,12 +341,12 @@ public static function postAuth(array $state) * * @param array &$state The authentication request state. * - * @throws SimpleSAML_Error_NoPassive If we were asked to do passive authentication. + * @throws Module\saml\Error\NoPassive If we were asked to do passive authentication. */ private function authenticate(array &$state) { if (isset($state['isPassive']) && (bool) $state['isPassive']) { - throw new SimpleSAML_Error_NoPassive('Passive authentication not supported.'); + throw new Module\saml\Error\NoPassive(SAML2::STATUS_RESPONDER, 'Passive authentication not supported.'); } $this->authSource->login($state); @@ -363,13 +363,13 @@ private function authenticate(array &$state) * * @param array &$state The authentication request state. * - * @throws SimpleSAML_Error_Exception If there is no auth source defined for this IdP. + * @throws Exception If there is no auth source defined for this IdP. */ private function reauthenticate(array &$state) { $sourceImpl = $this->authSource->getAuthSource(); if ($sourceImpl === null) { - throw new SimpleSAML_Error_Exception('No such auth source defined.'); + throw new Exception('No such auth source defined.'); } $sourceImpl->reauthenticate($state); @@ -383,7 +383,7 @@ private function reauthenticate(array &$state) */ public function handleAuthenticationRequest(array &$state) { - assert('isset($state["Responder"])'); + assert(isset($state['Responder'])); $state['core:IdP'] = $this->id; @@ -405,21 +405,21 @@ public function handleAuthenticationRequest(array &$state) } $state['IdPMetadata'] = $this->getConfig()->toArray(); - $state['ReturnCallback'] = array('SimpleSAML_IdP', 'postAuth'); + $state['ReturnCallback'] = ['\SimpleSAML\IdP', 'postAuth']; try { if ($needAuth) { $this->authenticate($state); - assert('FALSE'); + assert(false); } else { $this->reauthenticate($state); } $this->postAuth($state); - } catch (SimpleSAML_Error_Exception $e) { - SimpleSAML_Auth_State::throwException($state, $e); } catch (Exception $e) { - $e = new SimpleSAML_Error_UnserializableException($e); - SimpleSAML_Auth_State::throwException($state, $e); + \SimpleSAML\Auth\State::throwException($state, $e); + } catch (\Exception $e) { + $e = new Error\UnserializableException($e); + Auth\State::throwException($state, $e); } } @@ -427,9 +427,9 @@ public function handleAuthenticationRequest(array &$state) /** * Find the logout handler of this IdP. * - * @return \SimpleSAML\IdP\LogoutHandlerInterface The logout handler class. + * @return IdP\LogoutHandlerInterface The logout handler class. * - * @throws SimpleSAML_Error_Exception If we cannot find a logout handler. + * @throws Exception If we cannot find a logout handler. */ public function getLogoutHandler() { @@ -437,13 +437,13 @@ public function getLogoutHandler() $logouttype = $this->getConfig()->getString('logouttype', 'traditional'); switch ($logouttype) { case 'traditional': - $handler = 'SimpleSAML\IdP\TraditionalLogoutHandler'; + $handler = '\SimpleSAML\IdP\TraditionalLogoutHandler'; break; case 'iframe': - $handler = 'SimpleSAML\IdP\IFrameLogoutHandler'; + $handler = '\SimpleSAML\IdP\IFrameLogoutHandler'; break; default: - throw new SimpleSAML_Error_Exception('Unknown logout handler: '.var_export($logouttype, true)); + throw new Exception('Unknown logout handler: '.var_export($logouttype, true)); } return new $handler($this); @@ -459,11 +459,11 @@ public function getLogoutHandler() */ public function finishLogout(array &$state) { - assert('isset($state["Responder"])'); + assert(isset($state['Responder'])); - $idp = SimpleSAML_IdP::getByState($state); + $idp = IdP::getByState($state); call_user_func($state['Responder'], $idp, $state); - assert('false'); + assert(false); } @@ -478,27 +478,27 @@ public function finishLogout(array &$state) */ public function handleLogoutRequest(array &$state, $assocId) { - assert('isset($state["Responder"])'); - assert('is_string($assocId) || is_null($assocId)'); + assert(isset($state['Responder'])); + assert(is_string($assocId) || $assocId === null); $state['core:IdP'] = $this->id; $state['core:TerminatedAssocId'] = $assocId; if ($assocId !== null) { $this->terminateAssociation($assocId); - $session = SimpleSAML_Session::getSessionFromRequest(); - $session->deleteData('core:idp-ssotime', $this->id.':'.$state['saml:SPEntityId']); + $session = Session::getSessionFromRequest(); + $session->deleteData('core:idp-ssotime', $this->id.';'.$state['saml:SPEntityId']); } // terminate the local session - $id = SimpleSAML_Auth_State::saveState($state, 'core:Logout:afterbridge'); - $returnTo = SimpleSAML\Module::getModuleURL('core/idp/resumelogout.php', array('id' => $id)); + $id = Auth\State::saveState($state, 'core:Logout:afterbridge'); + $returnTo = Module::getModuleURL('core/idp/resumelogout.php', ['id' => $id]); $this->authSource->logout($returnTo); $handler = $this->getLogoutHandler(); $handler->startLogout($state, $assocId); - assert('false'); + assert(false); } @@ -507,22 +507,22 @@ public function handleLogoutRequest(array &$state, $assocId) * * This function will never return. * - * @param string $assocId The association that is terminated. - * @param string|null $relayState The RelayState from the start of the logout. - * @param SimpleSAML_Error_Exception|null $error The error that occurred during session termination (if any). + * @param string $assocId The association that is terminated. + * @param string|null $relayState The RelayState from the start of the logout. + * @param Exception|null $error The error that occurred during session termination (if any). */ - public function handleLogoutResponse($assocId, $relayState, SimpleSAML_Error_Exception $error = null) + public function handleLogoutResponse($assocId, $relayState, Exception $error = null) { - assert('is_string($assocId)'); - assert('is_string($relayState) || is_null($relayState)'); + assert(is_string($assocId)); + assert(is_string($relayState) || $relayState === null); - $session = SimpleSAML_Session::getSessionFromRequest(); + $session = Session::getSessionFromRequest(); $session->deleteData('core:idp-ssotime', $this->id.';'.substr($assocId, strpos($assocId, ':') + 1)); $handler = $this->getLogoutHandler(); $handler->onResponse($assocId, $relayState, $error); - assert('false'); + assert(false); } @@ -535,15 +535,15 @@ public function handleLogoutResponse($assocId, $relayState, SimpleSAML_Error_Exc */ public function doLogoutRedirect($url) { - assert('is_string($url)'); + assert(is_string($url)); - $state = array( - 'Responder' => array('SimpleSAML_IdP', 'finishLogoutRedirect'), + $state = [ + 'Responder' => ['\SimpleSAML\IdP', 'finishLogoutRedirect'], 'core:Logout:URL' => $url, - ); + ]; $this->handleLogoutRequest($state, null); - assert('false'); + assert(false); } @@ -552,14 +552,14 @@ public function doLogoutRedirect($url) * * This function never returns. * - * @param SimpleSAML_IdP $idp Deprecated. Will be removed. - * @param array &$state The logout state from doLogoutRedirect(). + * @param IdP $idp Deprecated. Will be removed. + * @param array &$state The logout state from doLogoutRedirect(). */ - public static function finishLogoutRedirect(SimpleSAML_IdP $idp, array $state) + public static function finishLogoutRedirect(IdP $idp, array $state) { - assert('isset($state["core:Logout:URL"])'); + assert(isset($state['core:Logout:URL'])); - \SimpleSAML\Utils\HTTP::redirectTrustedURL($state['core:Logout:URL']); - assert('false'); + Utils\HTTP::redirectTrustedURL($state['core:Logout:URL']); + assert(false); } } diff --git a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/IdP/IFrameLogoutHandler.php b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/IdP/IFrameLogoutHandler.php index e14e86bd3d..df84a413b5 100644 --- a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/IdP/IFrameLogoutHandler.php +++ b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/IdP/IFrameLogoutHandler.php @@ -2,32 +2,32 @@ namespace SimpleSAML\IdP; +use SimpleSAML\Configuration; use SimpleSAML\Module; use SimpleSAML\Utils\HTTP; - +use SimpleSAML\XHTML\Template; /** * Class that handles iframe logout. * * @package SimpleSAMLphp */ + class IFrameLogoutHandler implements LogoutHandlerInterface { - /** * The IdP we are logging out from. * - * @var \SimpleSAML_IdP + * @var \SimpleSAML\IdP */ private $idp; - /** * LogoutIFrame constructor. * - * @param \SimpleSAML_IdP $idp The IdP to log out from. + * @param \SimpleSAML\IdP $idp The IdP to log out from. */ - public function __construct(\SimpleSAML_IdP $idp) + public function __construct(\SimpleSAML\IdP $idp) { $this->idp = $idp; } @@ -40,7 +40,7 @@ public function __construct(\SimpleSAML_IdP $idp) */ public function startLogout(array &$state, $assocId) { - assert('is_string($assocId) || is_null($assocId)'); + assert(is_string($assocId) || $assocId === null); $associations = $this->idp->getAssociations(); @@ -49,7 +49,7 @@ public function startLogout(array &$state, $assocId) } foreach ($associations as $id => &$association) { - $idp = \SimpleSAML_IdP::getByState($association); + $idp = \SimpleSAML\IdP::getByState($association); $association['core:Logout-IFrame:Name'] = $idp->getSPName($id); $association['core:Logout-IFrame:State'] = 'onhold'; } @@ -58,7 +58,7 @@ public function startLogout(array &$state, $assocId) if (!is_null($assocId)) { $spName = $this->idp->getSPName($assocId); if ($spName === null) { - $spName = array('en' => $assocId); + $spName = ['en' => $assocId]; } $state['core:Logout-IFrame:From'] = $spName; @@ -66,9 +66,9 @@ public function startLogout(array &$state, $assocId) $state['core:Logout-IFrame:From'] = null; } - $params = array( - 'id' => \SimpleSAML_Auth_State::saveState($state, 'core:Logout-IFrame'), - ); + $params = [ + 'id' => \SimpleSAML\Auth\State::saveState($state, 'core:Logout-IFrame'), + ]; if (isset($state['core:Logout-IFrame:InitType'])) { $params['type'] = $state['core:Logout-IFrame:InitType']; } @@ -85,36 +85,23 @@ public function startLogout(array &$state, $assocId) * * @param string $assocId The association that is terminated. * @param string|null $relayState The RelayState from the start of the logout. - * @param \SimpleSAML_Error_Exception|null $error The error that occurred during session termination (if any). + * @param \SimpleSAML\Error\Exception|null $error The error that occurred during session termination (if any). */ - public function onResponse($assocId, $relayState, \SimpleSAML_Error_Exception $error = null) + public function onResponse($assocId, $relayState, \SimpleSAML\Error\Exception $error = null) { - assert('is_string($assocId)'); + assert(is_string($assocId)); - $spId = sha1($assocId); $this->idp->terminateAssociation($assocId); - $header = <<<HEADER -<!DOCTYPE html> -<html> - <head> - <title>Logout response from %s</title> - <script> -HEADER; - printf($header, htmlspecialchars(var_export($assocId, true))); - if ($error) { - $errorMsg = $error->getMessage(); - echo('window.parent.logoutFailed("'.$spId.'", "'.addslashes($errorMsg).'");'); - } else { - echo('window.parent.logoutCompleted("'.$spId.'");'); + $config = Configuration::getInstance(); + + $t = new Template($config, 'IFrameLogoutHandler.tpl.php'); + $t->data['assocId'] = var_export($assocId, true); + $t->data['spId'] = sha1($assocId); + if (!is_null($error)) { + $t->data['errorMsg'] = $error->getMessage(); } - echo <<<FOOTER - </script> - </head> - <body> - </body> -</html> -FOOTER; - exit(0); + + $t->show(); } } diff --git a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/IdP/LogoutHandlerInterface.php b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/IdP/LogoutHandlerInterface.php index 11589f3d0f..773bda6947 100644 --- a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/IdP/LogoutHandlerInterface.php +++ b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/IdP/LogoutHandlerInterface.php @@ -2,22 +2,20 @@ namespace SimpleSAML\IdP; - /** * Interface that all logout handlers must implement. * * @package SimpleSAMLphp */ + interface LogoutHandlerInterface { - - /** * Initialize this logout handler. * - * @param \SimpleSAML_IdP $idp The IdP we are logging out from. + * @param \SimpleSAML\IdP $idp The IdP we are logging out from. */ - public function __construct(\SimpleSAML_IdP $idp); + public function __construct(\SimpleSAML\IdP $idp); /** @@ -38,7 +36,7 @@ public function startLogout(array &$state, $assocId); * * @param string $assocId The association that is terminated. * @param string|null $relayState The RelayState from the start of the logout. - * @param \SimpleSAML_Error_Exception|null $error The error that occurred during session termination (if any). + * @param \SimpleSAML\Error\Exception|null $error The error that occurred during session termination (if any). */ - public function onResponse($assocId, $relayState, \SimpleSAML_Error_Exception $error = null); + public function onResponse($assocId, $relayState, \SimpleSAML\Error\Exception $error = null); } diff --git a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/IdP/TraditionalLogoutHandler.php b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/IdP/TraditionalLogoutHandler.php index 534b088734..32652b5617 100644 --- a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/IdP/TraditionalLogoutHandler.php +++ b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/IdP/TraditionalLogoutHandler.php @@ -5,19 +5,18 @@ use SimpleSAML\Logger; use SimpleSAML\Utils\HTTP; - /** * Class that handles traditional logout. * * @package SimpleSAMLphp */ + class TraditionalLogoutHandler implements LogoutHandlerInterface { - /** * The IdP we are logging out from. * - * @var \SimpleSAML_IdP + * @var \SimpleSAML\IdP */ private $idp; @@ -25,9 +24,9 @@ class TraditionalLogoutHandler implements LogoutHandlerInterface /** * TraditionalLogout constructor. * - * @param \SimpleSAML_IdP $idp The IdP to log out from. + * @param \SimpleSAML\IdP $idp The IdP to log out from. */ - public function __construct(\SimpleSAML_IdP $idp) + public function __construct(\SimpleSAML\IdP $idp) { $this->idp = $idp; } @@ -47,14 +46,14 @@ private function logoutNextSP(array &$state) $this->idp->finishLogout($state); } - $relayState = \SimpleSAML_Auth_State::saveState($state, 'core:LogoutTraditional', true); + $relayState = \SimpleSAML\Auth\State::saveState($state, 'core:LogoutTraditional', true); $id = $association['id']; Logger::info('Logging out of '.var_export($id, true).'.'); try { - $idp = \SimpleSAML_IdP::getByState($association); - $url = call_user_func(array($association['Handler'], 'getLogoutURL'), $idp, $association, $relayState); + $idp = \SimpleSAML\IdP::getByState($association); + $url = call_user_func([$association['Handler'], 'getLogoutURL'], $idp, $association, $relayState); HTTP::redirectTrustedURL($url); } catch (\Exception $e) { Logger::warning('Unable to initialize logout to '.var_export($id, true).'.'); @@ -63,7 +62,7 @@ private function logoutNextSP(array &$state) // Try the next SP $this->logoutNextSP($state); - assert('FALSE'); + assert(false); } } @@ -80,7 +79,7 @@ public function startLogout(array &$state, $assocId) { $state['core:LogoutTraditional:Remaining'] = $this->idp->getAssociations(); - self::logoutNextSP($state); + $this->logoutNextSP($state); } @@ -91,20 +90,20 @@ public function startLogout(array &$state, $assocId) * * @param string $assocId The association that is terminated. * @param string|null $relayState The RelayState from the start of the logout. - * @param \SimpleSAML_Error_Exception|null $error The error that occurred during session termination (if any). + * @param \SimpleSAML\Error\Exception|null $error The error that occurred during session termination (if any). * - * @throws \SimpleSAML_Error_Exception If the RelayState was lost during logout. + * @throws \SimpleSAML\Error\Exception If the RelayState was lost during logout. */ - public function onResponse($assocId, $relayState, \SimpleSAML_Error_Exception $error = null) + public function onResponse($assocId, $relayState, \SimpleSAML\Error\Exception $error = null) { - assert('is_string($assocId)'); - assert('is_string($relayState) || is_null($relayState)'); + assert(is_string($assocId)); + assert(is_string($relayState) || $relayState === null); if ($relayState === null) { - throw new \SimpleSAML_Error_Exception('RelayState lost during logout.'); + throw new \SimpleSAML\Error\Exception('RelayState lost during logout.'); } - $state = \SimpleSAML_Auth_State::loadState($relayState, 'core:LogoutTraditional'); + $state = \SimpleSAML\Auth\State::loadState($relayState, 'core:LogoutTraditional'); if ($error === null) { Logger::info('Logged out of '.var_export($assocId, true).'.'); @@ -115,6 +114,6 @@ public function onResponse($assocId, $relayState, \SimpleSAML_Error_Exception $e $state['core:Failed'] = true; } - self::logoutNextSP($state); + $this->logoutNextSP($state); } } diff --git a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Locale/Language.php b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Locale/Language.php index edb7267c3c..858dad86ce 100644 --- a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Locale/Language.php +++ b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Locale/Language.php @@ -18,12 +18,12 @@ class Language /** * This is the default language map. It is used to map languages codes from the user agent to other language codes. */ - private static $defaultLanguageMap = array('nb' => 'no'); + private static $defaultLanguageMap = ['nb' => 'no']; /** * The configuration to use. * - * @var \SimpleSAML_Configuration + * @var \SimpleSAML\Configuration */ private $configuration; @@ -77,7 +77,7 @@ class Language * * @var array */ - private $language_names = array( + private $language_names = [ 'no' => 'Bokmål', // Norwegian Bokmål 'nn' => 'Nynorsk', // Norwegian Nynorsk 'se' => 'Sámegiella', // Northern Sami @@ -88,6 +88,7 @@ class Language 'sv' => 'Svenska', // Swedish 'fi' => 'Suomeksi', // Finnish 'es' => 'Español', // Spanish + 'ca' => 'Català', // Catalan 'fr' => 'Français', // French 'it' => 'Italiano', // Italian 'nl' => 'Nederlands', // Dutch @@ -117,32 +118,34 @@ class Language 'ro' => 'Românește', // Romanian 'eu' => 'Euskara', // Basque 'af' => 'Afrikaans', // Afrikaans - ); + 'zu' => 'IsiZulu', // Zulu + 'xh' => 'isiXhosa', // Xhosa + ]; /** * A mapping of SSP languages to locales * * @var array */ - private $languagePosixMapping = array( + private $languagePosixMapping = [ 'no' => 'nb_NO', 'nn' => 'nn_NO', - ); + ]; /** * Constructor * - * @param \SimpleSAML_Configuration $configuration Configuration object + * @param \SimpleSAML\Configuration $configuration Configuration object */ - public function __construct(\SimpleSAML_Configuration $configuration) + public function __construct(\SimpleSAML\Configuration $configuration) { $this->configuration = $configuration; $this->availableLanguages = $this->getInstalledLanguages(); $this->defaultLanguage = $this->configuration->getString('language.default', 'en'); $this->languageParameterName = $this->configuration->getString('language.parameter.name', 'language'); $this->customFunction = $this->configuration->getArray('language.get_language_function', null); - $this->rtlLanguages = $this->configuration->getArray('language.rtl', array()); + $this->rtlLanguages = $this->configuration->getArray('language.rtl', []); if (isset($_GET[$this->languageParameterName])) { $this->setLanguage( $_GET[$this->languageParameterName], @@ -159,8 +162,8 @@ public function __construct(\SimpleSAML_Configuration $configuration) */ private function getInstalledLanguages() { - $configuredAvailableLanguages = $this->configuration->getArray('language.available', array('en')); - $availableLanguages = array(); + $configuredAvailableLanguages = $this->configuration->getArray('language.available', ['en']); + $availableLanguages = []; foreach ($configuredAvailableLanguages as $code) { if (array_key_exists($code, $this->language_names) && isset($this->language_names[$code])) { $availableLanguages[] = $code; @@ -230,7 +233,7 @@ public function getLanguage() } // language is provided in a stored cookie - $languageCookie = Language::getLanguageCookie(); + $languageCookie = self::getLanguageCookie(); if ($languageCookie !== null) { $this->language = $languageCookie; return $languageCookie; @@ -376,8 +379,8 @@ public function isLanguageRTL() */ public static function getLanguageCookie() { - $config = \SimpleSAML_Configuration::getInstance(); - $availableLanguages = $config->getArray('language.available', array('en')); + $config = \SimpleSAML\Configuration::getInstance(); + $availableLanguages = $config->getArray('language.available', ['en']); $name = $config->getString('language.cookie.name', 'language'); if (isset($_COOKIE[$name])) { @@ -399,24 +402,25 @@ public static function getLanguageCookie() */ public static function setLanguageCookie($language) { - assert('is_string($language)'); + assert(is_string($language)); $language = strtolower($language); - $config = \SimpleSAML_Configuration::getInstance(); - $availableLanguages = $config->getArray('language.available', array('en')); + $config = \SimpleSAML\Configuration::getInstance(); + $availableLanguages = $config->getArray('language.available', ['en']); if (!in_array($language, $availableLanguages, true) || headers_sent()) { return; } $name = $config->getString('language.cookie.name', 'language'); - $params = array( + $params = [ 'lifetime' => ($config->getInteger('language.cookie.lifetime', 60 * 60 * 24 * 900)), 'domain' => ($config->getString('language.cookie.domain', null)), 'path' => ($config->getString('language.cookie.path', '/')), 'secure' => ($config->getBoolean('language.cookie.secure', false)), 'httponly' => ($config->getBoolean('language.cookie.httponly', false)), - ); + 'samesite' => ($config->getString('language.cookie.samesite', null)), + ]; HTTP::setCookie($name, $language, $params, false); } diff --git a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Locale/Localization.php b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Locale/Localization.php index 1fc1cb74bd..822a71f96f 100644 --- a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Locale/Localization.php +++ b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Locale/Localization.php @@ -14,63 +14,97 @@ class Localization { - /** * The configuration to use. * - * @var \SimpleSAML_Configuration + * @var \SimpleSAML\Configuration */ private $configuration; /** * The default gettext domain. + * + * @var string */ const DEFAULT_DOMAIN = 'messages'; /** * Old internationalization backend included in SimpleSAMLphp. + * + * @var string */ const SSP_I18N_BACKEND = 'SimpleSAMLphp'; /** * An internationalization backend implemented purely in PHP. + * + * @var string */ const GETTEXT_I18N_BACKEND = 'gettext/gettext'; - /* + /** * The default locale directory + * + * @var string */ private $localeDir; - /* + /** * Where specific domains are stored + * + * @var array */ - private $localeDomainMap = array(); + private $localeDomainMap = []; - /* + /** * Pointer to currently active translator + * + * @var \Gettext\Translator */ private $translator; + /** + * Pointer to current Language + * + * @var Language + */ + private $language; + + /** + * Language code representing the current Language + * + * @var string + */ + private $langcode; + + + /** + * The language backend to use + * + * @var string + */ + public $i18nBackend; /** * Constructor * - * @param \SimpleSAML_Configuration $configuration Configuration object + * @param \SimpleSAML\Configuration $configuration Configuration object */ - public function __construct(\SimpleSAML_Configuration $configuration) + public function __construct(\SimpleSAML\Configuration $configuration) { $this->configuration = $configuration; $this->localeDir = $this->configuration->resolvePath('locales'); $this->language = new Language($configuration); $this->langcode = $this->language->getPosixLanguage($this->language->getLanguage()); - $this->i18nBackend = $this->configuration->getString('language.i18n.backend', self::SSP_I18N_BACKEND); + $this->i18nBackend = ($this->configuration->getBoolean('usenewui', false) ? self::GETTEXT_I18N_BACKEND : self::SSP_I18N_BACKEND); $this->setupL10N(); } /** * Dump the default locale directory + * + * @return string */ public function getLocaleDir() { @@ -82,15 +116,17 @@ public function getLocaleDir() * Get the default locale dir for a specific module aka. domain * * @param string $domain Name of module/domain + * + * @return string */ public function getDomainLocaleDir($domain) { - $localeDir = $this->configuration->resolvePath('modules') . '/' . $domain . '/locales'; + $localeDir = $this->configuration->resolvePath('modules').'/'.$domain.'/locales'; return $localeDir; } - /* + /** * Add a new translation domain from a module * (We're assuming that each domain only exists in one place) * @@ -106,7 +142,7 @@ public function addModuleDomain($module, $localeDir = null) } - /* + /** * Add a new translation domain * (We're assuming that each domain only exists in one place) * @@ -125,6 +161,8 @@ public function addDomain($localeDir, $domain) * * @param string $domain Name of localization domain * @throws Exception If the path does not exist even for the default, fallback language + * + * @return string */ public function getLangPath($domain = self::DEFAULT_DOMAIN) { @@ -153,7 +191,7 @@ public function getLangPath($domain = self::DEFAULT_DOMAIN) if (is_dir($langPath) && is_readable($langPath)) { // Report that the localization for the preferred language is missing $error = "Localization not found for langcode '$langcode' at '$langPath', falling back to langcode '". - $defLangcode."'"; + $defLangcode."'"; \SimpleSAML\Logger::error($_SERVER['PHP_SELF'].' - '.$error); return $langPath; } @@ -216,6 +254,8 @@ private function loadGettextGettextFromPO($domain = self::DEFAULT_DOMAIN, $catch * Test to check if backend is set to default * * (if false: backend unset/there's an error) + * + * @return bool */ public function isI18NBackendDefault() { @@ -243,10 +283,11 @@ private function setupL10N() /** * Show which domains are registered + * + * @return array */ public function getRegisteredDomains() { return $this->localeDomainMap; } - } diff --git a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Locale/Translate.php b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Locale/Translate.php index 3e6e467708..54b56e1a9a 100644 --- a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Locale/Translate.php +++ b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Locale/Translate.php @@ -12,23 +12,31 @@ class Translate { - /** * The configuration to be used for this translator. * - * @var \SimpleSAML_Configuration + * @var \SimpleSAML\Configuration */ private $configuration; - private $langtext = array(); + /** + * Associative array of languages. + * + * @var array + */ + private $langtext = []; /** * Associative array of dictionaries. + * + * @var array */ - private $dictionaries = array(); + private $dictionaries = []; /** * The default dictionary. + * + * @var string|null */ private $defaultDictionary = null; @@ -39,14 +47,13 @@ class Translate */ private $language; - /** * Constructor * - * @param \SimpleSAML_Configuration $configuration Configuration object + * @param \SimpleSAML\Configuration $configuration Configuration object * @param string|null $defaultDictionary The default dictionary where tags will come from. */ - public function __construct(\SimpleSAML_Configuration $configuration, $defaultDictionary = null) + public function __construct(\SimpleSAML\Configuration $configuration, $defaultDictionary = null) { $this->configuration = $configuration; $this->language = new Language($configuration); @@ -67,7 +74,6 @@ public function __construct(\SimpleSAML_Configuration $configuration, $defaultDi } } - /** * Return the internal language object used by this translator. * @@ -78,7 +84,6 @@ public function getLanguage() return $this->language; } - /** * This method retrieves a dictionary with the name given. * @@ -89,7 +94,7 @@ public function getLanguage() */ private function getDictionary($name) { - assert('is_string($name)'); + assert(is_string($name)); if (!array_key_exists($name, $this->dictionaries)) { $sepPos = strpos($name, ':'); @@ -108,18 +113,17 @@ private function getDictionary($name) return $this->dictionaries[$name]; } - /** * This method retrieves a tag as an array with language => string mappings. * * @param string $tag The tag name. The tag name can also be on the form '{<dictionary>:<tag>}', to retrieve a tag * from the specific dictionary. * - * @return array An associative array with language => string mappings, or null if the tag wasn't found. + * @return array|null An associative array with language => string mappings, or null if the tag wasn't found. */ public function getTag($tag) { - assert('is_string($tag)'); + assert(is_string($tag)); // first check translations loaded by the includeInlineTranslation and includeLanguageFile methods if (array_key_exists($tag, $this->langtext)) { @@ -146,7 +150,6 @@ public function getTag($tag) return $dictionary[$tag]; } - /** * Retrieve the preferred translation of a given text. * @@ -158,7 +161,7 @@ public function getTag($tag) */ public function getPreferredTranslation($translations) { - assert('is_array($translations)'); + assert(is_array($translations)); // look up translation of tag in the selected language $selected_language = $this->language->getLanguage(); @@ -187,7 +190,6 @@ public function getPreferredTranslation($translations) throw new \Exception('Nothing to return from translation.'); } - /** * Translate the name of an attribute. * @@ -199,7 +201,7 @@ public function getAttributeTranslation($name) { // normalize attribute name $normName = strtolower($name); - $normName = str_replace(":", "_", $normName); + $normName = str_replace([":", "-"], "_", $normName); // check for an extra dictionary $extraDict = $this->configuration->getString('attributes.extradictionary', null); @@ -220,7 +222,6 @@ public function getAttributeTranslation($name) return $name; } - /** * Mark a string for translation without translating it. * @@ -233,7 +234,6 @@ public static function noop($tag) return $tag; } - /** * Translate a tag into the current language, with a fallback to english. * @@ -258,17 +258,20 @@ public static function noop($tag) */ public function t( $tag, - $replacements = array(), - $fallbackdefault = true, // TODO: remove this for 2.0. Assume true - $oldreplacements = array(), // TODO: remove this for 2.0 - $striptags = false // TODO: remove this for 2.0 + $replacements = [], + // TODO: remove this for 2.0. Assume true + $fallbackdefault = true, + // TODO: remove this for 2.0 + $oldreplacements = [], + // TODO: remove this for 2.0 + $striptags = false ) { $backtrace = debug_backtrace(); $where = $backtrace[0]['file'].':'.$backtrace[0]['line']; if (!$fallbackdefault) { \SimpleSAML\Logger::warning( 'Deprecated use of new SimpleSAML\Locale\Translate::t(...) at '.$where. - '. This parameter will go away, the fallback will become' . + '. This parameter will go away, the fallback will become'. ' identical to the $tag in 2.0.' ); } @@ -302,7 +305,7 @@ public function t( $tagData = $this->getTag($tag); if ($tagData === null) { // tag not found - \SimpleSAML\Logger::info('Template: Looking up ['.$tag.']: not translated at all.'); + \SimpleSAML\Logger::info('Translate: Looking up ['.$tag.']: not translated at all.'); return $this->getStringNotTranslated($tag, $fallbackdefault); } } @@ -319,7 +322,6 @@ public function t( return $translated; } - /** * Return the string that should be used when no translation was found. * @@ -338,10 +340,9 @@ private function getStringNotTranslated($tag, $fallbacktag) } } - /** * Include a translation inline instead of putting translations in dictionaries. This function is recommended to be - * used ONLU from variable data, or when the translation is already provided by an external source, as a database + * used ONLY for variable data, or when the translation is already provided by an external source, as a database * or in metadata. * * @param string $tag The tag that has a translation @@ -352,21 +353,20 @@ private function getStringNotTranslated($tag, $fallbacktag) public function includeInlineTranslation($tag, $translation) { if (is_string($translation)) { - $translation = array('en' => $translation); + $translation = ['en' => $translation]; } elseif (!is_array($translation)) { throw new \Exception("Inline translation should be string or array. Is ".gettype($translation)." now!"); } - \SimpleSAML\Logger::debug('Template: Adding inline language translation for tag ['.$tag.']'); + \SimpleSAML\Logger::debug('Translate: Adding inline language translation for tag ['.$tag.']'); $this->langtext[$tag] = $translation; } - /** * Include a language file from the dictionaries directory. * * @param string $file File name of dictionary to include - * @param \SimpleSAML_Configuration|null $otherConfig Optionally provide a different configuration object than the + * @param \SimpleSAML\Configuration|null $otherConfig Optionally provide a different configuration object than the * one provided in the constructor to be used to find the directory of the dictionary. This allows to combine * dictionaries inside the SimpleSAMLphp main code distribution together with external dictionaries. Defaults to * null. @@ -380,11 +380,10 @@ public function includeLanguageFile($file, $otherConfig = null) } $lang = $this->readDictionaryFile($filebase.$file); - \SimpleSAML\Logger::debug('Template: Merging language array. Loading ['.$file.']'); + \SimpleSAML\Logger::debug('Translate: Merging language array. Loading ['.$file.']'); $this->langtext = array_merge($this->langtext, $lang); } - /** * Read a dictionary file in JSON format. * @@ -395,14 +394,14 @@ public function includeLanguageFile($file, $otherConfig = null) private function readDictionaryJSON($filename) { $definitionFile = $filename.'.definition.json'; - assert('file_exists($definitionFile)'); + assert(file_exists($definitionFile)); $fileContent = file_get_contents($definitionFile); $lang = json_decode($fileContent, true); if (empty($lang)) { \SimpleSAML\Logger::error('Invalid dictionary definition file ['.$definitionFile.']'); - return array(); + return []; } $translationFile = $filename.'.translation.json'; @@ -417,7 +416,6 @@ private function readDictionaryJSON($filename) return $lang; } - /** * Read a dictionary file in PHP format. * @@ -428,7 +426,7 @@ private function readDictionaryJSON($filename) private function readDictionaryPHP($filename) { $phpFile = $filename.'.php'; - assert('file_exists($phpFile)'); + assert(file_exists($phpFile)); $lang = null; include($phpFile); @@ -436,10 +434,9 @@ private function readDictionaryPHP($filename) return $lang; } - return array(); + return []; } - /** * Read a dictionary file. * @@ -449,9 +446,9 @@ private function readDictionaryPHP($filename) */ private function readDictionaryFile($filename) { - assert('is_string($filename)'); + assert(is_string($filename)); - \SimpleSAML\Logger::debug('Template: Reading ['.$filename.']'); + \SimpleSAML\Logger::debug('Translate: Reading dictionary ['.$filename.']'); $jsonFile = $filename.'.definition.json'; if (file_exists($jsonFile)) { @@ -464,12 +461,18 @@ private function readDictionaryFile($filename) } \SimpleSAML\Logger::error( - $_SERVER['PHP_SELF'].' - Template: Could not find dictionary file at ['.$filename.']' + $_SERVER['PHP_SELF'].' - Translate: Could not find dictionary file at ['.$filename.']' ); - return array(); + return []; } - + /** + * Translate a singular text. + * + * @param string $original The string before translation. + * + * @return string The translated string. + */ public static function translateSingularGettext($original) { $text = \Gettext\BaseTranslator::$current->gettext($original); @@ -483,7 +486,15 @@ public static function translateSingularGettext($original) return strtr($text, is_array($args[0]) ? $args[0] : $args); } - + /** + * Translate a plural text. + * + * @param string $original The string before translation. + * @param string $plural + * @param string $value + * + * @return string The translated string. + */ public static function translatePluralGettext($original, $plural, $value) { $text = \Gettext\BaseTranslator::$current->ngettext($original, $plural, $value); @@ -496,4 +507,49 @@ public static function translatePluralGettext($original, $plural, $value) return strtr($text, is_array($args[0]) ? $args[0] : $args); } + + /** + * Pick a translation from a given array of translations for the current language. + * + * @param array $context An array of options. The current language must be specified as an ISO 639 code accessible + * with the key "currentLanguage" in the array. + * @param array $translations An array of translations. Each translation has an ISO 639 code as its key, identifying + * the language it corresponds to. + * + * @return null|string The translation appropriate for the current language, or null if none found. If the + * $context or $translations arrays are null, or $context['currentLanguage'] is not defined, null is also returned. + */ + public static function translateFromArray($context, $translations) + { + if (!is_array($translations) || $translations === null) { + return null; + } + + if (!is_array($context) || !isset($context['currentLanguage'])) { + return null; + } + + if (isset($translations[$context['currentLanguage']])) { + return $translations[$context['currentLanguage']]; + } + + // we don't have a translation for the current language, load alternative priorities + $sspcfg = \SimpleSAML\Configuration::getInstance(); + $langcfg = $sspcfg->getConfigItem('language', null); + $priorities = []; + if ($langcfg instanceof \SimpleSAML\Configuration) { + $priorities = $langcfg->getArray('priorities', []); + } + + if (!empty($priorities[$context['currentLanguage']])) { + foreach ($priorities[$context['currentLanguage']] as $lang) { + if (isset($translations[$lang])) { + return $translations[$lang]; + } + } + } + + // nothing we can use, return null so that we can set a default + return null; + } } diff --git a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Logger.php b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Logger.php index 618c6b7b57..ace36e1a18 100644 --- a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Logger.php +++ b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Logger.php @@ -2,7 +2,6 @@ namespace SimpleSAML; - /** * The main logger class for SimpleSAMLphp. * @@ -10,11 +9,9 @@ * @author Andreas Åkre Solberg, UNINETT AS. <andreas.solberg@uninett.no> * @author Jaime Pérez Crespo, UNINETT AS <jaime.perez@uninett.no> * @package SimpleSAMLphp - * @version $ID$ */ class Logger { - /** * @var \SimpleSAML\Logger\LoggingHandlerInterface|false|null */ @@ -33,14 +30,14 @@ class Logger /** * @var array */ - private static $capturedLog = array(); + private static $capturedLog = []; /** * Array with messages logged before the logging handler was initialized. * * @var array */ - private static $earlyLog = array(); + private static $earlyLog = []; /** * List of log levels. @@ -49,7 +46,7 @@ class Logger * * @var array */ - private static $logLevelStack = array(); + private static $logLevelStack = []; /** * The current mask of log levels disabled. @@ -255,31 +252,45 @@ public static function getCapturedLog() public static function setTrackId($trackId) { self::$trackid = $trackId; + self::flush(); } /** * Flush any pending log messages to the logging handler. * + * @return void + */ + public static function flush() + { + foreach (self::$earlyLog as $msg) { + self::log($msg['level'], $msg['string'], $msg['statsLog']); + } + self::$earlyLog = []; + } + + + /** + * Flush any pending deferred logs during shutdown. + * * This method is intended to be registered as a shutdown handler, so that any pending messages that weren't sent * to the logging handler at that point, can still make it. It is therefore not intended to be called manually. * */ - public static function flush() + public static function shutdown() { - try { - $s = \SimpleSAML_Session::getSessionFromRequest(); - } catch (\Exception $e) { - // loading session failed. We don't care why, at this point we have a transient session, so we use that - self::error('Cannot load or create session: '.$e->getMessage()); - $s = \SimpleSAML_Session::getSessionFromRequest(); + if (self::$trackid === self::NO_TRACKID) { + try { + $s = Session::getSessionFromRequest(); + } catch (\Exception $e) { + // loading session failed. We don't care why, at this point we have a transient session, so we use that + self::error('Cannot load or create session: '.$e->getMessage()); + $s = Session::getSessionFromRequest(); + } + self::$trackid = $s->getTrackID(); } - self::$trackid = $s->getTrackID(); - self::$shuttingDown = true; - foreach (self::$earlyLog as $msg) { - self::log($msg['level'], $msg['string'], $msg['statsLog']); - } + self::flush(); } @@ -305,10 +316,10 @@ public static function isErrorMasked($errno) */ public static function maskErrors($mask) { - assert('is_int($mask)'); + assert(is_int($mask)); $currentEnabled = error_reporting(); - self::$logLevelStack[] = array($currentEnabled, self::$logMask); + self::$logLevelStack[] = [$currentEnabled, self::$logMask]; $currentEnabled &= ~$mask; error_reporting($currentEnabled); @@ -339,11 +350,11 @@ public static function popErrorMask() private static function defer($level, $message, $stats) { // save the message for later - self::$earlyLog[] = array('level' => $level, 'string' => $message, 'statsLog' => $stats); + self::$earlyLog[] = ['level' => $level, 'string' => $message, 'statsLog' => $stats]; // register a shutdown handler if needed if (!self::$shutdownRegistered) { - register_shutdown_function(array('SimpleSAML\Logger', 'flush')); + register_shutdown_function([self::class, 'shutdown']); self::$shutdownRegistered = true; } } @@ -355,15 +366,15 @@ private static function createLoggingHandler($handler = null) self::$loggingHandler = false; // a set of known logging handlers - $known_handlers = array( + $known_handlers = [ 'syslog' => 'SimpleSAML\Logger\SyslogLoggingHandler', 'file' => 'SimpleSAML\Logger\FileLoggingHandler', 'errorlog' => 'SimpleSAML\Logger\ErrorLogLoggingHandler', - ); + ]; // get the configuration - $config = \SimpleSAML_Configuration::getInstance(); - assert($config instanceof \SimpleSAML_Configuration); + $config = Configuration::getInstance(); + assert($config instanceof Configuration); // setting minimum log_level self::$logLevel = $config->getInteger('logging.level', self::INFO); @@ -411,13 +422,7 @@ private static function log($level, $string, $statsLog = false) } elseif (self::$loggingHandler === null) { // Initialize logging self::createLoggingHandler(); - - if (!empty(self::$earlyLog)) { - // output messages which were logged before we properly initialized logging - foreach (self::$earlyLog as $msg) { - self::log($msg['level'], $msg['string'], $msg['statsLog']); - } - } + self::flush(); } if (self::$captureLog) { @@ -432,8 +437,8 @@ private static function log($level, $string, $statsLog = false) $string = implode(",", $string); } - $formats = array('%trackid', '%msg', '%srcip', '%stat'); - $replacements = array(self::$trackid, $string, $_SERVER['REMOTE_ADDR']); + $formats = ['%trackid', '%msg', '%srcip', '%stat']; + $replacements = [self::$trackid, $string, $_SERVER['REMOTE_ADDR']]; $stat = ''; if ($statsLog) { diff --git a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Logger/ErrorLogLoggingHandler.php b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Logger/ErrorLogLoggingHandler.php index 845103cf2d..355fe24d1d 100644 --- a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Logger/ErrorLogLoggingHandler.php +++ b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Logger/ErrorLogLoggingHandler.php @@ -14,11 +14,10 @@ */ class ErrorLogLoggingHandler implements LoggingHandlerInterface { - /** * This array contains the mappings from syslog log level to names. */ - private static $levelNames = array( + private static $levelNames = [ Logger::EMERG => 'EMERG', Logger::ALERT => 'ALERT', Logger::CRIT => 'CRIT', @@ -27,7 +26,7 @@ class ErrorLogLoggingHandler implements LoggingHandlerInterface Logger::NOTICE => 'NOTICE', Logger::INFO => 'INFO', Logger::DEBUG => 'DEBUG', - ); + ]; /** * The name of this process. @@ -40,9 +39,9 @@ class ErrorLogLoggingHandler implements LoggingHandlerInterface /** * ErrorLogLoggingHandler constructor. * - * @param \SimpleSAML_Configuration $config The configuration object for this handler. + * @param \SimpleSAML\Configuration $config The configuration object for this handler. */ - public function __construct(\SimpleSAML_Configuration $config) + public function __construct(\SimpleSAML\Configuration $config) { $this->processname = $config->getString('logging.processname', 'SimpleSAMLphp'); } @@ -73,8 +72,8 @@ public function log($level, $string) $levelName = sprintf('UNKNOWN%d', $level); } - $formats = array('%process', '%level'); - $replacements = array($this->processname, $levelName); + $formats = ['%process', '%level']; + $replacements = [$this->processname, $levelName]; $string = str_replace($formats, $replacements, $string); $string = preg_replace('/%\w+(\{[^\}]+\})?/', '', $string); $string = trim($string); diff --git a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Logger/FileLoggingHandler.php b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Logger/FileLoggingHandler.php index 475541f1bf..8e9202f55d 100644 --- a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Logger/FileLoggingHandler.php +++ b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Logger/FileLoggingHandler.php @@ -25,7 +25,7 @@ class FileLoggingHandler implements LoggingHandlerInterface * This array contains the mappings from syslog log levels to names. Copied more or less directly from * SimpleSAML\Logger\ErrorLogLoggingHandler. */ - private static $levelNames = array( + private static $levelNames = [ Logger::EMERG => 'EMERGENCY', Logger::ALERT => 'ALERT', Logger::CRIT => 'CRITICAL', @@ -34,7 +34,7 @@ class FileLoggingHandler implements LoggingHandlerInterface Logger::NOTICE => 'NOTICE', Logger::INFO => 'INFO', Logger::DEBUG => 'DEBUG', - ); + ]; protected $processname = null; protected $format; @@ -42,7 +42,7 @@ class FileLoggingHandler implements LoggingHandlerInterface /** * Build a new logging handler based on files. */ - public function __construct(\SimpleSAML_Configuration $config) + public function __construct(\SimpleSAML\Configuration $config) { // get the metadata handler option from the configuration $this->logFile = $config->getPathValue('loggingdir', 'log/'). @@ -92,10 +92,10 @@ public function log($level, $string) $levelName = self::$levelNames[$level]; } - $formats = array('%process', '%level'); - $replacements = array($this->processname, $levelName); + $formats = ['%process', '%level']; + $replacements = [$this->processname, $levelName]; - $matches = array(); + $matches = []; if (preg_match('/%date(?:\{([^\}]+)\})?/', $this->format, $matches)) { $format = "%b %d %H:%M:%S"; if (isset($matches[1])) { @@ -107,7 +107,7 @@ public function log($level, $string) } $string = str_replace($formats, $replacements, $string); - file_put_contents($this->logFile, $string.PHP_EOL, FILE_APPEND); + file_put_contents($this->logFile, $string.\PHP_EOL, FILE_APPEND); } } } diff --git a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Logger/LoggingHandlerInterface.php b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Logger/LoggingHandlerInterface.php index c7b00eb01a..a9b939ddd0 100644 --- a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Logger/LoggingHandlerInterface.php +++ b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Logger/LoggingHandlerInterface.php @@ -13,11 +13,11 @@ interface LoggingHandlerInterface { /** - * Constructor for log handlers. It must accept receiving a \SimpleSAML_Configuration object. + * Constructor for log handlers. It must accept receiving a \SimpleSAML\Configuration object. * - * @param \SimpleSAML_Configuration $config The configuration to use in this log handler. + * @param \SimpleSAML\Configuration $config The configuration to use in this log handler. */ - public function __construct(\SimpleSAML_Configuration $config); + public function __construct(\SimpleSAML\Configuration $config); /** diff --git a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Logger/StandardErrorLoggingHandler.php b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Logger/StandardErrorLoggingHandler.php index 0f35fcf54b..3413e68cea 100644 --- a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Logger/StandardErrorLoggingHandler.php +++ b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Logger/StandardErrorLoggingHandler.php @@ -16,7 +16,7 @@ class StandardErrorLoggingHandler extends FileLoggingHandler * * It runs the parent constructor and sets the log file to be the standard error descriptor. */ - public function __construct(\SimpleSAML_Configuration $config) + public function __construct(\SimpleSAML\Configuration $config) { $this->processname = $config->getString('logging.processname', 'SimpleSAMLphp'); $this->logFile = 'php://stderr'; diff --git a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Logger/SyslogLoggingHandler.php b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Logger/SyslogLoggingHandler.php index ce2739798e..8d6e21a396 100644 --- a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Logger/SyslogLoggingHandler.php +++ b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Logger/SyslogLoggingHandler.php @@ -20,7 +20,7 @@ class SyslogLoggingHandler implements LoggingHandlerInterface /** * Build a new logging handler based on syslog. */ - public function __construct(\SimpleSAML_Configuration $config) + public function __construct(\SimpleSAML\Configuration $config) { $facility = $config->getInteger('logging.facility', defined('LOG_LOCAL5') ? constant('LOG_LOCAL5') : LOG_USER); @@ -64,8 +64,8 @@ public function log($level, $string) } } - $formats = array('%process', '%level'); - $replacements = array('', $level); + $formats = ['%process', '%level']; + $replacements = ['', $level]; $string = str_replace($formats, $replacements, $string); $string = preg_replace('/%\w+(\{[^\}]+\})?/', '', $string); $string = trim($string); diff --git a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Memcache.php b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Memcache.php index 2d2944e0c2..227022c201 100644 --- a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Memcache.php +++ b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Memcache.php @@ -1,5 +1,6 @@ <?php +namespace SimpleSAML; /** * This file implements functions to read and write to a group of memcache @@ -17,22 +18,22 @@ * @author Olav Morken, UNINETT AS. * @package SimpleSAMLphp */ -class SimpleSAML_Memcache -{ +class Memcache +{ /** * Cache of the memcache servers we are using. * - * @var Memcache[]|null + * @var \Memcache[]|null */ private static $serverGroups = null; - /** - * The flavor of memcache PHP extension we are using. - * - * @var string - */ + /** + * The flavor of memcache PHP extension we are using. + * + * @var string + */ private static $extension = ''; @@ -45,7 +46,7 @@ class SimpleSAML_Memcache */ public static function get($key) { - SimpleSAML\Logger::debug("loading key $key from memcache"); + Logger::debug("loading key $key from memcache"); $latestInfo = null; $latestTime = 0.0; @@ -59,7 +60,7 @@ public static function get($key) if ($serializedInfo === false) { // either the server is down, or we don't have the value stored on that server $mustUpdate = true; - $up = $server->getstats(); + $up = $server->getStats(); if ($up !== false) { $allDown = false; } @@ -76,19 +77,19 @@ public static function get($key) * - 'data': The data. */ if (!is_array($info)) { - SimpleSAML\Logger::warning( + Logger::warning( 'Retrieved invalid data from a memcache server. Data was not an array.' ); continue; } if (!array_key_exists('timestamp', $info)) { - SimpleSAML\Logger::warning( + Logger::warning( 'Retrieved invalid data from a memcache server. Missing timestamp.' ); continue; } if (!array_key_exists('data', $info)) { - SimpleSAML\Logger::warning( + Logger::warning( 'Retrieved invalid data from a memcache server. Missing data.' ); continue; @@ -121,17 +122,17 @@ public static function get($key) if ($latestData === null) { if ($allDown) { // all servers are down, panic! - $e = new SimpleSAML_Error_Error('MEMCACHEDOWN', null, 503); - throw new SimpleSAML_Error_Exception('All memcache servers are down', 503, $e); + $e = new Error\Error('MEMCACHEDOWN', null, 503); + throw new Error\Exception('All memcache servers are down', 503, $e); } // we didn't find any data matching the key - SimpleSAML\Logger::debug("key $key not found in memcache"); + Logger::debug("key $key not found in memcache"); return null; } if ($mustUpdate) { // we found data matching the key, but some of the servers need updating - SimpleSAML\Logger::debug("Memcache servers out of sync for $key, forcing sync"); + Logger::debug("Memcache servers out of sync for $key, forcing sync"); self::set($key, $latestData); } @@ -148,11 +149,11 @@ public static function get($key) */ public static function set($key, $value, $expire = null) { - SimpleSAML\Logger::debug("saving key $key to memcache"); - $savedInfo = array( + Logger::debug("saving key $key to memcache"); + $savedInfo = [ 'timestamp' => microtime(true), 'data' => $value - ); + ]; if ($expire === null) { $expire = self::getExpireTime(); @@ -162,10 +163,9 @@ public static function set($key, $value, $expire = null) // store this object to all groups of memcache servers foreach (self::getMemcacheServers() as $server) { - if (self::$extension === 'memcached') { + if (self::$extension === '\memcached') { $server->set($key, $savedInfoSerialized, $expire); - } - else { + } else { $server->set($key, $savedInfoSerialized, 0, $expire); } } @@ -179,8 +179,8 @@ public static function set($key, $value, $expire = null) */ public static function delete($key) { - assert('is_string($key)'); - SimpleSAML\Logger::debug("deleting key $key from memcache"); + assert(is_string($key)); + Logger::debug("deleting key $key from memcache"); // store this object to all groups of memcache servers foreach (self::getMemcacheServers() as $server) { @@ -207,16 +207,16 @@ public static function delete($key) * The timeout for contacting this server, in seconds. * The default value is 3 seconds. * - * @param Memcache $memcache The Memcache object we should add this server to. + * @param \Memcache $memcache The Memcache object we should add this server to. * @param array $server An associative array with the configuration options for the server to add. * - * @throws Exception If any configuration option for the server is invalid. + * @throws \Exception If any configuration option for the server is invalid. */ private static function addMemcacheServer($memcache, $server) { // the hostname option is required if (!array_key_exists('hostname', $server)) { - throw new Exception( + throw new \Exception( "hostname setting missing from server in the 'memcache_store.servers' configuration option." ); } @@ -225,27 +225,21 @@ private static function addMemcacheServer($memcache, $server) // the hostname must be a valid string if (!is_string($hostname)) { - throw new Exception( + throw new \Exception( "Invalid hostname for server in the 'memcache_store.servers' configuration option. The hostname is". ' supposed to be a string.' ); } - // check if we are told to use a socket - $socket = false; - if (strpos($hostname, 'unix:///') === 0) { - $socket = true; - } - // check if the user has specified a port number - if ($socket) { + if (strpos($hostname, 'unix:///') === 0) { // force port to be 0 for sockets $port = 0; } elseif (array_key_exists('port', $server)) { // get the port number from the array, and validate it $port = (int) $server['port']; if (($port <= 0) || ($port > 65535)) { - throw new Exception( + throw new \Exception( "Invalid port for server in the 'memcache_store.servers' configuration option. The port number". ' is supposed to be an integer between 0 and 65535.' ); @@ -264,7 +258,7 @@ private static function addMemcacheServer($memcache, $server) // get the weight and validate it $weight = (int) $server['weight']; if ($weight <= 0) { - throw new Exception( + throw new \Exception( "Invalid weight for server in the 'memcache_store.servers' configuration option. The weight is". ' supposed to be a positive integer.' ); @@ -279,7 +273,7 @@ private static function addMemcacheServer($memcache, $server) // get the timeout and validate it $timeout = (int) $server['timeout']; if ($timeout <= 0) { - throw new Exception( + throw new \Exception( "Invalid timeout for server in the 'memcache_store.servers' configuration option. The timeout is". ' supposed to be a positive integer.' ); @@ -290,7 +284,7 @@ private static function addMemcacheServer($memcache, $server) } // add this server to the Memcache object - if (self::$extension === 'memcached') { + if (self::$extension === '\memcached') { $memcache->addServer($hostname, $port); } else { $memcache->addServer($hostname, $port, true, $weight, $timeout, $timeout, true); @@ -304,26 +298,28 @@ private static function addMemcacheServer($memcache, $server) * * @param array $group Array of servers which should be created as a group. * - * @return Memcache A Memcache object of the servers in the group + * @return \Memcache A Memcache object of the servers in the group * - * @throws Exception If the servers configuration is invalid. + * @throws \Exception If the servers configuration is invalid. */ private static function loadMemcacheServerGroup(array $group) { - $class = class_exists('Memcache') ? 'Memcache' : (class_exists('Memcached') ? 'Memcached' : FALSE); + $class = class_exists('\Memcache') ? '\Memcache' : (class_exists('\Memcached') ? '\Memcached' : false); if (!$class) { - throw new Exception('Missing Memcached implementation. You must install either the Memcache or Memcached extension.'); + throw new \Exception( + 'Missing Memcached implementation. You must install either the Memcache or Memcached extension.' + ); } self::$extension = strtolower($class); - // create the Memcache object + // create the \Memcache object $memcache = new $class(); // iterate over all the servers in the group and add them to the Memcache object foreach ($group as $index => $server) { // make sure that we don't have an index. An index would be a sign of invalid configuration if (!is_int($index)) { - throw new Exception( + throw new \Exception( "Invalid index on element in the 'memcache_store.servers' configuration option. Perhaps you". ' have forgotten to add an array(...) around one of the server groups? The invalid index was: '. $index @@ -332,7 +328,7 @@ private static function loadMemcacheServerGroup(array $group) // make sure that the server object is an array. Each server is an array with name-value pairs if (!is_array($server)) { - throw new Exception( + throw new \Exception( 'Invalid value for the server with index '.$index. '. Remeber that the \'memcache_store.servers\' configuration option'. ' contains an array of arrays of arrays.' @@ -350,9 +346,9 @@ private static function loadMemcacheServerGroup(array $group) * This function gets a list of all configured memcache servers. This list is initialized based * on the content of 'memcache_store.servers' in the configuration. * - * @return Memcache[] Array with Memcache objects. + * @return \Memcache[] Array with Memcache objects. * - * @throws Exception If the servers configuration is invalid. + * @throws \Exception If the servers configuration is invalid. */ private static function getMemcacheServers() { @@ -362,10 +358,10 @@ private static function getMemcacheServers() } // initialize the servers-array - self::$serverGroups = array(); + self::$serverGroups = []; // load the configuration - $config = SimpleSAML_Configuration::getInstance(); + $config = Configuration::getInstance(); $groups = $config->getArray('memcache_store.servers'); @@ -374,7 +370,7 @@ private static function getMemcacheServers() foreach ($groups as $index => $group) { // make sure that the group doesn't have an index. An index would be a sign of invalid configuration if (!is_int($index)) { - throw new Exception( + throw new \Exception( "Invalid index on element in the 'memcache_store.servers'". ' configuration option. Perhaps you have forgotten to add an array(...)'. ' around one of the server groups? The invalid index was: '.$index @@ -386,7 +382,7 @@ private static function getMemcacheServers() * an array of name => value pairs for that server. */ if (!is_array($group)) { - throw new Exception( + throw new \Exception( "Invalid value for the server with index ".$index. ". Remeber that the 'memcache_store.servers' configuration option". ' contains an array of arrays of arrays.' @@ -411,20 +407,20 @@ private static function getMemcacheServers() * * @return integer The value which should be passed in the set(...) calls to the memcache objects. * - * @throws Exception If the option 'memcache_store.expires' has a negative value. + * @throws \Exception If the option 'memcache_store.expires' has a negative value. */ private static function getExpireTime() { // get the configuration instance - $config = SimpleSAML_Configuration::getInstance(); - assert($config instanceof SimpleSAML_Configuration); + $config = Configuration::getInstance(); + assert($config instanceof \SimpleSAML\Configuration); // get the expire-value from the configuration $expire = $config->getInteger('memcache_store.expires', 0); // it must be a positive integer if ($expire < 0) { - throw new Exception( + throw new \Exception( "The value of 'memcache_store.expires' in the configuration can't be a negative integer." ); } @@ -439,9 +435,7 @@ private static function getExpireTime() /* The expire option is given as the number of seconds into the future an item should expire. We convert this * to an actual timestamp. */ - $expireTime = time() + $expire; - - return $expireTime; + return (time() + $expire); } @@ -450,21 +444,21 @@ private static function getExpireTime() * * @return array Array with the names of each stat and an array with the value for each server group. * - * @throws Exception If memcache server status couldn't be retrieved. + * @throws \Exception If memcache server status couldn't be retrieved. */ public static function getStats() { - $ret = array(); + $ret = []; foreach (self::getMemcacheServers() as $sg) { $stats = method_exists($sg, 'getExtendedStats') ? $sg->getExtendedStats() : $sg->getStats(); foreach ($stats as $server => $data) { if ($data === false) { - throw new Exception('Failed to get memcache server status.'); + throw new \Exception('Failed to get memcache server status.'); } } - $stats = SimpleSAML\Utils\Arrays::transpose($stats); + $stats = Utils\Arrays::transpose($stats); $ret = array_merge_recursive($ret, $stats); } @@ -481,7 +475,7 @@ public static function getStats() */ public static function getRawStats() { - $ret = array(); + $ret = []; foreach (self::getMemcacheServers() as $sg) { $stats = method_exists($sg, 'getExtendedStats') ? $sg->getExtendedStats() : $sg->getStats(); @@ -490,5 +484,4 @@ public static function getRawStats() return $ret; } - } diff --git a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Metadata/MetaDataStorageHandler.php b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Metadata/MetaDataStorageHandler.php index 33e5ef1c89..6e712ea3a3 100644 --- a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Metadata/MetaDataStorageHandler.php +++ b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Metadata/MetaDataStorageHandler.php @@ -1,5 +1,9 @@ <?php +namespace SimpleSAML\Metadata; + +use SAML2\XML\saml\Issuer; +use SimpleSAML\Utils\ClearableState; /** * This file defines a class for metadata handling. @@ -7,16 +11,15 @@ * @author Andreas Åkre Solberg, UNINETT AS. <andreas.solberg@uninett.no> * @package SimpleSAMLphp */ -class SimpleSAML_Metadata_MetaDataStorageHandler -{ - +class MetaDataStorageHandler implements ClearableState +{ /** * This static variable contains a reference to the current * instance of the metadata handler. This variable will be null if * we haven't instantiated a metadata handler yet. * - * @var SimpleSAML_Metadata_MetaDataStorageHandler + * @var MetaDataStorageHandler */ private static $metadataHandler = null; @@ -25,7 +28,7 @@ class SimpleSAML_Metadata_MetaDataStorageHandler * This is a list of all the metadata sources we have in our metadata * chain. When we need metadata, we will look through this chain from start to end. * - * @var SimpleSAML_Metadata_MetaDataStorageSource[] + * @var MetaDataStorageSource[] */ private $sources; @@ -35,12 +38,12 @@ class SimpleSAML_Metadata_MetaDataStorageHandler * The metadata handler will be instantiated if this is the first call * to this function. * - * @return SimpleSAML_Metadata_MetaDataStorageHandler The current metadata handler instance. + * @return MetaDataStorageHandler The current metadata handler instance. */ public static function getMetadataHandler() { if (self::$metadataHandler === null) { - self::$metadataHandler = new SimpleSAML_Metadata_MetaDataStorageHandler(); + self::$metadataHandler = new MetaDataStorageHandler(); } return self::$metadataHandler; @@ -53,20 +56,20 @@ public static function getMetadataHandler() */ protected function __construct() { - $config = SimpleSAML_Configuration::getInstance(); + $config = \SimpleSAML\Configuration::getInstance(); $sourcesConfig = $config->getArray('metadata.sources', null); // for backwards compatibility, and to provide a default configuration if ($sourcesConfig === null) { $type = $config->getString('metadata.handler', 'flatfile'); - $sourcesConfig = array(array('type' => $type)); + $sourcesConfig = [['type' => $type]]; } try { - $this->sources = SimpleSAML_Metadata_MetaDataStorageSource::parseSources($sourcesConfig); - } catch (Exception $e) { - throw new Exception( + $this->sources = MetaDataStorageSource::parseSources($sourcesConfig); + } catch (\Exception $e) { + throw new \Exception( "Invalid configuration of the 'metadata.sources' configuration option: ".$e->getMessage() ); } @@ -80,7 +83,7 @@ protected function __construct() * @param string $set The set we the property comes from. * * @return string The auto-generated metadata property. - * @throws Exception If the metadata cannot be generated automatically. + * @throws \Exception If the metadata cannot be generated automatically. */ public function getGenerated($property, $set) { @@ -90,13 +93,13 @@ public function getGenerated($property, $set) if (array_key_exists($property, $metadataSet)) { return $metadataSet[$property]; } - } catch (Exception $e) { + } catch (\Exception $e) { // probably metadata wasn't found. In any case we continue by generating the metadata } // get the configuration - $config = SimpleSAML_Configuration::getInstance(); - assert($config instanceof SimpleSAML_Configuration); + $config = \SimpleSAML\Configuration::getInstance(); + assert($config instanceof \SimpleSAML\Configuration); $baseurl = \SimpleSAML\Utils\HTTP::getSelfURLHost().$config->getBasePath(); @@ -124,7 +127,7 @@ public function getGenerated($property, $set) } } - throw new Exception('Could not generate metadata property '.$property.' for set '.$set.'.'); + throw new \Exception('Could not generate metadata property '.$property.' for set '.$set.'.'); } @@ -138,9 +141,9 @@ public function getGenerated($property, $set) */ public function getList($set = 'saml20-idp-remote') { - assert('is_string($set)'); + assert(is_string($set)); - $result = array(); + $result = []; foreach ($this->sources as $source) { $srcList = $source->getMetadataSet($set); @@ -149,9 +152,9 @@ public function getList($set = 'saml20-idp-remote') if (array_key_exists('expire', $le)) { if ($le['expire'] < time()) { unset($srcList[$key]); - SimpleSAML\Logger::warning( + \SimpleSAML\Logger::warning( "Dropping metadata entity ".var_export($key, true).", expired ". - SimpleSAML\Utils\Time::generateTimestamp($le['expire'])."." + \SimpleSAML\Utils\Time::generateTimestamp($le['expire'])."." ); } } @@ -189,11 +192,11 @@ public function getMetaDataCurrent($set) * @param string $type Do you want to return the metaindex or the entityID. [entityid|metaindex] * * @return string The entity id which is associated with the current hostname/path combination. - * @throws Exception If no default metadata can be found in the set for the current host. + * @throws \Exception If no default metadata can be found in the set for the current host. */ public function getMetaDataCurrentEntityID($set, $type = 'entityid') { - assert('is_string($set)'); + assert(is_string($set)); // first we look for the hostname/path combination $currenthostwithpath = \SimpleSAML\Utils\HTTP::getSelfHostWithPath(); // sp.example.org/university @@ -224,7 +227,7 @@ public function getMetaDataCurrentEntityID($set, $type = 'entityid') } // we were unable to find the hostname/path in any metadata source - throw new Exception( + throw new \Exception( 'Could not find any default metadata entities in set ['.$set.'] for host ['.$currenthost.' : '. $currenthostwithpath.']' ); @@ -263,27 +266,26 @@ public function getPreferredEntityIdFromCIDRhint($set, $ip) * @param string $set The set of metadata we are looking up the entity id in. * * @return array The metadata array describing the specified entity. - * @throws Exception If metadata for the specified entity is expired. - * @throws SimpleSAML_Error_MetadataNotFound If no metadata for the entity specified can be found. + * @throws \Exception If metadata for the specified entity is expired. + * @throws \SimpleSAML\Error\MetadataNotFound If no metadata for the entity specified can be found. */ public function getMetaData($index, $set) { - assert('is_string($set)'); + assert(is_string($set)); if ($index === null) { $index = $this->getMetaDataCurrentEntityID($set, 'metaindex'); } - assert('is_string($index)'); + assert(is_string($index)); foreach ($this->sources as $source) { $metadata = $source->getMetaData($index, $set); if ($metadata !== null) { - if (array_key_exists('expire', $metadata)) { if ($metadata['expire'] < time()) { - throw new Exception( + throw new \Exception( 'Metadata for the entity ['.$index.'] expired '. (time() - $metadata['expire']).' seconds ago.' ); @@ -292,12 +294,12 @@ public function getMetaData($index, $set) $metadata['metadata-index'] = $index; $metadata['metadata-set'] = $set; - assert('array_key_exists("entityid", $metadata)'); + assert(array_key_exists('entityid', $metadata)); return $metadata; } } - throw new SimpleSAML_Error_MetadataNotFound($index); + throw new \SimpleSAML\Error\MetadataNotFound($index); } @@ -309,16 +311,16 @@ public function getMetaData($index, $set) * @param string $entityId The entity ID we are looking up. * @param string $set The metadata set we are searching. * - * @return SimpleSAML_Configuration The configuration object representing the metadata. - * @throws SimpleSAML_Error_MetadataNotFound If no metadata for the entity specified can be found. + * @return \SimpleSAML\Configuration The configuration object representing the metadata. + * @throws \SimpleSAML\Error\MetadataNotFound If no metadata for the entity specified can be found. */ public function getMetaDataConfig($entityId, $set) { - assert('is_string($entityId)'); - assert('is_string($set)'); + assert(is_string($entityId)); + assert(is_string($set)); $metadata = $this->getMetaData($entityId, $set); - return SimpleSAML_Configuration::loadFromArray($metadata, $set.'/'.var_export($entityId, true)); + return \SimpleSAML\Configuration::loadFromArray($metadata, $set.'/'.var_export($entityId, true)); } @@ -328,15 +330,15 @@ public function getMetaDataConfig($entityId, $set) * @param string $sha1 The SHA1 digest of the entity ID. * @param string $set The metadata set we are searching. * - * @return null|SimpleSAML_Configuration The metadata corresponding to the entity, or null if the entity cannot be + * @return null|\SimpleSAML\Configuration The metadata corresponding to the entity, or null if the entity cannot be * found. */ public function getMetaDataConfigForSha1($sha1, $set) { - assert('is_string($sha1)'); - assert('is_string($set)'); + assert(is_string($sha1)); + assert(is_string($set)); - $result = array(); + $result = []; foreach ($this->sources as $source) { $srcList = $source->getMetadataSet($set); @@ -347,11 +349,10 @@ public function getMetaDataConfigForSha1($sha1, $set) $result = array_merge($srcList, $result); } foreach ($result as $remote_provider) { - if (sha1($remote_provider['entityid']) == $sha1) { $remote_provider['metadata-set'] = $set; - return SimpleSAML_Configuration::loadFromArray( + return \SimpleSAML\Configuration::loadFromArray( $remote_provider, $set.'/'.var_export($remote_provider['entityid'], true) ); @@ -360,4 +361,14 @@ public function getMetaDataConfigForSha1($sha1, $set) return null; } + + /** + * Clear any metadata cached. + * Allows for metadata configuration to be changed and reloaded during a given request. Most useful + * when running phpunit tests and needing to alter config.php and metadata sources between test cases + */ + public static function clearInternalState() + { + self::$metadataHandler = null; + } } diff --git a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Metadata/MetaDataStorageHandlerFlatFile.php b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Metadata/MetaDataStorageHandlerFlatFile.php index 3f86322275..55336a04d5 100644 --- a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Metadata/MetaDataStorageHandlerFlatFile.php +++ b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Metadata/MetaDataStorageHandlerFlatFile.php @@ -1,5 +1,6 @@ <?php +namespace SimpleSAML\Metadata; /** * This file defines a flat file metadata source. @@ -9,9 +10,9 @@ * @author Andreas Åkre Solberg, UNINETT AS. <andreas.solberg@uninett.no> * @package SimpleSAMLphp */ -class SimpleSAML_Metadata_MetaDataStorageHandlerFlatFile extends SimpleSAML_Metadata_MetaDataStorageSource -{ +class MetaDataStorageHandlerFlatFile extends MetaDataStorageSource +{ /** * This is the directory we will load metadata files from. The path will always end * with a '/'. @@ -26,7 +27,7 @@ class SimpleSAML_Metadata_MetaDataStorageHandlerFlatFile extends SimpleSAML_Meta * * @var array */ - private $cachedMetadata = array(); + private $cachedMetadata = []; /** @@ -40,10 +41,10 @@ class SimpleSAML_Metadata_MetaDataStorageHandlerFlatFile extends SimpleSAML_Meta */ protected function __construct($config) { - assert('is_array($config)'); + assert(is_array($config)); // get the configuration - $globalConfig = SimpleSAML_Configuration::getInstance(); + $globalConfig = \SimpleSAML\Configuration::getInstance(); // find the path to the directory we should search for metadata in if (array_key_exists('directory', $config)) { @@ -67,7 +68,7 @@ protected function __construct($config) * * @return array An associative array with the metadata, or null if we are unable to load metadata from the given * file. - * @throws Exception If the metadata set cannot be loaded. + * @throws \Exception If the metadata set cannot be loaded. */ private function load($set) { @@ -77,12 +78,12 @@ private function load($set) return null; } - $metadata = array(); + $metadata = []; include($metadatasetfile); if (!is_array($metadata)) { - throw new Exception('Could not load metadata set ['.$set.'] from file: '.$metadatasetfile); + throw new \Exception('Could not load metadata set ['.$set.'] from file: '.$metadatasetfile); } return $metadata; @@ -106,39 +107,16 @@ public function getMetadataSet($set) $metadataSet = $this->load($set); if ($metadataSet === null) { - $metadataSet = array(); + $metadataSet = []; } // add the entity id of an entry to each entry in the metadata foreach ($metadataSet as $entityId => &$entry) { - if (preg_match('/__DYNAMIC(:[0-9]+)?__/', $entityId)) { - $entry['entityid'] = $this->generateDynamicHostedEntityID($set); - } else { - $entry['entityid'] = $entityId; - } + $entry = $this->updateEntityID($set, $entityId, $entry); } $this->cachedMetadata[$set] = $metadataSet; return $metadataSet; } - - - private function generateDynamicHostedEntityID($set) - { - // get the configuration - $baseurl = \SimpleSAML\Utils\HTTP::getBaseURL(); - - if ($set === 'saml20-idp-hosted') { - return $baseurl.'saml2/idp/metadata.php'; - } elseif ($set === 'shib13-idp-hosted') { - return $baseurl.'shib13/idp/metadata.php'; - } elseif ($set === 'wsfed-sp-hosted') { - return 'urn:federation:'.\SimpleSAML\Utils\HTTP::getSelfHost(); - } elseif ($set === 'adfs-idp-hosted') { - return 'urn:federation:'.\SimpleSAML\Utils\HTTP::getSelfHost().':idp'; - } else { - throw new Exception('Can not generate dynamic EntityID for metadata of this type: ['.$set.']'); - } - } } diff --git a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Metadata/MetaDataStorageHandlerPdo.php b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Metadata/MetaDataStorageHandlerPdo.php index 0e349b7957..95f1417a1b 100644 --- a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Metadata/MetaDataStorageHandlerPdo.php +++ b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Metadata/MetaDataStorageHandlerPdo.php @@ -1,5 +1,6 @@ <?php +namespace SimpleSAML\Metadata; /** * Class for handling metadata files stored in a database. @@ -8,12 +9,11 @@ * mooknarf@gmail.com and patched to work with the latest version * of SimpleSAMLphp * - * @author Tyler Antonio, University of Alberta <tantonio@ualberta.ca> * @package SimpleSAMLphp */ -class SimpleSAML_Metadata_MetaDataStorageHandlerPdo extends SimpleSAML_Metadata_MetaDataStorageSource -{ +class MetaDataStorageHandlerPdo extends MetaDataStorageSource +{ /** * The PDO object */ @@ -27,12 +27,12 @@ class SimpleSAML_Metadata_MetaDataStorageHandlerPdo extends SimpleSAML_Metadata_ /** * This is an associative array which stores the different metadata sets we have loaded. */ - private $cachedMetadata = array(); + private $cachedMetadata = []; /** * All the metadata sets supported by this MetaDataStorageHandler */ - public $supportedSets = array( + public $supportedSets = [ 'adfs-idp-hosted', 'adfs-sp-remote', 'saml20-idp-hosted', @@ -44,7 +44,7 @@ class SimpleSAML_Metadata_MetaDataStorageHandlerPdo extends SimpleSAML_Metadata_ 'shib13-sp-remote', 'wsfed-idp-remote', 'wsfed-sp-hosted' - ); + ]; /** @@ -60,9 +60,9 @@ class SimpleSAML_Metadata_MetaDataStorageHandlerPdo extends SimpleSAML_Metadata_ */ public function __construct($config) { - assert('is_array($config)'); + assert(is_array($config)); - $this->db = SimpleSAML\Database::getInstance(); + $this->db = \SimpleSAML\Database::getInstance(); } @@ -75,12 +75,12 @@ public function __construct($config) * @return array $metadata Associative array with the metadata, or NULL if we are unable to load metadata from the * given file. * - * @throws Exception If a database error occurs. - * @throws SimpleSAML_Error_Exception If the metadata can be retrieved from the database, but cannot be decoded. + * @throws \Exception If a database error occurs. + * @throws \SimpleSAML\Error\Exception If the metadata can be retrieved from the database, but cannot be decoded. */ private function load($set) { - assert('is_string($set)'); + assert(is_string($set)); $tableName = $this->getTableName($set); @@ -90,12 +90,12 @@ private function load($set) $stmt = $this->db->read("SELECT entity_id, entity_data FROM $tableName"); if ($stmt->execute()) { - $metadata = array(); + $metadata = []; while ($d = $stmt->fetch()) { $data = json_decode($d['entity_data'], true); if ($data === null) { - throw new SimpleSAML_Error_Exception("Cannot decode metadata for entity '${d['entity_id']}'"); + throw new \SimpleSAML\Error\Exception("Cannot decode metadata for entity '${d['entity_id']}'"); } if (!array_key_exists('entityid', $data)) { $data['entityid'] = $d['entity_id']; @@ -105,7 +105,7 @@ private function load($set) return $metadata; } else { - throw new Exception('PDO metadata handler: Database error: '.var_export($this->db->getLastError(), true)); + throw new \Exception('PDO metadata handler: Database error: '.var_export($this->db->getLastError(), true)); } } @@ -119,7 +119,7 @@ private function load($set) */ public function getMetadataSet($set) { - assert('is_string($set)'); + assert(is_string($set)); if (array_key_exists($set, $this->cachedMetadata)) { return $this->cachedMetadata[$set]; @@ -127,46 +127,87 @@ public function getMetadataSet($set) $metadataSet = $this->load($set); if ($metadataSet === null) { - $metadataSet = array(); + $metadataSet = []; } + /** @var array $metadataSet */ foreach ($metadataSet as $entityId => &$entry) { - if (preg_match('/__DYNAMIC(:[0-9]+)?__/', $entityId)) { - $entry['entityid'] = $this->generateDynamicHostedEntityID($set); - } else { - $entry['entityid'] = $entityId; - } + $entry = $this->updateEntityID($set, $entityId, $entry); } $this->cachedMetadata[$set] = $metadataSet; return $metadataSet; } - - private function generateDynamicHostedEntityID($set) + /** + * Retrieve a metadata entry. + * + * @param string $entityId The entityId we are looking up. + * @param string $set The set we are looking for metadata in. + * + * @return array An associative array with metadata for the given entity, or NULL if we are unable to + * locate the entity. + */ + public function getMetaData($entityId, $set) { - assert('is_string($set)'); - - // get the configuration - $baseurl = \SimpleSAML\Utils\HTTP::getBaseURL(); - - if ($set === 'saml20-idp-hosted') { - return $baseurl.'saml2/idp/metadata.php'; - } elseif ($set === 'saml20-sp-hosted') { - return $baseurl.'saml2/sp/metadata.php'; - } elseif ($set === 'shib13-idp-hosted') { - return $baseurl.'shib13/idp/metadata.php'; - } elseif ($set === 'shib13-sp-hosted') { - return $baseurl.'shib13/sp/metadata.php'; - } elseif ($set === 'wsfed-sp-hosted') { - return 'urn:federation:'.\SimpleSAML\Utils\HTTP::getSelfHost(); - } elseif ($set === 'adfs-idp-hosted') { - return 'urn:federation:'.\SimpleSAML\Utils\HTTP::getSelfHost().':idp'; - } else { - throw new Exception('Can not generate dynamic EntityID for metadata of this type: ['.$set.']'); + assert(is_string($entityId)); + assert(is_string($set)); + + // validate the metadata set is valid + if (!in_array($set, $this->supportedSets, true)) { + return null; + } + + // support caching + if (isset($this->cachedMetadata[$entityId][$set])) { + return $this->cachedMetadata[$entityId][$set]; } - } + $tableName = $this->getTableName($set); + + // according to the docs, it looks like *-idp-hosted metadata are the types + // that allow the __DYNAMIC:*__ entity id. with the current table design + // we need to lookup the specific metadata entry but also we need to lookup + // any dynamic entries to see if the dynamic hosted entity id matches + if (substr($set, -10) == 'idp-hosted') { + $stmt = $this->db->read( + "SELECT entity_id, entity_data FROM {$tableName} WHERE (entity_id LIKE :dynamicId OR entity_id = :entityId)", + ['dynamicId' => '__DYNAMIC%', 'entityId' => $entityId] + ); + } + // other metadata types should be able to match on entity id + else { + $stmt = $this->db->read( + "SELECT entity_id, entity_data FROM {$tableName} WHERE entity_id = :entityId", + ['entityId' => $entityId] + ); + } + + // throw pdo exception upon execution failure + if (!$stmt->execute()) { + throw new \Exception('PDO metadata handler: Database error: '.var_export($this->db->getLastError(), true)); + } + + // load the metadata into an array + $metadataSet = []; + while ($d = $stmt->fetch()) { + $data = json_decode($d['entity_data'], true); + if (json_last_error() != JSON_ERROR_NONE) { + throw new \SimpleSAML\Error\Exception("Cannot decode metadata for entity '${d['entity_id']}'"); + } + + // update the entity id to either the key (if not dynamic or generate the dynamic hosted url) + $metadataSet[$d['entity_id']] = $this->updateEntityID($set, $entityId, $data); + } + + $indexLookup = $this->lookupIndexFromEntityId($entityId, $metadataSet); + if (isset($indexLookup) && array_key_exists($indexLookup, $metadataSet)) { + $this->cachedMetadata[$indexLookup][$set] = $metadataSet[$indexLookup]; + return $this->cachedMetadata[$indexLookup][$set]; + } + + return null; + } /** * Add metadata to the configured database @@ -179,9 +220,9 @@ private function generateDynamicHostedEntityID($set) */ public function addEntry($index, $set, $entityData) { - assert('is_string($index)'); - assert('is_string($set)'); - assert('is_array($entityData)'); + assert(is_string($index)); + assert(is_string($set)); + assert(is_array($entityData)); if (!in_array($set, $this->supportedSets, true)) { return false; @@ -191,17 +232,17 @@ public function addEntry($index, $set, $entityData) $metadata = $this->db->read( "SELECT entity_id, entity_data FROM $tableName WHERE entity_id = :entity_id", - array( + [ 'entity_id' => $index, - ) + ] ); $retrivedEntityIDs = $metadata->fetch(); - $params = array( + $params = [ 'entity_id' => $index, 'entity_data' => json_encode($entityData), - ); + ]; if ($retrivedEntityIDs !== false && count($retrivedEntityIDs) > 0) { $rows = $this->db->write( @@ -229,7 +270,7 @@ public function addEntry($index, $set, $entityData) */ private function getTableName($table) { - assert('is_string($table)'); + assert(is_string($table)); return $this->db->applyPrefix(str_replace("-", "_", $this->tablePrefix.$table)); } @@ -250,7 +291,7 @@ public function initDatabase() "CREATE TABLE IF NOT EXISTS $tableName (entity_id VARCHAR(255) PRIMARY KEY NOT NULL, entity_data ". "TEXT NOT NULL)" ); - if ($rows === 0) { + if ($rows === false) { $fine = false; } else { $stmt += $rows; @@ -261,5 +302,4 @@ public function initDatabase() } return $stmt; } - } diff --git a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Metadata/MetaDataStorageHandlerSerialize.php b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Metadata/MetaDataStorageHandlerSerialize.php index c487d31b7c..8c05077567 100644 --- a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Metadata/MetaDataStorageHandlerSerialize.php +++ b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Metadata/MetaDataStorageHandlerSerialize.php @@ -1,14 +1,15 @@ <?php +namespace SimpleSAML\Metadata; /** * Class for handling metadata files in serialized format. * * @package SimpleSAMLphp */ -class SimpleSAML_Metadata_MetaDataStorageHandlerSerialize extends SimpleSAML_Metadata_MetaDataStorageSource -{ +class MetaDataStorageHandlerSerialize extends MetaDataStorageSource +{ /** * The file extension we use for our metadata files. * @@ -34,11 +35,11 @@ class SimpleSAML_Metadata_MetaDataStorageHandlerSerialize extends SimpleSAML_Met */ public function __construct($config) { - assert('is_array($config)'); + assert(is_array($config)); - $globalConfig = SimpleSAML_Configuration::getInstance(); + $globalConfig = \SimpleSAML\Configuration::getInstance(); - $cfgHelp = SimpleSAML_Configuration::loadFromArray($config, 'serialize metadata source'); + $cfgHelp = \SimpleSAML\Configuration::loadFromArray($config, 'serialize metadata source'); $this->directory = $cfgHelp->getString('directory'); @@ -59,8 +60,8 @@ public function __construct($config) */ private function getMetadataPath($entityId, $set) { - assert('is_string($entityId)'); - assert('is_string($set)'); + assert(is_string($entityId)); + assert(is_string($set)); return $this->directory.'/'.rawurlencode($set).'/'.rawurlencode($entityId).self::EXTENSION; } @@ -73,18 +74,17 @@ private function getMetadataPath($entityId, $set) */ public function getMetadataSets() { - $ret = array(); + $ret = []; $dh = @opendir($this->directory); if ($dh === false) { - SimpleSAML\Logger::warning( + \SimpleSAML\Logger::warning( 'Serialize metadata handler: Unable to open directory: '.var_export($this->directory, true) ); return $ret; } while (($entry = readdir($dh)) !== false) { - if ($entry[0] === '.') { // skip '..', '.' and hidden files continue; @@ -93,7 +93,7 @@ public function getMetadataSets() $path = $this->directory.'/'.$entry; if (!is_dir($path)) { - SimpleSAML\Logger::warning( + \SimpleSAML\Logger::warning( 'Serialize metadata handler: Metadata directory contained a file where only directories should '. 'exist: '.var_export($path, true) ); @@ -118,9 +118,9 @@ public function getMetadataSets() */ public function getMetadataSet($set) { - assert('is_string($set)'); + assert(is_string($set)); - $ret = array(); + $ret = []; $dir = $this->directory.'/'.rawurlencode($set); if (!is_dir($dir)) { @@ -130,7 +130,9 @@ public function getMetadataSet($set) $dh = @opendir($dir); if ($dh === false) { - SimpleSAML\Logger::warning('Serialize metadata handler: Unable to open directory: '.var_export($dir, true)); + \SimpleSAML\Logger::warning( + 'Serialize metadata handler: Unable to open directory: '.var_export($dir, true) + ); return $ret; } @@ -171,8 +173,8 @@ public function getMetadataSet($set) */ public function getMetaData($entityId, $set) { - assert('is_string($entityId)'); - assert('is_string($set)'); + assert(is_string($entityId)); + assert(is_string($set)); $filePath = $this->getMetadataPath($entityId, $set); @@ -183,7 +185,7 @@ public function getMetaData($entityId, $set) $data = @file_get_contents($filePath); if ($data === false) { $error = error_get_last(); - SimpleSAML\Logger::warning( + \SimpleSAML\Logger::warning( 'Error reading file '.$filePath.': '.$error['message'] ); return null; @@ -191,7 +193,7 @@ public function getMetaData($entityId, $set) $data = @unserialize($data); if ($data === false) { - SimpleSAML\Logger::warning('Error unserializing file: '.$filePath); + \SimpleSAML\Logger::warning('Error unserializing file: '.$filePath); return null; } @@ -214,39 +216,39 @@ public function getMetaData($entityId, $set) */ public function saveMetadata($entityId, $set, $metadata) { - assert('is_string($entityId)'); - assert('is_string($set)'); - assert('is_array($metadata)'); + assert(is_string($entityId)); + assert(is_string($set)); + assert(is_array($metadata)); $filePath = $this->getMetadataPath($entityId, $set); $newPath = $filePath.'.new'; $dir = dirname($filePath); if (!is_dir($dir)) { - SimpleSAML\Logger::info('Creating directory: '.$dir); + \SimpleSAML\Logger::info('Creating directory: '.$dir); $res = @mkdir($dir, 0777, true); if ($res === false) { $error = error_get_last(); - SimpleSAML\Logger::error('Failed to create directory '.$dir.': '.$error['message']); + \SimpleSAML\Logger::error('Failed to create directory '.$dir.': '.$error['message']); return false; } } $data = serialize($metadata); - SimpleSAML\Logger::debug('Writing: '.$newPath); + \SimpleSAML\Logger::debug('Writing: '.$newPath); $res = file_put_contents($newPath, $data); if ($res === false) { $error = error_get_last(); - SimpleSAML\Logger::error('Error saving file '.$newPath.': '.$error['message']); + \SimpleSAML\Logger::error('Error saving file '.$newPath.': '.$error['message']); return false; } $res = rename($newPath, $filePath); if ($res === false) { $error = error_get_last(); - SimpleSAML\Logger::error('Error renaming '.$newPath.' to '.$filePath.': '.$error['message']); + \SimpleSAML\Logger::error('Error renaming '.$newPath.' to '.$filePath.': '.$error['message']); return false; } @@ -262,13 +264,13 @@ public function saveMetadata($entityId, $set, $metadata) */ public function deleteMetadata($entityId, $set) { - assert('is_string($entityId)'); - assert('is_string($set)'); + assert(is_string($entityId)); + assert(is_string($set)); $filePath = $this->getMetadataPath($entityId, $set); if (!file_exists($filePath)) { - SimpleSAML\Logger::warning( + \SimpleSAML\Logger::warning( 'Attempted to erase nonexistent metadata entry '. var_export($entityId, true).' in set '.var_export($set, true).'.' ); @@ -278,7 +280,7 @@ public function deleteMetadata($entityId, $set) $res = unlink($filePath); if ($res === false) { $error = error_get_last(); - SimpleSAML\Logger::error( + \SimpleSAML\Logger::error( 'Failed to delete file '.$filePath. ': '.$error['message'] ); diff --git a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Metadata/MetaDataStorageHandlerXML.php b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Metadata/MetaDataStorageHandlerXML.php index 44dba1fcfe..9430781b6c 100644 --- a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Metadata/MetaDataStorageHandlerXML.php +++ b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Metadata/MetaDataStorageHandlerXML.php @@ -1,5 +1,6 @@ <?php +namespace SimpleSAML\Metadata; /** * This class implements a metadata source which loads metadata from XML files. @@ -8,7 +9,8 @@ * @author Olav Morken, UNINETT AS. * @package SimpleSAMLphp */ -class SimpleSAML_Metadata_MetaDataStorageHandlerXML extends SimpleSAML_Metadata_MetaDataStorageSource + +class MetaDataStorageHandlerXML extends MetaDataStorageSource { /** @@ -32,27 +34,34 @@ class SimpleSAML_Metadata_MetaDataStorageHandlerXML extends SimpleSAML_Metadata_ */ protected function __construct($config) { - // get the configuration - $globalConfig = SimpleSAML_Configuration::getInstance(); - + $src = $srcXml = null; if (array_key_exists('file', $config)) { + // get the configuration + $globalConfig = \SimpleSAML\Configuration::getInstance(); $src = $globalConfig->resolvePath($config['file']); } elseif (array_key_exists('url', $config)) { $src = $config['url']; + } elseif (array_key_exists('xml', $config)) { + $srcXml = $config['xml']; } else { - throw new Exception("Missing either 'file' or 'url' in XML metadata source configuration."); + throw new \Exception("Missing one of 'file', 'url' and 'xml' in XML metadata source configuration."); } - $SP1x = array(); - $IdP1x = array(); - $SP20 = array(); - $IdP20 = array(); - $AAD = array(); + $SP1x = []; + $IdP1x = []; + $SP20 = []; + $IdP20 = []; + $AAD = []; - $entities = SimpleSAML_Metadata_SAMLParser::parseDescriptorsFile($src); + if (isset($src)) { + $entities = SAMLParser::parseDescriptorsFile($src); + } elseif (isset($srcXml)) { + $entities = SAMLParser::parseDescriptorsString($srcXml); + } else { + throw new \Exception("Neither source file path/URI nor string data provided"); + } foreach ($entities as $entityId => $entity) { - $md = $entity->getMetadata1xSP(); if ($md !== null) { $SP1x[$entityId] = $md; @@ -79,13 +88,13 @@ protected function __construct($config) } } - $this->metadata = array( + $this->metadata = [ 'shib13-sp-remote' => $SP1x, 'shib13-idp-remote' => $IdP1x, 'saml20-sp-remote' => $SP20, 'saml20-idp-remote' => $IdP20, 'attributeauthority-remote' => $AAD, - ); + ]; } @@ -104,6 +113,6 @@ public function getMetadataSet($set) } // we don't have this metadata set - return array(); + return []; } } diff --git a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Metadata/MetaDataStorageSource.php b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Metadata/MetaDataStorageSource.php index 6d1d637f9d..a08db89b96 100644 --- a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Metadata/MetaDataStorageSource.php +++ b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Metadata/MetaDataStorageSource.php @@ -1,5 +1,6 @@ <?php +namespace SimpleSAML\Metadata; /** * This abstract class defines an interface for metadata storage sources. @@ -12,10 +13,9 @@ * @author Andreas Aakre Solberg, UNINETT AS. * @package SimpleSAMLphp */ -abstract class SimpleSAML_Metadata_MetaDataStorageSource -{ - +abstract class MetaDataStorageSource +{ /** * Parse array with metadata sources. * @@ -26,17 +26,17 @@ abstract class SimpleSAML_Metadata_MetaDataStorageSource * * @return array Parsed metadata configuration. * - * @throws Exception If something is wrong in the configuration. + * @throws \Exception If something is wrong in the configuration. */ public static function parseSources($sourcesConfig) { - assert('is_array($sourcesConfig)'); + assert(is_array($sourcesConfig)); - $sources = array(); + $sources = []; foreach ($sourcesConfig as $sourceConfig) { if (!is_array($sourceConfig)) { - throw new Exception("Found an element in metadata source configuration which wasn't an array."); + throw new \Exception("Found an element in metadata source configuration which wasn't an array."); } $sources[] = self::getSource($sourceConfig); @@ -55,7 +55,7 @@ public static function parseSources($sourcesConfig) * * @return mixed An instance of a metadata source with the given configuration. * - * @throws Exception If the metadata source type is invalid. + * @throws \Exception If the metadata source type is invalid. */ public static function getSource($sourceConfig) { @@ -69,26 +69,26 @@ public static function getSource($sourceConfig) switch ($type) { case 'flatfile': - return new SimpleSAML_Metadata_MetaDataStorageHandlerFlatFile($sourceConfig); + return new MetaDataStorageHandlerFlatFile($sourceConfig); case 'xml': - return new SimpleSAML_Metadata_MetaDataStorageHandlerXML($sourceConfig); + return new MetaDataStorageHandlerXML($sourceConfig); case 'serialize': - return new SimpleSAML_Metadata_MetaDataStorageHandlerSerialize($sourceConfig); + return new MetaDataStorageHandlerSerialize($sourceConfig); case 'mdx': case 'mdq': - return new \SimpleSAML\Metadata\Sources\MDQ($sourceConfig); + return new Sources\MDQ($sourceConfig); case 'pdo': - return new SimpleSAML_Metadata_MetaDataStorageHandlerPdo($sourceConfig); + return new MetaDataStorageHandlerPdo($sourceConfig); default: // metadata store from module try { - $className = SimpleSAML\Module::resolveClass( + $className = \SimpleSAML\Module::resolveClass( $type, 'MetadataStore', - 'SimpleSAML_Metadata_MetaDataStorageSource' + '\SimpleSAML\Metadata\MetaDataStorageSource' ); - } catch (Exception $e) { - throw new SimpleSAML\Error\CriticalConfigurationError( + } catch (\Exception $e) { + throw new \SimpleSAML\Error\CriticalConfigurationError( "Invalid 'type' for metadata source. Cannot find store '$type'.", null ); @@ -111,7 +111,7 @@ public static function getSource($sourceConfig) */ public function getMetadataSet($set) { - return array(); + return []; } @@ -139,7 +139,6 @@ public function getEntityIdFromHostPath($hostPath, $set, $type = 'entityid') } foreach ($metadataSet as $index => $entry) { - if (!array_key_exists('host', $entry)) { continue; } @@ -159,7 +158,7 @@ public function getEntityIdFromHostPath($hostPath, $set, $type = 'entityid') /** - * This function will go through all the metadata, and check the hint.cidr + * This function will go through all the metadata, and check the DiscoHints->IPHint * parameter, which defines a network space (ip range) for each remote entry. * This function returns the entityID for any of the entities that have an * IP range which the IP falls within. @@ -177,16 +176,27 @@ public function getPreferredEntityIdFromCIDRhint($set, $ip, $type = 'entityid') $metadataSet = $this->getMetadataSet($set); foreach ($metadataSet as $index => $entry) { + $cidrHints = []; + + // support hint.cidr for idp discovery + if (array_key_exists('hint.cidr', $entry) && is_array($entry['hint.cidr'])) { + $cidrHints = $entry['hint.cidr']; + } - if (!array_key_exists('hint.cidr', $entry)) { - continue; + // support discohints in idp metadata for idp discovery + if (array_key_exists('DiscoHints', $entry) + && array_key_exists('IPHint', $entry['DiscoHints']) + && is_array($entry['DiscoHints']['IPHint'])) { + // merge with hints derived from discohints, but prioritize hint.cidr in case it is used + $cidrHints = array_merge($entry['DiscoHints']['IPHint'], $cidrHints); } - if (!is_array($entry['hint.cidr'])) { + + if (empty($cidrHints)) { continue; } - foreach ($entry['hint.cidr'] as $hint_entry) { - if (SimpleSAML\Utils\Net::ipCIDRcheck($hint_entry, $ip)) { + foreach ($cidrHints as $hint_entry) { + if (\SimpleSAML\Utils\Net::ipCIDRcheck($hint_entry, $ip)) { if ($type === 'entityid') { return $entry['entityid']; } else { @@ -201,25 +211,60 @@ public function getPreferredEntityIdFromCIDRhint($set, $ip, $type = 'entityid') } - /* + /** + * This function retrieves metadata for the given entity id in the given set of metadata. + * It will return NULL if it is unable to locate the metadata. * + * This class implements this function using the getMetadataSet-function. A subclass should + * override this function if it doesn't implement the getMetadataSet function, or if the + * implementation of getMetadataSet is slow. + * + * @param string $index The entityId or metaindex we are looking up. + * @param string $set The set we are looking for metadata in. + * + * @return array|null An associative array with metadata for the given entity, or NULL if we are unable to + * locate the entity. */ - private function lookupIndexFromEntityId($entityId, $set) + public function getMetaData($index, $set) { - assert('is_string($entityId)'); - assert('isset($set)'); + + assert(is_string($index)); + assert(isset($set)); $metadataSet = $this->getMetadataSet($set); + $indexLookup = $this->lookupIndexFromEntityId($index, $metadataSet); + if (isset($indexLookup) && array_key_exists($indexLookup, $metadataSet)) { + return $metadataSet[$indexLookup]; + } + + return null; + } + + /** + * This method returns the full metadata set for a given entity id or null if the entity id cannot be found + * in the given metadata set. + * + * @param string $entityId + * @param array $metadataSet the already loaded metadata set + * @return mixed|null + */ + protected function lookupIndexFromEntityId($entityId, array $metadataSet) + { + assert(is_string($entityId)); + assert(is_array($metadataSet)); + // check for hostname - $currenthost = \SimpleSAML\Utils\HTTP::getSelfHost(); // sp.example.org + $currentHost = \SimpleSAML\Utils\HTTP::getSelfHost(); // sp.example.org foreach ($metadataSet as $index => $entry) { + // explicit index match if ($index === $entityId) { return $index; } + if ($entry['entityid'] === $entityId) { - if ($entry['host'] === '__DEFAULT__' || $entry['host'] === $currenthost) { + if ($entry['host'] === '__DEFAULT__' || $entry['host'] === $currentHost) { return $index; } } @@ -228,39 +273,71 @@ private function lookupIndexFromEntityId($entityId, $set) return null; } + /** + * @param string $set + * @throws \Exception + * @return string + */ + private function getDynamicHostedUrl($set) + { + assert(is_string($set)); + + // get the configuration + $baseUrl = \SimpleSAML\Utils\HTTP::getBaseURL(); + + if ($set === 'saml20-idp-hosted') { + return $baseUrl.'saml2/idp/metadata.php'; + } + else if ($set === 'saml20-sp-hosted') { + return $baseUrl.'saml2/sp/metadata.php'; + } + else if ($set === 'shib13-idp-hosted') { + return $baseUrl.'shib13/idp/metadata.php'; + } + else if ($set === 'shib13-sp-hosted') { + return $baseUrl.'shib13/sp/metadata.php'; + } + else if ($set === 'wsfed-sp-hosted') { + return 'urn:federation:'.\SimpleSAML\Utils\HTTP::getSelfHost(); + } + else if ($set === 'adfs-idp-hosted') { + return 'urn:federation:'.\SimpleSAML\Utils\HTTP::getSelfHost().':idp'; + } + else { + throw new \Exception('Can not generate dynamic EntityID for metadata of this type: ['.$set.']'); + } + } /** - * This function retrieves metadata for the given entity id in the given set of metadata. - * It will return NULL if it is unable to locate the metadata. + * Updates the metadata entry's entity id and returns the modified array. If the entity id is __DYNAMIC:*__ a + * the current url is assigned. If it is explicit the entityid array key is updated to the entityId that was + * provided. * - * This class implements this function using the getMetadataSet-function. A subclass should - * override this function if it doesn't implement the getMetadataSet function, or if the - * implementation of getMetadataSet is slow. - * - * @param string $index The entityId or metaindex we are looking up. - * @param string $set The set we are looking for metadata in. + * @param string $metadataSet a metadata set (saml20-idp-hosted, saml20-sp-remote, etc) + * @param string $entityId the entity id we are modifying + * @param array $metadataEntry the fully populated metadata entry * * @return array An associative array with metadata for the given entity, or NULL if we are unable to * locate the entity. + * @throws \Exception */ - public function getMetaData($index, $set) + protected function updateEntityID($metadataSet, $entityId, array $metadataEntry) { + assert(is_string($metadataSet)); + assert(is_string($entityId)); + assert(is_array($metadataEntry)); - assert('is_string($index)'); - assert('isset($set)'); - - $metadataSet = $this->getMetadataSet($set); + $modifiedMetadataEntry = $metadataEntry; - if (array_key_exists($index, $metadataSet)) { - return $metadataSet[$index]; + // generate a dynamic hosted url + if (preg_match('/__DYNAMIC(:[0-9]+)?__/', $entityId)) { + $modifiedMetadataEntry['entityid'] = $this->getDynamicHostedUrl($metadataSet); } - - $indexlookup = $this->lookupIndexFromEntityId($index, $set); - if (isset($indexlookup) && array_key_exists($indexlookup, $metadataSet)) { - return $metadataSet[$indexlookup]; + // set the entityid metadata array key to the provided entity id + else { + $modifiedMetadataEntry['entityid'] = $entityId; } - return null; + return $modifiedMetadataEntry; } - } diff --git a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Metadata/SAMLBuilder.php b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Metadata/SAMLBuilder.php index 2f92f0fb28..929cb5ebf0 100644 --- a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Metadata/SAMLBuilder.php +++ b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Metadata/SAMLBuilder.php @@ -1,5 +1,6 @@ <?php +namespace SimpleSAML\Metadata; /** * Class for generating SAML 2.0 metadata from SimpleSAMLphp metadata arrays. @@ -8,10 +9,9 @@ * * @package SimpleSAMLphp */ -class SimpleSAML_Metadata_SAMLBuilder -{ - +class SAMLBuilder +{ /** * The EntityDescriptor we are building. * @@ -46,13 +46,13 @@ class SimpleSAML_Metadata_SAMLBuilder */ public function __construct($entityId, $maxCache = null, $maxDuration = null) { - assert('is_string($entityId)'); + assert(is_string($entityId)); $this->maxCache = $maxCache; $this->maxDuration = $maxDuration; $this->entityDescriptor = new \SAML2\XML\md\EntityDescriptor(); - $this->entityDescriptor->entityID = $entityId; + $this->entityDescriptor->setEntityID($entityId); } @@ -65,10 +65,10 @@ private function setExpiration($metadata) } if ($this->maxCache !== null) { - $this->entityDescriptor->cacheDuration = 'PT'.$this->maxCache.'S'; + $this->entityDescriptor->setCacheDuration('PT'.$this->maxCache.'S'); } if ($this->maxDuration !== null) { - $this->entityDescriptor->validUntil = time() + $this->maxDuration; + $this->entityDescriptor->setValidUntil(time() + $this->maxDuration); } } @@ -76,7 +76,7 @@ private function setExpiration($metadata) /** * Retrieve the EntityDescriptor element which is generated for this entity. * - * @return DOMElement The EntityDescriptor element of this entity. + * @return \DOMElement The EntityDescriptor element of this entity. */ public function getEntityDescriptor() { @@ -98,11 +98,11 @@ public function getEntityDescriptor() */ public function getEntityDescriptorText($formatted = true) { - assert('is_bool($formatted)'); + assert(is_bool($formatted)); $xml = $this->getEntityDescriptor(); if ($formatted) { - SimpleSAML\Utils\XML::formatDOMElement($xml); + \SimpleSAML\Utils\XML::formatDOMElement($xml); } return $xml->ownerDocument->saveXML(); @@ -116,58 +116,58 @@ public function getEntityDescriptorText($formatted = true) */ public function addSecurityTokenServiceType($metadata) { - assert('is_array($metadata)'); - assert('isset($metadata["entityid"])'); - assert('isset($metadata["metadata-set"])'); + assert(is_array($metadata)); + assert(isset($metadata['entityid'])); + assert(isset($metadata['metadata-set'])); - $metadata = SimpleSAML_Configuration::loadFromArray($metadata, $metadata['entityid']); + $metadata = \SimpleSAML\Configuration::loadFromArray($metadata, $metadata['entityid']); $defaultEndpoint = $metadata->getDefaultEndpoint('SingleSignOnService'); - $e = new sspmod_adfs_SAML2_XML_fed_SecurityTokenServiceType(); - $e->Location = $defaultEndpoint['Location']; + $e = new \SimpleSAML\Module\adfs\SAML2\XML\fed\SecurityTokenServiceType(); + $e->setLocation($defaultEndpoint['Location']); $this->addCertificate($e, $metadata); - $this->entityDescriptor->RoleDescriptor[] = $e; + $this->entityDescriptor->addRoleDescriptor($e); } /** * Add extensions to the metadata. * - * @param SimpleSAML_Configuration $metadata The metadata to get extensions from. + * @param \SimpleSAML\Configuration $metadata The metadata to get extensions from. * @param \SAML2\XML\md\RoleDescriptor $e Reference to the element where the Extensions element should be included. */ - private function addExtensions(SimpleSAML_Configuration $metadata, \SAML2\XML\md\RoleDescriptor $e) + private function addExtensions(\SimpleSAML\Configuration $metadata, \SAML2\XML\md\RoleDescriptor $e) { if ($metadata->hasValue('tags')) { $a = new \SAML2\XML\saml\Attribute(); - $a->Name = 'tags'; + $a->setName('tags'); foreach ($metadata->getArray('tags') as $tag) { - $a->AttributeValue[] = new \SAML2\XML\saml\AttributeValue($tag); + $a->addAttributeValue(new \SAML2\XML\saml\AttributeValue($tag)); } - $e->Extensions[] = $a; + $e->setExtensions(array_merge($e->getExtensions(), [$a])); } if ($metadata->hasValue('hint.cidr')) { $a = new \SAML2\XML\saml\Attribute(); - $a->Name = 'hint.cidr'; + $a->setName('hint.cidr'); foreach ($metadata->getArray('hint.cidr') as $hint) { - $a->AttributeValue[] = new \SAML2\XML\saml\AttributeValue($hint); + $a->addAttributeValue(new \SAML2\XML\saml\AttributeValue($hint)); } - $e->Extensions[] = $a; + $e->setExtensions(array_merge($e->getExtensions(), [$a])); } if ($metadata->hasValue('scope')) { foreach ($metadata->getArray('scope') as $scopetext) { $s = new \SAML2\XML\shibmd\Scope(); - $s->scope = $scopetext; + $s->setScope($scopetext); // Check whether $ ^ ( ) * | \ are in a scope -> assume regex. if (1 === preg_match('/[\$\^\)\(\*\|\\\\]/', $scopetext)) { - $s->regexp = true; + $s->setIsRegexpScope(true); } else { - $s->regexp = false; + $s->setIsRegexpScope(false); } - $e->Extensions[] = $s; + $e->setExtensions(array_merge($e->getExtensions(), [$s])); } } @@ -175,23 +175,25 @@ private function addExtensions(SimpleSAML_Configuration $metadata, \SAML2\XML\md $ea = new \SAML2\XML\mdattr\EntityAttributes(); foreach ($metadata->getArray('EntityAttributes') as $attributeName => $attributeValues) { $a = new \SAML2\XML\saml\Attribute(); - $a->Name = $attributeName; - $a->NameFormat = 'urn:oasis:names:tc:SAML:2.0:attrname-format:uri'; + $a->setName($attributeName); + $a->setNameFormat('urn:oasis:names:tc:SAML:2.0:attrname-format:uri'); // Attribute names that is not URI is prefixed as this: '{nameformat}name' if (preg_match('/^\{(.*?)\}(.*)$/', $attributeName, $matches)) { - $a->Name = $matches[2]; + $a->setName($matches[2]); $nameFormat = $matches[1]; if ($nameFormat !== \SAML2\Constants::NAMEFORMAT_UNSPECIFIED) { - $a->NameFormat = $nameFormat; + $a->setNameFormat($nameFormat); } } foreach ($attributeValues as $attributeValue) { - $a->AttributeValue[] = new \SAML2\XML\saml\AttributeValue($attributeValue); + $a->addAttributeValue(new \SAML2\XML\saml\AttributeValue($attributeValue)); } - $ea->children[] = $a; + $ea->addChildren($a); } - $this->entityDescriptor->Extensions[] = $ea; + $this->entityDescriptor->setExtensions( + array_merge($this->entityDescriptor->getExtensions(), [$ea]) + ); } if ($metadata->hasValue('RegistrationInfo')) { @@ -199,17 +201,19 @@ private function addExtensions(SimpleSAML_Configuration $metadata, \SAML2\XML\md foreach ($metadata->getArray('RegistrationInfo') as $riName => $riValues) { switch ($riName) { case 'authority': - $ri->registrationAuthority = $riValues; + $ri->setRegistrationAuthority($riValues); break; case 'instant': - $ri->registrationInstant = \SAML2\Utils::xsDateTimeToTimestamp($riValues); + $ri->setRegistrationInstant(\SAML2\Utils::xsDateTimeToTimestamp($riValues)); break; case 'policies': - $ri->RegistrationPolicy = $riValues; + $ri->setRegistrationPolicy($riValues); break; } } - $this->entityDescriptor->Extensions[] = $ri; + $this->entityDescriptor->setExtensions( + array_merge($this->entityDescriptor->getExtensions(), [$ri]) + ); } if ($metadata->hasValue('UIInfo')) { @@ -217,40 +221,40 @@ private function addExtensions(SimpleSAML_Configuration $metadata, \SAML2\XML\md foreach ($metadata->getArray('UIInfo') as $uiName => $uiValues) { switch ($uiName) { case 'DisplayName': - $ui->DisplayName = $uiValues; + $ui->setDisplayName($uiValues); break; case 'Description': - $ui->Description = $uiValues; + $ui->setDescription($uiValues); break; case 'InformationURL': - $ui->InformationURL = $uiValues; + $ui->setInformationURL($uiValues); break; case 'PrivacyStatementURL': - $ui->PrivacyStatementURL = $uiValues; + $ui->setPrivacyStatementURL($uiValues); break; case 'Keywords': foreach ($uiValues as $lang => $keywords) { $uiItem = new \SAML2\XML\mdui\Keywords(); - $uiItem->lang = $lang; - $uiItem->Keywords = $keywords; - $ui->Keywords[] = $uiItem; + $uiItem->setLanguage($lang); + $uiItem->setKeywords($keywords); + $ui->addKeyword($uiItem); } break; case 'Logo': foreach ($uiValues as $logo) { $uiItem = new \SAML2\XML\mdui\Logo(); - $uiItem->url = $logo['url']; - $uiItem->width = $logo['width']; - $uiItem->height = $logo['height']; + $uiItem->setUrl($logo['url']); + $uiItem->setWidth($logo['width']); + $uiItem->setHeight($logo['height']); if (isset($logo['lang'])) { - $uiItem->lang = $logo['lang']; + $uiItem->setLanguage($logo['lang']); } - $ui->Logo[] = $uiItem; + $ui->addLogo($uiItem); } break; } } - $e->Extensions[] = $ui; + $e->setExtensions(array_merge($e->getExtensions(), [$ui])); } if ($metadata->hasValue('DiscoHints')) { @@ -258,17 +262,17 @@ private function addExtensions(SimpleSAML_Configuration $metadata, \SAML2\XML\md foreach ($metadata->getArray('DiscoHints') as $dhName => $dhValues) { switch ($dhName) { case 'IPHint': - $dh->IPHint = $dhValues; + $dh->setIPHint($dhValues); break; case 'DomainHint': - $dh->DomainHint = $dhValues; + $dh->setDomainHint($dhValues); break; case 'GeolocationHint': - $dh->GeolocationHint = $dhValues; + $dh->setGeolocationHint($dhValues); break; } } - $e->Extensions[] = $dh; + $e->setExtensions(array_merge($e->getExtensions(), [$dh])); } } @@ -284,11 +288,11 @@ public function addOrganization(array $orgName, array $orgDisplayName, array $or { $org = new \SAML2\XML\md\Organization(); - $org->OrganizationName = $orgName; - $org->OrganizationDisplayName = $orgDisplayName; - $org->OrganizationURL = $orgURL; + $org->setOrganizationName($orgName); + $org->setOrganizationDisplayName($orgDisplayName); + $org->setOrganizationURL($orgURL); - $this->entityDescriptor->Organization = $org; + $this->entityDescriptor->setOrganization($org); } @@ -299,8 +303,7 @@ public function addOrganization(array $orgName, array $orgDisplayName, array $or */ public function addOrganizationInfo(array $metadata) { - if ( - empty($metadata['OrganizationName']) || + if (empty($metadata['OrganizationName']) || empty($metadata['OrganizationDisplayName']) || empty($metadata['OrganizationURL']) ) { @@ -308,9 +311,9 @@ public function addOrganizationInfo(array $metadata) return; } - $orgName = SimpleSAML\Utils\Arrays::arrayize($metadata['OrganizationName'], 'en'); - $orgDisplayName = SimpleSAML\Utils\Arrays::arrayize($metadata['OrganizationDisplayName'], 'en'); - $orgURL = SimpleSAML\Utils\Arrays::arrayize($metadata['OrganizationURL'], 'en'); + $orgName = \SimpleSAML\Utils\Arrays::arrayize($metadata['OrganizationName'], 'en'); + $orgDisplayName = \SimpleSAML\Utils\Arrays::arrayize($metadata['OrganizationDisplayName'], 'en'); + $orgURL = \SimpleSAML\Utils\Arrays::arrayize($metadata['OrganizationURL'], 'en'); $this->addOrganization($orgName, $orgDisplayName, $orgURL); } @@ -322,13 +325,14 @@ public function addOrganizationInfo(array $metadata) * @param array $endpoints The endpoints. * @param bool $indexed Whether the endpoints should be indexed. * - * @return array An array of endpoint objects, either \SAML2\XML\md\EndpointType or \SAML2\XML\md\IndexedEndpointType. + * @return array An array of endpoint objects, + * either \SAML2\XML\md\EndpointType or \SAML2\XML\md\IndexedEndpointType. */ private static function createEndpoints(array $endpoints, $indexed) { - assert('is_bool($indexed)'); + assert(is_bool($indexed)); - $ret = array(); + $ret = []; foreach ($endpoints as &$ep) { if ($indexed) { @@ -337,10 +341,10 @@ private static function createEndpoints(array $endpoints, $indexed) $t = new \SAML2\XML\md\EndpointType(); } - $t->Binding = $ep['Binding']; - $t->Location = $ep['Location']; + $t->setBinding($ep['Binding']); + $t->setLocation($ep['Location']); if (isset($ep['ResponseLocation'])) { - $t->ResponseLocation = $ep['ResponseLocation']; + $t->setResponseLocation($ep['ResponseLocation']); } if (isset($ep['hoksso:ProtocolBinding'])) { $t->setAttributeNS( @@ -367,7 +371,7 @@ private static function createEndpoints(array $endpoints, $indexed) $ep['index'] = $maxIndex + 1; } - $t->index = $ep['index']; + $t->setIndex($ep['index']); } $ret[] = $t; @@ -381,13 +385,13 @@ private static function createEndpoints(array $endpoints, $indexed) * Add an AttributeConsumingService element to the metadata. * * @param \SAML2\XML\md\SPSSODescriptor $spDesc The SPSSODescriptor element. - * @param SimpleSAML_Configuration $metadata The metadata. + * @param \SimpleSAML\Configuration $metadata The metadata. */ private function addAttributeConsumingService( \SAML2\XML\md\SPSSODescriptor $spDesc, - SimpleSAML_Configuration $metadata + \SimpleSAML\Configuration $metadata ) { - $attributes = $metadata->getArray('attributes', array()); + $attributes = $metadata->getArray('attributes', []); $name = $metadata->getLocalizedString('name', null); if ($name === null || count($attributes) == 0) { @@ -395,7 +399,7 @@ private function addAttributeConsumingService( return; } - $attributesrequired = $metadata->getArray('attributes.required', array()); + $attributesrequired = $metadata->getArray('attributes.required', []); /* * Add an AttributeConsumingService element with information as name and description and list @@ -403,28 +407,32 @@ private function addAttributeConsumingService( */ $attributeconsumer = new \SAML2\XML\md\AttributeConsumingService(); - $attributeconsumer->index = 0; + $attributeconsumer->setIndex($metadata->getInteger('attributes.index', 0)); - $attributeconsumer->ServiceName = $name; - $attributeconsumer->ServiceDescription = $metadata->getLocalizedString('description', array()); + if ($metadata->hasValue('attributes.isDefault')) { + $attributeconsumer->setIsDefault($metadata->getBoolean('attributes.isDefault', false)); + } + + $attributeconsumer->setServiceName($name); + $attributeconsumer->setServiceDescription($metadata->getLocalizedString('description', [])); $nameFormat = $metadata->getString('attributes.NameFormat', \SAML2\Constants::NAMEFORMAT_UNSPECIFIED); foreach ($attributes as $friendlyName => $attribute) { $t = new \SAML2\XML\md\RequestedAttribute(); - $t->Name = $attribute; + $t->setName($attribute); if (!is_int($friendlyName)) { - $t->FriendlyName = $friendlyName; + $t->setFriendlyName($friendlyName); } if ($nameFormat !== \SAML2\Constants::NAMEFORMAT_UNSPECIFIED) { - $t->NameFormat = $nameFormat; + $t->setNameFormat($nameFormat); } if (in_array($attribute, $attributesrequired, true)) { - $t->isRequired = true; + $t->setIsRequired(true); } - $attributeconsumer->RequestedAttribute[] = $t; + $attributeconsumer->addRequestedAttribute($t); } - $spDesc->AttributeConsumingService[] = $attributeconsumer; + $spDesc->addAttributeConsumingService($attributeconsumer); } @@ -436,8 +444,8 @@ private function addAttributeConsumingService( */ public function addMetadata($set, $metadata) { - assert('is_string($set)'); - assert('is_array($metadata)'); + assert(is_string($set)); + assert(is_array($metadata)); $this->setExpiration($metadata); @@ -458,7 +466,7 @@ public function addMetadata($set, $metadata) $this->addAttributeAuthority($metadata); break; default: - SimpleSAML\Logger::warning('Unable to generate metadata for unknown type \''.$set.'\'.'); + \SimpleSAML\Logger::warning('Unable to generate metadata for unknown type \''.$set.'\'.'); } } @@ -469,50 +477,50 @@ public function addMetadata($set, $metadata) * @param array $metadata The metadata. * @param array $protocols The protocols supported. Defaults to \SAML2\Constants::NS_SAMLP. */ - public function addMetadataSP20($metadata, $protocols = array(\SAML2\Constants::NS_SAMLP)) + public function addMetadataSP20($metadata, $protocols = [\SAML2\Constants::NS_SAMLP]) { - assert('is_array($metadata)'); - assert('is_array($protocols)'); - assert('isset($metadata["entityid"])'); - assert('isset($metadata["metadata-set"])'); + assert(is_array($metadata)); + assert(is_array($protocols)); + assert(isset($metadata['entityid'])); + assert(isset($metadata['metadata-set'])); - $metadata = SimpleSAML_Configuration::loadFromArray($metadata, $metadata['entityid']); + $metadata = \SimpleSAML\Configuration::loadFromArray($metadata, $metadata['entityid']); $e = new \SAML2\XML\md\SPSSODescriptor(); - $e->protocolSupportEnumeration = $protocols; + $e->setProtocolSupportEnumeration($protocols); if ($metadata->hasValue('saml20.sign.assertion')) { - $e->WantAssertionsSigned = $metadata->getBoolean('saml20.sign.assertion'); + $e->setWantAssertionsSigned($metadata->getBoolean('saml20.sign.assertion')); } if ($metadata->hasValue('redirect.validate')) { - $e->AuthnRequestsSigned = $metadata->getBoolean('redirect.validate'); + $e->setAuthnRequestsSigned($metadata->getBoolean('redirect.validate')); } elseif ($metadata->hasValue('validate.authnrequest')) { - $e->AuthnRequestsSigned = $metadata->getBoolean('validate.authnrequest'); + $e->setAuthnRequestsSigned($metadata->getBoolean('validate.authnrequest')); } $this->addExtensions($metadata, $e); $this->addCertificate($e, $metadata); - $e->SingleLogoutService = self::createEndpoints($metadata->getEndpoints('SingleLogoutService'), false); + $e->setSingleLogoutService(self::createEndpoints($metadata->getEndpoints('SingleLogoutService'), false)); - $e->NameIDFormat = $metadata->getArrayizeString('NameIDFormat', array()); + $e->setNameIDFormat($metadata->getArrayizeString('NameIDFormat', [])); $endpoints = $metadata->getEndpoints('AssertionConsumerService'); - foreach ($metadata->getArrayizeString('AssertionConsumerService.artifact', array()) as $acs) { - $endpoints[] = array( + foreach ($metadata->getArrayizeString('AssertionConsumerService.artifact', []) as $acs) { + $endpoints[] = [ 'Binding' => 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Artifact', 'Location' => $acs, - ); + ]; } - $e->AssertionConsumerService = self::createEndpoints($endpoints, true); + $e->setAssertionConsumerService(self::createEndpoints($endpoints, true)); $this->addAttributeConsumingService($e, $metadata); - $this->entityDescriptor->RoleDescriptor[] = $e; + $this->entityDescriptor->addRoleDescriptor($e); - foreach ($metadata->getArray('contacts', array()) as $contact) { + foreach ($metadata->getArray('contacts', []) as $contact) { if (array_key_exists('contactType', $contact) && array_key_exists('emailAddress', $contact)) { $this->addContact($contact['contactType'], \SimpleSAML\Utils\Config\Metadata::getContact($contact)); } @@ -527,19 +535,19 @@ public function addMetadataSP20($metadata, $protocols = array(\SAML2\Constants:: */ public function addMetadataIdP20($metadata) { - assert('is_array($metadata)'); - assert('isset($metadata["entityid"])'); - assert('isset($metadata["metadata-set"])'); + assert(is_array($metadata)); + assert(isset($metadata['entityid'])); + assert(isset($metadata['metadata-set'])); - $metadata = SimpleSAML_Configuration::loadFromArray($metadata, $metadata['entityid']); + $metadata = \SimpleSAML\Configuration::loadFromArray($metadata, $metadata['entityid']); $e = new \SAML2\XML\md\IDPSSODescriptor(); - $e->protocolSupportEnumeration[] = 'urn:oasis:names:tc:SAML:2.0:protocol'; + $e->setProtocolSupportEnumeration(array_merge($e->getProtocolSupportEnumeration(), ['urn:oasis:names:tc:SAML:2.0:protocol'])); if ($metadata->hasValue('sign.authnrequest')) { - $e->WantAuthnRequestsSigned = $metadata->getBoolean('sign.authnrequest'); + $e->setWantAuthnRequestsSigned($metadata->getBoolean('sign.authnrequest')); } elseif ($metadata->hasValue('redirect.sign')) { - $e->WantAuthnRequestsSigned = $metadata->getBoolean('redirect.sign'); + $e->setWantAuthnRequestsSigned($metadata->getBoolean('redirect.sign')); } $this->addExtensions($metadata, $e); @@ -547,21 +555,21 @@ public function addMetadataIdP20($metadata) $this->addCertificate($e, $metadata); if ($metadata->hasValue('ArtifactResolutionService')) { - $e->ArtifactResolutionService = self::createEndpoints( + $e->setArtifactResolutionService(self::createEndpoints( $metadata->getEndpoints('ArtifactResolutionService'), true - ); + )); } - $e->SingleLogoutService = self::createEndpoints($metadata->getEndpoints('SingleLogoutService'), false); + $e->setSingleLogoutService(self::createEndpoints($metadata->getEndpoints('SingleLogoutService'), false)); - $e->NameIDFormat = $metadata->getArrayizeString('NameIDFormat', array()); + $e->setNameIDFormat($metadata->getArrayizeString('NameIDFormat', [])); - $e->SingleSignOnService = self::createEndpoints($metadata->getEndpoints('SingleSignOnService'), false); + $e->setSingleSignOnService(self::createEndpoints($metadata->getEndpoints('SingleSignOnService'), false)); - $this->entityDescriptor->RoleDescriptor[] = $e; + $this->entityDescriptor->addRoleDescriptor($e); - foreach ($metadata->getArray('contacts', array()) as $contact) { + foreach ($metadata->getArray('contacts', []) as $contact) { if (array_key_exists('contactType', $contact) && array_key_exists('emailAddress', $contact)) { $this->addContact($contact['contactType'], \SimpleSAML\Utils\Config\Metadata::getContact($contact)); } @@ -576,31 +584,34 @@ public function addMetadataIdP20($metadata) */ public function addMetadataSP11($metadata) { - assert('is_array($metadata)'); - assert('isset($metadata["entityid"])'); - assert('isset($metadata["metadata-set"])'); + assert(is_array($metadata)); + assert(isset($metadata['entityid'])); + assert(isset($metadata['metadata-set'])); - $metadata = SimpleSAML_Configuration::loadFromArray($metadata, $metadata['entityid']); + $metadata = \SimpleSAML\Configuration::loadFromArray($metadata, $metadata['entityid']); $e = new \SAML2\XML\md\SPSSODescriptor(); - $e->protocolSupportEnumeration[] = 'urn:oasis:names:tc:SAML:1.1:protocol'; + $e->setProtocolSupportEnumeration(array_merge( + $e->getProtocolSupportEnumeration(), + ['urn:oasis:names:tc:SAML:1.1:protocol'] + )); $this->addCertificate($e, $metadata); - $e->NameIDFormat = $metadata->getArrayizeString('NameIDFormat', array()); + $e->setNameIDFormat($metadata->getArrayizeString('NameIDFormat', [])); $endpoints = $metadata->getEndpoints('AssertionConsumerService'); - foreach ($metadata->getArrayizeString('AssertionConsumerService.artifact', array()) as $acs) { - $endpoints[] = array( + foreach ($metadata->getArrayizeString('AssertionConsumerService.artifact', []) as $acs) { + $endpoints[] = [ 'Binding' => 'urn:oasis:names:tc:SAML:1.0:profiles:artifact-01', 'Location' => $acs, - ); + ]; } - $e->AssertionConsumerService = self::createEndpoints($endpoints, true); + $e->setAssertionConsumerService(self::createEndpoints($endpoints, true)); $this->addAttributeConsumingService($e, $metadata); - $this->entityDescriptor->RoleDescriptor[] = $e; + $this->entityDescriptor->addRoleDescriptor($e); } @@ -611,23 +622,27 @@ public function addMetadataSP11($metadata) */ public function addMetadataIdP11($metadata) { - assert('is_array($metadata)'); - assert('isset($metadata["entityid"])'); - assert('isset($metadata["metadata-set"])'); + assert(is_array($metadata)); + assert(isset($metadata['entityid'])); + assert(isset($metadata['metadata-set'])); - $metadata = SimpleSAML_Configuration::loadFromArray($metadata, $metadata['entityid']); + $metadata = \SimpleSAML\Configuration::loadFromArray($metadata, $metadata['entityid']); $e = new \SAML2\XML\md\IDPSSODescriptor(); - $e->protocolSupportEnumeration[] = 'urn:oasis:names:tc:SAML:1.1:protocol'; - $e->protocolSupportEnumeration[] = 'urn:mace:shibboleth:1.0'; + $e->setProtocolSupportEnumeration( + array_merge($e->getProtocolSupportEnumeration(), [ + 'urn:oasis:names:tc:SAML:1.1:protocol', + 'urn:mace:shibboleth:1.0' + ]) + ); $this->addCertificate($e, $metadata); - $e->NameIDFormat = $metadata->getArrayizeString('NameIDFormat', array()); + $e->setNameIDFormat($metadata->getArrayizeString('NameIDFormat', [])); - $e->SingleSignOnService = self::createEndpoints($metadata->getEndpoints('SingleSignOnService'), false); + $e->setSingleSignOnService(self::createEndpoints($metadata->getEndpoints('SingleSignOnService'), false)); - $this->entityDescriptor->RoleDescriptor[] = $e; + $this->entityDescriptor->addRoleDescriptor($e); } @@ -635,31 +650,31 @@ public function addMetadataIdP11($metadata) * Add metadata of a SAML attribute authority. * * @param array $metadata The AttributeAuthorityDescriptor, in the format returned by - * SimpleSAML_Metadata_SAMLParser. + * \SimpleSAML\Metadata\SAMLParser. */ public function addAttributeAuthority(array $metadata) { - assert('is_array($metadata)'); - assert('isset($metadata["entityid"])'); - assert('isset($metadata["metadata-set"])'); + assert(is_array($metadata)); + assert(isset($metadata['entityid'])); + assert(isset($metadata['metadata-set'])); - $metadata = SimpleSAML_Configuration::loadFromArray($metadata, $metadata['entityid']); + $metadata = \SimpleSAML\Configuration::loadFromArray($metadata, $metadata['entityid']); $e = new \SAML2\XML\md\AttributeAuthorityDescriptor(); - $e->protocolSupportEnumeration = $metadata->getArray('protocols', array(\SAML2\Constants::NS_SAMLP)); + $e->setProtocolSupportEnumeration($metadata->getArray('protocols', [\SAML2\Constants::NS_SAMLP])); $this->addExtensions($metadata, $e); $this->addCertificate($e, $metadata); - $e->AttributeService = self::createEndpoints($metadata->getEndpoints('AttributeService'), false); - $e->AssertionIDRequestService = self::createEndpoints( + $e->setAttributeService(self::createEndpoints($metadata->getEndpoints('AttributeService'), false)); + $e->setAssertionIDRequestService(self::createEndpoints( $metadata->getEndpoints('AssertionIDRequestService'), false - ); + )); - $e->NameIDFormat = $metadata->getArrayizeString('NameIDFormat', array()); + $e->setNameIDFormat($metadata->getArrayizeString('NameIDFormat', [])); - $this->entityDescriptor->RoleDescriptor[] = $e; + $this->entityDescriptor->addRoleDescriptor($e); } @@ -678,51 +693,51 @@ public function addAttributeAuthority(array $metadata) */ public function addContact($type, $details) { - assert('is_string($type)'); - assert('is_array($details)'); - assert('in_array($type, array("technical", "support", "administrative", "billing", "other"), TRUE)'); + assert(is_string($type)); + assert(is_array($details)); + assert(in_array($type, ['technical', 'support', 'administrative', 'billing', 'other'], true)); // TODO: remove this check as soon as getContact() is called always before calling this function $details = \SimpleSAML\Utils\Config\Metadata::getContact($details); $e = new \SAML2\XML\md\ContactPerson(); - $e->contactType = $type; + $e->setContactType($type); if (!empty($details['attributes'])) { - $e->ContactPersonAttributes = $details['attributes']; + $e->setContactPersonAttributes($details['attributes']); } if (isset($details['company'])) { - $e->Company = $details['company']; + $e->setCompany($details['company']); } if (isset($details['givenName'])) { - $e->GivenName = $details['givenName']; + $e->setGivenName($details['givenName']); } if (isset($details['surName'])) { - $e->SurName = $details['surName']; + $e->setSurName($details['surName']); } if (isset($details['emailAddress'])) { $eas = $details['emailAddress']; if (!is_array($eas)) { - $eas = array($eas); + $eas = [$eas]; } foreach ($eas as $ea) { - $e->EmailAddress[] = $ea; + $e->addEmailAddress($ea); } } if (isset($details['telephoneNumber'])) { $tlfNrs = $details['telephoneNumber']; if (!is_array($tlfNrs)) { - $tlfNrs = array($tlfNrs); + $tlfNrs = [$tlfNrs]; } foreach ($tlfNrs as $tlfNr) { - $e->TelephoneNumber[] = $tlfNr; + $e->addTelephoneNumber($tlfNr); } } - $this->entityDescriptor->ContactPerson[] = $e; + $this->entityDescriptor->addContactPerson($e); } @@ -735,12 +750,12 @@ public function addContact($type, $details) */ private function addX509KeyDescriptor(\SAML2\XML\md\RoleDescriptor $rd, $use, $x509data) { - assert('in_array($use, array("encryption", "signing"), TRUE)'); - assert('is_string($x509data)'); + assert(in_array($use, ['encryption', 'signing'], true)); + assert(is_string($x509data)); $keyDescriptor = \SAML2\Utils::createKeyDescriptor($x509data); - $keyDescriptor->use = $use; - $rd->KeyDescriptor[] = $keyDescriptor; + $keyDescriptor->setUse($use); + $rd->addKeyDescriptor($keyDescriptor); } @@ -750,22 +765,20 @@ private function addX509KeyDescriptor(\SAML2\XML\md\RoleDescriptor $rd, $use, $x * Helper function for adding a certificate to the metadata. * * @param \SAML2\XML\md\RoleDescriptor $rd The RoleDescriptor the certificate should be added to. - * @param SimpleSAML_Configuration $metadata The metadata of the entity. + * @param \SimpleSAML\Configuration $metadata The metadata of the entity. */ - private function addCertificate(\SAML2\XML\md\RoleDescriptor $rd, SimpleSAML_Configuration $metadata) + private function addCertificate(\SAML2\XML\md\RoleDescriptor $rd, \SimpleSAML\Configuration $metadata) { $keys = $metadata->getPublicKeys(); - if ($keys !== null) { - foreach ($keys as $key) { - if ($key['type'] !== 'X509Certificate') { - continue; - } - if (!isset($key['signing']) || $key['signing'] === true) { - $this->addX509KeyDescriptor($rd, 'signing', $key['X509Certificate']); - } - if (!isset($key['encryption']) || $key['encryption'] === true) { - $this->addX509KeyDescriptor($rd, 'encryption', $key['X509Certificate']); - } + foreach ($keys as $key) { + if ($key['type'] !== 'X509Certificate') { + continue; + } + if (!isset($key['signing']) || $key['signing'] === true) { + $this->addX509KeyDescriptor($rd, 'signing', $key['X509Certificate']); + } + if (!isset($key['encryption']) || $key['encryption'] === true) { + $this->addX509KeyDescriptor($rd, 'encryption', $key['X509Certificate']); } } diff --git a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Metadata/SAMLParser.php b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Metadata/SAMLParser.php index bd8886e680..cfced57c9e 100644 --- a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Metadata/SAMLParser.php +++ b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Metadata/SAMLParser.php @@ -1,40 +1,41 @@ <?php +namespace SimpleSAML\Metadata; + +use RobRichards\XMLSecLibs\XMLSecurityKey; /** * This is class for parsing of SAML 1.x and SAML 2.0 metadata. * * Metadata is loaded by calling the static methods parseFile, parseString or parseElement. - * These functions returns an instance of SimpleSAML_Metadata_SAMLParser. To get metadata + * These functions returns an instance of SAMLParser. To get metadata * from this object, use the methods getMetadata1xSP or getMetadata20SP. * * To parse a file which can contain a collection of EntityDescriptor or EntitiesDescriptor elements, use the * parseDescriptorsFile, parseDescriptorsString or parseDescriptorsElement methods. These functions will return * an array of SAMLParser elements where each element represents an EntityDescriptor-element. */ -class SimpleSAML_Metadata_SAMLParser -{ +class SAMLParser +{ /** * This is the list of SAML 1.x protocols. * * @var string[] */ - private static $SAML1xProtocols = array( + private static $SAML1xProtocols = [ 'urn:oasis:names:tc:SAML:1.0:protocol', 'urn:oasis:names:tc:SAML:1.1:protocol', - ); - + ]; /** * This is the list with the SAML 2.0 protocol. * * @var string[] */ - private static $SAML20Protocols = array( + private static $SAML20Protocols = [ 'urn:oasis:names:tc:SAML:2.0:protocol', - ); - + ]; /** * This is the entity id we find in the metadata. @@ -43,7 +44,6 @@ class SimpleSAML_Metadata_SAMLParser */ private $entityId; - /** * This is an array with the processed SPSSODescriptor elements we have found in this * metadata file. @@ -56,7 +56,6 @@ class SimpleSAML_Metadata_SAMLParser */ private $spDescriptors; - /** * This is an array with the processed IDPSSODescriptor elements we have found. * Each element in the array is an associative array with the elements from parseSSODescriptor and: @@ -67,14 +66,12 @@ class SimpleSAML_Metadata_SAMLParser */ private $idpDescriptors; - /** * List of attribute authorities we have found. * * @var array */ - private $attributeAuthorityDescriptors = array(); - + private $attributeAuthorityDescriptors = []; /** * This is an associative array with the organization name for this entity. The key of @@ -83,8 +80,7 @@ class SimpleSAML_Metadata_SAMLParser * * @var string[] */ - private $organizationName = array(); - + private $organizationName = []; /** * This is an associative array with the organization display name for this entity. The key of @@ -93,8 +89,7 @@ class SimpleSAML_Metadata_SAMLParser * * @var string[] */ - private $organizationDisplayName = array(); - + private $organizationDisplayName = []; /** * This is an associative array with the organization URI for this entity. The key of @@ -102,23 +97,20 @@ class SimpleSAML_Metadata_SAMLParser * * @var string[] */ - private $organizationURL = array(); - + private $organizationURL = []; /** * This is an array of the Contact Persons of this entity. * * @var array[] */ - private $contacts = array(); - + private $contacts = []; /** * @var array */ private $scopes; - /** * @var array */ @@ -135,14 +127,12 @@ class SimpleSAML_Metadata_SAMLParser */ private $tags; - /** * This is an array of elements that may be used to validate this element. * * @var \SAML2\SignedElementHelper[] */ - private $validators = array(); - + private $validators = []; /** * The original EntityDescriptor element for this entity, as a base64 encoded string. @@ -151,12 +141,11 @@ class SimpleSAML_Metadata_SAMLParser */ private $entityDescriptor; - /** * This is the constructor for the SAMLParser class. * * @param \SAML2\XML\md\EntityDescriptor $entityElement The EntityDescriptor. - * @param int|NULL $maxExpireTime The unix timestamp for when this entity should expire, or + * @param int|null $maxExpireTime The unix timestamp for when this entity should expire, or * NULL if unknown. * @param array $validators An array of parent elements that may validate this element. * @param array $parentExtensions An optional array of extensions from the parent element. @@ -164,18 +153,18 @@ class SimpleSAML_Metadata_SAMLParser private function __construct( \SAML2\XML\md\EntityDescriptor $entityElement, $maxExpireTime, - array $validators = array(), - array $parentExtensions = null + array $validators = [], + array $parentExtensions = [] ) { - assert('is_null($maxExpireTime) || is_int($maxExpireTime)'); + assert($maxExpireTime === null || is_int($maxExpireTime)); - $this->spDescriptors = array(); - $this->idpDescriptors = array(); + $this->spDescriptors = []; + $this->idpDescriptors = []; $e = $entityElement->toXML(); $e = $e->ownerDocument->saveXML($e); $this->entityDescriptor = base64_encode($e); - $this->entityId = $entityElement->entityID; + $this->entityId = $entityElement->getEntityID(); $expireTime = self::getExpireTime($entityElement, $maxExpireTime); @@ -190,8 +179,7 @@ private function __construct( $this->registrationInfo = $ext['RegistrationInfo']; // look over the RoleDescriptors - foreach ($entityElement->RoleDescriptor as $child) { - + foreach ($entityElement->getRoleDescriptor() as $child) { if ($child instanceof \SAML2\XML\md\SPSSODescriptor) { $this->processSPSSODescriptor($child, $expireTime); } elseif ($child instanceof \SAML2\XML\md\IDPSSODescriptor) { @@ -201,12 +189,12 @@ private function __construct( } } - if ($entityElement->Organization) { - $this->processOrganization($entityElement->Organization); + if ($entityElement->getOrganization() !== null) { + $this->processOrganization($entityElement->getOrganization()); } - if (!empty($entityElement->ContactPerson)) { - foreach ($entityElement->ContactPerson as $contact) { + if ($entityElement->getContactPerson() !== []) { + foreach ($entityElement->getContactPerson() as $contact) { $this->processContactPerson($contact); } } @@ -218,7 +206,7 @@ private function __construct( * * @param string $file The path to the file which contains the metadata. * - * @return SimpleSAML_Metadata_SAMLParser An instance of this class with the metadata loaded. + * @return SAMLParser An instance of this class with the metadata loaded. * @throws Exception If the file does not parse as XML. */ public static function parseFile($file) @@ -227,8 +215,8 @@ public static function parseFile($file) try { $doc = \SAML2\DOMDocumentFactory::fromString($data); - } catch(\Exception $e) { - throw new Exception('Failed to read XML from file: '.$file); + } catch (\Exception $e) { + throw new \Exception('Failed to read XML from file: '.$file); } return self::parseDocument($doc); @@ -240,15 +228,15 @@ public static function parseFile($file) * * @param string $metadata A string which contains XML encoded metadata. * - * @return SimpleSAML_Metadata_SAMLParser An instance of this class with the metadata loaded. + * @return SAMLParser An instance of this class with the metadata loaded. * @throws Exception If the string does not parse as XML. */ public static function parseString($metadata) { try { $doc = \SAML2\DOMDocumentFactory::fromString($metadata); - } catch(\Exception $e) { - throw new Exception('Failed to parse XML string.'); + } catch (\Exception $e) { + throw new \Exception('Failed to parse XML string.'); } return self::parseDocument($doc); @@ -256,15 +244,15 @@ public static function parseString($metadata) /** - * This function parses a DOMDocument which is assumed to contain a single EntityDescriptor element. + * This function parses a \DOMDocument which is assumed to contain a single EntityDescriptor element. * - * @param DOMDocument $document The DOMDocument which contains the EntityDescriptor element. + * @param \DOMDocument $document The \DOMDocument which contains the EntityDescriptor element. * - * @return SimpleSAML_Metadata_SAMLParser An instance of this class with the metadata loaded. + * @return SAMLParser An instance of this class with the metadata loaded. */ public static function parseDocument($document) { - assert('$document instanceof DOMDocument'); + assert($document instanceof \DOMDocument); $entityElement = self::findEntityDescriptor($document); @@ -278,13 +266,12 @@ public static function parseDocument($document) * @param \SAML2\XML\md\EntityDescriptor $entityElement A \SAML2\XML\md\EntityDescriptor object which represents a * EntityDescriptor element. * - * @return SimpleSAML_Metadata_SAMLParser An instance of this class with the metadata loaded. + * @return SAMLParser An instance of this class with the metadata loaded. */ public static function parseElement($entityElement) { - assert('$entityElement instanceof \SAML2\XML\md\EntityDescriptor'); - - return new SimpleSAML_Metadata_SAMLParser($entityElement, null); + assert($entityElement instanceof \SAML2\XML\md\EntityDescriptor); + return new SAMLParser($entityElement, null, []); } @@ -296,26 +283,25 @@ public static function parseElement($entityElement) * * @param string $file The path to the file which contains the EntityDescriptor or EntitiesDescriptor element. * - * @return SimpleSAML_Metadata_SAMLParser[] An array of SAMLParser instances. - * @throws Exception If the file does not parse as XML. + * @return SAMLParser[] An array of SAMLParser instances. + * @throws \Exception If the file does not parse as XML. */ public static function parseDescriptorsFile($file) { - if ($file === null) { - throw new Exception('Cannot open file NULL. File name not specified.'); + throw new \Exception('Cannot open file NULL. File name not specified.'); } $data = \SimpleSAML\Utils\HTTP::fetch($file); try { $doc = \SAML2\DOMDocumentFactory::fromString($data); - } catch(\Exception $e) { - throw new Exception('Failed to read XML from file: '.$file); + } catch (\Exception $e) { + throw new \Exception('Failed to read XML from file: '.$file); } if ($doc->documentElement === null) { - throw new Exception('Opened file is not an XML document: '.$file); + throw new \Exception('Opened file is not an XML document: '.$file); } return self::parseDescriptorsElement($doc->documentElement); @@ -329,16 +315,16 @@ public static function parseDescriptorsFile($file) * * @param string $string The string with XML data. * - * @return SimpleSAML_Metadata_SAMLParser[] An associative array of SAMLParser instances. The key of the array will + * @return SAMLParser[] An associative array of SAMLParser instances. The key of the array will * be the entity id. - * @throws Exception If the string does not parse as XML. + * @throws \Exception If the string does not parse as XML. */ public static function parseDescriptorsString($string) { try { $doc = \SAML2\DOMDocumentFactory::fromString($string); - } catch(\Exception $e) { - throw new Exception('Failed to parse XML string.'); + } catch (\Exception $e) { + throw new \Exception('Failed to parse XML string.'); } return self::parseDescriptorsElement($doc->documentElement); @@ -349,25 +335,25 @@ public static function parseDescriptorsString($string) * This function parses a DOMElement which represents either an EntityDescriptor element or an * EntitiesDescriptor element. It will return an associative array of SAMLParser instances in both cases. * - * @param DOMElement|NULL $element The DOMElement which contains the EntityDescriptor element or the + * @param \DOMElement|NULL $element The DOMElement which contains the EntityDescriptor element or the * EntitiesDescriptor element. * - * @return SimpleSAML_Metadata_SAMLParser[] An associative array of SAMLParser instances. The key of the array will + * @return SAMLParser[] An associative array of SAMLParser instances. The key of the array will * be the entity id. - * @throws Exception if the document is empty or the root is an unexpected node. + * @throws \Exception if the document is empty or the root is an unexpected node. */ - public static function parseDescriptorsElement(DOMElement $element = null) + public static function parseDescriptorsElement(\DOMElement $element = null) { if ($element === null) { - throw new Exception('Document was empty.'); + throw new \Exception('Document was empty.'); } - if (SimpleSAML\Utils\XML::isDOMNodeOfType($element, 'EntityDescriptor', '@md') === true) { + if (\SimpleSAML\Utils\XML::isDOMNodeOfType($element, 'EntityDescriptor', '@md') === true) { return self::processDescriptorsElement(new \SAML2\XML\md\EntityDescriptor($element)); - } elseif (SimpleSAML\Utils\XML::isDOMNodeOfType($element, 'EntitiesDescriptor', '@md') === true) { + } elseif (\SimpleSAML\Utils\XML::isDOMNodeOfType($element, 'EntitiesDescriptor', '@md') === true) { return self::processDescriptorsElement(new \SAML2\XML\md\EntitiesDescriptor($element)); } else { - throw new Exception('Unexpected root node: ['.$element->namespaceURI.']:'.$element->localName); + throw new \Exception('Unexpected root node: ['.$element->namespaceURI.']:'.$element->localName); } } @@ -382,32 +368,32 @@ public static function parseDescriptorsElement(DOMElement $element = null) * @param array $parentExtensions An optional array of * extensions from the parent element. * - * @return SimpleSAML_Metadata_SAMLParser[] Array of SAMLParser instances. + * @return SAMLParser[] Array of SAMLParser instances. */ private static function processDescriptorsElement( $element, $maxExpireTime = null, - array $validators = array(), - array $parentExtensions = array() + array $validators = [], + array $parentExtensions = [] ) { - assert('is_null($maxExpireTime) || is_int($maxExpireTime)'); + assert($maxExpireTime === null || is_int($maxExpireTime)); if ($element instanceof \SAML2\XML\md\EntityDescriptor) { - $ret = new SimpleSAML_Metadata_SAMLParser($element, $maxExpireTime, $validators, $parentExtensions); - $ret = array($ret->getEntityId() => $ret); - /** @var SimpleSAML_Metadata_SAMLParser[] $ret */ + $ret = new SAMLParser($element, $maxExpireTime, $validators, $parentExtensions); + $ret = [$ret->getEntityId() => $ret]; + /** @var SAMLParser[] $ret */ return $ret; } - assert('$element instanceof \SAML2\XML\md\EntitiesDescriptor'); + assert($element instanceof \SAML2\XML\md\EntitiesDescriptor); $extensions = self::processExtensions($element, $parentExtensions); $expTime = self::getExpireTime($element, $maxExpireTime); $validators[] = $element; - $ret = array(); - foreach ($element->children as $child) { + $ret = []; + foreach ($element->getChildren() as $child) { $ret += self::processDescriptorsElement($child, $expTime, $validators, $extensions); } @@ -430,7 +416,7 @@ private static function processDescriptorsElement( private static function getExpireTime($element, $maxExpireTime) { // validUntil may be null - $expire = $element->validUntil; + $expire = $element->getValidUntil(); if ($maxExpireTime !== null && ($expire === null || $maxExpireTime < $expire)) { $expire = $maxExpireTime; @@ -453,7 +439,7 @@ public function getEntityId() private function getMetadataCommon() { - $ret = array(); + $ret = []; $ret['entityid'] = $this->entityId; $ret['entityDescriptor'] = $this->entityDescriptor; @@ -486,8 +472,8 @@ private function getMetadataCommon() */ private function addExtensions(array &$metadata, array $roleDescriptor) { - assert('array_key_exists("scope", $roleDescriptor)'); - assert('array_key_exists("tags", $roleDescriptor)'); + assert(array_key_exists('scope', $roleDescriptor)); + assert(array_key_exists('tags', $roleDescriptor)); $scopes = array_merge($this->scopes, array_diff($roleDescriptor['scope'], $this->scopes)); if (!empty($scopes)) { @@ -508,7 +494,7 @@ private function addExtensions(array &$metadata, array $roleDescriptor) $metadata['EntityAttributes'] = $this->entityAttributes; // check for entity categories - if (SimpleSAML\Utils\Config\Metadata::isHiddenFromDiscovery($metadata)) { + if (\SimpleSAML\Utils\Config\Metadata::isHiddenFromDiscovery($metadata)) { $metadata['hide.from.discovery'] = true; } } @@ -708,6 +694,12 @@ public function getMetadata20SP() if (array_key_exists('attributes.NameFormat', $spd)) { $ret['attributes.NameFormat'] = $spd['attributes.NameFormat']; } + if (array_key_exists('attributes.index', $spd)) { + $ret['attributes.index'] = $spd['attributes.index']; + } + if (array_key_exists('attributes.isDefault', $spd)) { + $ret['attributes.isDefault'] = $spd['attributes.isDefault']; + } // add name & description if (array_key_exists('name', $spd)) { @@ -842,9 +834,9 @@ public function getAttributeAuthorities() */ private static function parseRoleDescriptorType(\SAML2\XML\md\RoleDescriptor $element, $expireTime) { - assert('is_null($expireTime) || is_int($expireTime)'); + assert($expireTime === null || is_int($expireTime)); - $ret = array(); + $ret = []; $expireTime = self::getExpireTime($element, $expireTime); @@ -853,11 +845,11 @@ private static function parseRoleDescriptorType(\SAML2\XML\md\RoleDescriptor $el $ret['expire'] = $expireTime; } - $ret['protocols'] = $element->protocolSupportEnumeration; + $ret['protocols'] = $element->getProtocolSupportEnumeration(); // process KeyDescriptor elements - $ret['keys'] = array(); - foreach ($element->KeyDescriptor as $kd) { + $ret['keys'] = []; + foreach ($element->getKeyDescriptor() as $kd) { $key = self::parseKeyDescriptor($kd); if ($key !== null) { $ret['keys'][] = $key; @@ -893,19 +885,19 @@ private static function parseRoleDescriptorType(\SAML2\XML\md\RoleDescriptor $el */ private static function parseSSODescriptor(\SAML2\XML\md\SSODescriptorType $element, $expireTime) { - assert('is_null($expireTime) || is_int($expireTime)'); + assert($expireTime === null || is_int($expireTime)); $sd = self::parseRoleDescriptorType($element, $expireTime); // find all SingleLogoutService elements - $sd['SingleLogoutService'] = self::extractEndpoints($element->SingleLogoutService); + $sd['SingleLogoutService'] = self::extractEndpoints($element->getSingleLogoutService()); // find all ArtifactResolutionService elements - $sd['ArtifactResolutionService'] = self::extractEndpoints($element->ArtifactResolutionService); + $sd['ArtifactResolutionService'] = self::extractEndpoints($element->getArtifactResolutionService()); // process NameIDFormat elements - $sd['nameIDFormats'] = $element->NameIDFormat; + $sd['nameIDFormats'] = $element->getNameIDFormat(); return $sd; } @@ -920,27 +912,27 @@ private static function parseSSODescriptor(\SAML2\XML\md\SSODescriptorType $elem */ private function processSPSSODescriptor(\SAML2\XML\md\SPSSODescriptor $element, $expireTime) { - assert('is_null($expireTime) || is_int($expireTime)'); + assert($expireTime === null || is_int($expireTime)); $sp = self::parseSSODescriptor($element, $expireTime); // find all AssertionConsumerService elements - $sp['AssertionConsumerService'] = self::extractEndpoints($element->AssertionConsumerService); + $sp['AssertionConsumerService'] = self::extractEndpoints($element->getAssertionConsumerService()); // find all the attributes and SP name... - $attcs = $element->AttributeConsumingService; + $attcs = $element->getAttributeConsumingService(); if (count($attcs) > 0) { self::parseAttributeConsumerService($attcs[0], $sp); } // check AuthnRequestsSigned - if ($element->AuthnRequestsSigned !== null) { - $sp['AuthnRequestsSigned'] = $element->AuthnRequestsSigned; + if ($element->getAuthnRequestsSigned() !== null) { + $sp['AuthnRequestsSigned'] = $element->getAuthnRequestsSigned(); } // check WantAssertionsSigned - if ($element->WantAssertionsSigned !== null) { - $sp['WantAssertionsSigned'] = $element->WantAssertionsSigned; + if ($element->wantAssertionsSigned() !== null) { + $sp['WantAssertionsSigned'] = $element->wantAssertionsSigned(); } $this->spDescriptors[] = $sp; @@ -956,14 +948,14 @@ private function processSPSSODescriptor(\SAML2\XML\md\SPSSODescriptor $element, */ private function processIDPSSODescriptor(\SAML2\XML\md\IDPSSODescriptor $element, $expireTime) { - assert('is_null($expireTime) || is_int($expireTime)'); + assert($expireTime === null || is_int($expireTime)); $idp = self::parseSSODescriptor($element, $expireTime); // find all SingleSignOnService elements - $idp['SingleSignOnService'] = self::extractEndpoints($element->SingleSignOnService); + $idp['SingleSignOnService'] = self::extractEndpoints($element->getSingleSignOnService()); - if ($element->WantAuthnRequestsSigned) { + if ($element->wantAuthnRequestsSigned()) { $idp['WantAuthnRequestsSigned'] = true; } else { $idp['WantAuthnRequestsSigned'] = false; @@ -984,15 +976,15 @@ private function processAttributeAuthorityDescriptor( \SAML2\XML\md\AttributeAuthorityDescriptor $element, $expireTime ) { - assert('is_null($expireTime) || is_int($expireTime)'); + assert($expireTime === null || is_int($expireTime)); $aad = self::parseRoleDescriptorType($element, $expireTime); - $aad['entityid'] = $this->entityId; + $aad['entityid'] = $this->getEntityId(); $aad['metadata-set'] = 'attributeauthority-remote'; - $aad['AttributeService'] = self::extractEndpoints($element->AttributeService); - $aad['AssertionIDRequestService'] = self::extractEndpoints($element->AssertionIDRequestService); - $aad['NameIDFormat'] = $element->NameIDFormat; + $aad['AttributeService'] = self::extractEndpoints($element->getAttributeService()); + $aad['AssertionIDRequestService'] = self::extractEndpoints($element->getAssertionIDRequestService()); + $aad['NameIDFormat'] = $element->getNameIDFormat(); $this->attributeAuthorityDescriptors[] = $aad; } @@ -1007,16 +999,16 @@ private function processAttributeAuthorityDescriptor( * * @return array An associative array with the extensions parsed. */ - private static function processExtensions($element, $parentExtensions = array()) + private static function processExtensions($element, $parentExtensions = []) { - $ret = array( - 'scope' => array(), - 'tags' => array(), - 'EntityAttributes' => array(), - 'RegistrationInfo' => array(), - 'UIInfo' => array(), - 'DiscoHints' => array(), - ); + $ret = [ + 'scope' => [], + 'tags' => [], + 'EntityAttributes' => [], + 'RegistrationInfo' => [], + 'UIInfo' => [], + 'DiscoHints' => [], + ]; // Some extensions may get inherited from a parent element if (($element instanceof \SAML2\XML\md\EntityDescriptor || $element instanceof \SAML2\XML\md\EntitiesDescriptor) @@ -1024,48 +1016,49 @@ private static function processExtensions($element, $parentExtensions = array()) $ret['RegistrationInfo'] = $parentExtensions['RegistrationInfo']; } - foreach ($element->Extensions as $e) { - + foreach ($element->getExtensions() as $e) { if ($e instanceof \SAML2\XML\shibmd\Scope) { - $ret['scope'][] = $e->scope; + $ret['scope'][] = $e->getScope(); continue; } // Entity Attributes are only allowed at entity level extensions and not at RoleDescriptor level if ($element instanceof \SAML2\XML\md\EntityDescriptor || $element instanceof \SAML2\XML\md\EntitiesDescriptor) { - - if ($e instanceof \SAML2\XML\mdrpi\RegistrationInfo) { // Registration Authority cannot be overridden (warn only if override attempts to change the value) if (isset($ret['RegistrationInfo']['registrationAuthority']) - && $ret['RegistrationInfo']['registrationAuthority'] !== $e->registrationAuthority) { - SimpleSAML\Logger::warning('Invalid attempt to override registrationAuthority \'' - . $ret['RegistrationInfo']['registrationAuthority'] . "' with '{$e->registrationAuthority}'"); + && $ret['RegistrationInfo']['registrationAuthority'] !== $e->getRegistrationAuthority()) { + \SimpleSAML\Logger::warning('Invalid attempt to override registrationAuthority \''. + $ret['RegistrationInfo']['registrationAuthority']."' with '{$e->getRegistrationAuthority()}'"); } else { - $ret['RegistrationInfo']['registrationAuthority'] = $e->registrationAuthority; + $ret['RegistrationInfo']['registrationAuthority'] = $e->getRegistrationAuthority(); } } - if ($e instanceof \SAML2\XML\mdattr\EntityAttributes && !empty($e->children)) { - foreach ($e->children as $attr) { + if ($e instanceof \SAML2\XML\mdattr\EntityAttributes && !empty($e->getChildren())) { + foreach ($e->getChildren() as $attr) { // only saml:Attribute are currently supported here. The specifications also allows // saml:Assertions, which more complex processing if ($attr instanceof \SAML2\XML\saml\Attribute) { - if (empty($attr->Name) || empty($attr->AttributeValue)) { + $attrName = $attr->getName(); + $attrNameFormat = $attr->getNameFormat(); + $attrValue = $attr->getAttributeValue(); + + if ($attrName === null || $attrValue === []) { continue; } // attribute names that is not URI is prefixed as this: '{nameformat}name' - $name = $attr->Name; - if (empty($attr->NameFormat)) { - $name = '{'.\SAML2\Constants::NAMEFORMAT_UNSPECIFIED.'}'.$attr->Name; - } elseif ($attr->NameFormat !== 'urn:oasis:names:tc:SAML:2.0:attrname-format:uri') { - $name = '{'.$attr->NameFormat.'}'.$attr->Name; + $name = $attrName; + if ($attrNameFormat === null) { + $name = '{'.\SAML2\Constants::NAMEFORMAT_UNSPECIFIED.'}'.$attr->getName(); + } elseif ($attrNameFormat !== 'urn:oasis:names:tc:SAML:2.0:attrname-format:uri') { + $name = '{'.$attrNameFormat.'}'.$attrName; } - $values = array(); - foreach ($attr->AttributeValue as $attrvalue) { - $values[] = $attrvalue->getString(); + $values = []; + foreach ($attrValue as $attrval) { + $values[] = $attrval->getString(); } $ret['EntityAttributes'][$name] = $values; @@ -1077,36 +1070,35 @@ private static function processExtensions($element, $parentExtensions = array()) // UIInfo elements are only allowed at RoleDescriptor level extensions if ($element instanceof \SAML2\XML\md\RoleDescriptor) { if ($e instanceof \SAML2\XML\mdui\UIInfo) { + $ret['UIInfo']['DisplayName'] = $e->getDisplayName(); + $ret['UIInfo']['Description'] = $e->getDescription(); + $ret['UIInfo']['InformationURL'] = $e->getInformationURL(); + $ret['UIInfo']['PrivacyStatementURL'] = $e->getPrivacyStatementURL(); - $ret['UIInfo']['DisplayName'] = $e->DisplayName; - $ret['UIInfo']['Description'] = $e->Description; - $ret['UIInfo']['InformationURL'] = $e->InformationURL; - $ret['UIInfo']['PrivacyStatementURL'] = $e->PrivacyStatementURL; - - foreach ($e->Keywords as $uiItem) { + foreach ($e->getKeywords() as $uiItem) { if (!($uiItem instanceof \SAML2\XML\mdui\Keywords) - || empty($uiItem->Keywords) - || empty($uiItem->lang) + || ($uiItem->getKeywords() === []) + || ($uiItem->getLanguage() === null) ) { continue; } - $ret['UIInfo']['Keywords'][$uiItem->lang] = $uiItem->Keywords; + $ret['UIInfo']['Keywords'][$uiItem->getLanguage()] = $uiItem->getKeywords(); } - foreach ($e->Logo as $uiItem) { + foreach ($e->getLogo() as $uiItem) { if (!($uiItem instanceof \SAML2\XML\mdui\Logo) - || empty($uiItem->url) - || empty($uiItem->height) - || empty($uiItem->width) + || ($uiItem->getUrl() === null) + || ($uiItem->getHeight() === null) + || ($uiItem->getWidth() === null) ) { continue; } - $logo = array( - 'url' => $uiItem->url, - 'height' => $uiItem->height, - 'width' => $uiItem->width, - ); - if (!empty($uiItem->lang)) { - $logo['lang'] = $uiItem->lang; + $logo = [ + 'url' => $uiItem->getUrl(), + 'height' => $uiItem->getHeight(), + 'width' => $uiItem->getWidth(), + ]; + if ($uiItem->getLanguage() !== null) { + $logo['lang'] = $uiItem->getLanguage(); } $ret['UIInfo']['Logo'][] = $logo; } @@ -1115,11 +1107,10 @@ private static function processExtensions($element, $parentExtensions = array()) // DiscoHints elements are only allowed at IDPSSODescriptor level extensions if ($element instanceof \SAML2\XML\md\IDPSSODescriptor) { - if ($e instanceof \SAML2\XML\mdui\DiscoHints) { - $ret['DiscoHints']['IPHint'] = $e->IPHint; - $ret['DiscoHints']['DomainHint'] = $e->DomainHint; - $ret['DiscoHints']['GeolocationHint'] = $e->GeolocationHint; + $ret['DiscoHints']['IPHint'] = $e->getIPHint(); + $ret['DiscoHints']['DomainHint'] = $e->getDomainHint(); + $ret['DiscoHints']['GeolocationHint'] = $e->getGeolocationHint(); } } @@ -1127,13 +1118,13 @@ private static function processExtensions($element, $parentExtensions = array()) continue; } - if ($e->localName === 'Attribute' && $e->namespaceURI === \SAML2\Constants::NS_SAML) { + if ($e->getLocalName() === 'Attribute' && $e->getNamespaceURI() === \SAML2\Constants::NS_SAML) { $attribute = $e->getXML(); $name = $attribute->getAttribute('Name'); $values = array_map( - array('SimpleSAML\Utils\XML', 'getDOMText'), - SimpleSAML\Utils\XML::getDOMChildren($attribute, 'AttributeValue', '@saml2') + ['\SimpleSAML\Utils\XML', 'getDOMText'], + \SimpleSAML\Utils\XML::getDOMChildren($attribute, 'AttributeValue', '@saml2') ); if ($name === 'tags') { @@ -1156,9 +1147,9 @@ private static function processExtensions($element, $parentExtensions = array()) */ private function processOrganization(\SAML2\XML\md\Organization $element) { - $this->organizationName = $element->OrganizationName; - $this->organizationDisplayName = $element->OrganizationDisplayName; - $this->organizationURL = $element->OrganizationURL; + $this->organizationName = $element->getOrganizationName(); + $this->organizationDisplayName = $element->getOrganizationDisplayName(); + $this->organizationURL = $element->getOrganizationURL(); } @@ -1170,24 +1161,24 @@ private function processOrganization(\SAML2\XML\md\Organization $element) private function processContactPerson(\SAML2\XML\md\ContactPerson $element) { - $contactPerson = array(); - if (!empty($element->contactType)) { - $contactPerson['contactType'] = $element->contactType; + $contactPerson = []; + if ($element->getContactType() !== '') { + $contactPerson['contactType'] = $element->getContactType(); } - if (!empty($element->Company)) { - $contactPerson['company'] = $element->Company; + if ($element->getCompany() !== null) { + $contactPerson['company'] = $element->getCompany(); } - if (!empty($element->GivenName)) { - $contactPerson['givenName'] = $element->GivenName; + if ($element->getGivenName() !== null) { + $contactPerson['givenName'] = $element->getGivenName(); } - if (!empty($element->SurName)) { + if ($element->getSurName() !== null) { $contactPerson['surName'] = $element->SurName; } - if (!empty($element->EmailAddress)) { - $contactPerson['emailAddress'] = $element->EmailAddress; + if ($element->getEmailAddress() !== []) { + $contactPerson['emailAddress'] = $element->getEmailAddress(); } - if (!empty($element->TelephoneNumber)) { - $contactPerson['telephoneNumber'] = $element->TelephoneNumber; + if ($element->getTelephoneNumber() !== []) { + $contactPerson['telephoneNumber'] = $element->getTelephoneNumber(); } if (!empty($contactPerson)) { $this->contacts[] = $contactPerson; @@ -1203,24 +1194,24 @@ private function processContactPerson(\SAML2\XML\md\ContactPerson $element) */ private static function parseAttributeConsumerService(\SAML2\XML\md\AttributeConsumingService $element, &$sp) { - assert('is_array($sp)'); + assert(is_array($sp)); - $sp['name'] = $element->ServiceName; - $sp['description'] = $element->ServiceDescription; + $sp['name'] = $element->getServiceName(); + $sp['description'] = $element->getServiceDescription(); $format = null; - $sp['attributes'] = array(); - $sp['attributes.required'] = array(); - foreach ($element->RequestedAttribute as $child) { - $attrname = $child->Name; + $sp['attributes'] = []; + $sp['attributes.required'] = []; + foreach ($element->getRequestedAttribute() as $child) { + $attrname = $child->getName(); $sp['attributes'][] = $attrname; - if ($child->isRequired !== null && $child->isRequired === true) { + if ($child->getIsRequired() === true) { $sp['attributes.required'][] = $attrname; } - if ($child->NameFormat !== null) { - $attrformat = $child->NameFormat; + if ($child->getNameFormat() !== null) { + $attrformat = $child->getNameFormat(); } else { $attrformat = \SAML2\Constants::NAMEFORMAT_UNSPECIFIED; } @@ -1262,20 +1253,20 @@ private static function parseAttributeConsumerService(\SAML2\XML\md\AttributeCon */ private static function parseGenericEndpoint(\SAML2\XML\md\EndpointType $element) { - $ep = array(); + $ep = []; - $ep['Binding'] = $element->Binding; - $ep['Location'] = $element->Location; + $ep['Binding'] = $element->getBinding(); + $ep['Location'] = $element->getLocation(); - if ($element->ResponseLocation !== null) { - $ep['ResponseLocation'] = $element->ResponseLocation; + if ($element->getResponseLocation() !== null) { + $ep['ResponseLocation'] = $element->getResponseLocation(); } if ($element instanceof \SAML2\XML\md\IndexedEndpointType) { - $ep['index'] = $element->index; + $ep['index'] = $element->getIndex(); - if ($element->isDefault !== null) { - $ep['isDefault'] = $element->isDefault; + if ($element->getIsDefault() !== null) { + $ep['isDefault'] = $element->getIsDefault(); } } @@ -1292,12 +1283,7 @@ private static function parseGenericEndpoint(\SAML2\XML\md\EndpointType $element */ private static function extractEndpoints(array $endpoints) { - $ret = array(); - foreach ($endpoints as $ep) { - $ret[] = self::parseGenericEndpoint($ep); - } - - return $ret; + return array_map(['self', 'parseGenericEndpoint'], $endpoints); } @@ -1317,12 +1303,12 @@ private static function extractEndpoints(array $endpoints) */ private static function parseKeyDescriptor(\SAML2\XML\md\KeyDescriptor $kd) { - $r = array(); + $r = []; - if ($kd->use === 'encryption') { + if ($kd->getUse() === 'encryption') { $r['encryption'] = true; $r['signing'] = false; - } elseif ($kd->use === 'signing') { + } elseif ($kd->getUse() === 'signing') { $r['encryption'] = false; $r['signing'] = true; } else { @@ -1330,14 +1316,14 @@ private static function parseKeyDescriptor(\SAML2\XML\md\KeyDescriptor $kd) $r['signing'] = true; } - $keyInfo = $kd->KeyInfo; + $keyInfo = $kd->getKeyInfo(); - foreach ($keyInfo->info as $i) { + foreach ($keyInfo->getInfo() as $i) { if ($i instanceof \SAML2\XML\ds\X509Data) { - foreach ($i->data as $d) { + foreach ($i->getData() as $d) { if ($d instanceof \SAML2\XML\ds\X509Certificate) { $r['type'] = 'X509Certificate'; - $r['X509Certificate'] = $d->certificate; + $r['X509Certificate'] = $d->getCertificate(); return $r; } } @@ -1353,13 +1339,13 @@ private static function parseKeyDescriptor(\SAML2\XML\md\KeyDescriptor $kd) * * @param $protocols Array with the protocols we accept. * - * @return Array with SP descriptors which supports one of the given protocols. + * @return array with SP descriptors which supports one of the given protocols. */ private function getSPDescriptors($protocols) { - assert('is_array($protocols)'); + assert(is_array($protocols)); - $ret = array(); + $ret = []; foreach ($this->spDescriptors as $spd) { $sharedProtocols = array_intersect($protocols, $spd['protocols']); @@ -1377,13 +1363,13 @@ private function getSPDescriptors($protocols) * * @param $protocols Array with the protocols we accept. * - * @return Array with IdP descriptors which supports one of the given protocols. + * @return array with IdP descriptors which supports one of the given protocols. */ private function getIdPDescriptors($protocols) { - assert('is_array($protocols)'); + assert(is_array($protocols)); - $ret = array(); + $ret = []; foreach ($this->idpDescriptors as $idpd) { $sharedProtocols = array_intersect($protocols, $idpd['protocols']); @@ -1402,24 +1388,24 @@ private function getIdPDescriptors($protocols) * * This function will throw an exception if it is unable to locate the node. * - * @param DOMDocument $doc The DOMDocument where we should find the EntityDescriptor node. + * @param \DOMDocument $doc The \DOMDocument where we should find the EntityDescriptor node. * - * @return \SAML2\XML\md\EntityDescriptor The DOMEntity which represents the EntityDescriptor. - * @throws Exception If the document is empty or the first element is not an EntityDescriptor element. + * @return \SAML2\XML\md\EntityDescriptor The \DOMEntity which represents the EntityDescriptor. + * @throws \Exception If the document is empty or the first element is not an EntityDescriptor element. */ private static function findEntityDescriptor($doc) { - assert('$doc instanceof DOMDocument'); + assert($doc instanceof \DOMDocument); // find the EntityDescriptor DOMElement. This should be the first (and only) child of the DOMDocument $ed = $doc->documentElement; if ($ed === null) { - throw new Exception('Failed to load SAML metadata from empty XML document.'); + throw new \Exception('Failed to load SAML metadata from empty XML document.'); } - if (SimpleSAML\Utils\XML::isDOMNodeOfType($ed, 'EntityDescriptor', '@md') === false) { - throw new Exception('Expected first element in the metadata document to be an EntityDescriptor element.'); + if (\SimpleSAML\Utils\XML::isDOMNodeOfType($ed, 'EntityDescriptor', '@md') === false) { + throw new \Exception('Expected first element in the metadata document to be an EntityDescriptor element.'); } return new \SAML2\XML\md\EntityDescriptor($ed); @@ -1438,28 +1424,28 @@ private static function findEntityDescriptor($doc) public function validateSignature($certificates) { foreach ($certificates as $cert) { - assert('is_string($cert)'); + assert(is_string($cert)); $certFile = \SimpleSAML\Utils\Config::getCertPath($cert); if (!file_exists($certFile)) { - throw new Exception( + throw new \Exception( 'Could not find certificate file ['.$certFile.'], which is needed to validate signature' ); } $certData = file_get_contents($certFile); foreach ($this->validators as $validator) { - $key = new XMLSecurityKey(XMLSecurityKey::RSA_SHA1, array('type' => 'public')); + $key = new XMLSecurityKey(XMLSecurityKey::RSA_SHA256, ['type' => 'public']); $key->loadKey($certData); try { if ($validator->validate($key)) { return true; } - } catch (Exception $e) { + } catch (\Exception $e) { // this certificate did not sign this element, skip } } } - SimpleSAML\Logger::debug('Could not validate signature'); + \SimpleSAML\Logger::debug('Could not validate signature'); return false; } @@ -1475,14 +1461,13 @@ public function validateSignature($certificates) */ public function validateFingerprint($fingerprint) { - assert('is_string($fingerprint)'); + assert(is_string($fingerprint)); $fingerprint = strtolower(str_replace(":", "", $fingerprint)); - $candidates = array(); + $candidates = []; foreach ($this->validators as $validator) { foreach ($validator->getValidatingCertificates() as $cert) { - $fp = strtolower(sha1(base64_decode($cert))); $candidates[] = $fp; if ($fp === $fingerprint) { @@ -1490,7 +1475,7 @@ public function validateFingerprint($fingerprint) } } } - SimpleSAML\Logger::debug('Fingerprint was ['.$fingerprint.'] not one of ['.join(', ', $candidates).']'); + \SimpleSAML\Logger::debug('Fingerprint was ['.$fingerprint.'] not one of ['.join(', ', $candidates).']'); return false; } } diff --git a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Metadata/Signer.php b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Metadata/Signer.php index dd2e5e497d..98806d5621 100644 --- a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Metadata/Signer.php +++ b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Metadata/Signer.php @@ -1,5 +1,9 @@ <?php +namespace SimpleSAML\Metadata; + +use RobRichards\XMLSecLibs\XMLSecurityKey; +use RobRichards\XMLSecLibs\XMLSecurityDSig; /** * This class implements a helper function for signing of metadata. @@ -7,16 +11,16 @@ * @author Olav Morken, UNINETT AS. * @package SimpleSAMLphp */ -class SimpleSAML_Metadata_Signer -{ +class Signer +{ /** * This functions finds what key & certificate files should be used to sign the metadata * for the given entity. * - * @param SimpleSAML_Configuration $config Our SimpleSAML_Configuration instance. - * @param array $entityMetadata The metadata of the entity. - * @param string $type A string which describes the type entity this is, e.g. 'SAML 2 IdP' or + * @param \SimpleSAML\Configuration $config Our \SimpleSAML\Configuration instance. + * @param array $entityMetadata The metadata of the entity. + * @param string $type A string which describes the type entity this is, e.g. 'SAML 2 IdP' or * 'Shib 1.3 SP'. * * @return array An associative array with the keys 'privatekey', 'certificate', and optionally 'privatekey_pass'. @@ -28,12 +32,10 @@ private static function findKeyCert($config, $entityMetadata, $type) if (array_key_exists('metadata.sign.privatekey', $entityMetadata) || array_key_exists('metadata.sign.certificate', $entityMetadata) ) { - if (!array_key_exists('metadata.sign.privatekey', $entityMetadata) || !array_key_exists('metadata.sign.certificate', $entityMetadata) ) { - - throw new Exception( + throw new \Exception( 'Missing either the "metadata.sign.privatekey" or the'. ' "metadata.sign.certificate" configuration option in the metadata for'. ' the '.$type.' "'.$entityMetadata['entityid'].'". If one of'. @@ -41,10 +43,10 @@ private static function findKeyCert($config, $entityMetadata, $type) ); } - $ret = array( + $ret = [ 'privatekey' => $entityMetadata['metadata.sign.privatekey'], 'certificate' => $entityMetadata['metadata.sign.certificate'] - ); + ]; if (array_key_exists('metadata.sign.privatekey_pass', $entityMetadata)) { $ret['privatekey_pass'] = $entityMetadata['metadata.sign.privatekey_pass']; @@ -58,14 +60,14 @@ private static function findKeyCert($config, $entityMetadata, $type) $certificate = $config->getString('metadata.sign.certificate', null); if ($privatekey !== null || $certificate !== null) { if ($privatekey === null || $certificate === null) { - throw new Exception( + throw new \Exception( 'Missing either the "metadata.sign.privatekey" or the'. ' "metadata.sign.certificate" configuration option in the global'. ' configuration. If one of these options is specified, then the other'. ' must also be specified.' ); } - $ret = array('privatekey' => $privatekey, 'certificate' => $certificate); + $ret = ['privatekey' => $privatekey, 'certificate' => $certificate]; $privatekey_pass = $config->getString('metadata.sign.privatekey_pass', null); if ($privatekey_pass !== null) { @@ -79,11 +81,10 @@ private static function findKeyCert($config, $entityMetadata, $type) if (array_key_exists('privatekey', $entityMetadata) || array_key_exists('certificate', $entityMetadata) ) { - if (!array_key_exists('privatekey', $entityMetadata) || !array_key_exists('certificate', $entityMetadata) ) { - throw new Exception( + throw new \Exception( 'Both the "privatekey" and the "certificate" option must'. ' be set in the metadata for the '.$type.' "'. $entityMetadata['entityid'].'" before it is possible to sign metadata'. @@ -91,10 +92,10 @@ private static function findKeyCert($config, $entityMetadata, $type) ); } - $ret = array( + $ret = [ 'privatekey' => $entityMetadata['privatekey'], 'certificate' => $entityMetadata['certificate'] - ); + ]; if (array_key_exists('privatekey_pass', $entityMetadata)) { $ret['privatekey_pass'] = $entityMetadata['privatekey_pass']; @@ -103,7 +104,7 @@ private static function findKeyCert($config, $entityMetadata, $type) return $ret; } - throw new Exception( + throw new \Exception( 'Could not find what key & certificate should be used to sign the metadata'. ' for the '.$type.' "'.$entityMetadata['entityid'].'".' ); @@ -113,20 +114,20 @@ private static function findKeyCert($config, $entityMetadata, $type) /** * Determine whether metadata signing is enabled for the given metadata. * - * @param SimpleSAML_Configuration $config Our SimpleSAML_Configuration instance. - * @param array $entityMetadata The metadata of the entity. - * @param string $type A string which describes the type entity this is, e.g. 'SAML 2 IdP' or + * @param \SimpleSAML\Configuration $config Our \SimpleSAML\Configuration instance. + * @param array $entityMetadata The metadata of the entity. + * @param string $type A string which describes the type entity this is, e.g. 'SAML 2 IdP' or * 'Shib 1.3 SP'. * * @return boolean True if metadata signing is enabled, false otherwise. - * @throws Exception If the value of the 'metadata.sign.enable' option is not a boolean. + * @throws \Exception If the value of the 'metadata.sign.enable' option is not a boolean. */ private static function isMetadataSigningEnabled($config, $entityMetadata, $type) { // first check the metadata for the entity if (array_key_exists('metadata.sign.enable', $entityMetadata)) { if (!is_bool($entityMetadata['metadata.sign.enable'])) { - throw new Exception( + throw new \Exception( 'Invalid value for the "metadata.sign.enable" configuration option for'. ' the '.$type.' "'.$entityMetadata['entityid'].'". This option'. ' should be a boolean.' @@ -148,7 +149,7 @@ private static function isMetadataSigningEnabled($config, $entityMetadata, $type * This method will look for the 'metadata.sign.algorithm' key in the $entityMetadata array, or look for such * a configuration option in the $config object. * - * @param SimpleSAML_Configuration $config The global configuration. + * @param \SimpleSAML\Configuration $config The global configuration. * @param array $entityMetadata An array containing the metadata related to this entity. * @param string $type A string describing the type of entity. E.g. 'SAML 2 IdP' or 'Shib 1.3 SP'. * @@ -156,8 +157,6 @@ private static function isMetadataSigningEnabled($config, $entityMetadata, $type * algorithms to use, respectively. * * @throws \SimpleSAML\Error\CriticalConfigurationError - * - * @todo change to SHA256 by default. */ private static function getMetadataSigningAlgorithm($config, $entityMetadata, $type) { @@ -171,15 +170,15 @@ private static function getMetadataSigningAlgorithm($config, $entityMetadata, $t } $alg = $entityMetadata['metadata.sign.algorithm']; } else { - $alg = $config->getString('metadata.sign.algorithm', XMLSecurityKey::RSA_SHA1); + $alg = $config->getString('metadata.sign.algorithm', XMLSecurityKey::RSA_SHA256); } - $supported_algs = array( + $supported_algs = [ XMLSecurityKey::RSA_SHA1, XMLSecurityKey::RSA_SHA256, XMLSecurityKey::RSA_SHA384, XMLSecurityKey::RSA_SHA512, - ); + ]; if (!in_array($alg, $supported_algs, true)) { throw new \SimpleSAML\Error\CriticalConfigurationError("Unknown signature algorithm '$alg'"); @@ -199,10 +198,10 @@ private static function getMetadataSigningAlgorithm($config, $entityMetadata, $t $digest = XMLSecurityDSig::SHA1; } - return array( + return [ 'algorithm' => $alg, 'digest' => $digest, - ); + ]; } @@ -214,11 +213,11 @@ private static function getMetadataSigningAlgorithm($config, $entityMetadata, $t * @param string $type A string which describes the type entity this is, e.g. 'SAML 2 IdP' or 'Shib 1.3 SP'. * * @return string The $metadataString with the signature embedded. - * @throws Exception If the certificate or private key cannot be loaded, or the metadata doesn't parse properly. + * @throws \Exception If the certificate or private key cannot be loaded, or the metadata doesn't parse properly. */ public static function sign($metadataString, $entityMetadata, $type) { - $config = SimpleSAML_Configuration::getInstance(); + $config = \SimpleSAML\Configuration::getInstance(); // check if metadata signing is enabled if (!self::isMetadataSigningEnabled($config, $entityMetadata, $type)) { @@ -230,13 +229,15 @@ public static function sign($metadataString, $entityMetadata, $type) $keyFile = \SimpleSAML\Utils\Config::getCertPath($keyCertFiles['privatekey']); if (!file_exists($keyFile)) { - throw new Exception('Could not find private key file ['.$keyFile.'], which is needed to sign the metadata'); + throw new \Exception( + 'Could not find private key file ['.$keyFile.'], which is needed to sign the metadata' + ); } $keyData = file_get_contents($keyFile); $certFile = \SimpleSAML\Utils\Config::getCertPath($keyCertFiles['certificate']); if (!file_exists($certFile)) { - throw new Exception( + throw new \Exception( 'Could not find certificate file ['.$certFile.'], which is needed to sign the metadata' ); } @@ -246,14 +247,14 @@ public static function sign($metadataString, $entityMetadata, $type) // convert the metadata to a DOM tree try { $xml = \SAML2\DOMDocumentFactory::fromString($metadataString); - } catch(Exception $e) { - throw new Exception('Error parsing self-generated metadata.'); + } catch (\Exception $e) { + throw new \Exception('Error parsing self-generated metadata.'); } $signature_cf = self::getMetadataSigningAlgorithm($config, $entityMetadata, $type); // load the private key - $objKey = new XMLSecurityKey($signature_cf['algorithm'], array('type' => 'private')); + $objKey = new XMLSecurityKey($signature_cf['algorithm'], ['type' => 'private']); if (array_key_exists('privatekey_pass', $keyCertFiles)) { $objKey->passphrase = $keyCertFiles['privatekey_pass']; } @@ -263,19 +264,15 @@ public static function sign($metadataString, $entityMetadata, $type) $rootNode = $xml->firstChild; // sign the metadata with our private key - if ($type == 'ADFS IdP') { - $objXMLSecDSig = new sspmod_adfs_XMLSecurityDSig($metadataString); - } else { - $objXMLSecDSig = new XMLSecurityDSig(); - } + $objXMLSecDSig = new XMLSecurityDSig(); $objXMLSecDSig->setCanonicalMethod(XMLSecurityDSig::EXC_C14N); $objXMLSecDSig->addReferenceList( - array($rootNode), + [$rootNode], $signature_cf['digest'], - array('http://www.w3.org/2000/09/xmldsig#enveloped-signature', XMLSecurityDSig::EXC_C14N), - array('id_name' => 'ID') + ['http://www.w3.org/2000/09/xmldsig#enveloped-signature', XMLSecurityDSig::EXC_C14N], + ['id_name' => 'ID'] ); $objXMLSecDSig->sign($objKey); diff --git a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Metadata/Sources/MDQ.php b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Metadata/Sources/MDQ.php index 5bd58847e4..4138464277 100644 --- a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Metadata/Sources/MDQ.php +++ b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Metadata/Sources/MDQ.php @@ -13,9 +13,9 @@ * @author Tamas Frank, NIIFI * @package SimpleSAMLphp */ -class MDQ extends \SimpleSAML_Metadata_MetaDataStorageSource -{ +class MDQ extends \SimpleSAML\Metadata\MetaDataStorageSource +{ /** * The URL of MDQ server (url:port) * @@ -65,7 +65,7 @@ class MDQ extends \SimpleSAML_Metadata_MetaDataStorageSource */ protected function __construct($config) { - assert('is_array($config)'); + assert(is_array($config)); if (!array_key_exists('server', $config)) { throw new \Exception(__CLASS__.": the 'server' configuration option is not set."); @@ -80,7 +80,7 @@ protected function __construct($config) } if (array_key_exists('cachedir', $config)) { - $globalConfig = \SimpleSAML_Configuration::getInstance(); + $globalConfig = \SimpleSAML\Configuration::getInstance(); $this->cacheDir = $globalConfig->resolvePath($config['cachedir']); } else { $this->cacheDir = null; @@ -104,7 +104,7 @@ protected function __construct($config) public function getMetadataSet($set) { // we don't have this metadata set - return array(); + return []; } @@ -118,8 +118,8 @@ public function getMetadataSet($set) */ private function getCacheFilename($set, $entityId) { - assert('is_string($set)'); - assert('is_string($entityId)'); + assert(is_string($set)); + assert(is_string($entityId)); $cachekey = sha1($entityId); return $this->cacheDir.'/'.$set.'-'.$cachekey.'.cached.xml'; @@ -138,8 +138,8 @@ private function getCacheFilename($set, $entityId) */ private function getFromCache($set, $entityId) { - assert('is_string($set)'); - assert('is_string($entityId)'); + assert(is_string($set)); + assert(is_string($entityId)); if (empty($this->cacheDir)) { return null; @@ -196,9 +196,9 @@ private function getFromCache($set, $entityId) */ private function writeToCache($set, $entityId, $data) { - assert('is_string($set)'); - assert('is_string($entityId)'); - assert('is_array($data)'); + assert(is_string($set)); + assert(is_string($entityId)); + assert(is_array($data)); if (empty($this->cacheDir)) { return; @@ -216,15 +216,15 @@ private function writeToCache($set, $entityId, $data) /** * Retrieve metadata for the correct set from a SAML2Parser. * - * @param \SimpleSAML_Metadata_SAMLParser $entity A SAML2Parser representing an entity. + * @param \SimpleSAML\Metadata\SAMLParser $entity A SAML2Parser representing an entity. * @param string $set The metadata set we are looking for. * * @return array|NULL The associative array with the metadata, or NULL if no metadata for * the given set was found. */ - private static function getParsedSet(\SimpleSAML_Metadata_SAMLParser $entity, $set) + private static function getParsedSet(\SimpleSAML\Metadata\SAMLParser $entity, $set) { - assert('is_string($set)'); + assert(is_string($set)); switch ($set) { case 'saml20-idp-remote': @@ -248,7 +248,7 @@ private static function getParsedSet(\SimpleSAML_Metadata_SAMLParser $entity, $s /** - * Overriding this function from the superclass SimpleSAML_Metadata_MetaDataStorageSource. + * Overriding this function from the superclass \SimpleSAML\Metadata\MetaDataStorageSource. * * This function retrieves metadata for the given entity id in the given set of metadata. * It will return NULL if it is unable to locate the metadata. @@ -262,17 +262,24 @@ private static function getParsedSet(\SimpleSAML_Metadata_SAMLParser $entity, $s * * @return array An associative array with metadata for the given entity, or NULL if we are unable to * locate the entity. - * @throws \Exception If an error occurs while downloading metadata, validating the signature or writing to cache. + * @throws \Exception If an error occurs while validating the signature or the metadata is in an + * incorrect set. */ public function getMetaData($index, $set) { - assert('is_string($index)'); - assert('is_string($set)'); + assert(is_string($index)); + assert(is_string($set)); Logger::info(__CLASS__.': loading metadata entity ['.$index.'] from ['.$set.']'); // read from cache if possible - $data = $this->getFromCache($set, $index); + try { + $data = $this->getFromCache($set, $index); + } catch (\Exception $e) { + Logger::error($e->getMessage()); + // proceed with fetching metadata even if the cache is broken + $data = null; + } if ($data !== null && array_key_exists('expires', $data) && $data['expires'] < time()) { // metadata has expired @@ -292,18 +299,19 @@ public function getMetaData($index, $set) try { $xmldata = HTTP::fetch($mdq_url); } catch (\Exception $e) { - Logger::warning('Fetching metadata for '.$index.': '.$e->getMessage()); + // Avoid propagating the exception, make sure we can handle the error later + $xmldata = false; } if (empty($xmldata)) { $error = error_get_last(); - throw new \Exception( - 'Error downloading metadata for "'.$index.'" from "'.$mdq_url.'": '.$error['message'] - ); + Logger::info('Unable to fetch metadata for "'.$index.'" from '.$mdq_url.': '. + (is_array($error) ? $error['message'] : 'no error available')); + return null; } /** @var string $xmldata */ - $entity = \SimpleSAML_Metadata_SAMLParser::parseString($xmldata); + $entity = \SimpleSAML\Metadata\SAMLParser::parseString($xmldata); Logger::debug(__CLASS__.': completed parsing of ['.$mdq_url.']'); if ($this->validateFingerprint !== null) { @@ -317,7 +325,12 @@ public function getMetaData($index, $set) throw new \Exception(__CLASS__.': no metadata for set "'.$set.'" available from "'.$index.'".'); } - $this->writeToCache($set, $index, $data); + try { + $this->writeToCache($set, $index, $data); + } catch (\Exception $e) { + // Proceed without writing to cache + Logger::error('Error writing MDQ result to cache: '.$e->getMessage()); + } return $data; } diff --git a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Module.php b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Module.php index b906b58821..4cbd416576 100644 --- a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Module.php +++ b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Module.php @@ -1,6 +1,13 @@ <?php + namespace SimpleSAML; +use Symfony\Component\HttpFoundation\BinaryFileResponse; +use Symfony\Component\HttpFoundation\RedirectResponse; +use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\HttpFoundation\ResponseHeaderBag; + /** * Helper class for accessing information about modules. * @@ -13,101 +20,55 @@ class Module { /** - * A list containing the modules currently installed. + * Index pages: file names to attempt when accessing directories. * * @var array */ - public static $modules = array(); + public static $indexFiles = ['index.php', 'index.html', 'index.htm', 'index.txt']; /** - * A cache containing specific information for modules, like whether they are enabled or not, or their hooks. + * MIME Types + * + * The key is the file extension and the value the corresponding MIME type. * * @var array */ - public static $module_info = array(); - + public static $mimeTypes = [ + 'bmp' => 'image/x-ms-bmp', + 'css' => 'text/css', + 'gif' => 'image/gif', + 'htm' => 'text/html', + 'html' => 'text/html', + 'shtml' => 'text/html', + 'ico' => 'image/vnd.microsoft.icon', + 'jpe' => 'image/jpeg', + 'jpeg' => 'image/jpeg', + 'jpg' => 'image/jpeg', + 'js' => 'text/javascript', + 'pdf' => 'application/pdf', + 'png' => 'image/png', + 'svg' => 'image/svg+xml', + 'svgz' => 'image/svg+xml', + 'swf' => 'application/x-shockwave-flash', + 'swfl' => 'application/x-shockwave-flash', + 'txt' => 'text/plain', + 'xht' => 'application/xhtml+xml', + 'xhtml' => 'application/xhtml+xml', + ]; /** - * Autoload function for SimpleSAMLphp modules following PSR-0. - * - * @param string $className Name of the class. - * - * @deprecated This method will be removed in SSP 2.0. + * A list containing the modules currently installed. * - * TODO: this autoloader should be removed once everything has been migrated to namespaces. + * @var array */ - public static function autoloadPSR0($className) - { - $modulePrefixLength = strlen('sspmod_'); - $classPrefix = substr($className, 0, $modulePrefixLength); - if ($classPrefix !== 'sspmod_') { - return; - } - - $modNameEnd = strpos($className, '_', $modulePrefixLength); - $module = substr($className, $modulePrefixLength, $modNameEnd - $modulePrefixLength); - $path = explode('_', substr($className, $modNameEnd + 1)); - - if (!self::isModuleEnabled($module)) { - return; - } - - $file = self::getModuleDir($module).'/lib/'.join('/', $path).'.php'; - if (!file_exists($file)) { - return; - } - require_once($file); - - if (!class_exists($className, false) && !interface_exists($className, false)) { - // the file exists, but the class is not defined. Is it using namespaces? - $nspath = join('\\', $path); - if (class_exists('SimpleSAML\Module\\'.$module.'\\'.$nspath) || - interface_exists('SimpleSAML\Module\\'.$module.'\\'.$nspath) - ) { - // the class has been migrated, create an alias and warn about it - \SimpleSAML\Logger::warning( - "The class or interface '$className' is now using namespaces, please use 'SimpleSAML\\Module\\". - $module."\\".$nspath."' instead." - ); - class_alias("SimpleSAML\\Module\\$module\\$nspath", $className); - } - } - } - + public static $modules = []; /** - * Autoload function for SimpleSAMLphp modules following PSR-4. + * A cache containing specific information for modules, like whether they are enabled or not, or their hooks. * - * @param string $className Name of the class. + * @var array */ - public static function autoloadPSR4($className) - { - $elements = explode('\\', $className); - if ($elements[0] === '') { // class name starting with /, ignore - array_shift($elements); - } - if (count($elements) < 4) { - return; // it can't be a module - } - if (array_shift($elements) !== 'SimpleSAML') { - return; // the first element is not "SimpleSAML" - } - if (array_shift($elements) !== 'Module') { - return; // the second element is not "module" - } - - // this is a SimpleSAMLphp module following PSR-4 - $module = array_shift($elements); - if (!self::isModuleEnabled($module)) { - return; // module not enabled, avoid giving out any information at all - } - - $file = self::getModuleDir($module).'/lib/'.implode('/', $elements).'.php'; - - if (file_exists($file)) { - require_once($file); - } - } + public static $module_info = []; /** @@ -141,8 +102,174 @@ public static function getModuleDir($module) */ public static function isModuleEnabled($module) { - $config = \SimpleSAML_Configuration::getOptionalConfig(); - return self::isModuleEnabledWithConf($module, $config->getArray('module.enable', array())); + $config = Configuration::getOptionalConfig(); + return self::isModuleEnabledWithConf($module, $config->getArray('module.enable', [])); + } + + + /** + * Handler for module requests. + * + * This controller receives requests for pages hosted by modules, and processes accordingly. Depending on the + * configuration and the actual request, it will run a PHP script and exit, or return a Response produced either + * by another controller or by a static file. + * + * @param Request|null $request The request to process. Defaults to the current one. + * + * @return Response|BinaryFileResponse Returns a Response object that can be sent to the browser. + * @throws Error\BadRequest In case the request URI is malformed. + * @throws Error\NotFound In case the request URI is invalid or the resource it points to cannot be found. + */ + public static function process(Request $request = null) + { + if ($request === null) { + $request = Request::createFromGlobals(); + } + + if ($request->getPathInfo() === '/') { + throw new Error\NotFound('No PATH_INFO to module.php'); + } + + $url = $request->getPathInfo(); + assert(substr($url, 0, 1) === '/'); + + /* clear the PATH_INFO option, so that a script can detect whether it is called with anything following the + *'.php'-ending. + */ + unset($_SERVER['PATH_INFO']); + + $modEnd = strpos($url, '/', 1); + if ($modEnd === false) { + // the path must always be on the form /module/ + throw new Error\NotFound('The URL must at least contain a module name followed by a slash.'); + } + + $module = substr($url, 1, $modEnd - 1); + $url = substr($url, $modEnd + 1); + if ($url === false) { + $url = ''; + } + + if (!self::isModuleEnabled($module)) { + throw new Error\NotFound('The module \''.$module.'\' was either not found, or wasn\'t enabled.'); + } + + /* Make sure that the request isn't suspicious (contains references to current directory or parent directory or + * anything like that. Searching for './' in the URL will detect both '../' and './'. Searching for '\' will + * detect attempts to use Windows-style paths. + */ + if (strpos($url, '\\') !== false) { + throw new Error\BadRequest('Requested URL contained a backslash.'); + } elseif (strpos($url, './') !== false) { + throw new Error\BadRequest('Requested URL contained \'./\'.'); + } + + $config = Configuration::getInstance(); + if ($config->getBoolean('usenewui', false) === true) { + $router = new HTTP\Router($module); + try { + return $router->process(); + } catch (\Symfony\Component\Config\Exception\FileLocatorFileNotFoundException $e) { + // no routes configured for this module, fall back to the old system + } catch (\Symfony\Component\HttpKernel\Exception\NotFoundHttpException $e) { + // this module has been migrated, but the route wasn't found + } + } + + $moduleDir = self::getModuleDir($module).'/www/'; + + // check for '.php/' in the path, the presence of which indicates that another php-script should handle the + // request + for ($phpPos = strpos($url, '.php/'); $phpPos !== false; $phpPos = strpos($url, '.php/', $phpPos + 1)) { + $newURL = substr($url, 0, $phpPos + 4); + $param = substr($url, $phpPos + 4); + + if (is_file($moduleDir.$newURL)) { + /* $newPath points to a normal file. Point execution to that file, and save the remainder of the path + * in PATH_INFO. + */ + $url = $newURL; + $request->server->set('PATH_INFO', $param); + $_SERVER['PATH_INFO'] = $param; + break; + } + } + + $path = $moduleDir.$url; + + if ($path[strlen($path) - 1] === '/') { + // path ends with a slash - directory reference. Attempt to find index file in directory + foreach (self::$indexFiles as $if) { + if (file_exists($path.$if)) { + $path .= $if; + break; + } + } + } + + if (is_dir($path)) { + /* Path is a directory - maybe no index file was found in the previous step, or maybe the path didn't end + * with a slash. Either way, we don't do directory listings. + */ + throw new Error\NotFound('Directory listing not available.'); + } + + if (!file_exists($path)) { + // file not found + Logger::info('Could not find file \''.$path.'\'.'); + throw new Error\NotFound('The URL wasn\'t found in the module.'); + } + + if (substr($path, -4) === '.php') { + // PHP file - attempt to run it + + /* In some environments, $_SERVER['SCRIPT_NAME'] is already set with $_SERVER['PATH_INFO']. Check for that + * case, and append script name only if necessary. + * + * Contributed by Travis Hegner. + */ + $script = "/$module/$url"; + if (strpos($request->getScriptName(), $script) === false) { + $request->server->set('SCRIPT_NAME', $request->getScriptName().'/'.$module.'/'.$url); + } + + require($path); + exit(); + } + + // some other file type - attempt to serve it + + // find MIME type for file, based on extension + $contentType = null; + if (preg_match('#\.([^/\.]+)$#D', $path, $type)) { + $type = strtolower($type[1]); + if (array_key_exists($type, self::$mimeTypes)) { + $contentType = self::$mimeTypes[$type]; + } + } + + if ($contentType === null) { + /* We were unable to determine the MIME type from the file extension. Fall back to mime_content_type (if it + * exists). + */ + if (function_exists('mime_content_type')) { + $contentType = mime_content_type($path); + } else { + // mime_content_type doesn't exist. Return a default MIME type + Logger::warning('Unable to determine mime content type of file: '.$path); + $contentType = 'application/octet-stream'; + } + } + + $response = new BinaryFileResponse($path); + $response->setCache(['public' => true, 'max_age' => 86400]); + $response->setExpires(new \DateTime(gmdate('D, j M Y H:i:s \G\M\T', time() + 10 * 60))); + $response->setLastModified(new \DateTime(gmdate('D, j M Y H:i:s \G\M\T', filemtime($path)))); + $response->headers->set('Content-Type', $contentType); + $response->headers->set('Content-Length', sprintf('%u', filesize($path))); // force file size to an unsigned + $response->setContentDisposition(ResponseHeaderBag::DISPOSITION_INLINE); + $response->prepare($request); + return $response; } @@ -235,7 +362,7 @@ public static function getModules() * * This function takes a string on the form "<module>:<class>" and converts it to a class * name. It can also check that the given class is a subclass of a specific class. The - * resolved classname will be "sspmod_<module>_<$type>_<class>. + * resolved classname will be "\SimleSAML\Module\<module>\<$type>\<class>. * * It is also possible to specify a full classname instead of <module>:<class>. * @@ -251,32 +378,32 @@ public static function getModules() */ public static function resolveClass($id, $type, $subclass = null) { - assert('is_string($id)'); - assert('is_string($type)'); - assert('is_string($subclass) || is_null($subclass)'); + assert(is_string($id)); + assert(is_string($type)); + assert(is_string($subclass) || $subclass === null); $tmp = explode(':', $id, 2); - if (count($tmp) === 1) { // no module involved + if (count($tmp) === 1) { + // no module involved $className = $tmp[0]; if (!class_exists($className)) { throw new \Exception("Could not resolve '$id': no class named '$className'."); } - } else { // should be a module + } else { + // should be a module // make sure empty types are handled correctly - $type = (empty($type)) ? '_' : '_'.$type.'_'; - - // check for the old-style class names - $className = 'sspmod_'.$tmp[0].$type.$tmp[1]; + $type = (empty($type)) ? '\\' : '\\'.$type.'\\'; + $className = 'SimpleSAML\\Module\\'.$tmp[0].$type.$tmp[1]; if (!class_exists($className)) { - // check for the new-style class names, using namespaces - $type = str_replace('_', '\\', $type); - $newClassName = 'SimpleSAML\Module\\'.$tmp[0].$type.$tmp[1]; + // check for the old-style class names + $type = str_replace('\\', '_', $type); + $oldClassName = 'sspmod_'.$tmp[0].$type.$tmp[1]; - if (!class_exists($newClassName)) { - throw new \Exception("Could not resolve '$id': no class named '$className' or '$newClassName'."); + if (!class_exists($oldClassName)) { + throw new \Exception("Could not resolve '$id': no class named '$className' or '$oldClassName'."); } - $className = $newClassName; + $className = $oldClassName; } } @@ -300,10 +427,10 @@ public static function resolveClass($id, $type, $subclass = null) * * @return string The absolute URL to the given resource. */ - public static function getModuleURL($resource, array $parameters = array()) + public static function getModuleURL($resource, array $parameters = []) { - assert('is_string($resource)'); - assert('$resource[0] !== "/"'); + assert(is_string($resource)); + assert($resource[0] !== '/'); $url = Utils\HTTP::getBaseURL().'module.php/'.$resource; if (!empty($parameters)) { @@ -330,10 +457,10 @@ public static function getModuleHooks($module) $hook_dir = self::getModuleDir($module).'/hooks'; if (!is_dir($hook_dir)) { - return array(); + return []; } - $hooks = array(); + $hooks = []; $files = scandir($hook_dir); foreach ($files as $file) { if ($file[0] === '.') { @@ -345,7 +472,7 @@ public static function getModuleHooks($module) } $hook_name = $matches[1]; $hook_func = $module.'_hook_'.$hook_name; - $hooks[$hook_name] = array('file' => $hook_dir.'/'.$file, 'func' => $hook_func); + $hooks[$hook_name] = ['file' => $hook_dir.'/'.$file, 'func' => $hook_func]; } return $hooks; } @@ -359,14 +486,14 @@ public static function getModuleHooks($module) * @param string $hook The name of the hook. * @param mixed &$data The data which should be passed to each hook. Will be passed as a reference. * - * @throws \SimpleSAML_Error_Exception If an invalid hook is found in a module. + * @throws \SimpleSAML\Error\Exception If an invalid hook is found in a module. */ public static function callHooks($hook, &$data = null) { - assert('is_string($hook)'); + assert(is_string($hook)); $modules = self::getModules(); - $config = \SimpleSAML_Configuration::getOptionalConfig()->getArray('module.enable', array()); + $config = Configuration::getOptionalConfig()->getArray('module.enable', []); sort($modules); foreach ($modules as $module) { if (!self::isModuleEnabledWithConf($module, $config)) { @@ -384,11 +511,28 @@ public static function callHooks($hook, &$data = null) require_once(self::$module_info[$module]['hooks'][$hook]['file']); if (!is_callable(self::$module_info[$module]['hooks'][$hook]['func'])) { - throw new \SimpleSAML_Error_Exception('Invalid hook \''.$hook.'\' for module \''.$module.'\'.'); + throw new \SimpleSAML\Error\Exception('Invalid hook \''.$hook.'\' for module \''.$module.'\'.'); } $fn = self::$module_info[$module]['hooks'][$hook]['func']; $fn($data); } } + + + /** + * Handle a valid request that ends with a trailing slash. + * + * This method removes the trailing slash and redirects to the resulting URL. + * + * @param Request $request The request to process by this controller method. + * + * @return RedirectResponse A redirection to the URI specified in the request, but without the trailing slash. + */ + public static function removeTrailingSlash(Request $request) + { + $pathInfo = $request->getPathInfo(); + $url = str_replace($pathInfo, rtrim($pathInfo, ' /'), $request->getRequestUri()); + return new RedirectResponse($url, 308); + } } diff --git a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Module/ControllerResolver.php b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Module/ControllerResolver.php new file mode 100644 index 0000000000..25bfa08fd1 --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Module/ControllerResolver.php @@ -0,0 +1,196 @@ +<?php + +namespace SimpleSAML\Module; + +use SimpleSAML\Auth\AuthenticationFactory; +use SimpleSAML\Configuration; +use SimpleSAML\Error\Exception; +use SimpleSAML\Module; +use SimpleSAML\Session; + +use Symfony\Component\Config\Exception\FileLocatorFileNotFoundException; +use Symfony\Component\Config\FileLocator; +use Symfony\Component\DependencyInjection\ContainerBuilder; +use Symfony\Component\DependencyInjection\Reference; +use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\HttpKernel\Controller\ArgumentResolverInterface; +use Symfony\Component\HttpKernel\Controller\ControllerResolver as SymfonyControllerResolver; +use Symfony\Component\HttpKernel\ControllerMetadata\ArgumentMetadata; +use Symfony\Component\HttpKernel\ControllerMetadata\ArgumentMetadataFactory; +use Symfony\Component\Routing\Exception\ResourceNotFoundException; +use Symfony\Component\Routing\Loader\YamlFileLoader; +use Symfony\Component\Routing\Matcher\UrlMatcher; +use Symfony\Component\Routing\RequestContext; +use Symfony\Component\Routing\Route; +use Symfony\Component\Routing\RouteCollection; + +/** + * A class to resolve module controllers based on a given request. + * + * This class allows us to find a controller (a callable) that's configured for a given URL. + * + * @package SimpleSAML + */ +class ControllerResolver extends SymfonyControllerResolver implements ArgumentResolverInterface +{ + + /** @var ArgumentMetadataFactory */ + protected $argFactory; + + /** @var ContainerBuilder */ + protected $container; + + /** @var string */ + protected $module; + + /** @var array */ + protected $params; + + /** @var RouteCollection */ + protected $routes; + + + /** + * Build a module controller resolver. + * + * @param string $module The name of the module. + */ + public function __construct($module) + { + parent::__construct(); + $this->module = $module; + + $loader = new YamlFileLoader( + new FileLocator(Module::getModuleDir($this->module)) + ); + + $this->argFactory = new ArgumentMetadataFactory(); + $this->container = new ContainerBuilder(); + $this->container->autowire(AuthenticationFactory::class, AuthenticationFactory::class); + + try { + $this->routes = $loader->load('routes.yaml'); + $redirect = new Route( + '/{url}', + ['_controller' => '\SimpleSAML\Module::removeTrailingSlash'], + ['url' => '.*/$'] + ); + $this->routes->add('trailing-slash', $redirect); + $this->routes->addPrefix('/'.$this->module); + } catch (FileLocatorFileNotFoundException $e) { + } + } + + + /** + * Get the controller associated with a given URL, based on a request. + * + * This method searches for a 'routes.yaml' file in the root of the module, defining valid routes for the module + * and mapping them given controllers. It's input is a Request object with the request that we want to serve. + * + * @param Request $request The request we need to find a controller for. + * + * @return callable|false A controller (as a callable) that can handle the request, or false if we cannot find + * one suitable for the given request. + */ + public function getController(Request $request) + { + if ($this->routes === null) { + return false; + } + $ctxt = new RequestContext(); + $ctxt->fromRequest($request); + + try { + $matcher = new UrlMatcher($this->routes, $ctxt); + $this->params = $matcher->match($ctxt->getPathInfo()); + list($class, $method) = explode('::', $this->params['_controller']); + $this->container->register($class, $class)->setAutowired(true)->setPublic(true); + $this->container->compile(); + return [$this->container->get($class), $method]; + } catch (ResourceNotFoundException $e) { + // no route defined matching this request + } + return false; + } + + + /** + * Get the arguments that should be passed to a controller from a given request. + * + * When the signature of the controller includes arguments with type Request, the given request will be passed to + * those. Otherwise, they'll be matched by name. If no value is available for a given argument, the method will + * try to set a default value or null, if possible. + * + * @param Request $request The request that holds all the information needed by the controller. + * @param callable $controller A controller for the given request. + * + * @return array An array of arguments that should be passed to the controller, in order. + * + * @throws \SimpleSAML\Error\Exception If we don't find anything suitable for an argument in the controller's + * signature. + */ + public function getArguments(Request $request, $controller) + { + $args = []; + $metadata = $this->argFactory->createArgumentMetadata($controller); + + /** @var ArgumentMetadata $argMeta */ + foreach ($metadata as $argMeta) { + if ($argMeta->getType() === 'Symfony\Component\HttpFoundation\Request') { + // add request argument + $args[] = $request; + continue; + } + + $argName = $argMeta->getName(); + if (array_key_exists($argName, $this->params)) { + // add argument by name + $args[] = $this->params[$argName]; + continue; + } + + // URL does not contain value for this argument + if ($argMeta->hasDefaultValue()) { + // it has a default value + $args[] = $argMeta->getDefaultValue(); + } + + // no default value + if ($argMeta->isNullable()) { + $args[] = null; + } + + throw new Exception('Missing value for argument '.$argName.'. This is probably a bug.'); + } + + return $args; + } + + + /** + * Set the configuration to use by the controllers. + * + * @param \SimpleSAML\Configuration $config + */ + public function setConfiguration(Configuration $config) + { + $this->container->set(Configuration::class, $config); + $this->container->register(Configuration::class)->setSynthetic(true)->setAutowired(true); + } + + + /** + * Set the session to use by the controllers. + * + * @param \SimpleSAML\Session $session + */ + public function setSession(Session $session) + { + $this->container->set(Session::class, $session); + $this->container->register(Session::class) + ->setSynthetic(true) + ->setAutowired(true) + ->addMethodCall('setConfiguration', [new Reference(Configuration::class)]); + } +} diff --git a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Session.php b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Session.php index 5492a95141..cd158b3fe6 100644 --- a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Session.php +++ b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Session.php @@ -1,4 +1,9 @@ <?php + +namespace SimpleSAML; + +use SimpleSAML\Error; + /** * The Session class holds information about a user session, and everything attached to it. * @@ -16,9 +21,9 @@ * @author Jaime Pérez Crespo, UNINETT AS <jaime.perez@uninett.no> * @package SimpleSAMLphp */ -class SimpleSAML_Session implements Serializable -{ +class Session implements \Serializable, Utils\ClearableState +{ /** * This is a timeout value for setData, which indicates that the data * should never be deleted, i.e. lasts the whole session lifetime. @@ -33,16 +38,22 @@ class SimpleSAML_Session implements Serializable * * @var array */ - private static $sessions = array(); + private static $sessions = []; /** * This variable holds the instance of the session - Singleton approach. * - * Warning: do not set the instance manually, call SimpleSAML_Session::load() instead. + * Warning: do not set the instance manually, call Session::load() instead. */ private static $instance = null; + /** + * The global configuration. + * + * @var \SimpleSAML\Configuration + */ + private static $config; /** * The session ID of this session. @@ -51,7 +62,6 @@ class SimpleSAML_Session implements Serializable */ private $sessionId; - /** * Transient session flag. * @@ -59,7 +69,6 @@ class SimpleSAML_Session implements Serializable */ private $transient = false; - /** * The track id is a new random unique identifier that is generated for each session. * This is used in the debug logs and error messages to easily track more information @@ -69,10 +78,11 @@ class SimpleSAML_Session implements Serializable */ private $trackid = null; - + /** + * @var integer|null + */ private $rememberMeExpire = null; - /** * Marks a session as modified, and therefore needs to be saved before destroying * this object. @@ -81,7 +91,6 @@ class SimpleSAML_Session implements Serializable */ private $dirty = false; - /** * Tells the session object that the save callback has been registered and there's no need to register it again. * @@ -89,7 +98,6 @@ class SimpleSAML_Session implements Serializable */ private $callback_registered = false; - /** * This is an array of objects which will expire automatically after a set time. It is used * where one needs to store some information - for example a logout request, but doesn't @@ -100,8 +108,7 @@ class SimpleSAML_Session implements Serializable * * @var array */ - private $dataStore = null; - + private $dataStore = []; /** * The list of IdP-SP associations. @@ -111,8 +118,7 @@ class SimpleSAML_Session implements Serializable * * @var array */ - private $associations = array(); - + private $associations = []; /** * The authentication token. @@ -123,15 +129,14 @@ class SimpleSAML_Session implements Serializable */ private $authToken; - /** * Authentication data. * * This is an array with authentication data for the various authsources. * - * @var array|null Associative array of associative arrays. + * @var array Associative array of associative arrays. */ - private $authData; + private $authData = []; /** @@ -142,19 +147,20 @@ class SimpleSAML_Session implements Serializable */ private function __construct($transient = false) { - $this->authData = array(); + $this->setConfiguration(Configuration::getInstance()); if (php_sapi_name() === 'cli' || defined('STDIN')) { $this->trackid = 'CL'.bin2hex(openssl_random_pseudo_bytes(4)); - SimpleSAML\Logger::setTrackId($this->trackid); + Logger::setTrackId($this->trackid); $this->transient = $transient; return; } - if ($transient) { // transient session - $sh = \SimpleSAML\SessionHandler::getSessionHandler(); + if ($transient) { + // transient session + $sh = SessionHandler::getSessionHandler(); $this->trackid = 'TR'.bin2hex(openssl_random_pseudo_bytes(4)); - SimpleSAML\Logger::setTrackId($this->trackid); + Logger::setTrackId($this->trackid); $this->transient = true; /* @@ -165,28 +171,39 @@ private function __construct($transient = false) if ($this->sessionId === null) { $this->sessionId = $sh->newSessionId(); } - } else { // regular session - $sh = \SimpleSAML\SessionHandler::getSessionHandler(); + } else { + // regular session + $sh = SessionHandler::getSessionHandler(); $this->sessionId = $sh->newSessionId(); $sh->setCookie($sh->getSessionCookieName(), $this->sessionId, $sh->getCookieParams()); $this->trackid = bin2hex(openssl_random_pseudo_bytes(5)); - SimpleSAML\Logger::setTrackId($this->trackid); + Logger::setTrackId($this->trackid); $this->markDirty(); // initialize data for session check function if defined - $globalConfig = SimpleSAML_Configuration::getInstance(); - $checkFunction = $globalConfig->getArray('session.check_function', null); + $checkFunction = self::$config->getArray('session.check_function', null); if (isset($checkFunction)) { - assert('is_callable($checkFunction)'); + assert(is_callable($checkFunction)); call_user_func($checkFunction, $this, true); } } } + /** + * Set the configuration we should use. + * + * @param Configuration $config + */ + public function setConfiguration(Configuration $config) + { + self::$config = $config; + } + + /** * Serialize this session object. * @@ -196,11 +213,9 @@ private function __construct($transient = false) */ public function serialize() { - $serialized = serialize(get_object_vars($this)); - return $serialized; + return serialize(get_object_vars($this)); } - /** * Unserialize a session object and load it.. * @@ -217,6 +232,7 @@ public function unserialize($serialized) $this->$k = $v; } } + self::$config = Configuration::getInstance(); // look for any raw attributes and load them in the 'Attributes' array foreach ($this->authData as $authority => $parameters) { @@ -225,7 +241,8 @@ public function unserialize($serialized) } foreach ($parameters['RawAttributes'] as $attribute => $values) { - foreach ($values as $idx => $value) { // this should be originally a DOMNodeList + foreach ($values as $idx => $value) { + // this should be originally a DOMNodeList /* @var \SAML2\XML\saml\AttributeValue $value */ $this->authData[$authority]['Attributes'][$attribute][$idx] = $value->element->childNodes; } @@ -233,12 +250,11 @@ public function unserialize($serialized) } } - /** * Retrieves the current session. Creates a new session if there's not one. * - * @return SimpleSAML_Session The current session. - * @throws Exception When session couldn't be initialized and the session fallback is disabled by configuration. + * @return Session The current session. + * @throws \Exception When session couldn't be initialized and the session fallback is disabled by configuration. */ public static function getSessionFromRequest() { @@ -248,21 +264,20 @@ public static function getSessionFromRequest() } // check if we have stored a session stored with the session handler - $session = null; try { $session = self::getSession(); - } catch (Exception $e) { + } catch (\Exception $e) { /* * For some reason, we were unable to initialize this session. Note that this error might be temporary, and * it's possible that we can recover from it in subsequent requests, so we should not try to create a new * session here. Therefore, use just a transient session and throw the exception for someone else to handle * it. */ - SimpleSAML\Logger::error('Error loading session: '.$e->getMessage()); + Logger::error('Error loading session: '.$e->getMessage()); self::useTransientSession(); - if ($e instanceof SimpleSAML_Error_Exception) { + if ($e instanceof Error\Exception) { $cause = $e->getCause(); - if ($cause instanceof Exception) { + if ($cause instanceof \Exception) { throw $cause; } } @@ -270,7 +285,7 @@ public static function getSessionFromRequest() } // if getSession() found it, use it - if ($session instanceof SimpleSAML_Session) { + if ($session instanceof Session) { return self::load($session); } @@ -286,20 +301,20 @@ public static function getSessionFromRequest() // try to create a new session try { - self::load(new SimpleSAML_Session()); - } catch (\SimpleSAML\Error\CannotSetCookie $e) { + self::load(new Session()); + } catch (Error\CannotSetCookie $e) { // can't create a regular session because we can't set cookies. Use transient. - $c = SimpleSAML_Configuration::getInstance(); + $c = Configuration::getInstance(); self::useTransientSession(); - if ($e->getCode() === \SimpleSAML\Error\CannotSetCookie::SECURE_COOKIE) { - throw new \SimpleSAML\Error\CriticalConfigurationError( + if ($e->getCode() === Error\CannotSetCookie::SECURE_COOKIE) { + throw new Error\CriticalConfigurationError( $e->getMessage(), null, $c->toArray() ); } - SimpleSAML\Logger::error('Error creating session: '.$e->getMessage()); + Logger::error('Error creating session: '.$e->getMessage()); } // we must have a session now, either regular or transient @@ -311,14 +326,14 @@ public static function getSessionFromRequest() * * @param string|null $sessionId The session we should get, or null to get the current session. * - * @return SimpleSAML_Session|null The session that is stored in the session handler, or null if the session wasn't + * @return Session|null The session that is stored in the session handler, or null if the session wasn't * found. */ public static function getSession($sessionId = null) { - assert('is_string($sessionId) || is_null($sessionId)'); + assert(is_string($sessionId) || $sessionId === null); - $sh = \SimpleSAML\SessionHandler::getSessionHandler(); + $sh = SessionHandler::getSessionHandler(); if ($sessionId === null) { $checkToken = true; @@ -339,10 +354,10 @@ public static function getSession($sessionId = null) return null; } - assert('$session instanceof self'); + assert($session instanceof self); if ($checkToken) { - $globalConfig = SimpleSAML_Configuration::getInstance(); + $globalConfig = Configuration::getInstance(); if ($session->authToken !== null) { $authTokenCookieName = $globalConfig->getString( @@ -350,11 +365,11 @@ public static function getSession($sessionId = null) 'SimpleSAMLAuthToken' ); if (!isset($_COOKIE[$authTokenCookieName])) { - SimpleSAML\Logger::warning('Missing AuthToken cookie.'); + Logger::warning('Missing AuthToken cookie.'); return null; } - if (!SimpleSAML\Utils\Crypto::secureCompare($session->authToken, $_COOKIE[$authTokenCookieName])) { - SimpleSAML\Logger::warning('Invalid AuthToken cookie.'); + if (!Utils\Crypto::secureCompare($session->authToken, $_COOKIE[$authTokenCookieName])) { + Logger::warning('Invalid AuthToken cookie.'); return null; } } @@ -362,10 +377,10 @@ public static function getSession($sessionId = null) // run session check function if defined $checkFunction = $globalConfig->getArray('session.check_function', null); if (isset($checkFunction)) { - assert('is_callable($checkFunction)'); + assert(is_callable($checkFunction)); $check = call_user_func($checkFunction, $session); if ($check !== true) { - SimpleSAML\Logger::warning('Session did not pass check function.'); + Logger::warning('Session did not pass check function.'); return null; } } @@ -376,7 +391,6 @@ public static function getSession($sessionId = null) return $session; } - /** * Load a given session as the current one. * @@ -384,12 +398,12 @@ public static function getSession($sessionId = null) * * Warning: never set self::$instance yourself, call this method instead. * - * @param SimpleSAML_Session $session The session to load. - * @return SimpleSAML_Session The session we just loaded, just for convenience. + * @param Session $session The session to load. + * @return Session The session we just loaded, just for convenience. */ - private static function load(SimpleSAML_Session $session) + private static function load(Session $session) { - SimpleSAML\Logger::setTrackId($session->getTrackID()); + Logger::setTrackId($session->getTrackID()); self::$instance = $session; return self::$instance; } @@ -407,7 +421,7 @@ public static function useTransientSession() return; } - self::load(new SimpleSAML_Session(true)); + self::load(new Session(true)); } /** @@ -417,7 +431,7 @@ public static function useTransientSession() */ public static function createSession($sessionId) { - assert('is_string($sessionId)'); + assert(is_string($sessionId)); self::$sessions[$sessionId] = null; } @@ -439,20 +453,19 @@ public function save() $this->dirty = false; $this->callback_registered = false; - $sh = \SimpleSAML\SessionHandler::getSessionHandler(); + $sh = SessionHandler::getSessionHandler(); try { $sh->saveSession($this); - } catch (Exception $e) { - if (!($e instanceof SimpleSAML_Error_Exception)) { - $e = new SimpleSAML_Error_UnserializableException($e); + } catch (\Exception $e) { + if (!($e instanceof Error\Exception)) { + $e = new Error\UnserializableException($e); } - SimpleSAML\Logger::error('Unable to save session.'); + Logger::error('Unable to save session.'); $e->logError(); } } - /** * Save the current session and clean any left overs that could interfere with the normal application behaviour. * @@ -462,13 +475,12 @@ public function save() public function cleanup() { $this->save(); - $sh = \SimpleSAML\SessionHandler::getSessionHandler(); - if ($sh instanceof \SimpleSAML\SessionHandlerPHP) { + $sh = SessionHandler::getSessionHandler(); + if ($sh instanceof SessionHandlerPHP) { $sh->restorePrevious(); } } - /** * Mark this session as dirty. * @@ -482,19 +494,13 @@ public function markDirty() $this->dirty = true; - if (!function_exists('header_register_callback')) { - // PHP version < 5.4, can't register the callback - return; - } - if ($this->callback_registered) { // we already have a shutdown callback registered for this object, no need to add another one return; } - $this->callback_registered = header_register_callback(array($this, 'save')); + $this->callback_registered = header_register_callback([$this, 'save']); } - /** * Destroy the session. * @@ -554,15 +560,14 @@ public function getRememberMeExpire() */ public function setRememberMeExpire($expire = null) { - assert('is_int($expire) || is_null($expire)'); + assert(is_int($expire) || $expire === null); if ($expire === null) { - $globalConfig = SimpleSAML_Configuration::getInstance(); - $expire = time() + $globalConfig->getInteger('session.rememberme.lifetime', 14 * 86400); + $expire = time() + self::$config->getInteger('session.rememberme.lifetime', 14 * 86400); } $this->rememberMeExpire = $expire; - $cookieParams = array('expire' => $this->rememberMeExpire); + $cookieParams = ['expire' => $this->rememberMeExpire]; $this->updateSessionCookies($cookieParams); } @@ -574,14 +579,14 @@ public function setRememberMeExpire($expire = null) * @param string $authority The authority the user logged in with. * @param array|null $data The authentication data for this authority. * - * @throws \SimpleSAML\Error\CannotSetCookie If the authentication token cannot be set for some reason. + * @throws Error\CannotSetCookie If the authentication token cannot be set for some reason. */ public function doLogin($authority, array $data = null) { - assert('is_string($authority)'); - assert('is_array($data) || is_null($data)'); + assert(is_string($authority)); + assert(is_array($data) || $data === null); - SimpleSAML\Logger::debug('Session: doLogin("'.$authority.'")'); + Logger::debug('Session: doLogin("'.$authority.'")'); $this->markDirty(); @@ -591,17 +596,16 @@ public function doLogin($authority, array $data = null) } if ($data === null) { - $data = array(); + $data = []; } $data['Authority'] = $authority; - $globalConfig = SimpleSAML_Configuration::getInstance(); if (!isset($data['AuthnInstant'])) { $data['AuthnInstant'] = time(); } - $maxSessionExpire = time() + $globalConfig->getInteger('session.duration', 8 * 60 * 60); + $maxSessionExpire = time() + self::$config->getInteger('session.duration', 8 * 60 * 60); if (!isset($data['Expire']) || $data['Expire'] > $maxSessionExpire) { // unset, or beyond our session lifetime. Clamp it to our maximum session lifetime $data['Expire'] = $maxSessionExpire; @@ -632,22 +636,21 @@ public function doLogin($authority, array $data = null) $this->authData[$authority] = $data; - $this->authToken = SimpleSAML\Utils\Random::generateID(); - $sessionHandler = \SimpleSAML\SessionHandler::getSessionHandler(); + $this->authToken = Utils\Random::generateID(); + $sessionHandler = SessionHandler::getSessionHandler(); - if (!$this->transient && (!empty($data['RememberMe']) || $this->rememberMeExpire) && - $globalConfig->getBoolean('session.rememberme.enable', false) + if (!$this->transient && (!empty($data['RememberMe']) || $this->rememberMeExpire !== null) && + self::$config->getBoolean('session.rememberme.enable', false) ) { - $this->setRememberMeExpire(); } else { try { - SimpleSAML\Utils\HTTP::setCookie( - $globalConfig->getString('session.authtoken.cookiename', 'SimpleSAMLAuthToken'), + Utils\HTTP::setCookie( + self::$config->getString('session.authtoken.cookiename', 'SimpleSAMLAuthToken'), $this->authToken, $sessionHandler->getCookieParams() ); - } catch (SimpleSAML\Error\CannotSetCookie $e) { + } catch (Error\CannotSetCookie $e) { /* * Something went wrong when setting the auth token. We cannot recover from this, so we better log a * message and throw an exception. The user is not properly logged in anyway, so clear all login @@ -655,7 +658,7 @@ public function doLogin($authority, array $data = null) */ unset($this->authToken); unset($this->authData[$authority]); - \SimpleSAML\Logger::error('Cannot set authentication token cookie: '.$e->getMessage()); + Logger::error('Cannot set authentication token cookie: '.$e->getMessage()); throw $e; } } @@ -670,10 +673,10 @@ public function doLogin($authority, array $data = null) */ public function doLogout($authority) { - SimpleSAML\Logger::debug('Session: doLogout('.var_export($authority, true).')'); + Logger::debug('Session: doLogout('.var_export($authority, true).')'); if (!isset($this->authData[$authority])) { - SimpleSAML\Logger::debug('Session: Already logged out of '.$authority.'.'); + Logger::debug('Session: Already logged out of '.$authority.'.'); return; } @@ -682,7 +685,7 @@ public function doLogout($authority) $this->callLogoutHandlers($authority); unset($this->authData[$authority]); - if (!$this->isValid($authority) && $this->rememberMeExpire) { + if (!$this->isValid($authority) && $this->rememberMeExpire !== null) { $this->rememberMeExpire = null; $this->updateSessionCookies(); } @@ -693,12 +696,12 @@ public function doLogout($authority) * * @param string $authority The authentication source we are logging out from. * - * @throws Exception If the handler is not a valid function or method. + * @throws \Exception If the handler is not a valid function or method. */ private function callLogoutHandlers($authority) { - assert('is_string($authority)'); - assert('isset($this->authData[$authority])'); + assert(is_string($authority)); + assert(isset($this->authData[$authority])); if (empty($this->authData[$authority]['LogoutHandlers'])) { return; @@ -709,7 +712,7 @@ private function callLogoutHandlers($authority) $classname = $handler[0]; $functionname = $handler[1]; - throw new Exception( + throw new \Exception( 'Logout handler is not a valid function: '.$classname.'::'. $functionname ); @@ -729,14 +732,14 @@ private function callLogoutHandlers($authority) * * @param string $authority The authentication source that the user should be authenticated with. * - * @return true if the user has a valid session, false if not. + * @return bool True if the user has a valid session, false if not. */ public function isValid($authority) { - assert('is_string($authority)'); + assert(is_string($authority)); if (!isset($this->authData[$authority])) { - SimpleSAML\Logger::debug( + Logger::debug( 'Session: '.var_export($authority, true). ' not valid because we are not authenticated.' ); @@ -744,11 +747,11 @@ public function isValid($authority) } if ($this->authData[$authority]['Expire'] <= time()) { - SimpleSAML\Logger::debug('Session: '.var_export($authority, true).' not valid because it is expired.'); + Logger::debug('Session: '.var_export($authority, true).' not valid because it is expired.'); return false; } - SimpleSAML\Logger::debug('Session: Valid session found with '.var_export($authority, true).'.'); + Logger::debug('Session: Valid session found with '.var_export($authority, true).'.'); return true; } @@ -760,16 +763,19 @@ public function isValid($authority) */ public function updateSessionCookies($params = null) { - $sessionHandler = \SimpleSAML\SessionHandler::getSessionHandler(); + assert(is_null($params) || is_array($params)); + + $sessionHandler = SessionHandler::getSessionHandler(); if ($this->sessionId !== null) { $sessionHandler->setCookie($sessionHandler->getSessionCookieName(), $this->sessionId, $params); } + $params = array_merge($sessionHandler->getCookieParams(), is_array($params) ? $params : []); + if ($this->authToken !== null) { - $globalConfig = SimpleSAML_Configuration::getInstance(); - \SimpleSAML\Utils\HTTP::setCookie( - $globalConfig->getString('session.authtoken.cookiename', 'SimpleSAMLAuthToken'), + Utils\HTTP::setCookie( + self::$config->getString('session.authtoken.cookiename', 'SimpleSAMLAuthToken'), $this->authToken, $params ); @@ -784,14 +790,13 @@ public function updateSessionCookies($params = null) */ public function setAuthorityExpire($authority, $expire = null) { - assert('isset($this->authData[$authority])'); - assert('is_int($expire) || is_null($expire)'); + assert(isset($this->authData[$authority])); + assert(is_int($expire) || $expire === null); $this->markDirty(); if ($expire === null) { - $globalConfig = SimpleSAML_Configuration::getInstance(); - $expire = time() + $globalConfig->getInteger('session.duration', 8 * 60 * 60); + $expire = time() + self::$config->getInteger('session.duration', 8 * 60 * 60); } $this->authData[$authority]['Expire'] = $expire; @@ -804,17 +809,17 @@ public function setAuthorityExpire($authority, $expire = null) * @param string $classname The class which contains the logout handler. * @param string $functionname The logout handler function. * - * @throws Exception If the handler is not a valid function or method. + * @throws \Exception If the handler is not a valid function or method. */ public function registerLogoutHandler($authority, $classname, $functionname) { - assert('isset($this->authData[$authority])'); + assert(isset($this->authData[$authority])); - $logout_handler = array($classname, $functionname); + $logout_handler = [$classname, $functionname]; if (!is_callable($logout_handler)) { - throw new Exception( - 'Logout handler is not a vaild function: '.$classname.'::'. + throw new \Exception( + 'Logout handler is not a valid function: '.$classname.'::'. $functionname ); } @@ -833,12 +838,8 @@ public function registerLogoutHandler($authority, $classname, $functionname) */ public function deleteData($type, $id) { - assert('is_string($type)'); - assert('is_string($id)'); - - if (!is_array($this->dataStore)) { - return; - } + assert(is_string($type)); + assert(is_string($id)); if (!array_key_exists($type, $this->dataStore)) { return; @@ -851,36 +852,34 @@ public function deleteData($type, $id) /** * This function stores data in the data store. * - * The timeout value can be SimpleSAML_Session::DATA_TIMEOUT_SESSION_END, which indicates + * The timeout value can be Session::DATA_TIMEOUT_SESSION_END, which indicates * that the data should never be deleted. * * @param string $type The type of the data. This is checked when retrieving data from the store. * @param string $id The identifier of the data. * @param mixed $data The data. - * @param int|null $timeout The number of seconds this data should be stored after its last access. + * @param int|string|null $timeout The number of seconds this data should be stored after its last access. * This parameter is optional. The default value is set in 'session.datastore.timeout', * and the default is 4 hours. * - * @throws Exception If the data couldn't be stored. + * @throws \Exception If the data couldn't be stored. * */ public function setData($type, $id, $data, $timeout = null) { - assert('is_string($type)'); - assert('is_string($id)'); - assert('is_int($timeout) || is_null($timeout) || $timeout === self::DATA_TIMEOUT_SESSION_END'); + assert(is_string($type)); + assert(is_string($id)); + assert(is_int($timeout) || $timeout === null || $timeout === self::DATA_TIMEOUT_SESSION_END); // clean out old data $this->expireData(); if ($timeout === null) { // use the default timeout - $configuration = SimpleSAML_Configuration::getInstance(); - - $timeout = $configuration->getInteger('session.datastore.timeout', null); + $timeout = self::$config->getInteger('session.datastore.timeout', null); if ($timeout !== null) { if ($timeout <= 0) { - throw new Exception( + throw new \Exception( 'The value of the session.datastore.timeout'. ' configuration option should be a positive integer.' ); @@ -894,18 +893,14 @@ public function setData($type, $id, $data, $timeout = null) $expires = time() + $timeout; } - $dataInfo = array( + $dataInfo = [ 'expires' => $expires, 'timeout' => $timeout, 'data' => $data - ); - - if (!is_array($this->dataStore)) { - $this->dataStore = array(); - } + ]; if (!array_key_exists($type, $this->dataStore)) { - $this->dataStore[$type] = array(); + $this->dataStore[$type] = []; } $this->dataStore[$type][$id] = $dataInfo; @@ -922,10 +917,6 @@ public function setData($type, $id, $data, $timeout = null) */ private function expireData() { - if (!is_array($this->dataStore)) { - return; - } - $ct = time(); foreach ($this->dataStore as &$typedData) { @@ -955,8 +946,8 @@ private function expireData() */ public function getData($type, $id) { - assert('is_string($type)'); - assert('$id === null || is_string($id)'); + assert(is_string($type)); + assert($id === null || is_string($id)); if ($id === null) { return null; @@ -964,10 +955,6 @@ public function getData($type, $id) $this->expireData(); - if (!is_array($this->dataStore)) { - return null; - } - if (!array_key_exists($type, $this->dataStore)) { return null; } @@ -994,17 +981,13 @@ public function getData($type, $id) */ public function getDataOfType($type) { - assert('is_string($type)'); - - if (!is_array($this->dataStore)) { - return array(); - } + assert(is_string($type)); if (!array_key_exists($type, $this->dataStore)) { - return array(); + return []; } - $ret = array(); + $ret = []; foreach ($this->dataStore[$type] as $id => $info) { $ret[$id] = $info['data']; } @@ -1021,7 +1004,7 @@ public function getDataOfType($type) */ public function getAuthState($authority) { - assert('is_string($authority)'); + assert(is_string($authority)); if (!isset($this->authData[$authority])) { return null; @@ -1030,7 +1013,6 @@ public function getAuthState($authority) return $this->authData[$authority]; } - /** * Check whether the session cookie is set. * @@ -1040,31 +1022,30 @@ public function getAuthState($authority) */ public function hasSessionCookie() { - $sh = \SimpleSAML\SessionHandler::getSessionHandler(); + $sh = SessionHandler::getSessionHandler(); return $sh->hasSessionCookie(); } - /** * Add an SP association for an IdP. * - * This function is only for use by the SimpleSAML_IdP class. + * This function is only for use by the IdP class. * * @param string $idp The IdP id. * @param array $association The association we should add. */ public function addAssociation($idp, array $association) { - assert('is_string($idp)'); - assert('isset($association["id"])'); - assert('isset($association["Handler"])'); + assert(is_string($idp)); + assert(isset($association['id'])); + assert(isset($association['Handler'])); if (!isset($this->associations)) { - $this->associations = array(); + $this->associations = []; } if (!isset($this->associations[$idp])) { - $this->associations[$idp] = array(); + $this->associations[$idp] = []; } $this->associations[$idp][$association['id']] = $association; @@ -1072,11 +1053,10 @@ public function addAssociation($idp, array $association) $this->markDirty(); } - /** * Retrieve the associations for an IdP. * - * This function is only for use by the SimpleSAML_IdP class. + * This function is only for use by the IdP class. * * @param string $idp The IdP id. * @@ -1084,14 +1064,14 @@ public function addAssociation($idp, array $association) */ public function getAssociations($idp) { - assert('is_string($idp)'); + assert(is_string($idp)); if (!isset($this->associations)) { - $this->associations = array(); + $this->associations = []; } if (!isset($this->associations[$idp])) { - return array(); + return []; } foreach ($this->associations[$idp] as $id => $assoc) { @@ -1108,19 +1088,18 @@ public function getAssociations($idp) return $this->associations[$idp]; } - /** * Remove an SP association for an IdP. * - * This function is only for use by the SimpleSAML_IdP class. + * This function is only for use by the IdP class. * * @param string $idp The IdP id. * @param string $associationId The id of the association. */ public function terminateAssociation($idp, $associationId) { - assert('is_string($idp)'); - assert('is_string($associationId)'); + assert(is_string($idp)); + assert(is_string($associationId)); if (!isset($this->associations)) { return; @@ -1135,7 +1114,6 @@ public function terminateAssociation($idp, $associationId) $this->markDirty(); } - /** * Retrieve authentication data. * @@ -1146,8 +1124,8 @@ public function terminateAssociation($idp, $associationId) */ public function getAuthData($authority, $name) { - assert('is_string($authority)'); - assert('is_string($name)'); + assert(is_string($authority)); + assert(is_string($name)); if (!isset($this->authData[$authority][$name])) { return null; @@ -1155,7 +1133,6 @@ public function getAuthData($authority, $name) return $this->authData[$authority][$name]; } - /** * Retrieve a list of authorities (authentication sources) that are currently valid within * this session. @@ -1164,7 +1141,7 @@ public function getAuthData($authority, $name) */ public function getAuthorities() { - $authorities = array(); + $authorities = []; foreach (array_keys($this->authData) as $authority) { if ($this->isValid($authority)) { $authorities[] = $authority; @@ -1172,4 +1149,15 @@ public function getAuthorities() } return $authorities; } + + + /** + * Clear any configuration information cached + */ + public static function clearInternalState() + { + self::$config = null; + self::$instance = null; + self::$sessions = null; + } } diff --git a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/SessionHandler.php b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/SessionHandler.php index 7c18ac210c..b7422609a6 100644 --- a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/SessionHandler.php +++ b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/SessionHandler.php @@ -82,9 +82,9 @@ abstract public function getSessionCookieName(); /** * Save the session. * - * @param \SimpleSAML_Session $session The session object we should save. + * @param \SimpleSAML\Session $session The session object we should save. */ - abstract public function saveSession(\SimpleSAML_Session $session); + abstract public function saveSession(Session $session); /** @@ -92,11 +92,21 @@ abstract public function saveSession(\SimpleSAML_Session $session); * * @param string|null $sessionId The ID of the session we should load, or null to use the default. * - * @return \SimpleSAML_Session|null The session object, or null if it doesn't exist. + * @return \SimpleSAML\Session|null The session object, or null if it doesn't exist. */ abstract public function loadSession($sessionId = null); + /** + * Check whether the session cookie is set. + * + * This function will only return false if is is certain that the cookie isn't set. + * + * @return bool True if it was set, false if not. + */ + abstract public function hasSessionCookie(); + + /** * Set a session cookie. * @@ -113,13 +123,13 @@ abstract public function setCookie($sessionName, $sessionID, array $cookieParams * Initialize the session handler. * * This function creates an instance of the session handler which is - * selected in the 'session.handler' configuration directive. If no + * selected in the 'store.type' configuration directive. If no * session handler is selected, then we will fall back to the default * PHP session handler. */ private static function createSessionHandler() { - $store = \SimpleSAML\Store::getInstance(); + $store = Store::getInstance(); if ($store === false) { self::$sessionHandler = new SessionHandlerPHP(); } else { @@ -129,19 +139,6 @@ private static function createSessionHandler() } - /** - * Check whether the session cookie is set. - * - * This function will only return false if is is certain that the cookie isn't set. - * - * @return bool True if it was set, false if not. - */ - public function hasSessionCookie() - { - return true; - } - - /** * Get the cookie parameters that should be used for session cookies. * @@ -150,14 +147,15 @@ public function hasSessionCookie() */ public function getCookieParams() { - $config = \SimpleSAML_Configuration::getInstance(); + $config = Configuration::getInstance(); - return array( + return [ 'lifetime' => $config->getInteger('session.cookie.lifetime', 0), 'path' => $config->getString('session.cookie.path', '/'), 'domain' => $config->getString('session.cookie.domain', null), 'secure' => $config->getBoolean('session.cookie.secure', false), + 'samesite' => $config->getString('session.cookie.samesite', null), 'httponly' => true, - ); + ]; } } diff --git a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/SessionHandlerCookie.php b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/SessionHandlerCookie.php index 5f82e76b38..7eea4656d9 100644 --- a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/SessionHandlerCookie.php +++ b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/SessionHandlerCookie.php @@ -44,7 +44,7 @@ protected function __construct() // call the constructor in the base class in case it should become necessary in the future parent::__construct(); - $config = \SimpleSAML_Configuration::getInstance(); + $config = Configuration::getInstance(); $this->cookie_name = $config->getString('session.cookie.name', 'SimpleSAMLSessionID'); } @@ -57,7 +57,7 @@ protected function __construct() public function newSessionId() { $this->session_id = self::createSessionID(); - \SimpleSAML_Session::createSession($this->session_id); + Session::createSession($this->session_id); return $this->session_id; } @@ -71,7 +71,7 @@ public function newSessionId() public function getCookieSessionId() { if ($this->session_id === null) { - if (self::hasSessionCookie()) { + if ($this->hasSessionCookie()) { // attempt to retrieve the session id from the cookie $this->session_id = $_COOKIE[$this->cookie_name]; } @@ -159,8 +159,8 @@ public function hasSessionCookie() */ public function setCookie($sessionName, $sessionID, array $cookieParams = null) { - assert('is_string($sessionName)'); - assert('is_string($sessionID) || is_null($sessionID)'); + assert(is_string($sessionName)); + assert(is_string($sessionID) || $sessionID === null); if ($cookieParams !== null) { $params = array_merge($this->getCookieParams(), $cookieParams); diff --git a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/SessionHandlerPHP.php b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/SessionHandlerPHP.php index 4583adac88..6045c59aac 100644 --- a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/SessionHandlerPHP.php +++ b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/SessionHandlerPHP.php @@ -34,7 +34,7 @@ class SessionHandlerPHP extends SessionHandler * * @var array */ - private $previous_session = array(); + private $previous_session = []; /** @@ -46,16 +46,10 @@ protected function __construct() // call the parent constructor in case it should become necessary in the future parent::__construct(); - $config = \SimpleSAML_Configuration::getInstance(); + $config = Configuration::getInstance(); $this->cookie_name = $config->getString('session.phpsession.cookiename', null); - if (function_exists('session_status') && defined('PHP_SESSION_ACTIVE')) { // PHP >= 5.4 - $previous_session = session_status() === PHP_SESSION_ACTIVE; - } else { - $previous_session = (session_id() !== '') && (session_name() !== $this->cookie_name); - } - - if ($previous_session) { + if (session_status() === PHP_SESSION_ACTIVE) { if (session_name() === $this->cookie_name || $this->cookie_name === null) { Logger::warning( 'There is already a PHP session with the same name as SimpleSAMLphp\'s session, or the '. @@ -82,13 +76,30 @@ protected function __construct() $params = $this->getCookieParams(); - session_set_cookie_params( - $params['lifetime'], - $params['path'], - $params['domain'], - $params['secure'], - $params['httponly'] - ); + if (!headers_sent()) { + if (\PHP_VERSION_ID >= 70300) { + session_set_cookie_params([ + 'lifetime' => $params['lifetime'], + 'path' => $params['path'], + 'domain' => $params['domain'], + 'secure' => $params['secure'], + 'httponly' => $params['httponly'], + 'samesite' => $params['samesite'], + ]); + } else { + /* in older versions of PHP we need a nasty hack to set RFC6265bis SameSite attribute */ + if ($params['samesite'] !== null and !preg_match('/;\s+samesite/i', $params['path'])) { + $params['path'] .= '; SameSite='.$params['samesite']; + } + session_set_cookie_params( + $params['lifetime'], + $params['path'], + $params['domain'], + $params['secure'], + $params['httponly'] + ); + } + } $savepath = $config->getString('session.phpsession.savepath', null); if (!empty($savepath)) { @@ -97,39 +108,13 @@ protected function __construct() } - /** - * This method starts a session, making sure no warnings are generated due to headers being already sent. - */ - private function sessionStart() - { - $cacheLimiter = session_cache_limiter(); - if (headers_sent()) { - /* - * session_start() tries to send HTTP headers depending on the configuration, according to the - * documentation: - * - * http://php.net/manual/en/function.session-start.php - * - * If headers have been already sent, it will then trigger an error since no more headers can be sent. - * Being unable to send headers does not mean we cannot recover the session by calling session_start(), - * so we still want to call it. In this case, though, we want to avoid session_start() to send any - * headers at all so that no error is generated, so we clear the cache limiter temporarily (no headers - * sent then) and restore it after successfully starting the session. - */ - session_cache_limiter(''); - } - session_cache_limiter($cacheLimiter); - @session_start(); - } - - /** * Restore a previously-existing session. * * Use this method to restore a previous PHP session existing before SimpleSAMLphp initialized its own session. * * WARNING: do not use this method directly, unless you know what you are doing. Calling this method directly, - * outside of SimpleSAML_Session, could cause SimpleSAMLphp's session to be lost or mess the application's one. The + * outside of \SimpleSAML\Session, could cause SimpleSAMLphp's session to be lost or mess the application's one. The * session must always be saved properly before calling this method. If you don't understand what this is about, * don't use this method. */ @@ -143,16 +128,20 @@ public function restorePrevious() session_write_close(); session_name($this->previous_session['name']); - session_set_cookie_params( - $this->previous_session['cookie_params']['lifetime'], - $this->previous_session['cookie_params']['path'], - $this->previous_session['cookie_params']['domain'], - $this->previous_session['cookie_params']['secure'], - $this->previous_session['cookie_params']['httponly'] - ); + if (\PHP_VERSION_ID >= 70300) { + session_set_cookie_params($this->previous_session['cookie_params']); + } else { + session_set_cookie_params( + $this->previous_session['cookie_params']['lifetime'], + $this->previous_session['cookie_params']['path'], + $this->previous_session['cookie_params']['domain'], + $this->previous_session['cookie_params']['secure'], + $this->previous_session['cookie_params']['httponly'] + ); + } session_id($this->previous_session['id']); - $this->previous_session = array(); - $this->sessionStart(); + $this->previous_session = []; + @session_start(); /* * At this point, we have restored a previously-existing session, so we can't continue to use our session here. @@ -171,23 +160,31 @@ public function restorePrevious() public function newSessionId() { // generate new (secure) session id - $sessionId = bin2hex(openssl_random_pseudo_bytes(16)); - \SimpleSAML_Session::createSession($sessionId); + if (function_exists('session_create_id') && version_compare(phpversion(), '7.3', '<')) { + $sid_length = (int) ini_get('session.sid_length'); + $sid_bits_per_char = (int) ini_get('session.sid_bits_per_character'); + if (($sid_length * $sid_bits_per_char) < 128) { + \SimpleSAML\Logger::warning("Unsafe defaults used for sessionId generation!"); + } + $sessionId = session_create_id(); + } else { + $sessionId = bin2hex(openssl_random_pseudo_bytes(16)); + } + \SimpleSAML\Session::createSession($sessionId); return $sessionId; } - /** * Retrieve the session ID saved in the session cookie, if there's one. * * @return string|null The session id saved in the cookie or null if no session cookie was set. * - * @throws \SimpleSAML_Error_Exception If the cookie is marked as secure but we are not using HTTPS. + * @throws \SimpleSAML\Error\Exception If the cookie is marked as secure but we are not using HTTPS. */ public function getCookieSessionId() { - if (!self::hasSessionCookie()) { + if (!$this->hasSessionCookie()) { return null; // there's no session cookie, can't return ID } @@ -197,10 +194,10 @@ public function getCookieSessionId() $session_cookie_params = session_get_cookie_params(); if ($session_cookie_params['secure'] && !HTTP::isHTTPS()) { - throw new \SimpleSAML_Error_Exception('Session start with secure cookie not allowed on http.'); + throw new \SimpleSAML\Error\Exception('Session start with secure cookie not allowed on http.'); } - $this->sessionStart(); + @session_start(); return session_id(); } @@ -219,9 +216,9 @@ public function getSessionCookieName() /** * Save the current session to the PHP session array. * - * @param \SimpleSAML_Session $session The session object we should save. + * @param \SimpleSAML\Session $session The session object we should save. */ - public function saveSession(\SimpleSAML_Session $session) + public function saveSession(\SimpleSAML\Session $session) { $_SESSION['SimpleSAMLphp_SESSION'] = serialize($session); } @@ -232,30 +229,30 @@ public function saveSession(\SimpleSAML_Session $session) * * @param string|null $sessionId The ID of the session we should load, or null to use the default. * - * @return \SimpleSAML_Session|null The session object, or null if it doesn't exist. + * @return \SimpleSAML\Session|null The session object, or null if it doesn't exist. * - * @throws \SimpleSAML_Error_Exception If it wasn't possible to disable session cookies or we are trying to load a + * @throws \SimpleSAML\Error\Exception If it wasn't possible to disable session cookies or we are trying to load a * PHP session with a specific identifier and it doesn't match with the current session identifier. */ public function loadSession($sessionId = null) { - assert('is_string($sessionId) || is_null($sessionId)'); + assert(is_string($sessionId) || $sessionId === null); if ($sessionId !== null) { if (session_id() === '') { // session not initiated with getCookieSessionId(), start session without setting cookie $ret = ini_set('session.use_cookies', '0'); if ($ret === false) { - throw new \SimpleSAML_Error_Exception('Disabling PHP option session.use_cookies failed.'); + throw new \SimpleSAML\Error\Exception('Disabling PHP option session.use_cookies failed.'); } session_id($sessionId); - $this->sessionStart(); + @session_start(); } elseif ($sessionId !== session_id()) { - throw new \SimpleSAML_Error_Exception('Cannot load PHP session with a specific ID.'); + throw new \SimpleSAML\Error\Exception('Cannot load PHP session with a specific ID.'); } } elseif (session_id() === '') { - self::getCookieSessionId(); + $this->getCookieSessionId(); } if (!isset($_SESSION['SimpleSAMLphp_SESSION'])) { @@ -263,7 +260,7 @@ public function loadSession($sessionId = null) } $session = $_SESSION['SimpleSAMLphp_SESSION']; - assert('is_string($session)'); + assert(is_string($session)); $session = unserialize($session); @@ -292,17 +289,17 @@ public function hasSessionCookie() * @return array The cookie parameters for our sessions. * @link http://www.php.net/manual/en/function.session-get-cookie-params.php * - * @throws \SimpleSAML_Error_Exception If both 'session.phpsession.limitedpath' and 'session.cookie.path' options + * @throws \SimpleSAML\Error\Exception If both 'session.phpsession.limitedpath' and 'session.cookie.path' options * are set at the same time in the configuration. */ public function getCookieParams() { - $config = \SimpleSAML_Configuration::getInstance(); + $config = Configuration::getInstance(); $ret = parent::getCookieParams(); if ($config->hasValue('session.phpsession.limitedpath') && $config->hasValue('session.cookie.path')) { - throw new \SimpleSAML_Error_Exception( + throw new \SimpleSAML\Error\Exception( 'You cannot set both the session.phpsession.limitedpath and session.cookie.path options.' ); } elseif ($config->hasValue('session.phpsession.limitedpath')) { @@ -347,20 +344,24 @@ public function setCookie($sessionName, $sessionID, array $cookieParams = null) ); } - session_set_cookie_params( - $cookieParams['lifetime'], - $cookieParams['path'], - $cookieParams['domain'], - $cookieParams['secure'], - $cookieParams['httponly'] - ); - if (session_id() !== '') { // session already started, close it session_write_close(); } + if (\PHP_VERSION_ID >= 70300) { + session_set_cookie_params($cookieParams); + } else { + session_set_cookie_params( + $cookieParams['lifetime'], + $cookieParams['path'], + $cookieParams['domain'], + $cookieParams['secure'], + $cookieParams['httponly'] + ); + } + session_id($sessionID); - $this->sessionStart(); + @session_start(); } } diff --git a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/SessionHandlerStore.php b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/SessionHandlerStore.php index fc40bf04bc..f40b9eb958 100644 --- a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/SessionHandlerStore.php +++ b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/SessionHandlerStore.php @@ -38,11 +38,11 @@ protected function __construct(Store $store) * * @param string|null $sessionId The ID of the session we should load, or null to use the default. * - * @return \SimpleSAML_Session|null The session object, or null if it doesn't exist. + * @return \SimpleSAML\Session|null The session object, or null if it doesn't exist. */ public function loadSession($sessionId = null) { - assert('is_string($sessionId) || is_null($sessionId)'); + assert(is_string($sessionId) || $sessionId === null); if ($sessionId === null) { $sessionId = $this->getCookieSessionId(); @@ -54,7 +54,7 @@ public function loadSession($sessionId = null) $session = $this->store->get('session', $sessionId); if ($session !== null) { - assert('$session instanceof SimpleSAML_Session'); + assert($session instanceof Session); return $session; } @@ -65,13 +65,13 @@ public function loadSession($sessionId = null) /** * Save a session to the data store. * - * @param \SimpleSAML_Session $session The session object we should save. + * @param \SimpleSAML\Session $session The session object we should save. */ - public function saveSession(\SimpleSAML_Session $session) + public function saveSession(Session $session) { $sessionId = $session->getSessionId(); - $config = \SimpleSAML_Configuration::getInstance(); + $config = Configuration::getInstance(); $sessionDuration = $config->getInteger('session.duration', 8 * 60 * 60); $expire = time() + $sessionDuration; diff --git a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Stats.php b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Stats.php index 6c962f0151..56d07c3022 100644 --- a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Stats.php +++ b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Stats.php @@ -1,5 +1,6 @@ <?php +namespace SimpleSAML; /** * Statistics handler class. @@ -8,9 +9,9 @@ * * @package SimpleSAMLphp */ -class SimpleSAML_Stats -{ +class Stats +{ /** * Whether this class is initialized. * @@ -30,14 +31,14 @@ class SimpleSAML_Stats /** * Create an output from a configuration object. * - * @param SimpleSAML_Configuration $config The configuration object. + * @param \SimpleSAML\Configuration $config The configuration object. * * @return mixed A new instance of the configured class. */ - private static function createOutput(SimpleSAML_Configuration $config) + private static function createOutput(\SimpleSAML\Configuration $config) { $cls = $config->getString('class'); - $cls = SimpleSAML\Module::resolveClass($cls, 'Stats_Output', 'SimpleSAML_Stats_Output'); + $cls = \SimpleSAML\Module::resolveClass($cls, 'Stats\Output', '\SimpleSAML\Stats\Output'); $output = new $cls($config); return $output; @@ -50,10 +51,10 @@ private static function createOutput(SimpleSAML_Configuration $config) private static function initOutputs() { - $config = SimpleSAML_Configuration::getInstance(); - $outputCfgs = $config->getConfigList('statistics.out', array()); + $config = \SimpleSAML\Configuration::getInstance(); + $outputCfgs = $config->getConfigList('statistics.out', []); - self::$outputs = array(); + self::$outputs = []; foreach ($outputCfgs as $cfg) { self::$outputs[] = self::createOutput($cfg); } @@ -68,12 +69,12 @@ private static function initOutputs() * * @return void|boolean False if output is not enabled, void otherwise. */ - public static function log($event, array $data = array()) + public static function log($event, array $data = []) { - assert('is_string($event)'); - assert('!isset($data["op"])'); - assert('!isset($data["time"])'); - assert('!isset($data["_id"])'); + assert(is_string($event)); + assert(!isset($data['op'])); + assert(!isset($data['time'])); + assert(!isset($data['_id'])); if (!self::$initialized) { self::initOutputs(); @@ -97,5 +98,4 @@ public static function log($event, array $data = array()) $out->emit($data); } } - } diff --git a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Stats/Output.php b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Stats/Output.php index 8b019c8c9d..a4a05ed44b 100644 --- a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Stats/Output.php +++ b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Stats/Output.php @@ -1,20 +1,21 @@ <?php +namespace SimpleSAML\Stats; /** * Interface for statistics outputs. * * @package SimpleSAMLphp */ -abstract class SimpleSAML_Stats_Output -{ +abstract class Output +{ /** * Initialize the output. * - * @param SimpleSAML_Configuration $config The configuration for this output. + * @param \SimpleSAML\Configuration $config The configuration for this output. */ - public function __construct(SimpleSAML_Configuration $config) + public function __construct(\SimpleSAML\Configuration $config) { // do nothing by default } diff --git a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Store.php b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Store.php index 8f25b59c91..74e761e494 100644 --- a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Store.php +++ b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Store.php @@ -9,14 +9,14 @@ * * @package SimpleSAMLphp */ -abstract class Store +abstract class Store implements Utils\ClearableState { /** * Our singleton instance. * * This is false if the data store isn't enabled, and null if we haven't attempted to initialize it. * - * @var \SimpleSAML\Store|false|null + * @var \SimpleSAML\Store|bool|null */ private static $instance; @@ -34,11 +34,8 @@ public static function getInstance() return self::$instance; } - $config = \SimpleSAML_Configuration::getInstance(); - $storeType = $config->getString('store.type', null); - if ($storeType === null) { - $storeType = $config->getString('session.handler', 'phpsession'); - } + $config = Configuration::getInstance(); + $storeType = $config->getString('store.type', 'phpsession'); switch ($storeType) { case 'phpsession': @@ -103,4 +100,13 @@ abstract public function set($type, $key, $value, $expire = null); * @param string $key The key. */ abstract public function delete($type, $key); + + + /** + * Clear any SSP specific state, such as SSP environmental variables or cached internals. + */ + public static function clearInternalState() + { + self::$instance = null; + } } diff --git a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Store/Memcache.php b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Store/Memcache.php index b835207826..209ae762f3 100644 --- a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Store/Memcache.php +++ b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Store/Memcache.php @@ -2,7 +2,7 @@ namespace SimpleSAML\Store; -use \SimpleSAML_Configuration as Configuration; +use \SimpleSAML\Configuration; use \SimpleSAML\Store; /** @@ -39,10 +39,10 @@ protected function __construct() */ public function get($type, $key) { - assert('is_string($type)'); - assert('is_string($key)'); + assert(is_string($type)); + assert(is_string($key)); - return \SimpleSAML_Memcache::get($this->prefix . '.' . $type . '.' . $key); + return \SimpleSAML\Memcache::get($this->prefix.'.'.$type.'.'.$key); } @@ -56,15 +56,15 @@ public function get($type, $key) */ public function set($type, $key, $value, $expire = null) { - assert('is_string($type)'); - assert('is_string($key)'); - assert('is_null($expire) || (is_int($expire) && $expire > 2592000)'); + assert(is_string($type)); + assert(is_string($key)); + assert($expire === null || (is_int($expire) && $expire > 2592000)); if ($expire === null) { $expire = 0; } - \SimpleSAML_Memcache::set($this->prefix . '.' . $type . '.' . $key, $value, $expire); + \SimpleSAML\Memcache::set($this->prefix.'.'.$type.'.'.$key, $value, $expire); } @@ -76,9 +76,9 @@ public function set($type, $key, $value, $expire = null) */ public function delete($type, $key) { - assert('is_string($type)'); - assert('is_string($key)'); + assert(is_string($type)); + assert(is_string($key)); - \SimpleSAML_Memcache::delete($this->prefix . '.' . $type . '.' . $key); + \SimpleSAML\Memcache::delete($this->prefix.'.'.$type.'.'.$key); } } diff --git a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Store/Redis.php b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Store/Redis.php index 5f4c0a8238..310caa98f4 100644 --- a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Store/Redis.php +++ b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Store/Redis.php @@ -2,7 +2,7 @@ namespace SimpleSAML\Store; -use \SimpleSAML_Configuration as Configuration; +use \SimpleSAML\Configuration; use \SimpleSAML\Store; /** @@ -12,33 +12,36 @@ */ class Redis extends Store { + public $redis; + /** * Initialize the Redis data store. */ public function __construct($redis = null) { - assert('is_null($redis) || is_subclass_of($redis, "Predis\\Client")'); + assert($redis === null || is_subclass_of($redis, 'Predis\\Client')); if (!class_exists('\Predis\Client')) { throw new \SimpleSAML\Error\CriticalConfigurationError('predis/predis is not available.'); } - if (is_null($redis)) { + if ($redis === null) { $config = Configuration::getInstance(); $host = $config->getString('store.redis.host', 'localhost'); $port = $config->getInteger('store.redis.port', 6379); $prefix = $config->getString('store.redis.prefix', 'SimpleSAMLphp'); + $password = $config->getString('store.redis.password', ''); $redis = new \Predis\Client( - array( + [ 'scheme' => 'tcp', 'host' => $host, 'port' => $port, - ), - array( + ] + (!empty($password) ? ['password' => $password] : []), + [ 'prefix' => $prefix, - ) + ] ); } @@ -65,8 +68,8 @@ public function __destruct() */ public function get($type, $key) { - assert('is_string($type)'); - assert('is_string($key)'); + assert(is_string($type)); + assert(is_string($key)); $result = $this->redis->get("{$type}.{$key}"); @@ -87,16 +90,17 @@ public function get($type, $key) */ public function set($type, $key, $value, $expire = null) { - assert('is_string($type)'); - assert('is_string($key)'); - assert('is_null($expire) || (is_int($expire) && $expire > 2592000)'); + assert(is_string($type)); + assert(is_string($key)); + assert($expire === null || (is_int($expire) && $expire > 2592000)); $serialized = serialize($value); - if (is_null($expire)) { + if ($expire === null) { $this->redis->set("{$type}.{$key}", $serialized); } else { - $this->redis->setex("{$type}.{$key}", $expire, $serialized); + // setex expire time is in seconds (not unix timestamp) + $this->redis->setex("{$type}.{$key}", $expire - time(), $serialized); } } @@ -108,8 +112,8 @@ public function set($type, $key, $value, $expire = null) */ public function delete($type, $key) { - assert('is_string($type)'); - assert('is_string($key)'); + assert(is_string($type)); + assert(is_string($key)); $this->redis->del("{$type}.{$key}"); } diff --git a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Store/SQL.php b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Store/SQL.php index 4152d7afb8..0f623df52e 100644 --- a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Store/SQL.php +++ b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Store/SQL.php @@ -2,7 +2,7 @@ namespace SimpleSAML\Store; -use \SimpleSAML_Configuration as Configuration; +use \SimpleSAML\Configuration; use \SimpleSAML\Logger; use \SimpleSAML\Store; @@ -48,16 +48,20 @@ class SQL extends Store /** * Initialize the SQL data store. */ - protected function __construct() + public function __construct() { $config = Configuration::getInstance(); $dsn = $config->getString('store.sql.dsn'); $username = $config->getString('store.sql.username', null); $password = $config->getString('store.sql.password', null); + $options = $config->getArray('store.sql.options', null); $this->prefix = $config->getString('store.sql.prefix', 'simpleSAMLphp'); - - $this->pdo = new \PDO($dsn, $username, $password); + try { + $this->pdo = new \PDO($dsn, $username, $password, $options); + } catch (\PDOException $e) { + throw new \Exception("Database error: ".$e->getMessage()); + } $this->pdo->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION); $this->driver = $this->pdo->getAttribute(\PDO::ATTR_DRIVER_NAME); @@ -76,7 +80,7 @@ protected function __construct() */ private function initTableVersionTable() { - $this->tableVersions = array(); + $this->tableVersions = []; try { $fetchTableVersion = $this->pdo->query('SELECT _name, _version FROM '.$this->prefix.'_tableVersion'); @@ -99,25 +103,61 @@ private function initTableVersionTable() */ private function initKVTable() { - if ($this->getTableVersion('kvstore') === 1) { - // Table initialized - return; - } + $current_version = $this->getTableVersion('kvstore'); $text_t = 'TEXT'; if ($this->driver === 'mysql') { // TEXT data type has size constraints that can be hit at some point, so we use LONGTEXT instead $text_t = 'LONGTEXT'; } - $query = 'CREATE TABLE '.$this->prefix. - '_kvstore (_type VARCHAR(30) NOT NULL, _key VARCHAR(50) NOT NULL, _value '.$text_t. - ' NOT NULL, _expire TIMESTAMP, PRIMARY KEY (_key, _type))'; - $this->pdo->exec($query); - $query = 'CREATE INDEX '.$this->prefix.'_kvstore_expire ON '.$this->prefix.'_kvstore (_expire)'; - $this->pdo->exec($query); + /** + * Queries for updates, grouped by version. + * New updates can be added as a new array in this array + */ + $table_updates = [ + [ + 'CREATE TABLE '.$this->prefix. + '_kvstore (_type VARCHAR(30) NOT NULL, _key VARCHAR(50) NOT NULL, _value '.$text_t. + ' NOT NULL, _expire TIMESTAMP, PRIMARY KEY (_key, _type))', + 'CREATE INDEX '.$this->prefix.'_kvstore_expire ON '.$this->prefix.'_kvstore (_expire)' + ], + /** + * This upgrade removes the default NOT NULL constraint on the _expire field in MySQL. + * Because SQLite does not support field alterations, the approach is to: + * Create a new table without the NOT NULL constraint + * Copy the current data to the new table + * Drop the old table + * Rename the new table correctly + * Readd the index + */ + [ + 'CREATE TABLE '.$this->prefix. + '_kvstore_new (_type VARCHAR(30) NOT NULL, _key VARCHAR(50) NOT NULL, _value '.$text_t. + ' NOT NULL, _expire TIMESTAMP NULL, PRIMARY KEY (_key, _type))', + 'INSERT INTO '.$this->prefix.'_kvstore_new SELECT * FROM '.$this->prefix.'_kvstore', + 'DROP TABLE '.$this->prefix.'_kvstore', + 'ALTER TABLE '.$this->prefix.'_kvstore_new RENAME TO '.$this->prefix.'_kvstore', + 'CREATE INDEX '.$this->prefix.'_kvstore_expire ON '.$this->prefix.'_kvstore (_expire)' + ] + ]; + + $latest_version = count($table_updates); + + if ($current_version == $latest_version) { + return; + } + + // Only run queries for after the current version + $updates_to_run = array_slice($table_updates, $current_version); + + foreach ($updates_to_run as $version_updates) { + foreach ($version_updates as $query) { + $this->pdo->exec($query); + } + } - $this->setTableVersion('kvstore', 1); + $this->setTableVersion('kvstore', $latest_version); } @@ -130,7 +170,7 @@ private function initKVTable() */ public function getTableVersion($name) { - assert('is_string($name)'); + assert(is_string($name)); if (!isset($this->tableVersions[$name])) { return 0; @@ -148,13 +188,13 @@ public function getTableVersion($name) */ public function setTableVersion($name, $version) { - assert('is_string($name)'); - assert('is_int($version)'); + assert(is_string($name)); + assert(is_int($version)); $this->insertOrUpdate( $this->prefix.'_tableVersion', - array('_name'), - array('_name' => $name, '_version' => $version) + ['_name'], + ['_name' => $name, '_version' => $version] ); $this->tableVersions[$name] = $version; } @@ -171,7 +211,7 @@ public function setTableVersion($name, $version) */ public function insertOrUpdate($table, array $keys, array $data) { - assert('is_string($table)'); + assert(is_string($table)); $colNames = '('.implode(', ', array_keys($data)).')'; $values = 'VALUES(:'.implode(', :', array_keys($data)).')'; @@ -198,6 +238,8 @@ public function insertOrUpdate($table, array $keys, array $data) } catch (\PDOException $e) { $ecode = (string) $e->getCode(); switch ($ecode) { + case '23000': // MSSQL + break; case '23505': // PostgreSQL break; default: @@ -206,8 +248,8 @@ public function insertOrUpdate($table, array $keys, array $data) } } - $updateCols = array(); - $condCols = array(); + $updateCols = []; + $condCols = []; foreach ($data as $col => $value) { $tmp = $col.' = :'.$col; @@ -232,7 +274,7 @@ private function cleanKVStore() Logger::debug('store.sql: Cleaning key-value store.'); $query = 'DELETE FROM '.$this->prefix.'_kvstore WHERE _expire < :now'; - $params = array('now' => gmdate('Y-m-d H:i:s')); + $params = ['now' => gmdate('Y-m-d H:i:s')]; $query = $this->pdo->prepare($query); $query->execute($params); @@ -249,16 +291,16 @@ private function cleanKVStore() */ public function get($type, $key) { - assert('is_string($type)'); - assert('is_string($key)'); + assert(is_string($type)); + assert(is_string($key)); if (strlen($key) > 50) { $key = sha1($key); } $query = 'SELECT _value FROM '.$this->prefix. - '_kvstore WHERE _type = :type AND _key = :key AND (_expire IS NULL OR _expire > :now)'; - $params = array('type' => $type, 'key' => $key, 'now' => gmdate('Y-m-d H:i:s')); + '_kvstore WHERE _type = :type AND _key = :key AND (_expire IS NULL OR _expire > :now)'; + $params = ['type' => $type, 'key' => $key, 'now' => gmdate('Y-m-d H:i:s')]; $query = $this->pdo->prepare($query); $query->execute($params); @@ -292,9 +334,9 @@ public function get($type, $key) */ public function set($type, $key, $value, $expire = null) { - assert('is_string($type)'); - assert('is_string($key)'); - assert('is_null($expire) || (is_int($expire) && $expire > 2592000)'); + assert(is_string($type)); + assert(is_string($key)); + assert($expire === null || (is_int($expire) && $expire > 2592000)); if (rand(0, 1000) < 10) { $this->cleanKVStore(); @@ -311,14 +353,14 @@ public function set($type, $key, $value, $expire = null) $value = serialize($value); $value = rawurlencode($value); - $data = array( + $data = [ '_type' => $type, '_key' => $key, '_value' => $value, '_expire' => $expire, - ); + ]; - $this->insertOrUpdate($this->prefix.'_kvstore', array('_type', '_key'), $data); + $this->insertOrUpdate($this->prefix.'_kvstore', ['_type', '_key'], $data); } @@ -330,17 +372,17 @@ public function set($type, $key, $value, $expire = null) */ public function delete($type, $key) { - assert('is_string($type)'); - assert('is_string($key)'); + assert(is_string($type)); + assert(is_string($key)); if (strlen($key) > 50) { $key = sha1($key); } - $data = array( + $data = [ '_type' => $type, '_key' => $key, - ); + ]; $query = 'DELETE FROM '.$this->prefix.'_kvstore WHERE _type=:_type AND _key=:_key'; $query = $this->pdo->prepare($query); diff --git a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Utilities.php b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Utilities.php index 46be6ca60e..c6e04223e9 100644 --- a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Utilities.php +++ b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Utilities.php @@ -1,5 +1,6 @@ <?php +namespace SimpleSAML; /** * Misc static functions that is used several places.in example parsing and id generation. @@ -9,9 +10,9 @@ * * @deprecated This entire class will be removed in SimpleSAMLphp 2.0. */ -class SimpleSAML_Utilities -{ +class Utilities +{ /** * @deprecated This property will be removed in SSP 2.0. Please use SimpleSAML\Logger::isErrorMasked() instead. */ @@ -112,11 +113,11 @@ public static function checkURLAllowed($url, array $trustedSites = null) /** - * @deprecated This method will be removed in SSP 2.0. Please use SimpleSAML_Auth_State::parseStateID() instead. + * @deprecated This method will be removed in SSP 2.0. Please use \SimpleSAML\Auth\State::parseStateID() instead. */ public static function parseStateID($stateId) { - return SimpleSAML_Auth_State::parseStateID($stateId); + return \SimpleSAML\Auth\State::parseStateID($stateId); } @@ -149,7 +150,7 @@ public static function checkDateConditions($start = null, $end = null) */ public static function generateID() { - return SimpleSAML\Utils\Random::generateID(); + return \SimpleSAML\Utils\Random::generateID(); } @@ -159,7 +160,7 @@ public static function generateID() */ public static function generateTimestamp($instant = null) { - return SimpleSAML\Utils\Time::generateTimestamp($instant); + return \SimpleSAML\Utils\Time::generateTimestamp($instant); } @@ -168,16 +169,16 @@ public static function generateTimestamp($instant = null) */ public static function parseDuration($duration, $timestamp = null) { - return SimpleSAML\Utils\Time::parseDuration($duration, $timestamp); + return \SimpleSAML\Utils\Time::parseDuration($duration, $timestamp); } /** - * @deprecated This method will be removed in SSP 2.0. Please raise a SimpleSAML_Error_Error exception instead. + * @deprecated This method will be removed in SSP 2.0. Please raise a SimpleSAML\Error\Error exception instead. */ - public static function fatalError($trackId = 'na', $errorCode = null, Exception $e = null) + public static function fatalError($trackId = 'na', $errorCode = null, \Exception $e = null) { - throw new SimpleSAML_Error_Error($errorCode, $e); + throw new \SimpleSAML\Error\Error($errorCode, $e); } @@ -186,15 +187,15 @@ public static function fatalError($trackId = 'na', $errorCode = null, Exception */ public static function ipCIDRcheck($cidr, $ip = null) { - return SimpleSAML\Utils\Net::ipCIDRcheck($cidr, $ip); + return \SimpleSAML\Utils\Net::ipCIDRcheck($cidr, $ip); } - private static function _doRedirect($url, $parameters = array()) + private static function doRedirect($url, $parameters = []) { - assert('is_string($url)'); - assert('!empty($url)'); - assert('is_array($parameters)'); + assert(is_string($url)); + assert(!empty($url)); + assert(is_array($parameters)); if (!empty($parameters)) { $url = self::addURLparameter($url, $parameters); @@ -213,7 +214,7 @@ private static function _doRedirect($url, $parameters = array()) } if (strlen($url) > 2048) { - SimpleSAML\Logger::warning('Redirecting to a URL longer than 2048 bytes.'); + \SimpleSAML\Logger::warning('Redirecting to a URL longer than 2048 bytes.'); } // Set the location header @@ -252,18 +253,18 @@ private static function _doRedirect($url, $parameters = array()) * @deprecated 1.12.0 This method will be removed from the API. Instead, use the redirectTrustedURL() or * redirectUntrustedURL() functions accordingly. */ - public static function redirect($url, $parameters = array(), $allowed_redirect_hosts = null) + public static function redirect($url, $parameters = [], $allowed_redirect_hosts = null) { - assert('is_string($url)'); - assert('strlen($url) > 0'); - assert('is_array($parameters)'); + assert(is_string($url)); + assert(strlen($url) > 0); + assert(is_array($parameters)); if ($allowed_redirect_hosts !== null) { $url = self::checkURLAllowed($url, $allowed_redirect_hosts); } else { $url = self::normalizeURL($url); } - self::_doRedirect($url, $parameters); + self::doRedirect($url, $parameters); } @@ -271,7 +272,7 @@ public static function redirect($url, $parameters = array(), $allowed_redirect_h * @deprecated This method will be removed in SSP 2.0. Please use SimpleSAML\Utils\HTTP::redirectTrustedURL() * instead. */ - public static function redirectTrustedURL($url, $parameters = array()) + public static function redirectTrustedURL($url, $parameters = []) { \SimpleSAML\Utils\HTTP::redirectTrustedURL($url, $parameters); } @@ -281,7 +282,7 @@ public static function redirectTrustedURL($url, $parameters = array()) * @deprecated This method will be removed in SSP 2.0. Please use SimpleSAML\Utils\HTTP::redirectUntrustedURL() * instead. */ - public static function redirectUntrustedURL($url, $parameters = array()) + public static function redirectUntrustedURL($url, $parameters = []) { \SimpleSAML\Utils\HTTP::redirectUntrustedURL($url, $parameters); } @@ -292,7 +293,7 @@ public static function redirectUntrustedURL($url, $parameters = array()) */ public static function transposeArray($in) { - return SimpleSAML\Utils\Arrays::transpose($in); + return \SimpleSAML\Utils\Arrays::transpose($in); } @@ -300,18 +301,18 @@ public static function transposeArray($in) * @deprecated This method will be removed in SSP 2.0. Please use SimpleSAML\Utils\XML::isDOMNodeOfType() * instead. */ - public static function isDOMElementOfType(DOMNode $element, $name, $nsURI) + public static function isDOMElementOfType(\DOMNode $element, $name, $nsURI) { - return SimpleSAML\Utils\XML::isDOMNodeOfType($element, $name, $nsURI); + return \SimpleSAML\Utils\XML::isDOMNodeOfType($element, $name, $nsURI); } /** * @deprecated This method will be removed in SSP 2.0. Please use SimpleSAML\Utils\XML::getDOMChildren() instead. */ - public static function getDOMChildren(DOMElement $element, $localName, $namespaceURI) + public static function getDOMChildren(\DOMElement $element, $localName, $namespaceURI) { - return SimpleSAML\Utils\XML::getDOMChildren($element, $localName, $namespaceURI); + return \SimpleSAML\Utils\XML::getDOMChildren($element, $localName, $namespaceURI); } @@ -320,7 +321,7 @@ public static function getDOMChildren(DOMElement $element, $localName, $namespac */ public static function getDOMText($element) { - return SimpleSAML\Utils\XML::getDOMText($element); + return \SimpleSAML\Utils\XML::getDOMText($element); } @@ -358,7 +359,7 @@ public static function validateXMLDocument($message, $type) */ public static function generateRandomBytes($length) { - assert('is_int($length)'); + assert(is_int($length)); return openssl_random_pseudo_bytes($length); } @@ -419,7 +420,7 @@ public static function parseQueryString($query_string) */ public static function parseAttributes($attributes) { - return SimpleSAML\Utils\Attributes::normalizeAttributesArray($attributes); + return \SimpleSAML\Utils\Attributes::normalizeAttributesArray($attributes); } @@ -428,7 +429,7 @@ public static function parseAttributes($attributes) */ public static function getSecretSalt() { - return SimpleSAML\Utils\Config::getSecretSalt(); + return \SimpleSAML\Utils\Config::getSecretSalt(); } @@ -463,27 +464,27 @@ public static function resolveCert($path) /** * @deprecated This method will be removed in SSP 2.0. Please use SimpleSAML\Utils\Crypto::loadPublicKey() instead. */ - public static function loadPublicKey(SimpleSAML_Configuration $metadata, $required = false, $prefix = '') + public static function loadPublicKey(\SimpleSAML\Configuration $metadata, $required = false, $prefix = '') { - return SimpleSAML\Utils\Crypto::loadPublicKey($metadata, $required, $prefix); + return \SimpleSAML\Utils\Crypto::loadPublicKey($metadata, $required, $prefix); } /** * @deprecated This method will be removed in SSP 2.0. Please use SimpleSAML\Utils\Crypto::loadPrivateKey() instead. */ - public static function loadPrivateKey(SimpleSAML_Configuration $metadata, $required = false, $prefix = '') + public static function loadPrivateKey(\SimpleSAML\Configuration $metadata, $required = false, $prefix = '') { - return SimpleSAML\Utils\Crypto::loadPrivateKey($metadata, $required, $prefix); + return \SimpleSAML\Utils\Crypto::loadPrivateKey($metadata, $required, $prefix); } /** * @deprecated This method will be removed in SSP 2.0. Please use SimpleSAML\Utils\XML::formatDOMElement() instead. */ - public static function formatDOMElement(DOMElement $root, $indentBase = '') + public static function formatDOMElement(\DOMElement $root, $indentBase = '') { - SimpleSAML\Utils\XML::formatDOMElement($root, $indentBase); + \SimpleSAML\Utils\XML::formatDOMElement($root, $indentBase); } @@ -492,7 +493,7 @@ public static function formatDOMElement(DOMElement $root, $indentBase = '') */ public static function formatXMLString($xml, $indentBase = '') { - return SimpleSAML\Utils\XML::formatXMLString($xml, $indentBase); + return \SimpleSAML\Utils\XML::formatXMLString($xml, $indentBase); } @@ -501,7 +502,7 @@ public static function formatXMLString($xml, $indentBase = '') */ public static function arrayize($data, $index = 0) { - return SimpleSAML\Utils\Arrays::arrayize($data, $index); + return \SimpleSAML\Utils\Arrays::arrayize($data, $index); } @@ -510,7 +511,7 @@ public static function arrayize($data, $index = 0) */ public static function isAdmin() { - return SimpleSAML\Utils\Auth::isAdmin(); + return \SimpleSAML\Utils\Auth::isAdmin(); } @@ -519,7 +520,7 @@ public static function isAdmin() */ public static function getAdminLoginURL($returnTo = null) { - return SimpleSAML\Utils\Auth::getAdminLoginURL($returnTo); + return \SimpleSAML\Utils\Auth::getAdminLoginURL($returnTo); } @@ -557,21 +558,21 @@ public static function createPostRedirectLink($destination, $post) */ public static function createHttpPostRedirectLink($destination, $post) { - assert('is_string($destination)'); - assert('is_array($post)'); + assert(is_string($destination)); + assert(is_array($post)); - $postId = SimpleSAML\Utils\Random::generateID(); - $postData = array( + $postId = \SimpleSAML\Utils\Random::generateID(); + $postData = [ 'post' => $post, 'url' => $destination, - ); + ]; - $session = SimpleSAML_Session::getSessionFromRequest(); + $session = \SimpleSAML\Session::getSessionFromRequest(); $session->setData('core_postdatalink', $postId, $postData); - $redirInfo = base64_encode(SimpleSAML\Utils\Crypto::aesEncrypt($session->getSessionId().':'.$postId)); + $redirInfo = base64_encode(\SimpleSAML\Utils\Crypto::aesEncrypt($session->getSessionId().':'.$postId)); - $url = SimpleSAML\Module::getModuleURL('core/postredirect.php', array('RedirInfo' => $redirInfo)); + $url = \SimpleSAML\Module::getModuleURL('core/postredirect.php', ['RedirInfo' => $redirInfo]); $url = preg_replace("#^https:#", "http:", $url); return $url; @@ -610,7 +611,7 @@ public static function writeFile($filename, $data, $mode = 0600) */ public static function getTempDir() { - return SimpleSAML\Utils\System::getTempDir(); + return \SimpleSAML\Utils\System::getTempDir(); } @@ -619,7 +620,7 @@ public static function getTempDir() */ public static function maskErrors($mask) { - SimpleSAML\Logger::maskErrors($mask); + \SimpleSAML\Logger::maskErrors($mask); } @@ -628,7 +629,7 @@ public static function maskErrors($mask) */ public static function popErrorMask() { - SimpleSAML\Logger::popErrorMask(); + \SimpleSAML\Logger::popErrorMask(); } @@ -664,7 +665,7 @@ public static function debugMessage($message, $type) /** * @deprecated This method will be removed in SSP 2.0. Please use SimpleSAML\Utils\HTTP::fetch() instead. */ - public static function fetch($path, $context = array(), $getHeaders = false) + public static function fetch($path, $context = [], $getHeaders = false) { return \SimpleSAML\Utils\HTTP::fetch($path, $context, $getHeaders); } @@ -675,7 +676,7 @@ public static function fetch($path, $context = array(), $getHeaders = false) */ public static function aesEncrypt($clear) { - return SimpleSAML\Utils\Crypto::aesEncrypt($clear); + return \SimpleSAML\Utils\Crypto::aesEncrypt($clear); } @@ -684,7 +685,7 @@ public static function aesEncrypt($clear) */ public static function aesDecrypt($encData) { - return SimpleSAML\Utils\Crypto::aesDecrypt($encData); + return \SimpleSAML\Utils\Crypto::aesDecrypt($encData); } @@ -693,7 +694,7 @@ public static function aesDecrypt($encData) */ public static function isWindowsOS() { - return SimpleSAML\Utils\System::getOS() === SimpleSAML\Utils\System::WINDOWS; + return \SimpleSAML\Utils\System::getOS() === \SimpleSAML\Utils\System::WINDOWS; } diff --git a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Utils/Arrays.php b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Utils/Arrays.php index b7af49d018..c27b198eb0 100644 --- a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Utils/Arrays.php +++ b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Utils/Arrays.php @@ -12,7 +12,7 @@ class Arrays /** * Put a non-array variable into an array. * - * @param array $data The data to place into an array. + * @param mixed $data The data to place into an array. * @param mixed $index The index or key of the array where to place the data. Defaults to 0. * * @return array An array with one element containing $data, with key $index, or $data itself if it's already an @@ -23,7 +23,7 @@ class Arrays */ public static function arrayize($data, $index = 0) { - return (is_array($data)) ? $data : array($index => $data); + return (is_array($data)) ? $data : [$index => $data]; } @@ -42,7 +42,7 @@ public static function transpose($array) return false; } - $ret = array(); + $ret = []; foreach ($array as $k1 => $a2) { if (!is_array($a2)) { return false; @@ -50,7 +50,7 @@ public static function transpose($array) foreach ($a2 as $k2 => $v) { if (!array_key_exists($k2, $ret)) { - $ret[$k2] = array(); + $ret[$k2] = []; } $ret[$k2][$k1] = $v; } diff --git a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Utils/Attributes.php b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Utils/Attributes.php index 00e934f5e1..88c87f1aa2 100644 --- a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Utils/Attributes.php +++ b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Utils/Attributes.php @@ -1,4 +1,5 @@ <?php + namespace SimpleSAML\Utils; /** @@ -7,9 +8,9 @@ * @author Jaime Perez, UNINETT AS <jaime.perez@uninett.no> * @package SimpleSAML */ + class Attributes { - /** * Look for an attribute in a normalized attributes array, failing if it's not there. * @@ -21,7 +22,7 @@ class Attributes * $allow_multiple is set to true, the first value will be returned. * * @throws \InvalidArgumentException If $attributes is not an array or $expected is not a string. - * @throws \SimpleSAML_Error_Exception If the expected attribute was not found in the attributes array. + * @throws \SimpleSAML\Error\Exception If the expected attribute was not found in the attributes array. */ public static function getExpectedAttribute($attributes, $expected, $allow_multiple = false) { @@ -38,7 +39,7 @@ public static function getExpectedAttribute($attributes, $expected, $allow_multi } if (!array_key_exists($expected, $attributes)) { - throw new \SimpleSAML_Error_Exception("No such attribute '".$expected."' found."); + throw new \SimpleSAML\Error\Exception("No such attribute '".$expected."' found."); } $attribute = $attributes[$expected]; @@ -47,11 +48,10 @@ public static function getExpectedAttribute($attributes, $expected, $allow_multi } if (count($attribute) === 0) { - throw new \SimpleSAML_Error_Exception("Empty attribute '".$expected."'.'"); - + throw new \SimpleSAML\Error\Exception("Empty attribute '".$expected."'.'"); } elseif (count($attribute) > 1) { if ($allow_multiple === false) { - throw new \SimpleSAML_Error_Exception( + throw new \SimpleSAML\Error\Exception( 'More than one value found for the attribute, multiple values not allowed.' ); } @@ -85,7 +85,7 @@ public static function normalizeAttributesArray($attributes) ); } - $newAttrs = array(); + $newAttrs = []; foreach ($attributes as $name => $values) { if (!is_string($name)) { throw new \InvalidArgumentException('Invalid attribute name: "'.print_r($name, true).'".'); @@ -127,6 +127,6 @@ public static function getAttributeNamespace($name, $defaultns) $defaultns = substr($name, 0, $slash); $name = substr($name, $slash + 1); } - return array(htmlspecialchars($defaultns), htmlspecialchars($name)); + return [htmlspecialchars($defaultns), htmlspecialchars($name)]; } } diff --git a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Utils/Auth.php b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Utils/Auth.php index 5360f74da0..7cff78b27c 100644 --- a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Utils/Auth.php +++ b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Utils/Auth.php @@ -10,7 +10,6 @@ */ class Auth { - /** * Retrieve a admin login URL. * @@ -29,9 +28,29 @@ public static function getAdminLoginURL($returnTo = null) $returnTo = HTTP::getSelfURL(); } - return Module::getModuleURL('core/login-admin.php', array('ReturnTo' => $returnTo)); + return Module::getModuleURL('core/login-admin.php', ['ReturnTo' => $returnTo]); + } + + + /** + * Retrieve a admin logout URL. + * + * @param string|NULL $returnTo The URL the user should arrive on after admin authentication. Defaults to null. + * + * @return string A URL which can be used for logging out. + * @throws \InvalidArgumentException If $returnTo is neither a string nor null. + */ + public static function getAdminLogoutURL($returnTo = null) + { + if (!(is_string($returnTo) || is_null($returnTo))) { + throw new \InvalidArgumentException('Invalid input parameters.'); + } + + $as = new \SimpleSAML\Auth\Simple('admin'); + return $as->getLogoutURL($returnTo = null); } + /** * Check whether the current user is admin. * @@ -41,7 +60,7 @@ public static function getAdminLoginURL($returnTo = null) */ public static function isAdmin() { - $session = \SimpleSAML_Session::getSessionFromRequest(); + $session = \SimpleSAML\Session::getSessionFromRequest(); return $session->isValid('admin') || $session->isValid('login-admin'); } @@ -52,7 +71,7 @@ public static function isAdmin() * a login page if the current user doesn't have admin access. * * @return void This function will only return if the user is admin. - * @throws \SimpleSAML_Error_Exception If no "admin" authentication source was configured. + * @throws \SimpleSAML\Error\Exception If no "admin" authentication source was configured. * * @author Olav Morken, UNINETT AS <olav.morken@uninett.no> * @author Jaime Perez, UNINETT AS <jaime.perez@uninett.no> @@ -64,13 +83,13 @@ public static function requireAdmin() } // not authenticated as admin user, start authentication - if (\SimpleSAML_Auth_Source::getById('admin') !== null) { + if (\SimpleSAML\Auth\Source::getById('admin') !== null) { $as = new \SimpleSAML\Auth\Simple('admin'); $as->login(); } else { - throw new \SimpleSAML_Error_Exception( + throw new \SimpleSAML\Error\Exception( 'Cannot find "admin" auth source, and admin privileges are required.' ); } } -} \ No newline at end of file +} diff --git a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Utils/Config.php b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Utils/Config.php index fa044516bd..5f25f8a0de 100644 --- a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Utils/Config.php +++ b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Utils/Config.php @@ -8,7 +8,6 @@ */ class Config { - /** * Resolves a path that may be relative to the cert-directory. * @@ -25,7 +24,7 @@ public static function getCertPath($path) throw new \InvalidArgumentException('Invalid input parameters.'); } - $globalConfig = \SimpleSAML_Configuration::getInstance(); + $globalConfig = \SimpleSAML\Configuration::getInstance(); $base = $globalConfig->getPathValue('certdir', 'cert/'); return System::resolvePath($path, $base); } @@ -48,7 +47,7 @@ public static function getCertPath($path) */ public static function getSecretSalt() { - $secretSalt = \SimpleSAML_Configuration::getInstance()->getString('secretsalt'); + $secretSalt = \SimpleSAML\Configuration::getInstance()->getString('secretsalt'); if ($secretSalt === 'defaultsecretsalt') { throw new \InvalidArgumentException('The "secretsalt" configuration option must be set to a secret value.'); } @@ -66,14 +65,19 @@ public static function getSecretSalt() */ public static function getConfigDir() { - $configDir = dirname(dirname(dirname(__DIR__))) . '/config'; + $configDir = dirname(dirname(dirname(__DIR__))).'/config'; /** @var string|false $configDirEnv */ $configDirEnv = getenv('SIMPLESAMLPHP_CONFIG_DIR'); + + if ($configDirEnv === false) { + $configDirEnv = getenv('REDIRECT_SIMPLESAMLPHP_CONFIG_DIR'); + } + if ($configDirEnv !== false) { if (!is_dir($configDirEnv)) { throw new \InvalidArgumentException( sprintf( - 'Config directory specified by environment variable SIMPLESAMLPHP_CONFIG_DIR is not a ' . + 'Config directory specified by environment variable SIMPLESAMLPHP_CONFIG_DIR is not a '. 'directory. Given: "%s"', $configDirEnv ) diff --git a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Utils/Config/Metadata.php b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Utils/Config/Metadata.php index caf7b4a877..7c66f290cd 100644 --- a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Utils/Config/Metadata.php +++ b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Utils/Config/Metadata.php @@ -9,7 +9,6 @@ */ class Metadata { - /** * The string that identities Entity Categories. * @@ -36,7 +35,7 @@ class Metadata * @var array The valid configuration options for a contact configuration array. * @see "Metadata for the OASIS Security Assertion Markup Language (SAML) V2.0", section 2.3.2.2. */ - public static $VALID_CONTACT_OPTIONS = array( + public static $VALID_CONTACT_OPTIONS = [ 'contactType', 'emailAddress', 'givenName', @@ -44,20 +43,20 @@ class Metadata 'telephoneNumber', 'company', 'attributes', - ); + ]; /** * @var array The valid types of contact for a contact configuration array. * @see "Metadata for the OASIS Security Assertion Markup Language (SAML) V2.0", section 2.3.2.2. */ - public static $VALID_CONTACT_TYPES = array( + public static $VALID_CONTACT_TYPES = [ 'technical', 'support', 'administrative', 'billing', 'other', - ); + ]; /** @@ -117,8 +116,8 @@ function ($t) { // check attributes is an associative array if (isset($contact['attributes'])) { - if (empty($contact['attributes']) - || !is_array($contact['attributes']) + if (empty($contact['attributes']) + || !is_array($contact['attributes']) || count(array_filter(array_keys($contact['attributes']), 'is_string')) === 0 ) { throw new \InvalidArgumentException('"attributes" must be an array and cannot be empty.'); @@ -230,7 +229,7 @@ public static function getDefaultEndpoint(array $endpoints, array $bindings = nu continue; } - if (array_key_exists('isDefault', $ep)) { + if (isset($ep['isDefault'])) { if ($ep['isDefault'] === true) { // this is the first endpoint with isDefault set to true return $ep; @@ -279,4 +278,38 @@ public static function isHiddenFromDiscovery(array $metadata) \SimpleSAML\Logger::popErrorMask(); return $hidden === true; } + + + /** + * This method parses the different possible values of the NameIDPolicy metadata configuration. + * + * @param mixed $nameIdPolicy + * + * @return null|array + */ + public static function parseNameIdPolicy($nameIdPolicy) + { + $policy = null; + + if (is_string($nameIdPolicy)) { + // handle old configurations where 'NameIDPolicy' was used to specify just the format + $policy = ['Format' => $nameIdPolicy]; + } elseif (is_array($nameIdPolicy)) { + // handle current configurations specifying an array in the NameIDPolicy config option + $nameIdPolicy_cf = \SimpleSAML\Configuration::loadFromArray($nameIdPolicy); + $policy = [ + 'Format' => $nameIdPolicy_cf->getString('Format', \SAML2\Constants::NAMEID_TRANSIENT), + 'AllowCreate' => $nameIdPolicy_cf->getBoolean('AllowCreate', true), + ]; + $spNameQualifier = $nameIdPolicy_cf->getString('SPNameQualifier', false); + if ($spNameQualifier !== false) { + $policy['SPNameQualifier'] = $spNameQualifier; + } + } elseif ($nameIdPolicy === null) { + // when NameIDPolicy is unset or set to null, default to transient as before + $policy = ['Format' => \SAML2\Constants::NAMEID_TRANSIENT]; + } + + return $policy; + } } diff --git a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Utils/Crypto.php b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Utils/Crypto.php index 61c7b52695..9c22461d96 100644 --- a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Utils/Crypto.php +++ b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Utils/Crypto.php @@ -2,14 +2,17 @@ namespace SimpleSAML\Utils; +use SimpleSAML\Configuration; +use SimpleSAML\Error; + /** * A class for cryptography-related functions. * * @package SimpleSAMLphp */ + class Crypto { - /** * Decrypt data using AES-256-CBC and the key provided as a parameter. * @@ -18,7 +21,7 @@ class Crypto * * @return string The decrypted data. * @throws \InvalidArgumentException If $ciphertext is not a string. - * @throws \SimpleSAML_Error_Exception If the openssl module is not loaded. + * @throws Error\Exception If the openssl module is not loaded. * * @see \SimpleSAML\Utils\Crypto::aesDecrypt() */ @@ -37,7 +40,7 @@ private static function _aesDecrypt($ciphertext, $secret) ); } if (!function_exists("openssl_decrypt")) { - throw new \SimpleSAML_Error_Exception("The openssl PHP module is not loaded."); + throw new Error\Exception("The openssl PHP module is not loaded."); } // derive encryption and authentication keys from the secret @@ -57,12 +60,12 @@ private static function _aesDecrypt($ciphertext, $secret) $iv ); - if ($plaintext != false) { + if ($plaintext !== false) { return $plaintext; } } - throw new \SimpleSAML_Error_Exception("Failed to decrypt ciphertext."); + throw new Error\Exception("Failed to decrypt ciphertext."); } @@ -73,7 +76,7 @@ private static function _aesDecrypt($ciphertext, $secret) * * @return string The decrypted data. * @throws \InvalidArgumentException If $ciphertext is not a string. - * @throws \SimpleSAML_Error_Exception If the openssl module is not loaded. + * @throws Error\Exception If the openssl module is not loaded. * * @author Andreas Solberg, UNINETT AS <andreas.solberg@uninett.no> * @author Jaime Perez, UNINETT AS <jaime.perez@uninett.no> @@ -92,7 +95,7 @@ public static function aesDecrypt($ciphertext) * * @return string An HMAC of the encrypted data, the IV and the encrypted data, concatenated. * @throws \InvalidArgumentException If $data is not a string. - * @throws \SimpleSAML_Error_Exception If the openssl module is not loaded. + * @throws Error\Exception If the openssl module is not loaded. * * @see \SimpleSAML\Utils\Crypto::aesEncrypt() */ @@ -103,7 +106,7 @@ private static function _aesEncrypt($data, $secret) } if (!function_exists("openssl_encrypt")) { - throw new \SimpleSAML_Error_Exception('The openssl PHP module is not loaded.'); + throw new Error\Exception('The openssl PHP module is not loaded.'); } // derive encryption and authentication keys from the secret @@ -123,7 +126,7 @@ private static function _aesEncrypt($data, $secret) ); if ($ciphertext === false) { - throw new \SimpleSAML_Error_Exception("Failed to encrypt plaintext."); + throw new Error\Exception("Failed to encrypt plaintext."); } // return the ciphertext with proper authentication @@ -138,7 +141,7 @@ private static function _aesEncrypt($data, $secret) * * @return string An HMAC of the encrypted data, the IV and the encrypted data, concatenated. * @throws \InvalidArgumentException If $data is not a string. - * @throws \SimpleSAML_Error_Exception If the openssl module is not loaded. + * @throws Error\Exception If the openssl module is not loaded. * * @author Andreas Solberg, UNINETT AS <andreas.solberg@uninett.no> * @author Jaime Perez, UNINETT AS <jaime.perez@uninett.no> @@ -160,8 +163,8 @@ public static function aesEncrypt($data) public static function der2pem($der, $type = 'CERTIFICATE') { return "-----BEGIN ".$type."-----\n". - chunk_split(base64_encode($der), 64, "\n"). - "-----END ".$type."-----\n"; + chunk_split(base64_encode($der), 64, "\n"). + "-----END ".$type."-----\n"; } @@ -176,7 +179,7 @@ public static function der2pem($der, $type = 'CERTIFICATE') * - 'PEM': Data for the private key, in PEM-format. * - 'password': Password for the private key. * - * @param \SimpleSAML_Configuration $metadata The metadata array the private key should be loaded from. + * @param \SimpleSAML\Configuration $metadata The metadata array the private key should be loaded from. * @param bool $required Whether the private key is required. If this is true, a * missing key will cause an exception. Defaults to false. * @param string $prefix The prefix which should be used when reading from the metadata @@ -186,13 +189,13 @@ public static function der2pem($der, $type = 'CERTIFICATE') * * @return array|NULL Extracted private key, or NULL if no private key is present. * @throws \InvalidArgumentException If $required is not boolean or $prefix is not a string. - * @throws \SimpleSAML_Error_Exception If no private key is found in the metadata, or it was not possible to load + * @throws Error\Exception If no private key is found in the metadata, or it was not possible to load * it. * * @author Andreas Solberg, UNINETT AS <andreas.solberg@uninett.no> * @author Olav Morken, UNINETT AS <olav.morken@uninett.no> */ - public static function loadPrivateKey(\SimpleSAML_Configuration $metadata, $required = false, $prefix = '', $full_path = false) + public static function loadPrivateKey(Configuration $metadata, $required = false, $prefix = '', $full_path = false) { if (!is_bool($required) || !is_string($prefix) || !is_bool($full_path)) { throw new \InvalidArgumentException('Invalid input parameters.'); @@ -202,7 +205,7 @@ public static function loadPrivateKey(\SimpleSAML_Configuration $metadata, $requ if ($file === null) { // no private key found if ($required) { - throw new \SimpleSAML_Error_Exception('No private key found in metadata.'); + throw new Error\Exception('No private key found in metadata.'); } else { return null; } @@ -214,12 +217,12 @@ public static function loadPrivateKey(\SimpleSAML_Configuration $metadata, $requ $data = @file_get_contents($file); if ($data === false) { - throw new \SimpleSAML_Error_Exception('Unable to load private key from file "'.$file.'"'); + throw new Error\Exception('Unable to load private key from file "'.$file.'"'); } - $ret = array( + $ret = [ 'PEM' => $data, - ); + ]; if ($metadata->hasValue($prefix.'privatekey_pass')) { $ret['password'] = $metadata->getString($prefix.'privatekey_pass'); @@ -246,30 +249,30 @@ public static function loadPrivateKey(\SimpleSAML_Configuration $metadata, $requ * - 'certFingerprint': Array of valid certificate fingerprints. (Deprecated. Only present if this is a * certificate.) * - * @param \SimpleSAML_Configuration $metadata The metadata. + * @param \SimpleSAML\Configuration $metadata The metadata. * @param bool $required Whether the private key is required. If this is TRUE, a missing key * will cause an exception. Default is FALSE. * @param string $prefix The prefix which should be used when reading from the metadata array. * Defaults to ''. * * @return array|NULL Public key or certificate data, or NULL if no public key or certificate was found. - * @throws \InvalidArgumentException If $metadata is not an instance of \SimpleSAML_Configuration, $required is not + * @throws \InvalidArgumentException If $metadata is not an instance of \SimpleSAML\Configuration, $required is not * boolean or $prefix is not a string. - * @throws \SimpleSAML_Error_Exception If no private key is found in the metadata, or it was not possible to load + * @throws Error\Exception If no private key is found in the metadata, or it was not possible to load * it. * * @author Andreas Solberg, UNINETT AS <andreas.solberg@uninett.no> * @author Olav Morken, UNINETT AS <olav.morken@uninett.no> * @author Lasse Birnbaum Jensen */ - public static function loadPublicKey(\SimpleSAML_Configuration $metadata, $required = false, $prefix = '') + public static function loadPublicKey(Configuration $metadata, $required = false, $prefix = '') { if (!is_bool($required) || !is_string($prefix)) { throw new \InvalidArgumentException('Invalid input parameters.'); } $keys = $metadata->getPublicKeys(null, false, $prefix); - if ($keys !== null) { + if (!empty($keys)) { foreach ($keys as $key) { if ($key['type'] !== 'X509Certificate') { continue; @@ -283,11 +286,11 @@ public static function loadPublicKey(\SimpleSAML_Configuration $metadata, $requi "-----END CERTIFICATE-----\n"; $certFingerprint = strtolower(sha1(base64_decode($certData))); - return array( + return [ 'certData' => $certData, 'PEM' => $pem, - 'certFingerprint' => array($certFingerprint), - ); + 'certFingerprint' => [$certFingerprint], + ]; } // no valid key found } elseif ($metadata->hasValue($prefix.'certFingerprint')) { @@ -296,7 +299,7 @@ public static function loadPublicKey(\SimpleSAML_Configuration $metadata, $requi // normalize fingerprint(s) - lowercase and no colons foreach ($fps as &$fp) { - assert('is_string($fp)'); + assert(is_string($fp)); $fp = strtolower(str_replace(':', '', $fp)); } @@ -304,12 +307,12 @@ public static function loadPublicKey(\SimpleSAML_Configuration $metadata, $requi * We can't build a full certificate from a fingerprint, and may as well return an array with only the * fingerprint(s) immediately. */ - return array('certFingerprint' => $fps); + return ['certFingerprint' => $fps]; } // no public key/certificate available if ($required) { - throw new \SimpleSAML_Error_Exception('No public key / certificate found in metadata.'); + throw new Error\Exception('No public key / certificate found in metadata.'); } else { return null; } @@ -349,47 +352,54 @@ public static function pem2der($pem) * This function hashes a password with a given algorithm. * * @param string $password The password to hash. - * @param string $algorithm The hashing algorithm, uppercase, optionally prepended with 'S' (salted). See + * @param string|null $algorithm @deprecated The hashing algorithm, uppercase, optionally prepended with 'S' (salted). See * hash_algos() for a complete list of hashing algorithms. - * @param string $salt An optional salt to use. + * @param string|null $salt @deprecated An optional salt to use. * * @return string The hashed password. - * @throws \InvalidArgumentException If the input parameters are not strings. - * @throws \SimpleSAML_Error_Exception If the algorithm specified is not supported. + * @throws \InvalidArgumentException If the input parameter is not a string. + * @throws Error\Exception If the algorithm specified is not supported. * * @see hash_algos() * * @author Dyonisius Visser, TERENA <visser@terena.org> * @author Jaime Perez, UNINETT AS <jaime.perez@uninett.no> */ - public static function pwHash($password, $algorithm, $salt = null) + public static function pwHash($password, $algorithm = null, $salt = null) { - if (!is_string($algorithm) || !is_string($password)) { - throw new \InvalidArgumentException('Invalid input parameters.'); - } - - // hash w/o salt - if (in_array(strtolower($algorithm), hash_algos(), true)) { - $alg_str = '{'.str_replace('SHA1', 'SHA', $algorithm).'}'; // LDAP compatibility - $hash = hash(strtolower($algorithm), $password, true); - return $alg_str.base64_encode($hash); - } + if (!is_null($algorithm)) { + // @deprecated Old-style + if (!is_string($algorithm) || !is_string($password)) { + throw new \InvalidArgumentException('Invalid input parameters.'); + } + // hash w/o salt + if (in_array(strtolower($algorithm), hash_algos(), true)) { + $alg_str = '{'.str_replace('SHA1', 'SHA', $algorithm).'}'; // LDAP compatibility + $hash = hash(strtolower($algorithm), $password, true); + return $alg_str.base64_encode($hash); + } + // hash w/ salt + if ($salt === null) { + // no salt provided, generate one + // default 8 byte salt, but 4 byte for LDAP SHA1 hashes + $bytes = ($algorithm == 'SSHA1') ? 4 : 8; + $salt = openssl_random_pseudo_bytes($bytes); + } - // hash w/ salt - if ($salt === null) { // no salt provided, generate one - // default 8 byte salt, but 4 byte for LDAP SHA1 hashes - $bytes = ($algorithm == 'SSHA1') ? 4 : 8; - $salt = openssl_random_pseudo_bytes($bytes); - } + if ($algorithm[0] == 'S' && in_array(substr(strtolower($algorithm), 1), hash_algos(), true)) { + $alg = substr(strtolower($algorithm), 1); // 'sha256' etc + $alg_str = '{'.str_replace('SSHA1', 'SSHA', $algorithm).'}'; // LDAP compatibility + $hash = hash($alg, $password.$salt, true); + return $alg_str.base64_encode($hash.$salt); + } + throw new Error\Exception('Hashing algorithm \''.strtolower($algorithm).'\' is not supported'); + } else { + if (!is_string($password)) { + throw new \InvalidArgumentException('Invalid input parameter.'); + } - if ($algorithm[0] == 'S' && in_array(substr(strtolower($algorithm), 1), hash_algos(), true)) { - $alg = substr(strtolower($algorithm), 1); // 'sha256' etc - $alg_str = '{'.str_replace('SSHA1', 'SSHA', $algorithm).'}'; // LDAP compatibility - $hash = hash($alg, $password.$salt, true); - return $alg_str.base64_encode($hash.$salt); + return password_hash($password, PASSWORD_DEFAULT); } - - throw new \SimpleSAML_Error_Exception('Hashing algorithm \''.strtolower($algorithm).'\' is not supported'); } @@ -433,7 +443,7 @@ public static function secureCompare($known, $user) * * @return boolean True if the hash corresponds with the given password, false otherwise. * @throws \InvalidArgumentException If the input parameters are not strings. - * @throws \SimpleSAML_Error_Exception If the algorithm specified is not supported. + * @throws Error\Exception If the algorithm specified is not supported. * * @author Dyonisius Visser, TERENA <visser@terena.org> */ @@ -443,6 +453,12 @@ public static function pwValid($hash, $password) throw new \InvalidArgumentException('Invalid input parameters.'); } + if (password_verify($password, $hash)) { + return true; + } + // return $hash === $password + + // @deprecated remove everything below this line for 2.0 // match algorithm string (e.g. '{SSHA256}', '{MD5}') if (preg_match('/^{(.*?)}(.*)$/', $hash, $matches)) { // LDAP compatibility @@ -462,10 +478,9 @@ public static function pwValid($hash, $password) $salt = substr(base64_decode($matches[2]), $hash_length); return self::secureCompare($hash, self::pwHash($password, $alg, $salt)); } + throw new Error\Exception('Hashing algorithm \''.strtolower($alg).'\' is not supported'); } else { return $hash === $password; } - - throw new \SimpleSAML_Error_Exception('Hashing algorithm \''.strtolower($alg).'\' is not supported'); } } diff --git a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Utils/HTTP.php b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Utils/HTTP.php index c2086f208d..300e89e189 100644 --- a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Utils/HTTP.php +++ b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Utils/HTTP.php @@ -1,8 +1,11 @@ <?php namespace SimpleSAML\Utils; -use SimpleSAML\Module; +use SimpleSAML\Configuration; use SimpleSAML\Logger; +use SimpleSAML\Module; +use SimpleSAML\Session; +use SimpleSAML\Error; /** * HTTP-related utility methods. @@ -11,34 +14,33 @@ */ class HTTP { - /** * Obtain a URL where we can redirect to securely post a form with the given data to a specific destination. * * @param string $destination The destination URL. * @param array $data An associative array containing the data to be posted to $destination. * - * @throws \SimpleSAML_Error_Exception If the current session is transient. + * @throws Error\Exception If the current session is transient. * @return string A URL which allows to securely post a form to $destination. * * @author Jaime Perez, UNINETT AS <jaime.perez@uninett.no> */ private static function getSecurePOSTRedirectURL($destination, $data) { - $session = \SimpleSAML_Session::getSessionFromRequest(); + $session = Session::getSessionFromRequest(); $id = self::savePOSTData($session, $destination, $data); // get the session ID $session_id = $session->getSessionId(); if (is_null($session_id)) { // this is a transient session, it is pointless to continue - throw new \SimpleSAML_Error_Exception('Cannot save POST data to a transient session.'); + throw new Error\Exception('Cannot save POST data to a transient session.'); } // encrypt the session ID and the random ID $info = base64_encode(Crypto::aesEncrypt($session_id.':'.$id)); - $url = Module::getModuleURL('core/postredirect.php', array('RedirInfo' => $info)); + $url = Module::getModuleURL('core/postredirect.php', ['RedirInfo' => $info]); return preg_replace('#^https:#', 'http:', $url); } @@ -68,7 +70,7 @@ private static function getServerHost() if (!is_numeric($port)) { array_push($decomposed, $port); } - $current = implode($decomposed, ":"); + $current = implode(":", $decomposed); } return $current; } @@ -108,20 +110,40 @@ public static function getServerHTTPS() */ public static function getServerPort() { - $port = (isset($_SERVER['SERVER_PORT'])) ? $_SERVER['SERVER_PORT'] : '80'; - if (self::getServerHTTPS()) { - if ($port !== '443') { - return ':'.$port; - } - } else { - if ($port !== '80') { - return ':'.$port; - } + $default_port = self::getServerHTTPS() ? '443' : '80'; + $port = isset($_SERVER['SERVER_PORT']) ? $_SERVER['SERVER_PORT'] : $default_port; + + // Take care of edge-case where SERVER_PORT is an integer + $port = strval($port); + + if ($port !== $default_port) { + return ':'.$port; } return ''; } + /** + * Verify that a given URL is valid. + * + * @param string $url The URL we want to verify. + * + * @return boolean True if the given URL is valid, false otherwise. + */ + public static function isValidURL($url) + { + $url = filter_var($url, FILTER_VALIDATE_URL); + if ($url === false) { + return false; + } + $scheme = parse_url($url, PHP_URL_SCHEME); + if ($scheme !== false && in_array(strtolower($scheme), ['http', 'https'], true)) { + return true; + } + return false; + } + + /** * This function redirects the user to the specified address. * @@ -140,16 +162,21 @@ public static function getServerPort() * * @return void This function never returns. * @throws \InvalidArgumentException If $url is not a string or is empty, or $parameters is not an array. + * @throws \SimpleSAML\Error\Exception If $url is not a valid HTTP URL. * * @author Olav Morken, UNINETT AS <olav.morken@uninett.no> * @author Mads Freek Petersen * @author Jaime Perez, UNINETT AS <jaime.perez@uninett.no> */ - private static function redirect($url, $parameters = array()) + private static function redirect($url, $parameters = []) { if (!is_string($url) || empty($url) || !is_array($parameters)) { throw new \InvalidArgumentException('Invalid input parameters.'); } + if (!self::isValidURL($url)) { + throw new Error\Exception('Invalid destination URL.'); + } + if (!empty($parameters)) { $url = self::addURLParameters($url, $parameters); } @@ -206,7 +233,7 @@ private static function redirect($url, $parameters = array()) /** * Save the given HTTP POST data and the destination where it should be posted to a given session. * - * @param \SimpleSAML_Session $session The session where to temporarily store the data. + * @param \SimpleSAML\Session $session The session where to temporarily store the data. * @param string $destination The destination URL where the form should be posted. * @param array $data An associative array with the data to be posted to $destination. * @@ -215,14 +242,14 @@ private static function redirect($url, $parameters = array()) * @author Andjelko Horvat * @author Jaime Perez, UNINETT AS <jaime.perez@uninett.no> */ - private static function savePOSTData(\SimpleSAML_Session $session, $destination, $data) + private static function savePOSTData(Session $session, $destination, $data) { // generate a random ID to avoid replay attacks $id = Random::generateID(); - $postData = array( + $postData = [ 'post' => $data, 'url' => $destination, - ); + ]; // save the post data to the session, tied to the random ID $session->setData('core_postdatalink', $id, $postData); @@ -252,13 +279,13 @@ public static function addURLParameters($url, $parameters) $queryStart = strpos($url, '?'); if ($queryStart === false) { - $oldQuery = array(); + $oldQuery = []; $url .= '?'; } else { /** @var string|false $oldQuery */ $oldQuery = substr($url, $queryStart + 1); if ($oldQuery === false) { - $oldQuery = array(); + $oldQuery = []; } else { $oldQuery = self::parseQueryString($oldQuery); } @@ -290,7 +317,7 @@ public static function checkSessionCookie($retryURL = null) throw new \InvalidArgumentException('Invalid input parameters.'); } - $session = \SimpleSAML_Session::getSessionFromRequest(); + $session = Session::getSessionFromRequest(); if ($session->hasSessionCookie()) { return; } @@ -299,7 +326,7 @@ public static function checkSessionCookie($retryURL = null) $url = Module::getModuleURL('core/no_cookie.php'); if ($retryURL !== null) { - $url = self::addURLParameters($url, array('retryURL' => $retryURL)); + $url = self::addURLParameters($url, ['retryURL' => $retryURL]); } self::redirectTrustedURL($url); } @@ -315,7 +342,7 @@ public static function checkSessionCookie($retryURL = null) * @return string The normalized URL itself if it is allowed. An empty string if the $url parameter is empty as * defined by the empty() function. * @throws \InvalidArgumentException If the URL is malformed. - * @throws \SimpleSAML_Error_Exception If the URL is not allowed by configuration. + * @throws Error\Exception If the URL is not allowed by configuration. * * @author Jaime Perez, UNINETT AS <jaime.perez@uninett.no> */ @@ -326,13 +353,13 @@ public static function checkURLAllowed($url, array $trustedSites = null) } $url = self::normalizeURL($url); - if (filter_var($url, FILTER_VALIDATE_URL) === false) { - throw new \SimpleSAML_Error_Exception('Invalid URL: '.$url); + if (!self::isValidURL($url)) { + throw new Error\Exception('Invalid URL: '.$url); } // get the white list of domains if ($trustedSites === null) { - $trustedSites = \SimpleSAML_Configuration::getInstance()->getValue('trusted.url.domains', array()); + $trustedSites = Configuration::getInstance()->getValue('trusted.url.domains', []); } // validates the URL's host is among those allowed @@ -345,7 +372,7 @@ public static function checkURLAllowed($url, array $trustedSites = null) if ((isset($components['user']) && strpos($components['user'], '\\') !== false) || (isset($components['pass']) && strpos($components['pass'], '\\') !== false) ) { - throw new \SimpleSAML_Error_Exception('Invalid URL: '.$url); + throw new Error\Exception('Invalid URL: '.$url); } // allow URLs with standard ports specified (non-standard ports must then be allowed explicitly) @@ -358,7 +385,7 @@ public static function checkURLAllowed($url, array $trustedSites = null) $self_host = self::getSelfHostWithNonStandardPort(); - $trustedRegex = \SimpleSAML_Configuration::getInstance()->getValue('trusted.url.regex', false); + $trustedRegex = Configuration::getInstance()->getValue('trusted.url.regex', false); $trusted = false; if ($trustedRegex) { @@ -380,7 +407,7 @@ public static function checkURLAllowed($url, array $trustedSites = null) // throw exception due to redirection to untrusted site if (!$trusted) { - throw new \SimpleSAML_Error_Exception('URL not allowed: '.$url); + throw new Error\Exception('URL not allowed: '.$url); } } return $url; @@ -400,19 +427,19 @@ public static function checkURLAllowed($url, array $trustedSites = null) * @return string|array An array if $getHeaders is set, containing the data and the headers respectively; string * otherwise. * @throws \InvalidArgumentException If the input parameters are invalid. - * @throws \SimpleSAML_Error_Exception If the file or URL cannot be retrieved. + * @throws Error\Exception If the file or URL cannot be retrieved. * * @author Andjelko Horvat * @author Olav Morken, UNINETT AS <olav.morken@uninett.no> * @author Marco Ferrante, University of Genova <marco@csita.unige.it> */ - public static function fetch($url, $context = array(), $getHeaders = false) + public static function fetch($url, $context = [], $getHeaders = false) { if (!is_string($url)) { throw new \InvalidArgumentException('Invalid input parameters.'); } - $config = \SimpleSAML_Configuration::getInstance(); + $config = Configuration::getInstance(); $proxy = $config->getString('proxy', null); if ($proxy !== null) { @@ -441,10 +468,10 @@ public static function fetch($url, $context = array(), $getHeaders = false) // extract the hostname $hostname = parse_url($url, PHP_URL_HOST); if (!empty($hostname)) { - $context['ssl'] = array( + $context['ssl'] = [ 'SNI_server_name' => $hostname, 'SNI_enabled' => true, - ); + ]; } else { Logger::warning('Invalid URL format or local URL used through a proxy'); } @@ -452,20 +479,20 @@ public static function fetch($url, $context = array(), $getHeaders = false) } $context = stream_context_create($context); - $data = file_get_contents($url, false, $context); + $data = @file_get_contents($url, false, $context); if ($data === false) { $error = error_get_last(); - throw new \SimpleSAML_Error_Exception('Error fetching '.var_export($url, true).':'. + throw new Error\Exception('Error fetching '.var_export($url, true).':'. (is_array($error) ? $error['message'] : 'no error available')); } // data and headers if ($getHeaders) { if (isset($http_response_header)) { - $headers = array(); + $headers = []; foreach ($http_response_header as $h) { if (preg_match('@^HTTP/1\.[01]\s+\d{3}\s+@', $h)) { - $headers = array(); // reset + $headers = []; // reset $headers[0] = $h; continue; } @@ -478,7 +505,7 @@ public static function fetch($url, $context = array(), $getHeaders = false) // no HTTP headers, probably a different protocol, e.g. file $headers = null; } - return array($data, $headers); + return [$data, $headers]; } return $data; @@ -500,12 +527,12 @@ public static function getAcceptLanguage() { if (!array_key_exists('HTTP_ACCEPT_LANGUAGE', $_SERVER)) { // no Accept-Language header, return an empty set - return array(); + return []; } $languages = explode(',', strtolower($_SERVER['HTTP_ACCEPT_LANGUAGE'])); - $ret = array(); + $ret = []; foreach ($languages as $l) { $opts = explode(';', $l); @@ -597,14 +624,13 @@ public static function guessBasePath() */ public static function getBaseURL() { - $globalConfig = \SimpleSAML_Configuration::getInstance(); + $globalConfig = Configuration::getInstance(); $baseURL = $globalConfig->getString('baseurlpath', 'simplesaml/'); if (preg_match('#^https?://.*/?$#D', $baseURL, $matches)) { // full URL in baseurlpath, override local server values return rtrim($baseURL, '/').'/'; - } elseif ( - (preg_match('#^/?([^/]?.*/)$#D', $baseURL, $matches)) || + } elseif ((preg_match('#^/?([^/]?.*/)$#D', $baseURL, $matches)) || (preg_match('#^\*(.*)/$#D', $baseURL, $matches)) || ($baseURL === '') ) { @@ -625,7 +651,7 @@ public static function getBaseURL() */ $c = $globalConfig->toArray(); $c['baseurlpath'] = self::guessBasePath(); - throw new \SimpleSAML\Error\CriticalConfigurationError( + throw new Error\CriticalConfigurationError( 'Invalid value for \'baseurlpath\' in config.php. Valid format is in the form: '. '[(http|https)://(hostname|fqdn)[:port]]/[path/to/simplesaml/]. It must end with a \'/\'.', null, @@ -638,16 +664,16 @@ public static function getBaseURL() /** * Retrieve the first element of the URL path. * - * @param boolean $trailingslash Whether to add a trailing slash to the element or not. Defaults to true. + * @param boolean $leadingSlash Whether to add a leading slash to the element or not. Defaults to true. * - * @return string The first element of the URL path, with an optional, trailing slash. + * @return string The first element of the URL path, with an optional, leading slash. * * @author Andreas Solberg, UNINETT AS <andreas.solberg@uninett.no> */ - public static function getFirstPathElement($trailingslash = true) + public static function getFirstPathElement($leadingSlash = true) { if (preg_match('|^/(.*?)/|', $_SERVER['SCRIPT_NAME'], $matches)) { - return ($trailingslash ? '/' : '').$matches[1]; + return ($leadingSlash ? '/' : '').$matches[1]; } return ''; } @@ -671,16 +697,17 @@ public static function getPOSTRedirectURL($destination, $data) throw new \InvalidArgumentException('Invalid input parameters.'); } - $config = \SimpleSAML_Configuration::getInstance(); + $config = Configuration::getInstance(); $allowed = $config->getBoolean('enable.http_post', false); if ($allowed && preg_match("#^http:#", $destination) && self::isHTTPS()) { // we need to post the data to HTTP $url = self::getSecurePOSTRedirectURL($destination, $data); - } else { // post the data directly - $session = \SimpleSAML_Session::getSessionFromRequest(); + } else { + // post the data directly + $session = Session::getSessionFromRequest(); $id = self::savePOSTData($session, $destination, $data); - $url = Module::getModuleURL('core/postredirect.php', array('RedirId' => $id)); + $url = Module::getModuleURL('core/postredirect.php', ['RedirId' => $id]); } return $url; @@ -761,7 +788,7 @@ public static function getSelfHostWithPath() */ public static function getSelfURL() { - $cfg = \SimpleSAML_Configuration::getInstance(); + $cfg = Configuration::getInstance(); $baseDir = $cfg->getBaseDir(); $cur_path = realpath($_SERVER['SCRIPT_FILENAME']); // make sure we got a string from realpath() @@ -792,16 +819,16 @@ public static function getSelfURL() * for this case in the configuration. First, check if that's the case. */ - /** @var \SimpleSAML_Configuration $appcfg */ + /** @var \SimpleSAML\Configuration $appcfg */ $appcfg = $cfg->getConfigItem('application', null); - $appurl = ($appcfg instanceof \SimpleSAML_Configuration) ? $appcfg->getString('baseURL', '') : ''; + $appurl = ($appcfg instanceof Configuration) ? $appcfg->getString('baseURL', '') : ''; if (!empty($appurl)) { $protocol = parse_url($appurl, PHP_URL_SCHEME); $hostname = parse_url($appurl, PHP_URL_HOST); $port = parse_url($appurl, PHP_URL_PORT); $port = !empty($port) ? ':'.$port : ''; - - } else { // no base URL specified for app, just use the current URL + } else { + // no base URL specified for app, just use the current URL $protocol = 'http'; $protocol .= (self::getServerHTTPS()) ? 's' : ''; $hostname = self::getServerHost(); @@ -810,7 +837,7 @@ public static function getSelfURL() return $protocol.'://'.$hostname.$port.$_SERVER['REQUEST_URI']; } - return self::getBaseURL().$rel_path.substr($_SERVER['REQUEST_URI'], $uri_pos + strlen($url_path)); + return self::getBaseURL().$url_path.substr($_SERVER['REQUEST_URI'], $uri_pos + strlen($url_path)); } @@ -918,7 +945,7 @@ public static function parseQueryString($query_string) throw new \InvalidArgumentException('Invalid input parameters.'); } - $res = array(); + $res = []; if (empty($query_string)) { return $res; } @@ -959,7 +986,7 @@ public static function parseQueryString($query_string) * * @author Jaime Perez, UNINETT AS <jaime.perez@uninett.no> */ - public static function redirectTrustedURL($url, $parameters = array()) + public static function redirectTrustedURL($url, $parameters = []) { if (!is_string($url) || !is_array($parameters)) { throw new \InvalidArgumentException('Invalid input parameters.'); @@ -972,7 +999,7 @@ public static function redirectTrustedURL($url, $parameters = array()) /** * This function redirects to the specified URL after performing the appropriate security checks on it. - * Particularly, it will make sure that the provided URL is allowed by the 'redirect.trustedsites' directive in the + * Particularly, it will make sure that the provided URL is allowed by the 'trusted.url.domains' directive in the * configuration. * * If the aforementioned option is not set or the URL does correspond to a trusted site, it performs a redirection @@ -991,7 +1018,7 @@ public static function redirectTrustedURL($url, $parameters = array()) * * @author Jaime Perez, UNINETT AS <jaime.perez@uninett.no> */ - public static function redirectUntrustedURL($url, $parameters = array()) + public static function redirectUntrustedURL($url, $parameters = []) { if (!is_string($url) || !is_array($parameters)) { throw new \InvalidArgumentException('Invalid input parameters.'); @@ -1114,7 +1141,7 @@ public static function setCookie($name, $value, $params = null, $throw = true) throw new \InvalidArgumentException('Invalid input parameters.'); } - $default_params = array( + $default_params = [ 'lifetime' => 0, 'expire' => null, 'path' => '/', @@ -1122,7 +1149,8 @@ public static function setCookie($name, $value, $params = null, $throw = true) 'secure' => false, 'httponly' => true, 'raw' => false, - ); + 'samesite' => null, + ]; if ($params !== null) { $params = array_merge($default_params, $params); @@ -1133,9 +1161,9 @@ public static function setCookie($name, $value, $params = null, $throw = true) // Do not set secure cookie if not on HTTPS if ($params['secure'] && !self::isHTTPS()) { if ($throw) { - throw new \SimpleSAML\Error\CannotSetCookie( + throw new Error\CannotSetCookie( 'Setting secure cookie on plain HTTP is not allowed.', - \SimpleSAML\Error\CannotSetCookie::SECURE_COOKIE + Error\CannotSetCookie::SECURE_COOKIE ); } Logger::warning('Error setting cookie: setting secure cookie on plain HTTP is not allowed.'); @@ -1152,33 +1180,68 @@ public static function setCookie($name, $value, $params = null, $throw = true) $expire = time() + $params['lifetime']; } - if ($params['raw']) { - $success = @setrawcookie( - $name, - $value, - $expire, - $params['path'], - $params['domain'], - $params['secure'], - $params['httponly'] - ); + if (\PHP_VERSION_ID >= 70300) { + /* use the new options array for PHP >= 7.3 */ + if ($params['raw']) { + $success = @setrawcookie( + $name, + $value, + [ + 'expires' => $expire, + 'path' => $params['path'], + 'domain' => $params['domain'], + 'secure' => $params['secure'], + 'httponly' => $params['httponly'], + 'samesite' => $params['samesite'], + ] + ); + } else { + $success = @setcookie( + $name, + $value, + [ + 'expires' => $expire, + 'path' => $params['path'], + 'domain' => $params['domain'], + 'secure' => $params['secure'], + 'httponly' => $params['httponly'], + 'samesite' => $params['samesite'], + ] + ); + } } else { - $success = @setcookie( - $name, - $value, - $expire, - $params['path'], - $params['domain'], - $params['secure'], - $params['httponly'] - ); + /* in older versions of PHP we need a nasty hack to set RFC6265bis SameSite attribute */ + if ($params['samesite'] !== null and !preg_match('/;\s+samesite/i', $params['path'])) { + $params['path'] .= '; SameSite='.$params['samesite']; + } + if ($params['raw']) { + $success = @setrawcookie( + $name, + $value, + $expire, + $params['path'], + $params['domain'], + $params['secure'], + $params['httponly'] + ); + } else { + $success = @setcookie( + $name, + $value, + $expire, + $params['path'], + $params['domain'], + $params['secure'], + $params['httponly'] + ); + } } if (!$success) { if ($throw) { - throw new \SimpleSAML\Error\CannotSetCookie( + throw new Error\CannotSetCookie( 'Headers already sent.', - \SimpleSAML\Error\CannotSetCookie::HEADERS_SENT + Error\CannotSetCookie::HEADERS_SENT ); } Logger::warning('Error setting cookie: headers already sent.'); @@ -1195,6 +1258,7 @@ public static function setCookie($name, $value, $params = null, $throw = true) * @param array $data An associative array with the data to be posted to $destination. * * @throws \InvalidArgumentException If $destination is not a string or $data is not an array. + * @throws \SimpleSAML\Error\Exception If $destination is not a valid HTTP URL. * * @return void * @@ -1207,8 +1271,11 @@ public static function submitPOSTData($destination, $data) if (!is_string($destination) || !is_array($data)) { throw new \InvalidArgumentException('Invalid input parameters.'); } + if (!self::isValidURL($destination)) { + throw new Error\Exception('Invalid destination URL.'); + } - $config = \SimpleSAML_Configuration::getInstance(); + $config = Configuration::getInstance(); $allowed = $config->getBoolean('enable.http_post', false); if ($allowed && preg_match("#^http:#", $destination) && self::isHTTPS()) { @@ -1216,7 +1283,7 @@ public static function submitPOSTData($destination, $data) self::redirect(self::getSecurePOSTRedirectURL($destination, $data)); } - $p = new \SimpleSAML_XHTML_Template($config, 'post.php'); + $p = new \SimpleSAML\XHTML\Template($config, 'post.php'); $p->data['destination'] = $destination; $p->data['post'] = $data; $p->show(); diff --git a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Utils/HttpAdapter.php b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Utils/HttpAdapter.php new file mode 100644 index 0000000000..b823920763 --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Utils/HttpAdapter.php @@ -0,0 +1,211 @@ +<?php + +namespace SimpleSAML\Utils; + +/** + * Provides a non-static wrapper for the HTTP utility class. + * + * @package SimpleSAML\Utils + */ +class HttpAdapter +{ + /** + * @see HTTP::getServerHTTPS() + */ + public function getServerHTTPS() + { + return HTTP::getServerHTTPS(); + } + + /** + * @see HTTP::getServerPort() + */ + public function getServerPort() + { + return HTTP::getServerPort(); + } + + /** + * @see HTTP::addURLParameters() + */ + public function addURLParameters($url, $parameters) + { + return HTTP::addURLParameters($url, $parameters); + } + + /** + * @see HTTP::checkSessionCookie() + */ + public function checkSessionCookie($retryURL = null) + { + HTTP::checkSessionCookie($retryURL); + } + + /** + * @see HTTP::checkURLAllowed() + */ + public function checkURLAllowed($url, array $trustedSites = null) + { + return HTTP::checkURLAllowed($url, $trustedSites); + } + + /** + * @see HTTP::fetch() + */ + public function fetch($url, $context = [], $getHeaders = false) + { + return HTTP::fetch($url, $context, $getHeaders); + } + + /** + * @see HTTP::getAcceptLanguage() + */ + public function getAcceptLanguage() + { + return HTTP::getAcceptLanguage(); + } + + /** + * @see HTTP::guessBasePath() + */ + public function guessBasePath() + { + return HTTP::guessBasePath(); + } + + /** + * @see HTTP::getBaseURL() + */ + public function getBaseURL() + { + return HTTP::getBaseURL(); + } + + /** + * @see HTTP::getFirstPathElement() + */ + public function getFirstPathElement($trailingslash = true) + { + return HTTP::getFirstPathElement($trailingslash); + } + + /** + * @see HTTP::getPOSTRedirectURL() + */ + public function getPOSTRedirectURL($destination, $data) + { + return HTTP::getPOSTRedirectURL($destination, $data); + } + + /** + * @see HTTP::getSelfHost() + */ + public function getSelfHost() + { + return HTTP::getSelfHost(); + } + + /** + * @see HTTP::getSelfHostWithNonStandardPort() + */ + public function getSelfHostWithNonStandardPort() + { + return HTTP::getSelfHostWithNonStandardPort(); + } + + /** + * @see HTTP::getSelfHostWithPath() + */ + public function getSelfHostWithPath() + { + return HTTP::getSelfHostWithPath(); + } + + /** + * @see HTTP::getSelfURL() + */ + public function getSelfURL() + { + return HTTP::getSelfURL(); + } + + /** + * @see HTTP::getSelfURLHost() + */ + public function getSelfURLHost() + { + return HTTP::getSelfURLHost(); + } + + /** + * @see HTTP::getSelfURLNoQuery() + */ + public function getSelfURLNoQuery() + { + return HTTP::getSelfURLNoQuery(); + } + + /** + * @see HTTP::isHTTPS() + */ + public function isHTTPS() + { + return HTTP::isHTTPS(); + } + + /** + * @see HTTP::normalizeURL() + */ + public function normalizeURL($url) + { + return HTTP::normalizeURL($url); + } + + /** + * @see HTTP::parseQueryString() + */ + public function parseQueryString($query_string) + { + return HTTP::parseQueryString($query_string); + } + + /** + * @see HTTP::redirectTrustedURL() + */ + public function redirectTrustedURL($url, $parameters = []) + { + HTTP::redirectTrustedURL($url, $parameters); + } + + /** + * @see HTTP::redirectUntrustedURL() + */ + public function redirectUntrustedURL($url, $parameters = []) + { + HTTP::redirectUntrustedURL($url, $parameters); + } + + /** + * @see HTTP::resolveURL() + */ + public function resolveURL($url, $base = null) + { + return HTTP::resolveURL($url, $base); + } + + /** + * @see HTTP::setCookie() + */ + public function setCookie($name, $value, $params = null, $throw = true) + { + HTTP::setCookie($name, $value, $params, $throw); + } + + /** + * @see HTTP::submitPOSTData() + */ + public function submitPOSTData($destination, $data) + { + HTTP::submitPOSTData($destination, $data); + } +} diff --git a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Utils/Net.php b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Utils/Net.php index 96526ad683..02619d2215 100644 --- a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Utils/Net.php +++ b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Utils/Net.php @@ -35,8 +35,8 @@ public static function ipCIDRcheck($cidr, $ip = null) list ($net, $mask) = explode('/', $cidr); $mask = intval($mask); - $ip_ip = array(); - $ip_net = array(); + $ip_ip = []; + $ip_net = []; if (strstr($ip, ':') || strstr($net, ':')) { // Validate IPv6 with inet_pton, convert to hex with bin2hex // then store as a long with hexdec diff --git a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Utils/Random.php b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Utils/Random.php index b53ace2e5a..f3db05154b 100644 --- a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Utils/Random.php +++ b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Utils/Random.php @@ -25,6 +25,6 @@ class Random */ public static function generateID() { - return '_'.bin2hex(openssl_random_pseudo_bytes((int)((self::ID_LENGTH - 1)/2))); + return '_'.bin2hex(openssl_random_pseudo_bytes((int) ((self::ID_LENGTH - 1) / 2))); } -} \ No newline at end of file +} diff --git a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Utils/System.php b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Utils/System.php index 43c0b9b554..6769ae9b6d 100644 --- a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Utils/System.php +++ b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Utils/System.php @@ -1,14 +1,17 @@ <?php + namespace SimpleSAML\Utils; +use SimpleSAML\Error; + /** * System-related utility methods. * * @package SimpleSAMLphp */ + class System { - const WINDOWS = 1; const LINUX = 2; const OSX = 3; @@ -60,7 +63,7 @@ public static function getOS() * This function retrieves the path to a directory where temporary files can be saved. * * @return string Path to a temporary directory, without a trailing directory separator. - * @throws \SimpleSAML_Error_Exception If the temporary directory cannot be created or it exists and does not belong + * @throws Error\Exception If the temporary directory cannot be created or it exists and does not belong * to the current user. * * @author Andreas Solberg, UNINETT AS <andreas.solberg@uninett.no> @@ -69,7 +72,7 @@ public static function getOS() */ public static function getTempDir() { - $globalConfig = \SimpleSAML_Configuration::getInstance(); + $globalConfig = \SimpleSAML\Configuration::getInstance(); $tempDir = rtrim( $globalConfig->getString( @@ -82,7 +85,7 @@ public static function getTempDir() if (!is_dir($tempDir)) { if (!mkdir($tempDir, 0700, true)) { $error = error_get_last(); - throw new \SimpleSAML_Error_Exception( + throw new Error\Exception( 'Error creating temporary directory "'.$tempDir.'": '. (is_array($error) ? $error['message'] : 'no error available') ); @@ -91,7 +94,7 @@ public static function getTempDir() // check that the owner of the temp directory is the current user $stat = lstat($tempDir); if ($stat['uid'] !== posix_getuid()) { - throw new \SimpleSAML_Error_Exception( + throw new Error\Exception( 'Temporary directory "'.$tempDir.'" does not belong to the current user.' ); } @@ -118,17 +121,24 @@ public static function getTempDir() public static function resolvePath($path, $base = null) { if ($base === null) { - $config = \SimpleSAML_Configuration::getInstance(); + $config = \SimpleSAML\Configuration::getInstance(); $base = $config->getBaseDir(); } + // normalise directory separator + $base = str_replace('\\', '/', $base); + $path = str_replace('\\', '/', $path); + // remove trailing slashes $base = rtrim($base, '/'); + $path = rtrim($path, '/'); // check for absolute path if (substr($path, 0, 1) === '/') { // absolute path. */ $ret = '/'; + } elseif (static::pathContainsDriveLetter($path)) { + $ret = ''; } else { // path relative to base $ret = $base; @@ -141,7 +151,7 @@ public static function resolvePath($path, $base = null) } elseif ($d === '..') { $ret = dirname($ret); } else { - if (substr($ret, -1) !== '/') { + if ($ret && substr($ret, -1) !== '/') { $ret .= '/'; } $ret .= $d; @@ -163,7 +173,7 @@ public static function resolvePath($path, $base = null) * @param int $mode The permissions to apply to the file. Defaults to 0600. * * @throws \InvalidArgumentException If any of the input parameters doesn't have the proper types. - * @throws \SimpleSAML_Error_Exception If the file cannot be saved, permissions cannot be changed or it is not + * @throws Error\Exception If the file cannot be saved, permissions cannot be changed or it is not * possible to write to the target file. * * @author Andreas Solberg, UNINETT AS <andreas.solberg@uninett.no> @@ -184,7 +194,7 @@ public static function writeFile($filename, $data, $mode = 0600) $res = @file_put_contents($tmpFile, $data); if ($res === false) { $error = error_get_last(); - throw new \SimpleSAML_Error_Exception( + throw new Error\Exception( 'Error saving file "'.$tmpFile.'": '. (is_array($error) ? $error['message'] : 'no error available') ); @@ -195,7 +205,7 @@ public static function writeFile($filename, $data, $mode = 0600) unlink($tmpFile); $error = error_get_last(); //$error = (is_array($error) ? $error['message'] : 'no error available'); - throw new \SimpleSAML_Error_Exception( + throw new Error\Exception( 'Error changing file mode of "'.$tmpFile.'": '. (is_array($error) ? $error['message'] : 'no error available') ); @@ -205,7 +215,7 @@ public static function writeFile($filename, $data, $mode = 0600) if (!rename($tmpFile, $filename)) { unlink($tmpFile); $error = error_get_last(); - throw new \SimpleSAML_Error_Exception( + throw new Error\Exception( 'Error moving "'.$tmpFile.'" to "'.$filename.'": '. (is_array($error) ? $error['message'] : 'no error available') ); @@ -215,4 +225,18 @@ public static function writeFile($filename, $data, $mode = 0600) opcache_invalidate($filename); } } + + /** + * Check if the supplied path contains a Windows-style drive letter. + * + * @param string $path + * + * @return bool + */ + private static function pathContainsDriveLetter($path) + { + $letterAsciiValue = ord(strtoupper(substr($path, 0, 1))); + return substr($path, 1, 1) === ':' + && $letterAsciiValue >= 65 && $letterAsciiValue <= 90; + } } diff --git a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Utils/Time.php b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Utils/Time.php index be8d47b2d9..78246f9415 100644 --- a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Utils/Time.php +++ b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Utils/Time.php @@ -1,4 +1,5 @@ <?php + /** * Time-related utility methods. * @@ -9,10 +10,8 @@ use SimpleSAML\Logger; - class Time { - /** * Whether the timezone has been initialized or not. * @@ -45,7 +44,7 @@ public static function generateTimestamp($instant = null) * * @author Olav Morken, UNINETT AS <olav.morken@uninett.no> * - * @throws \SimpleSAML_Error_Exception If the timezone set in the configuration is invalid. + * @throws \SimpleSAML\Error\Exception If the timezone set in the configuration is invalid. * * @return void */ @@ -55,12 +54,12 @@ public static function initTimezone() return; } - $globalConfig = \SimpleSAML_Configuration::getInstance(); + $globalConfig = \SimpleSAML\Configuration::getInstance(); $timezone = $globalConfig->getString('timezone', null); if ($timezone !== null) { if (!date_default_timezone_set($timezone)) { - throw new \SimpleSAML_Error_Exception('Invalid timezone set in the "timezone" option in config.php.'); + throw new \SimpleSAML\Error\Exception('Invalid timezone set in the "timezone" option in config.php.'); } self::$tz_initialized = true; return; diff --git a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Utils/XML.php b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Utils/XML.php index 3f540d96a4..9b1f37766c 100644 --- a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Utils/XML.php +++ b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Utils/XML.php @@ -25,7 +25,7 @@ class XML * * @throws \InvalidArgumentException If $message is not a string or $type is not a string containing one of the * values allowed. - * @throws \SimpleSAML_Error_Exception If $message contains a doctype declaration. + * @throws \SimpleSAML\Error\Exception If $message contains a doctype declaration. * * @return void * @@ -34,24 +34,25 @@ class XML */ public static function checkSAMLMessage($message, $type) { - $allowed_types = array('saml20', 'saml11', 'saml-meta'); + $allowed_types = ['saml20', 'saml11', 'saml-meta']; if (!(is_string($message) && in_array($type, $allowed_types, true))) { throw new \InvalidArgumentException('Invalid input parameters.'); } // a SAML message should not contain a doctype-declaration if (strpos($message, '<!DOCTYPE') !== false) { - throw new \SimpleSAML_Error_Exception('XML contained a doctype declaration.'); + throw new \SimpleSAML\Error\Exception('XML contained a doctype declaration.'); } // see if debugging is enabled for XML validation - $debug = \SimpleSAML_Configuration::getInstance()->getArrayize('debug', array('validatexml' => false)); - $enabled = \SimpleSAML_Configuration::getInstance()->getBoolean('debug.validatexml', false); + $debug = \SimpleSAML\Configuration::getInstance()->getArrayize('debug', ['validatexml' => false]); + $enabled = \SimpleSAML\Configuration::getInstance()->getBoolean('debug.validatexml', false); if (!(in_array('validatexml', $debug, true) // implicitly enabled - || (array_key_exists('validatexml', $debug) && $debug['validatexml'] === true) // explicitly enabled - // TODO: deprecate this option and remove it in 2.0 - || $enabled // old 'debug.validatexml' configuration option + || (array_key_exists('validatexml', $debug) && $debug['validatexml'] === true) + // explicitly enabled + // TODO: deprecate this option and remove it in 2.0 + || $enabled // old 'debug.validatexml' configuration option )) { // XML validation is disabled return; @@ -98,12 +99,13 @@ public static function debugSAMLMessage($message, $type) } // see if debugging is enabled for SAML messages - $debug = \SimpleSAML_Configuration::getInstance()->getArrayize('debug', array('saml' => false)); + $debug = \SimpleSAML\Configuration::getInstance()->getArrayize('debug', ['saml' => false]); if (!(in_array('saml', $debug, true) // implicitly enabled - || (array_key_exists('saml', $debug) && $debug['saml'] === true) // explicitly enabled - // TODO: deprecate the old style and remove it in 2.0 - || (array_key_exists(0, $debug) && $debug[0] === true) // old style 'debug' + || (array_key_exists('saml', $debug) && $debug['saml'] === true) + // explicitly enabled + // TODO: deprecate the old style and remove it in 2.0 + || (array_key_exists(0, $debug) && $debug[0] === true) // old style 'debug' )) { // debugging messages is disabled return; @@ -161,8 +163,8 @@ public static function formatDOMElement(\DOMNode $root, $indentBase = '') // check what this element contains $fullText = ''; // all text in this element - $textNodes = array(); // text nodes which should be deleted - $childNodes = array(); // other child nodes + $textNodes = []; // text nodes which should be deleted + $childNodes = []; // other child nodes for ($i = 0; $i < $root->childNodes->length; $i++) { /** @var \DOMElement $child */ $child = $root->childNodes->item($i); @@ -283,7 +285,7 @@ public static function getDOMChildren(\DOMNode $element, $localName, $namespaceU throw new \InvalidArgumentException('Invalid input parameters.'); } - $ret = array(); + $ret = []; for ($i = 0; $i < $element->childNodes->length; $i++) { /** @var \DOMElement $child */ @@ -309,7 +311,7 @@ public static function getDOMChildren(\DOMNode $element, $localName, $namespaceU * @param \DOMElement $element The element we should extract text from. * * @return string The text content of the element. - * @throws \SimpleSAML_Error_Exception If the element contains a non-text child node. + * @throws \SimpleSAML\Error\Exception If the element contains a non-text child node. * * @author Olav Morken, UNINETT AS <olav.morken@uninett.no> */ @@ -321,7 +323,7 @@ public static function getDOMText(\DOMElement $element) /** @var \DOMElement $child */ $child = $element->childNodes->item($i); if (!($child instanceof \DOMText)) { - throw new \SimpleSAML_Error_Exception($element->localName.' contained a non-text child node.'); + throw new \SimpleSAML\Error\Exception($element->localName.' contained a non-text child node.'); } $txt .= $child->wholeText; @@ -364,7 +366,7 @@ public static function isDOMNodeOfType(\DOMNode $element, $name, $nsURI) // check if the namespace is a shortcut, and expand it if it is if ($nsURI[0] === '@') { // the defined shortcuts - $shortcuts = array( + $shortcuts = [ '@ds' => 'http://www.w3.org/2000/09/xmldsig#', '@md' => 'urn:oasis:names:tc:SAML:2.0:metadata', '@saml1' => 'urn:oasis:names:tc:SAML:1.0:assertion', @@ -373,7 +375,7 @@ public static function isDOMNodeOfType(\DOMNode $element, $name, $nsURI) '@saml2' => 'urn:oasis:names:tc:SAML:2.0:assertion', '@saml2p' => 'urn:oasis:names:tc:SAML:2.0:protocol', '@shibmd' => 'urn:mace:shibboleth:metadata:1.0', - ); + ]; // check if it is a valid shortcut if (!array_key_exists($nsURI, $shortcuts)) { @@ -429,11 +431,10 @@ public static function isValid($xml, $schema) } if ($res) { - $config = \SimpleSAML_Configuration::getInstance(); + $config = \SimpleSAML\Configuration::getInstance(); /** @var string $schemaPath */ $schemaPath = $config->resolvePath('schemas'); - $schemaPath .= './'; - $schemaFile = $schemaPath.$schema; + $schemaFile = $schemaPath.'/'.$schema; $res = $dom->schemaValidate($schemaFile); if ($res) { diff --git a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/XHTML/EMail.php b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/XHTML/EMail.php index 335df2bf40..a9e239029b 100644 --- a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/XHTML/EMail.php +++ b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/XHTML/EMail.php @@ -1,40 +1,54 @@ <?php +namespace SimpleSAML\XHTML; + /** * A minimalistic Emailer class. Creates and sends HTML emails. * * @author Andreas kre Solberg, UNINETT AS. <andreas.solberg@uninett.no> * @package SimpleSAMLphp */ -class SimpleSAML_XHTML_EMail { - - - private $to = NULL; - private $cc = NULL; - private $body = NULL; - private $from = NULL; - private $replyto = NULL; - private $subject = NULL; - private $headers = array(); - - - /** - * Constructor - */ - function __construct($to, $subject, $from = NULL, $cc = NULL, $replyto = NULL) { - $this->to = $to; - $this->cc = $cc; - $this->from = $from; - $this->replyto = $replyto; - $this->subject = $subject; - } - - function setBody($body) { - $this->body = $body; - } - - private function getHTML($body) { - return '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + +class EMail +{ + private $to = null; + private $cc = null; + private $body = null; + private $from = null; + private $replyto = null; + private $subject = null; + private $headers = []; + + + /** + * Constructor + */ + public function __construct($to, $subject, $from = null, $cc = null, $replyto = null) + { + $this->to = $to; + $this->cc = $cc; + $this->from = $from; + $this->replyto = $replyto; + $this->subject = $subject; + } + + /* + * @param string $body + * @return void + */ + public function setBody($body) + { + $this->body = $body; + } + + + /* + * @param string $body + * @return string + */ + private function getHTML($body) + { + return '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> @@ -54,46 +68,58 @@ private function getHTML($body) { </head> <body> <div class="container" style="background: #fafafa; border: 1px solid #eee; margin: 2em; padding: .6em;"> -' . $body . ' +'.$body.' </div> </body> </html>'; - } - - function send() { - if ($this->to == NULL) throw new Exception('EMail field [to] is required and not set.'); - if ($this->subject == NULL) throw new Exception('EMail field [subject] is required and not set.'); - if ($this->body == NULL) throw new Exception('EMail field [body] is required and not set.'); - - $random_hash = bin2hex(openssl_random_pseudo_bytes(16)); - - if (isset($this->from)) - $this->headers[]= 'From: ' . $this->from; - if (isset($this->replyto)) - $this->headers[]= 'Reply-To: ' . $this->replyto; - - $this->headers[] = 'Content-Type: multipart/alternative; boundary="simplesamlphp-' . $random_hash . '"'; - - $message = ' ---simplesamlphp-' . $random_hash . ' + } + + + /* + * @return void + */ + public function send() + { + if ($this->to === null) { + throw new \Exception('EMail field [to] is required and not set.'); + } elseif ($this->subject === null) { + throw new \Exception('EMail field [subject] is required and not set.'); + } elseif ($this->body === null) { + throw new \Exception('EMail field [body] is required and not set.'); + } + + $random_hash = bin2hex(openssl_random_pseudo_bytes(16)); + + if (isset($this->from)) { + $this->headers[] = 'From: '.$this->from; + } + if (isset($this->replyto)) { + $this->headers[] = 'Reply-To: '.$this->replyto; + } + + $this->headers[] = 'Content-Type: multipart/alternative; boundary="simplesamlphp-'.$random_hash.'"'; + + $message = ' +--simplesamlphp-'.$random_hash.' Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit -' . strip_tags(html_entity_decode($this->body)) . ' +'.strip_tags(html_entity_decode($this->body)).' ---simplesamlphp-' . $random_hash . ' +--simplesamlphp-'.$random_hash.' Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: 8bit -' . $this->getHTML($this->body) . ' +'.$this->getHTML($this->body).' ---simplesamlphp-' . $random_hash . '-- +--simplesamlphp-'.$random_hash.'-- '; - $headers = implode("\n", $this->headers); - - $mail_sent = @mail($this->to, $this->subject, $message, $headers); - SimpleSAML\Logger::debug('Email: Sending e-mail to [' . $this->to . '] : ' . ($mail_sent ? 'OK' : 'Failed')); - if (!$mail_sent) throw new Exception('Error when sending e-mail'); - } + $headers = implode("\n", $this->headers); + $mail_sent = @mail($this->to, $this->subject, $message, $headers); + \SimpleSAML\Logger::debug('Email: Sending e-mail to ['.$this->to.'] : '.($mail_sent ? 'OK' : 'Failed')); + if (!$mail_sent) { + throw new \Exception('Error when sending e-mail'); + } + } } diff --git a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/XHTML/IdPDisco.php b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/XHTML/IdPDisco.php index 0afb74e071..8f835f3661 100644 --- a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/XHTML/IdPDisco.php +++ b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/XHTML/IdPDisco.php @@ -1,5 +1,6 @@ <?php +namespace SimpleSAML\XHTML; /** * This class implements a generic IdP discovery service, for use in various IdP @@ -13,13 +14,13 @@ * @author Andreas Åkre Solberg <andreas@uninett.no>, UNINETT AS. * @package SimpleSAMLphp */ -class SimpleSAML_XHTML_IdPDisco -{ +class IdPDisco +{ /** * An instance of the configuration class. * - * @var SimpleSAML_Configuration + * @var \SimpleSAML\Configuration */ protected $config; @@ -34,7 +35,7 @@ class SimpleSAML_XHTML_IdPDisco /** * An instance of the metadata handler, which will allow us to fetch metadata about IdPs. * - * @var SimpleSAML_Metadata_MetaDataStorageHandler + * @var \SimpleSAML\Metadata\MetaDataStorageHandler */ protected $metadata; @@ -42,7 +43,7 @@ class SimpleSAML_XHTML_IdPDisco /** * The users session. * - * @var SimpleSAML_Session + * @var \SimpleSAML\Session */ protected $session; @@ -93,7 +94,7 @@ class SimpleSAML_XHTML_IdPDisco * * @var array */ - protected $scopedIDPList = array(); + protected $scopedIDPList = []; /** * The URL the user should be redirected to after choosing an IdP. @@ -115,12 +116,12 @@ class SimpleSAML_XHTML_IdPDisco */ public function __construct(array $metadataSets, $instance) { - assert('is_string($instance)'); + assert(is_string($instance)); // initialize standard classes - $this->config = SimpleSAML_Configuration::getInstance(); - $this->metadata = SimpleSAML_Metadata_MetaDataStorageHandler::getMetadataHandler(); - $this->session = SimpleSAML_Session::getSessionFromRequest(); + $this->config = \SimpleSAML\Configuration::getInstance(); + $this->metadata = \SimpleSAML\Metadata\MetaDataStorageHandler::getMetadataHandler(); + $this->session = \SimpleSAML\Session::getSessionFromRequest(); $this->instance = $instance; $this->metadataSets = $metadataSets; @@ -128,7 +129,7 @@ public function __construct(array $metadataSets, $instance) // standard discovery service parameters if (!array_key_exists('entityID', $_GET)) { - throw new Exception('Missing parameter: entityID'); + throw new \Exception('Missing parameter: entityID'); } else { $this->spEntityId = $_GET['entityID']; } @@ -142,7 +143,7 @@ public function __construct(array $metadataSets, $instance) $this->log('returnIdParam initially set to ['.$this->returnIdParam.']'); if (!array_key_exists('return', $_GET)) { - throw new Exception('Missing parameter: return'); + throw new \Exception('Missing parameter: return'); } else { $this->returnURL = \SimpleSAML\Utils\HTTP::checkURLAllowed($_GET['return']); } @@ -175,7 +176,7 @@ public function __construct(array $metadataSets, $instance) */ protected function log($message) { - SimpleSAML\Logger::info('idpDisco.'.$this->instance.': '.$message); + \SimpleSAML\Logger::info('idpDisco.'.$this->instance.': '.$message); } @@ -213,13 +214,13 @@ protected function setCookie($name, $value) { $prefixedName = 'idpdisco_'.$this->instance.'_'.$name; - $params = array( + $params = [ // we save the cookies for 90 days 'lifetime' => (60 * 60 * 24 * 90), // the base path for cookies. This should be the installation directory for SimpleSAMLphp 'path' => $this->config->getBasePath(), 'httponly' => false, - ); + ]; \SimpleSAML\Utils\HTTP::setCookie($prefixedName, $value, $params, false); } @@ -249,7 +250,7 @@ protected function validateIdP($idp) try { $this->metadata->getMetaData($idp, $metadataSet); return $idp; - } catch (Exception $e) { + } catch (\Exception $e) { // continue } } @@ -266,7 +267,7 @@ protected function validateIdP($idp) * * This function finds out which IdP the user has manually chosen, if any. * - * @return string The entity id of the IdP the user has chosen, or null if the user has made no choice. + * @return string|null The entity id of the IdP the user has chosen, or null if the user has made no choice. */ protected function getSelectedIdP() { @@ -289,7 +290,7 @@ protected function getSelectedIdP() * back. Therefore we do some quick and dirty parsing of the query string. */ $qstr = $_SERVER['QUERY_STRING']; - $matches = array(); + $matches = []; if (preg_match('/(?:^|&)idp_([^=]+)=/', $qstr, $matches)) { return $this->validateIdP(urldecode($matches[1])); } @@ -388,7 +389,7 @@ protected function getRecommendedIdP() */ protected function setPreviousIdP($idp) { - assert('is_string($idp)'); + assert(is_string($idp)); $this->log('Choice made ['.$idp.'] Setting cookie.'); $this->setCookie('lastidp', $idp); @@ -458,7 +459,7 @@ protected function getTargetIdP() */ protected function getIdPList() { - $idpList = array(); + $idpList = []; foreach ($this->metadataSets as $metadataSet) { $newList = $this->metadata->getList($metadataSet); /* @@ -511,23 +512,23 @@ protected function filterList($list) */ protected function start() { - $idp = $this->getTargetIdp(); + $idp = $this->getTargetIdP(); if ($idp !== null) { $extDiscoveryStorage = $this->config->getString('idpdisco.extDiscoveryStorage', null); if ($extDiscoveryStorage !== null) { $this->log('Choice made ['.$idp.'] (Forwarding to external discovery storage)'); - \SimpleSAML\Utils\HTTP::redirectTrustedURL($extDiscoveryStorage, array( + \SimpleSAML\Utils\HTTP::redirectTrustedURL($extDiscoveryStorage, [ 'entityID' => $this->spEntityId, 'IdPentityID' => $idp, 'returnIDParam' => $this->returnIdParam, 'isPassive' => 'true', 'return' => $this->returnURL - )); + ]); } else { $this->log( 'Choice made ['.$idp.'] (Redirecting the user back. returnIDParam='.$this->returnIdParam.')' ); - \SimpleSAML\Utils\HTTP::redirectTrustedURL($this->returnURL, array($this->returnIdParam => $idp)); + \SimpleSAML\Utils\HTTP::redirectTrustedURL($this->returnURL, [$this->returnIdParam => $idp]); } } @@ -566,7 +567,7 @@ public function handleRequest() ); \SimpleSAML\Utils\HTTP::redirectTrustedURL( $this->returnURL, - array($this->returnIdParam => $idpintersection[0]) + [$this->returnIdParam => $idpintersection[0]] ); } @@ -582,11 +583,48 @@ public function handleRequest() $templateFile = 'selectidp-links.php'; break; default: - throw new Exception('Invalid value for the \'idpdisco.layout\' option.'); + throw new \Exception('Invalid value for the \'idpdisco.layout\' option.'); + } + + $t = new Template($this->config, $templateFile, 'disco'); + + $fallbackLanguage = 'en'; + $defaultLanguage = $this->config->getString('language.default', $fallbackLanguage); + $translator = $t->getTranslator(); + $language = $translator->getLanguage()->getLanguage(); + $tryLanguages = [0 => $language, 1 => $defaultLanguage, 2 => $fallbackLanguage]; + + $newlist = []; + foreach ($idpList as $entityid => $data) { + $newlist[$entityid]['entityid'] = $entityid; + foreach ($tryLanguages as $lang) { + if ($name = $this->getEntityDisplayName($data, $lang)) { + $newlist[$entityid]['name'] = $name; + continue; + } + } + if (empty($newlist[$entityid]['name'])) { + $newlist[$entityid]['name'] = $entityid; + } + foreach ($tryLanguages as $lang) { + if (!empty($data['description'][$lang])) { + $newlist[$entityid]['description'] = $data['description'][$lang]; + continue; + } + } + if (!empty($data['icon'])) { + $newlist[$entityid]['icon'] = $data['icon']; + $newlist[$entityid]['iconurl'] = \SimpleSAML\Utils\HTTP::resolveURL($data['icon']); + } } + usort( + $newlist, + function ($idpentry1, $idpentry2) { + return strcasecmp($idpentry1['name'], $idpentry2['name']); + } + ); - $t = new SimpleSAML_XHTML_Template($this->config, $templateFile, 'disco'); - $t->data['idplist'] = $idpList; + $t->data['idplist'] = $newlist; $t->data['preferredidp'] = $preferredIdP; $t->data['return'] = $this->returnURL; $t->data['returnIDParam'] = $this->returnIdParam; @@ -595,4 +633,16 @@ public function handleRequest() $t->data['rememberenabled'] = $this->config->getBoolean('idpdisco.enableremember', false); $t->show(); } + + private function getEntityDisplayName(array $idpData, $language) + { + if (isset($idpData['UIInfo']['DisplayName'][$language])) { + return $idpData['UIInfo']['DisplayName'][$language]; + } elseif (isset($idpData['name'][$language])) { + return $idpData['name'][$language]; + } elseif (isset($idpData['OrganizationDisplayName'][$language])) { + return $idpData['OrganizationDisplayName'][$language]; + } + return null; + } } diff --git a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/XHTML/Template.php b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/XHTML/Template.php index 3bd52fdc90..43127d9a0d 100644 --- a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/XHTML/Template.php +++ b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/XHTML/Template.php @@ -1,5 +1,6 @@ <?php +namespace SimpleSAML\XHTML; /** * A minimalistic XHTML PHP based template system implemented for SimpleSAMLphp. @@ -8,20 +9,19 @@ * @package SimpleSAMLphp */ - use JaimePerez\TwigConfigurableI18n\Twig\Environment as Twig_Environment; use JaimePerez\TwigConfigurableI18n\Twig\Extensions\Extension\I18n as Twig_Extensions_Extension_I18n; +use Symfony\Component\HttpFoundation\Response; +use SimpleSAML\Locale\Localization; - -class SimpleSAML_XHTML_Template +class Template extends Response { - /** * The data associated with this template, accessible within the template itself. * * @var array */ - public $data = array(); + public $data = []; /** * A translator instance configured to work with this template. @@ -40,7 +40,7 @@ class SimpleSAML_XHTML_Template /** * The configuration to use in this template. * - * @var SimpleSAML_Configuration + * @var \SimpleSAML\Configuration */ private $configuration; @@ -56,7 +56,7 @@ class SimpleSAML_XHTML_Template * * @var false|Twig_Environment */ - private $twig; + private $twig = false; /** * The template name. @@ -70,14 +70,22 @@ class SimpleSAML_XHTML_Template */ private $module; + /** + * Whether to use the new user interface or not. + * + * @var bool + */ + private $useNewUI; + + /** * A template controller, if any. * * Used to intercept certain parts of the template handling, while keeping away unwanted/unexpected hooks. Set * the 'theme.controller' configuration option to a class that implements the - * SimpleSAML\XHTML\TemplateControllerInterface interface to use it. + * \SimpleSAML\XHTML\TemplateControllerInterface interface to use it. * - * @var SimpleSAML\XHTML\TemplateControllerInterface + * @var \SimpleSAML\XHTML\TemplateControllerInterface */ private $controller; @@ -86,21 +94,21 @@ class SimpleSAML_XHTML_Template * Whether we are using a non-default theme or not. * * If we are using a theme, this variable holds an array with two keys: "module" and "name", those being the name - * of the module and the name of the theme, respectively. If we are using the default theme, the variable defaults - * to false. + * of the module and the name of the theme, respectively. If we are using the default theme, the variable has + * the 'default' string in the "name" key, and 'null' in the "module" key. * - * @var bool|array + * @var array */ private $theme; /** * Constructor * - * @param SimpleSAML_Configuration $configuration Configuration object + * @param \SimpleSAML\Configuration $configuration Configuration object * @param string $template Which template file to load * @param string|null $defaultDictionary The default dictionary where tags will come from. */ - public function __construct(\SimpleSAML_Configuration $configuration, $template, $defaultDictionary = null) + public function __construct(\SimpleSAML\Configuration $configuration, $template, $defaultDictionary = null) { $this->configuration = $configuration; $this->template = $template; @@ -111,23 +119,64 @@ public function __construct(\SimpleSAML_Configuration $configuration, $template, list($this->module) = $this->findModuleAndTemplateName($template); // parse config to find theme and module theme is in, if any - list($this->theme['module'], $this->theme['name']) = self::findModuleAndTemplateName( + list($this->theme['module'], $this->theme['name']) = $this->findModuleAndTemplateName( $this->configuration->getString('theme.use', 'default') ); // initialize internationalization system - $this->translator = new SimpleSAML\Locale\Translate($configuration, $defaultDictionary); + $this->translator = new \SimpleSAML\Locale\Translate($configuration, $defaultDictionary); $this->localization = new \SimpleSAML\Locale\Localization($configuration); - // check if we need to attach a theme controller - $controller = $this->configuration->getString('theme.controller', false); - if ($controller && class_exists($controller) && - class_implements($controller, '\SimpleSAML\XHTML\TemplateControllerInterface') - ) { - $this->controller = new $controller(); + // check if we are supposed to use the new UI + $this->useNewUI = $this->configuration->getBoolean('usenewui', false); + + if ($this->useNewUI) { + // check if we need to attach a theme controller + $controller = $this->configuration->getString('theme.controller', false); + if ($controller && class_exists($controller) && + in_array('SimpleSAML\XHTML\TemplateControllerInterface', class_implements($controller)) + ) { + $this->controller = new $controller(); + } + + $this->twig = $this->setupTwig(); } + parent::__construct(); + } + - $this->twig = $this->setupTwig(); + /** + * Return the URL of an asset, including a cache-buster parameter that depends on the last modification time of + * the original file. + * + * @param string $asset + * @return string + */ + public function asset($asset) + { + $file = $this->configuration->getBaseDir().'www/assets/'.$asset; + if (!file_exists($file)) { + // don't be too harsh if an asset is missing, just pretend it's there... + return $this->configuration->getBasePath().'assets/'.$asset; + } + + $tag = $this->configuration->getVersion(); + if ($tag === 'master') { + $tag = filemtime($file); + } + $tag = substr(hash('md5', $tag), 0, 5); + return $this->configuration->getBasePath().'assets/'.$asset.'?tag='.$tag; + } + + + /** + * Get the normalized template name. + * + * @return string The name of the template to use. + */ + public function getTemplateName() + { + return $this->normalizeTemplateName($this->template); } @@ -150,40 +199,48 @@ private function normalizeTemplateName($templateName) if ($tplpos) { $templateName = substr($templateName, 0, $tplpos); } - return $templateName.'.twig'; + + if ($this->useNewUI || $this->theme['module'] !== null) { + return $templateName.'.twig'; + } + return $templateName; } /** * Set up the places where twig can look for templates. * - * @return Twig_Loader_Filesystem|false The twig template loader or false if the template does not exist. - * @throws Twig_Error_Loader In case a failure occurs. + * @return TemplateLoader The twig template loader or false if the template does not exist. + * @throws \Twig_Error_Loader In case a failure occurs. */ private function setupTwigTemplatepaths() { $filename = $this->normalizeTemplateName($this->template); // get namespace if any - list($namespace, $filename) = self::findModuleAndTemplateName($filename); + list($namespace, $filename) = $this->findModuleAndTemplateName($filename); $this->twig_template = ($namespace !== null) ? '@'.$namespace.'/'.$filename : $filename; - $loader = new \Twig_Loader_Filesystem(); + $loader = new TemplateLoader(); $templateDirs = $this->findThemeTemplateDirs(); - if ($this->module) { - $templateDirs[] = array($this->module => $this->getModuleTemplateDir($this->module)); + if ($this->module && $this->module != 'core') { + $templateDirs[] = [$this->module => TemplateLoader::getModuleTemplateDir($this->module)]; } if ($this->theme['module']) { try { - $templateDirs[] = array($this->theme['module'] => $this->getModuleTemplateDir($this->theme['module'])); + $templateDirs[] = [ + $this->theme['module'] => TemplateLoader::getModuleTemplateDir($this->theme['module']) + ]; } catch (\InvalidArgumentException $e) { // either the module is not enabled or it has no "templates" directory, ignore } } + $templateDirs[] = ['core' => TemplateLoader::getModuleTemplateDir('core')]; + // default, themeless templates are checked last - $templateDirs[] = array( + $templateDirs[] = [ \Twig_Loader_Filesystem::MAIN_NAMESPACE => $this->configuration->resolvePath('templates') - ); + ]; foreach ($templateDirs as $entry) { $loader->addPath($entry[key($entry)], key($entry)); } @@ -213,21 +270,13 @@ private function setupTwig() $this->localization->addModuleDomain($this->theme['module']); } - $options = array( + // set up translation + $options = [ 'cache' => $cache, 'auto_reload' => $auto_reload, - 'translation_function' => array('\SimpleSAML\Locale\Translate', 'translateSingularNativeGettext'), - 'translation_function_plural' => array('\SimpleSAML\Locale\Translate', 'translatePluralNativeGettext'), - ); - - // set up translation - if ($this->localization->i18nBackend === \SimpleSAML\Locale\Localization::GETTEXT_I18N_BACKEND) { - $options['translation_function'] = array('\SimpleSAML\Locale\Translate', 'translateSingularGettext'); - $options['translation_function_plural'] = array( - '\SimpleSAML\Locale\Translate', - 'translatePluralGettext' - ); - } // TODO: add a branch for the old SimpleSAMLphp backend + 'translation_function' => ['\SimpleSAML\Locale\Translate', 'translateSingularGettext'], + 'translation_function_plural' => ['\SimpleSAML\Locale\Translate', 'translatePluralGettext'], + ]; $twig = new Twig_Environment($loader, $options); $twig->addExtension(new Twig_Extensions_Extension_I18n()); @@ -235,7 +284,7 @@ private function setupTwig() // initialize some basic context $langParam = $this->configuration->getString('language.parameter.name', 'language'); $twig->addGlobal('languageParameterName', $langParam); - $twig->addGlobal('localeBackend', $this->configuration->getString('language.i18n.backend', 'SimpleSAMLphp')); + $twig->addGlobal('localeBackend', Localization::GETTEXT_I18N_BACKEND); $twig->addGlobal('currentLanguage', $this->translator->getLanguage()->getLanguage()); $twig->addGlobal('isRTL', false); // language RTL configuration if ($this->translator->getLanguage()->isLanguageRTL()) { @@ -247,6 +296,19 @@ private function setupTwig() } $twig->addGlobal('queryParams', $queryParams); $twig->addGlobal('templateId', str_replace('.twig', '', $this->normalizeTemplateName($this->template))); + $twig->addGlobal('isProduction', $this->configuration->getBoolean('production', true)); + + // add a filter for translations out of arrays + $twig->addFilter( + new \Twig_SimpleFilter( + 'translateFromArray', + ['\SimpleSAML\Locale\Translate', 'translateFromArray'], + ['needs_context' => true] + ) + ); + + // add an asset() function + $twig->addFunction(new \Twig_SimpleFunction('asset', [$this, 'asset'])); if ($this->controller) { $this->controller->setUpTwig($twig); @@ -262,20 +324,22 @@ private function setupTwig() */ private function findThemeTemplateDirs() { - if ($this->theme['module'] === null) { // no module involved - return array(); + if ($this->theme['module'] === null) { + // no module involved + return []; } // setup directories & namespaces $themeDir = \SimpleSAML\Module::getModuleDir($this->theme['module']).'/themes/'.$this->theme['name']; $subdirs = scandir($themeDir); - if (!$subdirs) { // no subdirectories in the theme directory, nothing to do here + if (empty($subdirs)) { + // no subdirectories in the theme directory, nothing to do here // this is probably wrong, log a message - \SimpleSAML\Logger::warning('Emtpy theme directory for theme "'.$this->theme['name'].'".'); - return array(); + \SimpleSAML\Logger::warning('Empty theme directory for theme "'.$this->theme['name'].'".'); + return []; } - $themeTemplateDirs = array(); + $themeTemplateDirs = []; foreach ($subdirs as $entry) { // discard anything that's not a directory. Expression is negated to profit from lazy evaluation if (!($entry !== '.' && $entry !== '..' && is_dir($themeDir.'/'.$entry))) { @@ -284,29 +348,29 @@ private function findThemeTemplateDirs() // set correct name for the default namespace $ns = ($entry === 'default') ? \Twig_Loader_Filesystem::MAIN_NAMESPACE : $entry; - $themeTemplateDirs[] = array($ns => $themeDir.'/'.$entry); + $themeTemplateDirs[] = [$ns => $themeDir.'/'.$entry]; } return $themeTemplateDirs; } + /** * Get the template directory of a module, if it exists. * - * @return string The templates directory of a module. + * @return string The templates directory of a module * - * @throws InvalidArgumentException If the module is not enabled or it has no templates directory. + * @throws \InvalidArgumentException If the module is not enabled or it has no templates directory. */ private function getModuleTemplateDir($module) { if (!\SimpleSAML\Module::isModuleEnabled($module)) { - throw new InvalidArgumentException('The module \''.$module.'\' is not enabled.'); + throw new \InvalidArgumentException('The module \''.$module.'\' is not enabled.'); } $moduledir = \SimpleSAML\Module::getModuleDir($module); // check if module has a /templates dir, if so, append $templatedir = $moduledir.'/templates'; if (!is_dir($templatedir)) { - throw new InvalidArgumentException('The module \''.$module.'\' has no templates directory.'); - + throw new \InvalidArgumentException('The module \''.$module.'\' has no templates directory.'); } return $templatedir; } @@ -319,12 +383,12 @@ private function getModuleTemplateDir($module) * * @param string $module The module where we need to search for templates. * - * @throws InvalidArgumentException If the module is not enabled or it has no templates directory. + * @throws \InvalidArgumentException If the module is not enabled or it has no templates directory. */ public function addTemplatesFromModule($module) { - $dir = $this->getModuleTemplateDir($module); - /** @var Twig_Loader_Filesystem $loader */ + $dir = TemplateLoader::getModuleTemplateDir($module); + /** @var \Twig_Loader_Filesystem $loader */ $loader = $this->twig->getLoader(); $loader->addPath($dir, $module); } @@ -339,10 +403,11 @@ public function addTemplatesFromModule($module) private function generateLanguageBar() { $languages = $this->translator->getLanguage()->getLanguageList(); + ksort($languages); $langmap = null; if (count($languages) > 1) { $parameterName = $this->getTranslator()->getLanguage()->getLanguageParameterName(); - $langmap = array(); + $langmap = []; foreach ($languages as $lang => $current) { $lang = strtolower($lang); $langname = $this->translator->getLanguage()->getLanguageLocalizedName($lang); @@ -350,13 +415,13 @@ private function generateLanguageBar() if (!$current) { $url = htmlspecialchars(\SimpleSAML\Utils\HTTP::addURLParameters( '', - array($parameterName => $lang) + [$parameterName => $lang] )); } - $langmap[$lang] = array( + $langmap[$lang] = [ 'name' => $langname, 'url' => $url, - ); + ]; } } return $langmap; @@ -390,23 +455,56 @@ private function twigDefaultContext() if (!isset($this->data['pagetitle'])) { $this->data['pagetitle'] = 'SimpleSAMLphp'; } + + $this->data['year'] = date('Y'); + + $this->data['header'] = $this->configuration->getValue('theme.header', 'SimpleSAMLphp'); + } + + + /** + * Get the contents produced by this template. + * + * @return string The HTML rendered by this template, as a string. + * @throws \Exception if the template cannot be found. + */ + protected function getContents() + { + $this->twigDefaultContext(); + if ($this->controller) { + $this->controller->display($this->data); + } + return $this->twig->render($this->twig_template, $this->data); + } + + + /** + * Send this template as a response. + * + * @return Response This response. + * @throws \Exception if the template cannot be found. + */ + public function send() + { + $this->content = $this->getContents(); + return parent::send(); } /** * Show the template to the user. + * + * This method is a remnant of the old templating system, where templates where shown manually instead of + * returning a response. + * + * @deprecated Do not use this method, use Twig + send() instead. Will be removed in 2.0 */ public function show() { if ($this->twig !== false) { - $this->twigDefaultContext(); - if ($this->controller) { - $this->controller->display($this->data); - } - echo $this->twig->render($this->twig_template, $this->data); + echo $this->getContents(); } else { - $filename = $this->findTemplatePath($this->template); - require($filename); + require($this->findTemplatePath($this->template)); } } @@ -421,7 +519,7 @@ public function show() private function findModuleAndTemplateName($template) { $tmp = explode(':', $template, 2); - return (count($tmp) === 2) ? array($tmp[0], $tmp[1]) : array(null, $tmp[0]); + return (count($tmp) === 2) ? [$tmp[0], $tmp[1]] : [null, $tmp[0]]; } @@ -438,11 +536,11 @@ private function findModuleAndTemplateName($template) * * @return string The absolute path to the template file. * - * @throws Exception If the template file couldn't be found. + * @throws \Exception If the template file couldn't be found. */ private function findTemplatePath($template, $throw_exception = true) { - assert('is_string($template)'); + assert(is_string($template)); list($templateModule, $templateName) = $this->findModuleAndTemplateName($template); $templateModule = ($templateModule !== null) ? $templateModule : 'default'; @@ -490,7 +588,7 @@ private function findTemplatePath($template, $throw_exception = true) $error = 'Template: Could not find template file ['.$template.'] at ['.$filename.']'; \SimpleSAML\Logger::critical($_SERVER['PHP_SELF'].' - '.$error); - throw new Exception($error); + throw new \Exception($error); } else { // missing template expected, return NULL return null; @@ -509,6 +607,17 @@ public function getTranslator() } + /** + * Return the internal localization object used by this template. + * + * @return \SimpleSAML\Locale\Localization The localization object that will be used with this template. + */ + public function getLocalization() + { + return $this->localization; + } + + /** * Get the current instance of Twig in use. * @@ -647,8 +756,8 @@ public function includeInlineTranslation($tag, $translation) /** - * @param $file - * @param null $otherConfig + * @param string $file + * @param \SimpleSAML\Configuration|null $otherConfig * * @deprecated This method will be removed in SSP 2.0. Please use * \SimpleSAML\Locale\Translate::includeLanguageFile() instead. @@ -694,7 +803,7 @@ public static function lang_merge($def, $lang) * @see \SimpleSAML\Locale\Translate::noop() * @deprecated This method will be removed in SSP 2.0. Please use \SimpleSAML\Locale\Translate::noop() instead. */ - static public function noop($tag) + public static function noop($tag) { return $tag; } @@ -708,9 +817,9 @@ static public function noop($tag) */ public function t( $tag, - $replacements = array(), + $replacements = [], $fallbackdefault = true, - $oldreplacements = array(), + $oldreplacements = [], $striptags = false ) { return $this->translator->t($tag, $replacements, $fallbackdefault, $oldreplacements, $striptags); diff --git a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/XHTML/TemplateControllerInterface.php b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/XHTML/TemplateControllerInterface.php index bd54907c48..8d6f4e733e 100644 --- a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/XHTML/TemplateControllerInterface.php +++ b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/XHTML/TemplateControllerInterface.php @@ -7,7 +7,8 @@ * * @package SimpleSAMLphp */ -interface TemplateControllerInterface { +interface TemplateControllerInterface +{ /** * Implement to modify the twig environment after its initialization (e.g. add filters or extensions). diff --git a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/XHTML/TemplateLoader.php b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/XHTML/TemplateLoader.php new file mode 100644 index 0000000000..c5090d5544 --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/XHTML/TemplateLoader.php @@ -0,0 +1,72 @@ +<?php + + +namespace SimpleSAML\XHTML; + +/** + * This class extends the Twig\Loader\FilesystemLoader so that we can load templates from modules in twig, even + * when the main template is not part of a module (or the same one). + * + * @package simplesamlphp/simplesamlphp + */ +class TemplateLoader extends \Twig\Loader\FilesystemLoader +{ + /** + * This method adds a namespace dynamically so that we can load templates from modules whenever we want. + * + * @inheritdoc + */ + protected function findTemplate($name, $throw = true) + { + list($namespace, $shortname) = $this->parseModuleName($name); + if (!in_array($namespace, $this->paths, true) && $namespace !== self::MAIN_NAMESPACE) { + $this->addPath(self::getModuleTemplateDir($namespace), $namespace); + } + return parent::findTemplate($name, $throw); + } + + + /** + * Parse the name of a template in a module. + * + * @param string $name The full name of the template, including namespace and template name / path. + * + * @return array An array with the corresponding namespace and name of the template. The namespace defaults to + * \Twig\Loader\FilesystemLoader::MAIN_NAMESPACE, if none was specified in $name. + */ + protected function parseModuleName($name, $default = self::MAIN_NAMESPACE) + { + if (strpos($name, ':')) { + // we have our old SSP format + list($namespace, $shortname) = explode(':', $name, 2); + $shortname = strtr($shortname, [ + '.tpl.php' => '.twig', + '.php' => '.twig', + ]); + return [$namespace, $shortname]; + } + return [$default, $name]; + } + + + /** + * Get the template directory of a module, if it exists. + * + * @return string The templates directory of a module. + * + * @throws \InvalidArgumentException If the module is not enabled or it has no templates directory. + */ + public static function getModuleTemplateDir($module) + { + if (!\SimpleSAML\Module::isModuleEnabled($module)) { + throw new \InvalidArgumentException('The module \''.$module.'\' is not enabled.'); + } + $moduledir = \SimpleSAML\Module::getModuleDir($module); + // check if module has a /templates dir, if so, append + $templatedir = $moduledir.'/templates'; + if (!is_dir($templatedir)) { + throw new \InvalidArgumentException('The module \''.$module.'\' has no templates directory.'); + } + return $templatedir; + } +} diff --git a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/XML/Errors.php b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/XML/Errors.php index 201c56f269..6f6d228ef3 100644 --- a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/XML/Errors.php +++ b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/XML/Errors.php @@ -12,13 +12,14 @@ namespace SimpleSAML\XML; +use LibXMLError; + class Errors { - /** * @var array This is an stack of error logs. The topmost element is the one we are currently working on. */ - private static $errorStack = array(); + private static $errorStack = []; /** * @var bool This is the xml error state we had before we began logging. @@ -65,7 +66,7 @@ public static function begin() } // Add a new level to the error stack - self::$errorStack[] = array(); + self::$errorStack[] = []; } @@ -80,7 +81,7 @@ public static function end() // Check whether the error access functions are present if (!function_exists('libxml_use_internal_errors')) { // Pretend that no errors occurred - return array(); + return []; } // Add any errors which may have occurred @@ -108,9 +109,9 @@ public static function end() */ public static function formatError($error) { - assert('$error instanceof LibXMLError'); - return 'level=' . $error->level . ',code=' . $error->code . ',line=' . $error->line . ',col=' . $error->column . - ',msg=' . trim($error->message); + assert($error instanceof LibXMLError); + return 'level='.$error->level.',code='.$error->code.',line='.$error->line.',col='.$error->column. + ',msg='.trim($error->message); } @@ -126,11 +127,11 @@ public static function formatError($error) */ public static function formatErrors($errors) { - assert('is_array($errors)'); + assert(is_array($errors)); $ret = ''; foreach ($errors as $error) { - $ret .= self::formatError($error) . "\n"; + $ret .= self::formatError($error)."\n"; } return $ret; diff --git a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/XML/Parser.php b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/XML/Parser.php index b43fe49a76..39287b2cb9 100644 --- a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/XML/Parser.php +++ b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/XML/Parser.php @@ -28,7 +28,7 @@ public static function fromSimpleXMLElement(\SimpleXMLElement $element) // Traverse all existing namespaces in element $namespaces = $element->getNamespaces(); foreach ($namespaces as $prefix => $ns) { - $element[(($prefix === '') ? 'xmlns' : 'xmlns:' . $prefix)] = $ns; + $element[(($prefix === '') ? 'xmlns' : 'xmlns:'.$prefix)] = $ns; } /* Create a new parser with the xml document where the namespace definitions @@ -50,9 +50,11 @@ public function getValueDefault($xpath, $defvalue) public function getValue($xpath, $required = false) { $result = $this->simplexml->xpath($xpath); - if (! $result or !is_array($result)) { + if (!is_array($result) || empty($result)) { if ($required) { - throw new \Exception('Could not get value from XML document using the following XPath expression: ' . $xpath); + throw new \Exception( + 'Could not get value from XML document using the following XPath expression: '.$xpath + ); } else { return null; } @@ -69,7 +71,9 @@ public function getValueAlternatives(array $xpath, $required = false) } } if ($required) { - throw new \Exception('Could not get value from XML document using multiple alternative XPath expressions.'); + throw new \Exception( + 'Could not get value from XML document using multiple alternative XPath expressions.' + ); } else { return null; } diff --git a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/XML/Shib13/AuthnRequest.php b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/XML/Shib13/AuthnRequest.php index f52fea212c..221951d9b7 100644 --- a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/XML/Shib13/AuthnRequest.php +++ b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/XML/Shib13/AuthnRequest.php @@ -36,18 +36,21 @@ public function getIssuer() public function createRedirect($destination, $shire) { - $metadata = \SimpleSAML_Metadata_MetaDataStorageHandler::getMetadataHandler(); + $metadata = \SimpleSAML\Metadata\MetaDataStorageHandler::getMetadataHandler(); $idpmetadata = $metadata->getMetaDataConfig($destination, 'shib13-idp-remote'); - $desturl = $idpmetadata->getDefaultEndpoint('SingleSignOnService', array('urn:mace:shibboleth:1.0:profiles:AuthnRequest')); + $desturl = $idpmetadata->getDefaultEndpoint( + 'SingleSignOnService', + ['urn:mace:shibboleth:1.0:profiles:AuthnRequest'] + ); $desturl = $desturl['Location']; $target = $this->getRelayState(); - $url = $desturl . '?' . - 'providerId=' . urlencode($this->getIssuer()) . - '&shire=' . urlencode($shire) . - (isset($target) ? '&target=' . urlencode($target) : ''); + $url = $desturl.'?'. + 'providerId='.urlencode($this->getIssuer()). + '&shire='.urlencode($shire). + (isset($target) ? '&target='.urlencode($target) : ''); return $url; } } diff --git a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/XML/Shib13/AuthnResponse.php b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/XML/Shib13/AuthnResponse.php index b023fa4192..8b6c1fb6e3 100644 --- a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/XML/Shib13/AuthnResponse.php +++ b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/XML/Shib13/AuthnResponse.php @@ -9,6 +9,8 @@ namespace SimpleSAML\XML\Shib13; +use DOMDocument; +use DOMNode; use SAML2\DOMDocumentFactory; use SAML2\Utils; use SimpleSAML\Utils\Config; @@ -18,7 +20,6 @@ class AuthnResponse { - /** * @var \SimpleSAML\XML\Validator This variable contains an XML validator for this message. */ @@ -53,7 +54,7 @@ class AuthnResponse */ public function setMessageValidated($messageValidated) { - assert('is_bool($messageValidated)'); + assert(is_bool($messageValidated)); $this->messageValidated = $messageValidated; } @@ -61,7 +62,7 @@ public function setMessageValidated($messageValidated) public function setXML($xml) { - assert('is_string($xml)'); + assert(is_string($xml)); try { $this->dom = DOMDocumentFactory::fromString(str_replace("\r", "", $xml)); @@ -82,7 +83,7 @@ public function getRelayState() public function validate() { - assert('$this->dom instanceof DOMDocument'); + assert($this->dom instanceof DOMDocument); if ($this->messageValidated) { // This message was validated externally @@ -90,18 +91,18 @@ public function validate() } // Validate the signature - $this->validator = new Validator($this->dom, array('ResponseID', 'AssertionID')); + $this->validator = new Validator($this->dom, ['ResponseID', 'AssertionID']); // Get the issuer of the response $issuer = $this->getIssuer(); // Get the metadata of the issuer - $metadata = \SimpleSAML_Metadata_MetaDataStorageHandler::getMetadataHandler(); + $metadata = \SimpleSAML\Metadata\MetaDataStorageHandler::getMetadataHandler(); $md = $metadata->getMetaDataConfig($issuer, 'shib13-idp-remote'); $publicKeys = $md->getPublicKeys('signing'); - if ($publicKeys !== null) { - $certFingerprints = array(); + if (!empty($publicKeys)) { + $certFingerprints = []; foreach ($publicKeys as $key) { if ($key['type'] !== 'X509Certificate') { continue; @@ -118,7 +119,9 @@ public function validate() // Validate against CA $this->validator->validateCA(Config::getCertPath($md->getString('caFile'))); } else { - throw new \SimpleSAML_Error_Exception('Missing certificate in Shibboleth 1.3 IdP Remote metadata for identity provider [' . $issuer . '].'); + throw new \SimpleSAML\Error\Exception( + 'Missing certificate in Shibboleth 1.3 IdP Remote metadata for identity provider ['.$issuer.'].' + ); } return true; @@ -147,7 +150,7 @@ private function isNodeValidated($node) $node = dom_import_simplexml($node); } - assert('$node instanceof DOMNode'); + assert($node instanceof \DOMNode); return $this->validator->isNodeValidated($node); } @@ -163,14 +166,14 @@ private function isNodeValidated($node) */ private function doXPathQuery($query, $node = null) { - assert('is_string($query)'); - assert('$this->dom instanceof DOMDocument'); + assert(is_string($query)); + assert($this->dom instanceof \DOMDocument); if ($node === null) { $node = $this->dom->documentElement; } - assert('$node instanceof DOMNode'); + assert($node instanceof \DOMNode); $xPath = new \DOMXpath($this->dom); $xPath->registerNamespace('shibp', self::SHIB_PROTOCOL_NS); @@ -186,7 +189,7 @@ private function doXPathQuery($query, $node = null) */ public function getSessionIndex() { - assert('$this->dom instanceof DOMDocument'); + assert($this->dom instanceof DOMDocument); $query = '/shibp:Response/shib:Assertion/shib:AuthnStatement'; $nodelist = $this->doXPathQuery($query); @@ -200,15 +203,15 @@ public function getSessionIndex() public function getAttributes() { - $metadata = \SimpleSAML_Metadata_MetaDataStorageHandler::getMetadataHandler(); - $md = $metadata->getMetadata($this->getIssuer(), 'shib13-idp-remote'); + $metadata = \SimpleSAML\Metadata\MetaDataStorageHandler::getMetadataHandler(); + $md = $metadata->getMetaData($this->getIssuer(), 'shib13-idp-remote'); $base64 = isset($md['base64attributes']) ? $md['base64attributes'] : false; - if (! ($this->dom instanceof \DOMDocument)) { - return array(); + if (!($this->dom instanceof \DOMDocument)) { + return []; } - $attributes = array(); + $attributes = []; $assertions = $this->doXPathQuery('/shibp:Response/shib:Assertion'); @@ -226,20 +229,23 @@ public function getAttributes() if ($start && $end) { if (!self::checkDateConditions($start, $end)) { - error_log('Date check failed ... (from ' . $start . ' to ' . $end . ')'); + error_log('Date check failed ... (from '.$start.' to '.$end.')'); continue; } } } - $attribute_nodes = $this->doXPathQuery('shib:AttributeStatement/shib:Attribute/shib:AttributeValue', $assertion); + $attribute_nodes = $this->doXPathQuery( + 'shib:AttributeStatement/shib:Attribute/shib:AttributeValue', + $assertion + ); /** @var \DOMElement $attribute */ foreach ($attribute_nodes as $attribute) { $value = $attribute->textContent; $name = $attribute->parentNode->getAttribute('AttributeName'); if ($attribute->hasAttribute('Scope')) { - $scopePart = '@' . $attribute->getAttribute('Scope'); + $scopePart = '@'.$attribute->getAttribute('Scope'); } else { $scopePart = ''; } @@ -249,16 +255,16 @@ public function getAttributes() } if (!array_key_exists($name, $attributes)) { - $attributes[$name] = array(); + $attributes[$name] = []; } if ($base64) { $encodedvalues = explode('_', $value); foreach ($encodedvalues as $v) { - $attributes[$name][] = base64_decode($v) . $scopePart; + $attributes[$name][] = base64_decode($v).$scopePart; } } else { - $attributes[$name][] = $value . $scopePart; + $attributes[$name][] = $value.$scopePart; } } } @@ -281,7 +287,7 @@ public function getIssuer() public function getNameID() { - $nameID = array(); + $nameID = []; $query = '/shibp:Response/shib:Assertion/shib:AuthenticationStatement/shib:Subject/shib:NameIdentifier'; $nodelist = $this->doXPathQuery($query); @@ -298,23 +304,23 @@ public function getNameID() /** * Build a authentication response. * - * @param \SimpleSAML_Configuration $idp Metadata for the IdP the response is sent from. - * @param \SimpleSAML_Configuration $sp Metadata for the SP the response is sent to. + * @param \SimpleSAML\Configuration $idp Metadata for the IdP the response is sent from. + * @param \SimpleSAML\Configuration $sp Metadata for the SP the response is sent to. * @param string $shire The endpoint on the SP the response is sent to. * @param array|null $attributes The attributes which should be included in the response. * @return string The response. */ - public function generate(\SimpleSAML_Configuration $idp, \SimpleSAML_Configuration $sp, $shire, $attributes) + public function generate(\SimpleSAML\Configuration $idp, \SimpleSAML\Configuration $sp, $shire, $attributes) { - assert('is_string($shire)'); - assert('$attributes === NULL || is_array($attributes)'); + assert(is_string($shire)); + assert($attributes === null || is_array($attributes)); if ($sp->hasValue('scopedattributes')) { $scopedAttributes = $sp->getArray('scopedattributes'); } elseif ($idp->hasValue('scopedattributes')) { $scopedAttributes = $idp->getArray('scopedattributes'); } else { - $scopedAttributes = array(); + $scopedAttributes = []; } $id = Random::generateID(); @@ -325,7 +331,7 @@ public function generate(\SimpleSAML_Configuration $idp, \SimpleSAML_Configurati $notBefore = Time::generateTimestamp(time() - 30); - $assertionExpire = Time::generateTimestamp(time() + 60 * 5);# 5 minutes + $assertionExpire = Time::generateTimestamp(time() + 300); // 5 minutes $assertionid = Random::generateID(); $spEntityId = $sp->getString('entityid'); @@ -336,18 +342,18 @@ public function generate(\SimpleSAML_Configuration $idp, \SimpleSAML_Configurati $namequalifier = $sp->getString('NameQualifier', $spEntityId); $nameid = Random::generateID(); $subjectNode = - '<Subject>' . - '<NameIdentifier' . - ' Format="urn:mace:shibboleth:1.0:nameIdentifier"' . - ' NameQualifier="' . htmlspecialchars($namequalifier) . '"' . - '>' . - htmlspecialchars($nameid) . - '</NameIdentifier>' . - '<SubjectConfirmation>' . - '<ConfirmationMethod>' . - 'urn:oasis:names:tc:SAML:1.0:cm:bearer' . - '</ConfirmationMethod>' . - '</SubjectConfirmation>' . + '<Subject>'. + '<NameIdentifier'. + ' Format="urn:mace:shibboleth:1.0:nameIdentifier"'. + ' NameQualifier="'.htmlspecialchars($namequalifier).'"'. + '>'. + htmlspecialchars($nameid). + '</NameIdentifier>'. + '<SubjectConfirmation>'. + '<ConfirmationMethod>'. + 'urn:oasis:names:tc:SAML:1.0:cm:bearer'. + '</ConfirmationMethod>'. + '</SubjectConfirmation>'. '</Subject>'; $encodedattributes = ''; @@ -357,7 +363,7 @@ public function generate(\SimpleSAML_Configuration $idp, \SimpleSAML_Configurati $encodedattributes .= $subjectNode; foreach ($attributes as $name => $value) { - $encodedattributes .= $this->enc_attribute($name, $value, $base64, $scopedAttributes); + $encodedattributes .= $this->encAttribute($name, $value, $base64, $scopedAttributes); } $encodedattributes .= '</AttributeStatement>'; @@ -369,25 +375,25 @@ public function generate(\SimpleSAML_Configuration $idp, \SimpleSAML_Configurati $response = '<Response xmlns="urn:oasis:names:tc:SAML:1.0:protocol" xmlns:saml="urn:oasis:names:tc:SAML:1.0:assertion" xmlns:samlp="urn:oasis:names:tc:SAML:1.0:protocol" xmlns:xsd="http://www.w3.org/2001/XMLSchema" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" IssueInstant="' . $issueInstant. '" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" IssueInstant="'.$issueInstant.'" MajorVersion="1" MinorVersion="1" - Recipient="' . htmlspecialchars($shire) . '" ResponseID="' . $id . '"> + Recipient="'.htmlspecialchars($shire).'" ResponseID="'.$id.'"> <Status> <StatusCode Value="samlp:Success" /> </Status> <Assertion xmlns="urn:oasis:names:tc:SAML:1.0:assertion" - AssertionID="' . $assertionid . '" IssueInstant="' . $issueInstant. '" - Issuer="' . htmlspecialchars($idp->getString('entityid')) . '" MajorVersion="1" MinorVersion="1"> - <Conditions NotBefore="' . $notBefore. '" NotOnOrAfter="'. $assertionExpire . '"> + AssertionID="'.$assertionid.'" IssueInstant="'.$issueInstant.'" + Issuer="'.htmlspecialchars($idp->getString('entityid')).'" MajorVersion="1" MinorVersion="1"> + <Conditions NotBefore="'.$notBefore.'" NotOnOrAfter="'.$assertionExpire.'"> <AudienceRestrictionCondition> - <Audience>' . htmlspecialchars($audience) . '</Audience> + <Audience>'.htmlspecialchars($audience).'</Audience> </AudienceRestrictionCondition> </Conditions> - <AuthenticationStatement AuthenticationInstant="' . $issueInstant. '" - AuthenticationMethod="urn:oasis:names:tc:SAML:1.0:am:unspecified">' . - $subjectNode . ' + <AuthenticationStatement AuthenticationInstant="'.$issueInstant.'" + AuthenticationMethod="urn:oasis:names:tc:SAML:1.0:am:unspecified">'. + $subjectNode.' </AuthenticationStatement> - ' . $encodedattributes . ' + '.$encodedattributes.' </Assertion> </Response>'; @@ -404,12 +410,12 @@ public function generate(\SimpleSAML_Configuration $idp, \SimpleSAML_Configurati * @param array $scopedAttributes Array of attributes names which are scoped. * @return string The attribute encoded as an XML-string. */ - private function enc_attribute($name, $values, $base64, $scopedAttributes) + private function encAttribute($name, $values, $base64, $scopedAttributes) { - assert('is_string($name)'); - assert('is_array($values)'); - assert('is_bool($base64)'); - assert('is_array($scopedAttributes)'); + assert(is_string($name)); + assert(is_array($values)); + assert(is_bool($base64)); + assert(is_array($scopedAttributes)); if (in_array($name, $scopedAttributes, true)) { $scoped = true; @@ -417,14 +423,15 @@ private function enc_attribute($name, $values, $base64, $scopedAttributes) $scoped = false; } - $attr = '<Attribute AttributeName="' . htmlspecialchars($name) . '" AttributeNamespace="urn:mace:shibboleth:1.0:attributeNamespace:uri">'; + $attr = '<Attribute AttributeName="'.htmlspecialchars($name). + '" AttributeNamespace="urn:mace:shibboleth:1.0:attributeNamespace:uri">'; foreach ($values as $value) { $scopePart = ''; if ($scoped) { $tmp = explode('@', $value, 2); if (count($tmp) === 2) { $value = $tmp[0]; - $scopePart = ' Scope="' . htmlspecialchars($tmp[1]) . '"'; + $scopePart = ' Scope="'.htmlspecialchars($tmp[1]).'"'; } } @@ -432,7 +439,7 @@ private function enc_attribute($name, $values, $base64, $scopedAttributes) $value = base64_encode($value); } - $attr .= '<AttributeValue' . $scopePart . '>' . htmlspecialchars($value) . '</AttributeValue>'; + $attr .= '<AttributeValue'.$scopePart.'>'.htmlspecialchars($value).'</AttributeValue>'; } $attr .= '</Attribute>'; diff --git a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/XML/Signer.php b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/XML/Signer.php index 42ddfa350b..26f46ab62f 100644 --- a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/XML/Signer.php +++ b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/XML/Signer.php @@ -11,34 +11,35 @@ namespace SimpleSAML\XML; +use DOMComment; +use DOMElement; +use DOMText; use RobRichards\XMLSecLibs\XMLSecurityDSig; use RobRichards\XMLSecLibs\XMLSecurityKey; use SimpleSAML\Utils\Config; class Signer { - - /** * @var string The name of the ID attribute. */ - private $idAttrName; + private $idAttrName = ''; /** * @var XMLSecurityKey|bool The private key (as an XMLSecurityKey). */ - private $privateKey; + private $privateKey = false; /** * @var string The certificate (as text). */ - private $certificate; + private $certificate = ''; /** - * @var string Extra certificates which should be included in the response. + * @var array Extra certificates which should be included in the response. */ - private $extraCertificates; + private $extraCertificates = []; /** @@ -51,20 +52,15 @@ class Signer * - privatekey The file with the private key, relative to the cert-directory. * - privatekey_pass The passphrase for the private key. * - certificate The file with the certificate, relative to the cert-directory. - * - privatekey_array The private key, as an array returned from SimpleSAML_Utilities::loadPrivateKey. - * - publickey_array The public key, as an array returned from SimpleSAML_Utilities::loadPublicKey. + * - privatekey_array The private key, as an array returned from \SimpleSAML\Utils\Crypto::loadPrivateKey. + * - publickey_array The public key, as an array returned from \SimpleSAML\Utils\Crypto::loadPublicKey. * - id The name of the ID attribute. * * @param array $options Associative array with options for the constructor. Defaults to an empty array. */ - public function __construct($options = array()) + public function __construct($options = []) { - assert('is_array($options)'); - - $this->idAttrName = false; - $this->privateKey = false; - $this->certificate = false; - $this->extraCertificates = array(); + assert(is_array($options)); if (array_key_exists('privatekey', $options)) { $pass = null; @@ -88,7 +84,7 @@ public function __construct($options = array()) } if (array_key_exists('id', $options)) { - $this->setIdAttribute($options['id']); + $this->setIDAttribute($options['id']); } } @@ -97,16 +93,16 @@ public function __construct($options = array()) * Set the private key from an array. * * This function loads the private key from an array matching what is returned - * by SimpleSAML_Utilities::loadPrivateKey(...). + * by \SimpleSAML\Utils\Crypto::loadPrivateKey(...). * * @param array $privatekey The private key. */ public function loadPrivateKeyArray($privatekey) { - assert('is_array($privatekey)'); - assert('array_key_exists("PEM", $privatekey)'); + assert(is_array($privatekey)); + assert(array_key_exists('PEM', $privatekey)); - $this->privateKey = new XMLSecurityKey(XMLSecurityKey::RSA_SHA1, array('type' => 'private')); + $this->privateKey = new XMLSecurityKey(XMLSecurityKey::RSA_SHA256, ['type' => 'private']); if (array_key_exists('password', $privatekey)) { $this->privateKey->passphrase = $privatekey['password']; } @@ -129,9 +125,9 @@ public function loadPrivateKeyArray($privatekey) */ public function loadPrivateKey($file, $pass = null, $full_path = false) { - assert('is_string($file)'); - assert('is_string($pass) || is_null($pass)'); - assert('is_bool($full_path)'); + assert(is_string($file)); + assert(is_string($pass) || $pass === null); + assert(is_bool($full_path)); if (!$full_path) { $keyFile = Config::getCertPath($file); @@ -140,14 +136,14 @@ public function loadPrivateKey($file, $pass = null, $full_path = false) } if (!file_exists($keyFile)) { - throw new \Exception('Could not find private key file "' . $keyFile . '".'); + throw new \Exception('Could not find private key file "'.$keyFile.'".'); } $keyData = file_get_contents($keyFile); if ($keyData === false) { - throw new \Exception('Unable to read private key file "' . $keyFile . '".'); + throw new \Exception('Unable to read private key file "'.$keyFile.'".'); } - $privatekey = array('PEM' => $keyData); + $privatekey = ['PEM' => $keyData]; if ($pass !== null) { $privatekey['password'] = $pass; } @@ -159,14 +155,14 @@ public function loadPrivateKey($file, $pass = null, $full_path = false) * Set the public key / certificate we should include in the signature. * * This function loads the public key from an array matching what is returned - * by SimpleSAML_Utilities::loadPublicKey(...). + * by \SimpleSAML\Utils\Crypto::loadPublicKey(...). * * @param array $publickey The public key. * @throws \Exception */ public function loadPublicKeyArray($publickey) { - assert('is_array($publickey)'); + assert(is_array($publickey)); if (!array_key_exists('PEM', $publickey)) { // We have a public key with only a fingerprint @@ -192,8 +188,8 @@ public function loadPublicKeyArray($publickey) */ public function loadCertificate($file, $full_path = false) { - assert('is_string($file)'); - assert('is_bool($full_path)'); + assert(is_string($file)); + assert(is_bool($full_path)); if (!$full_path) { $certFile = Config::getCertPath($file); @@ -202,13 +198,14 @@ public function loadCertificate($file, $full_path = false) } if (!file_exists($certFile)) { - throw new \Exception('Could not find certificate file "' . $certFile . '".'); + throw new \Exception('Could not find certificate file "'.$certFile.'".'); } - $this->certificate = file_get_contents($certFile); - if ($this->certificate === false) { - throw new \Exception('Unable to read certificate file "' . $certFile . '".'); + $cert = file_get_contents($certFile); + if ($cert === false) { + throw new \Exception('Unable to read certificate file "'.$certFile.'".'); } + $this->certificate = $cert; } @@ -219,7 +216,7 @@ public function loadCertificate($file, $full_path = false) */ public function setIDAttribute($idAttrName) { - assert('is_string($idAttrName)'); + assert(is_string($idAttrName)); $this->idAttrName = $idAttrName; } @@ -238,8 +235,8 @@ public function setIDAttribute($idAttrName) */ public function addCertificate($file, $full_path = false) { - assert('is_string($file)'); - assert('is_bool($full_path)'); + assert(is_string($file)); + assert(is_bool($full_path)); if (!$full_path) { $certFile = Config::getCertPath($file); @@ -248,12 +245,12 @@ public function addCertificate($file, $full_path = false) } if (!file_exists($certFile)) { - throw new \Exception('Could not find extra certificate file "' . $certFile . '".'); + throw new \Exception('Could not find extra certificate file "'.$certFile.'".'); } $certificate = file_get_contents($certFile); if ($certificate === false) { - throw new \Exception('Unable to read extra certificate file "' . $certFile . '".'); + throw new \Exception('Unable to read extra certificate file "'.$certFile.'".'); } $this->extraCertificates[] = $certificate; @@ -274,10 +271,10 @@ public function addCertificate($file, $full_path = false) */ public function sign($node, $insertInto, $insertBefore = null) { - assert('$node instanceof DOMElement'); - assert('$insertInto instanceof DOMElement'); - assert('is_null($insertBefore) || $insertBefore instanceof DOMElement ' . - '|| $insertBefore instanceof DOMComment || $insertBefore instanceof DOMText'); + assert($node instanceof DOMElement); + assert($insertInto instanceof DOMElement); + assert($insertBefore === null || $insertBefore instanceof DOMElement || + $insertBefore instanceof DOMComment || $insertBefore instanceof DOMText); if ($this->privateKey === false) { throw new \Exception('Private key not set.'); @@ -287,25 +284,24 @@ public function sign($node, $insertInto, $insertBefore = null) $objXMLSecDSig = new XMLSecurityDSig(); $objXMLSecDSig->setCanonicalMethod(XMLSecurityDSig::EXC_C14N); - $options = array(); - if ($this->idAttrName !== false) { + $options = []; + if (!empty($this->idAttrName)) { $options['id_name'] = $this->idAttrName; } $objXMLSecDSig->addReferenceList( - array($node), - XMLSecurityDSig::SHA1, - array('http://www.w3.org/2000/09/xmldsig#enveloped-signature', XMLSecurityDSig::EXC_C14N), + [$node], + XMLSecurityDSig::SHA256, + ['http://www.w3.org/2000/09/xmldsig#enveloped-signature', XMLSecurityDSig::EXC_C14N], $options ); + /** @var \RobRichards\XMLSecLibs\XMLSecurityKey $this->privateKey */ $objXMLSecDSig->sign($this->privateKey); - if ($this->certificate !== false) { - // Add the certificate to the signature - $objXMLSecDSig->add509Cert($this->certificate, true); - } + // Add the certificate to the signature + $objXMLSecDSig->add509Cert($this->certificate, true); // Add extra certificates foreach ($this->extraCertificates as $certificate) { diff --git a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/XML/Validator.php b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/XML/Validator.php index 95e6f497b0..8dd46f8971 100644 --- a/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/XML/Validator.php +++ b/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/XML/Validator.php @@ -15,7 +15,6 @@ class Validator { - /** * @var string This variable contains the X509 certificate the XML document * was signed with, or NULL if it wasn't signed with an X509 certificate. @@ -23,7 +22,7 @@ class Validator private $x509Certificate; /** - * @var array This variable contains the nodes which are signed. + * @var array|null This variable contains the nodes which are signed. */ private $validNodes = null; @@ -36,7 +35,7 @@ class Validator * take the following values: * - NULL/FALSE: No validation will be performed. This is the default. * - A string: Assumed to be a PEM-encoded certificate / public key. - * - An array: Assumed to be an array returned by SimpleSAML_Utilities::loadPublicKey. + * - An array: Assumed to be an array returned by \SimpleSAML\Utils\Crypto::loadPublicKey. * * @param \DOMNode $xmlNode The XML node which contains the Signature element. * @param string|array $idAttribute The ID attribute which is used in node references. If @@ -48,16 +47,16 @@ class Validator */ public function __construct($xmlNode, $idAttribute = null, $publickey = false) { - assert('$xmlNode instanceof \DOMNode'); + assert($xmlNode instanceof \DOMNode); if ($publickey === null) { $publickey = false; } elseif (is_string($publickey)) { - $publickey = array( + $publickey = [ 'PEM' => $publickey, - ); + ]; } else { - assert('$publickey === FALSE || is_array($publickey)'); + assert($publickey === false || is_array($publickey)); } // Create an XML security object @@ -111,12 +110,12 @@ public function __construct($xmlNode, $idAttribute = null, $publickey = false) * Check that the response contains a certificate with a matching * fingerprint. */ - assert('is_array($publickey["certFingerprint"])'); + assert(is_array($publickey['certFingerprint'])); $certificate = $objKey->getX509Certificate(); if ($certificate === null) { // Wasn't signed with an X509 certificate - throw new \Exception('Message wasn\'t signed with an X509 certificate,' . + throw new \Exception('Message wasn\'t signed with an X509 certificate,'. ' and no public key was provided in the metadata.'); } @@ -162,7 +161,7 @@ public function getX509Certificate() */ private static function calculateX509Fingerprint($x509cert) { - assert('is_string($x509cert)'); + assert(is_string($x509cert)); $lines = explode("\n", $x509cert); @@ -205,18 +204,18 @@ private static function calculateX509Fingerprint($x509cert) */ private static function validateCertificateFingerprint($certificate, $fingerprints) { - assert('is_string($certificate)'); - assert('is_array($fingerprints)'); + assert(is_string($certificate)); + assert(is_array($fingerprints)); $certFingerprint = self::calculateX509Fingerprint($certificate); if ($certFingerprint === null) { // Couldn't calculate fingerprint from X509 certificate. Should not happen. - throw new \Exception('Unable to calculate fingerprint from X509' . + throw new \Exception('Unable to calculate fingerprint from X509'. ' certificate. Maybe it isn\'t an X509 certificate?'); } foreach ($fingerprints as $fp) { - assert('is_string($fp)'); + assert(is_string($fp)); if ($fp === $certFingerprint) { // The fingerprints matched @@ -225,8 +224,8 @@ private static function validateCertificateFingerprint($certificate, $fingerprin } // None of the fingerprints matched. Throw an exception describing the error. - throw new \Exception('Invalid fingerprint of certificate. Expected one of [' . - implode('], [', $fingerprints) . '], but got [' . $certFingerprint . ']'); + throw new \Exception('Invalid fingerprint of certificate. Expected one of ['. + implode('], [', $fingerprints).'], but got ['.$certFingerprint.']'); } @@ -243,19 +242,19 @@ private static function validateCertificateFingerprint($certificate, $fingerprin */ public function validateFingerprint($fingerprints) { - assert('is_string($fingerprints) || is_array($fingerprints)'); + assert(is_string($fingerprints) || is_array($fingerprints)); if ($this->x509Certificate === null) { throw new \Exception('Key used to sign the message was not an X509 certificate.'); } if (!is_array($fingerprints)) { - $fingerprints = array($fingerprints); + $fingerprints = [$fingerprints]; } // Normalize the fingerprints foreach ($fingerprints as &$fp) { - assert('is_string($fp)'); + assert(is_string($fp)); // Make sure that the fingerprint is in the correct format $fp = strtolower(str_replace(":", "", $fp)); @@ -274,7 +273,7 @@ public function validateFingerprint($fingerprints) */ public function isNodeValidated($node) { - assert('$node instanceof \DOMNode'); + assert($node instanceof \DOMNode); while ($node !== null) { if (in_array($node, $this->validNodes, true)) { @@ -301,7 +300,7 @@ public function isNodeValidated($node) */ public function validateCA($caFile) { - assert('is_string($caFile)'); + assert(is_string($caFile)); if ($this->x509Certificate === null) { throw new \Exception('Key used to sign the message was not an X509 certificate.'); @@ -321,18 +320,19 @@ public function validateCA($caFile) */ private static function validateCABuiltIn($certificate, $caFile) { - assert('is_string($certificate)'); - assert('is_string($caFile)'); + assert(is_string($certificate)); + assert(is_string($caFile)); // Clear openssl errors - while (openssl_error_string() !== false); + while (openssl_error_string() !== false) { + } - $res = openssl_x509_checkpurpose($certificate, X509_PURPOSE_ANY, array($caFile)); + $res = openssl_x509_checkpurpose($certificate, X509_PURPOSE_ANY, [$caFile]); $errors = ''; // Log errors while (($error = openssl_error_string()) !== false) { - $errors .= ' [' . $error . ']'; + $errors .= ' ['.$error.']'; } if ($res !== true) { @@ -358,28 +358,28 @@ private static function validateCABuiltIn($certificate, $caFile) */ private static function validateCAExec($certificate, $caFile) { - assert('is_string($certificate)'); - assert('is_string($caFile)'); + assert(is_string($certificate)); + assert(is_string($caFile)); - $command = array( + $command = [ 'openssl', 'verify', '-CAfile', $caFile, '-purpose', 'any', - ); + ]; $cmdline = ''; foreach ($command as $c) { - $cmdline .= escapeshellarg($c) . ' '; + $cmdline .= escapeshellarg($c).' '; } $cmdline .= '2>&1'; - $descSpec = array( - 0 => array('pipe', 'r'), - 1 => array('pipe', 'w'), - ); + $descSpec = [ + 0 => ['pipe', 'r'], + 1 => ['pipe', 'w'], + ]; $process = proc_open($cmdline, $descSpec, $pipes); if (!is_resource($process)) { - throw new \Exception('Failed to execute verification command: ' . $cmdline); + throw new \Exception('Failed to execute verification command: '.$cmdline); } if (fwrite($pipes[0], $certificate) === false) { @@ -391,7 +391,7 @@ private static function validateCAExec($certificate, $caFile) while (!feof($pipes[1])) { $line = trim(fgets($pipes[1])); if (strlen($line) > 0) { - $out .= ' [' . $line . ']'; + $out .= ' ['.$line.']'; } } fclose($pipes[1]); @@ -417,25 +417,25 @@ private static function validateCAExec($certificate, $caFile) */ public static function validateCertificate($certificate, $caFile) { - assert('is_string($certificate)'); - assert('is_string($caFile)'); + assert(is_string($certificate)); + assert(is_string($caFile)); if (!file_exists($caFile)) { - throw new \Exception('Could not load CA file: ' . $caFile); + throw new \Exception('Could not load CA file: '.$caFile); } - Logger::debug('Validating certificate against CA file: ' . var_export($caFile, true)); + Logger::debug('Validating certificate against CA file: '.var_export($caFile, true)); $resBuiltin = self::validateCABuiltIn($certificate, $caFile); if ($resBuiltin !== true) { - Logger::debug('Failed to validate with internal function: ' . var_export($resBuiltin, true)); + Logger::debug('Failed to validate with internal function: '.var_export($resBuiltin, true)); $resExternal = self::validateCAExec($certificate, $caFile); if ($resExternal !== true) { - Logger::debug('Failed to validate with external function: ' . var_export($resExternal, true)); - throw new \Exception('Could not verify certificate against CA file "' - . $caFile . '". Internal result:' . $resBuiltin . - ' External result:' . $resExternal); + Logger::debug('Failed to validate with external function: '.var_export($resExternal, true)); + throw new \Exception('Could not verify certificate against CA file "'. + $caFile.'". Internal result:'.$resBuiltin. + ' External result:'.$resExternal); } } diff --git a/vendor/simplesamlphp/simplesamlphp/lib/_autoload.php b/vendor/simplesamlphp/simplesamlphp/lib/_autoload.php index 018468b550..245acd1e55 100644 --- a/vendor/simplesamlphp/simplesamlphp/lib/_autoload.php +++ b/vendor/simplesamlphp/simplesamlphp/lib/_autoload.php @@ -11,7 +11,8 @@ // SSP is loaded as a separate project if (file_exists(dirname(dirname(__FILE__)).'/vendor/autoload.php')) { require_once dirname(dirname(__FILE__)).'/vendor/autoload.php'; -} else { // SSP is loaded as a library +} else { + // SSP is loaded as a library if (file_exists(dirname(dirname(__FILE__)).'/../../autoload.php')) { require_once dirname(dirname(__FILE__)).'/../../autoload.php'; } else { diff --git a/vendor/simplesamlphp/simplesamlphp/lib/_autoload_modules.php b/vendor/simplesamlphp/simplesamlphp/lib/_autoload_modules.php index 1cbe074594..223ebc5fd6 100644 --- a/vendor/simplesamlphp/simplesamlphp/lib/_autoload_modules.php +++ b/vendor/simplesamlphp/simplesamlphp/lib/_autoload_modules.php @@ -20,9 +20,11 @@ function temporaryLoader($class) { // handle the upgrade to the latest version of XMLSecLibs using namespaces - if (strstr($class, 'XMLSec')) { - if (class_exists('\\RobRichards\\XMLSecLibs\\'.$class, true)) { - class_alias('\\RobRichards\\XMLSecLibs\\'.$class, $class); + if (strstr($class, 'XMLSec') && !strstr($class, '\\RobRichards\\XMLSecLibs\\')) { + $new = '\\RobRichards\\XMLSecLibs\\'.$class; + if (class_exists($new, true)) { + class_alias($new, $class); + SimpleSAML\Logger::warning("The class '$class' is now using namespaces, please use '$new'."); return; } } @@ -33,7 +35,7 @@ class_alias('\\RobRichards\\XMLSecLibs\\'.$class, $class); $original = $class; // list of classes that have been renamed or moved - $renamed = array( + $renamed = [ 'SimpleSAML_Metadata_MetaDataStorageHandlerMDX' => 'SimpleSAML_Metadata_Sources_MDQ', 'SimpleSAML_Logger_LoggingHandlerSyslog' => 'SimpleSAML_Logger_SyslogLoggingHandler', 'SimpleSAML_Logger_LoggingHandlerErrorLog' => 'SimpleSAML_Logger_ErrorLogLoggingHandler', @@ -42,7 +44,7 @@ class_alias('\\RobRichards\\XMLSecLibs\\'.$class, $class); 'SimpleSAML_IdP_LogoutHandler' => 'SimpleSAML_IdP_LogoutHandlerInterface', 'SimpleSAML_IdP_LogoutIFrame' => 'SimpleSAML_IdP_IFrameLogoutHandler', 'SimpleSAML_IdP_LogoutTraditional' => 'SimpleSAML_IdP_TraditionalLogoutHandler', - ); + ]; if (array_key_exists($class, $renamed)) { // the class has been renamed, try to load it and create an alias $class = $renamed[$class]; @@ -69,6 +71,103 @@ class_alias($new, $original); } } + +/** + * Autoload function for SimpleSAMLphp modules following PSR-0. + * + * @param string $className Name of the class. + * + * @deprecated This method will be removed in SSP 2.0. + * + * TODO: this autoloader should be removed once everything has been migrated to namespaces. + */ +function sspmodAutoloadPSR0($className) +{ + $modulePrefixLength = strlen('sspmod_'); + $classPrefix = substr($className, 0, $modulePrefixLength); + if ($classPrefix !== 'sspmod_') { + return; + } + + // list of classes that have been renamed or moved + $renamed = [ + 'sspmod_adfs_SAML2_XML_fed_Const' => [ + 'module' => 'adfs', + 'path' => ['SAML2', 'XML', 'fed', 'Constants'] + ], + ]; + if (array_key_exists($className, $renamed)) { + // the class has been renamed, try to load it and create an alias + $module = $renamed[$className]['module']; + $path = $renamed[$className]['path']; + } else { + $modNameEnd = strpos($className, '_', $modulePrefixLength); + $module = substr($className, $modulePrefixLength, $modNameEnd - $modulePrefixLength); + $path = explode('_', substr($className, $modNameEnd + 1)); + } + + if (!\SimpleSAML\Module::isModuleEnabled($module)) { + return; + } + + $file = \SimpleSAML\Module::getModuleDir($module).'/lib/'.join('/', $path).'.php'; + if (!file_exists($file)) { + return; + } + require_once($file); + + if (!class_exists($className, false) && !interface_exists($className, false)) { + // the file exists, but the class is not defined. Is it using namespaces? + $nspath = join('\\', $path); + if (class_exists('SimpleSAML\\Module\\'.$module.'\\'.$nspath) || + interface_exists('SimpleSAML\\Module\\'.$module.'\\'.$nspath) + ) { + // the class has been migrated, create an alias and warn about it + \SimpleSAML\Logger::warning( + "The class or interface '$className' is now using namespaces, please use 'SimpleSAML\\Module\\". + $module."\\".$nspath."' instead." + ); + class_alias("SimpleSAML\\Module\\$module\\$nspath", $className); + } + } +} + + +/** + * Autoload function for SimpleSAMLphp modules following PSR-4. + * + * @param string $className Name of the class. + */ +function sspmodAutoloadPSR4($className) +{ + $elements = explode('\\', $className); + if ($elements[0] === '') { + // class name starting with /, ignore + array_shift($elements); + } + if (count($elements) < 4) { + return; // it can't be a module + } + if (array_shift($elements) !== 'SimpleSAML') { + return; // the first element is not "SimpleSAML" + } + if (array_shift($elements) !== 'Module') { + return; // the second element is not "module" + } + + // this is a SimpleSAMLphp module following PSR-4 + $module = array_shift($elements); + if (!\SimpleSAML\Module::isModuleEnabled($module)) { + return; // module not enabled, avoid giving out any information at all + } + + $file = \SimpleSAML\Module::getModuleDir($module).'/lib/'.implode('/', $elements).'.php'; + + if (file_exists($file)) { + require_once($file); + } +} + spl_autoload_register("temporaryLoader"); -spl_autoload_register(array('SimpleSAML\Module', 'autoloadPSR0')); -spl_autoload_register(array('SimpleSAML\Module', 'autoloadPSR4')); +spl_autoload_register('sspmodAutoloadPSR0'); +spl_autoload_register('sspmodAutoloadPSR4'); diff --git a/vendor/simplesamlphp/simplesamlphp/locales/af/LC_MESSAGES/messages.po b/vendor/simplesamlphp/simplesamlphp/locales/af/LC_MESSAGES/messages.po index b102e3cf58..6de84e3fbd 100644 --- a/vendor/simplesamlphp/simplesamlphp/locales/af/LC_MESSAGES/messages.po +++ b/vendor/simplesamlphp/simplesamlphp/locales/af/LC_MESSAGES/messages.po @@ -1226,3 +1226,15 @@ msgstr "" "Jy het aansoek gedoen vir toegang na die Assertion Consumer Service " "koppelvlak, maar geen SAML Verifikasie Versoek is saam gestuur nie." + +msgid "" +"You are now accessing a pre-production system. This authentication setup " +"is for testing and pre-production verification only. If someone sent you " +"a link that pointed you here, and you are not <i>a tester</i> you " +"probably got the wrong link, and should <b>not be here</b>." +msgstr "" +"Jy het nou toegang gekry tot 'n pre-produksie stelsel. Dié verifikasie " +"opstel is vir die toets en pre-produksie verifikasie aleen. Indien iemand" +" vir jou 'n skakel gestuur wat na hier verwys en jy is nie <i> 'n toets " +"persoon nie </i> het jy waarskynlik die verkeerde skakel en moet <b> jy " +"nie hier </b> wees nie." diff --git a/vendor/simplesamlphp/simplesamlphp/locales/ar/LC_MESSAGES/messages.po b/vendor/simplesamlphp/simplesamlphp/locales/ar/LC_MESSAGES/messages.po index b44ab6cbd5..657205af2a 100644 --- a/vendor/simplesamlphp/simplesamlphp/locales/ar/LC_MESSAGES/messages.po +++ b/vendor/simplesamlphp/simplesamlphp/locales/ar/LC_MESSAGES/messages.po @@ -1522,3 +1522,13 @@ msgid "" " not intended to be accessed directly." msgstr "لقد وصلت لنطاق تأكيد خدمة زبون لكنك لم توفر استجابة توثيق SAML" + +msgid "" +"You are now accessing a pre-production system. This authentication setup " +"is for testing and pre-production verification only. If someone sent you " +"a link that pointed you here, and you are not <i>a tester</i> you " +"probably got the wrong link, and should <b>not be here</b>." +msgstr "" +"لقد دخلت نظاماً مبدئياً. إعدادات التصديق هذه للاختبار فقط. اذا دخلت هنا " +"بناء علي حصولك علي هذا الرابط من شخص ما و انت لست احد مختبري هذا النظام " +"قم رجاءاً بالخروج" diff --git a/vendor/simplesamlphp/simplesamlphp/locales/cs/LC_MESSAGES/messages.po b/vendor/simplesamlphp/simplesamlphp/locales/cs/LC_MESSAGES/messages.po index 9794db5e9c..1f58c27e84 100644 --- a/vendor/simplesamlphp/simplesamlphp/locales/cs/LC_MESSAGES/messages.po +++ b/vendor/simplesamlphp/simplesamlphp/locales/cs/LC_MESSAGES/messages.po @@ -1548,3 +1548,12 @@ msgstr "" "Přistupujete k Assertion Consumer Service rozhraní, ale neposílálate SAML" " Authentication Response." + +msgid "" +"You are now accessing a pre-production system. This authentication setup " +"is for testing and pre-production verification only. If someone sent you " +"a link that pointed you here, and you are not <i>a tester</i> you " +"probably got the wrong link, and should <b>not be here</b>." +msgstr "" +"Právě přistupujete k testovacímu systému. Pokud nejste administrátor, " +"nebo tester, máte pravděpodobně špatný link." diff --git a/vendor/simplesamlphp/simplesamlphp/locales/da/LC_MESSAGES/messages.po b/vendor/simplesamlphp/simplesamlphp/locales/da/LC_MESSAGES/messages.po index 3353afc173..1037383153 100644 --- a/vendor/simplesamlphp/simplesamlphp/locales/da/LC_MESSAGES/messages.po +++ b/vendor/simplesamlphp/simplesamlphp/locales/da/LC_MESSAGES/messages.po @@ -1601,3 +1601,14 @@ msgstr "" "Du forsøger at tilgå Assertion Consumer Service grænsefladen uden at " "sende et SAML Authentication Response" + +msgid "" +"You are now accessing a pre-production system. This authentication setup " +"is for testing and pre-production verification only. If someone sent you " +"a link that pointed you here, and you are not <i>a tester</i> you " +"probably got the wrong link, and should <b>not be here</b>." +msgstr "" +"Du tilgår nu et pre-produktions-system. Dette autentificeringssetup er " +"kun til test og pre-produktion verifikation. Hvis nogen har sendt et " +"link, som peger her og du ikke er en <i>tester</i>, så har du sikekrt " +"fået et forkert lin og burde <b>ikke være her.</b> " diff --git a/vendor/simplesamlphp/simplesamlphp/locales/de/LC_MESSAGES/messages.po b/vendor/simplesamlphp/simplesamlphp/locales/de/LC_MESSAGES/messages.po index 7db780833e..5093d0f4b2 100644 --- a/vendor/simplesamlphp/simplesamlphp/locales/de/LC_MESSAGES/messages.po +++ b/vendor/simplesamlphp/simplesamlphp/locales/de/LC_MESSAGES/messages.po @@ -465,7 +465,7 @@ msgid "{general:no_cancel}" msgstr "Nein, ich stimme nicht zu" msgid "{login:user_pass_header}" -msgstr "Bitten geben Sie ihren Nutzernamen und Passwort ein" +msgstr "Bitte geben Sie Ihren Nutzernamen und Ihr Passwort ein" msgid "{errors:report_explain}" msgstr "Erläutern Sie, wodurch der Fehler auftrat..." @@ -978,7 +978,7 @@ msgstr "" "Kopfzeile der SAML-Entität." msgid "Enter your username and password" -msgstr "Bitten geben Sie ihren Nutzernamen und Passwort ein" +msgstr "Bitte geben Sie Ihren Nutzernamen und Ihr Passwort ein" msgid "Login at" msgstr "Login bei" @@ -1639,3 +1639,15 @@ msgstr "" "Sie haben auf die Assertion Consumer Service Schnittstelle zugegriffen, " "aber keine SAML Authentifizierungsantwort bereit gestellt." + +msgid "" +"You are now accessing a pre-production system. This authentication setup " +"is for testing and pre-production verification only. If someone sent you " +"a link that pointed you here, and you are not <i>a tester</i> you " +"probably got the wrong link, and should <b>not be here</b>." +msgstr "" +"Sie greifen jetzt auf ein System im Pilotbetrieb zu. Diese " +"Authentifizierungs-Konfiguration dient nur zum Testen und zur Überprüfung" +" des Pilotbetriebes. Falls Ihnen jemand einen Link gesendet hat, der Sie " +"hierher geführt hat und Sie sind kein <i>Tester</i>, so war der Link " +"vermutlich falsch und Sie sollten <b>nicht hier sein</b>. " diff --git a/vendor/simplesamlphp/simplesamlphp/locales/el/LC_MESSAGES/messages.po b/vendor/simplesamlphp/simplesamlphp/locales/el/LC_MESSAGES/messages.po index 067ccf5ae1..ee4679c650 100644 --- a/vendor/simplesamlphp/simplesamlphp/locales/el/LC_MESSAGES/messages.po +++ b/vendor/simplesamlphp/simplesamlphp/locales/el/LC_MESSAGES/messages.po @@ -1725,3 +1725,14 @@ msgstr "" "Σημειώστε ότι αυτό το τελικό σημείο (endpoint) δεν προορίζεται να είναι " "άμεσα προσβάσιμο." + +msgid "" +"You are now accessing a pre-production system. This authentication setup " +"is for testing and pre-production verification only. If someone sent you " +"a link that pointed you here, and you are not <i>a tester</i> you " +"probably got the wrong link, and should <b>not be here</b>." +msgstr "" +"Εισέρχεστε σε περιβάλλον ταυτοποίησης χρηστών που εξυπηρετεί αποκλειστικά" +" δοκιμαστικούς σκοπούς. Αν οδηγηθήκατε εδώ μέσω κάποιου συνδέσμου ενώ δεν" +" είστε <i>δοκιμαστής (tester)</i>, τότε πρόκειται περί λάθους και <b>δεν " +"πρέπει να βρίσκεστε εδώ</b>." diff --git a/vendor/simplesamlphp/simplesamlphp/locales/en/LC_MESSAGES/messages.po b/vendor/simplesamlphp/simplesamlphp/locales/en/LC_MESSAGES/messages.po index 4df17251e7..be62029f06 100644 --- a/vendor/simplesamlphp/simplesamlphp/locales/en/LC_MESSAGES/messages.po +++ b/vendor/simplesamlphp/simplesamlphp/locales/en/LC_MESSAGES/messages.po @@ -47,6 +47,9 @@ msgstr "Username" msgid "{login:processing}" msgstr "Processing..." +msgid "Back" +msgstr "Back" + msgid "{errors:title_METADATA}" msgstr "Error loading metadata" @@ -1739,3 +1742,13 @@ msgstr "" "provide a SAML Authentication Response. Please note that this endpoint is" " not intended to be accessed directly." +msgid "" +"You are now accessing a pre-production system. This authentication setup " +"is for testing and pre-production verification only. If someone sent you " +"a link that pointed you here, and you are not <i>a tester</i> you " +"probably got the wrong link, and should <b>not be here</b>." +msgstr "" +"You are now accessing a pre-production system. This authentication setup " +"is for testing and pre-production verification only. If someone sent you " +"a link that pointed you here, and you are not <i>a tester</i> you " +"probably got the wrong link, and should <b>not be here</b>." diff --git a/vendor/simplesamlphp/simplesamlphp/locales/es/LC_MESSAGES/messages.po b/vendor/simplesamlphp/simplesamlphp/locales/es/LC_MESSAGES/messages.po index 25b50079b6..c68754ea35 100644 --- a/vendor/simplesamlphp/simplesamlphp/locales/es/LC_MESSAGES/messages.po +++ b/vendor/simplesamlphp/simplesamlphp/locales/es/LC_MESSAGES/messages.po @@ -1696,3 +1696,15 @@ msgstr "" "Usted accedió a la interfaz consumidora de aserciones pero no incluyó una" " respuesta de autenticación SAML." + +msgid "" +"You are now accessing a pre-production system. This authentication setup " +"is for testing and pre-production verification only. If someone sent you " +"a link that pointed you here, and you are not <i>a tester</i> you " +"probably got the wrong link, and should <b>not be here</b>." +msgstr "" +"Está accediendo a un sistema en pre-producción. Esta configuración es " +"únicamente para pruebas y para verificación del sistema de preproducción." +" Si siguió un enlace que alguien le envió para llegar hasta aquí y no es " +"un <i>probador</i> probablemente se trata de un error, y usted <b>no " +"debería estar aquí</b>" diff --git a/vendor/simplesamlphp/simplesamlphp/locales/et/LC_MESSAGES/messages.po b/vendor/simplesamlphp/simplesamlphp/locales/et/LC_MESSAGES/messages.po index 3e766df689..f0010796e4 100644 --- a/vendor/simplesamlphp/simplesamlphp/locales/et/LC_MESSAGES/messages.po +++ b/vendor/simplesamlphp/simplesamlphp/locales/et/LC_MESSAGES/messages.po @@ -1567,3 +1567,14 @@ msgstr "" "Sa külastasid Assertion Consumer Service liidest, kuid ei pakkunud SAML " "autentimisvastust." + +msgid "" +"You are now accessing a pre-production system. This authentication setup " +"is for testing and pre-production verification only. If someone sent you " +"a link that pointed you here, and you are not <i>a tester</i> you " +"probably got the wrong link, and should <b>not be here</b>." +msgstr "" +"Sa kasutad nüüd testsüsteemi. See autentimisseadistus on mõeldud " +"testimiseks ja eelkontrollimiseks. Kui keegi saatis sulle lingi, mis " +"näitas siia, ja sa ei ole <i>testija</i>, siis said tõenäoliselt vale " +"lingi ja sa ei peaks <b>siin olema</b>." diff --git a/vendor/simplesamlphp/simplesamlphp/locales/eu/LC_MESSAGES/messages.po b/vendor/simplesamlphp/simplesamlphp/locales/eu/LC_MESSAGES/messages.po index d2d60a1c6c..ff123121ee 100644 --- a/vendor/simplesamlphp/simplesamlphp/locales/eu/LC_MESSAGES/messages.po +++ b/vendor/simplesamlphp/simplesamlphp/locales/eu/LC_MESSAGES/messages.po @@ -1587,3 +1587,15 @@ msgstr "" "Baieztapen kontsumitzailearen interfazera sartu zara baina ez duzu SAML " "kautotze erantzun bat erantsi." + +msgid "" +"You are now accessing a pre-production system. This authentication setup " +"is for testing and pre-production verification only. If someone sent you " +"a link that pointed you here, and you are not <i>a tester</i> you " +"probably got the wrong link, and should <b>not be here</b>." +msgstr "" +"Aurre-produzkio batean sartzen ari zara. Konfigurazio hau aurre-" +"produkzioko sistemaren frogak egin eta egiaztatzeko bakarrik da. Hona " +"iristeko norbaitek bidali dizun lotura bat jarraitu baduzu eta " +"<i>frogatzaile</i> bat ez bazara, ziurrenik errore bat izango da, eta zuk" +" <b>ez zenuke hemen egon behar</b>." diff --git a/vendor/simplesamlphp/simplesamlphp/locales/fi/LC_MESSAGES/messages.po b/vendor/simplesamlphp/simplesamlphp/locales/fi/LC_MESSAGES/messages.po index 5424aab67d..6d1706d3ed 100644 --- a/vendor/simplesamlphp/simplesamlphp/locales/fi/LC_MESSAGES/messages.po +++ b/vendor/simplesamlphp/simplesamlphp/locales/fi/LC_MESSAGES/messages.po @@ -1153,3 +1153,14 @@ msgstr "" "Yritit Assertion Consumer Service-liittymään, mutta et tarjonnut SAML " "tunnistautumisvastausta." + +msgid "" +"You are now accessing a pre-production system. This authentication setup " +"is for testing and pre-production verification only. If someone sent you " +"a link that pointed you here, and you are not <i>a tester</i> you " +"probably got the wrong link, and should <b>not be here</b>." +msgstr "" +"Olet siirtymässä testijärjestelmään. Käyttäjätunnistus on tarkoitettu " +"vain testaukseen. Jos sait linkin järjestelmään ja et ole " +"<i>testikäyttäjä</i>, sait todennäköisesti väärän linkin ja sinun ei " +"pitäisi <b>olla täällä</b>." diff --git a/vendor/simplesamlphp/simplesamlphp/locales/fr/LC_MESSAGES/messages.po b/vendor/simplesamlphp/simplesamlphp/locales/fr/LC_MESSAGES/messages.po index 0225d6144a..cb8bd91da8 100644 --- a/vendor/simplesamlphp/simplesamlphp/locales/fr/LC_MESSAGES/messages.po +++ b/vendor/simplesamlphp/simplesamlphp/locales/fr/LC_MESSAGES/messages.po @@ -1621,3 +1621,13 @@ msgstr "" "Vous avez accédé à l'interface du service de traitement des assertions, " "mais vous n'avez pas fourni de réponse d'authentification SAML." + +msgid "" +"You are now accessing a pre-production system. This authentication setup " +"is for testing and pre-production verification only. If someone sent you " +"a link that pointed you here, and you are not <i>a tester</i> you " +"probably got the wrong link, and should <b>not be here</b>." +msgstr "" +"Ceci est un système en pré-production. La configuration " +"d'authentification n'est destinée qu'aux tests. Si vous n'êtes pas un " +"testeur, <b>vous ne devriez pas être là</b>." diff --git a/vendor/simplesamlphp/simplesamlphp/locales/he/LC_MESSAGES/messages.po b/vendor/simplesamlphp/simplesamlphp/locales/he/LC_MESSAGES/messages.po index 5e89caafa1..05975ac511 100644 --- a/vendor/simplesamlphp/simplesamlphp/locales/he/LC_MESSAGES/messages.po +++ b/vendor/simplesamlphp/simplesamlphp/locales/he/LC_MESSAGES/messages.po @@ -1513,3 +1513,13 @@ msgid "" " not intended to be accessed directly." msgstr "ניגשת לממשק הכרזת שירות ללקוח, אבל לא סיפקת תגובת הזדהות SAML. " + +msgid "" +"You are now accessing a pre-production system. This authentication setup " +"is for testing and pre-production verification only. If someone sent you " +"a link that pointed you here, and you are not <i>a tester</i> you " +"probably got the wrong link, and should <b>not be here</b>." +msgstr "" +"אתה נגש למערכת קדם-ייצור. תצורת ההיזדהות הזו היא לבדיקה ולאימות מערכת " +"הקדם-ייצור בלבד. אם מישהו שלח לך קישור שהצביע לכאן, ואתה לא <i>בודק</i> " +"כנראה קיבלת קידור לא נכון, ואתה לא אמור להיות כאן " diff --git a/vendor/simplesamlphp/simplesamlphp/locales/hr/LC_MESSAGES/messages.po b/vendor/simplesamlphp/simplesamlphp/locales/hr/LC_MESSAGES/messages.po index b1c7a48754..7e3e9bdc11 100644 --- a/vendor/simplesamlphp/simplesamlphp/locales/hr/LC_MESSAGES/messages.po +++ b/vendor/simplesamlphp/simplesamlphp/locales/hr/LC_MESSAGES/messages.po @@ -1610,3 +1610,15 @@ msgstr "" "Pristupili ste sučelju za obradu SAML potvrda, ali niste dostavili SAML " "autentifikacijski odgovor." + +msgid "" +"You are now accessing a pre-production system. This authentication setup " +"is for testing and pre-production verification only. If someone sent you " +"a link that pointed you here, and you are not <i>a tester</i> you " +"probably got the wrong link, and should <b>not be here</b>." +msgstr "" +"Pristupate sustavu koji se nalazi u pretprodukcijskoj fazi. Ove " +"autentifikacijske postavke služe za testiranje i provjeru ispravnosti " +"rada pretprodukcijskog sustava. Ako vam je netko poslao adresu koja " +"pokazuje na ovu stranicu, a vi niste <i>osoba zadužena za testiranje</i>," +" vjerojatno ste <b>na ovu stranicu došli greškom</b>." diff --git a/vendor/simplesamlphp/simplesamlphp/locales/hu/LC_MESSAGES/messages.po b/vendor/simplesamlphp/simplesamlphp/locales/hu/LC_MESSAGES/messages.po index 16de3950bf..863e652e35 100644 --- a/vendor/simplesamlphp/simplesamlphp/locales/hu/LC_MESSAGES/messages.po +++ b/vendor/simplesamlphp/simplesamlphp/locales/hu/LC_MESSAGES/messages.po @@ -1567,3 +1567,14 @@ msgstr "" "Az Assertion Consumer Service interfészen SAML Authentication Response " "üzenetet kell megadni." + +msgid "" +"You are now accessing a pre-production system. This authentication setup " +"is for testing and pre-production verification only. If someone sent you " +"a link that pointed you here, and you are not <i>a tester</i> you " +"probably got the wrong link, and should <b>not be here</b>." +msgstr "" +"Egy teszt, vagy fejlesztői oldalra jutottál. Az azonosítás csak próba " +"miatt történik. Ha valaki olyan linket küldött, amire kattintva ide " +"jutottál, és nem vagy <i>tesztelő</i>, valószínűleg elrontott valamit, és" +" amit keresel, azt <b>itt nem találod</b>." diff --git a/vendor/simplesamlphp/simplesamlphp/locales/id/LC_MESSAGES/messages.po b/vendor/simplesamlphp/simplesamlphp/locales/id/LC_MESSAGES/messages.po index f456dcb550..5a678b68a7 100644 --- a/vendor/simplesamlphp/simplesamlphp/locales/id/LC_MESSAGES/messages.po +++ b/vendor/simplesamlphp/simplesamlphp/locales/id/LC_MESSAGES/messages.po @@ -1593,3 +1593,12 @@ msgstr "" "Anda mengakses antarnyka Assertion Consumer Service, tetapi tidak " "menyediakan Response Autentifikasi SAML. " + +msgid "" +"You are now accessing a pre-production system. This authentication setup " +"is for testing and pre-production verification only. If someone sent you " +"a link that pointed you here, and you are not <i>a tester</i> you " +"probably got the wrong link, and should <b>not be here</b>." +msgstr "" +"Sekarang anda sedang mengakses sistem pra-produksi. Setup autentifikasi " +"ini untuk keperluan uji coba dan verifikasi pra-produksi" diff --git a/vendor/simplesamlphp/simplesamlphp/locales/it/LC_MESSAGES/messages.po b/vendor/simplesamlphp/simplesamlphp/locales/it/LC_MESSAGES/messages.po index f3bd0823be..f34a236f7e 100644 --- a/vendor/simplesamlphp/simplesamlphp/locales/it/LC_MESSAGES/messages.po +++ b/vendor/simplesamlphp/simplesamlphp/locales/it/LC_MESSAGES/messages.po @@ -1617,3 +1617,15 @@ msgstr "" "Hai acceduto all'interfaccia di Assertion Consumer Service, ma senza " "fornire un messaggio SAML di Authentication Response." + +msgid "" +"You are now accessing a pre-production system. This authentication setup " +"is for testing and pre-production verification only. If someone sent you " +"a link that pointed you here, and you are not <i>a tester</i> you " +"probably got the wrong link, and should <b>not be here</b>." +msgstr "" +"Si sta per accedere ad un sistema di pre-produzione. Questa " +"configurazione di autenticazione è solo allo scopo di test. Se si è " +"arrivati qui a seguito di link fornito da qualcuno, e non si sta operando" +" come <i>tester</i>, probabilmente si è seguito un link sbagliato visto " +"che <b> non si dovrebbe essere qui</b>." diff --git a/vendor/simplesamlphp/simplesamlphp/locales/ja/LC_MESSAGES/messages.po b/vendor/simplesamlphp/simplesamlphp/locales/ja/LC_MESSAGES/messages.po index 61691ed81f..a8250f4eeb 100644 --- a/vendor/simplesamlphp/simplesamlphp/locales/ja/LC_MESSAGES/messages.po +++ b/vendor/simplesamlphp/simplesamlphp/locales/ja/LC_MESSAGES/messages.po @@ -1451,3 +1451,10 @@ msgid "" " not intended to be accessed directly." msgstr "Assertion Consumer Serviceインターフェースへアクセスしましたが、SAML認証レスポンスが提供されませんでした。" + +msgid "" +"You are now accessing a pre-production system. This authentication setup " +"is for testing and pre-production verification only. If someone sent you " +"a link that pointed you here, and you are not <i>a tester</i> you " +"probably got the wrong link, and should <b>not be here</b>." +msgstr "あなたは今試験環境へアクセスしています。この認証設定は試験環境のテストと検証の為のものです。もし誰かがこのリンクをあなたに送り、あなたが<i>テスター</i>でないのであれば恐らく間違ったリンクであり、ここに<b>来てはいけない</b>でしょう。" diff --git a/vendor/simplesamlphp/simplesamlphp/locales/lt/LC_MESSAGES/messages.po b/vendor/simplesamlphp/simplesamlphp/locales/lt/LC_MESSAGES/messages.po index 643d1cdf2e..f75442d392 100644 --- a/vendor/simplesamlphp/simplesamlphp/locales/lt/LC_MESSAGES/messages.po +++ b/vendor/simplesamlphp/simplesamlphp/locales/lt/LC_MESSAGES/messages.po @@ -1578,3 +1578,15 @@ msgstr "" "Jūs pasiekėte vartotojų aptarnavimo servisą, tačiau nepateikėte SAML " "autentikacijos atsakymo." + +msgid "" +"You are now accessing a pre-production system. This authentication setup " +"is for testing and pre-production verification only. If someone sent you " +"a link that pointed you here, and you are not <i>a tester</i> you " +"probably got the wrong link, and should <b>not be here</b>." +msgstr "" +"Šiuo metu Jūs kreipiatės į nebaigtą diegti sistemą. Šie autentiškumo " +"patvirtinimo nustatymai skirti tik testavimui ir sistemos veikimo " +"tikrinimui. Jei kažkas Jums atsiuntė nuorodą, vedančią čia, ir Jūs nesate" +" <i>testuotojas</i>, Jūs greičiausiai gavote neteisingą nuorodą ir " +"<b>neturėtumėte čia būti</b>." diff --git a/vendor/simplesamlphp/simplesamlphp/locales/lv/LC_MESSAGES/messages.po b/vendor/simplesamlphp/simplesamlphp/locales/lv/LC_MESSAGES/messages.po index 2dd9c6a0f1..9250283d96 100644 --- a/vendor/simplesamlphp/simplesamlphp/locales/lv/LC_MESSAGES/messages.po +++ b/vendor/simplesamlphp/simplesamlphp/locales/lv/LC_MESSAGES/messages.po @@ -1558,3 +1558,13 @@ msgstr "" "Jūs izmantojat Assertion Consumer Service interfeisu, bet neesat devis " "SAML autentifikācijas atbildi." + +msgid "" +"You are now accessing a pre-production system. This authentication setup " +"is for testing and pre-production verification only. If someone sent you " +"a link that pointed you here, and you are not <i>a tester</i> you " +"probably got the wrong link, and should <b>not be here</b>." +msgstr "" +"Jūs izmantojat testa (pirmsprodukcijas) sistēmu. Šī autentifikācija ir " +"tikai testēšanas vajadzībām. Ja kāds Jums atsūtījis saiti uz šejieni un " +"Jūs neesat <i>testētājs</i>, Jums te <b>nav jāatrodas</b>." diff --git a/vendor/simplesamlphp/simplesamlphp/locales/nb/LC_MESSAGES/messages.po b/vendor/simplesamlphp/simplesamlphp/locales/nb/LC_MESSAGES/messages.po index f5fa90149f..aaa30d7309 100644 --- a/vendor/simplesamlphp/simplesamlphp/locales/nb/LC_MESSAGES/messages.po +++ b/vendor/simplesamlphp/simplesamlphp/locales/nb/LC_MESSAGES/messages.po @@ -1588,3 +1588,14 @@ msgstr "" "Du brukte AssertionConsumerService-grensesnittet uten å angi en SAML " "AuthenticationResponse." + +msgid "" +"You are now accessing a pre-production system. This authentication setup " +"is for testing and pre-production verification only. If someone sent you " +"a link that pointed you here, and you are not <i>a tester</i> you " +"probably got the wrong link, and should <b>not be here</b>." +msgstr "" +"Du har nå kommet til et test-oppsett. Dette oppsettet for autentisering " +"er kun til bruk for testing og pre-produksjon verifikasjon. Hvis noen " +"sendte deg en link som pekte hit, og du ikke er <i>en tester</i> så fikk " +"du nok en feil link, og <b>skulle ikke vært her</b>." diff --git a/vendor/simplesamlphp/simplesamlphp/locales/nl/LC_MESSAGES/messages.po b/vendor/simplesamlphp/simplesamlphp/locales/nl/LC_MESSAGES/messages.po index 1810ebbb9e..5704f1458f 100644 --- a/vendor/simplesamlphp/simplesamlphp/locales/nl/LC_MESSAGES/messages.po +++ b/vendor/simplesamlphp/simplesamlphp/locales/nl/LC_MESSAGES/messages.po @@ -44,6 +44,9 @@ msgstr "Toestandsinformatie verloren" msgid "{login:username}" msgstr "Gebruikersnaam" +msgid "Back" +msgstr "Terug" + msgid "{errors:title_METADATA}" msgstr "Fout bij het laden van metadata" @@ -1667,3 +1670,14 @@ msgstr "" "Je hebt de Assertion Consumer Service interface aangeroepen, maar hebt " "geen SAML Authentication Response meegestuurd." + +msgid "" +"You are now accessing a pre-production system. This authentication setup " +"is for testing and pre-production verification only. If someone sent you " +"a link that pointed you here, and you are not <i>a tester</i> you " +"probably got the wrong link, and should <b>not be here</b>." +msgstr "" +"Je gaat nu een pre-productiesysteem gebruiken. Deze authenticatie is " +"uitsluitend opgezet voor testen en pre-productie-verfificatie. Als iemand" +" je een link hierheen stuurde, en je bent geen <i>tester</i>, dan is dit " +"waarschijnlijk een vergissing en zou je <b>niet hier moeten zijn</b>." diff --git a/vendor/simplesamlphp/simplesamlphp/locales/nn/LC_MESSAGES/messages.po b/vendor/simplesamlphp/simplesamlphp/locales/nn/LC_MESSAGES/messages.po index 6cb4d9b56d..9e623c9a7f 100644 --- a/vendor/simplesamlphp/simplesamlphp/locales/nn/LC_MESSAGES/messages.po +++ b/vendor/simplesamlphp/simplesamlphp/locales/nn/LC_MESSAGES/messages.po @@ -1598,3 +1598,14 @@ msgstr "" "Service), men utan å senda SAML autentiseringssvar (Authentication " "Response)" + +msgid "" +"You are now accessing a pre-production system. This authentication setup " +"is for testing and pre-production verification only. If someone sent you " +"a link that pointed you here, and you are not <i>a tester</i> you " +"probably got the wrong link, and should <b>not be here</b>." +msgstr "" +"Du er no inne på eit testsystem. Denne autentiseringsløysinga er for " +"testing og beta-drift, ikkje for vanleg drift. Dersom du har fått peikar" +" hit og du ikkje er <i>utviklar</i>, så er du truleg på feil plass og " +"<i>skulle ikkje vore her</i>." diff --git a/vendor/simplesamlphp/simplesamlphp/locales/no b/vendor/simplesamlphp/simplesamlphp/locales/no new file mode 120000 index 0000000000..6c2c32f1bd --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/locales/no @@ -0,0 +1 @@ +nb \ No newline at end of file diff --git a/vendor/simplesamlphp/simplesamlphp/locales/pl/LC_MESSAGES/messages.po b/vendor/simplesamlphp/simplesamlphp/locales/pl/LC_MESSAGES/messages.po index 283202ba23..f507fd6000 100644 --- a/vendor/simplesamlphp/simplesamlphp/locales/pl/LC_MESSAGES/messages.po +++ b/vendor/simplesamlphp/simplesamlphp/locales/pl/LC_MESSAGES/messages.po @@ -1510,3 +1510,14 @@ msgstr "" "Została wywołana usługa Assertion Consumer Service, ale nie dostarczono " "komunikatu SAML 'Authentication Response'" + +msgid "" +"You are now accessing a pre-production system. This authentication setup " +"is for testing and pre-production verification only. If someone sent you " +"a link that pointed you here, and you are not <i>a tester</i> you " +"probably got the wrong link, and should <b>not be here</b>." +msgstr "" +"Korzystasz w tej chwili z wersji testowej systemu. To ustawienie " +"uwierzytelniania jest tylko dla testów. Jeśli ktoś wysłał Ci link " +"kierujący tutaj, a ty nie jesteś <i>testerem</i> to prawdopodobnie " +"otrzymałeś błędny link i <b>nie powinieneś być tutaj</b>." diff --git a/vendor/simplesamlphp/simplesamlphp/locales/pt-br/LC_MESSAGES/messages.po b/vendor/simplesamlphp/simplesamlphp/locales/pt-br/LC_MESSAGES/messages.po index b2790c3aae..f511dd7bdc 100644 --- a/vendor/simplesamlphp/simplesamlphp/locales/pt-br/LC_MESSAGES/messages.po +++ b/vendor/simplesamlphp/simplesamlphp/locales/pt-br/LC_MESSAGES/messages.po @@ -1581,3 +1581,15 @@ msgstr "" "Você acessou a interface do Assertion Consumer Service, mas não forneceu " "uma SAML Authentication Response." + +msgid "" +"You are now accessing a pre-production system. This authentication setup " +"is for testing and pre-production verification only. If someone sent you " +"a link that pointed you here, and you are not <i>a tester</i> you " +"probably got the wrong link, and should <b>not be here</b>." +msgstr "" +"Agora você está acessando um sistema de pré-produção. Esta configuração " +"de autenticação é para testes e verificação de pré-produção apenas. Se " +"alguém lhe enviou um link que apontava para aqui, e você não é <i>um " +"testador</i>, você provavelmente tem o link errado, e <b>não deveria " +"estar aqui</b>." diff --git a/vendor/simplesamlphp/simplesamlphp/locales/pt/LC_MESSAGES/messages.po b/vendor/simplesamlphp/simplesamlphp/locales/pt/LC_MESSAGES/messages.po index abdbe6e749..c14ea158ca 100644 --- a/vendor/simplesamlphp/simplesamlphp/locales/pt/LC_MESSAGES/messages.po +++ b/vendor/simplesamlphp/simplesamlphp/locales/pt/LC_MESSAGES/messages.po @@ -1455,3 +1455,14 @@ msgstr "" "Na interface Assertion Consumer Service deve fornecer uma mensagem SAML " "do tipo Authentication Response." + +msgid "" +"You are now accessing a pre-production system. This authentication setup " +"is for testing and pre-production verification only. If someone sent you " +"a link that pointed you here, and you are not <i>a tester</i> you " +"probably got the wrong link, and should <b>not be here</b>." +msgstr "" +"Está a aceder a um sistema em pré-produção. Este passo de autenticação " +"servirá apenas para testes e verificações de pré-produção. Se alguém lhe " +"enviou este endereço, e você não é um <i>testador</i>, então " +"provavelmente recebeu um link errado, e <b>não deveria estar aqui</b>." diff --git a/vendor/simplesamlphp/simplesamlphp/locales/ro/LC_MESSAGES/messages.po b/vendor/simplesamlphp/simplesamlphp/locales/ro/LC_MESSAGES/messages.po index 434bd3f0f8..c012e57d8c 100644 --- a/vendor/simplesamlphp/simplesamlphp/locales/ro/LC_MESSAGES/messages.po +++ b/vendor/simplesamlphp/simplesamlphp/locales/ro/LC_MESSAGES/messages.po @@ -1624,3 +1624,15 @@ msgstr "" "Ați accesat interfața <i>Assertion Consumer Service</i> dar nu ați " "furnizat răspunsul de autentificare SAML." + +msgid "" +"You are now accessing a pre-production system. This authentication setup " +"is for testing and pre-production verification only. If someone sent you " +"a link that pointed you here, and you are not <i>a tester</i> you " +"probably got the wrong link, and should <b>not be here</b>." +msgstr "" +"În acest moment accesați un sistem pre-producție. Acest sistem de " +"autentificare este realizat doar pentru testare și verificare. Dacă ați " +"primit de la cineva acest link și nu sunteți <i>tester</i>, atunci " +"probabil ați primit un link greșit și <b>nu</b> ar fi trebuit să ajungeți" +" aici." diff --git a/vendor/simplesamlphp/simplesamlphp/locales/ru/LC_MESSAGES/messages.po b/vendor/simplesamlphp/simplesamlphp/locales/ru/LC_MESSAGES/messages.po index 7b48731ce1..4148ad38fb 100644 --- a/vendor/simplesamlphp/simplesamlphp/locales/ru/LC_MESSAGES/messages.po +++ b/vendor/simplesamlphp/simplesamlphp/locales/ru/LC_MESSAGES/messages.po @@ -1648,3 +1648,15 @@ msgstr "" "Вы получили доступ к интерфейсу Assertion Consumer Service, но не " "предоставили отклик SAML аутентификации." + +msgid "" +"You are now accessing a pre-production system. This authentication setup " +"is for testing and pre-production verification only. If someone sent you " +"a link that pointed you here, and you are not <i>a tester</i> you " +"probably got the wrong link, and should <b>not be here</b>." +msgstr "" +"Сейчас вы имеете доступ к предварительной версии системы. Эта настройка " +"аутентификации только для тестирования и проверки предварительной версии." +" Если кто-то прислал вам ссылку, которую вы указали здесь, и вы не " +"<i>тестер</i>, то вы, вероятно, получили неправильную ссылку, и <b>не " +"должны быть здесь</b>." diff --git a/vendor/simplesamlphp/simplesamlphp/locales/sl/LC_MESSAGES/messages.po b/vendor/simplesamlphp/simplesamlphp/locales/sl/LC_MESSAGES/messages.po index 98ff9d1fe7..55607c6d71 100644 --- a/vendor/simplesamlphp/simplesamlphp/locales/sl/LC_MESSAGES/messages.po +++ b/vendor/simplesamlphp/simplesamlphp/locales/sl/LC_MESSAGES/messages.po @@ -1554,3 +1554,14 @@ msgstr "" "Dostopili ste do \"Assertion Consumer Service\" vmesnika, ampak niste " "zagotovili \"SAML Authentication Responsa\"." + +msgid "" +"You are now accessing a pre-production system. This authentication setup " +"is for testing and pre-production verification only. If someone sent you " +"a link that pointed you here, and you are not <i>a tester</i> you " +"probably got the wrong link, and should <b>not be here</b>." +msgstr "" +"Dostopate do predprodukcijskega sistema, ki je namenjen izključno " +"preizkušanju. V primeru da ste pristali na tej strani med postopkom " +"prijave v produkcijsko storitev, je storitev verjetno napačno " +"nastavljena." diff --git a/vendor/simplesamlphp/simplesamlphp/locales/sr/LC_MESSAGES/messages.po b/vendor/simplesamlphp/simplesamlphp/locales/sr/LC_MESSAGES/messages.po index 1f43925201..dc6e00551f 100644 --- a/vendor/simplesamlphp/simplesamlphp/locales/sr/LC_MESSAGES/messages.po +++ b/vendor/simplesamlphp/simplesamlphp/locales/sr/LC_MESSAGES/messages.po @@ -1606,3 +1606,15 @@ msgstr "" "Pristupili ste sistemu za obradu SAML potvrda, ali niste dostavili SAML " "autentikacioni odgovor." + +msgid "" +"You are now accessing a pre-production system. This authentication setup " +"is for testing and pre-production verification only. If someone sent you " +"a link that pointed you here, and you are not <i>a tester</i> you " +"probably got the wrong link, and should <b>not be here</b>." +msgstr "" +"Pristupate sistemu koji se nalazi u pred-produkcionoj fazi. Ova " +"autentifikaciona podešavanja služe za testiranje i proveru ispravnosti " +"rada pred-produkcionog sistema. Ako vam je neko poslao adresu koja " +"pokazuje na ovu stranicu, a vi niste <i>osoba zadužena za testiranje</i>," +" verovatno ste <b>na ovu stranicu došli greškom</b>." diff --git a/vendor/simplesamlphp/simplesamlphp/locales/sv/LC_MESSAGES/messages.po b/vendor/simplesamlphp/simplesamlphp/locales/sv/LC_MESSAGES/messages.po index ed2ce6de23..e9cd592c9f 100644 --- a/vendor/simplesamlphp/simplesamlphp/locales/sv/LC_MESSAGES/messages.po +++ b/vendor/simplesamlphp/simplesamlphp/locales/sv/LC_MESSAGES/messages.po @@ -1603,3 +1603,14 @@ msgstr "" "Du har anropat gränssnittet för Assertion Consumer Service utan att " "skicka med någon SAML Authentication Responce." + +msgid "" +"You are now accessing a pre-production system. This authentication setup " +"is for testing and pre-production verification only. If someone sent you " +"a link that pointed you here, and you are not <i>a tester</i> you " +"probably got the wrong link, and should <b>not be here</b>." +msgstr "" +"Du har kommit till en tjänst som ännu inte är i drift. Denna " +"autentisieringskonfiguration är för testning och tidig " +"produktionskontroll. Om någon har skickat dig en länk hit och du inte är " +"en <i>en testare</i> har du troligtvis fått fel länk." diff --git a/vendor/simplesamlphp/simplesamlphp/locales/tr/LC_MESSAGES/messages.po b/vendor/simplesamlphp/simplesamlphp/locales/tr/LC_MESSAGES/messages.po index 7fe7255f05..b2f9d463de 100644 --- a/vendor/simplesamlphp/simplesamlphp/locales/tr/LC_MESSAGES/messages.po +++ b/vendor/simplesamlphp/simplesamlphp/locales/tr/LC_MESSAGES/messages.po @@ -1441,3 +1441,15 @@ msgstr "" "Onay Alıcı Servis (Assertion Consumer Service) arayüzüne giriş yaptınız, " "ancak SAML Kimlik Doğrulama Cevabı sağlamadınız." + +msgid "" +"You are now accessing a pre-production system. This authentication setup " +"is for testing and pre-production verification only. If someone sent you " +"a link that pointed you here, and you are not <i>a tester</i> you " +"probably got the wrong link, and should <b>not be here</b>." +msgstr "" +"Şu anda tamamlanmamış bir sisteme giriyorsunuz. Bu doğrulama kurulumu " +"sadece test ve tamamlanma öncesi onaylama amaçlıdır. Eğer birileri size " +"burayı gösteren bir bağlantı gönderdiyse, ve siz <i>test edici</i> " +"değilseniz, muhtemelen yanlış bir bağlantı aldınızı, ve şu anda <b>burada" +" olmamalısınız</b>. " diff --git a/vendor/simplesamlphp/simplesamlphp/locales/xh/LC_MESSAGES/messages.po b/vendor/simplesamlphp/simplesamlphp/locales/xh/LC_MESSAGES/messages.po new file mode 100644 index 0000000000..46368da9b2 --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/locales/xh/LC_MESSAGES/messages.po @@ -0,0 +1,684 @@ + +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: SimpleSAMLphp 1.15\n" +"Report-Msgid-Bugs-To: simplesamlphp-translation@googlegroups.com\n" +"POT-Creation-Date: 2018-11-15 15:07+0200\n" +"PO-Revision-Date: 2018-11-15 15:07+0200\n" +"Last-Translator: \n" +"Language-Team: \n" +"Plural-Forms: nplurals=2; plural=(n != 1)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 1.3\n" + +msgid "{login:next}" +msgstr "Okulandelayo" + +msgid "{errors:title_METADATANOTFOUND}" +msgstr "Imetadata ayifunyenwanga" + +msgid "{errors:descr_GENERATEAUTHNRESPONSE}" +msgstr "" +"Xa lo mboneleli wesazisi ezama ukuyila impendulo yongqinisiso, kwenzeke " +"impazamo." + +msgid "{errors:descr_METADATA}" +msgstr "" +"Kukho ulungiselelo olungachanekanga oluthile lofakelo lwakho lwe-" +"SimpleSAMLphp. Ukuba ngaba ungumlawuli wale nkonzo, ufanele uqinisekise " +"ulungiselelo lwakho lweempawu-ngcaciso zefayile lusetwe " +"ngokuchanekileyo." + +msgid "{errors:descr_NOSTATE}" +msgstr "Inkcazelo yobume ilahlekile, yaye akukho ndlela yokuqalisa isicelo" + +msgid "{attributes:attribute_postaladdress}" +msgstr "Idilesi yeposi" + +msgid "{errors:title_SSOPARAMS}" +msgstr "Akukho sicelo se-SAML sinikelweyo" + +msgid "{attributes:attribute_ou}" +msgstr "Iyunithi yombutho" + +msgid "{status:header_wsfed}" +msgstr "Umzekelo weDemo we-WS-Fed SP" + +msgid "{errors:descr_CASERROR}" +msgstr "Impazamo xa kunxibelelwana neseva ye-CAS." + +msgid "{attributes:attribute_noreduorgnin}" +msgstr "Inombolo yenkampani" + +msgid "{attributes:attribute_homephone}" +msgstr "Umnxeba wasekhaya" + +msgid "{errors:title_SLOSERVICEPARAMS}" +msgstr "Akukho myalezo we-SAML unikelweyo" + +msgid "{attributes:attribute_uid}" +msgstr "I-ID yomsebenzisi" + +msgid "{login:error_nopassword}" +msgstr "" +"Uthumele into kwikhasi lokungena, kodwa ngesizathu esithile iphaswedi " +"ayithunyelwanga. Nceda uzame kwakhona." + +msgid "{status:intro}" +msgstr "" +"Molo, eli likhasi lobume be-SimpleSAMLphp. Apha ungabona ukuba ngaba " +"iseshoni yakho iphelelwe lixesha, iza kuhlala ixesha elide kangakanani " +"ngaphambi kokuba iphelelwe nazo zonke iimpawu ezincanyathiselweyo " +"kwiseshoni yakho." + +msgid "{status:authData_header}" +msgstr "Ungqinisiso lweNgcombolo" + +msgid "{attributes:attribute_facsimiletelephonenumber}" +msgstr "Inombolo yefeksi" + +msgid "{errors:title_BADREQUEST}" +msgstr "Kufunyenwe isicelo esibi" + +msgid "{login:login_button}" +msgstr "Ngena" + +msgid "{status:validfor}" +msgstr "Iseshoni yakho iza kusebenza kangangemizuzu e-%SECONDS% ukususela ngoku." + +msgid "{status:header_shib}" +msgstr "Idemo ye-Shibboleth" + +msgid "{disco:icon_prefered_idp}" +msgstr "[Ukhetho olukhethwayo]" + +msgid "{errors:descr_BADREQUEST}" +msgstr "Kukho impazamo kwisicelo kweli khasi. Isizathu sesi: %REASON%" + +msgid "{attributes:attribute_homepostaladdress}" +msgstr "Idilesi yeposi yasekhaya" + +msgid "{login:help_header}" +msgstr "Ncedani! Andiyikhumbuli iphaswedi yam." + +msgid "{logout:return}" +msgstr "Buyela kwinkonzo" + +msgid "{errors:title_METADATA}" +msgstr "Impazamo ilayisha imetadata" + +msgid "{errors:title_LOGOUTREQUEST}" +msgstr "Impazamo iprosesa iSicelo Sokuphuma" + +msgid "{attributes:attribute_schacuserprivateattribute}" +msgstr "Iimpawu zenkcazelo yangasese" + +msgid "{logout:hold}" +msgstr "Ibanjiwe" + +msgid "{errors:title_LDAPERROR}" +msgstr "Impazamo ye-LDAP" + +msgid "{errors:descr_AUTHSOURCEERROR}" +msgstr "Impazamo yongqinisiso kumthombo %AUTHSOURCE%. Isizathu sesi: %REASON%" + +msgid "{logout:logout_all}" +msgstr "Ewe, zonke iinkonzo" + +msgid "{errors:descr_CREATEREQUEST}" +msgstr "Kwenzeke impazamo xa kuzanywa ukuyilwa isicelo se-SAML." + +msgid "{login:help_desk_link}" +msgstr "Ikhasi lekhaya ledesika yoncedo" + +msgid "{attributes:attribute_cn}" +msgstr "Igama eliqhelekileyo" + +msgid "{errors:debuginfo_header}" +msgstr "Inkcazelo yokulungisa" + +msgid "{errors:title_NOACCESS}" +msgstr "Akukho fikelelo" + +msgid "{errors:title_INVALIDCERT}" +msgstr "Isatifikethi esingasebenziyo" + +msgid "{errors:title_WRONGUSERPASS}" +msgstr "Igama lomsebenzisi okanye iphaswedi engachanekanga" + +msgid "{status:authData_summary}" +msgstr "Cofa ukuze ubone uNgqinisiso lweNgcombolo" + +msgid "{errors:howto_header}" +msgstr "Indlela yokufumana uncedo" + +msgid "{disco:login_at}" +msgstr "Ungeno ngo-" + +msgid "{disco:select}" +msgstr "Khetha" + +msgid "{disco:remember}" +msgstr "Khumbula ukhetho lwam" + +msgid "{general:remember}" +msgstr "Khumbula" + +msgid "{attributes:attribute_edupersonprincipalname}" +msgstr "Igama elingundoqo lomntu kwinkampani yekhaya" + +msgid "{errors:title_PROCESSASSERTION}" +msgstr "Impazamo iprosesa impendulo esuka kuMboneleli Wesazisi" + +msgid "{errors:descr_NOTFOUND}" +msgstr "Ikhasi elinikelweyo alifunyenwanga. I-URL ngu: %URL%" + +msgid "{errors:descr_NOACCESS}" +msgstr "" +"Le ndawo yokuphela ayenziwanga yasebenza. Jonga ukhetho lokwenza isebenze" +" kulungiselelo lwakho lwe-SimpleSAMLphp." + +msgid "{errors:descr_NORELAYSTATE}" +msgstr "" +"Umqalisi wesi sicelo akanikelanga ngepharamitha ye-RelayState apho " +"kufanele kuyiwe khona." + +msgid "{status:subject_format}" +msgstr "Ufomatho" + +msgid "{errors:descr_NOTVALIDCERT}" +msgstr "Awukhange uzise isatifikethi esisebenzayo." + +msgid "{errors:title_NOTFOUND}" +msgstr "Ikhasi alifunyenwanga" + +msgid "{logout:completed}" +msgstr "Igqityiwe" + +msgid "{status:subject_header}" +msgstr "Umbandela we-SAML" + +msgid "{attributes:attribute_schachomeorganization}" +msgstr "Igama ledomeyini yombutho wekhaya" + +msgid "{errors:descr_LOGOUTINFOLOST}" +msgstr "" +"Inkcazelo malunga nomsebenzi wokuphuma wangoku ilahlekile. Ufanele " +"ubuyele kwinkonzo ubuzama ukuphuma kuyo uzame ukuphuma kwakhona. Le " +"mpazamo inokubangelwa kukuphelelwa kwenkcazelo yokuphuma. Inkcazelo " +"yokuphuma igcinwa ixesha elithile - ngokuqhelekileyo iiyure eziliqela. " +"Oku kuthatha ixesha elide kunawo nawuphi na umsebenzi wokuphuma ofanele " +"ulithathe, ngoko le mpazamo isenokubonisa enye impazamo ngolungiselelo. " +"Ukuba ingxaki iyaqhubeka, qhagamshela umboneleli wenkonzo wakho." + +msgid "{attributes:attribute_noredupersonlin}" +msgstr "Inombolo yesazisi yasekuhlaleni" + +msgid "{status:subject_notset}" +msgstr "ayikasetwa" + +msgid "{errors:title_RESPONSESTATUSNOSUCCESS}" +msgstr "Impazamo efunyenwe kuMboneleli Wesazisi" + +msgid "{disco:selectidp}" +msgstr "Khetha umboneleli wesazisi wakho" + +msgid "{attributes:attribute_edupersonorgdn}" +msgstr "Igama elahlukileyo (DN) lenkampani yekhaya yomntu" + +msgid "{errors:title_NOTSET}" +msgstr "Iphaswedi ayisetwanga" + +msgid "{attributes:attribute_edupersonaffiliation}" +msgstr "Indima" + +msgid "{login:user_pass_text}" +msgstr "" +"Inkonzo icele ukuba uzingqinisise. Nceda ungenise igama lomsebenzisi " +"nephaswedi yakho kwifomu ngezantsi." + +msgid "{logout:logout_only}" +msgstr "Hayi, kuphela %SP%" + +msgid "{login:username}" +msgstr "Igama lomsebenzisi" + +msgid "{attributes:attribute_edupersonprimaryorgunitdn}" +msgstr "Igama elahlukileyo (DN) leYunithi Yenkampani yokuqala yomntu" + +msgid "{errors:error_header}" +msgstr "Impazamo ye-SimpleSAMLphp" + +msgid "{general:no_cancel}" +msgstr "Hayi, rhoxisa" + +msgid "{status:header_diagnostics}" +msgstr "Uhlalutyo lwe-SimpleSAMLphp" + +msgid "{errors:descr_SSOPARAMS}" +msgstr "" +"Ufikelele i-intafeyisi ye-Single Sign On Service, kodwa awukhange unikele" +" iMpendulo Yongqinisiso ye-SAML. Nceda uqaphele ukuba le ndawo yokuphela " +"ayilungiselelwanga ukuba ifikelelwe ngokuthe ngqo." + +msgid "{login:contact_info}" +msgstr "Inkcazelo yoqhagamshelwano:" + +msgid "{errors:errorreport_header}" +msgstr "Ingxelo yempazamo ithunyelwe" + +msgid "{errors:title_USERABORTED}" +msgstr "Ungqinisiso luyekiwe" + +msgid "{errors:descr_PROCESSAUTHNREQUEST}" +msgstr "" +"Lo Mboneleli Wesazisi ufumene Isicelo Songqinisiso esisuka kuMboneleli " +"Wenkonzo, kodwa kwenzeke impazamo xa kuzanywa ukuprosesa isicelo." + +msgid "{attributes:attribute_mobile}" +msgstr "Imobhayili" + +msgid "{login:remember_me}" +msgstr "Ndikhumbule" + +msgid "{disco:previous_auth}" +msgstr "Kwixesha elidlulileyo ukhethe ukungqinisisa ngo-" + +msgid "{attributes:attribute_l}" +msgstr "Indawo" + +msgid "{general:yes_continue}" +msgstr "Ewe, qhubeka" + +msgid "{attributes:attribute_organisationname}" +msgstr "Igama lombutho" + +msgid "{login:remember_username}" +msgstr "Khumbula igama lomsebenzisi lam" + +msgid "{errors:title_ACSPARAMS}" +msgstr "Akukho mpendulo ye-SAML inikelweyo" + +msgid "{login:user_pass_header}" +msgstr "Ngenisa igama lomsebenzisi nephaswedi yakho" + +msgid "{attributes:attribute_jpegphoto}" +msgstr "Ifoto ye-JPEG" + +msgid "{logout:logging_out_from}" +msgstr "Iphuma kwezi nkonzo zilandelayo:" + +msgid "{general:yes}" +msgstr "Ewe" + +msgid "{errors:title_CASERROR}" +msgstr "Impazamo ye-CAS" + +msgid "{errors:descr_LDAPERROR}" +msgstr "" +"I-LDAP ngumvimba wengcombolo yomsebenzisi, yaye xa uzame ukungena, " +"kufuneka siqhagamshele uvimba wengcombolo we-LDAP. Kwenzeke impazamo xa " +"besiyizama." + +msgid "{errors:debuginfo_text}" +msgstr "" +"Inkcazelo yokulungisa engezantsi isenokuba ibangela umdla kumlawuli / " +"idesika yoncedo:" + +msgid "{attributes:attribute_edupersontargetedid}" +msgstr "Igama elingelolakhe elingatshintshiyo elingqale kwinkonzo" + +msgid "{errors:descr_NOTFOUNDREASON}" +msgstr "" +"Ikhasi elinikelweyo alifunyenwanga. Isizathu sesi: %REASON% I-URL ngu: " +"%URL%" + +msgid "{attributes:attribute_noredupersonbirthdate}" +msgstr "Umhla wokuzalwa" + +msgid "{logout:success}" +msgstr "Uphume ngokuyimpumelelo kuzo zonke iinkonzo ezidweliswe ngasentla." + +msgid "{login:error_wrongpassword}" +msgstr "Igama lomsebenzisi okanye iphaswedi engachanekanga." + +msgid "{attributes:attribute_edupersonprimaryaffiliation}" +msgstr "Indima eyintloko" + +msgid "{attributes:attribute_sn}" +msgstr "Ifani" + +msgid "{login:error_header}" +msgstr "Impazamo" + +msgid "{logout:logged_out_text}" +msgstr "Uphumile." + +msgid "{errors:title_GENERATEAUTHNRESPONSE}" +msgstr "Ayikwazanga ukuyila impendulo yongqinisiso" + +msgid "{errors:descr_UNKNOWNCERT}" +msgstr "Ungqinisiso lusilele: isatifikerthi esithunyelwe yibhrawuza yakho asaziwa" + +msgid "{attributes:attribute_noredupersonnin}" +msgstr "Inombolo yesazisi eyabelwe ngamagunya oluntu" + +msgid "{errors:descr_RESPONSESTATUSNOSUCCESS}" +msgstr "" +"Umboneleli Wesazisi uphendule ngempazamo. (Ikhowudi yobume kwiMpendulo " +"ye-SAML ayiphumelelanga)" + +msgid "{general:service_provider}" +msgstr "Umboneleli Wenkonzo" + +msgid "{attributes:attribute_edupersonnickname}" +msgstr "Isiteketiso" + +msgid "{errors:descr_DISCOPARAMS}" +msgstr "Iipharamitha ezithunyelwe kwinkonzo yofumaniso azihambelani neenkcukacha." + +msgid "{status:header_saml20_sp}" +msgstr "Umzekelo weDemo we-SAML 2.0 SP" + +msgid "{attributes:attribute_edupersonorgunitdn}" +msgstr "Igama elahlukileyo (DN) leyunithi yenkampani yekhaya yomntu" + +msgid "{errors:descr_INVALIDCERT}" +msgstr "" +"Ungqinisiso lusilele: isatifikethi esithunyelwe yibhrawuza yakho " +"asisebenzi okanye asikwazi ukufundwa" + +msgid "{login:change_home_org_button}" +msgstr "Khetha umbutho wekhaya" + +msgid "{attributes:attribute_eduorglegalname}" +msgstr "Igama elisemthethweni lenkampani" + +msgid "{status:logout}" +msgstr "Phuma" + +msgid "{errors:descr_NOTSET}" +msgstr "" +"Iphaswedi ekulungiselelo (auth.adminpassword) ayitshintshwanga ukusuka " +"kwixabiso lesiseko. Nceda uhlele ifayile yolungiselelo." + +msgid "{attributes:attribute_givenname}" +msgstr "Igama elinikiweyo" + +msgid "{errors:title_AUTHSOURCEERROR}" +msgstr "Impazamo yomthombo wongqinisiso" + +msgid "{attributes:attribute_manager}" +msgstr "Umanejala" + +msgid "{attributes:attribute_edupersonentitlement}" +msgstr "Ilungelo ngokuphathelele inkonzo" + +msgid "{errors:title_UNHANDLEDEXCEPTION}" +msgstr "Isinxaxhi esingasingathwanga" + +msgid "{errors:report_header}" +msgstr "Chaza iimpazamo" + +msgid "{errors:descr_LOGOUTREQUEST}" +msgstr "Kwenzeke impazamo ngoxa kuproseswa isiCelo Sokuphuma." + +msgid "{attributes:attribute_postalcode}" +msgstr "Ikhowudi yeposi" + +msgid "{attributes:attribute_street}" +msgstr "Istrato" + +msgid "{errors:title_NOTVALIDCERT}" +msgstr "Isatifikethi esingasebenziyo" + +msgid "{errors:descr_MEMCACHEDOWN}" +msgstr "" +"Ingcombolo yeseshoni yakho ayikwazi ukubuyiselwa okwangoku ngenxa " +"yeengxaki zobugcisa. Nceda uzame kwakhona kwimizuzu embalwa." + +msgid "{errors:report_submit}" +msgstr "Thumela ingxelo yempazamo" + +msgid "{logout:incapablesps}" +msgstr "" +"Inkonzo enye okanye ezingakumbi ongeneyo kuzo <i>azikuxhasi ukuphuma</i>." +" Ukuqinisekisa zonke iiseshoni zakho zivaliwe, ukhuthazwa <i>uvale " +"ibhrawuza yewebhu</i>." + +msgid "{errors:title_CONFIG}" +msgstr "Impazamo yolungiselelo" + +msgid "{errors:report_trackid}" +msgstr "" +"Ukuba ngaba uchaza le mpazamo, nceda kananjalo uchaze le nombolo " +"yolandelelo eyenza kube lula ukufumana iseshoni yakho kwiincwadi " +"ezifumaneka kumlawuli wesistim:" + +msgid "{attributes:attribute_displayname}" +msgstr "Igama lomboniso" + +msgid "{attributes:attribute_eduorghomepageuri}" +msgstr "Ikhasi lekhaya Lenkampani" + +msgid "{login:change_home_org_title}" +msgstr "Tshintsha umbutho wakho wekhaya" + +msgid "{attributes:attribute_edupersonorcid}" +msgstr "Isazisi se-ORCID" + +msgid "{errors:title_UNKNOWNCERT}" +msgstr "Isatifikethi esingaziwayo" + +msgid "{general:no}" +msgstr "Hayi" + +msgid "{errors:title_NOCERT}" +msgstr "Akukho satifikethi" + +msgid "{errors:descr_UNHANDLEDEXCEPTION}" +msgstr "Isinxaxhi esingasingathwanga silahliwe." + +msgid "{attributes:attribute_title}" +msgstr "Isibizo" + +msgid "{attributes:attribute_dc}" +msgstr "Ikhomponenti yedomeyin (DC)" + +msgid "{errors:title_CREATEREQUEST}" +msgstr "Impazamo nokuyila isicelo" + +msgid "{errors:descr_SLOSERVICEPARAMS}" +msgstr "" +"Ufikelele i-intafeyisi ye-SingleLogoutService, kodwa awukhange unikele " +"i-SAML LogoutRequest okanye i-LogoutResponse. Nceda uqaphele ukuba le " +"ndawo yokuphela ayilungiselelwanga ukuba ifikelelwe ngokuthe ngqo." + +msgid "{errors:descr_PROCESSASSERTION}" +msgstr "Asiyamkelanga impendulo ethunyelwe ukusuka kuMboneleli Wesazisi." + +msgid "{disco:selectidp_full}" +msgstr "Nceda ukhethe umboneleli wesazisi apho ufuna ukungqinisisa:" + +msgid "{attributes:attribute_edupersonassurance}" +msgstr "Iprofayile yokuqinisekisa isazisi" + +msgid "{attributes:attribute_ismemberof}" +msgstr "Ubulungu beqela" + +msgid "{logout:failedsps}" +msgstr "" +"Awukwazi ukuphuma kwinkonzo enye okanye ezingakumbi. Ukuqinisekisa zonke " +"iiseshoni zakho zivaliwe, ukhuthazwa <i>uvale ibhrawuza yewebhu</i>." + +msgid "{login:change_home_org_text}" +msgstr "" +"Uye wakhetha u-<b>%HOMEORG%</b> njengombutho wakho wekhaya. Ukuba oku " +"akuchanekanga usenokukhetha omnye." + +msgid "{login:processing}" +msgstr "Iyaprosesa..." + +msgid "{logout:default_link_text}" +msgstr "Buyela emva kwikhasi lofakelo le-SimpleSAMLphp" + +msgid "{errors:descr_CONFIG}" +msgstr "I-SimpleSAMLphp ibonakala ingalungiselelwanga kakuhle." + +msgid "{attributes:attribute_preferredlanguage}" +msgstr "Ulwimi olukhethayo" + +msgid "{errors:title_DISCOPARAMS}" +msgstr "Isicelo esibi kwinkonzo yofumaniso" + +msgid "{status:attributes_header}" +msgstr "Iimpawu zakho" + +msgid "{errors:descr_WRONGUSERPASS}" +msgstr "" +"Kusenokwenzeka akukho msebenzisi unegama lomsebenzisi elinikelweyo " +"ofunyenweyo, okanye iphaswedi oyinikeleyo ayichanekanga. Nceda ujonge " +"igama lomsebenzisi uzame kwakhona." + +msgid "{status:sessionsize}" +msgstr "Ubukhulu beseshoni: %SIZE%" + +msgid "{errors:title_LOGOUTINFOLOST}" +msgstr "Inkcazelo yokuphuma ilahlekile" + +msgid "{errors:title_NORELAYSTATE}" +msgstr "Akukho RelayState" + +msgid "{logout:also_from}" +msgstr "Kananjalo ungene kwezi nkonzo:" + +msgid "{logout:logout_all_question}" +msgstr "Ngaba ufuna ukuphuma kuzo zonke iinkonzo ezingasentla?" + +msgid "{attributes:attribute_o}" +msgstr "Igama lombutho" + +msgid "{logout:loggedoutfrom}" +msgstr "Ngoku uphume ngokuyimpumelelo kwi-%SP%." + +msgid "{errors:title_NOTFOUNDREASON}" +msgstr "Ikhasi alifunyenwanga" + +msgid "{errors:descr_USERABORTED}" +msgstr "Ungqinisiso luyekiswe ngumsebenzisi" + +msgid "{errors:report_email}" +msgstr "Idilesi ye-imeyile:" + +msgid "{login:organization}" +msgstr "Umbutho" + +msgid "{errors:descr_ACSPARAMS}" +msgstr "" +"Ufikelele i-intafeyisi ye-Assertion Consumer Service, kodwa awukhange " +"unikele iMpendulo Yongqinisiso ye-SAML. Nceda uqaphele ukuba le ndawo " +"yokuphela ayilungiselelwanga ukuba ifikelelwe ngokuthe ngqo." + +msgid "{errors:descr_NOCERT}" +msgstr "" +"Ungqinisiso lusilele: ibhrawuza yakho ayithumelanga nasiphi na " +"isatifikethi" + +msgid "{errors:descr_ARSPARAMS}" +msgstr "" +"Ufikelele i-intafeyisi ye-Artifact Resolution Service, kodwa awukhange " +"unikrele umyalezo we-SAML ArtifactResolve. Nceda uqaphele ukuba le ndawo " +"yokuphela ayilungiselelwanga ukuba ifikelelwe ngokuthe ngqo." + +msgid "{attributes:attribute_edupersonscopedaffiliation}" +msgstr "Indima kumbutho wasekhaya" + +msgid "{errors:title_MEMCACHEDOWN}" +msgstr "Ayikwazi ukubuyisela ingcombolo yeseshoni" + +msgid "{status:some_error_occurred}" +msgstr "Kwenzeke impazamo ethile" + +msgid "{errors:errorreport_text}" +msgstr "Ingxelo yempazamo ithunyelwe kubalawuli." + +msgid "{errors:title_ARSPARAMS}" +msgstr "Akukho myalezo we-SAML unikelweyo" + +msgid "{login:help_desk_email}" +msgstr "Thumela i-imeyile kwidesika yoncedo" + +msgid "{errors:title_PROCESSAUTHNREQUEST}" +msgstr "Impazamo iprosesa isicelo esisuka kuMboneleli Wenkonzo" + +msgid "{errors:descr_METADATANOTFOUND}" +msgstr "Ayikwazi ukufumana iimpawu-ngcaciso zefayile ze-%ENTITYID%" + +msgid "{errors:title_NOSTATE}" +msgstr "Inkcazelo yobume ilahlekile" + +msgid "{logout:title}" +msgstr "Uphumile" + +msgid "{errors:report_explain}" +msgstr "Cacisa ukuba wenze ntoni xa bekusenzeka le mpazamo..." + +msgid "{attributes:attribute_telephonenumber}" +msgstr "Inombolo yomnxeba" + +msgid "{attributes:attribute_edupersonuniqueid}" +msgstr "" +"I-ID yomntu enganakuphinda yabelwe, ebhalwe ngegama lobuxoki eqhubekayo " +"kwinkampani yekhaya" + +msgid "{logout:failed}" +msgstr "Ukuphuma kusilele" + +msgid "{login:password}" +msgstr "Iphaswedi" + +msgid "{login:help_text}" +msgstr "" +"Ngaphandle kwegama lomsebenzisi nephaswedi yakho awukwazi ukuzingqinisisa" +" ukuze ufumane ufikelelo kwinkonzo. Kusenokuba ukho umntu onokukunceda. " +"Qhagamshelana nedesika yoncedo kumbutho wakho!" + +msgid "{logout:no}" +msgstr "Hayi" + +msgid "{errors:howto_text}" +msgstr "" +"Le mpazamo kusenokwenzeka ingenxa yendlela yokwenza engalindelekanga " +"okanye ulungiselelo olungachanekanga lwe-SimpleSAMLphp. Qhagamshelana " +"nomlawuli wale nkonzo yokungena, uze umthumele umyalezo wempazamo " +"ongentla." + +msgid "{attributes:attribute_userpassword}" +msgstr "Iheshi yephaswedi yomsebenzisi" + +msgid "{errors:report_text}" +msgstr "" +"Unokhetho lokuthumela idilesi yeimeyile yakho, ukuze abalawuli bakwazi " +"ukukuqhagamshela ukuba banemibuzo engakumbi malunga nomba wakho:" + +msgid "{attributes:attribute_mail}" +msgstr "Iposi" + +msgid "{logout:progress}" +msgstr "Iyaphuma..." + +msgid "{attributes:attribute_labeleduri}" +msgstr "I-URI eneleyibheli" + +msgid "{login:select_home_org}" +msgstr "Khetha umbutho wakho wekhaya" + +msgid "{attributes:attribute_noredupersonlegalname}" +msgstr "Igama elisemthethweni" + +msgid "{attributes:attribute_postofficebox}" +msgstr "Ibhokisi yaseposini" + diff --git a/vendor/simplesamlphp/simplesamlphp/locales/zh-tw/LC_MESSAGES/messages.po b/vendor/simplesamlphp/simplesamlphp/locales/zh-tw/LC_MESSAGES/messages.po index 513d860faf..ae447689a0 100644 --- a/vendor/simplesamlphp/simplesamlphp/locales/zh-tw/LC_MESSAGES/messages.po +++ b/vendor/simplesamlphp/simplesamlphp/locales/zh-tw/LC_MESSAGES/messages.po @@ -1503,3 +1503,12 @@ msgid "" " not intended to be accessed directly." msgstr "您連結消費者聲明服務界面,但是沒有提供一個 SAML 認證回應。" + +msgid "" +"You are now accessing a pre-production system. This authentication setup " +"is for testing and pre-production verification only. If someone sent you " +"a link that pointed you here, and you are not <i>a tester</i> you " +"probably got the wrong link, and should <b>not be here</b>." +msgstr "" +"您現在正在存取一個非正式上線系統。這個身分驗證環境僅是在測試及檢查非正式上線系統。如果有人傳遞這個連結給你,而你並非是 <i>測試人員</i> " +"的話,你可能是取得一個錯誤連結,且您可能 <b>不適合在此</b>。" diff --git a/vendor/simplesamlphp/simplesamlphp/locales/zh/LC_MESSAGES/messages.po b/vendor/simplesamlphp/simplesamlphp/locales/zh/LC_MESSAGES/messages.po index 0938f4baa9..029cef0413 100644 --- a/vendor/simplesamlphp/simplesamlphp/locales/zh/LC_MESSAGES/messages.po +++ b/vendor/simplesamlphp/simplesamlphp/locales/zh/LC_MESSAGES/messages.po @@ -1435,3 +1435,10 @@ msgid "" " not intended to be accessed directly." msgstr "你访问了Assertion Consumer Service接口,但是并没有提供一个SAML认证应答" + +msgid "" +"You are now accessing a pre-production system. This authentication setup " +"is for testing and pre-production verification only. If someone sent you " +"a link that pointed you here, and you are not <i>a tester</i> you " +"probably got the wrong link, and should <b>not be here</b>." +msgstr "你现在访问的是一个预安装系统,这个认证设置是用来测试和预发布校验之用。如果有人发送一个连接让你访问到这里,并且你又不是<i>测试人员</i>,那么你获得了一个错误连接,并且你<b>不应该在这里</b>" diff --git a/vendor/simplesamlphp/simplesamlphp/locales/zu/LC_MESSAGES/messages.po b/vendor/simplesamlphp/simplesamlphp/locales/zu/LC_MESSAGES/messages.po new file mode 100644 index 0000000000..52b41aa0ff --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/locales/zu/LC_MESSAGES/messages.po @@ -0,0 +1,689 @@ + +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: SimpleSAMLphp 1.15\n" +"Report-Msgid-Bugs-To: simplesamlphp-translation@googlegroups.com\n" +"POT-Creation-Date: 2018-11-15 15:07+0200\n" +"PO-Revision-Date: 2018-11-15 15:07+0200\n" +"Last-Translator: \n" +"Language-Team: \n" +"Plural-Forms: nplurals=2; plural=(n != 1)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 1.3\n" + +msgid "{login:next}" +msgstr "Okulandelayo" + +msgid "{errors:title_METADATANOTFOUND}" +msgstr "Imethadatha ayitholakalanga" + +msgid "{errors:descr_GENERATEAUTHNRESPONSE}" +msgstr "" +"Ngenkathi lo mhlinzeki kamazisi ezama ukwakha impendulo yokuqinisekisa, " +"kuvele iphutha." + +msgid "{errors:descr_METADATA}" +msgstr "" +"Kukhona umiso olungafanele kukufaka kwakho kwe-SimpleSAMLphp. Uma " +"ungumlawuli wale sevisi, kufanele wenze isiqiniseko sokuthi umiso lwakho " +"lwemethadatha lumiswe ngendlela efanele." + +msgid "{errors:descr_NOSTATE}" +msgstr "" +"Ulwazi lwesifunda lulahlekile, futhi ayikho indlela yokuqala kabusha " +"isicelo" + +msgid "{attributes:attribute_postaladdress}" +msgstr "Ikheli leposi" + +msgid "{errors:title_SSOPARAMS}" +msgstr "Asikho isicelo se-SAML esinikeziwe" + +msgid "{attributes:attribute_ou}" +msgstr "Iyunithi yenhlangano" + +msgid "{status:header_wsfed}" +msgstr "Isibonelo Sedemo ye-WS-Fed SP" + +msgid "{errors:descr_CASERROR}" +msgstr "Iphutha ngenkathi kuxhunyanwa neseva ye-CAS." + +msgid "{attributes:attribute_noreduorgnin}" +msgstr "Inombolo yenhlangano" + +msgid "{attributes:attribute_homephone}" +msgstr "Ucingo lwasekhaya" + +msgid "{errors:title_SLOSERVICEPARAMS}" +msgstr "Awukho umlayezo we-SAML onikeziwe" + +msgid "{attributes:attribute_uid}" +msgstr "I-ID yomsebenzisi" + +msgid "{login:error_nopassword}" +msgstr "" +"Uthumele okuthile ekhasini lokungena, kodwa ngasizathu simbe iphasiwedi " +"ayizange ithunyelwe. Sicela uzame futhi." + +msgid "{status:intro}" +msgstr "" +"Sawubona, leli ikhasi lesimo se-SimpleSAMLphp. Lapha ungakwazi ukubona " +"ukuthi iseshini yakho iphelelwe isikhathi yini, ukuthi ihlala isikhathi " +"eside kangakanani ngaphambi kokuthi iphelelwe isikhathi kanye nazo zonke " +"izici ezihambisana neseshini yakho." + +msgid "{status:authData_header}" +msgstr "I-AuthData" + +msgid "{attributes:attribute_facsimiletelephonenumber}" +msgstr "Inombolo yefeksi" + +msgid "{errors:title_BADREQUEST}" +msgstr "Kutholwe umlayezo ongalungile" + +msgid "{login:login_button}" +msgstr "Ngena" + +msgid "{status:validfor}" +msgstr "Iseshini yakho isebenza imizuzwana engu-%SECONDS% ukusuka manje." + +msgid "{status:header_shib}" +msgstr "Idemo ye-Shibboleth" + +msgid "{disco:icon_prefered_idp}" +msgstr "[Ukukhetha okuncanyelwayo]" + +msgid "{errors:descr_BADREQUEST}" +msgstr "Kukhona iphutha kusicelo saleli khasi. Isizathu besithi: %REASON%" + +msgid "{attributes:attribute_homepostaladdress}" +msgstr "Ikheli leposi lasekhaya" + +msgid "{login:help_header}" +msgstr "Siza! Angiyikhumbuli iphasiwedi yami." + +msgid "{logout:return}" +msgstr "Buyela kusevisi" + +msgid "{errors:title_METADATA}" +msgstr "Iphutha lokulayisha imethadatha" + +msgid "{errors:title_LOGOUTREQUEST}" +msgstr "Iphutha lokucubungula Isicelo Sokuphuma" + +msgid "{attributes:attribute_schacuserprivateattribute}" +msgstr "Izingxenye zolwazi oluyimfihlo" + +msgid "{logout:hold}" +msgstr "Imisiwe" + +msgid "{errors:title_LDAPERROR}" +msgstr "Iphutha le-LDAP" + +msgid "{errors:descr_AUTHSOURCEERROR}" +msgstr "" +"Iphutha lokuqinisekisa kumthombo othi %AUTHSOURCE%. Isizathu besithi: " +"%REASON%" + +msgid "{logout:logout_all}" +msgstr "Yebo, wonke amasevisi" + +msgid "{errors:descr_CREATEREQUEST}" +msgstr "Kuvele iphutha ngenkathi izama ukwakha isicelo se-SAML." + +msgid "{login:help_desk_link}" +msgstr "Ikhasi lasekhaya ledeski losizo" + +msgid "{attributes:attribute_cn}" +msgstr "Igama elivamile" + +msgid "{errors:debuginfo_header}" +msgstr "Ulwazi lokususwa kwephutha" + +msgid "{errors:title_NOACCESS}" +msgstr "Akukho ukufinyelela" + +msgid "{errors:title_INVALIDCERT}" +msgstr "Isifiketi esingalungile" + +msgid "{errors:title_WRONGUSERPASS}" +msgstr "Igama lomsebenzisi elingalungile noma iphasiwedi" + +msgid "{status:authData_summary}" +msgstr "Qhafaza ukuze ubuke i-AuthData" + +msgid "{errors:howto_header}" +msgstr "Indlela yokuthola usizo" + +msgid "{disco:login_at}" +msgstr "Ngena kokuthi" + +msgid "{disco:select}" +msgstr "Khetha" + +msgid "{disco:remember}" +msgstr "Khumbula ukukhetha kwami" + +msgid "{general:remember}" +msgstr "Khumbula" + +msgid "{attributes:attribute_edupersonprincipalname}" +msgstr "Igama eliyinhloko lomuntu enhlanganweni yasekhaya" + +msgid "{errors:title_PROCESSASSERTION}" +msgstr "Iphutha lokucubungula impendulo esuka Kumhlinzeki Kamazisi" + +msgid "{errors:descr_NOTFOUND}" +msgstr "Ikhasi elinikeziwe alitholakalanga. I-URL ibithi: %URL%" + +msgid "{errors:descr_NOACCESS}" +msgstr "" +"Lesi siphetho asivunyelwe. Hlola izinketho zokuvumela kumiso lwakho lwe-" +"SimpleSAMLphp." + +msgid "{errors:descr_NORELAYSTATE}" +msgstr "" +"Umqalisi walesi sicelo akazange ahlinzeke ngepharamitha ye-RelayState " +"ebonisa ukuthi kufanele uye kuphi ngokulandelayo." + +msgid "{status:subject_format}" +msgstr "Ifomethi" + +msgid "{errors:descr_NOTVALIDCERT}" +msgstr "Awuzange wethule isitifiketi esilungile." + +msgid "{errors:title_NOTFOUND}" +msgstr "Ikhasi alitholakali" + +msgid "{logout:completed}" +msgstr "Kuqedile" + +msgid "{status:subject_header}" +msgstr "Isihloko Se-SAML" + +msgid "{attributes:attribute_schachomeorganization}" +msgstr "Igama lesizinda senhlangano yasekhaya" + +msgid "{errors:descr_LOGOUTINFOLOST}" +msgstr "" +"Ulwazi olumayelana nomsebenzi wokuphuma wamanje lulahlekile. Kufanele " +"ubuyele kusevisi obuzama ukuphuma kuyo futhi uzame ukuphuma futhi. Leli " +"phutha lingabangelwa ukuphelelwa isikhathi kolwazi lokuphuma. Ulwazi " +"lokuphuma lugcinwa isikhathi esilinganiselwe - ngokuvamile amahora " +"ambalwa. Lokhu kude kunanoma yimuphi umsebenzi wokuphuma ovamile, ngakho " +"leli phutha lingase libonise elinye iphutha ngomiso. Uma inkinga " +"iphikelela, thinta umhlinzeki wakho wesevisi." + +msgid "{attributes:attribute_noredupersonlin}" +msgstr "Inombolo kamazisi yasendaweni" + +msgid "{status:subject_notset}" +msgstr "akusethiwe" + +msgid "{errors:title_RESPONSESTATUSNOSUCCESS}" +msgstr "Iphutha litholwe ukusuka Kumhlinzeki Kamazisi" + +msgid "{disco:selectidp}" +msgstr "Khetha umhlinzeki wakho kamazisi" + +msgid "{attributes:attribute_edupersonorgdn}" +msgstr "Igama elihloniphekile (I-DN) lenhlangano yasekhaya yomuntu" + +msgid "{errors:title_NOTSET}" +msgstr "Iphasiwedi ayisethiwe" + +msgid "{attributes:attribute_edupersonaffiliation}" +msgstr "Indima" + +msgid "{login:user_pass_text}" +msgstr "" +"Isevisi icele ukuthi uziqinisekise. Sicela ufake igama lakho lomsebenzisi" +" nephasiwedi ngohlobo olungezansi." + +msgid "{logout:logout_only}" +msgstr "Cha, ku-%SP% kuphela" + +msgid "{login:username}" +msgstr "Igama lomsebenzisi" + +msgid "{attributes:attribute_edupersonprimaryorgunitdn}" +msgstr "Igama elihloniphekile (I-DN) Leyunithi Yenhlangano eyinhloko yomuntu" + +msgid "{errors:error_header}" +msgstr "Iphutha le-SimpleSAMLphp" + +msgid "{general:no_cancel}" +msgstr "Cha, khansela" + +msgid "{status:header_diagnostics}" +msgstr "Ukuhlonzwa Kwe-SimpleSAMLphp" + +msgid "{errors:descr_SSOPARAMS}" +msgstr "" +"Ufinyelele ukusebenzisana Kwesevisi Yokubhalisa Okukodwa, kodwa awuzange " +"uhlinzeke Ngempendulo Yokuqinisekisa ye-SAML. Sicela uphawule ukuthi " +"isiphetho asihloselwe ukufinyelelwa ngokuqondile." + +msgid "{login:contact_info}" +msgstr "Ulwazi lokuxhumana:" + +msgid "{errors:errorreport_header}" +msgstr "Umbiko wephutha uthunyelwe" + +msgid "{errors:title_USERABORTED}" +msgstr "Ukuqinisekisa kuyekisiwe" + +msgid "{errors:descr_PROCESSAUTHNREQUEST}" +msgstr "" +"Lo Mhlinzeki Kamazisi uthole Isicelo Sokuqinisekisa ukusuka Kumhlinzeki " +"Wesevisi, kodw,a kuvele iphutha ngenkathi ezama ukucubungula isicelo." + +msgid "{attributes:attribute_mobile}" +msgstr "Imobhayili" + +msgid "{login:remember_me}" +msgstr "Ngikhumbule" + +msgid "{disco:previous_auth}" +msgstr "Ngaphambilini ukhethe ukuqinisekisa kokuthi" + +msgid "{attributes:attribute_l}" +msgstr "Indawo" + +msgid "{general:yes_continue}" +msgstr "Yebo, qhubeka" + +msgid "{attributes:attribute_organisationname}" +msgstr "Igama lenhlangano" + +msgid "{login:remember_username}" +msgstr "Khumbula igama lami lomsebenzisi" + +msgid "{errors:title_ACSPARAMS}" +msgstr "Ayikho impendulo ye-SAML enikeziwe" + +msgid "{login:user_pass_header}" +msgstr "Faka igama lakho lomsebenzisi nephasiwedi" + +msgid "{attributes:attribute_jpegphoto}" +msgstr "Isithombe se-JPEG" + +msgid "{logout:logging_out_from}" +msgstr "Iyaphuma kumasevisi alandelayo:" + +msgid "{general:yes}" +msgstr "Yebo" + +msgid "{errors:title_CASERROR}" +msgstr "Iphutha Le-CAS" + +msgid "{errors:descr_LDAPERROR}" +msgstr "" +"I-LDAP iyidathabheyisi yomsebenzisi, futhi lapho uzama ukungena, sidinga " +"ukuthinta idathabheyisi ye-LDAP. Kuvele iphutha ngesikhathi siyizama " +"ngalesi sikhathi." + +msgid "{errors:debuginfo_text}" +msgstr "" +"Ulwazi lokususwa kwephutha olungezansi lungase lukhange kumlawuli / " +"ideski losizo:" + +msgid "{attributes:attribute_edupersontargetedid}" +msgstr "Isibizo esingashintshi esiqondene nesevisi" + +msgid "{errors:descr_NOTFOUNDREASON}" +msgstr "" +"Ikhasi elinikeziwe alitholakalanga. Isizathu besithi: %REASON% I-URL " +"ibithi: %URL%" + +msgid "{attributes:attribute_noredupersonbirthdate}" +msgstr "Usuku lokuzalwa" + +msgid "{logout:success}" +msgstr "Uphume ngempumelelo kuwo wonke amasevisi abhalwe ngenhla." + +msgid "{login:error_wrongpassword}" +msgstr "Igama lomsebenzisi noma iphasiwedi engalungile." + +msgid "{attributes:attribute_edupersonprimaryaffiliation}" +msgstr "Indima eyinhloko" + +msgid "{attributes:attribute_sn}" +msgstr "Isibongo" + +msgid "{login:error_header}" +msgstr "Iphutha" + +msgid "{logout:logged_out_text}" +msgstr "Usuphumile." + +msgid "{errors:title_GENERATEAUTHNRESPONSE}" +msgstr "Ayikwazanga ukwakha impendulo yokuqinisekisa" + +msgid "{errors:descr_UNKNOWNCERT}" +msgstr "" +"Ukuqinisekisa kuhlulekile: isitifiketi esithunyelwe isiphequluli sakho " +"asaziwa" + +msgid "{attributes:attribute_noredupersonnin}" +msgstr "Inombolo kamazisi eyabelwe amagunya omphakathi" + +msgid "{errors:descr_RESPONSESTATUSNOSUCCESS}" +msgstr "" +"Umhlinzeki Womazisi uphendule ngephutha. (Ikhodi yesimo Sempendulo ye-" +"SAML ayizange iphumelele)" + +msgid "{general:service_provider}" +msgstr "Umhlinzeki Wesevisi" + +msgid "{attributes:attribute_edupersonnickname}" +msgstr "Isidlaliso" + +msgid "{errors:descr_DISCOPARAMS}" +msgstr "Amapharamitha athunyelwe kusevisi yokuthola abengavumelani nezici." + +msgid "{status:header_saml20_sp}" +msgstr "Isampula Ledemo Ye-SAML 2.0 SP" + +msgid "{attributes:attribute_edupersonorgunitdn}" +msgstr "Igama elihloniphekile (I-DN) leyunithi yenhlangano yasekhaya yomuntu" + +msgid "{errors:descr_INVALIDCERT}" +msgstr "" +"Ukuqinisekisa kuhlulekile: isitifiketi esithunyelwe isiphequluli sakho " +"asivumelekile noma asikwazi ukufundwa" + +msgid "{login:change_home_org_button}" +msgstr "Khetha inhlangano yasekhaya" + +msgid "{attributes:attribute_eduorglegalname}" +msgstr "Igama elisemthethweni lenhlangano" + +msgid "{status:logout}" +msgstr "Phuma" + +msgid "{errors:descr_NOTSET}" +msgstr "" +"Iphasiwedi kumiso (auth.adminpassword) ayishintshiwe kunani " +"elizenzakalelayo. Sicela uhlele ifayela lomiso." + +msgid "{attributes:attribute_givenname}" +msgstr "Igama lokuzalwa" + +msgid "{errors:title_AUTHSOURCEERROR}" +msgstr "Iphutha lomthombo wokuqinisekisa" + +msgid "{attributes:attribute_manager}" +msgstr "Umphathi" + +msgid "{attributes:attribute_edupersonentitlement}" +msgstr "Ilungelo eliphathelene nesevisi" + +msgid "{errors:title_UNHANDLEDEXCEPTION}" +msgstr "Okuhlukile okungasingathiwe" + +msgid "{errors:report_header}" +msgstr "Amaphutha ombiko" + +msgid "{errors:descr_LOGOUTREQUEST}" +msgstr "Kuvele iphutha ngenkathi izama ukucubungula Isicelo Sokuphuma." + +msgid "{attributes:attribute_postalcode}" +msgstr "Ikhodi yeposi" + +msgid "{attributes:attribute_street}" +msgstr "Umgwaqo" + +msgid "{errors:title_NOTVALIDCERT}" +msgstr "Isitifiketi esingalungile" + +msgid "{errors:descr_MEMCACHEDOWN}" +msgstr "" +"Idatha yeseshini yakho ayikwazi ukubuyiswa njengamanje ngenxa yezinkinga " +"zobuchwepheshe. Sicela uzame futhi emizuzwini embalwa." + +msgid "{errors:report_submit}" +msgstr "Thumela umbiko wephutha" + +msgid "{logout:incapablesps}" +msgstr "" +"Isevisi eyodwa noma ngaphezulu ongene kuyo <i>ayikusekeli ukuphuma</i>. " +"Ukuze wenze isiqiniseko sokuthi wonke amaseshini akho avaliwe, ukhuthazwa" +" ukuthi <i>uvale isiphequluli sakho sewebhu</i>." + +msgid "{errors:title_CONFIG}" +msgstr "Iphutha lomiso" + +msgid "{errors:report_trackid}" +msgstr "" +"Uma ubika leli phutha, sicela futhi ubike le nombolo yokulandelela eyenza" +" kube nokwenzeka ukuthola iseshini yakho kumalogi atholakalayo kumlawuli " +"wesistimu:" + +msgid "{attributes:attribute_displayname}" +msgstr "Igama lesibonisi" + +msgid "{attributes:attribute_eduorghomepageuri}" +msgstr "Ikhasi lasekhaya lenhlangano" + +msgid "{login:change_home_org_title}" +msgstr "Shintsha inhlangano yakho yasekhaya" + +msgid "{attributes:attribute_edupersonorcid}" +msgstr "Isihlonzi se-ORCID" + +msgid "{errors:title_UNKNOWNCERT}" +msgstr "Isitifiketi esingaziwa" + +msgid "{general:no}" +msgstr "Cha" + +msgid "{errors:title_NOCERT}" +msgstr "Asikho isitifiketi" + +msgid "{errors:descr_UNHANDLEDEXCEPTION}" +msgstr "Okuhlukile okungasingathiwe kulahliwe." + +msgid "{attributes:attribute_title}" +msgstr "Isiqu" + +msgid "{attributes:attribute_dc}" +msgstr "Ingxenye yesizinda (I-DC)" + +msgid "{errors:title_CREATEREQUEST}" +msgstr "Iphutha lokwakha isicelo" + +msgid "{errors:descr_SLOSERVICEPARAMS}" +msgstr "" +"Ufinyelele ukusebenzisana kwe-SingleLogoutService, kodwa awuzange " +"uhlinzeke nge-SAML LogoutRequest noma i-LogoutResponse. Sicela uphawule " +"ukuthi isiphetho asihloselwe ukufinyelelwa ngokuqondile." + +msgid "{errors:descr_PROCESSASSERTION}" +msgstr "Asizange samukele impendulo ethunyelwe ukusuka Kumhlinzeki Kamazisi." + +msgid "{disco:selectidp_full}" +msgstr "Sicela ukhethe umhlinzeki kamazisi lapho ofuna ukuqinisekisa khona:" + +msgid "{attributes:attribute_edupersonassurance}" +msgstr "Iphrofayela yokuqinisekisa umazisi" + +msgid "{attributes:attribute_ismemberof}" +msgstr "Ubulungu beqembu" + +msgid "{logout:failedsps}" +msgstr "" +"Ayikwazi ukuphuma kusevisi eyodwa noma ngaphezulu. Ukuze wenze " +"isiqiniseko sokuthi wonke amaseshini akho avaliwe, ukhuthazwa ukuthi " +"<i>uvale isiphequluli sakho sewebhu</i>." + +msgid "{login:change_home_org_text}" +msgstr "" +"Ukhethe okuthi <b>%HOMEORG%</b> njengenhlangano yakho yasekhaya. Uma " +"lokhu kungalungile ungase ukhethe enye." + +msgid "{login:processing}" +msgstr "Iyacubungula..." + +msgid "{logout:default_link_text}" +msgstr "Buyela emuva ekhasini lokufaka le-SimpleSAMLphp" + +msgid "{errors:descr_CONFIG}" +msgstr "I-SimpleSAMLphp ibonakala ingamisiwe ngendlela efanele." + +msgid "{attributes:attribute_preferredlanguage}" +msgstr "Ulimi oluncanyelwayo" + +msgid "{errors:title_DISCOPARAMS}" +msgstr "Isicelo esingalungile sesevisi yokuthola" + +msgid "{status:attributes_header}" +msgstr "Izici zakho" + +msgid "{errors:descr_WRONGUSERPASS}" +msgstr "" +"Kungenzeka ukuthi akekho umsebenzisi onegama lomsebenzisi otholiwe, noma " +"iphasiwedi oyinikezile ayilungile. Sicela uhlole igama lomsebenzisi bese " +"uzame futhi." + +msgid "{status:sessionsize}" +msgstr "Usayizi weseshini: %SIZE%" + +msgid "{errors:title_LOGOUTINFOLOST}" +msgstr "Ulwazi lokuphuma lulahlekile" + +msgid "{errors:title_NORELAYSTATE}" +msgstr "Ayikho I-RelayState" + +msgid "{logout:also_from}" +msgstr "Ungenile futhi kulawa masevisi:" + +msgid "{logout:logout_all_question}" +msgstr "Ingabe ufuna ukuphuma kuwo wonke amasevisi angenhla?" + +msgid "{attributes:attribute_o}" +msgstr "Igama lenhlangano" + +msgid "{logout:loggedoutfrom}" +msgstr "Usuphume ngempumelelo kokuthi %SP%." + +msgid "{errors:title_NOTFOUNDREASON}" +msgstr "Ikhasi alitholakali" + +msgid "{errors:descr_USERABORTED}" +msgstr "Ukuqinisekisa kuyekiswe umsebenzisi" + +msgid "{errors:report_email}" +msgstr "Ikheli le-imeyili:" + +msgid "{login:organization}" +msgstr "Inhlangano" + +msgid "{errors:descr_ACSPARAMS}" +msgstr "" +"Ufinyelele ukusebenzisana Kwesevisi Yomthengi Yesimemezelo, kodwa " +"awuzange uhlinzeke Ngempendulo Yokuqinisekisa ye-SAML. Sicela uphawule " +"ukuthi isiphetho asihloselwe ukufinyelelwa ngokuqondile." + +msgid "{errors:descr_NOCERT}" +msgstr "" +"Ukuqinisekisa kuhlulekile: isiphequluli sakho asizange sithumele noma " +"yisiphi isitifiketi" + +msgid "{errors:descr_ARSPARAMS}" +msgstr "" +"Ufinyelele ukusebenzisana Kwesevisi Yokucaciswa Kobuciko, kodwa awuzange " +"uhlinzeke umlayezo we-SAML ArtifactResolve. Sicela uphawule ukuthi " +"isiphetho asihloselwe ukufinyelelwa ngokuqondile." + +msgid "{attributes:attribute_edupersonscopedaffiliation}" +msgstr "Indima enhlanganweni yasekhaya" + +msgid "{errors:title_MEMCACHEDOWN}" +msgstr "Ayikwazi ukubuyisela idatha yeseshini" + +msgid "{status:some_error_occurred}" +msgstr "Kuvele iphutha elithile" + +msgid "{errors:errorreport_text}" +msgstr "Umbiko wephutha uthunyelwe kubalawuli." + +msgid "{errors:title_ARSPARAMS}" +msgstr "Awukho umlayezo we-SAML onikeziwe" + +msgid "{login:help_desk_email}" +msgstr "Thumela i-imeyili edeskini losizo" + +msgid "{errors:title_PROCESSAUTHNREQUEST}" +msgstr "Iphutha lokucubungula isicelo esisuka Kumhlinzeki Wesevisi" + +msgid "{errors:descr_METADATANOTFOUND}" +msgstr "Ayikwazi ukuthola imethadatha yokuthi %ENTITYID%" + +msgid "{errors:title_NOSTATE}" +msgstr "Ulwazi lwesifunda lulahlekile" + +msgid "{logout:title}" +msgstr "Uphume ngemvume" + +msgid "{errors:report_explain}" +msgstr "Chaza ukuthi yini oyenzile ngenkathi kuvela leli phutha..." + +msgid "{attributes:attribute_telephonenumber}" +msgstr "Inombolo yocingo" + +msgid "{attributes:attribute_edupersonuniqueid}" +msgstr "" +"I-ID yesibizo ephikelelayo, engakwazi ukwabelwa kabusha yomuntu " +"yenhlangano yasekhaya" + +msgid "{logout:failed}" +msgstr "Ukuphuma kuhlulekile" + +msgid "{login:password}" +msgstr "Iphasiwedi" + +msgid "{login:help_text}" +msgstr "" +"Ngaphandle kwegama lakho lomsebenzisi nephasiwedi awukwazi " +"ukuziqinisekisa ukuze ufinyelele isevisi. Kungase kube khona ozokusiza. " +"Thinta ideski losizo enhlanganweni yakho!" + +msgid "{logout:no}" +msgstr "Cha" + +msgid "{errors:howto_text}" +msgstr "" +"Leli phutha kungenzeka ukuthi libangelwa indlela yokuziphatha " +"engalindelwe noma umiso olungafanele lwe-SimpleSAMLphp. Thinta umlawuli " +"wale sevisi yokungena, bese umthumela umlayezo wephutha ongenhla." + +msgid "{attributes:attribute_userpassword}" +msgstr "Uheshi wephasiwedi yomsebenzisi" + +msgid "{errors:report_text}" +msgstr "" +"Faka ngokuzithandela ikheli lakho le-imeyili, ukuze abalawuli bakwazi " +"ukukuthinta ngemibuzo eyengeziwe mayelana nenkinga yakho:" + +msgid "{attributes:attribute_mail}" +msgstr "Imeyili" + +msgid "{logout:progress}" +msgstr "Iyaphuma..." + +msgid "{attributes:attribute_labeleduri}" +msgstr "I-URI Enelebula" + +msgid "{login:select_home_org}" +msgstr "Khetha inhlangano yakho yasekhaya" + +msgid "{attributes:attribute_noredupersonlegalname}" +msgstr "Igama elisemthethweni" + +msgid "{attributes:attribute_postofficebox}" +msgstr "Ibhokisi lehhovisi leposi" + diff --git a/vendor/simplesamlphp/simplesamlphp/metadata-templates/adfs-idp-hosted.php b/vendor/simplesamlphp/simplesamlphp/metadata-templates/adfs-idp-hosted.php index cace17d0c5..dd81340695 100644 --- a/vendor/simplesamlphp/simplesamlphp/metadata-templates/adfs-idp-hosted.php +++ b/vendor/simplesamlphp/simplesamlphp/metadata-templates/adfs-idp-hosted.php @@ -1,12 +1,12 @@ <?php -$metadata['__DYNAMIC:1__'] = array( - 'host' => '__DEFAULT__', - 'privatekey' => 'server.pem', - 'certificate' => 'server.crt', - 'auth' => 'example-userpass', - 'authproc' => array( - // Convert LDAP names to WS-Fed Claims. - 100 => array('class' => 'core:AttributeMap', 'name2claim'), - ), -); +$metadata['__DYNAMIC:1__'] = [ + 'host' => '__DEFAULT__', + 'privatekey' => 'server.pem', + 'certificate' => 'server.crt', + 'auth' => 'example-userpass', + 'authproc' => [ + // Convert LDAP names to WS-Fed Claims. + 100 => ['class' => 'core:AttributeMap', 'name2claim'], + ], +]; diff --git a/vendor/simplesamlphp/simplesamlphp/metadata-templates/adfs-sp-remote.php b/vendor/simplesamlphp/simplesamlphp/metadata-templates/adfs-sp-remote.php index 8b627ee4b3..ec2d79c916 100644 --- a/vendor/simplesamlphp/simplesamlphp/metadata-templates/adfs-sp-remote.php +++ b/vendor/simplesamlphp/simplesamlphp/metadata-templates/adfs-sp-remote.php @@ -1,12 +1,12 @@ <?php -$metadata['urn:federation:localhost'] = array( - 'prp' => 'https://localhost/adfs/ls/', - 'simplesaml.nameidattribute' => 'uid', - 'authproc' => array( - 50 => array( - 'class' => 'core:AttributeLimit', - 'cn', 'mail', 'uid', 'eduPersonAffiliation', - ), - ), -); +$metadata['urn:federation:localhost'] = [ + 'prp' => 'https://localhost/adfs/ls/', + 'simplesaml.nameidattribute' => 'uid', + 'authproc' => [ + 50 => [ + 'class' => 'core:AttributeLimit', + 'cn', 'mail', 'uid', 'eduPersonAffiliation', + ], + ], +]; diff --git a/vendor/simplesamlphp/simplesamlphp/metadata-templates/saml20-idp-hosted.php b/vendor/simplesamlphp/simplesamlphp/metadata-templates/saml20-idp-hosted.php index 81a2007267..ecb05ce111 100644 --- a/vendor/simplesamlphp/simplesamlphp/metadata-templates/saml20-idp-hosted.php +++ b/vendor/simplesamlphp/simplesamlphp/metadata-templates/saml20-idp-hosted.php @@ -5,67 +5,47 @@ * See: https://simplesamlphp.org/docs/stable/simplesamlphp-reference-idp-hosted */ -$metadata['__DYNAMIC:1__'] = array( - /* - * The hostname of the server (VHOST) that will use this SAML entity. - * - * Can be '__DEFAULT__', to use this entry by default. - */ - 'host' => '__DEFAULT__', +$metadata['__DYNAMIC:1__'] = [ + /* + * The hostname of the server (VHOST) that will use this SAML entity. + * + * Can be '__DEFAULT__', to use this entry by default. + */ + 'host' => '__DEFAULT__', - // X.509 key and certificate. Relative to the cert directory. - 'privatekey' => 'server.pem', - 'certificate' => 'server.crt', + // X.509 key and certificate. Relative to the cert directory. + 'privatekey' => 'server.pem', + 'certificate' => 'server.crt', - /* - * Authentication source to use. Must be one that is configured in - * 'config/authsources.php'. - */ - 'auth' => 'example-userpass', + /* + * Authentication source to use. Must be one that is configured in + * 'config/authsources.php'. + */ + 'auth' => 'example-userpass', - /* - * WARNING: SHA-1 is disallowed starting January the 1st, 2014. - * - * Uncomment the following option to start using SHA-256 for your signatures. - * Currently, SimpleSAMLphp defaults to SHA-1, which has been deprecated since - * 2011, and will be disallowed by NIST as of 2014. Please refer to the following - * document for more information: - * - * http://csrc.nist.gov/publications/nistpubs/800-131A/sp800-131A.pdf - * - * If you are uncertain about service providers supporting SHA-256 or other - * algorithms of the SHA-2 family, you can configure it individually in the - * SP-remote metadata set for those that support it. Once you are certain that - * all your configured SPs support SHA-2, you can safely remove the configuration - * options in the SP-remote metadata set and uncomment the following option. - * - * Please refer to the IdP hosted reference for more information. - */ - //'signature.algorithm' => 'http://www.w3.org/2001/04/xmldsig-more#rsa-sha256', + /* Uncomment the following to use the uri NameFormat on attributes. */ + /* + 'attributes.NameFormat' => 'urn:oasis:names:tc:SAML:2.0:attrname-format:uri', + 'authproc' => [ + // Convert LDAP names to oids. + 100 => ['class' => 'core:AttributeMap', 'name2oid'], + ], + */ - /* Uncomment the following to use the uri NameFormat on attributes. */ - /* - 'attributes.NameFormat' => 'urn:oasis:names:tc:SAML:2.0:attrname-format:uri', - 'authproc' => array( - // Convert LDAP names to oids. - 100 => array('class' => 'core:AttributeMap', 'name2oid'), - ), - */ - - /* - * Uncomment the following to specify the registration information in the - * exported metadata. Refer to: + /* + * Uncomment the following to specify the registration information in the + * exported metadata. Refer to: * http://docs.oasis-open.org/security/saml/Post2.0/saml-metadata-rpi/v1.0/cs01/saml-metadata-rpi-v1.0-cs01.html - * for more information. - */ - /* - 'RegistrationInfo' => array( - 'authority' => 'urn:mace:example.org', - 'instant' => '2008-01-17T11:28:03Z', - 'policies' => array( - 'en' => 'http://example.org/policy', - 'es' => 'http://example.org/politica', - ), - ), - */ -); + * for more information. + */ + /* + 'RegistrationInfo' => [ + 'authority' => 'urn:mace:example.org', + 'instant' => '2008-01-17T11:28:03Z', + 'policies' => [ + 'en' => 'http://example.org/policy', + 'es' => 'http://example.org/politica', + ], + ], + */ +]; diff --git a/vendor/simplesamlphp/simplesamlphp/metadata-templates/saml20-idp-remote.php b/vendor/simplesamlphp/simplesamlphp/metadata-templates/saml20-idp-remote.php index 49f44f0284..d390647e6c 100644 --- a/vendor/simplesamlphp/simplesamlphp/metadata-templates/saml20-idp-remote.php +++ b/vendor/simplesamlphp/simplesamlphp/metadata-templates/saml20-idp-remote.php @@ -4,7 +4,5 @@ * * Remember to remove the IdPs you don't use from this file. * - * See: https://simplesamlphp.org/docs/stable/simplesamlphp-reference-idp-remote + * See: https://simplesamlphp.org/docs/stable/simplesamlphp-reference-idp-remote */ - - diff --git a/vendor/simplesamlphp/simplesamlphp/metadata-templates/saml20-sp-remote.php b/vendor/simplesamlphp/simplesamlphp/metadata-templates/saml20-sp-remote.php index 46262cee18..a9940e8202 100644 --- a/vendor/simplesamlphp/simplesamlphp/metadata-templates/saml20-sp-remote.php +++ b/vendor/simplesamlphp/simplesamlphp/metadata-templates/saml20-sp-remote.php @@ -8,20 +8,34 @@ /* * Example SimpleSAMLphp SAML 2.0 SP */ -$metadata['https://saml2sp.example.org'] = array( - 'AssertionConsumerService' => 'https://saml2sp.example.org/simplesaml/module.php/saml/sp/saml2-acs.php/default-sp', - 'SingleLogoutService' => 'https://saml2sp.example.org/simplesaml/module.php/saml/sp/saml2-logout.php/default-sp', -); +$metadata['https://saml2sp.example.org'] = [ + 'AssertionConsumerService' => 'https://saml2sp.example.org/simplesaml/module.php/saml/sp/saml2-acs.php/default-sp', + 'SingleLogoutService' => 'https://saml2sp.example.org/simplesaml/module.php/saml/sp/saml2-logout.php/default-sp', +]; /* * This example shows an example config that works with G Suite (Google Apps) for education. - * What is important is that you have an attribute in your IdP that maps to the local part of the email address - * at G Suite. In example, if your Google account is foo.com, and you have a user that has an email john@foo.com, then you + * What is important is that you have an attribute in your IdP that maps to the local part of the email address at + * G Suite. In example, if your Google account is foo.com, and you have a user that has an email john@foo.com, then you * must set the simplesaml.nameidattribute to be the name of an attribute that for this user has the value of 'john'. */ -$metadata['google.com'] = array( - 'AssertionConsumerService' => 'https://www.google.com/a/g.feide.no/acs', - 'NameIDFormat' => 'urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress', - 'simplesaml.nameidattribute' => 'uid', - 'simplesaml.attributes' => FALSE, -); +$metadata['google.com'] = [ + 'AssertionConsumerService' => 'https://www.google.com/a/g.feide.no/acs', + 'NameIDFormat' => 'urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress', + 'simplesaml.nameidattribute' => 'uid', + 'simplesaml.attributes' => false, +]; + +$metadata['https://legacy.example.edu'] = [ + 'AssertionConsumerService' => 'https://legacy.example.edu/saml/acs', + /* + * Currently, SimpleSAMLphp defaults to the SHA-256 hashing algorithm. + * Uncomment the following option to use SHA-1 for signatures directed + * at this specific service provider if it does not support SHA-256 yet. + * + * WARNING: SHA-1 is disallowed starting January the 1st, 2014. + * Please refer to the following document for more information: + * http://csrc.nist.gov/publications/nistpubs/800-131A/sp800-131A.pdf + */ + //'signature.algorithm' => 'http://www.w3.org/2000/09/xmldsig#rsa-sha1', +]; diff --git a/vendor/simplesamlphp/simplesamlphp/metadata-templates/shib13-idp-hosted.php b/vendor/simplesamlphp/simplesamlphp/metadata-templates/shib13-idp-hosted.php index 7617fd685a..28ccc42b33 100644 --- a/vendor/simplesamlphp/simplesamlphp/metadata-templates/shib13-idp-hosted.php +++ b/vendor/simplesamlphp/simplesamlphp/metadata-templates/shib13-idp-hosted.php @@ -5,22 +5,21 @@ * See: https://simplesamlphp.org/docs/stable/simplesamlphp-reference-idp-hosted */ -$metadata['__DYNAMIC:1__'] = array( +$metadata['__DYNAMIC:1__'] = [ + /* + * The hostname of the server (VHOST) that will use this SAML entity. + * + * Can be '__DEFAULT__', to use this entry by default. + */ + 'host' => '__DEFAULT__', - /* - * The hostname of the server (VHOST) that will use this SAML entity. - * - * Can be '__DEFAULT__', to use this entry by default. - */ - 'host' => '__DEFAULT__', + // X.509 key and certificate. Relative to the cert directory. + 'privatekey' => 'server.pem', + 'certificate' => 'server.crt', - // X.509 key and certificate. Relative to the cert directory. - 'privatekey' => 'server.pem', - 'certificate' => 'server.crt', - - /* - * Authentication source to use. Must be one that is configured in - * 'config/authsources.php'. - */ - 'auth' => 'example-userpass', -); + /* + * Authentication source to use. Must be one that is configured in + * 'config/authsources.php'. + */ + 'auth' => 'example-userpass', +]; diff --git a/vendor/simplesamlphp/simplesamlphp/metadata-templates/shib13-idp-remote.php b/vendor/simplesamlphp/simplesamlphp/metadata-templates/shib13-idp-remote.php index b48b6f9f92..69c1ef324e 100644 --- a/vendor/simplesamlphp/simplesamlphp/metadata-templates/shib13-idp-remote.php +++ b/vendor/simplesamlphp/simplesamlphp/metadata-templates/shib13-idp-remote.php @@ -8,8 +8,8 @@ */ /* -$metadata['theproviderid-of-the-idp'] = array( - 'SingleSignOnService' => 'https://idp.example.org/shibboleth-idp/SSO', - 'certificate' => 'example.pem', -); +$metadata['theproviderid-of-the-idp'] = [ + 'SingleSignOnService' => 'https://idp.example.org/shibboleth-idp/SSO', + 'certificate' => 'example.pem', +]; */ diff --git a/vendor/simplesamlphp/simplesamlphp/metadata-templates/shib13-sp-hosted.php b/vendor/simplesamlphp/simplesamlphp/metadata-templates/shib13-sp-hosted.php index f15cc910ef..e3581c9b86 100644 --- a/vendor/simplesamlphp/simplesamlphp/metadata-templates/shib13-sp-hosted.php +++ b/vendor/simplesamlphp/simplesamlphp/metadata-templates/shib13-sp-hosted.php @@ -8,6 +8,6 @@ /* * Example of hosted Shibboleth 1.3 SP. */ -$metadata['__DYNAMIC:1__'] = array( - 'host' => '__DEFAULT__', -); +$metadata['__DYNAMIC:1__'] = [ + 'host' => '__DEFAULT__', +]; diff --git a/vendor/simplesamlphp/simplesamlphp/metadata-templates/shib13-sp-remote.php b/vendor/simplesamlphp/simplesamlphp/metadata-templates/shib13-sp-remote.php index 5d0f3100aa..f60174e288 100644 --- a/vendor/simplesamlphp/simplesamlphp/metadata-templates/shib13-sp-remote.php +++ b/vendor/simplesamlphp/simplesamlphp/metadata-templates/shib13-sp-remote.php @@ -8,9 +8,8 @@ /* * This is just an example: */ -$metadata['https://sp.shiblab.feide.no'] = array( - 'AssertionConsumerService' => 'http://sp.shiblab.feide.no/Shibboleth.sso/SAML/POST', - 'audience' => 'urn:mace:feide:shiblab', - 'base64attributes' => FALSE, -); - +$metadata['https://sp.shiblab.feide.no'] = [ + 'AssertionConsumerService' => 'http://sp.shiblab.feide.no/Shibboleth.sso/SAML/POST', + 'audience' => 'urn:mace:feide:shiblab', + 'base64attributes' => false, +]; diff --git a/vendor/simplesamlphp/simplesamlphp/metadata-templates/wsfed-idp-remote.php b/vendor/simplesamlphp/simplesamlphp/metadata-templates/wsfed-idp-remote.php index 215fb0cd28..214679ce37 100644 --- a/vendor/simplesamlphp/simplesamlphp/metadata-templates/wsfed-idp-remote.php +++ b/vendor/simplesamlphp/simplesamlphp/metadata-templates/wsfed-idp-remote.php @@ -3,7 +3,7 @@ * WS-Federation remote IdP metadata for SimpleSAMLphp. */ -$metadata['urn:federation:pingfederate:localhost'] = array( - 'prp' => 'https://localhost:9031/idp/prp.wsf', - 'certificate' => 'pingfed-localhost.pem', -); +$metadata['urn:federation:pingfederate:localhost'] = [ + 'prp' => 'https://localhost:9031/idp/prp.wsf', + 'certificate' => 'pingfed-localhost.pem', +]; diff --git a/vendor/simplesamlphp/simplesamlphp/metadata-templates/wsfed-sp-hosted.php b/vendor/simplesamlphp/simplesamlphp/metadata-templates/wsfed-sp-hosted.php index 3a68b7a6b2..5ebdf21c19 100644 --- a/vendor/simplesamlphp/simplesamlphp/metadata-templates/wsfed-sp-hosted.php +++ b/vendor/simplesamlphp/simplesamlphp/metadata-templates/wsfed-sp-hosted.php @@ -6,6 +6,6 @@ * - host */ -$metadata['__DYNAMIC:1__'] = array( - 'host' => '__DEFAULT__', -); +$metadata['__DYNAMIC:1__'] = [ + 'host' => '__DEFAULT__', +]; diff --git a/vendor/simplesamlphp/simplesamlphp/modules/adfs/lib/IdP/ADFS.php b/vendor/simplesamlphp/simplesamlphp/modules/adfs/lib/IdP/ADFS.php index 625f2a123c..449c25e7d5 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/adfs/lib/IdP/ADFS.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/adfs/lib/IdP/ADFS.php @@ -1,39 +1,52 @@ <?php -class sspmod_adfs_IdP_ADFS +namespace SimpleSAML\Module\adfs\IdP; + +use RobRichards\XMLSecLibs\XMLSecurityDSig; +use RobRichards\XMLSecLibs\XMLSecurityKey; +use SimpleSAML\Utils\Config\Metadata; +use SimpleSAML\Utils\Crypto; + +class ADFS { - public static function receiveAuthnRequest(SimpleSAML_IdP $idp) + public static function receiveAuthnRequest(\SimpleSAML\IdP $idp) { try { parse_str($_SERVER['QUERY_STRING'], $query); $requestid = $query['wctx']; $issuer = $query['wtrealm']; - $metadata = SimpleSAML_Metadata_MetaDataStorageHandler::getMetadataHandler(); + + $metadata = \SimpleSAML\Metadata\MetaDataStorageHandler::getMetadataHandler(); $spMetadata = $metadata->getMetaDataConfig($issuer, 'adfs-sp-remote'); - SimpleSAML\Logger::info('ADFS - IdP.prp: Incoming Authentication request: '.$issuer.' id '.$requestid); - } catch(Exception $exception) { - throw new SimpleSAML_Error_Error('PROCESSAUTHNREQUEST', $exception); + \SimpleSAML\Logger::info('ADFS - IdP.prp: Incoming Authentication request: '.$issuer.' id '.$requestid); + } catch (\Exception $exception) { + throw new \SimpleSAML\Error\Error('PROCESSAUTHNREQUEST', $exception); } - $state = array( - 'Responder' => array('sspmod_adfs_IdP_ADFS', 'sendResponse'), + $state = [ + 'Responder' => ['\SimpleSAML\Module\adfs\IdP\ADFS', 'sendResponse'], 'SPMetadata' => $spMetadata->toArray(), 'ForceAuthn' => false, 'isPassive' => false, 'adfs:wctx' => $requestid, - ); + 'adfs:wreply' => false + ]; + + if (isset($query['wreply']) && !empty($query['wreply'])) { + $state['adfs:wreply'] = \SimpleSAML\Utils\HTTP::checkURLAllowed($query['wreply']); + } - $idp->handleAuthenticationRequest($state); + $idp->handleAuthenticationRequest($state); } - private static function generateResponse($issuer, $target, $nameid, $attributes) + private static function generateResponse($issuer, $target, $nameid, $attributes, $assertionLifetime) { - $issueInstant = SimpleSAML\Utils\Time::generateTimestamp(); - $notBefore = SimpleSAML\Utils\Time::generateTimestamp(time() - 30); - $assertionExpire = SimpleSAML\Utils\Time::generateTimestamp(time() + 60 * 5); - $assertionID = SimpleSAML\Utils\Random::generateID(); + $issueInstant = \SimpleSAML\Utils\Time::generateTimestamp(); + $notBefore = \SimpleSAML\Utils\Time::generateTimestamp(time() - 30); + $assertionExpire = \SimpleSAML\Utils\Time::generateTimestamp(time() + $assertionLifetime); + $assertionID = \SimpleSAML\Utils\Random::generateID(); $nameidFormat = 'http://schemas.xmlsoap.org/claims/UPN'; $nameid = htmlspecialchars($nameid); @@ -62,7 +75,10 @@ private static function generateResponse($issuer, $target, $nameid, $attributes) continue; } - list($namespace, $name) = SimpleSAML\Utils\Attributes::getAttributeNamespace($name, 'http://schemas.xmlsoap.org/claims'); + list($namespace, $name) = \SimpleSAML\Utils\Attributes::getAttributeNamespace( + $name, + 'http://schemas.xmlsoap.org/claims' + ); foreach ($values as $value) { if ((!isset($value)) || ($value === '')) { continue; @@ -74,7 +90,6 @@ private static function generateResponse($issuer, $target, $nameid, $attributes) <saml:AttributeValue>$value</saml:AttributeValue> </saml:Attribute> MSG; - } } @@ -93,19 +108,24 @@ private static function generateResponse($issuer, $target, $nameid, $attributes) return $result; } - private static function signResponse($response, $key, $cert) + private static function signResponse($response, $key, $cert, $algo, $passphrase) { $objXMLSecDSig = new XMLSecurityDSig(); - $objXMLSecDSig->idKeys = array('AssertionID'); - $objXMLSecDSig->setCanonicalMethod(XMLSecurityDSig::EXC_C14N); - $responsedom = \SAML2\DOMDocumentFactory::fromString(str_replace ("\r", "", $response)); + $objXMLSecDSig->idKeys = ['AssertionID']; + $objXMLSecDSig->setCanonicalMethod(XMLSecurityDSig::EXC_C14N); + $responsedom = \SAML2\DOMDocumentFactory::fromString(str_replace("\r", "", $response)); $firstassertionroot = $responsedom->getElementsByTagName('Assertion')->item(0); $objXMLSecDSig->addReferenceList( - array($firstassertionroot), XMLSecurityDSig::SHA1, - array('http://www.w3.org/2000/09/xmldsig#enveloped-signature', XMLSecurityDSig::EXC_C14N), - array('id_name' => 'AssertionID') + [$firstassertionroot], + XMLSecurityDSig::SHA256, + ['http://www.w3.org/2000/09/xmldsig#enveloped-signature', XMLSecurityDSig::EXC_C14N], + ['id_name' => 'AssertionID'] ); - $objKey = new XMLSecurityKey(XMLSecurityKey::RSA_SHA1, array('type'=>'private')); + + $objKey = new XMLSecurityKey($algo, ['type' => 'private']); + if (is_string($passphrase)) { + $objKey->passphrase = $passphrase; + } $objKey->loadKey($key, true); $objXMLSecDSig->sign($objKey); if ($cert) { @@ -113,105 +133,236 @@ private static function signResponse($response, $key, $cert) $objXMLSecDSig->add509Cert($public_cert, true); } $newSig = $responsedom->importNode($objXMLSecDSig->sigNode, true); - $firstassertionroot->appendChild($newSig); + $firstassertionroot->appendChild($newSig); return $responsedom->saveXML(); } private static function postResponse($url, $wresult, $wctx) { - $wresult = htmlspecialchars($wresult); - $wctx = htmlspecialchars($wctx); - - $post = <<<MSG - <body onload="document.forms[0].submit()"> - <form method="post" action="$url"> - <input type="hidden" name="wa" value="wsignin1.0"> - <input type="hidden" name="wresult" value="$wresult"> - <input type="hidden" name="wctx" value="$wctx"> - <noscript> - <input type="submit" value="Continue"> - </noscript> - </form> - </body> -MSG; + $config = \SimpleSAML\Configuration::getInstance(); + $t = new \SimpleSAML\XHTML\Template($config, 'adfs:postResponse.twig'); + $t->data['baseurlpath'] = \SimpleSAML\Module::getModuleURL('adfs'); + $t->data['url'] = $url; + $t->data['wresult'] = $wresult; + $t->data['wctx'] = $wctx; + $t->show(); + } + + + /** + * Get the metadata of a given hosted ADFS IdP. + * + * @param string $entityid The entity ID of the hosted ADFS IdP whose metadata we want to fetch. + * + * @return array + * @throws \SimpleSAML\Error\Exception + * @throws \SimpleSAML\Error\MetadataNotFound + */ + public static function getHostedMetadata($entityid) + { + $handler = \SimpleSAML\Metadata\MetaDataStorageHandler::getMetadataHandler(); + $config = $handler->getMetaDataConfig($entityid, 'adfs-idp-hosted'); + + $endpoint = \SimpleSAML\Module::getModuleURL('adfs/idp/prp.php'); + $metadata = [ + 'metadata-set' => 'adfs-idp-hosted', + 'entityid' => $entityid, + 'SingleSignOnService' => [ + [ + 'Binding' => \SAML2\Constants::BINDING_HTTP_REDIRECT, + 'Location' => $endpoint, + ] + ], + 'SingleLogoutService' => [ + 'Binding' => \SAML2\Constants::BINDING_HTTP_REDIRECT, + 'Location' => $endpoint, + ], + 'NameIDFormat' => $config->getString('NameIDFormat', \SAML2\Constants::NAMEID_TRANSIENT), + 'contacts' => [], + ]; + + // add certificates + $keys = []; + $certInfo = Crypto::loadPublicKey($config, false, 'new_'); + $hasNewCert = false; + if ($certInfo !== null) { + $keys[] = [ + 'type' => 'X509Certificate', + 'signing' => true, + 'encryption' => true, + 'X509Certificate' => $certInfo['certData'], + 'prefix' => 'new_', + ]; + $hasNewCert = true; + } + + $certInfo = Crypto::loadPublicKey($config, true); + $keys[] = [ + 'type' => 'X509Certificate', + 'signing' => true, + 'encryption' => $hasNewCert === false, + 'X509Certificate' => $certInfo['certData'], + 'prefix' => '', + ]; + + if ($config->hasValue('https.certificate')) { + $httpsCert = Crypto::loadPublicKey($config, true, 'https.'); + $keys[] = [ + 'type' => 'X509Certificate', + 'signing' => true, + 'encryption' => false, + 'X509Certificate' => $httpsCert['certData'], + 'prefix' => 'https.' + ]; + } + $metadata['keys'] = $keys; + + // add organization information + if ($config->hasValue('OrganizationName')) { + $metadata['OrganizationName'] = $config->getLocalizedString('OrganizationName'); + $metadata['OrganizationDisplayName'] = $config->getLocalizedString( + 'OrganizationDisplayName', + $metadata['OrganizationName'] + ); + + if (!$config->hasValue('OrganizationURL')) { + throw new \SimpleSAMl\Error\Exception('If OrganizationName is set, OrganizationURL must also be set.'); + } + $metadata['OrganizationURL'] = $config->getLocalizedString('OrganizationURL'); + } - echo $post; - exit; + // add scope + if ($config->hasValue('scope')) { + $metadata['scope'] = $config->getArray('scope'); + } + + // add extensions + if ($config->hasValue('EntityAttributes')) { + $metadata['EntityAttributes'] = $config->getArray('EntityAttributes'); + + // check for entity categories + if (Metadata::isHiddenFromDiscovery($metadata)) { + $metadata['hide.from.discovery'] = true; + } + } + + if ($config->hasValue('UIInfo')) { + $metadata['UIInfo'] = $config->getArray('UIInfo'); + } + + if ($config->hasValue('DiscoHints')) { + $metadata['DiscoHints'] = $config->getArray('DiscoHints'); + } + + if ($config->hasValue('RegistrationInfo')) { + $metadata['RegistrationInfo'] = $config->getArray('RegistrationInfo'); + } + + // add contact information + $globalConfig = \SimpleSAML\Configuration::getInstance(); + $email = $globalConfig->getString('technicalcontact_email', false); + if ($email && $email !== 'na@example.org') { + $contact = [ + 'emailAddress' => $email, + 'name' => $globalConfig->getString('technicalcontact_name', null), + 'contactType' => 'technical', + ]; + $metadata['contacts'][] = Metadata::getContact($contact); + } + + return $metadata; } + public static function sendResponse(array $state) { $spMetadata = $state["SPMetadata"]; $spEntityId = $spMetadata['entityid']; - $spMetadata = SimpleSAML_Configuration::loadFromArray($spMetadata, - '$metadata[' . var_export($spEntityId, true) . ']'); + $spMetadata = \SimpleSAML\Configuration::loadFromArray( + $spMetadata, + '$metadata['.var_export($spEntityId, true).']' + ); $attributes = $state['Attributes']; $nameidattribute = $spMetadata->getValue('simplesaml.nameidattribute'); if (!empty($nameidattribute)) { if (!array_key_exists($nameidattribute, $attributes)) { - throw new Exception('simplesaml.nameidattribute does not exist in resulting attribute set'); + throw new \Exception('simplesaml.nameidattribute does not exist in resulting attribute set'); } $nameid = $attributes[$nameidattribute][0]; } else { - $nameid = SimpleSAML\Utils\Random::generateID(); + $nameid = \SimpleSAML\Utils\Random::generateID(); } - $idp = SimpleSAML_IdP::getByState($state); + $idp = \SimpleSAML\IdP::getByState($state); $idpMetadata = $idp->getConfig(); $idpEntityId = $idpMetadata->getString('entityid'); - $idp->addAssociation(array( - 'id' => 'adfs:' . $spEntityId, - 'Handler' => 'sspmod_adfs_IdP_ADFS', + $idp->addAssociation([ + 'id' => 'adfs:'.$spEntityId, + 'Handler' => '\SimpleSAML\Module\adfs\IdP\ADFS', 'adfs:entityID' => $spEntityId, - )); + ]); + + $assertionLifetime = $spMetadata->getInteger('assertion.lifetime', null); + if ($assertionLifetime === null) { + $assertionLifetime = $idpMetadata->getInteger('assertion.lifetime', 300); + } - $response = sspmod_adfs_IdP_ADFS::generateResponse($idpEntityId, $spEntityId, $nameid, $attributes); + $response = ADFS::generateResponse($idpEntityId, $spEntityId, $nameid, $attributes, $assertionLifetime); $privateKeyFile = \SimpleSAML\Utils\Config::getCertPath($idpMetadata->getString('privatekey')); $certificateFile = \SimpleSAML\Utils\Config::getCertPath($idpMetadata->getString('certificate')); - $wresult = sspmod_adfs_IdP_ADFS::signResponse($response, $privateKeyFile, $certificateFile); + $passphrase = $idpMetadata->getString('privatekey_pass', null); + + $algo = $spMetadata->getString('signature.algorithm', null); + if ($algo === null) { + $algo = $idpMetadata->getString('signature.algorithm', XMLSecurityKey::RSA_SHA256); + } + $wresult = ADFS::signResponse($response, $privateKeyFile, $certificateFile, $algo, $passphrase); $wctx = $state['adfs:wctx']; - sspmod_adfs_IdP_ADFS::postResponse($spMetadata->getValue('prp'), $wresult, $wctx); + $wreply = $state['adfs:wreply'] ? : $spMetadata->getValue('prp'); + ADFS::postResponse($wreply, $wresult, $wctx); } - public static function sendLogoutResponse(SimpleSAML_IdP $idp, array $state) + public static function sendLogoutResponse(\SimpleSAML\IdP $idp, array $state) { // NB:: we don't know from which SP the logout request came from - $metadata = SimpleSAML_Metadata_MetaDataStorageHandler::getMetadataHandler(); $idpMetadata = $idp->getConfig(); - \SimpleSAML\Utils\HTTP::redirectTrustedURL($idpMetadata->getValue('redirect-after-logout', \SimpleSAML\Utils\HTTP::getBaseURL())); + \SimpleSAML\Utils\HTTP::redirectTrustedURL( + $idpMetadata->getValue('redirect-after-logout', \SimpleSAML\Utils\HTTP::getBaseURL()) + ); } - public static function receiveLogoutMessage(SimpleSAML_IdP $idp) + public static function receiveLogoutMessage(\SimpleSAML\IdP $idp) { // if a redirect is to occur based on wreply, we will redirect to url as // this implies an override to normal sp notification if (isset($_GET['wreply']) && !empty($_GET['wreply'])) { $idp->doLogoutRedirect(\SimpleSAML\Utils\HTTP::checkURLAllowed($_GET['wreply'])); - assert('false'); + assert(false); } - $state = array( - 'Responder' => array('sspmod_adfs_IdP_ADFS', 'sendLogoutResponse'), - ); + $state = [ + 'Responder' => ['\SimpleSAML\Module\adfs\IdP\ADFS', 'sendLogoutResponse'], + ]; $assocId = null; - // TODO: verify that this is really no problem for: + // TODO: verify that this is really no problem for: // a) SSP, because there's no caller SP. // b) ADFS SP because caller will be called back.. $idp->handleLogoutRequest($state, $assocId); } // accepts an association array, and returns a URL that can be accessed to terminate the association - public static function getLogoutURL(SimpleSAML_IdP $idp, array $association, $relayState) + public static function getLogoutURL(\SimpleSAML\IdP $idp, array $association, $relayState) { - $metadata = SimpleSAML_Metadata_MetaDataStorageHandler::getMetadataHandler(); - $idpMetadata = $idp->getConfig(); + $metadata = \SimpleSAML\Metadata\MetaDataStorageHandler::getMetadataHandler(); $spMetadata = $metadata->getMetaDataConfig($association['adfs:entityID'], 'adfs-sp-remote'); - $returnTo = SimpleSAML\Module::getModuleURL('adfs/idp/prp.php?assocId=' . urlencode($association["id"]) . '&relayState=' . urlencode($relayState)); - return $spMetadata->getValue('prp') . '?' . 'wa=wsignoutcleanup1.0&wreply=' . urlencode($returnTo); + $returnTo = \SimpleSAML\Module::getModuleURL( + 'adfs/idp/prp.php?assocId='.urlencode($association["id"]).'&relayState='.urlencode($relayState) + ); + return $spMetadata->getValue('prp').'?wa=wsignoutcleanup1.0&wreply='.urlencode($returnTo); } } diff --git a/vendor/simplesamlphp/simplesamlphp/modules/adfs/lib/SAML2/XML/fed/Const.php b/vendor/simplesamlphp/simplesamlphp/modules/adfs/lib/SAML2/XML/fed/Constants.php similarity index 61% rename from vendor/simplesamlphp/simplesamlphp/modules/adfs/lib/SAML2/XML/fed/Const.php rename to vendor/simplesamlphp/simplesamlphp/modules/adfs/lib/SAML2/XML/fed/Constants.php index d24436ca32..db326b3488 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/adfs/lib/SAML2/XML/fed/Const.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/adfs/lib/SAML2/XML/fed/Constants.php @@ -1,10 +1,14 @@ <?php + +namespace SimpleSAML\Module\adfs\SAML2\XML\fed; + /** - * Class representing fed Constants. + * Class holding constants relevant for ADFS. * * @package SimpleSAMLphp */ -class sspmod_adfs_SAML2_XML_fed_Const + +class Constants { /** * The namespace for WS-FED protocol. diff --git a/vendor/simplesamlphp/simplesamlphp/modules/adfs/lib/SAML2/XML/fed/Endpoint.php b/vendor/simplesamlphp/simplesamlphp/modules/adfs/lib/SAML2/XML/fed/Endpoint.php index 8adcc93377..d3ac56ad34 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/adfs/lib/SAML2/XML/fed/Endpoint.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/adfs/lib/SAML2/XML/fed/Endpoint.php @@ -1,21 +1,25 @@ <?php + +namespace SimpleSAML\Module\adfs\SAML2\XML\fed; + /** * Class representing fed Endpoint. * * @package SimpleSAMLphp */ -class sspmod_adfs_SAML2_XML_fed_Endpoint + +class Endpoint { /** * Add this endpoint to an XML element. * - * @param DOMElement $parent The element we should append this endpoint to. + * @param \DOMElement $parent The element we should append this endpoint to. * @param string $name The name of the element we should create. */ - public static function appendXML(DOMElement $parent, $name, $address) + public static function appendXML(\DOMElement $parent, $name, $address) { - assert('is_string($name)'); - assert('is_string($address)'); + assert(is_string($name)); + assert(is_string($address)); $e = $parent->ownerDocument->createElement($name); $parent->appendChild($e); diff --git a/vendor/simplesamlphp/simplesamlphp/modules/adfs/lib/SAML2/XML/fed/SecurityTokenServiceType.php b/vendor/simplesamlphp/simplesamlphp/modules/adfs/lib/SAML2/XML/fed/SecurityTokenServiceType.php index c57c06280a..de386e9f65 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/adfs/lib/SAML2/XML/fed/SecurityTokenServiceType.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/adfs/lib/SAML2/XML/fed/SecurityTokenServiceType.php @@ -1,17 +1,21 @@ <?php + +namespace SimpleSAML\Module\adfs\SAML2\XML\fed; + /** * Class representing SecurityTokenServiceType RoleDescriptor. * * @package SimpleSAMLphp */ -class sspmod_adfs_SAML2_XML_fed_SecurityTokenServiceType extends SAML2_XML_md_RoleDescriptor + +class SecurityTokenServiceType extends \SAML2\XML\md\RoleDescriptor { /** * List of supported protocols. * * @var array */ - public $protocolSupportEnumeration = array(sspmod_adfs_SAML2_XML_fed_Const::NS_FED); + public $protocolSupportEnumeration = [Constants::NS_FED]; /** * The Location of Services. @@ -23,9 +27,9 @@ class sspmod_adfs_SAML2_XML_fed_SecurityTokenServiceType extends SAML2_XML_md_Ro /** * Initialize a SecurityTokenServiceType element. * - * @param DOMElement|null $xml The XML element we should load. + * @param \DOMElement|null $xml The XML element we should load. */ - public function __construct(DOMElement $xml = null) + public function __construct(\DOMElement $xml = null) { parent::__construct('RoleDescriptor', $xml); if ($xml === null) { @@ -36,20 +40,42 @@ public function __construct(DOMElement $xml = null) /** * Convert this SecurityTokenServiceType RoleDescriptor to XML. * - * @param DOMElement $parent The element we should add this contact to. - * @return DOMElement The new ContactPerson-element. + * @param \DOMElement $parent The element we should add this contact to. + * @return \DOMElement The new ContactPerson-element. */ - public function toXML(DOMElement $parent) + public function toXML(\DOMElement $parent) { - assert('is_string($this->Location)'); + assert(is_string($this->Location)); $e = parent::toXML($parent); - $e->setAttributeNS('http://www.w3.org/2000/xmlns/', 'xmlns:fed', sspmod_adfs_SAML2_XML_fed_Const::NS_FED); + $e->setAttributeNS('http://www.w3.org/2000/xmlns/', 'xmlns:fed', Constants::NS_FED); $e->setAttributeNS(\SAML2\Constants::NS_XSI, 'xsi:type', 'fed:SecurityTokenServiceType'); - sspmod_adfs_SAML2_XML_fed_TokenTypesOffered::appendXML($e); - sspmod_adfs_SAML2_XML_fed_Endpoint::appendXML($e, 'SecurityTokenServiceEndpoint', $this->Location); - sspmod_adfs_SAML2_XML_fed_Endpoint::appendXML($e, 'fed:PassiveRequestorEndpoint', $this->Location); + TokenTypesOffered::appendXML($e); + Endpoint::appendXML($e, 'SecurityTokenServiceEndpoint', $this->Location); + Endpoint::appendXML($e, 'fed:PassiveRequestorEndpoint', $this->Location); return $e; } + + + /** + * Get the location of this service. + * + * @return string The full URL where this service can be reached. + */ + public function getLocation() + { + return $this->Location; + } + + + /** + * Set the location of this service. + * + * @param string $location The full URL where this service can be reached. + */ + public function setLocation($location) + { + $this->Location = $location; + } } diff --git a/vendor/simplesamlphp/simplesamlphp/modules/adfs/lib/SAML2/XML/fed/TokenTypesOffered.php b/vendor/simplesamlphp/simplesamlphp/modules/adfs/lib/SAML2/XML/fed/TokenTypesOffered.php index 280b80c3ae..5df8f3f9cc 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/adfs/lib/SAML2/XML/fed/TokenTypesOffered.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/adfs/lib/SAML2/XML/fed/TokenTypesOffered.php @@ -1,22 +1,26 @@ <?php + +namespace SimpleSAML\Module\adfs\SAML2\XML\fed; + /** * Class representing fed TokenTypesOffered. * * @package SimpleSAMLphp */ -class sspmod_adfs_SAML2_XML_fed_TokenTypesOffered + +class TokenTypesOffered { /** * Add tokentypesoffered to an XML element. * - * @param DOMElement $parent The element we should append this endpoint to. + * @param \DOMElement $parent The element we should append this endpoint to. */ - public static function appendXML(DOMElement $parent) + public static function appendXML(\DOMElement $parent) { - $e = $parent->ownerDocument->createElementNS(sspmod_adfs_SAML2_XML_fed_Const::NS_FED, 'fed:TokenTypesOffered'); + $e = $parent->ownerDocument->createElementNS(Constants::NS_FED, 'fed:TokenTypesOffered'); $parent->appendChild($e); - $tokentype = $parent->ownerDocument->createElementNS(sspmod_adfs_SAML2_XML_fed_Const::NS_FED, 'fed:TokenType'); + $tokentype = $parent->ownerDocument->createElementNS(Constants::NS_FED, 'fed:TokenType'); $tokentype->setAttribute('Uri', 'urn:oasis:names:tc:SAML:1.0:assertion'); $e->appendChild($tokentype); diff --git a/vendor/simplesamlphp/simplesamlphp/modules/adfs/lib/XMLSecurityDSig.php b/vendor/simplesamlphp/simplesamlphp/modules/adfs/lib/XMLSecurityDSig.php deleted file mode 100644 index 80b029efb4..0000000000 --- a/vendor/simplesamlphp/simplesamlphp/modules/adfs/lib/XMLSecurityDSig.php +++ /dev/null @@ -1,32 +0,0 @@ -<?php - -/** - * This class should be considered a temporary workaround to - * solve the lack of custom formatting in XMLSecurityDSig - * (xmlseclibs). It should be possible to either configure - * the original class to avoid formatting, or to use a custom - * template for the signature. - * - * @todo Move this functionality to xmlseclibs. - * - * @author Daniel Tsosie - * @package SimpleSAMLphp - */ -class sspmod_adfs_XMLSecurityDSig extends XMLSecurityDSig -{ - function __construct($metaxml) - { - $template = ''; - - if (strpos("\n", $metaxml) === false) { - foreach (explode("\n", self::template) as $line) { - $template .= trim($line); - } - } else { - $template = self::template; - } - - $sigdoc = \SAML2\DOMDocumentFactory::fromString($template); - $this->sigNode = $sigdoc->documentElement; - } -} diff --git a/vendor/simplesamlphp/simplesamlphp/modules/adfs/templates/postResponse.twig b/vendor/simplesamlphp/simplesamlphp/modules/adfs/templates/postResponse.twig new file mode 100644 index 0000000000..857aa8d7ab --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/modules/adfs/templates/postResponse.twig @@ -0,0 +1,16 @@ +<!DOCTYPE html> +<html> + <head> + <script src="{{ baseurlpath }}/assets/js/postResponse.js"></script> + </head> + <body> + <form method="post" action="{{ url }}"> + <input type="hidden" name="wa" value="wsignin1.0"> + <input type="hidden" name="wresult" value="{{ wresult|escape('html') }}"> + <input type="hidden" name="wctx" value="{{ wctx|escape('html') }}"> + <noscript> + <input type="submit" value="Continue"> + </noscript> + </form> + </body> +</html> diff --git a/vendor/simplesamlphp/simplesamlphp/modules/adfs/www/assets/js/postResponse.js b/vendor/simplesamlphp/simplesamlphp/modules/adfs/www/assets/js/postResponse.js new file mode 100644 index 0000000000..a813b92cbe --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/modules/adfs/www/assets/js/postResponse.js @@ -0,0 +1,3 @@ +document.addEventListener('DOMContentLoaded', function () { + document.forms[0].submit(); +}); diff --git a/vendor/simplesamlphp/simplesamlphp/modules/adfs/www/idp/metadata.php b/vendor/simplesamlphp/simplesamlphp/modules/adfs/www/idp/metadata.php index b52f8ef5b3..473af96dc6 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/adfs/www/idp/metadata.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/adfs/www/idp/metadata.php @@ -1,79 +1,78 @@ <?php // load configuration and metadata -$config = SimpleSAML_Configuration::getInstance(); -$metadata = SimpleSAML_Metadata_MetaDataStorageHandler::getMetadataHandler(); +$config = \SimpleSAML\Configuration::getInstance(); +$metadata = \SimpleSAML\Metadata\MetaDataStorageHandler::getMetadataHandler(); if (!$config->getBoolean('enable.adfs-idp', false)) { - throw new SimpleSAML_Error_Error('NOACCESS'); + throw new \SimpleSAML\Error\Error('NOACCESS'); } // check if valid local session exists if ($config->getBoolean('admin.protectmetadata', false)) { - SimpleSAML\Utils\Auth::requireAdmin(); + \SimpleSAML\Utils\Auth::requireAdmin(); } try { $idpentityid = isset($_GET['idpentityid']) ? - $_GET['idpentityid'] : - $metadata->getMetaDataCurrentEntityID('adfs-idp-hosted'); + $_GET['idpentityid'] : $metadata->getMetaDataCurrentEntityID('adfs-idp-hosted'); $idpmeta = $metadata->getMetaDataConfig($idpentityid, 'adfs-idp-hosted'); - $availableCerts = array(); + $availableCerts = []; - $keys = array(); - $certInfo = SimpleSAML\Utils\Crypto::loadPublicKey($idpmeta, false, 'new_'); + $keys = []; + $certInfo = \SimpleSAML\Utils\Crypto::loadPublicKey($idpmeta, false, 'new_'); if ($certInfo !== null) { $availableCerts['new_idp.crt'] = $certInfo; - $keys[] = array( + $keys[] = [ 'type' => 'X509Certificate', 'signing' => true, 'encryption' => true, 'X509Certificate' => $certInfo['certData'], - ); + ]; $hasNewCert = true; } else { $hasNewCert = false; } - $certInfo = SimpleSAML\Utils\Crypto::loadPublicKey($idpmeta, true); + $certInfo = \SimpleSAML\Utils\Crypto::loadPublicKey($idpmeta, true); $availableCerts['idp.crt'] = $certInfo; - $keys[] = array( + $keys[] = [ 'type' => 'X509Certificate', 'signing' => true, 'encryption' => ($hasNewCert ? false : true), 'X509Certificate' => $certInfo['certData'], - ); + ]; if ($idpmeta->hasValue('https.certificate')) { - $httpsCert = SimpleSAML\Utils\Crypto::loadPublicKey($idpmeta, true, 'https.'); - assert('isset($httpsCert["certData"])'); + $httpsCert = \SimpleSAML\Utils\Crypto::loadPublicKey($idpmeta, true, 'https.'); + assert(isset($httpsCert['certData'])); $availableCerts['https.crt'] = $httpsCert; - $keys[] = array( + $keys[] = [ 'type' => 'X509Certificate', 'signing' => true, 'encryption' => false, 'X509Certificate' => $httpsCert['certData'], - ); + ]; } - $adfs_service_location = SimpleSAML\Module::getModuleURL('adfs').'/idp/prp.php'; - $metaArray = array( + $adfs_service_location = \SimpleSAML\Module::getModuleURL('adfs').'/idp/prp.php'; + $metaArray = [ 'metadata-set' => 'adfs-idp-remote', 'entityid' => $idpentityid, - 'SingleSignOnService' => array( - 0 => array( + 'SingleSignOnService' => [ + 0 => [ 'Binding' => \SAML2\Constants::BINDING_HTTP_REDIRECT, 'Location' => $adfs_service_location - ) - ), - 'SingleLogoutService' => array( - 0 => array( + ] + ], + 'SingleLogoutService' => [ + 0 => [ 'Binding' => \SAML2\Constants::BINDING_HTTP_REDIRECT, 'Location' => $adfs_service_location - ) - ), - ); + ] + ], + ]; if (count($keys) === 1) { $metaArray['certData'] = $keys[0]['X509Certificate']; @@ -94,7 +93,7 @@ ); if (!$idpmeta->hasValue('OrganizationURL')) { - throw new SimpleSAML_Error_Exception('If OrganizationName is set, OrganizationURL must also be set.'); + throw new \SimpleSAML\Error\Exception('If OrganizationName is set, OrganizationURL must also be set.'); } $metaArray['OrganizationURL'] = $idpmeta->getLocalizedString('OrganizationURL'); } @@ -121,16 +120,16 @@ $metaflat = '$metadata['.var_export($idpentityid, true).'] = '.var_export($metaArray, true).';'; - $metaBuilder = new SimpleSAML_Metadata_SAMLBuilder($idpentityid); + $metaBuilder = new \SimpleSAML\Metadata\SAMLBuilder($idpentityid); $metaBuilder->addSecurityTokenServiceType($metaArray); $metaBuilder->addOrganizationInfo($metaArray); $technicalContactEmail = $config->getString('technicalcontact_email', null); if ($technicalContactEmail && $technicalContactEmail !== 'na@example.org') { - $metaBuilder->addContact('technical', \SimpleSAML\Utils\Config\Metadata::getContact(array( + $metaBuilder->addContact('technical', \SimpleSAML\Utils\Config\Metadata::getContact([ 'emailAddress' => $technicalContactEmail, 'name' => $config->getString('technicalcontact_name', null), 'contactType' => 'technical', - ))); + ])); } $output_xhtml = array_key_exists('output', $_GET) && $_GET['output'] == 'xhtml'; $metaxml = $metaBuilder->getEntityDescriptorText($output_xhtml); @@ -139,17 +138,30 @@ } // sign the metadata if enabled - $metaxml = SimpleSAML_Metadata_Signer::sign($metaxml, $idpmeta->toArray(), 'ADFS IdP'); + $metaxml = \SimpleSAML\Metadata\Signer::sign($metaxml, $idpmeta->toArray(), 'ADFS IdP'); if ($output_xhtml) { $defaultidp = $config->getString('default-adfs-idp', null); - $t = new SimpleSAML_XHTML_Template($config, 'metadata.php', 'admin'); + $t = new \SimpleSAML\XHTML\Template($config, 'metadata.php', 'admin'); $t->data['clipboard.js'] = true; $t->data['available_certs'] = $availableCerts; + $certdata = []; + foreach (array_keys($availableCerts) as $availableCert) { + $certdata[$availableCert]['name'] = $availableCert; + $certdata[$availableCert]['url'] = \SimpleSAML\Module::getModuleURL('saml/idp/certs.php'). + '/'.$availableCert; + + $certdata[$availableCert]['comment'] = ''; + if ($availableCerts[$availableCert]['certFingerprint'][0] === 'afe71c28ef740bc87425be13a2263d37971da1f9') { + $certdata[$availableCert]['comment'] = 'This is the default certificate.'. + ' Generate a new certificate if this is a production system.'; + } + } + $t->data['certdata'] = $certdata; $t->data['header'] = 'adfs-idp'; // TODO: Replace with headerString in 2.0 - $t->data['headerString'] = $t->noop('metadata_adfs-idp'); + $t->data['headerString'] = \SimpleSAML\Locale\Translate::noop('metadata_adfs-idp'); $t->data['metaurl'] = \SimpleSAML\Utils\HTTP::getSelfURLNoQuery(); $t->data['metadata'] = htmlspecialchars($metaxml); $t->data['metadataflat'] = htmlspecialchars($metaflat); @@ -166,6 +178,6 @@ exit(0); } -} catch (Exception $exception) { - throw new SimpleSAML_Error_Error('METADATA', $exception); +} catch (\Exception $exception) { + throw new \SimpleSAML\Error\Error('METADATA', $exception); } diff --git a/vendor/simplesamlphp/simplesamlphp/modules/adfs/www/idp/prp.php b/vendor/simplesamlphp/simplesamlphp/modules/adfs/www/idp/prp.php index 807e36506f..03a973b116 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/adfs/www/idp/prp.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/adfs/www/idp/prp.php @@ -1,4 +1,5 @@ <?php + /** * ADFS PRP IDP protocol support for SimpleSAMLphp. * @@ -6,23 +7,23 @@ * @package SimpleSAMLphp */ -SimpleSAML\Logger::info('ADFS - IdP.prp: Accessing ADFS IdP endpoint prp'); +\SimpleSAML\Logger::info('ADFS - IdP.prp: Accessing ADFS IdP endpoint prp'); -$metadata = SimpleSAML_Metadata_MetaDataStorageHandler::getMetadataHandler(); +$metadata = \SimpleSAML\Metadata\MetaDataStorageHandler::getMetadataHandler(); $idpEntityId = $metadata->getMetaDataCurrentEntityID('adfs-idp-hosted'); -$idp = SimpleSAML_IdP::getById('adfs:' . $idpEntityId); +$idp = \SimpleSAML\IdP::getById('adfs:'.$idpEntityId); if (isset($_GET['wa'])) { if ($_GET['wa'] === 'wsignout1.0') { - sspmod_adfs_IdP_ADFS::receiveLogoutMessage($idp); - } else if ($_GET['wa'] === 'wsignin1.0') { - sspmod_adfs_IdP_ADFS::receiveAuthnRequest($idp); + \SimpleSAML\Module\adfs\IdP\ADFS::receiveLogoutMessage($idp); + } elseif ($_GET['wa'] === 'wsignin1.0') { + \SimpleSAML\Module\adfs\IdP\ADFS::receiveAuthnRequest($idp); } - assert('false'); + assert(false); } elseif (isset($_GET['assocId'])) { // logout response from ADFS SP $assocId = $_GET['assocId']; // Association ID of the SP that sent the logout response $relayState = $_GET['relayState']; // Data that was sent in the logout request to the SP. Can be null - $logoutError = null; // null on success, or an instance of a SimpleSAML_Error_Exception on failure. + $logoutError = null; // null on success, or an instance of a \SimpleSAML\Error\Exception on failure. $idp->handleLogoutResponse($assocId, $relayState, $logoutError); } diff --git a/vendor/simplesamlphp/simplesamlphp/modules/admin/default-enable b/vendor/simplesamlphp/simplesamlphp/modules/admin/default-enable new file mode 100644 index 0000000000..e69de29bb2 diff --git a/vendor/simplesamlphp/simplesamlphp/modules/admin/lib/ConfigController.php b/vendor/simplesamlphp/simplesamlphp/modules/admin/lib/ConfigController.php new file mode 100644 index 0000000000..217010a17e --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/modules/admin/lib/ConfigController.php @@ -0,0 +1,410 @@ +<?php + +namespace SimpleSAML\Module\admin; + +use SimpleSAML\HTTP\RunnableResponse; +use SimpleSAML\Locale\Translate; +use SimpleSAML\Utils\HTTP; +use Symfony\Component\HttpFoundation\Request; + +/** + * Controller class for the admin module. + * + * This class serves the configuration views available in the module. + * + * @package SimpleSAML\Module\admin + */ +class ConfigController +{ + const LATEST_VERSION_STATE_KEY = 'core:latest_simplesamlphp_version'; + const RELEASES_API = 'https://api.github.com/repos/simplesamlphp/simplesamlphp/releases/latest'; + + /** @var \SimpleSAML\Configuration */ + protected $config; + + /** @var Menu */ + protected $menu; + + /** @var \SimpleSAML\Session */ + protected $session; + + + /** + * ConfigController constructor. + * + * @param \SimpleSAML\Configuration $config The configuration to use. + * @param \SimpleSAML\Session $session The current user session. + */ + public function __construct(\SimpleSAML\Configuration $config, \SimpleSAML\Session $session) + { + $this->config = $config; + $this->session = $session; + $this->menu = new Menu(); + } + + + /** + * Display basic diagnostic information on hostname, port and protocol. + * + * @param Request $request The current request. + * + * @return \SimpleSAML\XHTML\Template + */ + public function diagnostics(Request $request) + { + \SimpleSAML\Utils\Auth::requireAdmin(); + + $t = new \SimpleSAML\XHTML\Template($this->config, 'admin:diagnostics.twig'); + $t->data = [ + 'remaining' => $this->session->getAuthData('admin', 'Expire') - time(), + 'logouturl' => \SimpleSAML\Utils\Auth::getAdminLogoutURL(), + 'items' => [ + 'HTTP_HOST' => [$request->getHost()], + 'HTTPS' => $request->isSecure() ? ['on'] : [], + 'SERVER_PROTOCOL' => [$request->getProtocolVersion()], + 'getBaseURL()' => [HTTP::getBaseURL()], + 'getSelfHost()' => [HTTP::getSelfHost()], + 'getSelfHostWithNonStandardPort()' => [HTTP::getSelfHostWithNonStandardPort()], + 'getSelfURLHost()' => [HTTP::getSelfURLHost()], + 'getSelfURLNoQuery()' => [HTTP::getSelfURLNoQuery()], + 'getSelfHostWithPath()' => [HTTP::getSelfHostWithPath()], + 'getFirstPathElement()' => [HTTP::getFirstPathElement()], + 'getSelfURL()' => [HTTP::getSelfURL()], + ], + ]; + + $this->menu->addOption('logout', \SimpleSAML\Utils\Auth::getAdminLogoutURL(), Translate::noop('Log out')); + return $this->menu->insert($t); + } + + + /** + * Display the main admin page. + * + * @return \SimpleSAML\XHTML\Template + */ + public function main() + { + \SimpleSAML\Utils\Auth::requireAdmin(); + + $t = new \SimpleSAML\XHTML\Template($this->config, 'admin:config.twig'); + $t->data = [ + 'warnings' => $this->getWarnings(), + 'directory' => $this->config->getBaseDir(), + 'version' => $this->config->getVersion(), + 'links' => [ + [ + 'href' => \SimpleSAML\Module::getModuleURL('admin/diagnostics'), + 'text' => Translate::noop('Diagnostics on hostname, port and protocol') + ], + [ + 'href' => \SimpleSAML\Module::getModuleURL('admin/phpinfo'), + 'text' => Translate::noop('Information on your PHP installation') + ] + ], + 'enablematrix' => [ + 'saml20idp' => $this->config->getBoolean('enable.saml20-idp', false), + 'shib13idp' => $this->config->getBoolean('enable.shib13-idp', false), + ], + 'funcmatrix' => $this->getPrerequisiteChecks(), + 'logouturl' => \SimpleSAML\Utils\Auth::getAdminLogoutURL(), + ]; + + \SimpleSAML\Module::callHooks('configpage', $t); + $this->menu->addOption('logout', \SimpleSAML\Utils\Auth::getAdminLogoutURL(), Translate::noop('Log out')); + return $this->menu->insert($t); + } + + + /** + * Display the output of phpinfo(). + * + * @return RunnableResponse + */ + public function phpinfo() + { + Utils\Auth::requireAdmin(); + + return new RunnableResponse('phpinfo'); + } + + + /** + * Perform a list of checks on the current installation, and return the results as an array. + * + * The elements in the array returned are also arrays with the following keys: + * + * - required: Whether this prerequisite is mandatory or not. One of "required" or "optional". + * - descr: A translatable text that describes the prerequisite. If the text uses parameters, the value must be an + * array where the first value is the text to translate, and the second is a hashed array containing the + * parameters needed to properly translate the text. + * - enabled: True if the prerequisite is met, false otherwise. + * + * @return array + */ + protected function getPrerequisiteChecks() + { + $matrix = [ + [ + 'required' => 'required', + 'descr' => [ + Translate::noop('PHP %minimum% or newer is needed. You are running: %current%'), + [ + '%minimum%' => '5.5', + '%current%' => explode('-', phpversion())[0] + ] + ], + 'enabled' => version_compare(phpversion(), '5.5', '>=') + ] + ]; + $store = $this->config->getString('store.type', ''); + + // check dependencies used via normal functions + $functions = [ + 'time' => [ + 'required' => 'required', + 'descr' => [ + 'required' => Translate::noop('Date/Time Extension'), + ] + ], + 'hash' => [ + 'required' => 'required', + 'descr' => [ + 'required' => Translate::noop('Hashing function'), + ] + ], + 'gzinflate' => [ + 'required' => 'required', + 'descr' => [ + 'required' => Translate::noop('ZLib'), + ] + ], + 'openssl_sign' => [ + 'required' => 'required', + 'descr' => [ + 'required' => Translate::noop('OpenSSL'), + ] + ], + 'dom_import_simplexml' => [ + 'required' => 'required', + 'descr' => [ + 'required' => Translate::noop('XML DOM'), + ] + ], + 'preg_match' => [ + 'required' => 'required', + 'descr' => [ + 'required' => Translate::noop('Regular expression support'), + ] + ], + 'json_decode' => [ + 'required' => 'required', + 'descr' => [ + 'required' => Translate::noop('JSON support'), + ] + ], + 'class_implements' => [ + 'required' => 'required', + 'descr' => [ + 'required' => Translate::noop('Standard PHP library (SPL)'), + ] + ], + 'mb_strlen' => [ + 'required' => 'required', + 'descr' => [ + 'required' => Translate::noop('Multibyte String extension'), + ] + ], + 'curl_init' => [ + 'required' => $this->config->getBoolean('admin.checkforupdates', true) ? 'required' : 'optional', + 'descr' => [ + 'optional' => Translate::noop( + 'cURL (might be required by some modules)' + ), + 'required' => Translate::noop( + 'cURL (required if automatic version checks are used, also by some modules)' + ), + ] + ], + 'session_start' => [ + 'required' => $store === 'phpsession' ? 'required' : 'optional', + 'descr' => [ + 'optional' => Translate::noop('Session extension (required if PHP sessions are used)'), + 'required' => Translate::noop('Session extension'), + ] + ], + 'pdo_drivers' => [ + 'required' => $store === 'sql' ? 'required' : 'optional', + 'descr' => [ + 'optional' => Translate::noop('PDO Extension (required if a database backend is used)'), + 'required' => Translate::noop('PDO extension'), + ] + ], + 'ldap_bind' => [ + 'required' => \SimpleSAML\Module::isModuleEnabled('ldap') ? 'required' : 'optional', + 'descr' => [ + 'optional' => Translate::noop('LDAP extension (required if an LDAP backend is used)'), + 'required' => Translate::noop('LDAP extension'), + ] + ], + 'radius_auth_open' => [ + 'required' => \SimpleSAML\Module::isModuleEnabled('radius') ? 'required' : 'optional', + 'descr' => [ + 'optional' => Translate::noop('Radius extension (required if a radius backend is used)'), + 'required' => Translate::noop('Radius extension'), + ] + ], + ]; + + foreach ($functions as $function => $description) { + $matrix[] = [ + 'required' => $description['required'], + 'descr' => $description['descr'][$description['required']], + 'enabled' => function_exists($function), + ]; + } + + // check object-oriented external libraries and extensions + $libs = [ + [ + 'classes' => ['\Predis\Predis'], + 'required' => $store === 'redis' ? 'required' : 'optional', + 'descr' => [ + 'optional' => Translate::noop('predis/predis (required if the redis data store is used)'), + 'required' => Translate::noop('predis/predis library'), + ] + ], + [ + 'classes' => ['\Memcache', '\Memcached'], + 'required' => $store === 'memcache' ? 'required' : 'optional', + 'descr' => [ + 'optional' => Translate::noop( + 'Memcache or Memcached extension (required if the memcache backend is used)' + ), + 'required' => Translate::noop('Memcache or Memcached extension'), + ] + ] + ]; + + foreach ($libs as $lib) { + $enabled = false; + foreach ($lib['classes'] as $class) { + $enabled |= class_exists($class); + } + $matrix[] = [ + 'required' => $lib['required'], + 'descr' => $lib['descr'][$lib['required']], + 'enabled' => $enabled, + ]; + } + + // perform some basic configuration checks + $matrix[] = [ + 'required' => 'optional', + 'descr' => Translate::noop('The <code>technicalcontact_email</code> configuration option should be set'), + 'enabled' => $this->config->getString('technicalcontact_email', 'na@example.org') !== 'na@example.org', + ]; + + $matrix[] = [ + 'required' => 'required', + 'descr' => Translate::noop('The auth.adminpassword configuration option must be set'), + 'enabled' => $this->config->getString('auth.adminpassword', '123') !== '123', + ]; + + return $matrix; + } + + + /** + * Compile a list of warnings about the current deployment. + * + * The returned array can contain either strings that can be translated directly, or arrays. If an element is an + * array, the first value in that array is a string that can be translated, and the second value will be a hashed + * array that contains the substitutions that must be applied to the translation, with its corresponding value. This + * can be used in twig like this, assuming an element called "e": + * + * {{ e[0]|trans(e[1])|raw }} + * + * @return array + */ + protected function getWarnings() + { + $warnings = []; + + // make sure we're using HTTPS + if (!\SimpleSAML\Utils\HTTP::isHTTPS()) { + $warnings[] = Translate::noop( + '<strong>You are not using HTTPS</strong> to protect communications with your users. HTTP works fine '. + 'for testing purposes, but in a production environment you should use HTTPS. <a '. + 'href="https://simplesamlphp.org/docs/stable/simplesamlphp-maintenance">Read more about the '. + 'maintenance of SimpleSAMLphp</a>.' + ); + } + + // make sure we have a secret salt set + if ($this->config->getValue('secretsalt') === 'defaultsecretsalt') { + $warnings[] = Translate::noop( + '<strong>The configuration uses the default secret salt</strong>. Make sure to modify the <code>'. + 'secretsalt</code> option in the SimpleSAMLphp configuration in production environments. <a '. + 'href="https://simplesamlphp.org/docs/stable/simplesamlphp-install">Read more about the '. + 'maintenance of SimpleSAMLphp</a>.' + ); + } + + // check for URL limitations + if (extension_loaded('suhosin')) { + $len = ini_get('suhosin.get.max_value_length'); + if (empty($len) || $len < 2048) { + $warnings[] = Translate::noop( + 'The length of query parameters is limited by the PHP Suhosin extension. Please increase the '. + '<code>suhosin.get.max_value_length</code> option in your php.ini to at least 2048 bytes.' + ); + } + } + + /* + * Check for updates. Store the remote result in the session so we don't need to fetch it on every access to + * this page. + */ + if ($this->config->getBoolean('admin.checkforupdates', true) && $this->config->getVersion() !== 'master') { + if (!function_exists('curl_init')) { + $warnings[] = Translate::noop( + 'The cURL PHP extension is missing. Cannot check for SimpleSAMLphp updates.' + ); + } else { + $latest = $this->session->getData(self::LATEST_VERSION_STATE_KEY, "version"); + + if (!$latest) { + $ch = curl_init(self::RELEASES_API); + curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); + curl_setopt($ch, CURLOPT_USERAGENT, 'SimpleSAMLphp'); + curl_setopt($ch, CURLOPT_TIMEOUT, 2); + curl_setopt($ch, CURLOPT_PROXY, $this->config->getString('proxy', null)); + curl_setopt($ch, CURLOPT_PROXYUSERPWD, $this->config->getValue('proxy.auth', null)); + $response = curl_exec($ch); + + if (curl_getinfo($ch, CURLINFO_HTTP_CODE) === 200) { + $latest = json_decode($response, true); + $this->session->setData(self::LATEST_VERSION_STATE_KEY, 'version', $latest); + } + curl_close($ch); + } + + + if ($latest && version_compare($this->config->getVersion(), ltrim($latest['tag_name'], 'v'), 'lt')) { + $warnings[] = [ + Translate::noop( + 'You are running an outdated version of SimpleSAMLphp. Please update to <a href="'. + '%latest%">the latest version</a> as soon as possible.' + ), + [ + '%latest%' => $latest['html_url'] + ] + ]; + } + } + } + + return $warnings; + } +} diff --git a/vendor/simplesamlphp/simplesamlphp/modules/admin/lib/FederationController.php b/vendor/simplesamlphp/simplesamlphp/modules/admin/lib/FederationController.php new file mode 100644 index 0000000000..a6608ac627 --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/modules/admin/lib/FederationController.php @@ -0,0 +1,374 @@ +<?php + +namespace SimpleSAML\Module\admin; + +use SimpleSAML\Locale\Translate; +use SimpleSAML\Metadata\MetaDataStorageHandler; +use SimpleSAML\Metadata\SAMLBuilder; +use SimpleSAML\Module; +use SimpleSAML\Module\adfs\IdP\ADFS as ADFS_IdP; +use SimpleSAML\Module\saml\IdP\SAML1 as SAML1_IdP; +use SimpleSAML\Module\saml\IdP\SAML2 as SAML2_IdP; +use SimpleSAML\Utils\Auth; + +/** + * Controller class for the admin module. + * + * This class serves the federation views available in the module. + * + * @package SimpleSAML\Module\admin + */ +class FederationController +{ + + /** @var \SimpleSAML\Configuration */ + protected $config; + + /** @var MetaDataStorageHandler */ + protected $mdHandler; + + /** @var Menu */ + protected $menu; + + + /** + * FederationController constructor. + * + * @param \SimpleSAML\Configuration $config The configuration to use. + */ + public function __construct(\SimpleSAML\Configuration $config) + { + $this->config = $config; + $this->menu = new Menu(); + $this->mdHandler = MetaDataStorageHandler::getMetadataHandler(); + } + + + /** + * Display the federation page. + * + * @return \SimpleSAML\XHTML\Template + * @throws \SimpleSAML\Error\Exception + * @throws \SimpleSAML_Error_Exception + */ + public function main() + { + Auth::requireAdmin(); + + // initialize basic metadata array + $hostedSPs = $this->getHostedSP(); + $hostedIdPs = $this->getHostedIdP(); + $entries = [ + 'hosted' => array_merge($hostedSPs, $hostedIdPs), + 'remote' => [ + 'saml20-idp-remote' => !empty($hostedSPs) ? $this->mdHandler->getList('saml20-idp-remote') : [], + 'shib13-idp-remote' => !empty($hostedSPs) ? $this->mdHandler->getList('shib13-idp-remote') : [], + 'saml20-sp-remote' => $this->config->getBoolean('enable.saml20-idp', false) === true + ? $this->mdHandler->getList('saml20-sp-remote') : [], + 'shib13-sp-remote' => $this->config->getBoolean('enable.shib13-idp', false) === true + ? $this->mdHandler->getList('shib13-sp-remote') : [], + 'adfs-sp-remote' => ($this->config->getBoolean('enable.adfs-idp', false) === true) && + Module::isModuleEnabled('adfs') ? $this->mdHandler->getList('adfs-sp-remote') : [], + ], + ]; + + // initialize template and language + $t = new \SimpleSAML\XHTML\Template($this->config, 'admin:federation.twig'); + $language = $t->getTranslator()->getLanguage()->getLanguage(); + $defaultLang = $this->config->getString('language.default', 'en'); + + // process hosted entities + foreach ($entries['hosted'] as $index => $entity) { + if (isset($entity['name']) && is_string($entity['name'])) { + // if the entity has no internationalized name, fake it + $entries['hosted'][$index]['name'] = [$language => $entity['name']]; + } + } + + // clean up empty remote entries + foreach ($entries['remote'] as $key => $value) { + if (empty($value)) { + unset($entries['remote'][$key]); + } + } + + $translators = [ + 'name' => 'name_translated', + 'descr' => 'descr_translated', + 'OrganizationDisplayName' => 'organizationdisplayname_translated', + ]; + + foreach ($entries['remote'] as $key => $set) { + foreach ($set as $entityid => $entity) { + foreach ($translators as $old => $new) { + if (isset($entity[$old][$language])) { + $entries['remote'][$key][$entityid][$new] = $entity[$old][$language]; + } elseif (isset($entity[$old][$defaultLang])) { + $entries['remote'][$key][$entityid][$new] = $entity[$old][$defaultLang]; + } elseif (isset($entity[$old]['en'])) { + $entries['remote'][$key][$entityid][$new] = $entity[$old]['en']; + } elseif (isset($entries['remote'][$key][$entityid][$old])) { + $entries['remote'][$key][$entityid][$new] = $entries['remote'][$key][$entityid][$old]; + } + } + } + } + + $t->data = [ + 'links' => [ + [ + 'href' => Module::getModuleURL('admin/metadata-converter'), + 'text' => Translate::noop('XML to SimpleSAMLphp metadata converter'), + ] + ], + 'entries' => $entries, + 'mdtype' => [ + 'saml20-sp-remote' => Translate::noop('SAML 2.0 SP metadata'), + 'saml20-sp-hosted' => Translate::noop('SAML 2.0 SP metadata'), + 'saml20-idp-remote' => Translate::noop('SAML 2.0 IdP metadata'), + 'saml20-idp-hosted' => Translate::noop('SAML 2.0 IdP metadata'), + 'shib13-sp-remote' => Translate::noop('SAML 1.1 SP metadata'), + 'shib13-sp-hosted' => Translate::noop('SAML 1.1 SP metadata'), + 'shib13-idp-remote' => Translate::noop('SAML 1.1 IdP metadata'), + 'shib13-idp-hosted' => Translate::noop('SAML 1.1 IdP metadata'), + 'adfs-sp-remote' => Translate::noop('ADFS SP metadata'), + 'adfs-sp-hosted' => Translate::noop('ADFS SP metadata'), + 'adfs-idp-remote' => Translate::noop('ADFS IdP metadata'), + 'adfs-idp-hosted' => Translate::noop('ADFS IdP metadata'), + ], + 'logouturl' => Auth::getAdminLogoutURL(), + ]; + + Module::callHooks('federationpage', $t); + $this->menu->addOption('logout', $t->data['logouturl'], Translate::noop('Log out')); + return $this->menu->insert($t); + } + + + /** + * Get a list of the hosted IdP entities, including SAML 2, SAML 1.1 and ADFS. + * + * @return array + * @throws \Exception + */ + private function getHostedIdP() + { + $entities = []; + + // SAML 2 + if ($this->config->getBoolean('enable.saml20-idp', false)) { + try { + $idps = $this->mdHandler->getList('saml20-idp-hosted'); + $saml2entities = []; + if (count($idps) > 1) { + foreach ($idps as $index => $idp) { + $idp['url'] = Module::getModuleURL('saml/2/idp/metadata/'.$idp['auth']); + $idp['metadata-set'] = 'saml20-idp-hosted'; + $idp['metadata-index'] = $index; + $idp['metadata_array'] = SAML2_IdP::getHostedMetadata($idp['entityid']); + $saml2entities[] = $idp; + } + } else { + $saml2entities['saml20-idp'] = $this->mdHandler->getMetaDataCurrent('saml20-idp-hosted'); + $saml2entities['saml20-idp']['url'] = \SimpleSAML\Utils\HTTP::getBaseURL().'saml2/idp/metadata.php'; + $saml2entities['saml20-idp']['metadata_array'] = + SAML2_IdP::getHostedMetadata( + $this->mdHandler->getMetaDataCurrentEntityID('saml20-idp-hosted') + ); + } + + foreach ($saml2entities as $index => $entity) { + $builder = new SAMLBuilder($entity['entityid']); + $builder->addMetadataIdP20($entity['metadata_array']); + $builder->addOrganizationInfo($entity['metadata_array']); + foreach ($entity['metadata_array']['contacts'] as $contact) { + $builder->addContact($contact['contactType'], $contact); + } + + $entity['metadata'] = \SimpleSAML\Metadata\Signer::sign( + $builder->getEntityDescriptorText(), + $entity['metadata_array'], + 'SAML 2 IdP' + ); + $entities[$index] = $entity; + } + } catch (\Exception $e) { + \SimpleSAML\Logger::error('Federation: Error loading saml20-idp: '.$e->getMessage()); + } + } + + // SAML 1.1 / Shib13 + if ($this->config->getBoolean('enable.shib13-idp', false)) { + try { + $idps = $this->mdHandler->getList('shib13-idp-hosted'); + $shib13entities = []; + if (count($idps) > 1) { + foreach ($idps as $index => $idp) { + $idp['url'] = Module::getModuleURL('saml/1.1/idp/metadata/'.$idp['auth']); + $idp['metadata-set'] = 'shib13-idp-hosted'; + $idp['metadata-index'] = $index; + $idp['metadata_array'] = SAML1_IdP::getHostedMetadata($idp['entityid']); + $shib13entities[] = $idp; + } + } else { + $shib13entities['shib13-idp'] = $this->mdHandler->getMetaDataCurrent('shib13-idp-hosted'); + $shib13entities['shib13-idp']['url'] = \SimpleSAML\Utils\HTTP::getBaseURL(). + 'shib13/idp/metadata.php'; + $shib13entities['shib13-idp']['metadata_array'] = + SAML1_IdP::getHostedMetadata( + $this->mdHandler->getMetaDataCurrentEntityID('shib13-idp-hosted') + ); + } + + foreach ($shib13entities as $index => $entity) { + $builder = new SAMLBuilder($entity['entityid']); + $builder->addMetadataIdP11($entity['metadata_array']); + $builder->addOrganizationInfo($entity['metadata_array']); + foreach ($entity['metadata_array']['contacts'] as $contact) { + $builder->addContact($contact['contactType'], $contact); + } + + $entity['metadata'] = \SimpleSAML\Metadata\Signer::sign( + $builder->getEntityDescriptorText(), + $entity['metadata_array'], + 'SAML 2 SP' + ); + $entities[$index] = $entity; + } + } catch (\Exception $e) { + \SimpleSAML\Logger::error('Federation: Error loading shib13-idp: '.$e->getMessage()); + } + } + + // ADFS + if ($this->config->getBoolean('enable.adfs-idp', false) && Module::isModuleEnabled('adfs')) { + try { + $idps = $this->mdHandler->getList('adfs-idp-hosted'); + $adfsentities = []; + if (count($idps) > 1) { + foreach ($idps as $index => $idp) { + $idp['url'] = Module::getModuleURL('adfs/idp/metadata/'.$idp['auth']); + $idp['metadata-set'] = 'adfs-idp-hosted'; + $idp['metadata-index'] = $index; + $idp['metadata_array'] = ADFS_IdP::getHostedMetadata($idp['entityid']); + $adfsentities[] = $idp; + } + } else { + $adfsentities['adfs-idp'] = $this->mdHandler->getMetaDataCurrent('adfs-idp-hosted'); + $adfsentities['adfs-idp']['url'] = Module::getModuleURL('adfs/idp/metadata.php'); + $adfsentities['adfs-idp']['metadata_array'] = + ADFS_IdP::getHostedMetadata( + $this->mdHandler->getMetaDataCurrentEntityID('adfs-idp-hosted') + ); + } + + foreach ($adfsentities as $index => $entity) { + $builder = new SAMLBuilder($entity['entityid']); + $builder->addSecurityTokenServiceType($entity['metadata_array']); + $builder->addOrganizationInfo($entity['metadata_array']); + foreach ($entity['metadata_array']['contacts'] as $contact) { + $builder->addContact($contact['contactType'], $contact); + } + + $entity['metadata'] = \SimpleSAML\Metadata\Signer::sign( + $builder->getEntityDescriptorText(), + $entity['metadata_array'], + 'ADFS IdP' + ); + $entities[$index] = $entity; + } + } catch (\Exception $e) { + \SimpleSAML\Logger::error('Federation: Error loading adfs-idp: '.$e->getMessage()); + } + } + + // process certificate information and dump the metadata array + foreach ($entities as $index => $entity) { + $entities[$index]['type'] = $entity['metadata-set']; + foreach ($entity['metadata_array']['keys'] as $kidx => $key) { + $key['url'] = Module::getModuleURL( + 'admin/cert', + [ + 'set' => $entity['metadata-set'], + 'idp' => $entity['metadata-index'], + 'prefix' => $key['prefix'], + ] + ); + $key['name'] = 'idp'; + unset($entity['metadata_array']['keys'][$kidx]['prefix']); + $entities[$index]['certificates'][] = $key; + } + + // only one key, reduce + if (count($entity['metadata_array']['keys']) === 1) { + $cert = array_pop($entity['metadata_array']['keys']); + $entity['metadata_array']['certData'] = $cert['X509Certificate']; + unset($entity['metadata_array']['keys']); + } + + $entities[$index]['metadata_array'] = var_export($entity['metadata_array'], true); + } + + return $entities; + } + + + /** + * Get an array of entities describing the local SP instances. + * + * @return array + * @throws \SimpleSAML\Error\Exception If OrganizationName is set for an SP instance but OrganizationURL is not. + */ + private function getHostedSP() + { + $entities = []; + + /** @var \SimpleSAML\Module\saml\Auth\Source\SP $source */ + foreach (\SimpleSAML\Auth\Source::getSourcesOfType('saml:SP') as $source) { + $metadata = $source->getHostedMetadata(); + $certificates = $metadata['keys']; + if (count($metadata['keys']) === 1) { + $cert = array_pop($metadata['keys']); + $metadata['certData'] = $cert['X509Certificate']; + unset($metadata['keys']); + } + + // get the name + $name = $source->getMetadata()->getLocalizedString( + 'name', + $source->getMetadata()->getLocalizedString('OrganizationDisplayName', $source->getAuthId()) + ); + + $builder = new SAMLBuilder($source->getEntityId()); + $builder->addMetadataSP20($metadata, $source->getSupportedProtocols()); + $builder->addOrganizationInfo($metadata); + $xml = $builder->getEntityDescriptorText(true); + + // sanitize the resulting array + unset($metadata['UIInfo']); + unset($metadata['metadata-set']); + unset($metadata['entityid']); + + // sanitize the attributes array to remove friendly names + if (isset($metadata['attributes']) && is_array($metadata['attributes'])) { + $metadata['attributes'] = array_values($metadata['attributes']); + } + + // sign the metadata if enabled + $xml = \SimpleSAML\Metadata\Signer::sign($xml, $source->getMetadata()->toArray(), 'SAML 2 SP'); + + $entities[] = [ + 'authid' => $source->getAuthId(), + 'entityid' => $source->getEntityId(), + 'type' => 'saml20-sp-hosted', + 'url' => $source->getMetadataURL(), + 'name' => $name, + 'metadata' => $xml, + 'metadata_array' => var_export($metadata, true), + 'certificates' => $certificates, + ]; + } + + return $entities; + } +} diff --git a/vendor/simplesamlphp/simplesamlphp/modules/admin/lib/Menu.php b/vendor/simplesamlphp/simplesamlphp/modules/admin/lib/Menu.php new file mode 100644 index 0000000000..e4e55250cf --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/modules/admin/lib/Menu.php @@ -0,0 +1,90 @@ +<?php + +namespace SimpleSAML\Module\admin; + +use SimpleSAML\Locale\Translate; +use SimpleSAML\Module; +use SimpleSAML\XHTML\Template; + +/** + * A class to handle the menu in admin pages. + * + * @package SimpleSAML\Module\admin + */ +final class Menu +{ + /** @var array */ + private $options; + + + /** + * Menu constructor. + * + * Initialize the menu with some default admin options, and call a hook for anyone willing to extend it. + */ + public function __construct() + { + $this->options = [ + 'main' => [ + 'url' => Module::getModuleURL('admin/'), + 'name' => Translate::noop('Configuration'), + ], + 'test' => [ + 'url' => Module::getModuleURL('admin/test'), + 'name' => Translate::noop('Test'), + ], + 'federation' => [ + 'url' => Module::getModuleURL('admin/federation'), + 'name' => Translate::noop('Federation') + ] + ]; + } + + + /** + * Add a new option to this menu. + * + * If an option with the same $id already exists, it will be overwritten. Otherwise, the option is appended. Note + * that if the name of the option needs translation, you need to prepare for translation on your own (e.g. by + * registering your module as a translation domain in the template). + * + * @param string $id The identifier of this option. + * @param string $url The URL this option points to. + * @param string $name The name of the option for display purposes. + */ + public function addOption($id, $url, $name) + { + $this->options[$id] = [ + 'url' => $url, + 'name' => $name, + ]; + } + + + /** + * Inserts this menu into a template. + * + * The menu will be inserted into the "data" of the template, in the form of an array, where the key for each + * element is the identifier of the option (the default theme will compare this ID when determining if a menu + * option is currently selected), and the value itself is also an array with two keys: + * + * - url: The URL this option points to. + * - name: The name of the option for display purposes. + * + * This method will call the "adminmenu" hook, allowing modules to extend the menu by adding new options. If you + * are adding an option and need to translate its name, you need to add the translations to your own module, and + * add your module as a translation domain to the template object: + * + * $template->getLocalization()->addModuleDomain('mymodule'); + * + * @param \SimpleSAML\XHTML\Template $template The template we should insert this menu into. + * + * @return \SimpleSAML\XHTML\Template The template with the added menu. + */ + public function insert(Template $template) + { + $template->data['menu'] = $this->options; + Module::callHooks('adminmenu', $template); + return $template; + } +} diff --git a/vendor/simplesamlphp/simplesamlphp/modules/admin/lib/TestController.php b/vendor/simplesamlphp/simplesamlphp/modules/admin/lib/TestController.php new file mode 100644 index 0000000000..c330c81489 --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/modules/admin/lib/TestController.php @@ -0,0 +1,247 @@ +<?php + +namespace SimpleSAML\Module\admin; + +use SimpleSAML\HTTP\RunnableResponse; +use SimpleSAML\Locale\Translate; +use SimpleSAML\Utils\HTTP; +use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\HttpFoundation\Response; + +/** + * Controller class for the admin module. + * + * This class serves the 'Test authentication sources' views available in the module. + * + * @package SimpleSAML\Module\admin + */ +class TestController +{ + + /** @var \SimpleSAML\Configuration */ + protected $config; + + /** @var Menu */ + protected $menu; + + /** @var \SimpleSAML\Session */ + protected $session; + + + /** + * ConfigController constructor. + * + * @param \SimpleSAML\Configuration $config The configuration to use. + * @param \SimpleSAML\Session $session The current user session. + */ + public function __construct(\SimpleSAML\Configuration $config, \SimpleSAML\Session $session) + { + $this->config = $config; + $this->session = $session; + $this->menu = new Menu(); + } + + + /** + * Display the list of available authsources. + * + * @return \SimpleSAML\XHTML\Template + */ + public function main(Request $request, $as) + { + \SimpleSAML\Utils\Auth::requireAdmin(); + if (is_null($as)) { + $t = new \SimpleSAML\XHTML\Template($this->config, 'admin:authsource_list.twig'); + $t->data = [ + 'sources' => \SimpleSAML\Auth\Source::getSources(), + ]; + } else { + $authsource = new \SimpleSAML\Auth\Simple($as); + if (!is_null($request->query->get('logout'))) { + $authsource->logout($this->config->getBasePath().'logout.php'); + } elseif (!is_null($request->query->get(\SimpleSAML\Auth\State::EXCEPTION_PARAM))) { + // This is just a simple example of an error + $state = \SimpleSAML\Auth\State::loadExceptionState(); + assert(array_key_exists(\SimpleSAML\Auth\State::EXCEPTION_DATA, $state)); + throw $state[\SimpleSAML\Auth\State::EXCEPTION_DATA]; + } + + if (!$authsource->isAuthenticated()) { + $url = \SimpleSAML\Module::getModuleURL('admin/test/' .$as, []); + $params = [ + 'ErrorURL' => $url, + 'ReturnTo' => $url, + ]; + $authsource->login($params); + } + + $attributes = $authsource->getAttributes(); + $authData = $authsource->getAuthDataArray(); + $nameId = !is_null($authsource->getAuthData('saml:sp:NameID')) ? $authsource->getAuthData('saml:sp:NameID') : false; + + $t = new \SimpleSAML\XHTML\Template($this->config, 'admin:status.twig', 'attributes'); + $t->data = [ + 'attributes' => $attributes, + 'attributesHtml' => $this->getAttributesHTML($t, $attributes, ''), + 'authData' => $authData, + 'nameid' => $nameId, + 'logouturl' => \SimpleSAML\Utils\HTTP::getSelfURLNoQuery().'?as='.urlencode($as).'&logout', + ]; + + if ($nameId !== false) { + $t->data['nameidHtml'] = $this->getNameIDHTML($t, $nameId); + } + } + + \SimpleSAML\Module::callHooks('configpage', $t); + $this->menu->addOption('logout', \SimpleSAML\Utils\Auth::getAdminLogoutURL(), Translate::noop('Log out')); + return $this->menu->insert($t); + } + + + private function getNameIDHTML(\SimpleSAML\XHTML\Template $t, \SAML2\XML\saml\NameID $nameId) + { + $result = ''; + if ($nameId->getValue() === null) { + $list = ["NameID" => [$t->t('{status:subject_notset}')]]; + $result .= "<p>NameID: <span class=\"notset\">".$t->t('{status:subject_notset}')."</span></p>"; + } else { + $list = [ + "NameId" => [$nameId->getValue()], + ]; + if ($nameId->getFormat() !== null) { + $list[$t->t('{status:subject_format}')] = [$nameId->getFormat()]; + } + if ($nameId->getNameQualifier() !== null) { + $list['NameQualifier'] = [$nameId->getNameQualifier()]; + } + if ($nameId->getSPNameQualifier() !== null) { + $list['SPNameQualifier'] = [$nameId->getSPNameQualifier()]; + } + if ($nameId->getSPProvidedID() !== null) { + $list['SPProvidedID'] = [$nameId->getSPProvidedID()]; + } + } + return $result.$this->getAttributesHTML($t, $list, ''); + } + + + private function getAttributesHTML(\SimpleSAML\XHTML\Template $t, $attributes, $nameParent) + { + $alternate = ['pure-table-odd', 'pure-table-even']; + $i = 0; + $parentStr = (strlen($nameParent) > 0) ? strtolower($nameParent).'_' : ''; + $str = (strlen($nameParent) > 0) ? '<table class="pure-table pure-table-attributes" summary="attribute overview">' : + '<table id="table_with_attributes" class="pure-table pure-table-attributes" summary="attribute overview">'; + foreach ($attributes as $name => $value) { + $nameraw = $name; + $trans = $t->getTranslator(); + $name = $trans->getAttributeTranslation($parentStr.$nameraw); + if (preg_match('/^child_/', $nameraw)) { + $parentName = preg_replace('/^child_/', '', $nameraw); + foreach ($value as $child) { + $str .= '<tr class="odd"><td colspan="2" style="padding: 2em">'. + $this->getAttributesHTML($t, $child, $parentName).'</td></tr>'; + } + } else { + if (sizeof($value) > 1) { + $str .= '<tr class="'.$alternate[($i++ % 2)].'"><td class="attrname">'; + if ($nameraw !== $name) { + $str .= htmlspecialchars($name).'<br/>'; + } + $str .= '<code>'.htmlspecialchars($nameraw).'</code>'; + $str .= '</td><td class="attrvalue"><ul>'; + foreach ($value as $listitem) { + if ($nameraw === 'jpegPhoto') { + $str .= '<li><img src="data:image/jpeg;base64,'.htmlspecialchars($listitem).'" /></li>'; + } else { + $str .= '<li>'.$this->present_assoc($listitem).'</li>'; + } + } + $str .= '</ul></td></tr>'; + } elseif (isset($value[0])) { + $str .= '<tr class="'.$alternate[($i++ % 2)].'"><td class="attrname">'; + if ($nameraw !== $name) { + $str .= htmlspecialchars($name).'<br/>'; + } + $str .= '<code>'.htmlspecialchars($nameraw).'</code>'; + $str .= '</td>'; + if ($nameraw === 'jpegPhoto') { + $str .= '<td class="attrvalue"><img src="data:image/jpeg;base64,'.htmlspecialchars($value[0]). + '" /></td></tr>'; + } elseif (is_a($value[0], 'DOMNodeList')) { + // try to see if we have a NameID here + /** @var \DOMNodeList $value [0] */ + $n = $value[0]->length; + for ($idx = 0; $idx < $n; $idx++) { + $elem = $value[0]->item($idx); + /* @var \DOMElement $elem */ + if (!($elem->localName === 'NameID' && $elem->namespaceURI === \SAML2\Constants::NS_SAML)) { + continue; + } + $str .= $this->present_eptid($trans, new \SAML2\XML\saml\NameID($elem)); + break; // we only support one NameID here + } + $str .= '</td></tr>'; + } elseif (is_a($value[0], '\SAML2\XML\saml\NameID')) { + $str .= $this->present_eptid($trans, $value[0]); + $str .= '</td></tr>'; + } else { + $str .= '<td class="attrvalue">'.htmlspecialchars($value[0]).'</td></tr>'; + } + } + } + $str .= "\n"; + } + $str .= '</table>'; + return $str; + } + + private function present_list($attr) + { + if (is_array($attr) && count($attr) > 1) { + $str = '<ul>'; + foreach ($attr as $value) { + $str .= '<li>'.htmlspecialchars($attr).'</li>'; + } + $str .= '</ul>'; + return $str; + } else { + return htmlspecialchars($attr[0]); + } + } + + private function present_assoc($attr) + { + if (is_array($attr)) { + $str = '<dl>'; + foreach ($attr as $key => $value) { + $str .= "\n".'<dt>'.htmlspecialchars($key).'</dt><dd>'.$this->present_list($value).'</dd>'; + } + $str .= '</dl>'; + return $str; + } else { + return htmlspecialchars($attr); + } + } + + private function present_eptid(\SimpleSAML\Locale\Translate $t, \SAML2\XML\saml\NameID $nameID) + { + $eptid = [ + 'NameID' => [$nameID->getValue()], + ]; + if ($nameID->getFormat() !== null) { + $eptid[$t->t('{status:subject_format}')] = [$nameID->getFormat()]; + } + if ($nameID->getNameQualifier() !== null) { + $eptid['NameQualifier'] = [$nameID->getNameQualifier()]; + } + if ($nameID->getSPNameQualifier() !== null) { + $eptid['SPNameQualifier'] = [$nameID->getSPNameQualifier()]; + } + if ($nameID->getSPProvidedID() !== null) { + $eptid['SPProvidedID'] = [$nameID->getSPProvidedID()]; + } + return '<td class="attrvalue">'.$this->present_assoc($eptid); + } +} diff --git a/vendor/simplesamlphp/simplesamlphp/modules/admin/routes.yaml b/vendor/simplesamlphp/simplesamlphp/modules/admin/routes.yaml new file mode 100644 index 0000000000..e19374da6b --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/modules/admin/routes.yaml @@ -0,0 +1,15 @@ +admin-main: + path: / + defaults: { _controller: 'SimpleSAML\Module\admin\ConfigController::main' } +admin-diagnostics: + path: /diagnostics + defaults: { _controller: 'SimpleSAML\Module\admin\ConfigController::diagnostics' } +admin-phpinfo: + path: /phpinfo + defaults: { _controller: 'SimpleSAML\Module\admin\ConfigController::phpinfo' } +admin-test: + path: /test/{as} + defaults: { _controller: 'SimpleSAML\Module\admin\TestController::main', as: null } +admin-fed: + path: /federation + defaults: { _controller: 'SimpleSAML\Module\admin\FederationController::main' } diff --git a/vendor/simplesamlphp/simplesamlphp/modules/admin/templates/authsource_list.twig b/vendor/simplesamlphp/simplesamlphp/modules/admin/templates/authsource_list.twig new file mode 100644 index 0000000000..e00b3c356a --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/modules/admin/templates/authsource_list.twig @@ -0,0 +1,12 @@ +{% set pagetitle = 'Test Authentication Sources'|trans %} +{% set frontpage_section = 'test' %} +{% extends "base.twig" %} + +{% block content %} + {%- include "@admin/includes/menu.twig" %} + <ul> + {% for key, name in sources %} + <li><a href="test/{{ name|escape('url') }}">{{ name }}</a></li> + {% endfor %} + </ul> +{% endblock %} diff --git a/vendor/simplesamlphp/simplesamlphp/modules/admin/templates/config.twig b/vendor/simplesamlphp/simplesamlphp/modules/admin/templates/config.twig new file mode 100644 index 0000000000..017b653eee --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/modules/admin/templates/config.twig @@ -0,0 +1,69 @@ +{% set pagetitle = 'SimpleSAMLphp installation page'|trans %} +{% set frontpage_section = 'main' %} +{% extends "base.twig" %} + +{% block content %} + {%- include "@admin/includes/menu.twig" %} + + {%- for key, warning in warnings %} + {%- if warning is iterable %} + + <div class="message-box warning">{{ warning[0]|trans(warning[1])|raw }}</div> + {%- else %} + + <div class="message-box warning">{{ warning|trans|raw }}</div> + {%- endif %} + {%- endfor %} + + <div class="message-box"> + {% trans %}SimpleSAMLphp is installed in:{% endtrans %} + <kbd>{{ directory }}</kbd><br/> + {% trans %}You are running version <kbd>{{ version }}</kbd>.{% endtrans %} + </div> + <h2>{% trans %}Configuration{% endtrans %}</h2> + <div class="enablebox mini"> + <table> + <tr class="{%- if enablematrix.saml20idp %}enabled{% else %}disabled{% endif -%}"> + <td>SAML 2.0 IdP</td> + <td><i class="fa fa-{%- if enablematrix.saml20idp %}check{% else %}ban{% endif %}"></i></td> + </tr> + <tr class="{%- if enablematrix.shib13idp %}enabled{% else %}disabled{% endif -%}"> + <td>Shib 1.3 IdP</td> + <td><i class="fa fa-{%- if enablematrix.shib13idp %}check{% else %}ban{% endif %}"></i></td> + </tr> + </table> + </div> + <ul> + {%- for key, link in links %} + + <li><a href="{{ link.href }}">{{ link.text|trans }}</a></li> + {%- endfor %} + + </ul> + <h2>{% trans %}Checking your PHP installation{% endtrans %}</h2> + <div class="enablebox"> + <table> + {%- for key, func in funcmatrix %} + + <tr class="{%- if func.enabled %}enabled{% else %}disabled{% endif -%}"> + <td><i class="fa fa-{%- if func.enabled %}check{% else %}ban{% endif -%}"></i></td> + <td> + {%- if func.required == 'required' %} + {%- trans %}required{% endtrans %} + {%- else %} + {%- trans %}optional{% endtrans %} + {%- endif -%} + </td> + <td> + {%- if func.descr is iterable -%} + {{ func.descr[0]|trans(func.descr[1]|raw) }} + {%- else -%} + {{ func.descr|trans|raw }} + {%- endif -%} + </td> + </tr> + {%- endfor %} + + </table> + </div> +{% endblock %} diff --git a/vendor/simplesamlphp/simplesamlphp/modules/admin/templates/diagnostics.twig b/vendor/simplesamlphp/simplesamlphp/modules/admin/templates/diagnostics.twig new file mode 100644 index 0000000000..7e5e36064e --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/modules/admin/templates/diagnostics.twig @@ -0,0 +1,17 @@ +{% set pagetitle = 'Diagnostics on hostname, port and protocol'|trans %} +{% set frontpage_section = 'main' %} +{% extends "base.twig" %} + +{% block content %} + {%- include "@admin/includes/menu.twig" %} + {%- embed "_table.twig" %} + {%- block namecol %} + + <td class="attrname"><samp>{{ name }}</samp></td> + {%- endblock namecol %} + {%- block value %} + + {{ value }} + {%- endblock value %} + {%- endembed %} +{% endblock %} diff --git a/vendor/simplesamlphp/simplesamlphp/modules/admin/templates/federation.twig b/vendor/simplesamlphp/simplesamlphp/modules/admin/templates/federation.twig new file mode 100644 index 0000000000..ab2921b53e --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/modules/admin/templates/federation.twig @@ -0,0 +1,163 @@ +{% set pagetitle = 'SimpleSAMLphp installation page'|trans %} +{% set frontpage_section = 'federation' %} +{% extends "base.twig" %} + +{% block content %} + {%- include "@admin/includes/menu.twig" %} + {%- if entries.hosted is iterable %} + + <h2>{% trans %}Hosted entities{% endtrans %}</h2> + {%- for key, set in entries.hosted %} + {%- set metadataset = attribute(set, 'metadata-set') %} + {%- if not loop.first %} + + <br/> + {%- endif %} + {%- embed "includes/expander.twig" %} + {%- block general %} + + <dl> + {%- if set.name %} + + <dt>{{ set.name|translateFromArray }}</dt> + {%- endif %} + + <dd>EntityID: <code>{{ set.entityid }}</code></dd> + {%- if set.deprecated %} + + <dd><span class="entity-deprecated">Deprecated</span></dd> + {%- endif %} + {% set index = attribute(set, 'metadata-index')|default(false) %} + {%- if index and set.entityid != index %} + + <dd>Index: <code>{{ index }}</code></dd> + {%- endif %} + + <dd>{% trans %}Type:{% endtrans %} <strong>{{ mdtype[set.type]|trans }}</strong></dd> + </dl> + {%- endblock %} + {%- block content %} + + <dl> + <dt>{% trans %}SAML Metadata{% endtrans %}</dt> + <dd>{% trans %}You can get the metadata XML on a dedicated URL:{% endtrans %}</dd> + <dd class="code-box hljs"> + <div class="pure-button-group top-right-corner"> + <a class="pure-button copy hljs" data-clipboard-target="#url-{{ key }}" + title="{% trans %}Copy to clipboard{% endtrans %}"><span class="fa fa-copy"></span></a> + <a class="pure-button hljs" href="{{ set.url }}"> + <span class="fa fa-external-link-square"></span> + </a> + </div> + <code id="url-{{ key }}" class="code-box-content">{{ set.url }}</code> + </dd> + <dd>{% trans %}In SAML 2.0 Metadata XML format:{% endtrans %}</dd> + <dd class="code-box hljs"> + <div class="pure-button-group top-right-corner"> + <a class="pure-button copy hljs" data-clipboard-target="#xml-{{ key }}" + title="{% trans %}Copy to clipboard{% endtrans %}"><span class="fa fa-copy"></span></a> + </div> + <div id="xml-{{ key }}" class="code-box-content xml">{{ set.metadata }}</div> + </dd> + <dt>{% trans %}SimpleSAMLphp Metadata{% endtrans %}</dt> + <dd>{% trans %}Use this if you are using a SimpleSAMLphp entity on + {#- #} the other side:{% endtrans %}</dd> + <dd class="code-box hljs"> + <div class="pure-button-group top-right-corner"> + <a class="pure-button copy hljs" data-clipboard-target="#php-{{ key }}" + title="{% trans %}Copy to clipboard{% endtrans %}"><span class="fa fa-copy"></span></a> + </div> + <div id="php-{{ key }}" class="code-box-content php"> + {#- #}$metadata['{{ set.entityid }}'] = {{ set.metadata_array }};{# -#} + </div> + </dd> + <dt>{% trans %}Certificates{% endtrans %}</dt> + {%- for cert in set.certificates %} + {%- if loop.first %} + + <ul> + {%- endif %} + + <li> + <a href="{{ cert.url }}"><i class="fa fa-download"></i>{{ cert.name }} + {#- #}{% if cert.signing %}-signing{% endif %} + {#- #}{% if cert.encryption %}-encryption{% endif %}.pem + {#- #}{% if cert.prefix %} ({% trans %}new{% endtrans %}){% endif %}</a> + </li> + {%- if loop.last %} + + </ul> + {%- endif %} + {%- endfor %} + + </dl> + {%- endblock %} + {%- endembed %} + {%- endfor %} + {%- endif %} + + <h2>{% trans %}Trusted entities{% endtrans %}</h2> + {%- if entries.remote is iterable %} + {%- for key, set in entries.remote %} + + <fieldset class="fancyfieldset"> + <legend>{{ mdtype[key]|trans }}</legend> + <ul> + {% for entityid, entity in set %} + + <li><a href="{{ (metadata_url ~ '?entityid=' ~ entity.entityid ~ '&set=' ~ key) }}"> + {%- if entity.name_translated %} + + {{ entity.name_translated }} + {%- elseif entity.organizationdisplayname_translated %} + + {{ entity.organizationdisplayname_translated }} + {%- else %} + + {{ entity.entityid|escape('html') }} + {% endif -%} + + </a> + {%- if entity.expire %} + {%- if entity.expire < date().timestamp %} + + <span class="entity-expired"> (expired {{ ((date().timestamp - entity.expire) / 3600) }} hours ago)</span> + {%- else %} + {%- set expiration = (entity.expire - date().timestamp) / 3600 %} + + ({% trans %}expires in {{ expiration }} hours{% endtrans %}) + {%- endif %} + {%- endif %} + + </li> + {% endfor %} + </ul> + </fieldset> + {% endfor %} + {% endif %} + + <h2>{% trans %}Tools{% endtrans %}</h2> + <ul> + {%- for key, link in links %} + + <li><a href="{{ link.href }}">{{ link.text|trans }}</a></li> + {%- endfor %} + + </ul> + <form action="{{ metadata_url }}" method="get" class="pure-form"> + <fieldset class="fancyfieldset"> + <legend>{% trans %}Look up metadata for entity:{% endtrans %}</legend> + <select name="set"> + {%- if entries.remote %} + {%- for key, set in entries.remote %} + + <option value="{{ key|escape }}">{{ mdtype[key]|trans }}</option> + {%- endfor %} + {%- endif %} + + </select> + <input type="text" name="entityid" placeholder="{% trans %}EntityID{% endtrans %}" /> + <button class="pure-button pure-button-red" type="submit">{% trans %}Search{% endtrans %}</button> + </fieldset> + </form> +{% endblock %} diff --git a/vendor/simplesamlphp/simplesamlphp/modules/admin/templates/includes/menu.twig b/vendor/simplesamlphp/simplesamlphp/modules/admin/templates/includes/menu.twig new file mode 100644 index 0000000000..fda00d6e6a --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/modules/admin/templates/includes/menu.twig @@ -0,0 +1,15 @@ +<div class="pure-g frontpage-menu"> + <div class="pure-u-2-3"> + <div class="pure-menu pure-menu-horizontal"> + <ul class="pure-menu-list"> + {%- for id,option in menu %} + + <li class="pure-menu-item{% if frontpage_section == id %} pure-menu-selected{% endif %}"> + <a href="{{ option.url }}" class="pure-menu-link">{{ option.name|trans }}</a> + </li> + {%- endfor %} + + </ul> + </div> + </div> +</div> diff --git a/vendor/simplesamlphp/simplesamlphp/modules/admin/templates/status.twig b/vendor/simplesamlphp/simplesamlphp/modules/admin/templates/status.twig new file mode 100644 index 0000000000..341d3790ef --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/modules/admin/templates/status.twig @@ -0,0 +1,35 @@ +{% set pagetitle = 'SimpleSAMLphp installation page'|trans %} +{% set frontpage_section = 'test' %} +{% extends "base.twig" %} + +{% block content %} + {%- include "@admin/includes/menu.twig" %} + + <p>{% trans %}Hi, this is the status page of SimpleSAMLphp. Here you can see if your session is timed out, how long + it lasts until it times out and all the attributes that are attached to your session.{% endtrans %}</p> + + <h2>{{ '{status:attributes_header}'|trans }}</h2> + + {{ attributesHtml|raw }} + + {% if nameidHtml -%} + <h2>{{ '{status:subject_header}'|trans }}</h2> + {{ nameidHtml|raw }} + {%- endif %} + + {% if authData -%} + <h2>{% trans %}AuthData{% endtrans %}</h2> + <details><summary>{% trans %}Click to view AuthData{% endtrans %}</summary> + <pre>{{ authData|json_encode|raw }}</pre> + </details> + {%- endif %} + + {% if logout -%} + <h2>{{ '{status:logout}'|trans }}</h2> + <p>{{ logout }}</p> + {%- endif %} + + {% if logouturl -%} + <a href="{{ logouturl }}">{{ '{status:logout}'|trans }}</a> + {%- endif %} +{% endblock %} diff --git a/vendor/simplesamlphp/simplesamlphp/modules/authX509/dictionaries/X509warning.definition.json b/vendor/simplesamlphp/simplesamlphp/modules/authX509/dictionaries/X509warning.definition.json index e74d307751..d56bed1be7 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/authX509/dictionaries/X509warning.definition.json +++ b/vendor/simplesamlphp/simplesamlphp/modules/authX509/dictionaries/X509warning.definition.json @@ -1,6 +1,6 @@ { "warning": { - "en": "Your certificate will expire in %days% days." + "en": "Your certificate will expire in %daysleft% days." }, "warning_header": { "en": "Your certificate is about to expire." diff --git a/vendor/simplesamlphp/simplesamlphp/modules/authX509/dictionaries/X509warning.translation.json b/vendor/simplesamlphp/simplesamlphp/modules/authX509/dictionaries/X509warning.translation.json index 4a9b0b9577..e22096295f 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/authX509/dictionaries/X509warning.translation.json +++ b/vendor/simplesamlphp/simplesamlphp/modules/authX509/dictionaries/X509warning.translation.json @@ -1,10 +1,10 @@ { "warning": { - "nl": "Je certificaat verloopt over %days% dagen.", - "no": "Sertifikatet ditt vil utløpe om %days% dager.", - "da": "Dit certifikat udløber om %days% dage.", - "es": "Su certificado caduca en %days% días.", - "el": "\u0397 \u03b9\u03c3\u03c7\u03cd\u03c2 \u03c4\u03bf\u03c5 \u03c0\u03b9\u03c3\u03c4\u03bf\u03c0\u03bf\u03b9\u03b7\u03c4\u03b9\u03ba\u03bf\u03cd \u03c3\u03b1\u03c2 \u03b8\u03b1 \u03bb\u03ae\u03be\u03b5\u03b9 \u03c3\u03b5 %days%." + "nl": "Je certificaat verloopt over %daysleft% dagen.", + "no": "Sertifikatet ditt vil utløpe om %daysleft% dager.", + "da": "Dit certifikat udløber om %daysleft% dage.", + "es": "Su certificado caduca en %daysleft% días.", + "el": "\u0397 \u03b9\u03c3\u03c7\u03cd\u03c2 \u03c4\u03bf\u03c5 \u03c0\u03b9\u03c3\u03c4\u03bf\u03c0\u03bf\u03b9\u03b7\u03c4\u03b9\u03ba\u03bf\u03cd \u03c3\u03b1\u03c2 \u03b8\u03b1 \u03bb\u03ae\u03be\u03b5\u03b9 \u03c3\u03b5 %daysleft%." }, "warning_header": { "nl": "Je certificaat verloopt binnenkort.", diff --git a/vendor/simplesamlphp/simplesamlphp/modules/authX509/docs/authX509.md b/vendor/simplesamlphp/simplesamlphp/modules/authX509/docs/authX509.md index ac4a65851e..dcb8ff9259 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/authX509/docs/authX509.md +++ b/vendor/simplesamlphp/simplesamlphp/modules/authX509/docs/authX509.md @@ -47,9 +47,9 @@ example authsources.php entry: 'x509' => array( 'authX509:X509userCert', 'hostname' => 'ldaps://ldap.example.net', - 'enable_tls' => FALSE, - 'attributes' => array("cn", "uid", "mail", "ou", "sn"), - 'search.enable' => TRUE, + 'enable_tls' => false, + 'attributes' => array('cn', 'uid', 'mail', 'ou', 'sn'), + 'search.enable' => true, 'search.attributes' => array('uid', 'mail'), 'search.base' => 'dc=example,dc=net', 'authX509:x509attributes' => array('UID' => 'uid'), diff --git a/vendor/simplesamlphp/simplesamlphp/modules/authX509/lib/Auth/Process/ExpiryWarning.php b/vendor/simplesamlphp/simplesamlphp/modules/authX509/lib/Auth/Process/ExpiryWarning.php index 7a8841e82c..1b9c1ca875 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/authX509/lib/Auth/Process/ExpiryWarning.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/authX509/lib/Auth/Process/ExpiryWarning.php @@ -1,5 +1,7 @@ <?php +namespace SimpleSAML\Module\authX509\Auth\Process; + /** * Filter which shows a warning if the user's client certificate is about to expire. * @@ -14,7 +16,8 @@ * @author Joost van Dijk, SURFnet. <Joost.vanDijk@surfnet.nl> * @package SimpleSAMLphp */ -class sspmod_authX509_Auth_Process_ExpiryWarning extends SimpleSAML_Auth_ProcessingFilter + +class ExpiryWarning extends \SimpleSAML\Auth\ProcessingFilter { private $warndaysbefore = 30; @@ -30,19 +33,19 @@ public function __construct($config, $reserved) { parent::__construct($config, $reserved); - assert('is_array($config)'); + assert(is_array($config)); if (array_key_exists('warndaysbefore', $config)) { $this->warndaysbefore = $config['warndaysbefore']; if (!is_string($this->warndaysbefore)) { - throw new Exception('Invalid value for \'warndaysbefore\'-option to authX509::ExpiryWarning filter.'); + throw new \Exception('Invalid value for \'warndaysbefore\'-option to authX509::ExpiryWarning filter.'); } } if (array_key_exists('renewurl', $config)) { $this->renewurl = $config['renewurl']; if (!is_string($this->renewurl)) { - throw new Exception('Invalid value for \'renewurl\'-option to authX509::ExpiryWarning filter.'); + throw new \Exception('Invalid value for \'renewurl\'-option to authX509::ExpiryWarning filter.'); } } } @@ -57,7 +60,7 @@ public function __construct($config, $reserved) */ public function process(&$state) { - assert('is_array($state)'); + assert(is_array($state)); if (isset($state['isPassive']) && $state['isPassive'] === true) { // We have a passive request. Skip the warning @@ -72,25 +75,24 @@ public function process(&$state) $client_cert = $_SERVER['SSL_CLIENT_CERT']; $client_cert_data = openssl_x509_parse($client_cert); if ($client_cert_data == false) { - SimpleSAML\Logger::error('authX509: invalid cert'); + \SimpleSAML\Logger::error('authX509: invalid cert'); return; } $validTo = $client_cert_data['validTo_time_t']; $now = time(); - $daysleft = (int)(($validTo - $now) / (24*60*60)); + $daysleft = (int) (($validTo - $now) / 86400); //24*60*60 if ($daysleft > $this->warndaysbefore) { // We have a certificate that will be valid for some time. Skip the warning return; } - SimpleSAML\Logger::warning('authX509: user certificate expires in ' . $daysleft . ' days'); + \SimpleSAML\Logger::warning('authX509: user certificate expires in '.$daysleft.' days'); $state['daysleft'] = $daysleft; $state['renewurl'] = $this->renewurl; - /* Save state and redirect. */ - $id = SimpleSAML_Auth_State::saveState($state, 'warning:expire'); - $url = SimpleSAML\Module::getModuleURL('authX509/expirywarning.php'); - \SimpleSAML\Utils\HTTP::redirectTrustedURL($url, array('StateId' => $id)); + // Save state and redirect + $id = \SimpleSAML\Auth\State::saveState($state, 'warning:expire'); + $url = \SimpleSAML\Module::getModuleURL('authX509/expirywarning.php'); + \SimpleSAML\Utils\HTTP::redirectTrustedURL($url, ['StateId' => $id]); } - } diff --git a/vendor/simplesamlphp/simplesamlphp/modules/authX509/lib/Auth/Source/X509userCert.php b/vendor/simplesamlphp/simplesamlphp/modules/authX509/lib/Auth/Source/X509userCert.php index 508c13a60c..4605c0ee97 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/authX509/lib/Auth/Source/X509userCert.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/authX509/lib/Auth/Source/X509userCert.php @@ -1,24 +1,26 @@ <?php +namespace SimpleSAML\Module\authX509\Auth\Source; + /** * This class implements x509 certificate authentication with certificate validation against an LDAP directory. * * @author Emmanuel Dreyfus <manu@netbsd.org> * @package SimpleSAMLphp */ -class sspmod_authX509_Auth_Source_X509userCert extends SimpleSAML_Auth_Source -{ +class X509userCert extends \SimpleSAML\Auth\Source +{ /** * x509 attributes to use from the certificate for searching the user in the LDAP directory. */ - private $x509attributes = array('UID' => 'uid'); + private $x509attributes = ['UID' => 'uid']; /** * LDAP attribute containing the user certificate. */ - private $ldapusercert = array('userCertificate;binary'); + private $ldapusercert = ['userCertificate;binary']; /** @@ -37,8 +39,8 @@ class sspmod_authX509_Auth_Source_X509userCert extends SimpleSAML_Auth_Source */ public function __construct($info, &$config) { - assert('is_array($info)'); - assert('is_array($config)'); + assert(is_array($info)); + assert(is_array($config)); if (isset($config['authX509:x509attributes'])) { $this->x509attributes = $config['authX509:x509attributes']; @@ -50,9 +52,9 @@ public function __construct($info, &$config) parent::__construct($info, $config); - $this->ldapcf = new sspmod_ldap_ConfigHelper( + $this->ldapcf = new \SimpleSAML\Module\ldap\ConfigHelper( $config, - 'Authentication source ' . var_export($this->authId, true) + 'Authentication source '.var_export($this->authId, true) ); return; @@ -68,11 +70,12 @@ public function __construct($info, &$config) */ public function authFailed(&$state) { - $config = SimpleSAML_Configuration::getInstance(); + $config = \SimpleSAML\Configuration::getInstance(); - $t = new SimpleSAML_XHTML_Template($config, 'authX509:X509error.php'); + $t = new \SimpleSAML\XHTML\Template($config, 'authX509:X509error.php'); + $t->data['loginurl'] = \SimpleSAML\Utils\HTTP::getSelfURL(); $t->data['errorcode'] = $state['authX509.error']; - $t->data['errorcodes'] = SimpleSAML\Error\ErrorCodes::getAllErrorCodeMessages(); + $t->data['errorcodes'] = \SimpleSAML\Error\ErrorCodes::getAllErrorCodeMessages(); $t->show(); exit(); @@ -89,7 +92,7 @@ public function authFailed(&$state) */ public function authenticate(&$state) { - assert('is_array($state)'); + assert(is_array($state)); $ldapcf = $this->ldapcf; if (!isset($_SERVER['SSL_CLIENT_CERT']) || @@ -97,18 +100,18 @@ public function authenticate(&$state) $state['authX509.error'] = "NOCERT"; $this->authFailed($state); - assert('false'); // should never be reached + assert(false); // should never be reached return; } $client_cert = $_SERVER['SSL_CLIENT_CERT']; $client_cert_data = openssl_x509_parse($client_cert); if ($client_cert_data === false) { - SimpleSAML\Logger::error('authX509: invalid cert'); + \SimpleSAML\Logger::error('authX509: invalid cert'); $state['authX509.error'] = "INVALIDCERT"; $this->authFailed($state); - assert('false'); // should never be reached + assert(false); // should never be reached return; } @@ -117,7 +120,7 @@ public function authenticate(&$state) // value is scalar if (array_key_exists($x509_attr, $client_cert_data['subject'])) { $value = $client_cert_data['subject'][$x509_attr]; - SimpleSAML\Logger::info('authX509: cert '. $x509_attr.' = '.$value); + \SimpleSAML\Logger::info('authX509: cert '.$x509_attr.' = '.$value); $dn = $ldapcf->searchfordn($ldap_attr, $value, true); if ($dn !== null) { break; @@ -126,36 +129,37 @@ public function authenticate(&$state) } if ($dn === null) { - SimpleSAML\Logger::error('authX509: cert has no matching user in LDAP.'); + \SimpleSAML\Logger::error('authX509: cert has no matching user in LDAP.'); $state['authX509.error'] = "UNKNOWNCERT"; $this->authFailed($state); - assert('false'); // should never be reached + assert(false); // should never be reached return; } - if ($this->ldapusercert === null) { // do not check for certificate match + if ($this->ldapusercert === null) { + // do not check for certificate match $attributes = $ldapcf->getAttributes($dn); - assert('is_array($attributes)'); + assert(is_array($attributes)); $state['Attributes'] = $attributes; $this->authSuccesful($state); - assert('false'); // should never be reached + assert(false); // should never be reached return; } $ldap_certs = $ldapcf->getAttributes($dn, $this->ldapusercert); if ($ldap_certs === false) { - SimpleSAML\Logger::error('authX509: no certificate found in LDAP for dn='.$dn); + \SimpleSAML\Logger::error('authX509: no certificate found in LDAP for dn='.$dn); $state['authX509.error'] = "UNKNOWNCERT"; $this->authFailed($state); - assert('false'); // should never be reached + assert(false); // should never be reached return; } - $merged_ldapcerts = array(); + $merged_ldapcerts = []; foreach ($this->ldapusercert as $attr) { $merged_ldapcerts = array_merge($merged_ldapcerts, $ldap_certs[$attr]); } @@ -165,26 +169,26 @@ public function authenticate(&$state) $pem = \SimpleSAML\Utils\Crypto::der2pem($ldap_cert); $ldap_cert_data = openssl_x509_parse($pem); if ($ldap_cert_data === false) { - SimpleSAML\Logger::error('authX509: cert in LDAP is invalid for dn='.$dn); + \SimpleSAML\Logger::error('authX509: cert in LDAP is invalid for dn='.$dn); continue; } if ($ldap_cert_data === $client_cert_data) { $attributes = $ldapcf->getAttributes($dn); - assert('is_array($attributes)'); + assert(is_array($attributes)); $state['Attributes'] = $attributes; $this->authSuccesful($state); - assert('false'); // should never be reached + assert(false); // should never be reached return; } } - SimpleSAML\Logger::error('authX509: no matching cert in LDAP for dn='.$dn); + \SimpleSAML\Logger::error('authX509: no matching cert in LDAP for dn='.$dn); $state['authX509.error'] = "UNKNOWNCERT"; $this->authFailed($state); - assert('false'); // should never be reached + assert(false); // should never be reached return; } @@ -198,9 +202,9 @@ public function authenticate(&$state) */ public function authSuccesful(&$state) { - SimpleSAML_Auth_Source::completeAuth($state); + \SimpleSAML\Auth\Source::completeAuth($state); - assert('false'); // should never be reached + assert(false); // should never be reached return; } } diff --git a/vendor/simplesamlphp/simplesamlphp/modules/authX509/locales/da/LC_MESSAGES/authX509.po b/vendor/simplesamlphp/simplesamlphp/modules/authX509/locales/da/LC_MESSAGES/authX509.po index 6e89789b11..a883034f93 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/authX509/locales/da/LC_MESSAGES/authX509.po +++ b/vendor/simplesamlphp/simplesamlphp/modules/authX509/locales/da/LC_MESSAGES/authX509.po @@ -34,20 +34,20 @@ msgid "{authX509:X509error:certificate_header}" msgstr "X509 certifikat authentifikation" msgid "{authX509:X509warning:warning}" -msgstr "Dit certifikat udløber om %days% dage." +msgstr "Dit certifikat udløber om %daysleft% dage." msgid "Please renew your certificate in time." msgstr "Forny venligst dit certifikat i tide." #, python-format -msgid "Your certificate will expire in %days% days." -msgstr "Dit certifikat udløber om %days% dage." +msgid "Your certificate will expire in %daysleft% days." +msgstr "Dit certifikat udløber om %daysleft% dage." msgid "X509 certificate authentication" msgstr "X509 certifikat authentifikation" #, python-format -msgid "Please <a href='%renewurl%'>renew</a> your certificate in time." +msgid "Please <a href='%renewurl%'>renew your certificate</a> in time." msgstr "<a href='%renewurl%'>Forny</a>, venligst dit certifikat før det udløber." msgid "Proceed" diff --git a/vendor/simplesamlphp/simplesamlphp/modules/authX509/locales/el/LC_MESSAGES/authX509.po b/vendor/simplesamlphp/simplesamlphp/modules/authX509/locales/el/LC_MESSAGES/authX509.po index 26cf3a027c..8fb335efc1 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/authX509/locales/el/LC_MESSAGES/authX509.po +++ b/vendor/simplesamlphp/simplesamlphp/modules/authX509/locales/el/LC_MESSAGES/authX509.po @@ -36,20 +36,20 @@ msgid "{authX509:X509error:certificate_header}" msgstr "Ταυτοποίηση μέσω πιστοποιητικού X.509" msgid "{authX509:X509warning:warning}" -msgstr "Η ισχύς του πιστοποιητικού σας θα λήξει σε %days%." +msgstr "Η ισχύς του πιστοποιητικού σας θα λήξει σε %daysleft%." msgid "Please renew your certificate in time." msgstr "Παρακαλείστε να προχωρήσετε σε ανανέωση του πιστοποιητικού σας έγκαιρα." #, python-format -msgid "Your certificate will expire in %days% days." -msgstr "Η ισχύς του πιστοποιητικού σας θα λήξει σε %days%." +msgid "Your certificate will expire in %daysleft% days." +msgstr "Η ισχύς του πιστοποιητικού σας θα λήξει σε %daysleft%." msgid "X509 certificate authentication" msgstr "Ταυτοποίηση μέσω πιστοποιητικού X.509" #, python-format -msgid "Please <a href='%renewurl%'>renew</a> your certificate in time." +msgid "Please <a href='%renewurl%'>renew your certificate</a> in time." msgstr "" "Παρακαλείστε να προχωρήσετε σε <a href=‘%renewurl%’>ανανέωση</a> του " "πιστοποιητικού σας έγκαιρα." diff --git a/vendor/simplesamlphp/simplesamlphp/modules/authX509/locales/en/LC_MESSAGES/authX509.po b/vendor/simplesamlphp/simplesamlphp/modules/authX509/locales/en/LC_MESSAGES/authX509.po index 6457d3edf9..6e317173c4 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/authX509/locales/en/LC_MESSAGES/authX509.po +++ b/vendor/simplesamlphp/simplesamlphp/modules/authX509/locales/en/LC_MESSAGES/authX509.po @@ -34,21 +34,21 @@ msgid "{authX509:X509error:certificate_header}" msgstr "X509 certificate authentication" msgid "{authX509:X509warning:warning}" -msgstr "Your certificate will expire in %days% days." +msgstr "Your certificate will expire in %daysleft% days." msgid "Please renew your certificate in time." msgstr "Please renew your certificate in time." #, python-format -msgid "Your certificate will expire in %days% days." -msgstr "Your certificate will expire in %days% days." +msgid "Your certificate will expire in %daysleft% days." +msgstr "Your certificate will expire in %daysleft% days." msgid "X509 certificate authentication" msgstr "X509 certificate authentication" #, python-format -msgid "Please <a href='%renewurl%'>renew</a> your certificate in time." -msgstr "Please <a href='%renewurl%'>renew</a> your certificate in time." +msgid "Please <a href='%renewurl%'>renew your certificate</a> in time." +msgstr "Please <a href='%renewurl%'>renew your certificate</a> in time." msgid "Proceed" msgstr "Proceed" diff --git a/vendor/simplesamlphp/simplesamlphp/modules/authX509/locales/es/LC_MESSAGES/authX509.po b/vendor/simplesamlphp/simplesamlphp/modules/authX509/locales/es/LC_MESSAGES/authX509.po index 7256e926b8..e25961f4ea 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/authX509/locales/es/LC_MESSAGES/authX509.po +++ b/vendor/simplesamlphp/simplesamlphp/modules/authX509/locales/es/LC_MESSAGES/authX509.po @@ -36,21 +36,21 @@ msgid "{authX509:X509error:certificate_header}" msgstr "Autenticación mediante certificado X509" msgid "{authX509:X509warning:warning}" -msgstr "Su certificado caduca en %days% días." +msgstr "Su certificado caduca en %daysleft% días." msgid "Please renew your certificate in time." msgstr "Por favor, renueve su certificado a tiempo." #, python-format -msgid "Your certificate will expire in %days% days." -msgstr "Su certificado caduca en %days% días." +msgid "Your certificate will expire in %daysleft% days." +msgstr "Su certificado caduca en %daysleft% días." msgid "X509 certificate authentication" msgstr "Autenticación mediante certificado X509" #, python-format -msgid "Please <a href='%renewurl%'>renew</a> your certificate in time." -msgstr "Por favor, <a href=‘%renewurl%’>renueve</a> su certificado a tiempo." +msgid "Please <a href='%renewurl%'>renew your certificate</a> in time." +msgstr "Por favor, <a href=‘%renewurl%’>renueve su certificado</a> a tiempo." msgid "Proceed" msgstr "Continuar" diff --git a/vendor/simplesamlphp/simplesamlphp/modules/authX509/locales/nb/LC_MESSAGES/authX509.po b/vendor/simplesamlphp/simplesamlphp/modules/authX509/locales/nb/LC_MESSAGES/authX509.po index 1a74b995c5..6517289e0b 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/authX509/locales/nb/LC_MESSAGES/authX509.po +++ b/vendor/simplesamlphp/simplesamlphp/modules/authX509/locales/nb/LC_MESSAGES/authX509.po @@ -36,20 +36,20 @@ msgid "{authX509:X509error:certificate_header}" msgstr "X509 sertifikatautentisering" msgid "{authX509:X509warning:warning}" -msgstr "Sertifikatet ditt vil utløpe om %days% dager." +msgstr "Sertifikatet ditt vil utløpe om %daysleft% dager." msgid "Please renew your certificate in time." msgstr "Vennligst forny sertifikatet ditt før det utløper." #, python-format -msgid "Your certificate will expire in %days% days." -msgstr "Sertifikatet ditt vil utløpe om %days% dager." +msgid "Your certificate will expire in %daysleft% days." +msgstr "Sertifikatet ditt vil utløpe om %daysleft% dager." msgid "X509 certificate authentication" msgstr "X509 sertifikatautentisering" #, python-format -msgid "Please <a href='%renewurl%'>renew</a> your certificate in time." +msgid "Please <a href='%renewurl%'>renew your certificate</a> in time." msgstr "" "Vennligst <a href=‘%renewurl%’>forny</a> sertifikatet ditt før det " "utløper." diff --git a/vendor/simplesamlphp/simplesamlphp/modules/authX509/locales/nl/LC_MESSAGES/authX509.po b/vendor/simplesamlphp/simplesamlphp/modules/authX509/locales/nl/LC_MESSAGES/authX509.po index 5e341db071..3515e80ead 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/authX509/locales/nl/LC_MESSAGES/authX509.po +++ b/vendor/simplesamlphp/simplesamlphp/modules/authX509/locales/nl/LC_MESSAGES/authX509.po @@ -36,21 +36,21 @@ msgid "{authX509:X509error:certificate_header}" msgstr "Authenticatie via X509-certificaat" msgid "{authX509:X509warning:warning}" -msgstr "Je certificaat verloopt over %days% dagen." +msgstr "Je certificaat verloopt over %daysleft% dagen." msgid "Please renew your certificate in time." msgstr "Vervang tijdig je certificaat." #, python-format -msgid "Your certificate will expire in %days% days." -msgstr "Je certificaat verloopt over %days% dagen." +msgid "Your certificate will expire in %daysleft% days." +msgstr "Je certificaat verloopt over %daysleft% dagen." msgid "X509 certificate authentication" msgstr "Authenticatie via X509-certificaat" #, python-format -msgid "Please <a href='%renewurl%'>renew</a> your certificate in time." -msgstr "<a href='%renewurl%'>Vervang</a> tijdig je certificaat." +msgid "Please <a href=\"%renewurl%\">renew your certificate</a> in time." +msgstr "<a href=\"%renewurl%\">Vervang tijdig je certificaat</a>." msgid "Proceed" msgstr "Verder" diff --git a/vendor/simplesamlphp/simplesamlphp/modules/authX509/templates/X509error.php b/vendor/simplesamlphp/simplesamlphp/modules/authX509/templates/X509error.php index 089128a65d..b7f8d42802 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/authX509/templates/X509error.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/authX509/templates/X509error.php @@ -3,39 +3,32 @@ $this->includeAtTemplateBase('includes/header.php'); -?> - -<?php if ($this->data['errorcode'] !== null) { ?> - <div style="border-left: 1px solid #e8e8e8; border-bottom: 1px solid #e8e8e8; background: #f5f5f5"> - <img src="/<?php echo $this->data['baseurlpath']; ?>resources/icons/experience/gtk-dialog-error.48x48.png" class="float-l" style="margin: 15px" alt="" /> - <h2><?php echo $this->t('{login:error_header}'); ?></h2> - <p><b><?php echo $this->t($this->data['errorcodes']['title'][$this->data['errorcode']]); ?></b></p> - <p><?php echo $this->t($this->data['errorcodes']['descr'][$this->data['errorcode']]); ?></p> - </div> + <div style="border-left: 1px solid #e8e8e8; border-bottom: 1px solid #e8e8e8; background: #f5f5f5"> + <img src="/<?php echo $this->data['baseurlpath']; ?>resources/icons/experience/gtk-dialog-error.48x48.png" class="float-l" style="margin: 15px" alt="" /> + <h2><?php echo $this->t('{login:error_header}'); ?></h2> + <p><b><?php echo $this->t($this->data['errorcodes']['title'][$this->data['errorcode']]); ?></b></p> + <p><?php echo $this->t($this->data['errorcodes']['descr'][$this->data['errorcode']]); ?></p> + </div> <?php } ?> - <h2 style="break: both"><?php echo $this->t('{authX509:X509error:certificate_header}'); ?></h2> - - <p><?php echo $this->t('{authX509:X509error:certificate_text}'); ?></p> + <h2 style="break: both"><?php echo $this->t('{authX509:X509error:certificate_header}'); ?></h2> - <a href="<?php echo htmlspecialchars(\SimpleSAML\Utils\HTTP::getSelfURL()); ?>"> - <?php echo $this->t('{login:login_button}'); ?> - </a> + <p><?php echo $this->t('{authX509:X509error:certificate_text}'); ?></p> + <a href="<?php echo htmlspecialchars(\SimpleSAML\Utils\HTTP::getSelfURL()); ?>"> + <?php echo $this->t('{login:login_button}'); ?> + </a> <?php -if(!empty($this->data['links'])) { - echo '<ul class="links" style="margin-top: 2em">'; - foreach($this->data['links'] AS $l) { - echo '<li><a href="' . htmlspecialchars($l['href']) . '">' . htmlspecialchars($this->t($l['text'])) . '</a></li>'; - } - echo '</ul>'; +if (!empty($this->data['links'])) { + echo '<ul class="links" style="margin-top: 2em">'; + foreach ($this->data['links'] as $l) { + echo '<li><a href="'.htmlspecialchars($l['href']).'">'.htmlspecialchars($this->t($l['text'])).'</a></li>'; + } + echo '</ul>'; } - - - $this->includeAtTemplateBase('includes/footer.php'); diff --git a/vendor/simplesamlphp/simplesamlphp/modules/authX509/templates/X509error.twig b/vendor/simplesamlphp/simplesamlphp/modules/authX509/templates/X509error.twig new file mode 100644 index 0000000000..becaebdb72 --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/modules/authX509/templates/X509error.twig @@ -0,0 +1,19 @@ +{% set pagetitle = 'X509 certificate authentication'|trans %} +{% extends "base.twig" %} +{% block content %} + +{% if errorcode -%} +<h2>{% trans 'Error' %}</h2> +<h3>{% trans errortitle %}</h3> +<p>{% trans errordescr %}</p> +{% endif -%} + +<h2>{% trans 'X509 certificate authentication' %}</h2> + +<p>{% trans 'X509 certificate authentication is required to access this service.' %}</p> + +<a href="{{ loginurl }}"> +{% trans 'Login' %} +</a> + +{% endblock %} diff --git a/vendor/simplesamlphp/simplesamlphp/modules/authX509/templates/X509warning.php b/vendor/simplesamlphp/simplesamlphp/modules/authX509/templates/X509warning.php index 55b8b6281d..a25385ec9a 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/authX509/templates/X509warning.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/authX509/templates/X509warning.php @@ -10,16 +10,16 @@ * @package SimpleSAMLphp */ -$warning = $this->t('{authX509:X509warning:warning}', array( - '%days%' => htmlspecialchars($this->data['daysleft']), -)); +$warning = $this->t('{authX509:X509warning:warning}', [ + '%daysleft%' => htmlspecialchars($this->data['daysleft']), +]); -if( $this->data['renewurl']) { - $warning .= " " . $this->t('{authX509:X509warning:renew_url}', array( +if ($this->data['renewurl']) { + $warning .= " ".$this->t('{authX509:X509warning:renew_url}', [ '%renewurl%' => $this->data['renewurl'], - )); + ]); } else { - $warning .= " " . $this->t('{authX509:X509warning:renew}'); + $warning .= " ".$this->t('{authX509:X509warning:renew}'); } $this->data['header'] = $this->t('{authX509:X509warning:warning_header}'); @@ -32,10 +32,10 @@ <form style="display: inline; margin: 0px; padding: 0px" action="<?php echo htmlspecialchars($this->data['target']); ?>"> <?php - // Embed hidden fields... - foreach ($this->data['data'] as $name => $value) { - echo('<input type="hidden" name="' . htmlspecialchars($name) . '" value="' . htmlspecialchars($value) . '" />'); - } + // Embed hidden fields... + foreach ($this->data['data'] as $name => $value) { + echo '<input type="hidden" name="'.htmlspecialchars($name).'" value="'.htmlspecialchars($value).'" />'; + } ?> <p><?php echo $warning; ?></p> diff --git a/vendor/simplesamlphp/simplesamlphp/modules/authX509/templates/X509warning.twig b/vendor/simplesamlphp/simplesamlphp/modules/authX509/templates/X509warning.twig new file mode 100644 index 0000000000..b75f7c370f --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/modules/authX509/templates/X509warning.twig @@ -0,0 +1,24 @@ +{% extends "base.twig" %} + +{% block content %} + +<h2>{% trans 'Your certificate is about to expire.' %}</h2> +<form action="{{ target | escape }}"> + + {% for name, value in data -%} + <input type="hidden" name="{{ name }}" value="{{ value }}"> + {%- endfor %} + + <p>{% trans %}Your certificate will expire in {{ daysleft }} days.{% endtrans %}</p> + + {% if renewurl -%} + <p>{% trans %}Please <a href="{{ renewurl }}">renew your certificate</a> in time.{% endtrans %}</p> + {% else -%} + <p>{% trans 'Please renew your certificate in time.' %}</p> + {% endif -%} + + <p><input type="submit" name="proceed" id="proceedbutton" value="{% trans 'Proceed' %}" autofocus></p> + +</form> + +{% endblock %} diff --git a/vendor/simplesamlphp/simplesamlphp/modules/authX509/www/expirywarning.php b/vendor/simplesamlphp/simplesamlphp/modules/authX509/www/expirywarning.php index be6e4f664a..7bd36030d4 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/authX509/www/expirywarning.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/authX509/www/expirywarning.php @@ -6,26 +6,26 @@ * @package SimpleSAMLphp */ -SimpleSAML\Logger::info('AuthX509 - Showing expiry warning to user'); +\SimpleSAML\Logger::info('AuthX509 - Showing expiry warning to user'); if (!array_key_exists('StateId', $_REQUEST)) { - throw new SimpleSAML_Error_BadRequest('Missing required StateId query parameter.'); + throw new \SimpleSAML\Error\BadRequest('Missing required StateId query parameter.'); } $id = $_REQUEST['StateId']; -$state = SimpleSAML_Auth_State::loadState($id, 'warning:expire'); +$state = \SimpleSAML\Auth\State::loadState($id, 'warning:expire'); if (array_key_exists('proceed', $_REQUEST)) { // The user has pressed the proceed-button - SimpleSAML_Auth_ProcessingChain::resumeProcessing($state); + \SimpleSAML\Auth\ProcessingChain::resumeProcessing($state); } -$globalConfig = SimpleSAML_Configuration::getInstance(); +$globalConfig = \SimpleSAML\Configuration::getInstance(); -$t = new SimpleSAML_XHTML_Template($globalConfig, 'authX509:X509warning.php'); -$t->data['target'] = SimpleSAML\Module::getModuleURL('authX509/expirywarning.php'); -$t->data['data'] = array('StateId' => $id); +$t = new \SimpleSAML\XHTML\Template($globalConfig, 'authX509:X509warning.php'); +$t->data['target'] = \SimpleSAML\Module::getModuleURL('authX509/expirywarning.php'); +$t->data['data'] = ['StateId' => $id]; $t->data['daysleft'] = $state['daysleft']; $t->data['renewurl'] = $state['renewurl']; -$t->data['errorcodes'] = SimpleSAML\Error\ErrorCodes::getAllErrorCodeMessages(); +$t->data['errorcodes'] = \SimpleSAML\Error\ErrorCodes::getAllErrorCodeMessages(); $t->show(); diff --git a/vendor/simplesamlphp/simplesamlphp/modules/authYubiKey/lib/Auth/Process/OTP2YubiPrefix.php b/vendor/simplesamlphp/simplesamlphp/modules/authYubiKey/lib/Auth/Process/OTP2YubiPrefix.php index 8b368ca21c..42ef300f39 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/authYubiKey/lib/Auth/Process/OTP2YubiPrefix.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/authYubiKey/lib/Auth/Process/OTP2YubiPrefix.php @@ -1,5 +1,7 @@ <?php +namespace SimpleSAML\Module\authYubiKey\Auth\Process; + /* * Copyright (C) 2009 Simon Josefsson <simon@yubico.com>. * @@ -35,42 +37,44 @@ * * You use it by adding it as an authentication filter in config.php: * - * 'authproc.idp' => array( + * 'authproc.idp' => array( * ... * 90 => 'authYubiKey:OTP2YubiPrefix', * ... * ); * */ -class sspmod_authYubiKey_Auth_Process_OTP2YubiPrefix extends SimpleSAML_Auth_ProcessingFilter { - - - /** - * Filter out YubiKey 'otp' attribute and replace it with - * a 'yubiPrefix' attribute that leaves out the dynamic part. - * - * @param array &$state The state we should update. - */ - public function process(&$state) { - assert('is_array($state)'); - assert('array_key_exists("Attributes", $state)'); - $attributes = $state['Attributes']; - SimpleSAML\Logger::debug('OTP2YubiPrefix: enter with attributes: ' . implode(',', array_keys($attributes))); +class OTP2YubiPrefix extends \SimpleSAML\Auth\ProcessingFilter +{ + /** + * Filter out YubiKey 'otp' attribute and replace it with + * a 'yubiPrefix' attribute that leaves out the dynamic part. + * + * @param array &$state The state we should update. + */ + public function process(&$state) + { + assert(is_array($state)); + assert(array_key_exists('Attributes', $state)); + $attributes = $state['Attributes']; - $otps = $attributes['otp']; - $otp = $otps['0']; + \SimpleSAML\Logger::debug('OTP2YubiPrefix: enter with attributes: '.implode(',', array_keys($attributes))); - $token_size = 32; - $identity = substr ($otp, 0, strlen ($otp) - $token_size); + $otps = $attributes['otp']; + $otp = $otps['0']; - $attributes['yubiPrefix'] = array($identity); + $token_size = 32; + $identity = substr($otp, 0, strlen($otp) - $token_size); - SimpleSAML\Logger::info('OTP2YubiPrefix: otp: ' . $otp . ' identity: ' . $identity . ' (otp keys: ' . implode(',', array_keys($otps)) . ')'); + $attributes['yubiPrefix'] = [$identity]; - unset($attributes['otp']); + \SimpleSAML\Logger::info( + 'OTP2YubiPrefix: otp: '.$otp.' identity: '.$identity.' (otp keys: '.implode(',', array_keys($otps)).')' + ); - SimpleSAML\Logger::debug('OTP2YubiPrefix: leaving with attributes: ' . implode(',', array_keys($attributes))); - } + unset($attributes['otp']); + \SimpleSAML\Logger::debug('OTP2YubiPrefix: leaving with attributes: '.implode(',', array_keys($attributes))); + } } diff --git a/vendor/simplesamlphp/simplesamlphp/modules/authYubiKey/lib/Auth/Source/YubiKey.php b/vendor/simplesamlphp/simplesamlphp/modules/authYubiKey/lib/Auth/Source/YubiKey.php index 4f64273d99..65ddf84906 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/authYubiKey/lib/Auth/Source/YubiKey.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/authYubiKey/lib/Auth/Source/YubiKey.php @@ -1,5 +1,7 @@ <?php +namespace SimpleSAML\Module\authYubiKey\Auth\Source; + /* * Copyright (C) 2009 Andreas Åkre Solberg <andreas.solberg@uninett.no> * Copyright (C) 2009 Simon Josefsson <simon@yubico.com>. @@ -25,179 +27,183 @@ /** * YubiKey authentication module, see http://www.yubico.com/developers/intro/ - * * + * * Configure it by adding an entry to config/authsources.php such as this: * - * 'yubikey' => array( - * 'authYubiKey:YubiKey', - * 'id' => 997, - * 'key' => 'b64hmackey', - * ), + * 'yubikey' => array( + * 'authYubiKey:YubiKey', + * 'id' => 997, + * 'key' => 'b64hmackey', + * ), * * To generate your own client id/key you will need one YubiKey, and then * go to http://yubico.com/developers/api/ * * @package SimpleSAMLphp */ -class sspmod_authYubiKey_Auth_Source_YubiKey extends SimpleSAML_Auth_Source { - - /** - * The string used to identify our states. - */ - const STAGEID = 'sspmod_authYubiKey_Auth_Source_YubiKey.state'; - - /** - * The number of characters of the OTP that is the secure token. - * The rest is the user id. - */ - const TOKENSIZE = 32; - - /** - * The key of the AuthId field in the state. - */ - const AUTHID = 'sspmod_authYubiKey_Auth_Source_YubiKey.AuthId'; - - /** - * The client id/key for use with the Auth_Yubico PHP module. - */ - private $yubi_id; - private $yubi_key; - - /** - * Constructor for this authentication source. - * - * @param array $info Information about this authentication source. - * @param array $config Configuration. - */ - public function __construct($info, $config) { - assert('is_array($info)'); - assert('is_array($config)'); - - // Call the parent constructor first, as required by the interface - parent::__construct($info, $config); - - if (array_key_exists('id', $config)) { - $this->yubi_id = $config['id']; - } - - if (array_key_exists('key', $config)) { - $this->yubi_key = $config['key']; - } - } - - - /** - * Initialize login. - * - * This function saves the information about the login, and redirects to a - * login page. - * - * @param array &$state Information about the current authentication. - */ - public function authenticate(&$state) { - assert('is_array($state)'); - - // We are going to need the authId in order to retrieve this authentication source later - $state[self::AUTHID] = $this->authId; - - $id = SimpleSAML_Auth_State::saveState($state, self::STAGEID); - - $url = SimpleSAML\Module::getModuleURL('authYubiKey/yubikeylogin.php'); - \SimpleSAML\Utils\HTTP::redirectTrustedURL($url, array('AuthState' => $id)); - } - - - /** - * Handle login request. - * - * This function is used by the login form (core/www/loginuserpass.php) when the user - * enters a username and password. On success, it will not return. On wrong - * username/password failure, it will return the error code. Other failures will throw an - * exception. - * - * @param string $authStateId The identifier of the authentication state. - * @param string $otp The one time password entered- - * @return string Error code in the case of an error. - */ - public static function handleLogin($authStateId, $otp) { - assert('is_string($authStateId)'); - assert('is_string($otp)'); - - /* Retrieve the authentication state. */ - $state = SimpleSAML_Auth_State::loadState($authStateId, self::STAGEID); - - /* Find authentication source. */ - assert('array_key_exists(self::AUTHID, $state)'); - $source = SimpleSAML_Auth_Source::getById($state[self::AUTHID]); - if ($source === NULL) { - throw new Exception('Could not find authentication source with id ' . $state[self::AUTHID]); - } - - - try { - /* Attempt to log in. */ - $attributes = $source->login($otp); - } catch (SimpleSAML_Error_Error $e) { - /* An error occurred during login. Check if it is because of the wrong - * username/password - if it is, we pass that error up to the login form, - * if not, we let the generic error handler deal with it. - */ - if ($e->getErrorCode() === 'WRONGUSERPASS') { - return 'WRONGUSERPASS'; - } - - /* Some other error occurred. Rethrow exception and let the generic error - * handler deal with it. - */ - throw $e; - } - - $state['Attributes'] = $attributes; - SimpleSAML_Auth_Source::completeAuth($state); - } - - /** - * Return the user id part of a one time passord - */ - public static function getYubiKeyPrefix($otp) { - $uid = substr ($otp, 0, strlen ($otp) - self::TOKENSIZE); - return $uid; - } - - /** - * Attempt to log in using the given username and password. - * - * On a successful login, this function should return the users attributes. On failure, - * it should throw an exception. If the error was caused by the user entering the wrong - * username or password, a SimpleSAML_Error_Error('WRONGUSERPASS') should be thrown. - * - * Note that both the username and the password are UTF-8 encoded. - * - * @param string $username The username the user wrote. - * @param string $password The password the user wrote. - * @return array Associative array with the users attributes. - */ - protected function login($otp) { - assert('is_string($otp)'); - - require_once dirname(dirname(dirname(dirname(__FILE__)))) . '/libextinc/Yubico.php'; - - $attributes = array(); - - try { - $yubi = new Auth_Yubico($this->yubi_id, $this->yubi_key); - $auth = $yubi->verify($otp); - $uid = self::getYubiKeyPrefix($otp); - $attributes = array('uid' => array($uid)); - } catch (Exception $e) { - SimpleSAML\Logger::info('YubiKey:' . $this->authId . ': Validation error (otp ' . $otp . '), debug output: ' . $yubi->getLastResponse()); - - throw new SimpleSAML_Error_Error('WRONGUSERPASS', $e); - } - - SimpleSAML\Logger::info('YubiKey:' . $this->authId . ': YubiKey otp ' . $otp . ' validated successfully: ' . $yubi->getLastResponse()); - - return $attributes; - } +class YubiKey extends \SimpleSAML\Auth\Source +{ + /** + * The string used to identify our states. + */ + const STAGEID = '\SimpleSAML\Module\authYubiKey\Auth\Source\YubiKey.state'; + + /** + * The number of characters of the OTP that is the secure token. + * The rest is the user id. + */ + const TOKENSIZE = 32; + + /** + * The key of the AuthId field in the state. + */ + const AUTHID = '\SimpleSAML\Module\authYubiKey\Auth\Source\YubiKey.AuthId'; + + /** + * The client id/key for use with the Auth_Yubico PHP module. + */ + private $yubi_id; + private $yubi_key; + + /** + * Constructor for this authentication source. + * + * @param array $info Information about this authentication source. + * @param array $config Configuration. + */ + public function __construct($info, $config) + { + assert(is_array($info)); + assert(is_array($config)); + + // Call the parent constructor first, as required by the interface + parent::__construct($info, $config); + + if (array_key_exists('id', $config)) { + $this->yubi_id = $config['id']; + } + + if (array_key_exists('key', $config)) { + $this->yubi_key = $config['key']; + } + } + + + /** + * Initialize login. + * + * This function saves the information about the login, and redirects to a + * login page. + * + * @param array &$state Information about the current authentication. + */ + public function authenticate(&$state) + { + assert(is_array($state)); + + // We are going to need the authId in order to retrieve this authentication source later + $state[self::AUTHID] = $this->authId; + + $id = \SimpleSAML\Auth\State::saveState($state, self::STAGEID); + $url = \SimpleSAML\Module::getModuleURL('authYubiKey/yubikeylogin.php'); + \SimpleSAML\Utils\HTTP::redirectTrustedURL($url, ['AuthState' => $id]); + } + + + /** + * Handle login request. + * + * This function is used by the login form (core/www/loginuserpass.php) when the user + * enters a username and password. On success, it will not return. On wrong + * username/password failure, it will return the error code. Other failures will throw an + * exception. + * + * @param string $authStateId The identifier of the authentication state. + * @param string $otp The one time password entered- + * @return string|null Error code in the case of an error. + */ + public static function handleLogin($authStateId, $otp) + { + assert(is_string($authStateId)); + assert(is_string($otp)); + + /* Retrieve the authentication state. */ + $state = \SimpleSAML\Auth\State::loadState($authStateId, self::STAGEID); + + /* Find authentication source. */ + assert(array_key_exists(self::AUTHID, $state)); + $source = \SimpleSAML\Auth\Source::getById($state[self::AUTHID]); + if ($source === null) { + throw new \Exception('Could not find authentication source with id '.$state[self::AUTHID]); + } + + try { + /* Attempt to log in. */ + $attributes = $source->login($otp); + } catch (\SimpleSAML\Error\Error $e) { + /* An error occurred during login. Check if it is because of the wrong + * username/password - if it is, we pass that error up to the login form, + * if not, we let the generic error handler deal with it. + */ + if ($e->getErrorCode() === 'WRONGUSERPASS') { + return 'WRONGUSERPASS'; + } + + /* Some other error occurred. Rethrow exception and let the generic error + * handler deal with it. + */ + throw $e; + } + + $state['Attributes'] = $attributes; + \SimpleSAML\Auth\Source::completeAuth($state); + + return null; + } + + /** + * Return the user id part of a one time passord + */ + public static function getYubiKeyPrefix($otp) + { + $uid = substr($otp, 0, strlen($otp) - self::TOKENSIZE); + return $uid; + } + + /** + * Attempt to log in using the given username and password. + * + * On a successful login, this function should return the users attributes. On failure, + * it should throw an exception. If the error was caused by the user entering the wrong + * username or password, a \SimpleSAML\Error\Error('WRONGUSERPASS') should be thrown. + * + * Note that both the username and the password are UTF-8 encoded. + * + * @param string $otp + * @return array Associative array with the users attributes. + */ + protected function login($otp) + { + assert(is_string($otp)); + + require_once dirname(dirname(dirname(dirname(__FILE__)))).'/libextinc/Yubico.php'; + + try { + $yubi = new \Auth_Yubico($this->yubi_id, $this->yubi_key); + $yubi->verify($otp); + $uid = self::getYubiKeyPrefix($otp); + $attributes = ['uid' => [$uid]]; + } catch (\Exception $e) { + \SimpleSAML\Logger::info( + 'YubiKey:'.$this->authId.': Validation error (otp '.$otp.'), debug output: '.$yubi->getLastResponse() + ); + throw new \SimpleSAML\Error\Error('WRONGUSERPASS', $e); + } + + \SimpleSAML\Logger::info( + 'YubiKey:'.$this->authId.': YubiKey otp '.$otp.' validated successfully: '.$yubi->getLastResponse() + ); + return $attributes; + } } diff --git a/vendor/simplesamlphp/simplesamlphp/modules/authYubiKey/libextinc/Yubico.php b/vendor/simplesamlphp/simplesamlphp/modules/authYubiKey/libextinc/Yubico.php index aaf99c9983..d6f4c709aa 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/authYubiKey/libextinc/Yubico.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/authYubiKey/libextinc/Yubico.php @@ -1,44 +1,44 @@ <?php - /** - * Class for verifying Yubico One-Time-Passcodes - * - * LICENSE: - * - * Copyright (c) 2007, 2008 Simon Josefsson. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * o Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * o 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. - * o The names of the authors may not 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 - * OWNER 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. - * - * @category Auth - * @package Auth_Yubico - * @author Simon Josefsson <simon@yubico.com> - * @copyright 2008 Simon Josefsson - * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version CVS: $Id: Yubico.php,v 1.7 2007-10-22 12:56:14 jas Exp $ - * @link http://yubico.com/ - */ +/** + * Class for verifying Yubico One-Time-Passcodes + * + * LICENSE: + * + * Copyright (c) 2007, 2008 Simon Josefsson. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * o Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * o 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. + * o The names of the authors may not 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 + * OWNER 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. + * + * @category Auth + * @package Auth_Yubico + * @author Simon Josefsson <simon@yubico.com> + * @copyright 2008 Simon Josefsson + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version CVS: $Id: Yubico.php,v 1.7 2007-10-22 12:56:14 jas Exp $ + * @link http://yubico.com/ + */ /** * Class for verifying Yubico One-Time-Passcodes @@ -58,103 +58,104 @@ */ class Auth_Yubico { - /**#@+ - * @access private - */ - - /** - * Yubico client ID - * @var string - */ - var $_id; - - /** - * Yubico client key - * @var string - */ - var $_key; - - /** - * Response from server - * @var string - */ - var $_response; - - /** - * Constructor - * - * Sets up the object - * @param string The client identity - * @param string The client MAC key (optional) - * @access public - */ - public function __construct($id, $key = '') - { - $this->_id = $id; - $this->_key = base64_decode($key); - } - - /** - * Return the last data received from the server, if any. - * - * @return string Output from server. - * @access public - */ - function getLastResponse() - { - return $this->_response; - } - - // TODO? Add functions to get parsed parts of server response? - - /** - * Verify Yubico OTP - * - * @param string $token Yubico OTP - * @return mixed PEAR error on error, true otherwise - * @access public - */ - function verify($token) - { - $parameters = "id=" . $this->_id . "&otp=" . $token; - // Generate signature - if($this->_key <> "") { - $signature = base64_encode(hash_hmac('sha1', $parameters, $this->_key, true)); - $parameters .= '&h=' . $signature; - } - /* Support https. */ - $url = "https://api.yubico.com/wsapi/verify?" . $parameters; - - $responseMsg = file_get_contents($url); - - if(!preg_match("/status=([a-zA-Z0-9_]+)/", $responseMsg, $out)) { - throw new Exception('Could not parse response'); - } - - $status = $out[1]; - - /* Verify signature. */ - if($this->_key <> "") { - $rows = explode("\r\n", $responseMsg); - while (list($key, $val) = each($rows)) { - // = is also used in BASE64 encoding so we only replace the first = by # which is not used in BASE64 - $val = preg_replace('/=/', '#', $val, 1); - $row = explode("#", $val); - $response[$row[0]] = (isset($row[1])) ? $row[1] : ""; - } - - $check = 'status=' . $response['status'] . '&t='. $response['t']; - $checksignature = base64_encode(hash_hmac('sha1', $check, $this->_key, true)); - - if($response['h'] != $checksignature) { - throw new Exception('Checked Signature failed'); - } - } - - if ($status != 'OK') { - throw new Exception('Status was not OK: ' . $status); - } - - return true; - } + /**#@+ + * @access private + */ + + /** + * Yubico client ID + * @var string + */ + private $id; + + /** + * Yubico client key + * @var string + */ + private $key; + + /** + * Response from server + * @var string + */ + private $response; + + /** + * Constructor + * + * Sets up the object + * @param string $id The client identity + * @param string $key The client MAC key (optional) + * @access public + */ + public function __construct($id, $key = '') + { + $this->id = $id; + $this->key = base64_decode($key); + } + + /** + * Return the last data received from the server, if any. + * + * @return string Output from server. + * @access public + */ + public function getLastResponse() + { + return $this->response; + } + + // TODO? Add functions to get parsed parts of server response? + + /** + * Verify Yubico OTP + * + * @param string $token Yubico OTP + * @return mixed PEAR error on error, true otherwise + * @access public + */ + public function verify($token) + { + $parameters = "id=".$this->id."&otp=".$token; + // Generate signature + if ($this->key <> "") { + $signature = base64_encode(hash_hmac('sha1', $parameters, $this->key, true)); + $parameters .= '&h='.$signature; + } + // Support https + $url = "https://api.yubico.com/wsapi/verify?".$parameters; + + $responseMsg = \SimpleSAML\Utils\HTTP::fetch($url); + + if (!preg_match("/status=([a-zA-Z0-9_]+)/", $responseMsg, $out)) { + throw new Exception('Could not parse response'); + } + + $status = $out[1]; + + // Verify signature + if ($this->key <> "") { + $rows = explode("\r\n", $responseMsg); + $response = []; + foreach ($rows as $val) { + // = is also used in BASE64 encoding so we only replace the first = by # which is not used in BASE64 + $val = preg_replace('/=/', '#', $val, 1); + $row = explode("#", $val); + $response[$row[0]] = (isset($row[1])) ? $row[1] : ""; + } + + $check = 'status='.$response['status'].'&t='.$response['t']; + $checksignature = base64_encode(hash_hmac('sha1', $check, $this->key, true)); + + if ($response['h'] != $checksignature) { + throw new Exception('Checked Signature failed'); + } + } + + if ($status != 'OK') { + throw new Exception('Status was not OK: '.$status); + } + + return true; + } } diff --git a/vendor/simplesamlphp/simplesamlphp/modules/authYubiKey/templates/yubikeylogin.php b/vendor/simplesamlphp/simplesamlphp/modules/authYubiKey/templates/yubikeylogin.php index 0c9f3e48e3..693e4c374c 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/authYubiKey/templates/yubikeylogin.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/authYubiKey/templates/yubikeylogin.php @@ -1,47 +1,35 @@ <?php -$this->data['header'] = $this->t('{authYubiKey:yubikey:header}'); -$this->data['autofocus'] = 'otp'; $this->includeAtTemplateBase('includes/header.php'); +if ($this->data['errorCode'] !== null) { ?> - -<?php -if ($this->data['errorcode'] !== NULL) { -?> - <div style="border-left: 1px solid #e8e8e8; border-bottom: 1px solid #e8e8e8; background: #f5f5f5"> - <img src="/<?php echo $this->data['baseurlpath']; ?>resources/icons/experience/gtk-dialog-error.48x48.png" class="float-l" style="margin: 15px" alt="" /> - <h2><?php echo $this->t('{login:error_header}'); ?></h2> - <p><b><?php echo $this->t($this->data['errorcodes']['title'][$this->data['errorcode']]); ?></b></p> - <p><?php echo $this->t($this->data['errorcodes']['descr'][$this->data['errorcode']]); ?></p> - </div> + <div style="border-left: 1px solid #e8e8e8; border-bottom: 1px solid #e8e8e8; background: #f5f5f5"> + <img src="/<?php echo $this->data['baseurlpath']; ?>resources/icons/experience/gtk-dialog-error.48x48.png" class="float-l" style="margin: 15px" alt="" /> + <h2><?php echo $this->t('{login:error_header}'); ?></h2> + <p><b><?php echo $this->t($this->data['errorcodes']['title'][$this->data['errorcode']]); ?></b></p> + <p><?php echo $this->t($this->data['errorcodes']['descr'][$this->data['errorcode']]); ?></p> + </div> <?php } ?> + <img style="float: right" src="<?php echo($this->data['logoUrl']); ?>" alt="" /> + <img style="clear: right; float: right" src="<?php echo($this->data['devicepicUrl']); ?>" alt="YubiKey" /> - <img style="float: right" src="<?php echo($this->data['logo_url']); ?>" alt="" /> - <img style="clear: right; float: right" src="<?php echo($this->data['devicepic_url']); ?>" alt="YubiKey" /> - - - <h2 style=""><?php echo $this->t('{authYubiKey:yubikey:header}'); ?></h2> - - <form action="?" method="post" name="f"> - - <p><?php echo $this->t('{authYubiKey:yubikey:intro}'); ?></p> - - <p><input id="otp" style="border: 1px solid #ccc; background: #eee; padding: .5em; font-size: medium; width: 70%; color: #aaa" type="text" tabindex="2" name="otp" /></p> + <h2 style=""><?php echo $this->data['header']; ?></h2> + <form action="?" method="post" name="f"> + <p><?php echo $this->t('{authYubiKey:yubikey:intro}'); ?></p> + <p><input id="otp" style="border: 1px solid #ccc; background: #eee; padding: .5em; font-size: medium; width: 70%; color: #aaa" type="text" tabindex="2" name="otp" /></p> <?php -foreach ($this->data['stateparams'] as $name => $value) { - echo('<input type="hidden" name="' . htmlspecialchars($name) . '" value="' . htmlspecialchars($value) . '" />'); +foreach ($this->data['stateParams'] as $name => $value) { + echo '<input type="hidden" name="'.htmlspecialchars($name).'" value="'.htmlspecialchars($value).'" />'; } ?> - - </form> - + </form> <?php $this->includeAtTemplateBase('includes/footer.php'); diff --git a/vendor/simplesamlphp/simplesamlphp/modules/authYubiKey/templates/yubikeylogin.twig b/vendor/simplesamlphp/simplesamlphp/modules/authYubiKey/templates/yubikeylogin.twig new file mode 100644 index 0000000000..8fa4385f21 --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/modules/authYubiKey/templates/yubikeylogin.twig @@ -0,0 +1,31 @@ +{% set pagetitle = header|trans %} +{% extends "base.twig" %} + +{% block preload %} + <link rel="stylesheet" type="text/css" href="{{ baseurlpath }}assets/css/yubikey.css"> +{% endblock %} + +{% block postload %} + <script src="{{ baseurlpath }}assets/js/autofocus.js"></script> +{% endblock %} + +{% block content %} + {% if errorCode != null %} + <div class="message-box error"> + <h3>{{ errorTitle }}</h3> + <p>{{ errorDesc }}</p> + </div> + {% endif %} + + <img style="float: right" src="{{ logoUrl }}" alt=""> + <img style="clear: right; float: right" src="{{ devicepicUrl }}" alt="YubiKey"> + + <h2>{{ '{authYubiKey:yubikey:header}'|trans }}</h2> + <form action="?" method="post" name="f"> + <p>{{ '{authYubiKey:yubikey:intro}'|trans }}</p> + <p><input id="otp" type="text" tabindex="2" name="otp" autofocus></p> + {% for key, value in stateParams %} + <input type="hidden" name="{{ key|escape('html') }}" value="{{ value|escape('html') }}"> + {% endfor %} + </form> +{% endblock %} diff --git a/vendor/simplesamlphp/simplesamlphp/modules/authYubiKey/www/assets/css/yubikey.css b/vendor/simplesamlphp/simplesamlphp/modules/authYubiKey/www/assets/css/yubikey.css new file mode 100644 index 0000000000..6b033d0252 --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/modules/authYubiKey/www/assets/css/yubikey.css @@ -0,0 +1,7 @@ +input#otp { + border: 1px solid #ccc; + background: #eee; padding: .5em; + font-size: medium; + width: 70%; + color: #aaa; +} diff --git a/vendor/simplesamlphp/simplesamlphp/modules/authYubiKey/www/assets/js/autofocus.js b/vendor/simplesamlphp/simplesamlphp/modules/authYubiKey/www/assets/js/autofocus.js new file mode 100644 index 0000000000..c846eb302d --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/modules/authYubiKey/www/assets/js/autofocus.js @@ -0,0 +1 @@ +SimpleSAML_focus('otp'); diff --git a/vendor/simplesamlphp/simplesamlphp/modules/authYubiKey/www/resources/logo.jpg b/vendor/simplesamlphp/simplesamlphp/modules/authYubiKey/www/resources/logo.jpg index 3b7e7f360d..e2fded1a93 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/authYubiKey/www/resources/logo.jpg +++ b/vendor/simplesamlphp/simplesamlphp/modules/authYubiKey/www/resources/logo.jpg @@ -1,4 +1,4 @@ -�����JFIF��H�H������Exif��MM�*������������������J�������R(��������i�������Z�������H������H�����������,��������a�������C� +�����JFIF��H�H�����C� ���C ����a,"������������������������������������������ZS�1x]r̷� �nG^��ۓ� ��\3������?��Nj��1���p=Y���U�0�N|��gZ ;�,�}��U���9�K�n^+�<��J�����k������2n���+�x�O�����t'������k�Ӄ����C�&��g-�l~@s����u�OMg��+���z��,�g��18hy���ɒ���JӢsF�����z��<��B���YD�/�4�;ꬳ+?:�������ILG��m�)��O�jҷU=�-�u>Y�\$Co\3&�t��_����玽��>��Ds^����p9�q�F����QZ9�KԹ͕-����p�����\u!6lGf[���ol���gM� �9�f��1~���L�YOס�LJ2���۫�n������LQk��2��)x��`����<�z�t����DA �������"2�'O��ߩ��8�x$J�_�_�r%��*Df\��m^}e�~�������Ā����������������+�������6 5@AP"%01��������k�lWu�g���"?pUqvҟ�w�5}����B!��e _��QG���C��� diff --git a/vendor/simplesamlphp/simplesamlphp/modules/authYubiKey/www/yubikeylogin.php b/vendor/simplesamlphp/simplesamlphp/modules/authYubiKey/www/yubikeylogin.php index 1d0c7597ad..c484282515 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/authYubiKey/www/yubikeylogin.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/authYubiKey/www/yubikeylogin.php @@ -2,7 +2,7 @@ /** * This page shows a username/password login form, and passes information from it - * to the sspmod_core_Auth_UserPassBase class, which is a generic class for + * to the \SimpleSAML\Module\core\Auth\UserPassBase class, which is a generic class for * username/password authentication. * * @author Olav Morken, UNINETT AS. @@ -10,29 +10,27 @@ */ if (!array_key_exists('AuthState', $_REQUEST)) { - throw new SimpleSAML_Error_BadRequest('Missing AuthState parameter.'); + throw new \SimpleSAML\Error\BadRequest('Missing AuthState parameter.'); } $authStateId = $_REQUEST['AuthState']; -if (array_key_exists('otp', $_REQUEST)) { - $otp = $_REQUEST['otp']; -} else { - $otp = ''; -} +$globalConfig = \SimpleSAML\Configuration::getInstance(); +$t = new \SimpleSAML\XHTML\Template($globalConfig, 'authYubiKey:yubikeylogin.php'); +$translator = $t->getTranslator(); -if (!empty($otp)) { - // attempt to log in - $errorCode = sspmod_authYubiKey_Auth_Source_YubiKey::handleLogin($authStateId, $otp); -} else { - $errorCode = NULL; +$errorCode = null; +if (array_key_exists('otp', $_REQUEST)) { + // attempt to log in + $errorCode = \SimpleSAML\Module\authYubiKey\Auth\Source\YubiKey::handleLogin($authStateId, $_REQUEST['otp']); + $errorCodes = \SimpleSAML\Error\ErrorCodes::getAllErrorCodeMessages(); + $t->data['errorTitle'] = $errorCodes['title'][$errorCode]; + $t->data['errorDesc'] = $errorCodes['desc'][$errorCode]; } -$globalConfig = SimpleSAML_Configuration::getInstance(); -$t = new SimpleSAML_XHTML_Template($globalConfig, 'authYubiKey:yubikeylogin.php'); -$t->data['stateparams'] = array('AuthState' => $authStateId); -$t->data['errorcode'] = $errorCode; -$t->data['errorcodes'] = SimpleSAML\Error\ErrorCodes::getAllErrorCodeMessages(); -$t->data['logo_url'] = SimpleSAML\Module::getModuleURL('authYubiKey/resources/logo.jpg'); -$t->data['devicepic_url'] = SimpleSAML\Module::getModuleURL('authYubiKey/resources/yubikey.jpg'); +$t->data['header'] = $translator->t('{authYubiKey:yubikey:header}'); +$t->data['autofocus'] = 'otp'; +$t->data['errorCode'] = $errorCode; +$t->data['stateParams'] = ['AuthState' => $authStateId]; +$t->data['logoUrl'] = \SimpleSAML\Module::getModuleURL('authYubiKey/resources/logo.jpg'); +$t->data['devicepicUrl'] = \SimpleSAML\Module::getModuleURL('authYubiKey/resources/yubikey.jpg'); $t->show(); -exit(); diff --git a/vendor/simplesamlphp/simplesamlphp/modules/authcrypt/lib/Auth/Source/Hash.php b/vendor/simplesamlphp/simplesamlphp/modules/authcrypt/lib/Auth/Source/Hash.php index ef5b35b335..aa17adcf68 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/authcrypt/lib/Auth/Source/Hash.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/authcrypt/lib/Auth/Source/Hash.php @@ -1,5 +1,6 @@ <?php +namespace SimpleSAML\Module\authcrypt\Auth\Source; /** * Authentication source for username & hashed password. @@ -10,10 +11,9 @@ * @author Dyonisius Visser, TERENA. * @package SimpleSAMLphp */ -class sspmod_authcrypt_Auth_Source_Hash extends sspmod_core_Auth_UserPassBase -{ - +class Hash extends \SimpleSAML\Module\core\Auth\UserPassBase +{ /** * Our users, stored in an associative array. The key of the array is "<username>:<passwordhash>", * while the value of each element is a new array with the attributes for each user. @@ -31,33 +31,33 @@ class sspmod_authcrypt_Auth_Source_Hash extends sspmod_core_Auth_UserPassBase */ public function __construct($info, $config) { - assert('is_array($info)'); - assert('is_array($config)'); + assert(is_array($info)); + assert(is_array($config)); // Call the parent constructor first, as required by the interface parent::__construct($info, $config); - $this->users = array(); + $this->users = []; // Validate and parse our configuration foreach ($config as $userpass => $attributes) { if (!is_string($userpass)) { - throw new Exception('Invalid <username>:<passwordhash> for authentication source '. + throw new \Exception('Invalid <username>:<passwordhash> for authentication source '. $this->authId.': '.$userpass); } $userpass = explode(':', $userpass, 2); if (count($userpass) !== 2) { - throw new Exception('Invalid <username>:<passwordhash> for authentication source '. + throw new \Exception('Invalid <username>:<passwordhash> for authentication source '. $this->authId.': '.$userpass[0]); } $username = $userpass[0]; $passwordhash = $userpass[1]; try { - $attributes = SimpleSAML\Utils\Attributes::normalizeAttributesArray($attributes); - } catch (Exception $e) { - throw new Exception('Invalid attributes for user '.$username. + $attributes = \SimpleSAML\Utils\Attributes::normalizeAttributesArray($attributes); + } catch (\Exception $e) { + throw new \Exception('Invalid attributes for user '.$username. ' in authentication source '.$this->authId.': '. $e->getMessage()); } @@ -72,7 +72,7 @@ public function __construct($info, $config) * * On a successful login, this function should return the users attributes. On failure, * it should throw an exception. If the error was caused by the user entering the wrong - * username OR password, a SimpleSAML_Error_Error('WRONGUSERPASS') should be thrown. + * username OR password, a \SimpleSAML\Error\Error('WRONGUSERPASS') should be thrown. * * The username is UTF-8 encoded, and the hash is base64 encoded. * @@ -81,23 +81,23 @@ public function __construct($info, $config) * * @return array Associative array with the users attributes. * - * @throws SimpleSAML_Error_Error if authentication fails. + * @throws \SimpleSAML\Error\Error if authentication fails. */ protected function login($username, $password) { - assert('is_string($username)'); - assert('is_string($password)'); + assert(is_string($username)); + assert(is_string($password)); foreach ($this->users as $userpass => $attrs) { $matches = explode(':', $userpass, 2); if ($matches[0] === $username) { - if (SimpleSAML\Utils\Crypto::pwValid($matches[1], $password)) { + if (\SimpleSAML\Utils\Crypto::pwValid($matches[1], $password)) { return $attrs; } else { - SimpleSAML\Logger::debug('Incorrect password "'.$password.'" for user '.$username); + \SimpleSAML\Logger::debug('Incorrect password "'.$password.'" for user '.$username); } } } - throw new SimpleSAML_Error_Error('WRONGUSERPASS'); + throw new \SimpleSAML\Error\Error('WRONGUSERPASS'); } } diff --git a/vendor/simplesamlphp/simplesamlphp/modules/authcrypt/lib/Auth/Source/Htpasswd.php b/vendor/simplesamlphp/simplesamlphp/modules/authcrypt/lib/Auth/Source/Htpasswd.php index 5b9ffc3f38..72a1fce728 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/authcrypt/lib/Auth/Source/Htpasswd.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/authcrypt/lib/Auth/Source/Htpasswd.php @@ -1,5 +1,7 @@ <?php +namespace SimpleSAML\Module\authcrypt\Auth\Source; + /** * Authentication source for Apache 'htpasswd' files. * @@ -9,10 +11,8 @@ use WhiteHat101\Crypt\APR1_MD5; -class sspmod_authcrypt_Auth_Source_Htpasswd extends sspmod_core_Auth_UserPassBase +class Htpasswd extends \SimpleSAML\Module\core\Auth\UserPassBase { - - /** * Our users, stored in an array, where each value is "<username>:<passwordhash>". * @@ -25,7 +25,7 @@ class sspmod_authcrypt_Auth_Source_Htpasswd extends sspmod_core_Auth_UserPassBas * * @var array */ - private $attributes = array(); + private $attributes = []; /** @@ -38,24 +38,24 @@ class sspmod_authcrypt_Auth_Source_Htpasswd extends sspmod_core_Auth_UserPassBas */ public function __construct($info, $config) { - assert('is_array($info)'); - assert('is_array($config)'); + assert(is_array($info)); + assert(is_array($config)); // Call the parent constructor first, as required by the interface parent::__construct($info, $config); - $this->users = array(); + $this->users = []; if (!$htpasswd = file_get_contents($config['htpasswd_file'])) { - throw new Exception('Could not read '.$config['htpasswd_file']); + throw new \Exception('Could not read '.$config['htpasswd_file']); } $this->users = explode("\n", trim($htpasswd)); try { - $this->attributes = SimpleSAML\Utils\Attributes::normalizeAttributesArray($config['static_attributes']); - } catch (Exception $e) { - throw new Exception('Invalid static_attributes in authentication source '. + $this->attributes = \SimpleSAML\Utils\Attributes::normalizeAttributesArray($config['static_attributes']); + } catch (\Exception $e) { + throw new \Exception('Invalid static_attributes in authentication source '. $this->authId.': '.$e->getMessage()); } } @@ -66,7 +66,7 @@ public function __construct($info, $config) * * On a successful login, this function should return the username as 'uid' attribute, * and merged attributes from the configuration file. - * On failure, it should throw an exception. A SimpleSAML_Error_Error('WRONGUSERPASS') + * On failure, it should throw an exception. A \SimpleSAML\Error\Error('WRONGUSERPASS') * should be thrown in case of a wrong username OR a wrong password, to prevent the * enumeration of usernames. * @@ -75,12 +75,12 @@ public function __construct($info, $config) * * @return array Associative array with the users attributes. * - * @throws SimpleSAML_Error_Error if authentication fails. + * @throws \SimpleSAML\Error\Error if authentication fails. */ protected function login($username, $password) { - assert('is_string($username)'); - assert('is_string($password)'); + assert(is_string($username)); + assert(is_string($password)); foreach ($this->users as $userpass) { $matches = explode(':', $userpass, 2); @@ -88,12 +88,12 @@ protected function login($username, $password) $crypted = $matches[1]; // This is about the only attribute we can add - $attributes = array_merge(array('uid' => array($username)), $this->attributes); + $attributes = array_merge(['uid' => [$username]], $this->attributes); // Traditional crypt(3) - if (SimpleSAML\Utils\Crypto::secureCompare($crypted, crypt($password, $crypted))) { - SimpleSAML\Logger::debug('User '.$username.' authenticated successfully'); - SimpleSAML\Logger::warning( + if (\SimpleSAML\Utils\Crypto::secureCompare($crypted, crypt($password, $crypted))) { + \SimpleSAML\Logger::debug('User '.$username.' authenticated successfully'); + \SimpleSAML\Logger::warning( 'CRYPT authentication is insecure. Please consider using something else.' ); return $attributes; @@ -101,21 +101,18 @@ protected function login($username, $password) // Apache's custom MD5 if (APR1_MD5::check($password, $crypted)) { - SimpleSAML\Logger::debug('User '.$username.' authenticated successfully'); + \SimpleSAML\Logger::debug('User '.$username.' authenticated successfully'); return $attributes; } - // SHA1 or plain-text - if (SimpleSAML\Utils\Crypto::pwValid($crypted, $password)) { - SimpleSAML\Logger::debug('User '.$username.' authenticated successfully'); - SimpleSAML\Logger::warning( - 'SHA1 and PLAIN TEXT authentication are insecure. Please consider using something else.' - ); + // PASSWORD_BCRYPT + if (\SimpleSAML\Utils\Crypto::pwValid($crypted, $password)) { + \SimpleSAML\Logger::debug('User '.$username.' authenticated successfully'); return $attributes; } - throw new SimpleSAML_Error_Error('WRONGUSERPASS'); + throw new \SimpleSAML\Error\Error('WRONGUSERPASS'); } } - throw new SimpleSAML_Error_Error('WRONGUSERPASS'); + throw new \SimpleSAML\Error\Error('WRONGUSERPASS'); } } diff --git a/vendor/simplesamlphp/simplesamlphp/modules/authfacebook/extlibinc/base_facebook.php b/vendor/simplesamlphp/simplesamlphp/modules/authfacebook/extlibinc/base_facebook.php index cd4536db1a..aa1a23efb2 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/authfacebook/extlibinc/base_facebook.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/authfacebook/extlibinc/base_facebook.php @@ -16,10 +16,10 @@ */ if (!function_exists('curl_init')) { - throw new Exception('Facebook needs the CURL PHP extension.'); + throw new Exception('Facebook needs the CURL PHP extension.'); } if (!function_exists('json_decode')) { - throw new Exception('Facebook needs the JSON PHP extension.'); + throw new Exception('Facebook needs the JSON PHP extension.'); } /** @@ -29,81 +29,85 @@ */ class FacebookApiException extends Exception { - /** - * The result from the API server that represents the exception information. - */ - protected $result; - - /** - * Make a new API Exception with the given result. - * - * @param array $result The result from the API server - */ - public function __construct($result) { - $this->result = $result; - - $code = isset($result['error_code']) ? $result['error_code'] : 0; - - if (isset($result['error_description'])) { - // OAuth 2.0 Draft 10 style - $msg = $result['error_description']; - } else if (isset($result['error']) && is_array($result['error'])) { - // OAuth 2.0 Draft 00 style - $msg = $result['error']['message']; - } else if (isset($result['error_msg'])) { - // Rest server style - $msg = $result['error_msg']; - } else { - $msg = 'Unknown Error. Check getResult()'; + /** + * The result from the API server that represents the exception information. + */ + protected $result; + + /** + * Make a new API Exception with the given result. + * + * @param array $result The result from the API server + */ + public function __construct($result) + { + $this->result = $result; + + $code = isset($result['error_code']) ? $result['error_code'] : 0; + + if (isset($result['error_description'])) { + // OAuth 2.0 Draft 10 style + $msg = $result['error_description']; + } elseif (isset($result['error']) && is_array($result['error'])) { + // OAuth 2.0 Draft 00 style + $msg = $result['error']['message']; + } elseif (isset($result['error_msg'])) { + // Rest server style + $msg = $result['error_msg']; + } else { + $msg = 'Unknown Error. Check getResult()'; + } + + parent::__construct($msg, $code); } - parent::__construct($msg, $code); - } - - /** - * Return the associated result object returned by the API server. - * - * @return array The result from the API server - */ - public function getResult() { - return $this->result; - } - - /** - * Returns the associated type for the error. This will default to - * 'Exception' when a type is not available. - * - * @return string - */ - public function getType() { - if (isset($this->result['error'])) { - $error = $this->result['error']; - if (is_string($error)) { - // OAuth 2.0 Draft 10 style - return $error; - } else if (is_array($error)) { - // OAuth 2.0 Draft 00 style - if (isset($error['type'])) { - return $error['type']; + /** + * Return the associated result object returned by the API server. + * + * @return array The result from the API server + */ + public function getResult() + { + return $this->result; + } + + /** + * Returns the associated type for the error. This will default to + * 'Exception' when a type is not available. + * + * @return string + */ + public function getType() + { + if (isset($this->result['error'])) { + $error = $this->result['error']; + if (is_string($error)) { + // OAuth 2.0 Draft 10 style + return $error; + } elseif (is_array($error)) { + // OAuth 2.0 Draft 00 style + if (isset($error['type'])) { + return $error['type']; + } + } } - } + + return 'Exception'; } - return 'Exception'; - } - - /** - * To make debugging easier. - * - * @return string The string representation of the error - */ - public function __toString() { - $str = $this->getType() . ': '; - if ($this->code != 0) { - $str .= $this->code . ': '; + /** + * To make debugging easier. + * + * @return string The string representation of the error + */ + public function __toString() + { + $str = $this->getType().': '; + if ($this->code != 0) { + $str .= $this->code.': '; + } + return $str.$this->message; } - return $str . $this->message; - } } /** @@ -117,1320 +121,1340 @@ public function __toString() { */ abstract class BaseFacebook { - /** - * Version. - */ - const VERSION = '3.2.2'; - - /** - * Signed Request Algorithm. - */ - const SIGNED_REQUEST_ALGORITHM = 'HMAC-SHA256'; - - /** - * Default options for curl. - */ - public static $CURL_OPTS = array( - CURLOPT_CONNECTTIMEOUT => 10, - CURLOPT_RETURNTRANSFER => true, - CURLOPT_TIMEOUT => 60, - CURLOPT_USERAGENT => 'facebook-php-3.2', - ); - - /** - * List of query parameters that get automatically dropped when rebuilding - * the current URL. - */ - protected static $DROP_QUERY_PARAMS = array( - 'code', - 'state', - 'signed_request', - ); - - /** - * Maps aliases to Facebook domains. - */ - public static $DOMAIN_MAP = array( - 'api' => 'https://api.facebook.com/', - 'api_video' => 'https://api-video.facebook.com/', - 'api_read' => 'https://api-read.facebook.com/', - 'graph' => 'https://graph.facebook.com/', - 'graph_video' => 'https://graph-video.facebook.com/', - 'www' => 'https://www.facebook.com/', - ); - - /** - * The Application ID. - * - * @var string - */ - protected $appId; - - /** - * The Application App Secret. - * - * @var string - */ - protected $appSecret; - - /** - * The ID of the Facebook user, or 0 if the user is logged out. - * - * @var integer - */ - protected $user; - - /** - * The data from the signed_request token. - */ - protected $signedRequest; - - /** - * A CSRF state variable to assist in the defense against CSRF attacks. - */ - protected $state; - - /** - * The OAuth access token received in exchange for a valid authorization - * code. null means the access token has yet to be determined. - * - * @var string - */ - protected $accessToken = null; - - /** - * Indicates if the CURL based @ syntax for file uploads is enabled. - * - * @var boolean - */ - protected $fileUploadSupport = false; - - /** - * Indicates if we trust HTTP_X_FORWARDED_* headers. - * - * @var boolean - */ - protected $trustForwarded = false; - - /** - * Initialize a Facebook Application. - * - * The configuration: - * - appId: the application ID - * - secret: the application secret - * - fileUpload: (optional) boolean indicating if file uploads are enabled - * - * @param array $config The application configuration - */ - public function __construct($config) { - $this->setAppId($config['appId']); - $this->setAppSecret($config['secret']); - if (isset($config['fileUpload'])) { - $this->setFileUploadSupport($config['fileUpload']); + /** + * Version. + */ + const VERSION = '3.2.2'; + + /** + * Signed Request Algorithm. + */ + const SIGNED_REQUEST_ALGORITHM = 'HMAC-SHA256'; + + /** + * Default options for curl. + */ + public static $CURL_OPTS = [ + CURLOPT_CONNECTTIMEOUT => 10, + CURLOPT_RETURNTRANSFER => true, + CURLOPT_TIMEOUT => 60, + CURLOPT_USERAGENT => 'facebook-php-3.2', + ]; + + /** + * Maps aliases to Facebook domains. + */ + public static $DOMAIN_MAP = [ + 'api' => 'https://api.facebook.com/', + 'api_video' => 'https://api-video.facebook.com/', + 'api_read' => 'https://api-read.facebook.com/', + 'graph' => 'https://graph.facebook.com/', + 'graph_video' => 'https://graph-video.facebook.com/', + 'www' => 'https://www.facebook.com/', + ]; + + /** + * The Application ID. + * + * @var string + */ + protected $appId; + + /** + * The Application App Secret. + * + * @var string + */ + protected $appSecret; + + /** + * The ID of the Facebook user, or 0 if the user is logged out. + * + * @var integer + */ + protected $user; + + /** + * The data from the signed_request token. + */ + protected $signedRequest; + + /** + * A CSRF state variable to assist in the defense against CSRF attacks. + */ + protected $state; + + /** + * The OAuth access token received in exchange for a valid authorization + * code. null means the access token has yet to be determined. + * + * @var string + */ + protected $accessToken = null; + + /** + * Indicates if the CURL based @ syntax for file uploads is enabled. + * + * @var boolean + */ + protected $fileUploadSupport = false; + + /** + * Indicates if we trust HTTP_X_FORWARDED_* headers. + * + * @var boolean + */ + protected $trustForwarded = false; + + /** + * Initialize a Facebook Application. + * + * The configuration: + * - appId: the application ID + * - secret: the application secret + * - fileUpload: (optional) boolean indicating if file uploads are enabled + * + * @param array $config The application configuration + */ + public function __construct($config) + { + $this->setAppId($config['appId']); + $this->setAppSecret($config['secret']); + if (isset($config['fileUpload'])) { + $this->setFileUploadSupport($config['fileUpload']); + } + if (isset($config['trustForwarded']) && $config['trustForwarded']) { + $this->trustForwarded = true; + } + $state = $this->getPersistentData('state'); + if (!empty($state)) { + $this->state = $state; + } } - if (isset($config['trustForwarded']) && $config['trustForwarded']) { - $this->trustForwarded = true; + + /** + * Set the Application ID. + * + * @param string $appId The Application ID + * @return BaseFacebook + */ + public function setAppId($appId) + { + $this->appId = $appId; + return $this; } - $state = $this->getPersistentData('state'); - if (!empty($state)) { - $this->state = $state; + + /** + * Get the Application ID. + * + * @return string the Application ID + */ + public function getAppId() + { + return $this->appId; } - } - - /** - * Set the Application ID. - * - * @param string $appId The Application ID - * @return BaseFacebook - */ - public function setAppId($appId) { - $this->appId = $appId; - return $this; - } - - /** - * Get the Application ID. - * - * @return string the Application ID - */ - public function getAppId() { - return $this->appId; - } - - /** - * Set the App Secret. - * - * @param string $apiSecret The App Secret - * @return BaseFacebook - * @deprecated - */ - public function setApiSecret($apiSecret) { - $this->setAppSecret($apiSecret); - return $this; - } - - /** - * Set the App Secret. - * - * @param string $appSecret The App Secret - * @return BaseFacebook - */ - public function setAppSecret($appSecret) { - $this->appSecret = $appSecret; - return $this; - } - - /** - * Get the App Secret. - * - * @return string the App Secret - * @deprecated - */ - public function getApiSecret() { - return $this->getAppSecret(); - } - - /** - * Get the App Secret. - * - * @return string the App Secret - */ - public function getAppSecret() { - return $this->appSecret; - } - - /** - * Set the file upload support status. - * - * @param boolean $fileUploadSupport The file upload support status. - * @return BaseFacebook - */ - public function setFileUploadSupport($fileUploadSupport) { - $this->fileUploadSupport = $fileUploadSupport; - return $this; - } - - /** - * Get the file upload support status. - * - * @return boolean true if and only if the server supports file upload. - */ - public function getFileUploadSupport() { - return $this->fileUploadSupport; - } - - /** - * DEPRECATED! Please use getFileUploadSupport instead. - * - * Get the file upload support status. - * - * @return boolean true if and only if the server supports file upload. - */ - public function useFileUploadSupport() { - return $this->getFileUploadSupport(); - } - - /** - * Sets the access token for api calls. Use this if you get - * your access token by other means and just want the SDK - * to use it. - * - * @param string $access_token an access token. - * @return BaseFacebook - */ - public function setAccessToken($access_token) { - $this->accessToken = $access_token; - return $this; - } - - /** - * Extend an access token, while removing the short-lived token that might - * have been generated via client-side flow. Thanks to http://bit.ly/b0Pt0H - * for the workaround. - */ - public function setExtendedAccessToken() { - try { - // need to circumvent json_decode by calling _oauthRequest - // directly, since response isn't JSON format - $access_token_response = $this->_oauthRequest( - $this->getUrl('graph', '/oauth/access_token'), - $params = array( - 'client_id' => $this->getAppId(), - 'client_secret' => $this->getAppSecret(), - 'grant_type' => 'fb_exchange_token', - 'fb_exchange_token' => $this->getAccessToken(), - ) - ); + + /** + * Set the App Secret. + * + * @param string $apiSecret The App Secret + * @return BaseFacebook + * @deprecated + */ + public function setApiSecret($apiSecret) + { + $this->setAppSecret($apiSecret); + return $this; } - catch (FacebookApiException $e) { - // most likely that user very recently revoked authorization - // In any event, we don't have an access token, so say so - return false; + + /** + * Set the App Secret. + * + * @param string $appSecret The App Secret + * @return BaseFacebook + */ + public function setAppSecret($appSecret) + { + $this->appSecret = $appSecret; + return $this; } - if (empty($access_token_response)) { - return false; + /** + * Get the App Secret. + * + * @return string the App Secret + * @deprecated + */ + public function getApiSecret() + { + return $this->getAppSecret(); } - $response_params = array(); - parse_str($access_token_response, $response_params); + /** + * Get the App Secret. + * + * @return string the App Secret + */ + public function getAppSecret() + { + return $this->appSecret; + } - if (!isset($response_params['access_token'])) { - return false; + /** + * Set the file upload support status. + * + * @param boolean $fileUploadSupport The file upload support status. + * @return BaseFacebook + */ + public function setFileUploadSupport($fileUploadSupport) + { + $this->fileUploadSupport = $fileUploadSupport; + return $this; } - $this->destroySession(); - - $this->setPersistentData( - 'access_token', $response_params['access_token'] - ); - } - - /** - * Determines the access token that should be used for API calls. - * The first time this is called, $this->accessToken is set equal - * to either a valid user access token, or it's set to the application - * access token if a valid user access token wasn't available. Subsequent - * calls return whatever the first call returned. - * - * @return string The access token - */ - public function getAccessToken() { - if ($this->accessToken !== null) { - // we've done this already and cached it. Just return. - return $this->accessToken; + /** + * Get the file upload support status. + * + * @return boolean true if and only if the server supports file upload. + */ + public function getFileUploadSupport() + { + return $this->fileUploadSupport; } - // first establish access token to be the application - // access token, in case we navigate to the /oauth/access_token - // endpoint, where SOME access token is required - $this->setAccessToken($this->getApplicationAccessToken()); - $user_access_token = $this->getUserAccessToken(); - if ($user_access_token) { - $this->setAccessToken($user_access_token); + /** + * DEPRECATED! Please use getFileUploadSupport instead. + * + * Get the file upload support status. + * + * @return boolean true if and only if the server supports file upload. + */ + public function useFileUploadSupport() + { + return $this->getFileUploadSupport(); } - return $this->accessToken; - } - - /** - * Determines and returns the user access token, first using - * the signed request if present, and then falling back on - * the authorization code if present. The intent is to - * return a valid user access token, or false if one is determined - * to not be available. - * - * @return string A valid user access token, or false if one - * could not be determined. - */ - protected function getUserAccessToken() { - // first, consider a signed request if it's supplied - // if there is a signed request, then it alone determines - // the access token - $signed_request = $this->getSignedRequest(); - if ($signed_request) { - // apps.facebook.com hands the access_token in the signed_request - if (array_key_exists('oauth_token', $signed_request)) { - $access_token = $signed_request['oauth_token']; - $this->setPersistentData('access_token', $access_token); - return $access_token; - } - - // the JS SDK puts a code in with the redirect_uri of '' - if (array_key_exists('code', $signed_request)) { - $code = $signed_request['code']; - if ($code && $code == $this->getPersistentData('code')) { - // short-circuit if the code we have is the same as the one presented - return $this->getPersistentData('access_token'); + /** + * Sets the access token for api calls. Use this if you get + * your access token by other means and just want the SDK + * to use it. + * + * @param string $access_token an access token. + * @return BaseFacebook + */ + public function setAccessToken($access_token) + { + $this->accessToken = $access_token; + return $this; + } + + /** + * Extend an access token, while removing the short-lived token that might + * have been generated via client-side flow. Thanks to http://bit.ly/b0Pt0H + * for the workaround. + * + * @return boolean Return true is the access token is set. + */ + public function setExtendedAccessToken() + { + try { + // need to circumvent json_decode by calling _oauthRequest + // directly, since response isn't JSON format + $access_token_response = $this->_oauthRequest( + $this->getUrl('graph', '/oauth/access_token'), + $params = [ + 'client_id' => $this->getAppId(), + 'client_secret' => $this->getAppSecret(), + 'grant_type' => 'fb_exchange_token', + 'fb_exchange_token' => $this->getAccessToken(), + ] + ); + } catch (FacebookApiException $e) { + // most likely that user very recently revoked authorization + // In any event, we don't have an access token, so say so + return false; } - $access_token = $this->getAccessTokenFromCode($code, ''); - if ($access_token) { - $this->setPersistentData('code', $code); - $this->setPersistentData('access_token', $access_token); - return $access_token; + if (empty($access_token_response)) { + return false; } - } - // signed request states there's no access token, so anything - // stored should be cleared - $this->clearAllPersistentData(); - return false; // respect the signed request's data, even - // if there's an authorization code or something else - } + $response_params = []; + parse_str($access_token_response, $response_params); - $code = $this->getCode(); - if ($code && $code != $this->getPersistentData('code')) { - $access_token = $this->getAccessTokenFromCode($code); - if ($access_token) { - $this->setPersistentData('code', $code); - $this->setPersistentData('access_token', $access_token); - return $access_token; - } - - // code was bogus, so everything based on it should be invalidated - $this->clearAllPersistentData(); - return false; - } + if (!isset($response_params['access_token'])) { + return false; + } + + $this->destroySession(); - // as a fallback, just return whatever is in the persistent - // store, knowing nothing explicit (signed request, authorization - // code, etc.) was present to shadow it (or we saw a code in $_REQUEST, - // but it's the same as what's in the persistent store) - return $this->getPersistentData('access_token'); - } - - /** - * Retrieve the signed request, either from a request parameter or, - * if not present, from a cookie. - * - * @return string the signed request, if available, or null otherwise. - */ - public function getSignedRequest() { - if (!$this->signedRequest) { - if (!empty($_REQUEST['signed_request'])) { - $this->signedRequest = $this->parseSignedRequest( - $_REQUEST['signed_request']); - } else if (!empty($_COOKIE[$this->getSignedRequestCookieName()])) { - $this->signedRequest = $this->parseSignedRequest( - $_COOKIE[$this->getSignedRequestCookieName()]); - } + $this->setPersistentData( + 'access_token', + $response_params['access_token'] + ); + return true; } - return $this->signedRequest; - } - - /** - * Get the UID of the connected user, or 0 - * if the Facebook user is not connected. - * - * @return string the UID if available. - */ - public function getUser() { - if ($this->user !== null) { - // we've already determined this and cached the value - return $this->user; + + /** + * Determines the access token that should be used for API calls. + * The first time this is called, $this->accessToken is set equal + * to either a valid user access token, or it's set to the application + * access token if a valid user access token wasn't available. Subsequent + * calls return whatever the first call returned. + * + * @return string The access token + */ + public function getAccessToken() + { + if ($this->accessToken !== null) { + // we've done this already and cached it. Just return. + return $this->accessToken; + } + + // first establish access token to be the application + // access token, in case we navigate to the /oauth/access_token + // endpoint, where SOME access token is required + $this->setAccessToken($this->getApplicationAccessToken()); + $user_access_token = $this->getUserAccessToken(); + if ($user_access_token) { + $this->setAccessToken($user_access_token); + } + + return $this->accessToken; } - return $this->user = $this->getUserFromAvailableData(); - } - - /** - * Determines the connected user by first examining any signed - * requests, then considering an authorization code, and then - * falling back to any persistent store storing the user. - * - * @return integer The id of the connected Facebook user, - * or 0 if no such user exists. - */ - protected function getUserFromAvailableData() { - // if a signed request is supplied, then it solely determines - // who the user is - $signed_request = $this->getSignedRequest(); - if ($signed_request) { - if (array_key_exists('user_id', $signed_request)) { - $user = $signed_request['user_id']; - - if($user != $this->getPersistentData('user_id')){ - $this->clearAllPersistentData(); + /** + * Determines and returns the user access token, first using + * the signed request if present, and then falling back on + * the authorization code if present. The intent is to + * return a valid user access token, or false if one is determined + * to not be available. + * + * @return false|string A valid user access token, or false if one + * could not be determined. + */ + protected function getUserAccessToken() + { + // first, consider a signed request if it's supplied + // if there is a signed request, then it alone determines + // the access token + $signed_request = $this->getSignedRequest(); + if ($signed_request) { + // apps.facebook.com hands the access_token in the signed_request + if (array_key_exists('oauth_token', $signed_request)) { + $access_token = $signed_request['oauth_token']; + $this->setPersistentData('access_token', $access_token); + return $access_token; + } + + // the JS SDK puts a code in with the redirect_uri of '' + if (array_key_exists('code', $signed_request)) { + $code = $signed_request['code']; + if ($code && $code == $this->getPersistentData('code')) { + // short-circuit if the code we have is the same as the one presented + return $this->getPersistentData('access_token'); + } + + $access_token = $this->getAccessTokenFromCode($code, ''); + if ($access_token) { + $this->setPersistentData('code', $code); + $this->setPersistentData('access_token', $access_token); + return $access_token; + } + } + + // signed request states there's no access token, so anything + // stored should be cleared + $this->clearAllPersistentData(); + return false; + // respect the signed request's data, even if there's an authorization code or something else } - $this->setPersistentData('user_id', $signed_request['user_id']); - return $user; - } + $code = $this->getCode(); + if ($code && $code != $this->getPersistentData('code')) { + $access_token = $this->getAccessTokenFromCode($code); + if ($access_token) { + $this->setPersistentData('code', $code); + $this->setPersistentData('access_token', $access_token); + return $access_token; + } + + // code was bogus, so everything based on it should be invalidated + $this->clearAllPersistentData(); + return false; + } - // if the signed request didn't present a user id, then invalidate - // all entries in any persistent store - $this->clearAllPersistentData(); - return 0; + // as a fallback, just return whatever is in the persistent + // store, knowing nothing explicit (signed request, authorization + // code, etc.) was present to shadow it (or we saw a code in $_REQUEST, + // but it's the same as what's in the persistent store) + return $this->getPersistentData('access_token'); } - $user = $this->getPersistentData('user_id', $default = 0); - $persisted_access_token = $this->getPersistentData('access_token'); - - // use access_token to fetch user id if we have a user access_token, or if - // the cached access token has changed - $access_token = $this->getAccessToken(); - if ($access_token && - $access_token != $this->getApplicationAccessToken() && - !($user && $persisted_access_token == $access_token)) { - $user = $this->getUserFromAccessToken(); - if ($user) { - $this->setPersistentData('user_id', $user); - } else { - $this->clearAllPersistentData(); - } + /** + * Retrieve the signed request, either from a request parameter or, + * if not present, from a cookie. + * + * @return array the signed request, if available, or null otherwise. + */ + public function getSignedRequest() + { + if (!$this->signedRequest) { + if (!empty($_REQUEST['signed_request'])) { + $this->signedRequest = $this->parseSignedRequest( + $_REQUEST['signed_request'] + ); + } elseif (!empty($_COOKIE[$this->getSignedRequestCookieName()])) { + $this->signedRequest = $this->parseSignedRequest( + $_COOKIE[$this->getSignedRequestCookieName()] + ); + } + } + return $this->signedRequest; } - return $user; - } - - /** - * Get a Login URL for use with redirects. By default, full page redirect is - * assumed. If you are using the generated URL with a window.open() call in - * JavaScript, you can pass in display=popup as part of the $params. - * - * The parameters: - * - redirect_uri: the URL to go to after a successful login - * - scope: comma separated list of requested extended perms - * - * @param array $params Provide custom parameters - * @return string The URL for the login flow - */ - public function getLoginUrl($params=array()) { - $this->establishCSRFTokenState(); - $currentUrl = $this->getCurrentUrl(); - - // if 'scope' is passed as an array, convert to comma separated list - $scopeParams = isset($params['scope']) ? $params['scope'] : null; - if ($scopeParams && is_array($scopeParams)) { - $params['scope'] = implode(',', $scopeParams); + /** + * Get the UID of the connected user, or 0 + * if the Facebook user is not connected. + * + * @return string the UID if available. + */ + public function getUser() + { + if ($this->user !== null) { + // we've already determined this and cached the value + return $this->user; + } + + return $this->user = $this->getUserFromAvailableData(); } - return $this->getUrl( - 'www', - 'dialog/oauth', - array_merge(array( + /** + * Determines the connected user by first examining any signed + * requests, then considering an authorization code, and then + * falling back to any persistent store storing the user. + * + * @return integer The id of the connected Facebook user, + * or 0 if no such user exists. + */ + protected function getUserFromAvailableData() + { + // if a signed request is supplied, then it solely determines + // who the user is + $signed_request = $this->getSignedRequest(); + if ($signed_request) { + if (array_key_exists('user_id', $signed_request)) { + $user = $signed_request['user_id']; + + if ($user != $this->getPersistentData('user_id')) { + $this->clearAllPersistentData(); + } + + $this->setPersistentData('user_id', $signed_request['user_id']); + return $user; + } + + // if the signed request didn't present a user id, then invalidate + // all entries in any persistent store + $this->clearAllPersistentData(); + return 0; + } + + $user = $this->getPersistentData('user_id', $default = 0); + $persisted_access_token = $this->getPersistentData('access_token'); + + // use access_token to fetch user id if we have a user access_token, or if + // the cached access token has changed + $access_token = $this->getAccessToken(); + if ($access_token && + $access_token != $this->getApplicationAccessToken() && + !($user && $persisted_access_token == $access_token)) { + $user = $this->getUserFromAccessToken(); + if ($user) { + $this->setPersistentData('user_id', $user); + } else { + $this->clearAllPersistentData(); + } + } + + return $user; + } + + /** + * Get a Login URL for use with redirects. By default, full page redirect is + * assumed. If you are using the generated URL with a window.open() call in + * JavaScript, you can pass in display=popup as part of the $params. + * + * The parameters: + * - redirect_uri: the URL to go to after a successful login + * - scope: comma separated list of requested extended perms + * + * @param array $params Provide custom parameters + * @return string The URL for the login flow + */ + public function getLoginUrl($params = []) + { + $this->establishCSRFTokenState(); + $currentUrl = $this->getCurrentUrl(); + + // if 'scope' is passed as an array, convert to comma separated list + $scopeParams = isset($params['scope']) ? $params['scope'] : null; + if ($scopeParams && is_array($scopeParams)) { + $params['scope'] = implode(',', $scopeParams); + } + + return $this->getUrl( + 'www', + 'dialog/oauth', + array_merge( + [ 'client_id' => $this->getAppId(), 'redirect_uri' => $currentUrl, // possibly overwritten - 'state' => $this->state), - $params)); - } - - /** - * Get a Logout URL suitable for use with redirects. - * - * The parameters: - * - next: the URL to go to after a successful logout - * - * @param array $params Provide custom parameters - * @return string The URL for the logout flow - */ - public function getLogoutUrl($params=array()) { - return $this->getUrl( - 'www', - 'logout.php', - array_merge(array( - 'next' => $this->getCurrentUrl(), - 'access_token' => $this->getUserAccessToken(), - ), $params) - ); - } - - /** - * Get a login status URL to fetch the status from Facebook. - * - * The parameters: - * - ok_session: the URL to go to if a session is found - * - no_session: the URL to go to if the user is not connected - * - no_user: the URL to go to if the user is not signed into facebook - * - * @param array $params Provide custom parameters - * @return string The URL for the logout flow - */ - public function getLoginStatusUrl($params=array()) { - return $this->getUrl( - 'www', - 'extern/login_status.php', - array_merge(array( - 'api_key' => $this->getAppId(), - 'no_session' => $this->getCurrentUrl(), - 'no_user' => $this->getCurrentUrl(), - 'ok_session' => $this->getCurrentUrl(), - 'session_version' => 3, - ), $params) - ); - } - - /** - * Make an API call. - * - * @return mixed The decoded response - */ - public function api(/* polymorphic */) { - $args = func_get_args(); - if (is_array($args[0])) { - return $this->_restserver($args[0]); - } else { - return call_user_func_array(array($this, '_graph'), $args); - } - } - - /** - * Constructs and returns the name of the cookie that - * potentially houses the signed request for the app user. - * The cookie is not set by the BaseFacebook class, but - * it may be set by the JavaScript SDK. - * - * @return string the name of the cookie that would house - * the signed request value. - */ - protected function getSignedRequestCookieName() { - return 'fbsr_'.$this->getAppId(); - } - - /** - * Constructs and returns the name of the coookie that potentially contain - * metadata. The cookie is not set by the BaseFacebook class, but it may be - * set by the JavaScript SDK. - * - * @return string the name of the cookie that would house metadata. - */ - protected function getMetadataCookieName() { - return 'fbm_'.$this->getAppId(); - } - - /** - * Get the authorization code from the query parameters, if it exists, - * and otherwise return false to signal no authorization code was - * discoverable. - * - * @return mixed The authorization code, or false if the authorization - * code could not be determined. - */ - protected function getCode() { - if (isset($_REQUEST['code'])) { - if ($this->state !== null && - isset($_REQUEST['state']) && - $this->state === $_REQUEST['state']) { - - // CSRF state has done its job, so clear it - $this->state = null; - $this->clearPersistentData('state'); - return $_REQUEST['code']; - } else { - self::errorLog('CSRF state token does not match one provided. ' . $this->state . '!=' . $_REQUEST['state']); - return false; - } + 'state' => $this->state + ], + $params + ) + ); } - return false; - } - - /** - * Retrieves the UID with the understanding that - * $this->accessToken has already been set and is - * seemingly legitimate. It relies on Facebook's Graph API - * to retrieve user information and then extract - * the user ID. - * - * @return integer Returns the UID of the Facebook user, or 0 - * if the Facebook user could not be determined. - */ - protected function getUserFromAccessToken() { - try { - $user_info = $this->api('/me'); - return $user_info['id']; - } catch (FacebookApiException $e) { - return 0; - } - } - - /** - * Returns the access token that should be used for logged out - * users when no authorization code is available. - * - * @return string The application access token, useful for gathering - * public information about users and applications. - */ - protected function getApplicationAccessToken() { - return $this->appId.'|'.$this->appSecret; - } - - /** - * Lays down a CSRF state token for this process. - * - * @return void - */ - protected function establishCSRFTokenState() { - if ($this->state === null) { - $this->state = md5(uniqid(mt_rand(), true)); - $this->setPersistentData('state', $this->state); - } - } - - /** - * Retrieves an access token for the given authorization code - * (previously generated from www.facebook.com on behalf of - * a specific user). The authorization code is sent to graph.facebook.com - * and a legitimate access token is generated provided the access token - * and the user for which it was generated all match, and the user is - * either logged in to Facebook or has granted an offline access permission. - * - * @param string $code An authorization code. - * @return mixed An access token exchanged for the authorization code, or - * false if an access token could not be generated. - */ - protected function getAccessTokenFromCode($code, $redirect_uri = null) { - if (empty($code)) { - return false; + /** + * Get a Logout URL suitable for use with redirects. + * + * The parameters: + * - next: the URL to go to after a successful logout + * + * @param array $params Provide custom parameters + * @return string The URL for the logout flow + */ + public function getLogoutUrl($params = []) + { + return $this->getUrl( + 'www', + 'logout.php', + array_merge([ + 'next' => $this->getCurrentUrl(), + 'access_token' => $this->getUserAccessToken(), + ], $params) + ); } - if ($redirect_uri === null) { - $redirect_uri = $this->getCurrentUrl(); + /** + * Get a login status URL to fetch the status from Facebook. + * + * The parameters: + * - ok_session: the URL to go to if a session is found + * - no_session: the URL to go to if the user is not connected + * - no_user: the URL to go to if the user is not signed into facebook + * + * @param array $params Provide custom parameters + * @return string The URL for the logout flow + */ + public function getLoginStatusUrl($params = []) + { + return $this->getUrl( + 'www', + 'extern/login_status.php', + array_merge([ + 'api_key' => $this->getAppId(), + 'no_session' => $this->getCurrentUrl(), + 'no_user' => $this->getCurrentUrl(), + 'ok_session' => $this->getCurrentUrl(), + 'session_version' => 3, + ], $params) + ); } - try { - // need to circumvent json_decode by calling _oauthRequest - // directly, since response isn't JSON format - $access_token_response = - $this->_oauthRequest( - $this->getUrl('graph', '/oauth/access_token'), - $params = array('client_id' => $this->getAppId(), - 'client_secret' => $this->getAppSecret(), - 'redirect_uri' => $redirect_uri, - 'code' => $code)); - } catch (FacebookApiException $e) { - // most likely that user very recently revoked authorization. - // In any event, we don't have an access token, so say so. - return false; + /** + * Make an API call. + * + * @return mixed The decoded response + */ + public function api(/* polymorphic */) + { + $args = func_get_args(); + if (is_array($args[0])) { + return $this->_restserver($args[0]); + } else { + return call_user_func_array([$this, '_graph'], $args); + } } - if (empty($access_token_response)) { - return false; + /** + * Constructs and returns the name of the cookie that + * potentially houses the signed request for the app user. + * The cookie is not set by the BaseFacebook class, but + * it may be set by the JavaScript SDK. + * + * @return string the name of the cookie that would house + * the signed request value. + */ + protected function getSignedRequestCookieName() + { + return 'fbsr_'.$this->getAppId(); } - $response_params = json_decode($access_token_response, true); - if (!isset($response_params['access_token'])) { - return false; + /** + * Constructs and returns the name of the coookie that potentially contain + * metadata. The cookie is not set by the BaseFacebook class, but it may be + * set by the JavaScript SDK. + * + * @return string the name of the cookie that would house metadata. + */ + protected function getMetadataCookieName() + { + return 'fbm_'.$this->getAppId(); } - return $response_params['access_token']; - } - - /** - * Invoke the old restserver.php endpoint. - * - * @param array $params Method call object - * - * @return mixed The decoded response object - * @throws FacebookApiException - */ - protected function _restserver($params) { - // generic application level parameters - $params['api_key'] = $this->getAppId(); - $params['format'] = 'json-strings'; - - $result = json_decode($this->_oauthRequest( - $this->getApiUrl($params['method']), - $params - ), true); - - // results are returned, errors are thrown - if (is_array($result) && isset($result['error_code'])) { - $this->throwAPIException($result); - // @codeCoverageIgnoreStart - } - // @codeCoverageIgnoreEnd + /** + * Get the authorization code from the query parameters, if it exists, + * and otherwise return false to signal no authorization code was + * discoverable. + * + * @return mixed The authorization code, or false if the authorization + * code could not be determined. + */ + protected function getCode() + { + if (isset($_REQUEST['code'])) { + if ($this->state !== null && + isset($_REQUEST['state']) && + $this->state === $_REQUEST['state'] + ) { + // CSRF state has done its job, so clear it + $this->state = null; + $this->clearPersistentData('state'); + return $_REQUEST['code']; + } else { + self::errorLog('CSRF state token does not match one provided. '.$this->state.'!='.$_REQUEST['state']); + return false; + } + } - $method = strtolower($params['method']); - if ($method === 'auth.expiresession' || - $method === 'auth.revokeauthorization') { - $this->destroySession(); + return false; } - return $result; - } - - /** - * Return true if this is video post. - * - * @param string $path The path - * @param string $method The http method (default 'GET') - * - * @return boolean true if this is video post - */ - protected function isVideoPost($path, $method = 'GET') { - if ($method == 'POST' && preg_match("/^(\/)(.+)(\/)(videos)$/", $path)) { - return true; + /** + * Retrieves the UID with the understanding that + * $this->accessToken has already been set and is + * seemingly legitimate. It relies on Facebook's Graph API + * to retrieve user information and then extract + * the user ID. + * + * @return integer Returns the UID of the Facebook user, or 0 + * if the Facebook user could not be determined. + */ + protected function getUserFromAccessToken() + { + try { + $user_info = $this->api('/me'); + return $user_info['id']; + } catch (FacebookApiException $e) { + return 0; + } } - return false; - } - - /** - * Invoke the Graph API. - * - * @param string $path The path (required) - * @param string $method The http method (default 'GET') - * @param array $params The query/post data - * - * @return mixed The decoded response object - * @throws FacebookApiException - */ - protected function _graph($path, $method = 'GET', $params = array()) { - if (is_array($method) && empty($params)) { - $params = $method; - $method = 'GET'; + + /** + * Returns the access token that should be used for logged out + * users when no authorization code is available. + * + * @return string The application access token, useful for gathering + * public information about users and applications. + */ + protected function getApplicationAccessToken() + { + return $this->appId.'|'.$this->appSecret; } - $params['method'] = $method; // method override as we always do a POST - if ($this->isVideoPost($path, $method)) { - $domainKey = 'graph_video'; - } else { - $domainKey = 'graph'; + /** + * Lays down a CSRF state token for this process. + * + * @return void + */ + protected function establishCSRFTokenState() + { + if ($this->state === null) { + $this->state = md5(uniqid(mt_rand(), true)); + $this->setPersistentData('state', $this->state); + } } - $result = json_decode($this->_oauthRequest( - $this->getUrl($domainKey, $path), - $params - ), true); + /** + * Retrieves an access token for the given authorization code + * (previously generated from www.facebook.com on behalf of + * a specific user). The authorization code is sent to graph.facebook.com + * and a legitimate access token is generated provided the access token + * and the user for which it was generated all match, and the user is + * either logged in to Facebook or has granted an offline access permission. + * + * @param string $code An authorization code. + * @return mixed An access token exchanged for the authorization code, or + * false if an access token could not be generated. + */ + protected function getAccessTokenFromCode($code, $redirect_uri = null) + { + if (empty($code)) { + return false; + } - // results are returned, errors are thrown - if (is_array($result) && isset($result['error'])) { - $this->throwAPIException($result); - // @codeCoverageIgnoreStart - } - // @codeCoverageIgnoreEnd - - return $result; - } - - /** - * Make a OAuth Request. - * - * @param string $url The path (required) - * @param array $params The query/post data - * - * @return string The decoded response object - * @throws FacebookApiException - */ - protected function _oauthRequest($url, $params) { - if (!isset($params['access_token'])) { - $params['access_token'] = $this->getAccessToken(); - } + if ($redirect_uri === null) { + $redirect_uri = $this->getCurrentUrl(); + } + + try { + //self::errorLog('Redirect uri is ' . $redirect_uri); + // need to circumvent json_decode by calling _oauthRequest + // directly, since response isn't JSON format + $access_token_response = + $this->_oauthRequest( + $this->getUrl('graph', '/oauth/access_token'), + $params = [ + 'client_id' => $this->getAppId(), + 'client_secret' => $this->getAppSecret(), + 'redirect_uri' => $redirect_uri, + 'code' => $code + ] + ); + } catch (FacebookApiException $e) { + self::errorLog($e->getMessage()); + // most likely that user very recently revoked authorization. + // In any event, we don't have an access token, so say so. + return false; + } - // json_encode all params values that are not strings - foreach ($params as $key => $value) { - if (!is_string($value)) { - $params[$key] = json_encode($value); - } + if (empty($access_token_response)) { + self::errorLog('No access token response'); + return false; + } + + $response_params = json_decode($access_token_response, true); + if (!isset($response_params['access_token'])) { + self::errorLog('No access token in response. '.$access_token_response); + return false; + } + + return $response_params['access_token']; } - return $this->makeRequest($url, $params); - } - - /** - * Makes an HTTP request. This method can be overridden by subclasses if - * developers want to do fancier things or use something other than curl to - * make the request. - * - * @param string $url The URL to make the request to - * @param array $params The parameters to use for the POST body - * @param CurlHandler $ch Initialized curl handle - * - * @return string The response text - */ - protected function makeRequest($url, $params, $ch=null) { - if (!$ch) { - $ch = curl_init(); + /** + * Invoke the old restserver.php endpoint. + * + * @param array $params Method call object + * + * @return mixed The decoded response object + * @throws FacebookApiException + */ + protected function _restserver($params) + { + // generic application level parameters + $params['api_key'] = $this->getAppId(); + $params['format'] = 'json-strings'; + + $result = json_decode( + $this->_oauthRequest( + $this->getApiUrl($params['method']), + $params + ), + true + ); + + // results are returned, errors are thrown + if (is_array($result) && isset($result['error_code'])) { + $this->throwAPIException($result); + // @codeCoverageIgnoreStart + } + // @codeCoverageIgnoreEnd + + $method = strtolower($params['method']); + if ($method === 'auth.expiresession' || + $method === 'auth.revokeauthorization') { + $this->destroySession(); + } + + return $result; } - $opts = self::$CURL_OPTS; - if ($this->getFileUploadSupport()) { - $opts[CURLOPT_POSTFIELDS] = $params; - } else { - $opts[CURLOPT_POSTFIELDS] = http_build_query($params, null, '&'); + /** + * Return true if this is video post. + * + * @param string $path The path + * @param string $method The http method (default 'GET') + * + * @return boolean true if this is video post + */ + protected function isVideoPost($path, $method = 'GET') + { + if ($method == 'POST' && preg_match("/^(\/)(.+)(\/)(videos)$/", $path)) { + return true; + } + return false; } - $opts[CURLOPT_URL] = $url; - - // disable the 'Expect: 100-continue' behaviour. This causes CURL to wait - // for 2 seconds if the server does not support this header - if (isset($opts[CURLOPT_HTTPHEADER])) { - $existing_headers = $opts[CURLOPT_HTTPHEADER]; - $existing_headers[] = 'Expect:'; - $opts[CURLOPT_HTTPHEADER] = $existing_headers; - } else { - $opts[CURLOPT_HTTPHEADER] = array('Expect:'); + + /** + * Invoke the Graph API. + * + * @param string $path The path (required) + * @param string $method The http method (default 'GET') + * @param array $params The query/post data + * + * @return mixed The decoded response object + * @throws FacebookApiException + */ + protected function _graph($path, $method = 'GET', $params = []) + { + if (is_array($method) && empty($params)) { + $params = $method; + $method = 'GET'; + } + $params['method'] = $method; // method override as we always do a POST + + if ($this->isVideoPost($path, $method)) { + $domainKey = 'graph_video'; + } else { + $domainKey = 'graph'; + } + + $result = json_decode( + $this->_oauthRequest( + $this->getUrl($domainKey, $path), + $params + ), + true + ); + + // results are returned, errors are thrown + if (is_array($result) && isset($result['error'])) { + $this->throwAPIException($result); + // @codeCoverageIgnoreStart + } + // @codeCoverageIgnoreEnd + + return $result; } - curl_setopt_array($ch, $opts); - $result = curl_exec($ch); + /** + * Make a OAuth Request. + * + * @param string $url The path (required) + * @param array $params The query/post data + * + * @return string The decoded response object + * @throws FacebookApiException + */ + protected function _oauthRequest($url, $params) + { + if (!isset($params['access_token'])) { + $params['access_token'] = $this->getAccessToken(); + } + + // json_encode all params values that are not strings + foreach ($params as $key => $value) { + if (!is_string($value)) { + $params[$key] = json_encode($value); + } + } - if (curl_errno($ch) == 60) { // CURLE_SSL_CACERT - self::errorLog('Invalid or no certificate authority found, '. - 'using bundled information'); - curl_setopt($ch, CURLOPT_CAINFO, - dirname(__FILE__) . '/fb_ca_chain_bundle.crt'); - $result = curl_exec($ch); + return $this->makeRequest($url, $params); } - // With dual stacked DNS responses, it's possible for a server to - // have IPv6 enabled but not have IPv6 connectivity. If this is - // the case, curl will try IPv4 first and if that fails, then it will - // fall back to IPv6 and the error EHOSTUNREACH is returned by the - // operating system - if ($result === false && empty($opts[CURLOPT_IPRESOLVE])) { - $matches = array(); - $regex = '/Failed to connect to ([^:].*): Network is unreachable/'; - if (preg_match($regex, curl_error($ch), $matches)) { - if (strlen(@inet_pton($matches[1])) === 16) { - self::errorLog('Invalid IPv6 configuration on server, '. - 'Please disable or get native IPv6 on your server.'); - self::$CURL_OPTS[CURLOPT_IPRESOLVE] = CURL_IPRESOLVE_V4; - curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4); + /** + * Makes an HTTP request. This method can be overridden by subclasses if + * developers want to do fancier things or use something other than curl to + * make the request. + * + * @param string $url The URL to make the request to + * @param array $params The parameters to use for the POST body + * @param CurlHandler $ch Initialized curl handle + * + * @return string The response text + */ + protected function makeRequest($url, $params, $ch = null) + { + if (!$ch) { + $ch = curl_init(); + } + + $opts = self::$CURL_OPTS; + if ($this->getFileUploadSupport()) { + $opts[CURLOPT_POSTFIELDS] = $params; + } else { + $opts[CURLOPT_POSTFIELDS] = http_build_query($params, null, '&'); + } + $opts[CURLOPT_URL] = $url; + + // disable the 'Expect: 100-continue' behaviour. This causes CURL to wait + // for 2 seconds if the server does not support this header + if (isset($opts[CURLOPT_HTTPHEADER])) { + $existing_headers = $opts[CURLOPT_HTTPHEADER]; + $existing_headers[] = 'Expect:'; + $opts[CURLOPT_HTTPHEADER] = $existing_headers; + } else { + $opts[CURLOPT_HTTPHEADER] = ['Expect:']; + } + + curl_setopt_array($ch, $opts); + $result = curl_exec($ch); + + if (curl_errno($ch) == 60) { + // CURLE_SSL_CACERT + self::errorLog('Invalid or no certificate authority found, using bundled information'); + curl_setopt($ch, CURLOPT_CAINFO, dirname(__FILE__).'/fb_ca_chain_bundle.crt'); $result = curl_exec($ch); - } } - } - if ($result === false) { - $e = new FacebookApiException(array( - 'error_code' => curl_errno($ch), - 'error' => array( - 'message' => curl_error($ch), - 'type' => 'CurlException', - ), - )); - curl_close($ch); - throw $e; - } - curl_close($ch); - return $result; - } - - /** - * Parses a signed_request and validates the signature. - * - * @param string $signed_request A signed token - * @return array The payload inside it or null if the sig is wrong - */ - protected function parseSignedRequest($signed_request) { - list($encoded_sig, $payload) = explode('.', $signed_request, 2); - - // decode the data - $sig = self::base64UrlDecode($encoded_sig); - $data = json_decode(self::base64UrlDecode($payload), true); - - if (strtoupper($data['algorithm']) !== self::SIGNED_REQUEST_ALGORITHM) { - self::errorLog( - 'Unknown algorithm. Expected ' . self::SIGNED_REQUEST_ALGORITHM); - return null; - } + // With dual stacked DNS responses, it's possible for a server to + // have IPv6 enabled but not have IPv6 connectivity. If this is + // the case, curl will try IPv4 first and if that fails, then it will + // fall back to IPv6 and the error EHOSTUNREACH is returned by the + // operating system + if ($result === false && empty($opts[CURLOPT_IPRESOLVE])) { + $matches = []; + $regex = '/Failed to connect to ([^:].*): Network is unreachable/'; + if (preg_match($regex, curl_error($ch), $matches)) { + if (strlen(@inet_pton($matches[1])) === 16) { + self::errorLog('Invalid IPv6 configuration on server, '. + 'Please disable or get native IPv6 on your server.'); + self::$CURL_OPTS[CURLOPT_IPRESOLVE] = CURL_IPRESOLVE_V4; + curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4); + $result = curl_exec($ch); + } + } + } - // check sig - $expected_sig = hash_hmac('sha256', $payload, - $this->getAppSecret(), $raw = true); - if ($sig !== $expected_sig) { - self::errorLog('Bad Signed JSON signature!'); - return null; + if ($result === false) { + $e = new FacebookApiException([ + 'error_code' => curl_errno($ch), + 'error' => [ + 'message' => curl_error($ch), + 'type' => 'CurlException', + ], + ]); + curl_close($ch); + throw $e; + } + curl_close($ch); + return $result; } - return $data; - } - - /** - * Makes a signed_request blob using the given data. - * - * @param array The data array. - * @return string The signed request. - */ - protected function makeSignedRequest($data) { - if (!is_array($data)) { - throw new InvalidArgumentException( - 'makeSignedRequest expects an array. Got: ' . print_r($data, true)); - } - $data['algorithm'] = self::SIGNED_REQUEST_ALGORITHM; - $data['issued_at'] = time(); - $json = json_encode($data); - $b64 = self::base64UrlEncode($json); - $raw_sig = hash_hmac('sha256', $b64, $this->getAppSecret(), $raw = true); - $sig = self::base64UrlEncode($raw_sig); - return $sig.'.'.$b64; - } - - /** - * Build the URL for api given parameters. - * - * @param $method String the method name. - * @return string The URL for the given parameters - */ - protected function getApiUrl($method) { - static $READ_ONLY_CALLS = - array('admin.getallocation' => 1, - 'admin.getappproperties' => 1, - 'admin.getbannedusers' => 1, - 'admin.getlivestreamvialink' => 1, - 'admin.getmetrics' => 1, - 'admin.getrestrictioninfo' => 1, - 'application.getpublicinfo' => 1, - 'auth.getapppublickey' => 1, - 'auth.getsession' => 1, - 'auth.getsignedpublicsessiondata' => 1, - 'comments.get' => 1, - 'connect.getunconnectedfriendscount' => 1, - 'dashboard.getactivity' => 1, - 'dashboard.getcount' => 1, - 'dashboard.getglobalnews' => 1, - 'dashboard.getnews' => 1, - 'dashboard.multigetcount' => 1, - 'dashboard.multigetnews' => 1, - 'data.getcookies' => 1, - 'events.get' => 1, - 'events.getmembers' => 1, - 'fbml.getcustomtags' => 1, - 'feed.getappfriendstories' => 1, - 'feed.getregisteredtemplatebundlebyid' => 1, - 'feed.getregisteredtemplatebundles' => 1, - 'fql.multiquery' => 1, - 'fql.query' => 1, - 'friends.arefriends' => 1, - 'friends.get' => 1, - 'friends.getappusers' => 1, - 'friends.getlists' => 1, - 'friends.getmutualfriends' => 1, - 'gifts.get' => 1, - 'groups.get' => 1, - 'groups.getmembers' => 1, - 'intl.gettranslations' => 1, - 'links.get' => 1, - 'notes.get' => 1, - 'notifications.get' => 1, - 'pages.getinfo' => 1, - 'pages.isadmin' => 1, - 'pages.isappadded' => 1, - 'pages.isfan' => 1, - 'permissions.checkavailableapiaccess' => 1, - 'permissions.checkgrantedapiaccess' => 1, - 'photos.get' => 1, - 'photos.getalbums' => 1, - 'photos.gettags' => 1, - 'profile.getinfo' => 1, - 'profile.getinfooptions' => 1, - 'stream.get' => 1, - 'stream.getcomments' => 1, - 'stream.getfilters' => 1, - 'users.getinfo' => 1, - 'users.getloggedinuser' => 1, - 'users.getstandardinfo' => 1, - 'users.hasapppermission' => 1, - 'users.isappuser' => 1, - 'users.isverified' => 1, - 'video.getuploadlimits' => 1); - $name = 'api'; - if (isset($READ_ONLY_CALLS[strtolower($method)])) { - $name = 'api_read'; - } else if (strtolower($method) == 'video.upload') { - $name = 'api_video'; - } - return self::getUrl($name, 'restserver.php'); - } - - /** - * Build the URL for given domain alias, path and parameters. - * - * @param $name string The name of the domain - * @param $path string Optional path (without a leading slash) - * @param $params array Optional query parameters - * - * @return string The URL for the given parameters - */ - protected function getUrl($name, $path='', $params=array()) { - $url = self::$DOMAIN_MAP[$name]; - if ($path) { - if ($path[0] === '/') { - $path = substr($path, 1); - } - $url .= $path; - } - if ($params) { - $url .= '?' . http_build_query($params, null, '&'); - } + /** + * Parses a signed_request and validates the signature. + * + * @param string $signed_request A signed token + * @return array The payload inside it or null if the sig is wrong + */ + protected function parseSignedRequest($signed_request) + { + list($encoded_sig, $payload) = explode('.', $signed_request, 2); + + // decode the data + $sig = self::base64UrlDecode($encoded_sig); + $data = json_decode(self::base64UrlDecode($payload), true); + + if (strtoupper($data['algorithm']) !== self::SIGNED_REQUEST_ALGORITHM) { + self::errorLog('Unknown algorithm. Expected '.self::SIGNED_REQUEST_ALGORITHM); + return null; + } - return $url; - } + // check sig + $expected_sig = hash_hmac('sha256', $payload, $this->getAppSecret(), $raw = true); + if ($sig !== $expected_sig) { + self::errorLog('Bad Signed JSON signature!'); + return null; + } - protected function getHttpHost() { - if ($this->trustForwarded && isset($_SERVER['HTTP_X_FORWARDED_HOST'])) { - return $_SERVER['HTTP_X_FORWARDED_HOST']; - } - return $_SERVER['HTTP_HOST']; - } - - protected function getHttpProtocol() { - if ($this->trustForwarded && isset($_SERVER['HTTP_X_FORWARDED_PROTO'])) { - if ($_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https') { - return 'https'; - } - return 'http'; - } - /*apache + variants specific way of checking for https*/ - if (isset($_SERVER['HTTPS']) && - ($_SERVER['HTTPS'] === 'on' || $_SERVER['HTTPS'] == 1)) { - return 'https'; + return $data; } - /*nginx way of checking for https*/ - if (isset($_SERVER['SERVER_PORT']) && - ($_SERVER['SERVER_PORT'] === '443')) { - return 'https'; + + /** + * Makes a signed_request blob using the given data. + * + * @param $data array The data array. + * @return string The signed request. + */ + protected function makeSignedRequest($data) + { + if (!is_array($data)) { + throw new InvalidArgumentException( + 'makeSignedRequest expects an array. Got: '.print_r($data, true) + ); + } + $data['algorithm'] = self::SIGNED_REQUEST_ALGORITHM; + $data['issued_at'] = time(); + $json = json_encode($data); + $b64 = self::base64UrlEncode($json); + $raw_sig = hash_hmac('sha256', $b64, $this->getAppSecret(), $raw = true); + $sig = self::base64UrlEncode($raw_sig); + return $sig.'.'.$b64; } - return 'http'; - } - - /** - * Get the base domain used for the cookie. - */ - protected function getBaseDomain() { - // The base domain is stored in the metadata cookie if not we fallback - // to the current hostname - $metadata = $this->getMetadataCookie(); - if (array_key_exists('base_domain', $metadata) && - !empty($metadata['base_domain'])) { - return trim($metadata['base_domain'], '.'); + + /** + * Build the URL for api given parameters. + * + * @param $method String the method name. + * @return string The URL for the given parameters + */ + protected function getApiUrl($method) + { + static $READ_ONLY_CALLS = + [ + 'admin.getallocation' => 1, + 'admin.getappproperties' => 1, + 'admin.getbannedusers' => 1, + 'admin.getlivestreamvialink' => 1, + 'admin.getmetrics' => 1, + 'admin.getrestrictioninfo' => 1, + 'application.getpublicinfo' => 1, + 'auth.getapppublickey' => 1, + 'auth.getsession' => 1, + 'auth.getsignedpublicsessiondata' => 1, + 'comments.get' => 1, + 'connect.getunconnectedfriendscount' => 1, + 'dashboard.getactivity' => 1, + 'dashboard.getcount' => 1, + 'dashboard.getglobalnews' => 1, + 'dashboard.getnews' => 1, + 'dashboard.multigetcount' => 1, + 'dashboard.multigetnews' => 1, + 'data.getcookies' => 1, + 'events.get' => 1, + 'events.getmembers' => 1, + 'fbml.getcustomtags' => 1, + 'feed.getappfriendstories' => 1, + 'feed.getregisteredtemplatebundlebyid' => 1, + 'feed.getregisteredtemplatebundles' => 1, + 'fql.multiquery' => 1, + 'fql.query' => 1, + 'friends.arefriends' => 1, + 'friends.get' => 1, + 'friends.getappusers' => 1, + 'friends.getlists' => 1, + 'friends.getmutualfriends' => 1, + 'gifts.get' => 1, + 'groups.get' => 1, + 'groups.getmembers' => 1, + 'intl.gettranslations' => 1, + 'links.get' => 1, + 'notes.get' => 1, + 'notifications.get' => 1, + 'pages.getinfo' => 1, + 'pages.isadmin' => 1, + 'pages.isappadded' => 1, + 'pages.isfan' => 1, + 'permissions.checkavailableapiaccess' => 1, + 'permissions.checkgrantedapiaccess' => 1, + 'photos.get' => 1, + 'photos.getalbums' => 1, + 'photos.gettags' => 1, + 'profile.getinfo' => 1, + 'profile.getinfooptions' => 1, + 'stream.get' => 1, + 'stream.getcomments' => 1, + 'stream.getfilters' => 1, + 'users.getinfo' => 1, + 'users.getloggedinuser' => 1, + 'users.getstandardinfo' => 1, + 'users.hasapppermission' => 1, + 'users.isappuser' => 1, + 'users.isverified' => 1, + 'video.getuploadlimits' => 1 + ]; + $name = 'api'; + if (isset($READ_ONLY_CALLS[strtolower($method)])) { + $name = 'api_read'; + } elseif (strtolower($method) == 'video.upload') { + $name = 'api_video'; + } + return $this->getUrl($name, 'restserver.php'); } - return $this->getHttpHost(); - } - - /** - * Returns the Current URL, stripping it of known FB parameters that should - * not persist. - * - * @return string The current URL - */ - protected function getCurrentUrl() { - $protocol = $this->getHttpProtocol() . '://'; - $host = $this->getHttpHost(); - $currentUrl = $protocol.$host.$_SERVER['REQUEST_URI']; - $parts = parse_url($currentUrl); - - $query = ''; - if (!empty($parts['query'])) { - // drop known fb params - $params = explode('&', $parts['query']); - $retained_params = array(); - foreach ($params as $param) { - if ($this->shouldRetainParam($param)) { - $retained_params[] = $param; + + /** + * Build the URL for given domain alias, path and parameters. + * + * @param $name string The name of the domain + * @param $path string Optional path (without a leading slash) + * @param $params array Optional query parameters + * + * @return string The URL for the given parameters + */ + protected function getUrl($name, $path = '', $params = []) + { + $url = self::$DOMAIN_MAP[$name]; + if ($path) { + if ($path[0] === '/') { + $path = substr($path, 1); + } + $url .= $path; + } + if ($params) { + $url .= '?'.http_build_query($params, null, '&'); } - } - if (!empty($retained_params)) { - $query = '?'.implode($retained_params, '&'); - } + return $url; } - // use port if non default - $port = - isset($parts['port']) && - (($protocol === 'http://' && $parts['port'] !== 80) || - ($protocol === 'https://' && $parts['port'] !== 443)) - ? ':' . $parts['port'] : ''; - - // rebuild - return $protocol . $parts['host'] . $port . $parts['path'] . $query; - } - - /** - * Returns true if and only if the key or key/value pair should - * be retained as part of the query string. This amounts to - * a brute-force search of the very small list of Facebook-specific - * params that should be stripped out. - * - * @param string $param A key or key/value pair within a URL's query (e.g. - * 'foo=a', 'foo=', or 'foo'. - * - * @return boolean - */ - protected function shouldRetainParam($param) { - foreach (self::$DROP_QUERY_PARAMS as $drop_query_param) { - if (strpos($param, $drop_query_param.'=') === 0) { - return false; - } + protected function getHttpHost() + { + if ($this->trustForwarded && isset($_SERVER['HTTP_X_FORWARDED_HOST'])) { + return $_SERVER['HTTP_X_FORWARDED_HOST']; + } + return $_SERVER['HTTP_HOST']; + } + + protected function getHttpProtocol() + { + if ($this->trustForwarded && isset($_SERVER['HTTP_X_FORWARDED_PROTO'])) { + if ($_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https') { + return 'https'; + } + return 'http'; + } + /*apache + variants specific way of checking for https*/ + if (isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS'] === 'on' || $_SERVER['HTTPS'] == 1)) { + return 'https'; + } + /*nginx way of checking for https*/ + if (isset($_SERVER['SERVER_PORT']) && ($_SERVER['SERVER_PORT'] === '443')) { + return 'https'; + } + return 'http'; } - return true; - } - - /** - * Analyzes the supplied result to see if it was thrown - * because the access token is no longer valid. If that is - * the case, then we destroy the session. - * - * @param $result array A record storing the error message returned - * by a failed API call. - */ - protected function throwAPIException($result) { - $e = new FacebookApiException($result); - switch ($e->getType()) { - // OAuth 2.0 Draft 00 style - case 'OAuthException': - // OAuth 2.0 Draft 10 style - case 'invalid_token': - // REST server errors are just Exceptions - case 'Exception': - $message = $e->getMessage(); - if ((strpos($message, 'Error validating access token') !== false) || - (strpos($message, 'Invalid OAuth access token') !== false) || - (strpos($message, 'An active access token must be used') !== false) - ) { - $this->destroySession(); + /** + * Get the base domain used for the cookie. + */ + protected function getBaseDomain() + { + // The base domain is stored in the metadata cookie if not we fallback + // to the current hostname + $metadata = $this->getMetadataCookie(); + if (array_key_exists('base_domain', $metadata) && !empty($metadata['base_domain'])) { + return trim($metadata['base_domain'], '.'); } - break; + return $this->getHttpHost(); } - throw $e; - } + /** + * Returns the Current URL, stripping it of known FB parameters that should + * not persist. + * + * @return string The current URL + */ + protected function getCurrentUrl() + { + $protocol = $this->getHttpProtocol().'://'; + $host = $this->getHttpHost(); + $currentUrl = $protocol.$host.$_SERVER['REQUEST_URI']; + $parts = parse_url($currentUrl); + + // use port if non default + $port = + isset($parts['port']) && + (($protocol === 'http://' && $parts['port'] !== 80) || + ($protocol === 'https://' && $parts['port'] !== 443)) + ? ':'.$parts['port'] : ''; + + // rebuild + return $protocol.$parts['host'].$port.$parts['path']; + } + /** + * Analyzes the supplied result to see if it was thrown + * because the access token is no longer valid. If that is + * the case, then we destroy the session. + * + * @param $result array A record storing the error message returned + * by a failed API call. + */ + protected function throwAPIException($result) + { + $e = new FacebookApiException($result); + switch ($e->getType()) { + // OAuth 2.0 Draft 00 style + case 'OAuthException': + // OAuth 2.0 Draft 10 style + case 'invalid_token': + // REST server errors are just Exceptions + case 'Exception': + $message = $e->getMessage(); + if ((strpos($message, 'Error validating access token') !== false) || + (strpos($message, 'Invalid OAuth access token') !== false) || + (strpos($message, 'An active access token must be used') !== false) + ) { + $this->destroySession(); + } + break; + } - /** - * Prints to the error log if you aren't in command line mode. - * - * @param string $msg Log message - */ - protected static function errorLog($msg) { - // disable error log if we are running in a CLI environment - // @codeCoverageIgnoreStart - if (php_sapi_name() != 'cli') { - error_log($msg); + throw $e; } - // @codeCoverageIgnoreEnd - } - - /** - * Base64 encoding that doesn't need to be urlencode()ed. - * Exactly the same as base64_encode except it uses - * - instead of + - * _ instead of / - * No padded = - * - * @param string $input base64UrlEncoded string - * @return string - */ - protected static function base64UrlDecode($input) { - return base64_decode(strtr($input, '-_', '+/')); - } - - /** - * Base64 encoding that doesn't need to be urlencode()ed. - * Exactly the same as base64_encode except it uses - * - instead of + - * _ instead of / - * - * @param string $input string - * @return string base64Url encoded string - */ - protected static function base64UrlEncode($input) { - $str = strtr(base64_encode($input), '+/', '-_'); - $str = str_replace('=', '', $str); - return $str; - } - - /** - * Destroy the current session - */ - public function destroySession() { - $this->accessToken = null; - $this->signedRequest = null; - $this->user = null; - $this->clearAllPersistentData(); - - // Javascript sets a cookie that will be used in getSignedRequest that we - // need to clear if we can - $cookie_name = $this->getSignedRequestCookieName(); - if (array_key_exists($cookie_name, $_COOKIE)) { - unset($_COOKIE[$cookie_name]); - if (!headers_sent()) { - $base_domain = $this->getBaseDomain(); - setcookie($cookie_name, '', 1, '/', '.'.$base_domain); - } else { + + + /** + * Prints to the error log if you aren't in command line mode. + * + * @param string $msg Log message + */ + protected static function errorLog($msg) + { + // disable error log if we are running in a CLI environment // @codeCoverageIgnoreStart - self::errorLog( - 'There exists a cookie that we wanted to clear that we couldn\'t '. - 'clear because headers was already sent. Make sure to do the first '. - 'API call before outputing anything.' - ); + if (php_sapi_name() != 'cli') { + error_log($msg); + } // @codeCoverageIgnoreEnd - } - } - } - - /** - * Parses the metadata cookie that our Javascript API set - * - * @return an array mapping key to value - */ - protected function getMetadataCookie() { - $cookie_name = $this->getMetadataCookieName(); - if (!array_key_exists($cookie_name, $_COOKIE)) { - return array(); } - // The cookie value can be wrapped in "-characters so remove them - $cookie_value = trim($_COOKIE[$cookie_name], '"'); + /** + * Base64 encoding that doesn't need to be urlencode()ed. + * Exactly the same as base64_encode except it uses + * - instead of + + * _ instead of / + * No padded = + * + * @param string $input base64UrlEncoded string + * @return string + */ + protected static function base64UrlDecode($input) + { + return base64_decode(strtr($input, '-_', '+/')); + } - if (empty($cookie_value)) { - return array(); + /** + * Base64 encoding that doesn't need to be urlencode()ed. + * Exactly the same as base64_encode except it uses + * - instead of + + * _ instead of / + * + * @param string $input string + * @return string base64Url encoded string + */ + protected static function base64UrlEncode($input) + { + $str = strtr(base64_encode($input), '+/', '-_'); + $str = str_replace('=', '', $str); + return $str; } - $parts = explode('&', $cookie_value); - $metadata = array(); - foreach ($parts as $part) { - $pair = explode('=', $part, 2); - if (!empty($pair[0])) { - $metadata[urldecode($pair[0])] = - (count($pair) > 1) ? urldecode($pair[1]) : ''; - } + /** + * Destroy the current session + */ + public function destroySession() + { + $this->accessToken = null; + $this->signedRequest = null; + $this->user = null; + $this->clearAllPersistentData(); + + // Javascript sets a cookie that will be used in getSignedRequest that we + // need to clear if we can + $cookie_name = $this->getSignedRequestCookieName(); + if (array_key_exists($cookie_name, $_COOKIE)) { + unset($_COOKIE[$cookie_name]); + if (!headers_sent()) { + $base_domain = $this->getBaseDomain(); + setcookie($cookie_name, '', 1, '/', '.'.$base_domain); + } else { + // @codeCoverageIgnoreStart + self::errorLog( + 'There exists a cookie that we wanted to clear that we couldn\'t '. + 'clear because headers was already sent. Make sure to do the first '. + 'API call before outputing anything.' + ); + // @codeCoverageIgnoreEnd + } + } } - return $metadata; - } + /** + * Parses the metadata cookie that our Javascript API set + * + * @return array an array mapping key to value + */ + protected function getMetadataCookie() + { + $cookie_name = $this->getMetadataCookieName(); + if (!array_key_exists($cookie_name, $_COOKIE)) { + return []; + } + + // The cookie value can be wrapped in "-characters so remove them + $cookie_value = trim($_COOKIE[$cookie_name], '"'); - protected static function isAllowedDomain($big, $small) { - if ($big === $small) { - return true; + if (empty($cookie_value)) { + return []; + } + + $parts = explode('&', $cookie_value); + $metadata = []; + foreach ($parts as $part) { + $pair = explode('=', $part, 2); + if (!empty($pair[0])) { + $metadata[urldecode($pair[0])] = (count($pair) > 1) ? urldecode($pair[1]) : ''; + } + } + + return $metadata; + } + + protected static function isAllowedDomain($big, $small) + { + if ($big === $small) { + return true; + } + return self::endsWith($big, '.'.$small); } - return self::endsWith($big, '.'.$small); - } - protected static function endsWith($big, $small) { - $len = strlen($small); - if ($len === 0) { - return true; + protected static function endsWith($big, $small) + { + $len = strlen($small); + if ($len === 0) { + return true; + } + return substr($big, -$len) === $small; } - return substr($big, -$len) === $small; - } - - /** - * Each of the following four methods should be overridden in - * a concrete subclass, as they are in the provided Facebook class. - * The Facebook class uses PHP sessions to provide a primitive - * persistent store, but another subclass--one that you implement-- - * might use a database, memcache, or an in-memory cache. - * - * @see Facebook - */ - - /** - * Stores the given ($key, $value) pair, so that future calls to - * getPersistentData($key) return $value. This call may be in another request. - * - * @param string $key - * @param array $value - * - * @return void - */ - abstract protected function setPersistentData($key, $value); - - /** - * Get the data for $key, persisted by BaseFacebook::setPersistentData() - * - * @param string $key The key of the data to retrieve - * @param boolean $default The default value to return if $key is not found - * - * @return mixed - */ - abstract protected function getPersistentData($key, $default = false); - - /** - * Clear the data with $key from the persistent storage - * - * @param string $key - * @return void - */ - abstract protected function clearPersistentData($key); - - /** - * Clear all data from the persistent storage - * - * @return void - */ - abstract protected function clearAllPersistentData(); + + /** + * Each of the following four methods should be overridden in + * a concrete subclass, as they are in the provided Facebook class. + * The Facebook class uses PHP sessions to provide a primitive + * persistent store, but another subclass--one that you implement-- + * might use a database, memcache, or an in-memory cache. + * + * @see Facebook + */ + + /** + * Stores the given ($key, $value) pair, so that future calls to + * getPersistentData($key) return $value. This call may be in another request. + * + * @param string $key + * @param array $value + * + * @return void + */ + abstract protected function setPersistentData($key, $value); + + /** + * Get the data for $key, persisted by BaseFacebook::setPersistentData() + * + * @param string $key The key of the data to retrieve + * @param boolean $default The default value to return if $key is not found + * + * @return mixed + */ + abstract protected function getPersistentData($key, $default = false); + + /** + * Clear the data with $key from the persistent storage + * + * @param string $key + * @return void + */ + abstract protected function clearPersistentData($key); + + /** + * Clear all data from the persistent storage + * + * @return void + */ + abstract protected function clearAllPersistentData(); } diff --git a/vendor/simplesamlphp/simplesamlphp/modules/authfacebook/lib/Auth/Source/Facebook.php b/vendor/simplesamlphp/simplesamlphp/modules/authfacebook/lib/Auth/Source/Facebook.php index ed9890d0aa..a2bee6a7a3 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/authfacebook/lib/Auth/Source/Facebook.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/authfacebook/lib/Auth/Source/Facebook.php @@ -1,143 +1,158 @@ <?php +namespace SimpleSAML\Module\authfacebook\Auth\Source; + +use SimpleSAML\Module; + /** * Authenticate using Facebook Platform. * * @author Andreas Åkre Solberg, UNINETT AS. * @package SimpleSAMLphp */ -class sspmod_authfacebook_Auth_Source_Facebook extends SimpleSAML_Auth_Source { - - - /** - * The string used to identify our states. - */ - const STAGE_INIT = 'facebook:init'; - - - /** - * The key of the AuthId field in the state. - */ - const AUTHID = 'facebook:AuthId'; - - - /** - * Facebook App ID or API Key - */ - private $api_key; - - - /** - * Facebook App Secret - */ - private $secret; - - - /** - * Which additional data permissions to request from user - */ - private $req_perms; - - - /** - * A comma-separated list of user profile fields to request. - * - * Note that some user fields require appropriate permissions. For - * example, to retrieve the user's primary email address, "email" must - * be specified in both the req_perms and the user_fields parameter. - * - * When empty, only the app-specific user id and name will be returned. - * - * See the Graph API specification for all available user fields: - * https://developers.facebook.com/docs/graph-api/reference/v2.6/user - */ - private $user_fields; - - - /** - * Constructor for this authentication source. - * - * @param array $info Information about this authentication source. - * @param array $config Configuration. - */ - public function __construct($info, $config) { - assert('is_array($info)'); - assert('is_array($config)'); - - // Call the parent constructor first, as required by the interface - parent::__construct($info, $config); - - $cfgParse = SimpleSAML_Configuration::loadFromArray($config, 'authsources[' . var_export($this->authId, TRUE) . ']'); - - $this->api_key = $cfgParse->getString('api_key'); - $this->secret = $cfgParse->getString('secret'); - $this->req_perms = $cfgParse->getString('req_perms', NULL); - $this->user_fields = $cfgParse->getString('user_fields', NULL); - } - - - /** - * Log-in using Facebook platform - * - * @param array &$state Information about the current authentication. - */ - public function authenticate(&$state) { - assert('is_array($state)'); - - // We are going to need the authId in order to retrieve this authentication source later - $state[self::AUTHID] = $this->authId; - SimpleSAML_Auth_State::saveState($state, self::STAGE_INIT); - - $facebook = new sspmod_authfacebook_Facebook(array('appId' => $this->api_key, 'secret' => $this->secret), $state); - $facebook->destroySession(); - - $linkback = SimpleSAML\Module::getModuleURL('authfacebook/linkback.php'); - $url = $facebook->getLoginUrl(array('redirect_uri' => $linkback, 'scope' => $this->req_perms)); - SimpleSAML_Auth_State::saveState($state, self::STAGE_INIT); - - \SimpleSAML\Utils\HTTP::redirectTrustedURL($url); - } - - - public function finalStep(&$state) { - assert('is_array($state)'); - - $facebook = new sspmod_authfacebook_Facebook(array('appId' => $this->api_key, 'secret' => $this->secret), $state); - $uid = $facebook->getUser(); - - if (isset($uid) && $uid) { - try { - $info = $facebook->api("/" . $uid . ($this->user_fields ? "?fields=" . $this->user_fields : "")); - } catch (FacebookApiException $e) { - throw new SimpleSAML_Error_AuthSource($this->authId, 'Error getting user profile.', $e); - } - } - - if (!isset($info)) { - throw new SimpleSAML_Error_AuthSource($this->authId, 'Error getting user profile.'); - } - - $attributes = array(); - foreach($info AS $key => $value) { - if (is_string($value) && !empty($value)) { - $attributes['facebook.' . $key] = array((string)$value); - } - } - - if (array_key_exists('third_party_id', $info)) { - $attributes['facebook_user'] = array($info['third_party_id'] . '@facebook.com'); - } else { - $attributes['facebook_user'] = array($uid . '@facebook.com'); - } - - $attributes['facebook_targetedID'] = array('http://facebook.com!' . $uid); - $attributes['facebook_cn'] = array($info['name']); - - SimpleSAML\Logger::debug('Facebook Returned Attributes: '. implode(", ", array_keys($attributes))); - - $state['Attributes'] = $attributes; - - $facebook->destroySession(); - } +class Facebook extends \SimpleSAML\Auth\Source +{ + /** + * The string used to identify our states. + */ + const STAGE_INIT = 'facebook:init'; + + + /** + * The key of the AuthId field in the state. + */ + const AUTHID = 'facebook:AuthId'; + + + /** + * Facebook App ID or API Key + */ + private $api_key; + + + /** + * Facebook App Secret + */ + private $secret; + + + /** + * Which additional data permissions to request from user + */ + private $req_perms; + + + /** + * A comma-separated list of user profile fields to request. + * + * Note that some user fields require appropriate permissions. For + * example, to retrieve the user's primary email address, "email" must + * be specified in both the req_perms and the user_fields parameter. + * + * When empty, only the app-specific user id and name will be returned. + * + * See the Graph API specification for all available user fields: + * https://developers.facebook.com/docs/graph-api/reference/v2.6/user + */ + private $user_fields; + + + /** + * Constructor for this authentication source. + * + * @param array $info Information about this authentication source. + * @param array $config Configuration. + */ + public function __construct($info, $config) + { + assert(is_array($info)); + assert(is_array($config)); + + // Call the parent constructor first, as required by the interface + parent::__construct($info, $config); + + $cfgParse = \SimpleSAML\Configuration::loadFromArray( + $config, + 'authsources['.var_export($this->authId, true).']' + ); + + $this->api_key = $cfgParse->getString('api_key'); + $this->secret = $cfgParse->getString('secret'); + $this->req_perms = $cfgParse->getString('req_perms', null); + $this->user_fields = $cfgParse->getString('user_fields', null); + } + + + /** + * Log-in using Facebook platform + * + * @param array &$state Information about the current authentication. + */ + public function authenticate(&$state) + { + assert(is_array($state)); + + // We are going to need the authId in order to retrieve this authentication source later + $state[self::AUTHID] = $this->authId; + \SimpleSAML\Auth\State::saveState($state, self::STAGE_INIT); + + $facebook = new Module\authfacebook\Facebook( + ['appId' => $this->api_key, 'secret' => $this->secret], + $state + ); + $facebook->destroySession(); + + $linkback = Module::getModuleURL('authfacebook/linkback.php'); + $url = $facebook->getLoginUrl(['redirect_uri' => $linkback, 'scope' => $this->req_perms]); + \SimpleSAML\Auth\State::saveState($state, self::STAGE_INIT); + + \SimpleSAML\Utils\HTTP::redirectTrustedURL($url); + } + + + public function finalStep(&$state) + { + assert(is_array($state)); + + $facebook = new Module\authfacebook\Facebook( + ['appId' => $this->api_key, 'secret' => $this->secret], + $state + ); + $uid = $facebook->getUser(); + + if (isset($uid) && $uid) { + try { + $info = $facebook->api("/".$uid.($this->user_fields ? "?fields=".$this->user_fields : "")); + } catch (\FacebookApiException $e) { + throw new \SimpleSAML\Error\AuthSource($this->authId, 'Error getting user profile.', $e); + } + } + + if (!isset($info)) { + throw new \SimpleSAML\Error\AuthSource($this->authId, 'Error getting user profile.'); + } + + $attributes = []; + foreach ($info as $key => $value) { + if (is_string($value) && !empty($value)) { + $attributes['facebook.'.$key] = [(string) $value]; + } + } + + if (array_key_exists('third_party_id', $info)) { + $attributes['facebook_user'] = [$info['third_party_id'].'@facebook.com']; + } else { + $attributes['facebook_user'] = [$uid.'@facebook.com']; + } + + $attributes['facebook_targetedID'] = ['http://facebook.com!'.$uid]; + $attributes['facebook_cn'] = [$info['name']]; + + \SimpleSAML\Logger::debug('Facebook Returned Attributes: '.implode(", ", array_keys($attributes))); + + $state['Attributes'] = $attributes; + + $facebook->destroySession(); + } } diff --git a/vendor/simplesamlphp/simplesamlphp/modules/authfacebook/lib/Facebook.php b/vendor/simplesamlphp/simplesamlphp/modules/authfacebook/lib/Facebook.php index 049d1600c4..cf68d348a5 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/authfacebook/lib/Facebook.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/authfacebook/lib/Facebook.php @@ -1,156 +1,170 @@ <?php -require_once(dirname(dirname(__FILE__)) . '/extlibinc/base_facebook.php'); +namespace SimpleSAML\Module\authfacebook; + +require_once(dirname(dirname(__FILE__)).'/extlibinc/base_facebook.php'); /** * Extends the BaseFacebook class with the intent of using * PHP sessions to store user ids and access tokens. */ -class sspmod_authfacebook_Facebook extends BaseFacebook + +class Facebook extends \BaseFacebook { - const FBSS_COOKIE_NAME = 'fbss'; - - // We can set this to a high number because the main session - // expiration will trump this - const FBSS_COOKIE_EXPIRE = 31556926; // 1 year - - // Stores the shared session ID if one is set - protected $sharedSessionID; - - // SimpleSAMLphp state array - protected $ssp_state; - - /** - * Identical to the parent constructor, except that - * we start a PHP session to store the user ID and - * access token if during the course of execution - * we discover them. - * - * @param Array $config the application configuration. Additionally - * accepts "sharedSession" as a boolean to turn on a secondary - * cookie for environments with a shared session (that is, your app - * shares the domain with other apps). - * @see BaseFacebook::__construct in base_facebook.php - */ - public function __construct(array $config, &$ssp_state) { - $this->ssp_state = &$ssp_state; - - parent::__construct($config); - if (!empty($config['sharedSession'])) { - $this->initSharedSession(); + const FBSS_COOKIE_NAME = 'fbss'; + + // We can set this to a high number because the main session + // expiration will trump this + const FBSS_COOKIE_EXPIRE = 31556926; // 1 year + + // Stores the shared session ID if one is set + protected $sharedSessionID; + + // SimpleSAMLphp state array + protected $ssp_state; + + // \SimpleSAML\Auth\State + protected $state; + + /** + * Identical to the parent constructor, except that + * we start a PHP session to store the user ID and + * access token if during the course of execution + * we discover them. + * + * @param Array $config the application configuration. Additionally + * accepts "sharedSession" as a boolean to turn on a secondary + * cookie for environments with a shared session (that is, your app + * shares the domain with other apps). + * @see BaseFacebook::__construct in base_facebook.php + */ + public function __construct(array $config, &$ssp_state) + { + $this->ssp_state = &$ssp_state; + + parent::__construct($config); + if (!empty($config['sharedSession'])) { + $this->initSharedSession(); + } } - } - - protected static $kSupportedKeys = - array('state', 'code', 'access_token', 'user_id'); - - protected function initSharedSession() { - $cookie_name = $this->getSharedSessionCookieName(); - if (isset($_COOKIE[$cookie_name])) { - $data = $this->parseSignedRequest($_COOKIE[$cookie_name]); - if ($data && !empty($data['domain']) && - self::isAllowedDomain($this->getHttpHost(), $data['domain'])) { - // good case - $this->sharedSessionID = $data['id']; - return; - } - // ignoring potentially unreachable data - } - // evil/corrupt/missing case - $base_domain = $this->getBaseDomain(); - $this->sharedSessionID = md5(uniqid(mt_rand(), true)); - $cookie_value = $this->makeSignedRequest( - array( - 'domain' => $base_domain, - 'id' => $this->sharedSessionID, - ) - ); - $_COOKIE[$cookie_name] = $cookie_value; - if (!headers_sent()) { - $expire = time() + self::FBSS_COOKIE_EXPIRE; - setcookie($cookie_name, $cookie_value, $expire, '/', '.'.$base_domain); - } else { - // @codeCoverageIgnoreStart - SimpleSAML\Logger::debug( - 'Shared session ID cookie could not be set! You must ensure you '. - 'create the Facebook instance before headers have been sent. This '. - 'will cause authentication issues after the first request.' - ); - // @codeCoverageIgnoreEnd + + protected static $kSupportedKeys = ['state', 'code', 'access_token', 'user_id']; + + protected function initSharedSession() + { + $cookie_name = $this->getSharedSessionCookieName(); + if (isset($_COOKIE[$cookie_name])) { + $data = $this->parseSignedRequest($_COOKIE[$cookie_name]); + if (!empty($data) && !empty($data['domain']) && + self::isAllowedDomain($this->getHttpHost(), $data['domain'])) { + // good case + $this->sharedSessionID = $data['id']; + return; + } + // ignoring potentially unreachable data + } + // evil/corrupt/missing case + $base_domain = $this->getBaseDomain(); + $this->sharedSessionID = md5(uniqid(mt_rand(), true)); + $cookie_value = $this->makeSignedRequest( + [ + 'domain' => $base_domain, + 'id' => $this->sharedSessionID, + ] + ); + $_COOKIE[$cookie_name] = $cookie_value; + if (!headers_sent()) { + $expire = time() + self::FBSS_COOKIE_EXPIRE; + setcookie($cookie_name, $cookie_value, $expire, '/', '.'.$base_domain); + } else { + // @codeCoverageIgnoreStart + \SimpleSAML\Logger::debug( + 'Shared session ID cookie could not be set! You must ensure you '. + 'create the Facebook instance before headers have been sent. This '. + 'will cause authentication issues after the first request.' + ); + // @codeCoverageIgnoreEnd + } } - } - - /** - * Provides the implementations of the inherited abstract - * methods. The implementation uses PHP sessions to maintain - * a store for authorization codes, user ids, CSRF states, and - * access tokens. - */ - protected function setPersistentData($key, $value) { - if (!in_array($key, self::$kSupportedKeys)) { - SimpleSAML\Logger::debug("Unsupported key passed to setPersistentData: " . var_export($key, TRUE)); - return; + + /** + * Provides the implementations of the inherited abstract + * methods. The implementation uses PHP sessions to maintain + * a store for authorization codes, user ids, CSRF states, and + * access tokens. + */ + protected function setPersistentData($key, $value) + { + if (!in_array($key, self::$kSupportedKeys)) { + \SimpleSAML\Logger::debug("Unsupported key passed to setPersistentData: ".var_export($key, true)); + return; + } + + $session_var_name = $this->constructSessionVariableName($key); + $this->ssp_state[$session_var_name] = $value; } - $session_var_name = $this->constructSessionVariableName($key); - $this->ssp_state[$session_var_name] = $value; - } + protected function getPersistentData($key, $default = false) + { + if (!in_array($key, self::$kSupportedKeys)) { + \SimpleSAML\Logger::debug("Unsupported key passed to getPersistentData: ".var_export($key, true)); + return $default; + } - protected function getPersistentData($key, $default = false) { - if (!in_array($key, self::$kSupportedKeys)) { - SimpleSAML\Logger::debug("Unsupported key passed to getPersistentData: " . var_export($key, TRUE)); - return $default; + $session_var_name = $this->constructSessionVariableName($key); + return isset($this->ssp_state[$session_var_name]) ? $this->ssp_state[$session_var_name] : $default; } - $session_var_name = $this->constructSessionVariableName($key); - return isset($this->ssp_state[$session_var_name]) ? - $this->ssp_state[$session_var_name] : $default; - } + protected function clearPersistentData($key) + { + if (!in_array($key, self::$kSupportedKeys)) { + \SimpleSAML\Logger::debug("Unsupported key passed to clearPersistentData: ".var_export($key, true)); + return; + } + + $session_var_name = $this->constructSessionVariableName($key); + if (isset($this->ssp_state[$session_var_name])) { + unset($this->ssp_state[$session_var_name]); + } + } - protected function clearPersistentData($key) { - if (!in_array($key, self::$kSupportedKeys)) { - SimpleSAML\Logger::debug("Unsupported key passed to clearPersistentData: " . var_export($key, TRUE)); - return; + protected function clearAllPersistentData() + { + foreach (self::$kSupportedKeys as $key) { + $this->clearPersistentData($key); + } + if ($this->sharedSessionID) { + $this->deleteSharedSessionCookie(); + } } - $session_var_name = $this->constructSessionVariableName($key); - if (isset($this->ssp_state[$session_var_name])) { - unset($this->ssp_state[$session_var_name]); + protected function deleteSharedSessionCookie() + { + $cookie_name = $this->getSharedSessionCookieName(); + unset($_COOKIE[$cookie_name]); + $base_domain = $this->getBaseDomain(); + setcookie($cookie_name, '', 1, '/', '.'.$base_domain); } - } - protected function clearAllPersistentData() { - foreach (self::$kSupportedKeys as $key) { - $this->clearPersistentData($key); + protected function getSharedSessionCookieName() + { + return self::FBSS_COOKIE_NAME.'_'.$this->getAppId(); } - if ($this->sharedSessionID) { - $this->deleteSharedSessionCookie(); + + protected function constructSessionVariableName($key) + { + $parts = ['authfacebook:authdata:fb', $this->getAppId(), $key]; + if ($this->sharedSessionID) { + array_unshift($parts, $this->sharedSessionID); + } + return implode('_', $parts); } - } - - protected function deleteSharedSessionCookie() { - $cookie_name = $this->getSharedSessionCookieName(); - unset($_COOKIE[$cookie_name]); - $base_domain = $this->getBaseDomain(); - setcookie($cookie_name, '', 1, '/', '.'.$base_domain); - } - - protected function getSharedSessionCookieName() { - return self::FBSS_COOKIE_NAME . '_' . $this->getAppId(); - } - - protected function constructSessionVariableName($key) { - $parts = array('authfacebook:authdata:fb', $this->getAppId(), $key); - if ($this->sharedSessionID) { - array_unshift($parts, $this->sharedSessionID); + + protected function establishCSRFTokenState() + { + if ($this->state === null) { + $this->state = \SimpleSAML\Auth\State::getStateId($this->ssp_state); + $this->setPersistentData('state', $this->state); + } } - return implode('_', $parts); - } - - protected function establishCSRFTokenState() { - if ($this->state === null) { - $this->state = SimpleSAML_Auth_State::getStateId($this->ssp_state); - $this->setPersistentData('state', $this->state); - } - } } diff --git a/vendor/simplesamlphp/simplesamlphp/modules/authfacebook/www/linkback.php b/vendor/simplesamlphp/simplesamlphp/modules/authfacebook/www/linkback.php index 94adb16728..6a24590194 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/authfacebook/www/linkback.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/authfacebook/www/linkback.php @@ -6,34 +6,47 @@ // For backwards compatability look for AuthState first if (array_key_exists('AuthState', $_REQUEST) && !empty($_REQUEST['AuthState'])) { - $state = SimpleSAML_Auth_State::loadState($_REQUEST['AuthState'], sspmod_authfacebook_Auth_Source_Facebook::STAGE_INIT); + $state = \SimpleSAML\Auth\State::loadState( + $_REQUEST['AuthState'], + \SimpleSAML\Module\authfacebook\Auth\Source\Facebook::STAGE_INIT + ); } elseif (array_key_exists('state', $_REQUEST) && !empty($_REQUEST['state'])) { - $state = SimpleSAML_Auth_State::loadState($_REQUEST['state'], sspmod_authfacebook_Auth_Source_Facebook::STAGE_INIT); + $state = \SimpleSAML\Auth\State::loadState( + $_REQUEST['state'], + \SimpleSAML\Module\authfacebook\Auth\Source\Facebook::STAGE_INIT + ); } else { - throw new SimpleSAML_Error_BadRequest('Missing state parameter on facebook linkback endpoint.'); + throw new \SimpleSAML\Error\BadRequest('Missing state parameter on facebook linkback endpoint.'); } // Find authentication source -if (!array_key_exists(sspmod_authfacebook_Auth_Source_Facebook::AUTHID, $state)) { - throw new SimpleSAML_Error_BadRequest('No data in state for ' . sspmod_authfacebook_Auth_Source_Facebook::AUTHID); +if (!array_key_exists(\SimpleSAML\Module\authfacebook\Auth\Source\Facebook::AUTHID, $state)) { + throw new \SimpleSAML\Error\BadRequest( + 'No data in state for '.\SimpleSAML\Module\authfacebook\Auth\Source\Facebook::AUTHID + ); } -$sourceId = $state[sspmod_authfacebook_Auth_Source_Facebook::AUTHID]; +$sourceId = $state[\SimpleSAML\Module\authfacebook\Auth\Source\Facebook::AUTHID]; -$source = SimpleSAML_Auth_Source::getById($sourceId); -if ($source === NULL) { - throw new SimpleSAML_Error_BadRequest('Could not find authentication source with id ' . var_export($sourceId, TRUE)); +$source = \SimpleSAML\Auth\Source::getById($sourceId); +if ($source === null) { + throw new \SimpleSAML\Error\BadRequest( + 'Could not find authentication source with id '.var_export($sourceId, true) + ); } try { - if (isset($_REQUEST['error_reason']) && $_REQUEST['error_reason'] == 'user_denied') { - throw new SimpleSAML_Error_UserAborted(); - } + if (isset($_REQUEST['error_reason']) && $_REQUEST['error_reason'] == 'user_denied') { + throw new \SimpleSAML\Error\UserAborted(); + } - $source->finalStep($state); -} catch (SimpleSAML_Error_Exception $e) { - SimpleSAML_Auth_State::throwException($state, $e); -} catch (Exception $e) { - SimpleSAML_Auth_State::throwException($state, new SimpleSAML_Error_AuthSource($sourceId, 'Error on facebook linkback endpoint.', $e)); + $source->finalStep($state); +} catch (\SimpleSAML\Error\Exception $e) { + \SimpleSAML\Auth\State::throwException($state, $e); +} catch (\Exception $e) { + \SimpleSAML\Auth\State::throwException( + $state, + new \SimpleSAML\Error\AuthSource($sourceId, 'Error on facebook linkback endpoint.', $e) + ); } -SimpleSAML_Auth_Source::completeAuth($state); +\SimpleSAML\Auth\Source::completeAuth($state); diff --git a/vendor/simplesamlphp/simplesamlphp/modules/authlinkedin/docs/oauthlinkedin.md b/vendor/simplesamlphp/simplesamlphp/modules/authlinkedin/docs/oauthlinkedin.md deleted file mode 100644 index df437006f6..0000000000 --- a/vendor/simplesamlphp/simplesamlphp/modules/authlinkedin/docs/oauthlinkedin.md +++ /dev/null @@ -1,26 +0,0 @@ -Using the LinkedIn authentication source with SimpleSAMLphp -=========================================================== - -Remember to configure `authsources.php`, with both Consumer key and secret. Optionally you can set which attributes are requested from LinkedIn, the list of available attributes can be found here <https://developer.linkedin.com/docs/fields>. - -To get an API key and a secret, register the application at: - - * <https://www.linkedin.com/secure/developer> - -Set the callback URL to be: - - * `http://sp.example.org/simplesaml/module.php/authlinkedin/linkback.php` - -Replace `sp.example.org` with your hostname. - -## Testing authentication - -On the SimpleSAMLphp frontpage, go to the *Authentication* tab, and use the link: - - * *Test configured authentication sources* - -Then choose the *linkedin* authentication source. - -Expected behaviour would then be that you are sent to LinkedIn and asked to login. -There is no consent screen for attribute release. - diff --git a/vendor/simplesamlphp/simplesamlphp/modules/authlinkedin/lib/Auth/Source/LinkedIn.php b/vendor/simplesamlphp/simplesamlphp/modules/authlinkedin/lib/Auth/Source/LinkedIn.php deleted file mode 100644 index aeb6db11fd..0000000000 --- a/vendor/simplesamlphp/simplesamlphp/modules/authlinkedin/lib/Auth/Source/LinkedIn.php +++ /dev/null @@ -1,182 +0,0 @@ -<?php - -require_once(dirname(dirname(dirname(dirname(dirname(__FILE__))))) . '/oauth/libextinc/OAuth.php'); - -/** - * Authenticate using LinkedIn. - * - * @author Brook Schofield, TERENA. - * @package SimpleSAMLphp - */ -class sspmod_authlinkedin_Auth_Source_LinkedIn extends SimpleSAML_Auth_Source -{ - - /** - * The string used to identify our states. - */ - const STAGE_INIT = 'authlinkedin:init'; - - /** - * The key of the AuthId field in the state. - */ - const AUTHID = 'authlinkedin:AuthId'; - - private $key; - private $secret; - private $attributes; - - - /** - * Constructor for this authentication source. - * - * @param array $info Information about this authentication source. - * @param array $config Configuration. - */ - public function __construct($info, $config) - { - assert('is_array($info)'); - assert('is_array($config)'); - - // Call the parent constructor first, as required by the interface - parent::__construct($info, $config); - - if (!array_key_exists('key', $config)) - throw new Exception('LinkedIn authentication source is not properly configured: missing [key]'); - - $this->key = $config['key']; - - if (!array_key_exists('secret', $config)) - throw new Exception('LinkedIn authentication source is not properly configured: missing [secret]'); - - $this->secret = $config['secret']; - - if (array_key_exists('attributes', $config)) { - $this->attributes = $config['attributes']; - } else { - // Default values if the attributes are not set in config (ref https://developer.linkedin.com/docs/fields) - $this->attributes = 'id,first-name,last-name,headline,summary,specialties,picture-url,email-address'; - } - } - - - /** - * Log-in using LinkedIn platform - * Documentation at: http://developer.linkedin.com/docs/DOC-1008 - * - * @param array &$state Information about the current authentication. - */ - public function authenticate(&$state) - { - assert('is_array($state)'); - - // We are going to need the authId in order to retrieve this authentication source later - $state[self::AUTHID] = $this->authId; - - $stateID = SimpleSAML_Auth_State::getStateId($state); - SimpleSAML\Logger::debug('authlinkedin auth state id = ' . $stateID); - - $consumer = new sspmod_oauth_Consumer($this->key, $this->secret); - - // Get the request token - $requestToken = $consumer->getRequestToken( - 'https://api.linkedin.com/uas/oauth/requestToken', - array('oauth_callback' => SimpleSAML\Module::getModuleUrl('authlinkedin') . '/linkback.php?stateid=' . $stateID) - ); - - SimpleSAML\Logger::debug( - "Got a request token from the OAuth service provider [" . - $requestToken->key . "] with the secret [" . $requestToken->secret . "]" - ); - - $state['authlinkedin:requestToken'] = $requestToken; - - // Update the state - SimpleSAML_Auth_State::saveState($state, self::STAGE_INIT); - - // Authorize the request token - $consumer->getAuthorizeRequest('https://www.linkedin.com/uas/oauth/authenticate', $requestToken); - } - - - public function finalStep(&$state) - { - $requestToken = $state['authlinkedin:requestToken']; - - $consumer = new sspmod_oauth_Consumer($this->key, $this->secret); - - SimpleSAML\Logger::debug( - "oauth: Using this request token [" . - $requestToken->key . "] with the secret [" . $requestToken->secret . "]" - ); - - // Replace the request token with an access token (via GET method) - $accessToken = $consumer->getAccessToken( - 'https://api.linkedin.com/uas/oauth/accessToken', $requestToken, - array('oauth_verifier' => $state['authlinkedin:oauth_verifier']) - ); - - SimpleSAML\Logger::debug( - "Got an access token from the OAuth service provider [" . - $accessToken->key . "] with the secret [" . $accessToken->secret . "]" - ); - - $userdata = $consumer->getUserInfo( - 'https://api.linkedin.com/v1/people/~:(' . $this->attributes . ')', - $accessToken, - array('http' => array('header' => 'x-li-format: json')) - ); - - $attributes = $this->flatten($userdata, 'linkedin.'); - - // TODO: pass accessToken: key, secret + expiry as attributes? - - if (array_key_exists('id', $userdata)) { - $attributes['linkedin_targetedID'] = array('http://linkedin.com!' . $userdata['id']); - $attributes['linkedin_user'] = array($userdata['id'] . '@linkedin.com'); - } - - SimpleSAML\Logger::debug('LinkedIn Returned Attributes: '. implode(", ",array_keys($attributes))); - - $state['Attributes'] = $attributes; - } - - /** - * takes an associative array, traverses it and returns the keys concatenated with a dot - * - * e.g.: - * - * [ - * 'linkedin' => [ - * 'location' => [ - * 'id' => '123456' - * 'country' => [ - * 'code' => 'de' - * ] - * ] - * ] - * - * become: - * - * [ - * 'linkedin.location.id' => [0 => '123456'], - * 'linkedin.location.country.code' => [0 => 'de'] - * ] - * - * @param array $array - * @param string $prefix - * - * @return array the array with the new concatenated keys - */ - protected function flatten($array, $prefix = '') - { - $result = array(); - foreach ($array as $key => $value) { - if (is_array($value)) { - $result = $result + $this->flatten($value, $prefix . $key . '.'); - } else { - $result[$prefix . $key] = array($value); - } - } - return $result; - } -} diff --git a/vendor/simplesamlphp/simplesamlphp/modules/authlinkedin/www/linkback.php b/vendor/simplesamlphp/simplesamlphp/modules/authlinkedin/www/linkback.php deleted file mode 100644 index 85084dffe6..0000000000 --- a/vendor/simplesamlphp/simplesamlphp/modules/authlinkedin/www/linkback.php +++ /dev/null @@ -1,31 +0,0 @@ -<?php - -/** - * Handle linkback() response from LinkedIn. - */ - -if (!array_key_exists('stateid', $_REQUEST)) { - throw new Exception('Lost OAuth Client State'); -} -$state = SimpleSAML_Auth_State::loadState($_REQUEST['stateid'], sspmod_authlinkedin_Auth_Source_LinkedIn::STAGE_INIT); - -// http://developer.linkedin.com/docs/DOC-1008#2_Redirect_the_User_to_our_Authorization_Server -if (array_key_exists('oauth_verifier', $_REQUEST)) { - $state['authlinkedin:oauth_verifier'] = $_REQUEST['oauth_verifier']; -} else { - throw new Exception('OAuth verifier not returned.');; -} - -// Find authentication source -assert('array_key_exists(sspmod_authlinkedin_Auth_Source_LinkedIn::AUTHID, $state)'); -$sourceId = $state[sspmod_authlinkedin_Auth_Source_LinkedIn::AUTHID]; - -$source = SimpleSAML_Auth_Source::getById($sourceId); -if ($source === NULL) { - throw new Exception('Could not find authentication source with id ' . $sourceId); -} - -$source->finalStep($state); - -SimpleSAML_Auth_Source::completeAuth($state); - diff --git a/vendor/simplesamlphp/simplesamlphp/modules/authmyspace/docs/oauthmyspace.md b/vendor/simplesamlphp/simplesamlphp/modules/authmyspace/docs/oauthmyspace.md deleted file mode 100644 index 98b97b805a..0000000000 --- a/vendor/simplesamlphp/simplesamlphp/modules/authmyspace/docs/oauthmyspace.md +++ /dev/null @@ -1,25 +0,0 @@ -Using the MySpace authentication source with SimpleSAMLphp -========================================================== - -Remember to configure `authsources.php`, with both your Client ID and Secret key. - -To get an API key and a secret, register the application at: - - * <http://developer.myspace.com/Modules/Apps/Pages/CreateAppAccount.aspx> - -Create a MySpace ID App and set the callback evaluation URL to be: - - * `http://sp.example.org/` - -Replace `sp.example.org` with your hostname. - -## Testing authentication - -On the SimpleSAMLphp frontpage, go to the *Authentication* tab, and use the link: - - * *Test configured authentication sources* - -Then choose the *myspace* authentication source. - -Expected behaviour would then be that you are sent to MySpace, and asked to login. -There is no consent screen for attribute release. diff --git a/vendor/simplesamlphp/simplesamlphp/modules/authmyspace/lib/Auth/Source/MySpace.php b/vendor/simplesamlphp/simplesamlphp/modules/authmyspace/lib/Auth/Source/MySpace.php deleted file mode 100644 index 493b999aa8..0000000000 --- a/vendor/simplesamlphp/simplesamlphp/modules/authmyspace/lib/Auth/Source/MySpace.php +++ /dev/null @@ -1,137 +0,0 @@ -<?php - -require_once(dirname(dirname(dirname(dirname(dirname(__FILE__))))) . '/oauth/libextinc/OAuth.php'); - -/** - * Authenticate using MySpace. - * - * @author Brook Schofield, TERENA. - * @package SimpleSAMLphp - */ -class sspmod_authmyspace_Auth_Source_MySpace extends SimpleSAML_Auth_Source { - - /** - * The string used to identify our states. - */ - const STAGE_INIT = 'authmyspace:init'; - - /** - * The key of the AuthId field in the state. - */ - const AUTHID = 'authmyspace:AuthId'; - - private $key; - private $secret; - - - /** - * Constructor for this authentication source. - * - * @param array $info Information about this authentication source. - * @param array $config Configuration. - */ - public function __construct($info, $config) { - assert('is_array($info)'); - assert('is_array($config)'); - - // Call the parent constructor first, as required by the interface - parent::__construct($info, $config); - - if (!array_key_exists('key', $config)) - throw new Exception('MySpace authentication source is not properly configured: missing [key]'); - - $this->key = $config['key']; - - if (!array_key_exists('secret', $config)) - throw new Exception('MySpace authentication source is not properly configured: missing [secret]'); - - $this->secret = $config['secret']; - } - - - /** - * Log-in using MySpace platform - * - * @param array &$state Information about the current authentication. - */ - public function authenticate(&$state) { - assert('is_array($state)'); - - // We are going to need the authId in order to retrieve this authentication source later - $state[self::AUTHID] = $this->authId; - - $consumer = new sspmod_oauth_Consumer($this->key, $this->secret); - - // Get the request token - $requestToken = $consumer->getRequestToken('http://api.myspace.com/request_token'); - SimpleSAML\Logger::debug("Got a request token from the OAuth service provider [" . - $requestToken->key . "] with the secret [" . $requestToken->secret . "]"); - - $state['authmyspace:requestToken'] = $requestToken; - - $stateID = SimpleSAML_Auth_State::saveState($state, self::STAGE_INIT); - SimpleSAML\Logger::debug('authmyspace auth state id = ' . $stateID); - - // Authorize the request token - $consumer->getAuthorizeRequest('http://api.myspace.com/authorize', $requestToken, TRUE, SimpleSAML\Module::getModuleUrl('authmyspace') . '/linkback.php?stateid=' . $stateID); - - } - - - - public function finalStep(&$state) { - - $requestToken = $state['authmyspace:requestToken']; - - $consumer = new sspmod_oauth_Consumer($this->key, $this->secret); - - SimpleSAML\Logger::debug("oauth: Using this request token [" . - $requestToken->key . "] with the secret [" . $requestToken->secret . "]"); - - // Replace the request token with an access token - $accessToken = $consumer->getAccessToken('http://api.myspace.com/access_token', $requestToken); - SimpleSAML\Logger::debug("Got an access token from the OAuth service provider [" . - $accessToken->key . "] with the secret [" . $accessToken->secret . "]"); - - // People API - http://developerwiki.myspace.com/index.php?title=People_API - $userdata = $consumer->getUserInfo('http://api.myspace.com/1.0/people/@me/@self?fields=@all', $accessToken); - - $attributes = array(); - - if (is_array($userdata['person'])) { - foreach($userdata['person'] AS $key => $value) { - if (is_string($value) || is_int($value)) - $attributes['myspace.' . $key] = array((string)$value); - - if (is_array($value)) { - foreach($value AS $key2 => $value2) { - if (is_string($value2) || is_int($value2)) - $attributes['myspace.' . $key . '.' . $key2] = array((string)$value2); - } - } - } - - if (array_key_exists('id', $userdata['person']) ) { - - // person-id in the format of myspace.com.person.1234567890 - if (preg_match('/(\d+)$/',$userdata['person']['id'],$matches)) { - $attributes['myspace_targetedID'] = array('http://myspace.com!' . $matches[1]); - $attributes['myspace_uid'] = array($matches[1]); - $attributes['myspace_user'] = array($matches[1] . '@myspace.com'); - } - } - - // profileUrl in the format http://www.myspace.com/username - if (array_key_exists('profileUrl', $userdata['person']) ) { - if (preg_match('@/([^/]+)$@',$userdata['person']['profileUrl'],$matches)) { - $attributes['myspace_username'] = array($matches[1]); - $attributes['myspace_user'] = array($matches[1] . '@myspace.com'); - } - } - } - - SimpleSAML\Logger::debug('MySpace Returned Attributes: '. implode(", ",array_keys($attributes))); - - $state['Attributes'] = $attributes; - } -} diff --git a/vendor/simplesamlphp/simplesamlphp/modules/authmyspace/www/linkback.php b/vendor/simplesamlphp/simplesamlphp/modules/authmyspace/www/linkback.php deleted file mode 100644 index 9c530c1133..0000000000 --- a/vendor/simplesamlphp/simplesamlphp/modules/authmyspace/www/linkback.php +++ /dev/null @@ -1,42 +0,0 @@ -<?php - -/** - * Handle linkback() response from MySpace. - */ - -if (!array_key_exists('stateid', $_REQUEST)) { - throw new Exception('State Lost - not returned by MySpace Auth'); -} -$state = SimpleSAML_Auth_State::loadState($_REQUEST['stateid'], sspmod_authmyspace_Auth_Source_MySpace::STAGE_INIT); - -if (array_key_exists('oauth_problem', $_REQUEST)) { - // oauth_problem of 'user_refused' means user chose not to login with MySpace - if (strcmp($_REQUEST['oauth_problem'],'user_refused') == 0) { - $e = new SimpleSAML_Error_UserAborted(); - SimpleSAML_Auth_State::throwException($state, $e); - } - - // Error - $e = new SimpleSAML_Error_Error('Authentication failed: ' . $_REQUEST['oauth_problem']); - SimpleSAML_Auth_State::throwException($state, $e); -} - -if (array_key_exists('oauth_verifier', $_REQUEST)) { - $state['authmyspace:oauth_verifier'] = $_REQUEST['oauth_verifier']; -} else { - throw new Exception('OAuth verifier not returned.');; -} - -// Find authentication source -assert('array_key_exists(sspmod_authmyspace_Auth_Source_MySpace::AUTHID, $state)'); -$sourceId = $state[sspmod_authmyspace_Auth_Source_MySpace::AUTHID]; - -$source = SimpleSAML_Auth_Source::getById($sourceId); -if ($source === NULL) { - throw new Exception('Could not find authentication source with id ' . $sourceId); -} - -$source->finalStep($state); - -SimpleSAML_Auth_Source::completeAuth($state); - diff --git a/vendor/simplesamlphp/simplesamlphp/modules/authorize/dictionaries/Authorize.translation.json b/vendor/simplesamlphp/simplesamlphp/modules/authorize/dictionaries/Authorize.translation.json index e0aeeed45c..d3611a83f5 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/authorize/dictionaries/Authorize.translation.json +++ b/vendor/simplesamlphp/simplesamlphp/modules/authorize/dictionaries/Authorize.translation.json @@ -31,7 +31,9 @@ "eu": "Sarrera debekatua", "af": "Toegang verbode", "pt-br": "Acesso proibido", - "el": "\u0394\u03b5\u03bd \u03b5\u03c0\u03b9\u03c4\u03c1\u03ad\u03c0\u03b5\u03c4\u03b1\u03b9 \u03b7 \u03c0\u03c1\u03cc\u03c3\u03b2\u03b1\u03c3\u03b7" + "el": "\u0394\u03b5\u03bd \u03b5\u03c0\u03b9\u03c4\u03c1\u03ad\u03c0\u03b5\u03c4\u03b1\u03b9 \u03b7 \u03c0\u03c1\u03cc\u03c3\u03b2\u03b1\u03c3\u03b7", + "xh": "Ufikelelo luthintelwe", + "zu": "Ukufinyelela kwenqatshelwe" }, "403_text": { "es": "No tiene los privilegios necesarios para acceder a esta aplicaci\u00f3n. Si considera que esto no es correcto, consulte el administrador.", @@ -64,6 +66,8 @@ "eu": "Ez duzu beharrezko pribilegiorik aplikazio honetan sartzeko. Hau okerra dela baderitzozu, jar zaitez administratzailearekin harremanetan. ", "af": "Jy het nie die nodige regte vir toegang na die aansoek nie. Kontak asseblief die administrateur indien dit inkorrek is.", "pt-br": "Voc\u00ea n\u00e3o tem privil\u00e9gios necess\u00e1rios para acessar esta aplica\u00e7\u00e3o. Entre em contato com o administrador se voc\u00ea achar que isso seja incorreto.", - "el": "\u0394\u03b5\u03bd \u03ad\u03c7\u03b5\u03c4\u03b5 \u03c4\u03b1 \u03b1\u03c0\u03b1\u03c1\u03b1\u03af\u03c4\u03b7\u03c4\u03b1 \u03b4\u03b9\u03ba\u03b1\u03b9\u03ce\u03bc\u03b1\u03c4\u03b1 \u03b3\u03b9\u03b1 \u03bd\u03b1 \u03b1\u03c0\u03bf\u03ba\u03c4\u03ae\u03c3\u03b5\u03c4\u03b5 \u03c0\u03c1\u03cc\u03c3\u03b2\u03b1\u03c3\u03b7 \u03c3\u03b5 \u03b1\u03c5\u03c4\u03ae \u03c4\u03b7\u03bd \u03c5\u03c0\u03b7\u03c1\u03b5\u03c3\u03af\u03b1. \u03a0\u03b1\u03c1\u03b1\u03ba\u03b1\u03bb\u03bf\u03cd\u03bc\u03b5 \u03b5\u03c0\u03b9\u03ba\u03bf\u03b9\u03bd\u03c9\u03bd\u03ae\u03c3\u03c4\u03b5 \u03bc\u03b5 \u03c4\u03bf \u03b4\u03b9\u03b1\u03c7\u03b5\u03b9\u03c1\u03b9\u03c3\u03c4\u03ae \u03b1\u03bd \u03b8\u03b5\u03c9\u03c1\u03b5\u03af\u03c4\u03b5 \u03cc\u03c4\u03b9 \u03b1\u03c5\u03c4\u03cc \u03bd\u03b1 \u03b5\u03af\u03bd\u03b1\u03b9 \u03bb\u03b1\u03bd\u03b8\u03b1\u03c3\u03bc\u03ad\u03bd\u03bf." + "el": "\u0394\u03b5\u03bd \u03ad\u03c7\u03b5\u03c4\u03b5 \u03c4\u03b1 \u03b1\u03c0\u03b1\u03c1\u03b1\u03af\u03c4\u03b7\u03c4\u03b1 \u03b4\u03b9\u03ba\u03b1\u03b9\u03ce\u03bc\u03b1\u03c4\u03b1 \u03b3\u03b9\u03b1 \u03bd\u03b1 \u03b1\u03c0\u03bf\u03ba\u03c4\u03ae\u03c3\u03b5\u03c4\u03b5 \u03c0\u03c1\u03cc\u03c3\u03b2\u03b1\u03c3\u03b7 \u03c3\u03b5 \u03b1\u03c5\u03c4\u03ae \u03c4\u03b7\u03bd \u03c5\u03c0\u03b7\u03c1\u03b5\u03c3\u03af\u03b1. \u03a0\u03b1\u03c1\u03b1\u03ba\u03b1\u03bb\u03bf\u03cd\u03bc\u03b5 \u03b5\u03c0\u03b9\u03ba\u03bf\u03b9\u03bd\u03c9\u03bd\u03ae\u03c3\u03c4\u03b5 \u03bc\u03b5 \u03c4\u03bf \u03b4\u03b9\u03b1\u03c7\u03b5\u03b9\u03c1\u03b9\u03c3\u03c4\u03ae \u03b1\u03bd \u03b8\u03b5\u03c9\u03c1\u03b5\u03af\u03c4\u03b5 \u03cc\u03c4\u03b9 \u03b1\u03c5\u03c4\u03cc \u03bd\u03b1 \u03b5\u03af\u03bd\u03b1\u03b9 \u03bb\u03b1\u03bd\u03b8\u03b1\u03c3\u03bc\u03ad\u03bd\u03bf.", + "zu": "Awunawo amalungelo adingekile okufinyelela lolu hlelo. Sicela uthinte umlawuli uma uthola ukuthi lokhu akulona iqiniso.", + "xh": "Awunawo amalungelo afunekayo ukuze ufikelele olu setyenziso. Nceda uqhagamshelane nomlawuli ukuba ngaba ukufumanisa oku kungachanekanga." } } diff --git a/vendor/simplesamlphp/simplesamlphp/modules/authorize/docs/authorize.md b/vendor/simplesamlphp/simplesamlphp/modules/authorize/docs/authorize.md index de8cb4dcf2..36ac30c90b 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/authorize/docs/authorize.md +++ b/vendor/simplesamlphp/simplesamlphp/modules/authorize/docs/authorize.md @@ -20,20 +20,26 @@ This module provides a user authorization filter based on attribute matching for `authorize:Authorize` --------------------- -There are two configuration options that can be defined; deny and regex. All other filter configuration options are considered attribute matching rules. +There are three configuration options that can be defined: `deny`, `regex`, and `reject_msg`. All other filter configuration options are considered attribute matching rules. -The users not authorized will be shown a 403 Forbidden page. +Unauthorized users will be shown a 403 Forbidden page. -### Deny ### +### `deny` ### The default action of the filter is to authorize only if an attribute match is found (default allow). When set to TRUE, this option reverses that rule and authorizes the user unless an attribute match is found (default deny), causing an unauthorized action. Note: This option needs to be boolean (TRUE/FALSE) else it will be considered an attribute matching rule. -### Regex ### +### `regex` ### Turn regex pattern matching on or off for the attribute values defined. For backwards compatibility, this option defaults to TRUE, but can be turned off by setting it to FALSE. Note: This option needs to be boolean (TRUE/FALSE) else it will be considered an attribute matching rule. +### `reject_msg` ### +This option can be used to provide a localised, custom message to an unauthorised user. For example: tailored instructions on how to fix the authorisation issue, specific contact details, etc. + +It should be an array of key/value pairs, with the keys as the language code. You can use HTML in the message. See below for an example. + + ### Attribute Rules ### Each additional filter configuration option is considered an attribute matching rule. For each attribute, you can specify a string or array of strings to match. If one of those attributes match one of the rules (OR operator), the user is authorized/unauthorized (depending on the deny config option). @@ -45,39 +51,55 @@ Note: If regex is enabled, you must use the preg_match format, i.e. you have to ### Examples ### To use this filter configure it in `config/config.php`: - - 'authproc.sp' => array( - 60 => array( - 'class' => 'authorize:Authorize', - 'uid' => array( - '/.*@example.com/', - '/(user1|user2|user3)@example.edu/', - ), - 'schacUserStatus' => '@urn:mace:terena.org:userStatus:' . - 'example.org:service:active.*@', - ) +```php +'authproc.sp' => [ + 60 => [ + 'class' => 'authorize:Authorize', + 'uid' => [ + '/.*@example.com/', + '/(user1|user2|user3)@example.edu/', + ], + 'schacUserStatus' => '@urn:mace:terena.org:userStatus:' . + 'example.org:service:active.*@', + ] +] +``` An alternate way of using this filter is to deny certain users. Or even use multiple filters to create a simple ACL, by first allowing a group of users but then denying a "black list" of users. - 'authproc.sp' => array( - 60 => array( - 'class' => 'authorize:Authorize', - 'deny' => TRUE, - 'uid' => array( - '/.*@students.example.edu/', - '/(stu1|stu2|stu3)@example.edu/', - ) - ) +```php +'authproc.sp' => [ + 60 => array[ + 'class' => 'authorize:Authorize', + 'deny' => TRUE, + 'uid' => [ + '/.*@students.example.edu/', + '/(stu1|stu2|stu3)@example.edu/', + ] + ] +] +``` The regex pattern matching can be turned off, allowing for exact attribute matching rules. This can be helpful in cases where you know what the value should be. An example of this is with the memberOf attribute or using the ldap:AttributeAddUsersGroups filter with the group attribute. - 'authproc.sp' => array( - 60 => array( - 'class' => 'authorize:Authorize', - 'regex' => FALSE, - 'group' => array( - 'CN=SimpleSAML Students,CN=Users,DC=example,DC=edu', - 'CN=All Teachers,OU=Staff,DC=example,DC=edu', - ) - ) +Additionally, some helpful instructions are shown. + +```php +'authproc.sp' => [ + 60 => [ + 'class' => 'authorize:Authorize', + 'regex' => FALSE, + 'group' => [ + 'CN=SimpleSAML Students,CN=Users,DC=example,DC=edu', + 'CN=All Teachers,OU=Staff,DC=example,DC=edu', + ], + 'reject_msg' => [ + 'en' => 'This service is only available to students and teachers.' . + 'Please contact <a href="mailto:support@example.edu">support</a>.', + 'nl' => 'Deze dienst is alleen beschikbaar voor studenten en docenten.' . + 'Neem contact op met <a href="mailto:support@example.edu">support</a>.', + ] + ] +] +``` diff --git a/vendor/simplesamlphp/simplesamlphp/modules/authorize/lib/Auth/Process/Authorize.php b/vendor/simplesamlphp/simplesamlphp/modules/authorize/lib/Auth/Process/Authorize.php index 1eb39ce84e..e40cbaf362 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/authorize/lib/Auth/Process/Authorize.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/authorize/lib/Auth/Process/Authorize.php @@ -1,5 +1,7 @@ <?php +namespace SimpleSAML\Module\authorize\Auth\Process; + /** * Filter to authorize only certain users. * See docs directory. @@ -7,127 +9,152 @@ * @author Ernesto Revilla, Yaco Sistemas SL., Ryan Panning * @package SimpleSAMLphp */ -class sspmod_authorize_Auth_Process_Authorize extends SimpleSAML_Auth_ProcessingFilter { - - /** - * Flag to deny/unauthorize the user a attribute filter IS found - * - * @var bool - */ - protected $deny = FALSE; - - /** - * Flag to turn the REGEX pattern matching on or off - * - * @var bool - */ - protected $regex = TRUE; - - /** - * Array of valid users. Each element is a regular expression. You should - * user \ to escape special chars, like '.' etc. - * - */ - protected $valid_attribute_values = array(); - - - /** - * Initialize this filter. - * Validate configuration parameters. - * - * @param array $config Configuration information about this filter. - * @param mixed $reserved For future use. - */ - public function __construct($config, $reserved) { - parent::__construct($config, $reserved); - - assert('is_array($config)'); - - // Check for the deny option, get it and remove it - // Must be bool specifically, if not, it might be for a attrib filter below - if (isset($config['deny']) && is_bool($config['deny'])) { - $this->deny = $config['deny']; - unset($config['deny']); - } - - // Check for the regex option, get it and remove it - // Must be bool specifically, if not, it might be for a attrib filter below - if (isset($config['regex']) && is_bool($config['regex'])) { - $this->regex = $config['regex']; - unset($config['regex']); - } - - foreach ($config as $attribute => $values) { - if (is_string($values)) - $values = array($values); - if (!is_array($values)) - throw new Exception('Filter Authorize: Attribute values is neither string nor array: ' . var_export($attribute, TRUE)); - foreach ($values as $value){ - if(!is_string($value)) { - throw new Exception('Filter Authorize: Each value should be a string for attribute: ' . var_export($attribute, TRUE) . ' value: ' . var_export($value, TRUE) . ' Config is: ' . var_export($config, TRUE)); - } - } - $this->valid_attribute_values[$attribute] = $values; - } - } - - - /** - * Apply filter to validate attributes. - * - * @param array &$request The current request - */ - public function process(&$request) { - $authorize = $this->deny; - assert('is_array($request)'); - assert('array_key_exists("Attributes", $request)'); - - $attributes =& $request['Attributes']; - - foreach ($this->valid_attribute_values as $name => $patterns) { - if(array_key_exists($name, $attributes)) { - foreach ($patterns as $pattern){ - $values = $attributes[$name]; - if (!is_array($values)) - $values = array($values); - foreach ($values as $value){ - if ($this->regex) { - $matched = preg_match($pattern, $value); - } else { - $matched = ($value == $pattern); - } - if ($matched) { - $authorize = ($this->deny ? FALSE : TRUE); - break 3; - } - } - } - } - } - if (!$authorize){ - $this->unauthorized($request); - } - } - - - /** - * When the process logic determines that the user is not - * authorized for this service, then forward the user to - * an 403 unauthorized page. - * - * Separated this code into its own method so that child - * classes can override it and change the action. Forward - * thinking in case a "chained" ACL is needed, more complex - * permission logic. - * - * @param array $request - */ - protected function unauthorized(&$request) { - // Save state and redirect to 403 page - $id = SimpleSAML_Auth_State::saveState($request, - 'authorize:Authorize'); - $url = SimpleSAML\Module::getModuleURL( - 'authorize/authorize_403.php'); - \SimpleSAML\Utils\HTTP::redirectTrustedURL($url, array('StateId' => $id)); - } + +class Authorize extends \SimpleSAML\Auth\ProcessingFilter +{ + /** + * Flag to deny/unauthorize the user a attribute filter IS found + * + * @var bool + */ + protected $deny = false; + + /** + * Flag to turn the REGEX pattern matching on or off + * + * @var bool + */ + protected $regex = true; + + /** + * Array of localised rejection messages + * + * @var array + */ + protected $reject_msg = []; + + /** + * Array of valid users. Each element is a regular expression. You should + * user \ to escape special chars, like '.' etc. + * + */ + protected $valid_attribute_values = []; + + /** + * Initialize this filter. + * Validate configuration parameters. + * + * @param array $config Configuration information about this filter. + * @param mixed $reserved For future use. + */ + public function __construct($config, $reserved) + { + parent::__construct($config, $reserved); + + assert(is_array($config)); + + // Check for the deny option, get it and remove it + // Must be bool specifically, if not, it might be for a attrib filter below + if (isset($config['deny']) && is_bool($config['deny'])) { + $this->deny = $config['deny']; + unset($config['deny']); + } + + // Check for the regex option, get it and remove it + // Must be bool specifically, if not, it might be for a attrib filter below + if (isset($config['regex']) && is_bool($config['regex'])) { + $this->regex = $config['regex']; + unset($config['regex']); + } + + // Check for the reject_msg option, get it and remove it + // Must be array of languages + if (isset($config['reject_msg']) && is_array($config['reject_msg'])) { + $this->reject_msg = $config['reject_msg']; + unset($config['reject_msg']); + } + + foreach ($config as $attribute => $values) { + if (is_string($values)) { + $values = [$values]; + } + if (!is_array($values)) { + throw new \Exception( + 'Filter Authorize: Attribute values is neither string nor array: '.var_export($attribute, true) + ); + } + foreach ($values as $value) { + if (!is_string($value)) { + throw new \Exception( + 'Filter Authorize: Each value should be a string for attribute: '.var_export($attribute, true). + ' value: '.var_export($value, true).' Config is: '.var_export($config, true) + ); + } + } + $this->valid_attribute_values[$attribute] = $values; + } + } + + /** + * Apply filter to validate attributes. + * + * @param array &$request The current request + */ + public function process(&$request) + { + $authorize = $this->deny; + assert(is_array($request)); + assert(array_key_exists('Attributes', $request)); + + $attributes = &$request['Attributes']; + // Store the rejection message array in the $request + if(!empty($this->reject_msg)) { + $request['authprocAuthorize_reject_msg'] = $this->reject_msg; + } + + foreach ($this->valid_attribute_values as $name => $patterns) { + if (array_key_exists($name, $attributes)) { + foreach ($patterns as $pattern) { + $values = $attributes[$name]; + if (!is_array($values)) { + $values = [$values]; + } + foreach ($values as $value) { + if ($this->regex) { + $matched = preg_match($pattern, $value); + } else { + $matched = ($value == $pattern); + } + if ($matched) { + $authorize = ($this->deny ? false : true); + break 3; + } + } + } + } + } + if (!$authorize) { + $this->unauthorized($request); + } + } + + /** + * When the process logic determines that the user is not + * authorized for this service, then forward the user to + * an 403 unauthorized page. + * + * Separated this code into its own method so that child + * classes can override it and change the action. Forward + * thinking in case a "chained" ACL is needed, more complex + * permission logic. + * + * @param array $request + */ + protected function unauthorized(&$request) + { + // Save state and redirect to 403 page + $id = \SimpleSAML\Auth\State::saveState($request, 'authorize:Authorize'); + $url = \SimpleSAML\Module::getModuleURL('authorize/authorize_403.php'); + \SimpleSAML\Utils\HTTP::redirectTrustedURL($url, ['StateId' => $id]); + } } diff --git a/vendor/simplesamlphp/simplesamlphp/modules/authorize/locales/xh/LC_MESSAGES/authorize.po b/vendor/simplesamlphp/simplesamlphp/modules/authorize/locales/xh/LC_MESSAGES/authorize.po new file mode 100644 index 0000000000..e9300be062 --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/modules/authorize/locales/xh/LC_MESSAGES/authorize.po @@ -0,0 +1,24 @@ + +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: SimpleSAMLphp 1.15\n" +"Report-Msgid-Bugs-To: simplesamlphp-translation@googlegroups.com\n" +"POT-Creation-Date: 2018-11-15 14:49+0200\n" +"PO-Revision-Date: 2018-11-15 14:49+0200\n" +"Last-Translator: \n" +"Language-Team: \n" +"Plural-Forms: nplurals=2; plural=(n != 1)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 1.3\n" + +msgid "{authorize:Authorize:403_header}" +msgstr "Ufikelelo luthintelwe" + +msgid "{authorize:Authorize:403_text}" +msgstr "" +"Awunawo amalungelo afunekayo ukuze ufikelele olu setyenziso. Nceda " +"uqhagamshelane nomlawuli ukuba ngaba ukufumanisa oku kungachanekanga." + diff --git a/vendor/simplesamlphp/simplesamlphp/modules/authorize/locales/zu/LC_MESSAGES/authorize.po b/vendor/simplesamlphp/simplesamlphp/modules/authorize/locales/zu/LC_MESSAGES/authorize.po new file mode 100644 index 0000000000..f739b05dd4 --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/modules/authorize/locales/zu/LC_MESSAGES/authorize.po @@ -0,0 +1,24 @@ + +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: SimpleSAMLphp 1.15\n" +"Report-Msgid-Bugs-To: simplesamlphp-translation@googlegroups.com\n" +"POT-Creation-Date: 2018-11-15 14:49+0200\n" +"PO-Revision-Date: 2018-11-15 14:49+0200\n" +"Last-Translator: \n" +"Language-Team: \n" +"Plural-Forms: nplurals=2; plural=(n != 1)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 1.3\n" + +msgid "{authorize:Authorize:403_header}" +msgstr "Ukufinyelela kwenqatshelwe" + +msgid "{authorize:Authorize:403_text}" +msgstr "" +"Awunawo amalungelo adingekile okufinyelela lolu hlelo. Sicela uthinte " +"umlawuli uma uthola ukuthi lokhu akulona iqiniso." + diff --git a/vendor/simplesamlphp/simplesamlphp/modules/authorize/templates/authorize_403.php b/vendor/simplesamlphp/simplesamlphp/modules/authorize/templates/authorize_403.php index ee16d96a78..d4d5b79a09 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/authorize/templates/authorize_403.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/authorize/templates/authorize_403.php @@ -13,16 +13,17 @@ $this->data['403_header'] = $this->t('{authorize:Authorize:403_header}'); $this->data['403_text'] = $this->t('{authorize:Authorize:403_text}'); +if (array_key_exists('reject_msg', $this->data)) { + if(isset($this->data['reject_msg'][$this->getLanguage()])) { + $this->data['403_text'] = $this->data['reject_msg'][$this->getLanguage()]; + } +} $this->includeAtTemplateBase('includes/header.php'); -?> -<h1><?php echo $this->data['403_header']; ?></h1> -<p><?php echo $this->data['403_text']; ?></p> -<?php -if (isset($this->data['LogoutURL'])) { -?> -<p><a href="<?php echo htmlspecialchars($this->data['LogoutURL']); ?>"><?php echo $this->t('{status:logout}'); ?></a></p> -<?php + +echo '<h1>'.$this->data['403_header'].'</h1>'; +echo '<p>'.$this->data['403_text'].'</p>'; +if (isset($this->data['logoutURL'])) { + echo '<p><a href="'.htmlspecialchars($this->data['logoutURL']).'">'.$this->t('{status:logout}').'</a></p>'; } -?> -<?php + $this->includeAtTemplateBase('includes/footer.php'); diff --git a/vendor/simplesamlphp/simplesamlphp/modules/authorize/templates/authorize_403.twig b/vendor/simplesamlphp/simplesamlphp/modules/authorize/templates/authorize_403.twig new file mode 100644 index 0000000000..52d9a24308 --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/modules/authorize/templates/authorize_403.twig @@ -0,0 +1,15 @@ +{% extends "base.twig" %} + +{% block content %} + <h1>{% trans %}{authorize:Authorize:403_header}{% endtrans %}</h1> +{% if reject_msg %} + <p>{{ reject_msg|translateFromArray }}</p> +{% else %} + <p>{% trans %}{authorize:Authorize:403_text}{% endtrans %}</p> +{% endif %} + {% if logoutURL %} + <p> + <a href="{{ logoutURL }}">{% trans %}{status:logout}{% endtrans %}</a> + </p> + {% endif %} +{% endblock%} diff --git a/vendor/simplesamlphp/simplesamlphp/modules/authorize/www/authorize_403.php b/vendor/simplesamlphp/simplesamlphp/modules/authorize/www/authorize_403.php index f3f99b25fa..032e1ecffd 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/authorize/www/authorize_403.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/authorize/www/authorize_403.php @@ -6,14 +6,20 @@ */ if (!array_key_exists('StateId', $_REQUEST)) { - throw new SimpleSAML_Error_BadRequest('Missing required StateId query parameter.'); + throw new \SimpleSAML\Error\BadRequest('Missing required StateId query parameter.'); } -$state = SimpleSAML_Auth_State::loadState($_REQUEST['StateId'], 'authorize:Authorize'); +$state = \SimpleSAML\Auth\State::loadState($_REQUEST['StateId'], 'authorize:Authorize'); -$globalConfig = SimpleSAML_Configuration::getInstance(); -$t = new SimpleSAML_XHTML_Template($globalConfig, 'authorize:authorize_403.php'); +$globalConfig = \SimpleSAML\Configuration::getInstance(); +$t = new \SimpleSAML\XHTML\Template($globalConfig, 'authorize:authorize_403.php'); if (isset($state['Source']['auth'])) { - $t->data['LogoutURL'] = SimpleSAML\Module::getModuleURL('core/authenticate.php', array('as' => $state['Source']['auth']))."&logout"; + $t->data['logoutURL'] = \SimpleSAML\Module::getModuleURL( + 'core/authenticate.php', + ['as' => $state['Source']['auth']] + )."&logout"; +} +if (isset($state['authprocAuthorize_reject_msg'])) { + $t->data['reject_msg'] = $state['authprocAuthorize_reject_msg']; } header('HTTP/1.0 403 Forbidden'); $t->show(); diff --git a/vendor/simplesamlphp/simplesamlphp/modules/authtwitter/lib/Auth/Source/Twitter.php b/vendor/simplesamlphp/simplesamlphp/modules/authtwitter/lib/Auth/Source/Twitter.php index b20a82be6a..19ff725800 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/authtwitter/lib/Auth/Source/Twitter.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/authtwitter/lib/Auth/Source/Twitter.php @@ -1,6 +1,8 @@ <?php -require_once(dirname(dirname(dirname(dirname(dirname(__FILE__))))) . '/oauth/libextinc/OAuth.php'); +namespace SimpleSAML\Module\authtwitter\Auth\Source; + +require_once(dirname(dirname(dirname(dirname(dirname(__FILE__))))).'/oauth/libextinc/OAuth.php'); /** * Authenticate using Twitter. @@ -8,124 +10,154 @@ * @author Andreas Åkre Solberg, UNINETT AS. * @package SimpleSAMLphp */ -class sspmod_authtwitter_Auth_Source_Twitter extends SimpleSAML_Auth_Source { - - /** - * The string used to identify our states. - */ - const STAGE_INIT = 'twitter:init'; - - /** - * The key of the AuthId field in the state. - */ - const AUTHID = 'twitter:AuthId'; - - private $key; - private $secret; - private $force_login; - - - /** - * Constructor for this authentication source. - * - * @param array $info Information about this authentication source. - * @param array $config Configuration. - */ - public function __construct($info, $config) { - assert('is_array($info)'); - assert('is_array($config)'); - - // Call the parent constructor first, as required by the interface - parent::__construct($info, $config); - - $configObject = SimpleSAML_Configuration::loadFromArray($config, 'authsources[' . var_export($this->authId, TRUE) . ']'); - - $this->key = $configObject->getString('key'); - $this->secret = $configObject->getString('secret'); - $this->force_login = $configObject->getBoolean('force_login', FALSE); - $this->include_email = $configObject->getBoolean('include_email', FALSE); - } - - - /** - * Log-in using Twitter platform - * - * @param array &$state Information about the current authentication. - */ - public function authenticate(&$state) { - assert('is_array($state)'); - - // We are going to need the authId in order to retrieve this authentication source later - $state[self::AUTHID] = $this->authId; - - $stateID = SimpleSAML_Auth_State::saveState($state, self::STAGE_INIT); - - $consumer = new sspmod_oauth_Consumer($this->key, $this->secret); - // Get the request token - $linkback = SimpleSAML\Module::getModuleURL('authtwitter/linkback.php', array('AuthState' => $stateID)); - $requestToken = $consumer->getRequestToken('https://api.twitter.com/oauth/request_token', array('oauth_callback' => $linkback)); - SimpleSAML\Logger::debug("Got a request token from the OAuth service provider [" . - $requestToken->key . "] with the secret [" . $requestToken->secret . "]"); - - $state['authtwitter:authdata:requestToken'] = $requestToken; - SimpleSAML_Auth_State::saveState($state, self::STAGE_INIT); - - // Authorize the request token - $url = 'https://api.twitter.com/oauth/authenticate'; - if ($this->force_login) { - $url = \SimpleSAML\Utils\HTTP::addURLParameters($url, array('force_login' => 'true')); - } - $consumer->getAuthorizeRequest($url, $requestToken); - } - - - public function finalStep(&$state) { - $requestToken = $state['authtwitter:authdata:requestToken']; - $parameters = array(); - - if (!isset($_REQUEST['oauth_token'])) { - throw new SimpleSAML_Error_BadRequest("Missing oauth_token parameter."); - } - if ($requestToken->key !== (string)$_REQUEST['oauth_token']) { - throw new SimpleSAML_Error_BadRequest("Invalid oauth_token parameter."); - } - - if (!isset($_REQUEST['oauth_verifier'])) { - throw new SimpleSAML_Error_BadRequest("Missing oauth_verifier parameter."); - } - $parameters['oauth_verifier'] = (string)$_REQUEST['oauth_verifier']; - - $consumer = new sspmod_oauth_Consumer($this->key, $this->secret); - - SimpleSAML\Logger::debug("oauth: Using this request token [" . - $requestToken->key . "] with the secret [" . $requestToken->secret . "]"); - - // Replace the request token with an access token - $accessToken = $consumer->getAccessToken('https://api.twitter.com/oauth/access_token', $requestToken, $parameters); - SimpleSAML\Logger::debug("Got an access token from the OAuth service provider [" . - $accessToken->key . "] with the secret [" . $accessToken->secret . "]"); - - $verify_credentials_url = 'https://api.twitter.com/1.1/account/verify_credentials.json'; - if ($this->include_email) { - $verify_credentials_url = $verify_credentials_url . '?include_email=true'; - } - $userdata = $consumer->getUserInfo($verify_credentials_url, $accessToken); - - if (!isset($userdata['id_str']) || !isset($userdata['screen_name'])) { - throw new SimpleSAML_Error_AuthSource($this->authId, 'Authentication error: id_str and screen_name not set.'); - } - - $attributes = array(); - foreach($userdata AS $key => $value) { - if (is_string($value)) - $attributes['twitter.' . $key] = array((string)$value); - } - - $attributes['twitter_at_screen_name'] = array('@' . $userdata['screen_name']); - $attributes['twitter_screen_n_realm'] = array($userdata['screen_name'] . '@twitter.com'); - $attributes['twitter_targetedID'] = array('http://twitter.com!' . $userdata['id_str']); - - $state['Attributes'] = $attributes; - } +class Twitter extends \SimpleSAML\Auth\Source +{ + /** + * The string used to identify our states. + */ + const STAGE_INIT = 'twitter:init'; + + /** + * The key of the AuthId field in the state. + */ + const AUTHID = 'twitter:AuthId'; + + /** + * @var string + */ + private $key; + + /** + * @var string + */ + private $secret; + + /** + * @var bool + */ + private $force_login; + + /** + * @var bool + */ + private $include_email; + + /** + * Constructor for this authentication source. + * + * @param array $info Information about this authentication source. + * @param array $config Configuration. + */ + public function __construct($info, $config) + { + assert(is_array($info)); + assert(is_array($config)); + + // Call the parent constructor first, as required by the interface + parent::__construct($info, $config); + + $configObject = \SimpleSAML\Configuration::loadFromArray( + $config, + 'authsources['.var_export($this->authId, true).']' + ); + + $this->key = $configObject->getString('key'); + $this->secret = $configObject->getString('secret'); + $this->force_login = $configObject->getBoolean('force_login', false); + $this->include_email = $configObject->getBoolean('include_email', false); + } + + /** + * Log-in using Twitter platform + * + * @param array &$state Information about the current authentication. + */ + public function authenticate(&$state) + { + assert(is_array($state)); + + // We are going to need the authId in order to retrieve this authentication source later + $state[self::AUTHID] = $this->authId; + + $stateID = \SimpleSAML\Auth\State::saveState($state, self::STAGE_INIT); + + $consumer = new \SimpleSAML\Module\oauth\Consumer($this->key, $this->secret); + // Get the request token + $linkback = \SimpleSAML\Module::getModuleURL('authtwitter/linkback.php', ['AuthState' => $stateID]); + $requestToken = $consumer->getRequestToken( + 'https://api.twitter.com/oauth/request_token', + ['oauth_callback' => $linkback] + ); + \SimpleSAML\Logger::debug("Got a request token from the OAuth service provider [". + $requestToken->key."] with the secret [".$requestToken->secret."]"); + + $state['authtwitter:authdata:requestToken'] = $requestToken; + \SimpleSAML\Auth\State::saveState($state, self::STAGE_INIT); + + // Authorize the request token + $url = 'https://api.twitter.com/oauth/authenticate'; + if ($this->force_login) { + $url = \SimpleSAML\Utils\HTTP::addURLParameters($url, ['force_login' => 'true']); + } + $consumer->getAuthorizeRequest($url, $requestToken); + } + + public function finalStep(&$state) + { + $requestToken = $state['authtwitter:authdata:requestToken']; + $parameters = []; + + if (!isset($_REQUEST['oauth_token'])) { + throw new \SimpleSAML\Error\BadRequest("Missing oauth_token parameter."); + } + if ($requestToken->key !== (string) $_REQUEST['oauth_token']) { + throw new \SimpleSAML\Error\BadRequest("Invalid oauth_token parameter."); + } + + if (!isset($_REQUEST['oauth_verifier'])) { + throw new \SimpleSAML\Error\BadRequest("Missing oauth_verifier parameter."); + } + $parameters['oauth_verifier'] = (string) $_REQUEST['oauth_verifier']; + + $consumer = new \SimpleSAML\Module\oauth\Consumer($this->key, $this->secret); + + \SimpleSAML\Logger::debug("oauth: Using this request token [". + $requestToken->key."] with the secret [".$requestToken->secret."]"); + + // Replace the request token with an access token + $accessToken = $consumer->getAccessToken( + 'https://api.twitter.com/oauth/access_token', + $requestToken, + $parameters + ); + \SimpleSAML\Logger::debug("Got an access token from the OAuth service provider [". + $accessToken->key."] with the secret [".$accessToken->secret."]"); + + $verify_credentials_url = 'https://api.twitter.com/1.1/account/verify_credentials.json'; + if ($this->include_email) { + $verify_credentials_url = $verify_credentials_url.'?include_email=true'; + } + $userdata = $consumer->getUserInfo($verify_credentials_url, $accessToken); + + if (!isset($userdata['id_str']) || !isset($userdata['screen_name'])) { + throw new \SimpleSAML\Error\AuthSource( + $this->authId, + 'Authentication error: id_str and screen_name not set.' + ); + } + + $attributes = []; + foreach ($userdata as $key => $value) { + if (is_string($value)) { + $attributes['twitter.'.$key] = [(string) $value]; + } + } + + $attributes['twitter_at_screen_name'] = ['@'.$userdata['screen_name']]; + $attributes['twitter_screen_n_realm'] = [$userdata['screen_name'].'@twitter.com']; + $attributes['twitter_targetedID'] = ['http://twitter.com!'.$userdata['id_str']]; + + $state['Attributes'] = $attributes; + } } diff --git a/vendor/simplesamlphp/simplesamlphp/modules/authtwitter/www/linkback.php b/vendor/simplesamlphp/simplesamlphp/modules/authtwitter/www/linkback.php index 2886f8d9ae..cbeed68a7b 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/authtwitter/www/linkback.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/authtwitter/www/linkback.php @@ -5,31 +5,40 @@ */ if (!array_key_exists('AuthState', $_REQUEST) || empty($_REQUEST['AuthState'])) { - throw new SimpleSAML_Error_BadRequest('Missing state parameter on twitter linkback endpoint.'); + throw new \SimpleSAML\Error\BadRequest('Missing state parameter on twitter linkback endpoint.'); } -$state = SimpleSAML_Auth_State::loadState($_REQUEST['AuthState'], sspmod_authtwitter_Auth_Source_Twitter::STAGE_INIT); +$state = \SimpleSAML\Auth\State::loadState( + $_REQUEST['AuthState'], + \SimpleSAML\Module\authtwitter\Auth\Source\Twitter::STAGE_INIT +); // Find authentication source -if (!array_key_exists(sspmod_authtwitter_Auth_Source_Twitter::AUTHID, $state)) { - throw new SimpleSAML_Error_BadRequest('No data in state for ' . sspmod_authtwitter_Auth_Source_Twitter::AUTHID); +if (!array_key_exists(\SimpleSAML\Module\authtwitter\Auth\Source\Twitter::AUTHID, $state)) { + throw new \SimpleSAML\Error\BadRequest( + 'No data in state for '.\SimpleSAML\Module\authtwitter\Auth\Source\Twitter::AUTHID + ); } -$sourceId = $state[sspmod_authtwitter_Auth_Source_Twitter::AUTHID]; +$sourceId = $state[\SimpleSAML\Module\authtwitter\Auth\Source\Twitter::AUTHID]; -$source = SimpleSAML_Auth_Source::getById($sourceId); -if ($source === NULL) { - throw new SimpleSAML_Error_BadRequest('Could not find authentication source with id ' . var_export($sourceId, TRUE)); +$source = \SimpleSAML\Auth\Source::getById($sourceId); +if ($source === null) { + throw new \SimpleSAML\Error\BadRequest( + 'Could not find authentication source with id '.var_export($sourceId, true) + ); } try { - if (array_key_exists('denied', $_REQUEST)) { - throw new SimpleSAML_Error_UserAborted(); - } - - $source->finalStep($state); -} catch (SimpleSAML_Error_Exception $e) { - SimpleSAML_Auth_State::throwException($state, $e); -} catch (Exception $e) { - SimpleSAML_Auth_State::throwException($state, new SimpleSAML_Error_AuthSource($sourceId, 'Error on authtwitter linkback endpoint.', $e)); + if (array_key_exists('denied', $_REQUEST)) { + throw new \SimpleSAML\Error\UserAborted(); + } + $source->finalStep($state); +} catch (\SimpleSAML\Error\Exception $e) { + \SimpleSAML\Auth\State::throwException($state, $e); +} catch (\Exception $e) { + \SimpleSAML\Auth\State::throwException( + $state, + new \SimpleSAML\Error\AuthSource($sourceId, 'Error on authtwitter linkback endpoint.', $e) + ); } -SimpleSAML_Auth_Source::completeAuth($state); +\SimpleSAML\Auth\Source::completeAuth($state); diff --git a/vendor/simplesamlphp/simplesamlphp/modules/authwindowslive/docs/windowsliveid.md b/vendor/simplesamlphp/simplesamlphp/modules/authwindowslive/docs/windowsliveid.md index 390edae293..b80116cf3a 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/authwindowslive/docs/windowsliveid.md +++ b/vendor/simplesamlphp/simplesamlphp/modules/authwindowslive/docs/windowsliveid.md @@ -1,12 +1,14 @@ Using the Windows Live ID authentication source with SimpleSAMLphp ================================================================== +This module works around the limitation in Microsoft Online/Azure OIDC implementation of not supplying the OIDC userinfo endpoint. +Microsoft explains the omission by suggesting that the Graph API can produce anything userinfo would have brought, in place. Remember to configure `authsources.php`, with both your Client ID and Secret key. To get an API key and a secret, register the application at: - * <http://msdn.microsoft.com/en-us/library/ff751474.aspx> - * <https://manage.dev.live.com> + * <https://msdn.microsoft.com/en-us/library/ff751474.aspx> + * <https://apps.dev.microsoft.com/> ## Testing authentication diff --git a/vendor/simplesamlphp/simplesamlphp/modules/authwindowslive/lib/Auth/Source/LiveID.php b/vendor/simplesamlphp/simplesamlphp/modules/authwindowslive/lib/Auth/Source/LiveID.php index 8de392c228..3f4dc5446d 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/authwindowslive/lib/Auth/Source/LiveID.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/authwindowslive/lib/Auth/Source/LiveID.php @@ -1,5 +1,7 @@ <?php +namespace SimpleSAML\Module\authwindowslive\Auth\Source; + /** * Authenticate using LiveID. * @@ -7,9 +9,8 @@ * @author Guy Halse, TENET. * @package SimpleSAMLphp */ -class sspmod_authwindowslive_Auth_Source_LiveID extends SimpleSAML_Auth_Source +class LiveID extends \SimpleSAML\Auth\Source { - /** * The string used to identify our states. */ @@ -23,37 +24,35 @@ class sspmod_authwindowslive_Auth_Source_LiveID extends SimpleSAML_Auth_Source private $key; private $secret; - /** * Constructor for this authentication source. * * @param array $info Information about this authentication source. * @param array $config Configuration. * - * @throws Exception In case of misconfiguration. + * @throws \Exception In case of misconfiguration. */ public function __construct($info, $config) { - assert('is_array($info)'); - assert('is_array($config)'); + assert(is_array($info)); + assert(is_array($config)); // Call the parent constructor first, as required by the interface parent::__construct($info, $config); if (!array_key_exists('key', $config)) { - throw new Exception('LiveID authentication source is not properly configured: missing [key]'); + throw new \Exception('LiveID authentication source is not properly configured: missing [key]'); } $this->key = $config['key']; if (!array_key_exists('secret', $config)) { - throw new Exception('LiveID authentication source is not properly configured: missing [secret]'); + throw new \Exception('LiveID authentication source is not properly configured: missing [secret]'); } $this->secret = $config['secret']; } - /** * Log-in using LiveID platform * @@ -61,59 +60,58 @@ public function __construct($info, $config) */ public function authenticate(&$state) { - assert('is_array($state)'); + assert(is_array($state)); // we are going to need the authId in order to retrieve this authentication source later $state[self::AUTHID] = $this->authId; - $stateID = SimpleSAML_Auth_State::saveState($state, self::STAGE_INIT); + $stateID = \SimpleSAML\Auth\State::saveState($state, self::STAGE_INIT); - SimpleSAML\Logger::debug('authwindowslive auth state id = ' . $stateID); + \SimpleSAML\Logger::debug('authwindowslive auth state id = '.$stateID); // authenticate the user // documentation at: // https://azure.microsoft.com/en-us/documentation/articles/active-directory-v2-protocols-oauth-code/ - $authorizeURL = 'https://login.microsoftonline.com/common/oauth2/v2.0/authorize' - . '?client_id=' . $this->key - . '&response_type=code' - . '&response_mode=query' - . '&redirect_uri=' . urlencode(SimpleSAML\Module::getModuleUrl('authwindowslive') . '/linkback.php') - . '&state=' . urlencode($stateID) - . '&scope=' . urlencode('openid https://graph.microsoft.com/user.read') + $authorizeURL = 'https://login.microsoftonline.com/common/oauth2/v2.0/authorize'. + '?client_id='.$this->key. + '&response_type=code'. + '&response_mode=query'. + '&redirect_uri='.urlencode(\SimpleSAML\Module::getModuleURL('authwindowslive').'/linkback.php'). + '&state='.urlencode($stateID). + '&scope='.urlencode('openid https://graph.microsoft.com/user.read') ; \SimpleSAML\Utils\HTTP::redirectTrustedURL($authorizeURL); } - /** * @param $state * - * @throws Exception + * @throws \Exception */ public function finalStep(&$state) { - SimpleSAML\Logger::debug( + \SimpleSAML\Logger::debug( "authwindowslive oauth: Using this verification code [".$state['authwindowslive:verification_code']."]" ); // retrieve Access Token // documentation at: // https://azure.microsoft.com/en-us/documentation/articles/active-directory-v2-protocols-oauth-code/#request-an-access-token - $postData = 'client_id=' . urlencode($this->key) - . '&client_secret=' . urlencode($this->secret) - . '&scope=' . urlencode('https://graph.microsoft.com/user.read') - . '&grant_type=authorization_code' - . '&redirect_uri=' . urlencode(SimpleSAML\Module::getModuleUrl('authwindowslive') . '/linkback.php') - . '&code=' . urlencode($state['authwindowslive:verification_code']); - - $context = array( - 'http' => array( - 'method' => 'POST', - 'header' => 'Content-type: application/x-www-form-urlencoded', + $postData = 'client_id='.urlencode($this->key). + '&client_secret='.urlencode($this->secret). + '&scope='.urlencode('https://graph.microsoft.com/user.read'). + '&grant_type=authorization_code'. + '&redirect_uri='.urlencode(\SimpleSAML\Module::getModuleURL('authwindowslive').'/linkback.php'). + '&code='.urlencode($state['authwindowslive:verification_code']); + + $context = [ + 'http' => [ + 'method' => 'POST', + 'header' => 'Content-type: application/x-www-form-urlencoded', 'content' => $postData, - ), - ); + ], + ]; $result = \SimpleSAML\Utils\HTTP::fetch('https://login.microsoftonline.com/common/oauth2/v2.0/token', $context); @@ -121,41 +119,43 @@ public function finalStep(&$state) // error checking of $response to make sure we can proceed if (!array_key_exists('access_token', $response)) { - throw new Exception( + throw new \Exception( '['.$response['error'].'] '.$response['error_description']. - "\r\nNo access_token returned - cannot proceed\r\n" . implode(', ', $response['error_codes']) + "\r\nNo access_token returned - cannot proceed\r\n".implode(', ', $response['error_codes']) ); } - SimpleSAML\Logger::debug( + \SimpleSAML\Logger::debug( "authwindowslive: Got an access token from the OAuth service provider [".$response['access_token']."]" ); // documentation at: http://graph.microsoft.io/en-us/docs/overview/call_api - $opts = array('http' => array('header' => "Accept: application/json\r\nAuthorization: Bearer ". - $response['access_token']."\r\n")); + $opts = [ + 'http' => ['header' => "Accept: application/json\r\nAuthorization: Bearer ". + $response['access_token']."\r\n"] + ]; $data = \SimpleSAML\Utils\HTTP::fetch('https://graph.microsoft.com/v1.0/me', $opts); $userdata = json_decode($data, true); // this is the simplest case if (!array_key_exists('@odata.context', $userdata) || array_key_exists('error', $userdata)) { - throw new Exception( + throw new \Exception( 'Unable to retrieve userdata from Microsoft Graph ['.$userdata['error']['code'].'] '. $userdata['error']['message'] ); } - $attributes = array(); - $attributes['windowslive_targetedID'] = array( + $attributes = []; + $attributes['windowslive_targetedID'] = [ 'https://graph.microsoft.com!'.(!empty($userdata['id']) ? $userdata['id'] : 'unknown') - ); + ]; foreach ($userdata as $key => $value) { if (is_string($value)) { - $attributes['windowslive.' . $key] = array((string)$value); + $attributes['windowslive.'.$key] = [(string) $value]; } } - SimpleSAML\Logger::debug('LiveID Returned Attributes: '. implode(", ", array_keys($attributes))); + \SimpleSAML\Logger::debug('LiveID Returned Attributes: '.implode(", ", array_keys($attributes))); $state['Attributes'] = $attributes; } diff --git a/vendor/simplesamlphp/simplesamlphp/modules/authwindowslive/www/linkback.php b/vendor/simplesamlphp/simplesamlphp/modules/authwindowslive/www/linkback.php index 396de53454..758bdd215f 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/authwindowslive/www/linkback.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/authwindowslive/www/linkback.php @@ -5,9 +5,12 @@ */ if (!array_key_exists('state', $_REQUEST)) { - throw new Exception('Lost OAuth Client State'); + throw new \Exception('Lost OAuth Client State'); } -$state = SimpleSAML_Auth_State::loadState($_REQUEST['state'], sspmod_authwindowslive_Auth_Source_LiveID::STAGE_INIT); +$state = \SimpleSAML\Auth\State::loadState( + $_REQUEST['state'], + \SimpleSAML\Module\authwindowslive\Auth\Source\LiveID::STAGE_INIT +); // http://msdn.microsoft.com/en-us/library/ff749771.aspx if (array_key_exists('code', $_REQUEST)) { @@ -24,23 +27,23 @@ // to preserve support for this, so this is left in as a placeholder. // redirect them to their original page so they can choose another auth mechanism if ($_REQUEST['error'] === 'user_denied') { - $e = new SimpleSAML_Error_UserAborted(); - SimpleSAML_Auth_State::throwException($state, $e); + $e = new \SimpleSAML\Error\UserAborted(); + \SimpleSAML\Auth\State::throwException($state, $e); } // error - throw new Exception('Authentication failed: ['.$_REQUEST['error'].'] '.$_REQUEST['error_description']); + throw new \Exception('Authentication failed: ['.$_REQUEST['error'].'] '.$_REQUEST['error_description']); } // find authentication source -assert('array_key_exists(sspmod_authwindowslive_Auth_Source_LiveID::AUTHID, $state)'); -$sourceId = $state[sspmod_authwindowslive_Auth_Source_LiveID::AUTHID]; +assert(array_key_exists(\SimpleSAML\Module\authwindowslive\Auth\Source\LiveID::AUTHID, $state)); +$sourceId = $state[\SimpleSAML\Module\authwindowslive\Auth\Source\LiveID::AUTHID]; -$source = SimpleSAML_Auth_Source::getById($sourceId); +$source = \SimpleSAML\Auth\Source::getById($sourceId); if ($source === null) { - throw new Exception('Could not find authentication source with id '.$sourceId); + throw new \Exception('Could not find authentication source with id '.$sourceId); } $source->finalStep($state); -SimpleSAML_Auth_Source::completeAuth($state); +\SimpleSAML\Auth\Source::completeAuth($state); diff --git a/vendor/simplesamlphp/simplesamlphp/modules/cas/lib/Auth/Source/CAS.php b/vendor/simplesamlphp/simplesamlphp/modules/cas/lib/Auth/Source/CAS.php index 1b2f1e0c91..08f153c130 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/cas/lib/Auth/Source/CAS.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/cas/lib/Auth/Source/CAS.php @@ -1,5 +1,7 @@ <?php +namespace SimpleSAML\Module\cas\Auth\Source; + /** * Authenticate using CAS. * @@ -8,228 +10,245 @@ * @author Danny Bollaert, UGent. * @package SimpleSAMLphp */ -class sspmod_cas_Auth_Source_CAS extends SimpleSAML_Auth_Source { - - /** - * The string used to identify our states. - */ - const STAGE_INIT = 'sspmod_cas_Auth_Source_CAS.state'; - - /** - * The key of the AuthId field in the state. - */ - const AUTHID = 'sspmod_cas_Auth_Source_CAS.AuthId'; - - - /** - * @var array with ldap configuration - */ - private $_ldapConfig; - - /** - * @var cas configuration - */ - private $_casConfig; - - /** - * @var cas chosen validation method - */ - private $_validationMethod; - /** - * @var cas login method - */ - private $_loginMethod; - - - /** - * Constructor for this authentication source. - * - * @param array $info Information about this authentication source. - * @param array $config Configuration. - */ - public function __construct($info, $config) { - assert('is_array($info)'); - assert('is_array($config)'); - - // Call the parent constructor first, as required by the interface - parent::__construct($info, $config); - - if (!array_key_exists('cas', $config)){ - throw new Exception('cas authentication source is not properly configured: missing [cas]'); - } - - if (!array_key_exists('ldap', $config)){ - throw new Exception('ldap authentication source is not properly configured: missing [ldap]'); - } - - $this->_casConfig = $config['cas']; - $this->_ldapConfig = $config['ldap']; - - if(isset($this->_casConfig['serviceValidate'])){ - $this->_validationMethod = 'serviceValidate'; - }elseif(isset($this->_casConfig['validate'])){ - $this->_validationMethod = 'validate'; - }else{ - throw new Exception("validate or serviceValidate not specified"); - } - - if(isset($this->_casConfig['login'])){ - $this->_loginMethod = $this->_casConfig['login']; - }else{ - throw new Exception("cas login URL not specified"); - } - } - - - /** - * This the most simple version of validating, this provides only authentication validation - * - * @param string $ticket - * @param string $service - * @return list username and attributes - */ - private function casValidate($ticket, $service){ - $url = \SimpleSAML\Utils\HTTP::addURLParameters($this->_casConfig['validate'], array( - 'ticket' => $ticket, - 'service' => $service, - )); - $result = \SimpleSAML\Utils\HTTP::fetch($url); - $res = preg_split("/\r?\n/",$result); - - if (strcmp($res[0], "yes") == 0) { - return array($res[1], array()); - } else { - throw new Exception("Failed to validate CAS service ticket: $ticket"); - } - } - - - /** - * Uses the cas service validate, this provides additional attributes - * - * @param string $ticket - * @param string $service - * @return list username and attributes - */ - private function casServiceValidate($ticket, $service){ - $url = \SimpleSAML\Utils\HTTP::addURLParameters($this->_casConfig['serviceValidate'], array( - 'ticket' => $ticket, - 'service' => $service, - )); - $result = \SimpleSAML\Utils\HTTP::fetch($url); - - $dom = \SAML2\DOMDocumentFactory::fromString($result); - $xPath = new DOMXpath($dom); - $xPath->registerNamespace("cas", 'http://www.yale.edu/tp/cas'); - $success = $xPath->query("/cas:serviceResponse/cas:authenticationSuccess/cas:user"); - if ($success->length == 0) { - $failure = $xPath->evaluate("/cas:serviceResponse/cas:authenticationFailure"); - throw new Exception("Error when validating CAS service ticket: " . $failure->item(0)->textContent); - } else { - - $attributes = array(); - if ($casattributes = $this->_casConfig['attributes']) { # some has attributes in the xml - attributes is a list of XPath expressions to get them - foreach ($casattributes as $name => $query) { - $attrs = $xPath->query($query); - foreach ($attrs as $attrvalue) $attributes[$name][] = $attrvalue->textContent; - } - } - $casusername = $success->item(0)->textContent; - - return array($casusername, $attributes); - - } - } - - - /** - * Main validation method, redirects to correct method - * (keeps finalStep clean) - * - * @param string $ticket - * @param string $service - * @return list username and attributes - */ - protected function casValidation($ticket, $service){ - switch($this->_validationMethod){ - case 'validate': - return $this->casValidate($ticket, $service); - break; - case 'serviceValidate': - return $this->casServiceValidate($ticket, $service); - break; - default: - throw new Exception("validate or serviceValidate not specified"); - } - } - - - /** - * Called by linkback, to finish validate/ finish logging in. - * @param state $state - * @return list username, casattributes/ldap attributes - */ - public function finalStep(&$state) { - - - $ticket = $state['cas:ticket']; - $stateID = SimpleSAML_Auth_State::saveState($state, self::STAGE_INIT); - $service = SimpleSAML\Module::getModuleURL('cas/linkback.php', array('stateID' => $stateID)); - list($username, $casattributes) = $this->casValidation($ticket, $service); - $ldapattributes = array(); - if ($this->_ldapConfig['servers']) { - $ldap = new SimpleSAML_Auth_LDAP($this->_ldapConfig['servers'], $this->_ldapConfig['enable_tls']); - $ldapattributes = $ldap->validate($this->_ldapConfig, $username); - } - $attributes = array_merge_recursive($casattributes, $ldapattributes); - $state['Attributes'] = $attributes; - - SimpleSAML_Auth_Source::completeAuth($state); - } - - - /** - * Log-in using cas - * - * @param array &$state Information about the current authentication. - */ - public function authenticate(&$state) { - assert('is_array($state)'); - - // We are going to need the authId in order to retrieve this authentication source later - $state[self::AUTHID] = $this->authId; - - $stateID = SimpleSAML_Auth_State::saveState($state, self::STAGE_INIT); - - - - $serviceUrl = SimpleSAML\Module::getModuleURL('cas/linkback.php', array('stateID' => $stateID)); - - \SimpleSAML\Utils\HTTP::redirectTrustedURL($this->_loginMethod, array( - 'service' => $serviceUrl)); - } - - - /** - * Log out from this authentication source. - * - * This function should be overridden if the authentication source requires special - * steps to complete a logout operation. - * - * If the logout process requires a redirect, the state should be saved. Once the - * logout operation is completed, the state should be restored, and completeLogout - * should be called with the state. If this operation can be completed without - * showing the user a page, or redirecting, this function should return. - * - * @param array &$state Information about the current logout operation. - */ - public function logout(&$state) { - assert('is_array($state)'); - $logoutUrl = $this->_casConfig['logout']; - - SimpleSAML_Auth_State::deleteState($state); - // we want cas to log us out - \SimpleSAML\Utils\HTTP::redirectTrustedURL($logoutUrl); - } +class CAS extends \SimpleSAML\Auth\Source +{ + /** + * The string used to identify our states. + */ + const STAGE_INIT = '\SimpleSAML\Module\cas\Auth\Source\CAS.state'; + + /** + * The key of the AuthId field in the state. + */ + const AUTHID = '\SimpleSAML\Module\cas\Auth\Source\CAS.AuthId'; + + /** + * @var array with ldap configuration + */ + private $ldapConfig; + + /** + * @var cas configuration + */ + private $casConfig; + + /** + * @var string cas chosen validation method + */ + + private $validationMethod; + + /** + * @var string cas login method + */ + private $loginMethod; + + /** + * Constructor for this authentication source. + * + * @param array $info Information about this authentication source. + * @param array $config Configuration. + */ + public function __construct($info, $config) + { + assert(is_array($info)); + assert(is_array($config)); + + // Call the parent constructor first, as required by the interface + parent::__construct($info, $config); + + if (!array_key_exists('cas', $config)) { + throw new \Exception('cas authentication source is not properly configured: missing [cas]'); + } + + if (!array_key_exists('ldap', $config)) { + throw new \Exception('ldap authentication source is not properly configured: missing [ldap]'); + } + + $this->casConfig = $config['cas']; + $this->ldapConfig = $config['ldap']; + + if (isset($this->casConfig['serviceValidate'])) { + $this->validationMethod = 'serviceValidate'; + } elseif (isset($this->casConfig['validate'])) { + $this->validationMethod = 'validate'; + } else { + throw new \Exception("validate or serviceValidate not specified"); + } + + if (isset($this->casConfig['login'])) { + $this->loginMethod = $this->casConfig['login']; + } else { + throw new \Exception("cas login URL not specified"); + } + } + + + /** + * This the most simple version of validating, this provides only authentication validation + * + * @param string $ticket + * @param string $service + * + * @return array username and attributes + */ + private function casValidate($ticket, $service) + { + $url = \SimpleSAML\Utils\HTTP::addURLParameters($this->casConfig['validate'], [ + 'ticket' => $ticket, + 'service' => $service, + ]); + $result = \SimpleSAML\Utils\HTTP::fetch($url); + $res = preg_split("/\r?\n/", $result); + + if (strcmp($res[0], "yes") == 0) { + return [$res[1], []]; + } else { + throw new \Exception("Failed to validate CAS service ticket: $ticket"); + } + } + + + /** + * Uses the cas service validate, this provides additional attributes + * + * @param string $ticket + * @param string $service + * + * @return array username and attributes + */ + private function casServiceValidate($ticket, $service) + { + $url = \SimpleSAML\Utils\HTTP::addURLParameters( + $this->casConfig['serviceValidate'], + [ + 'ticket' => $ticket, + 'service' => $service, + ] + ); + $result = \SimpleSAML\Utils\HTTP::fetch($url); + + $dom = \SAML2\DOMDocumentFactory::fromString($result); + $xPath = new \DOMXpath($dom); + $xPath->registerNamespace("cas", 'http://www.yale.edu/tp/cas'); + $success = $xPath->query("/cas:serviceResponse/cas:authenticationSuccess/cas:user"); + if ($success->length == 0) { + $failure = $xPath->evaluate("/cas:serviceResponse/cas:authenticationFailure"); + throw new \Exception("Error when validating CAS service ticket: ".$failure->item(0)->textContent); + } else { + $attributes = []; + if ($casattributes = $this->casConfig['attributes']) { + // Some has attributes in the xml - attributes is a list of XPath expressions to get them + foreach ($casattributes as $name => $query) { + $attrs = $xPath->query($query); + foreach ($attrs as $attrvalue) { + $attributes[$name][] = $attrvalue->textContent; + } + } + } + $casusername = $success->item(0)->textContent; + + return [$casusername, $attributes]; + } + } + + + /** + * Main validation method, redirects to correct method + * (keeps finalStep clean) + * + * @param string $ticket + * @param string $service + * @return array username and attributes + */ + protected function casValidation($ticket, $service) + { + switch ($this->validationMethod) { + case 'validate': + return $this->casValidate($ticket, $service); + case 'serviceValidate': + return $this->casServiceValidate($ticket, $service); + default: + throw new \Exception("validate or serviceValidate not specified"); + } + } + + + /** + * Called by linkback, to finish validate/ finish logging in. + * @param array $state + */ + public function finalStep(&$state) + { + $ticket = $state['cas:ticket']; + $stateID = \SimpleSAML\Auth\State::saveState($state, self::STAGE_INIT); + $service = \SimpleSAML\Module::getModuleURL('cas/linkback.php', ['stateID' => $stateID]); + list($username, $casattributes) = $this->casValidation($ticket, $service); + $ldapattributes = []; + + $config = \SimpleSAML\Configuration::loadFromArray( + $this->ldapConfig, + 'Authentication source '.var_export($this->authId, true) + ); + if ($this->ldapConfig['servers']) { + $ldap = new \SimpleSAML\Auth\LDAP( + $config->getString('servers'), + $config->getBoolean('enable_tls', false), + $config->getBoolean('debug', false), + $config->getInteger('timeout', 0), + $config->getInteger('port', 389), + $config->getBoolean('referrals', true) + ); + $ldapattributes = $ldap->validate($this->ldapConfig, $username); + } + $attributes = array_merge_recursive($casattributes, $ldapattributes); + $state['Attributes'] = $attributes; + + \SimpleSAML\Auth\Source::completeAuth($state); + } + + + /** + * Log-in using cas + * + * @param array &$state Information about the current authentication. + */ + public function authenticate(&$state) + { + assert(is_array($state)); + + // We are going to need the authId in order to retrieve this authentication source later + $state[self::AUTHID] = $this->authId; + + $stateID = \SimpleSAML\Auth\State::saveState($state, self::STAGE_INIT); + + $serviceUrl = \SimpleSAML\Module::getModuleURL('cas/linkback.php', ['stateID' => $stateID]); + + \SimpleSAML\Utils\HTTP::redirectTrustedURL($this->loginMethod, ['service' => $serviceUrl]); + } + + + /** + * Log out from this authentication source. + * + * This function should be overridden if the authentication source requires special + * steps to complete a logout operation. + * + * If the logout process requires a redirect, the state should be saved. Once the + * logout operation is completed, the state should be restored, and completeLogout + * should be called with the state. If this operation can be completed without + * showing the user a page, or redirecting, this function should return. + * + * @param array &$state Information about the current logout operation. + */ + public function logout(&$state) + { + assert(is_array($state)); + $logoutUrl = $this->casConfig['logout']; + + \SimpleSAML\Auth\State::deleteState($state); + // we want cas to log us out + \SimpleSAML\Utils\HTTP::redirectTrustedURL($logoutUrl); + } } diff --git a/vendor/simplesamlphp/simplesamlphp/modules/cas/www/linkback.php b/vendor/simplesamlphp/simplesamlphp/modules/cas/www/linkback.php index c32ba477cd..366583c8a7 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/cas/www/linkback.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/cas/www/linkback.php @@ -5,24 +5,22 @@ */ if (!isset($_GET['stateID'])) { - throw new SimpleSAML_Error_BadRequest('Missing stateID parameter.'); + throw new \SimpleSAML\Error\BadRequest('Missing stateID parameter.'); } -$state = SimpleSAML_Auth_State::loadState($_GET['stateID'], sspmod_cas_Auth_Source_CAS::STAGE_INIT); +$state = \SimpleSAML\Auth\State::loadState($_GET['stateID'], \SimpleSAML\Module\cas\Auth\Source\CAS::STAGE_INIT); if (!isset($_GET['ticket'])) { - throw new SimpleSAML_Error_BadRequest('Missing ticket parameter.'); + throw new \SimpleSAML\Error\BadRequest('Missing ticket parameter.'); } -$state['cas:ticket'] = (string)$_GET['ticket']; +$state['cas:ticket'] = (string) $_GET['ticket']; // Find authentication source -assert('array_key_exists(sspmod_cas_Auth_Source_CAS::AUTHID, $state)'); -$sourceId = $state[sspmod_cas_Auth_Source_CAS::AUTHID]; +assert(array_key_exists(\SimpleSAML\Module\cas\Auth\Source\CAS::AUTHID, $state)); +$sourceId = $state[\SimpleSAML\Module\cas\Auth\Source\CAS::AUTHID]; -$source = SimpleSAML_Auth_Source::getById($sourceId); -if ($source === NULL) { - throw new Exception('Could not find authentication source with id ' . $sourceId); +$source = \SimpleSAML\Auth\Source::getById($sourceId); +if ($source === null) { + throw new \Exception('Could not find authentication source with id '.$sourceId); } $source->finalStep($state); - - diff --git a/vendor/simplesamlphp/simplesamlphp/modules/casserver/config-templates/module_casserver.php b/vendor/simplesamlphp/simplesamlphp/modules/casserver/config-templates/module_casserver.php deleted file mode 100644 index fab96fbbf4..0000000000 --- a/vendor/simplesamlphp/simplesamlphp/modules/casserver/config-templates/module_casserver.php +++ /dev/null @@ -1,21 +0,0 @@ -<?php -/* - * Configuration for the module casserver. - */ - -$config = array ( - - 'legal_service_urls' => array( - 'http://test.feide.no/casclient', - 'http://test.feide.no/cas2', - ), - - // Legal values: saml2, shib13 - 'auth' => 'saml2', - - 'ticketcache' => 'ticketcache', - - 'attrname' => 'mail', // 'eduPersonPrincipalName', - #'attributes' => TRUE, // enable transfer of attributes - -); diff --git a/vendor/simplesamlphp/simplesamlphp/modules/casserver/default-disable b/vendor/simplesamlphp/simplesamlphp/modules/casserver/default-disable deleted file mode 100644 index fa0bd82e2d..0000000000 --- a/vendor/simplesamlphp/simplesamlphp/modules/casserver/default-disable +++ /dev/null @@ -1,3 +0,0 @@ -This file indicates that the default state of this module -is disabled. To enable, create a file named enable in the -same directory as this file. diff --git a/vendor/simplesamlphp/simplesamlphp/modules/casserver/www/cas.php b/vendor/simplesamlphp/simplesamlphp/modules/casserver/www/cas.php deleted file mode 100644 index 5b9d16badd..0000000000 --- a/vendor/simplesamlphp/simplesamlphp/modules/casserver/www/cas.php +++ /dev/null @@ -1,34 +0,0 @@ -<?php - -/* - * Frontend for login.php, proxy.php, validate.php and serviceValidate.php. It allows them to be called - * as cas.php/login, cas.php/validate and cas.php/serviceValidate and is meant for clients - * like phpCAS which expects one configured prefix which it appends login, validate and - * serviceValidate to. - * - * This version supports CAS proxying. As SSP controls the user session (TGT in CAS parlance) - * and the CASServer as a backend/proxy server is not aware of termination of the session the Proxy- - * Granting-Tickets (PGT) issued have a very short ttl - pt. 60 secs. - * - * ServiceTickets (SP) and ProxyTickets (PT) now have a 5 secs ttl. - * - * Proxyed services (targetService) shall be present in the legal_service_urls config. - * - */ - - -$validFunctions = array( - 'login' => 'login', - 'proxy' => 'proxy', - 'validate' => 'serviceValidate', - 'serviceValidate' => 'serviceValidate', - 'proxyValidate' => 'serviceValidate' -); - -$function = substr($_SERVER['PATH_INFO'], 1); - -if (!isset($validFunctions[$function])) { - throw new SimpleSAML_Error_NotFound('Not a valid function for cas.php.'); -} - -include($validFunctions[$function].".php"); diff --git a/vendor/simplesamlphp/simplesamlphp/modules/casserver/www/login.php b/vendor/simplesamlphp/simplesamlphp/modules/casserver/www/login.php deleted file mode 100644 index fd55f05eb8..0000000000 --- a/vendor/simplesamlphp/simplesamlphp/modules/casserver/www/login.php +++ /dev/null @@ -1,55 +0,0 @@ -<?php -require 'tickets.php'; - -/* - * Incoming parameters: - * service - * renew - * gateway - * - */ - -if (!array_key_exists('service', $_GET)) - throw new Exception('Required URL query parameter [service] not provided. (CAS Server)'); - -$service = $_GET['service']; - -$forceAuthn =isset($_GET['renew']) && $_GET['renew']; -$isPassive = isset($_GET['gateway']) && $_GET['gateway']; - -$config = SimpleSAML_Configuration::getInstance(); -$casconfig = SimpleSAML_Configuration::getConfig('module_casserver.php'); - -$legal_service_urls = $casconfig->getValue('legal_service_urls'); -if (!checkServiceURL($service, $legal_service_urls)) - throw new Exception('Service parameter provided to CAS server is not listed as a legal service: [service] = ' . $service); - -$auth = $casconfig->getValue('auth', 'saml2'); -if (!in_array($auth, array('saml2', 'shib13'), true)) - throw new Exception('CAS Service configured to use [auth] = ' . $auth . ' only [saml2,shib13] is legal.'); - -$as = new \SimpleSAML\Auth\Simple($auth); -if (!$as->isAuthenticated()) { - $params = array( - 'ForceAuthn' => $forceAuthn, - 'isPassive' => $isPassive, - ); - $as->login($params); -} - -$attributes = $as->getAttributes(); - -$path = $casconfig->resolvePath($casconfig->getValue('ticketcache', '/tmp')); - -$ticket = str_replace( '_', 'ST-', SimpleSAML\Utils\Random::generateID() ); -storeTicket($ticket, $path, array('service' => $service, - 'forceAuthn' => $forceAuthn, - 'attributes' => $attributes, - 'proxies' => array(), - 'validbefore' => time() + 5)); - -\SimpleSAML\Utils\HTTP::redirectTrustedURL( - \SimpleSAML\Utils\HTTP::addURLParameters($service, - array('ticket' => $ticket) - ) -); \ No newline at end of file diff --git a/vendor/simplesamlphp/simplesamlphp/modules/casserver/www/proxy.php b/vendor/simplesamlphp/simplesamlphp/modules/casserver/www/proxy.php deleted file mode 100644 index 6fc14e4a31..0000000000 --- a/vendor/simplesamlphp/simplesamlphp/modules/casserver/www/proxy.php +++ /dev/null @@ -1,53 +0,0 @@ -<?php -require 'tickets.php'; - -/* - * Incoming parameters: - * targetService - * ptg - * - */ - -if (array_key_exists('targetService', $_GET)) { - $targetService = $_GET['targetService']; - $pgt = $_GET['pgt']; -} else { - throw new Exception('Required URL query parameter [targetService] not provided. (CAS Server)'); -} - -$casconfig = SimpleSAML_Configuration::getConfig('module_casserver.php'); - -$legal_service_urls = $casconfig->getValue('legal_service_urls'); - -if (!checkServiceURL($targetService, $legal_service_urls)) - throw new Exception('Service parameter provided to CAS server is not listed as a legal service: [service] = ' . $service); - -$path = $casconfig->resolvePath($casconfig->getValue('ticketcache', 'ticketcache')); - -$ticket = retrieveTicket($pgt, $path, false); -if ($ticket['validbefore'] > time()) { - $pt = str_replace( '_', 'PT-', SimpleSAML\Utils\Random::generateID() ); - storeTicket($pt, $path, array( - 'service' => $targetService, - 'forceAuthn' => false, - 'attributes' => $ticket['attributes'], - 'proxies' => $ticket['proxies'], - 'validbefore' => time() + 5) - ); - -print <<<eox -<cas:serviceResponse xmlns:cas='http://www.yale.edu/tp/cas'> - <cas:proxySuccess> - <cas:proxyTicket>$pt</cas:proxyTicket> - </cas:proxySuccess> -</cas:serviceResponse> -eox; -} else { -print <<<eox -<cas:serviceResponse xmlns:cas='http://www.yale.edu/tp/cas'> - <cas:proxyFailure code="INVALID_REQUEST"> - Proxygranting ticket to old - ssp casserver only supports shortlived (30 secs) pgts. - </cas:proxyFailure> -</cas:serviceResponse> -eox; -} \ No newline at end of file diff --git a/vendor/simplesamlphp/simplesamlphp/modules/casserver/www/serviceValidate.php b/vendor/simplesamlphp/simplesamlphp/modules/casserver/www/serviceValidate.php deleted file mode 100644 index cf4bd0af22..0000000000 --- a/vendor/simplesamlphp/simplesamlphp/modules/casserver/www/serviceValidate.php +++ /dev/null @@ -1,99 +0,0 @@ -<?php -require 'tickets.php'; - -# set manually if called directly - ie not included from validate.php or cas.php -if (!$function) $function = 'serviceValidate'; - -/* - * Incoming parameters: - * service - * renew - * ticket - * - */ - -if (array_key_exists('service', $_GET)) { - $service = $_GET['service']; - $ticket = $_GET['ticket']; - $forceAuthn = isset($_GET['renew']) && $_GET['renew']; -} else { - throw new Exception('Required URL query parameter [service] not provided. (CAS Server)'); -} - -try { -// Load SimpleSAMLphp, configuration and metadata - $casconfig = SimpleSAML_Configuration::getConfig('module_casserver.php'); - - $path = $casconfig->resolvePath($casconfig->getValue('ticketcache', 'ticketcache')); - $ticketcontent = retrieveTicket($ticket, $path); - - $usernamefield = $casconfig->getValue('attrname', 'eduPersonPrincipalName'); - $dosendattributes = $casconfig->getValue('attributes', FALSE); - - $attributes = $ticketcontent['attributes']; - - $pgtiouxml = ""; - - if ($ticketcontent['service'] == $service - && $ticketcontent['forceAuthn'] == $forceAuthn - && array_key_exists($usernamefield, $attributes) - && $ticketcontent['validbefore'] > time()) { - - if (isset($_GET['pgtUrl'])) { - $pgtUrl = $_GET['pgtUrl']; - $pgtiou = str_replace( '_', 'PGTIOU-', SimpleSAML\Utils\Random::generateID()); - $pgt = str_replace( '_', 'PGT-', SimpleSAML\Utils\Random::generateID()); - $content = array( - 'attributes' => $attributes, - 'forceAuthn' => false, - 'proxies' => array_merge(array($service), $ticketcontent['proxies']), - 'validbefore' => time() + 60); - \SimpleSAML\Utils\HTTP::fetch($pgtUrl . '?pgtIou=' . $pgtiou . '&pgtId=' . $pgt); - storeTicket($pgt, $path, $content); - $pgtiouxml = "\n<cas:proxyGrantingTicket>$pgtiou</cas:proxyGrantingTicket>\n"; - } - - $proxiesxml = join("\n", array_map(create_function('$a', 'return "<cas:proxy>$a</cas:proxy>";'), $ticketcontent['proxies'])); - if ($proxiesxml) $proxiesxml = "<cas:proxies>\n$proxiesxml\n</cas:proxies>\n"; - returnResponse('YES', $function, $attributes[$usernamefield][0], $dosendattributes ? $attributes : array(), $pgtiouxml.$proxiesxml); - } else { - returnResponse('NO', $function); - } - -} catch (Exception $e) { - returnResponse('NO', $function, $e->getMessage()); -} - -function returnResponse($value, $function, $usrname = '', $attributes = array(), $xtraxml = "") { - if ($value === 'YES') { - if ($function != 'validate') { - $attributesxml = ""; - foreach ($attributes as $attributename => $attributelist) { - $attr = htmlspecialchars($attributename); - foreach ($attributelist as $attributevalue) { - $attributesxml .= "<cas:$attr>" . htmlspecialchars($attributevalue) . "</cas:$attr>\n"; - } - } - if (sizeof($attributes)) $attributesxml = "<cas:attributes>\n" . $attributesxml . "</cas:attributes>\n"; - echo '<cas:serviceResponse xmlns:cas="http://www.yale.edu/tp/cas"> -<cas:authenticationSuccess> -<cas:user>' . htmlspecialchars($usrname) . '</cas:user>' . - $xtraxml . - $attributesxml . - '</cas:authenticationSuccess> -</cas:serviceResponse>'; - } else { - echo 'yes' . "\n" . $usrname; - } - } else { - if ($function != 'validate') { - echo '<cas:serviceResponse xmlns:cas="http://www.yale.edu/tp/cas"> -<cas:authenticationFailure code=""> -</cas:authenticationFailure> -</cas:serviceResponse>'; - } else { - echo 'no'; - - } - } -} \ No newline at end of file diff --git a/vendor/simplesamlphp/simplesamlphp/modules/casserver/www/tickets.php b/vendor/simplesamlphp/simplesamlphp/modules/casserver/www/tickets.php deleted file mode 100644 index 79498b1082..0000000000 --- a/vendor/simplesamlphp/simplesamlphp/modules/casserver/www/tickets.php +++ /dev/null @@ -1,41 +0,0 @@ -<?php - -function storeTicket($ticket, $path, $value ) { - - if (!is_dir($path)) - throw new Exception('Directory for CAS Server ticket storage [' . $path . '] does not exists. '); - - if (!is_writable($path)) - throw new Exception('Directory for CAS Server ticket storage [' . $path . '] is not writable. '); - - $filename = $path . '/' . $ticket; - file_put_contents($filename, serialize($value)); -} - -function retrieveTicket($ticket, $path, $unlink = true) { - - if (!preg_match('/^(ST|PT|PGT)-?[a-zA-Z0-9]+$/D', $ticket)) throw new Exception('Invalid characters in ticket'); - - if (!is_dir($path)) - throw new Exception('Directory for CAS Server ticket storage [' . $path . '] does not exists. '); - - $filename = $path . '/' . $ticket; - - if (!file_exists($filename)) - throw new Exception('Could not find ticket'); - - $content = file_get_contents($filename); - - if ($unlink) { - unlink($filename); - } - - return unserialize($content); -} - -function checkServiceURL($service, array $legal_service_urls) { - foreach ($legal_service_urls AS $legalurl) { - if (strpos($service, $legalurl) === 0) return TRUE; - } - return FALSE; -} diff --git a/vendor/simplesamlphp/simplesamlphp/modules/casserver/www/validate.php b/vendor/simplesamlphp/simplesamlphp/modules/casserver/www/validate.php deleted file mode 100644 index b57c744693..0000000000 --- a/vendor/simplesamlphp/simplesamlphp/modules/casserver/www/validate.php +++ /dev/null @@ -1,3 +0,0 @@ -<?php -$function = 'validate'; -include("serviceValidate.php"); diff --git a/vendor/simplesamlphp/simplesamlphp/modules/cdc/config-templates/module_cdc.php b/vendor/simplesamlphp/simplesamlphp/modules/cdc/config-templates/module_cdc.php index 77b83bdcec..411bbc4711 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/cdc/config-templates/module_cdc.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/cdc/config-templates/module_cdc.php @@ -1,24 +1,22 @@ <?php -$config = array( - 'example.org' => array( +$config = [ + 'example.org' => [ + /* + * The shared key for this CDC server. + */ + 'key' => 'ExampleSharedKey', - /* - * The shared key for this CDC server. - */ - 'key' => 'ExampleSharedKey', + /* + * The URL to the server script. + */ + 'server' => 'https://my-cdc.example.org/simplesaml/module.php/cdc/server.php', - /* - * The URL to the server script. - */ - 'server' => 'https://my-cdc.example.org/simplesaml/module.php/cdc/server.php', - - /* - * The lifetime of our cookie, in seconds. - * - * If this is 0, the cookie will expire when the browser is closed. - */ - 'cookie.lifetime' => 0, - - ), -); + /* + * The lifetime of our cookie, in seconds. + * + * If this is 0, the cookie will expire when the browser is closed. + */ + 'cookie.lifetime' => 0, + ], +]; diff --git a/vendor/simplesamlphp/simplesamlphp/modules/cdc/lib/Auth/Process/CDC.php b/vendor/simplesamlphp/simplesamlphp/modules/cdc/lib/Auth/Process/CDC.php index 93b24d5967..bf2a669d67 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/cdc/lib/Auth/Process/CDC.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/cdc/lib/Auth/Process/CDC.php @@ -1,71 +1,74 @@ <?php +namespace SimpleSAML\module\cdc\Auth\Process; + /** * Filter for setting the SAML 2 common domain cookie. * * @package SimpleSAMLphp */ -class sspmod_cdc_Auth_Process_CDC extends SimpleSAML_Auth_ProcessingFilter { - - - /** - * Our CDC domain. - * - * @var string - */ - private $domain; - - - /** - * Our CDC client. - * - * @var sspmod_cdc_Client - */ - private $client; - - - /** - * Initialize this filter. - * - * @param array $config Configuration information about this filter. - * @param mixed $reserved For future use. - */ - public function __construct($config, $reserved) { - parent::__construct($config, $reserved); - assert('is_array($config)'); - - if (!isset($config['domain'])) { - throw new SimpleSAML_Error_Exception('Missing domain option in cdc:CDC filter.'); - } - $this->domain = (string)$config['domain']; - - $this->client = new sspmod_cdc_Client($this->domain); - } - - - /** - * Redirect to page setting CDC. - * - * @param array &$state The request state. - */ - public function process(&$state) { - assert('is_array($state)'); - - if (!isset($state['Source']['entityid'])) { - SimpleSAML\Logger::warning('saml:CDC: Could not find IdP entityID.'); - return; - } - - // Save state and build request - $id = SimpleSAML_Auth_State::saveState($state, 'cdc:resume'); - - $returnTo = SimpleSAML\Module::getModuleURL('cdc/resume.php', array('domain' => $this->domain)); - - $params = array( - 'id' => $id, - 'entityID' => $state['Source']['entityid'], - ); - $this->client->sendRequest($returnTo, 'append', $params); - } +class CDC extends \SimpleSAML\Auth\ProcessingFilter +{ + /** + * Our CDC domain. + * + * @var string + */ + private $domain; + + + /** + * Our CDC client. + * + * @var \SimpleSAML\Module\cdc\Client + */ + private $client; + + + /** + * Initialize this filter. + * + * @param array $config Configuration information about this filter. + * @param mixed $reserved For future use. + */ + public function __construct($config, $reserved) + { + parent::__construct($config, $reserved); + assert(is_array($config)); + + if (!isset($config['domain'])) { + throw new \SimpleSAML\Error\Exception('Missing domain option in cdc:CDC filter.'); + } + $this->domain = (string) $config['domain']; + + $this->client = new \SimpleSAML\Module\cdc\Client($this->domain); + } + + + /** + * Redirect to page setting CDC. + * + * @param array &$state The request state. + */ + public function process(&$state) + { + assert(is_array($state)); + + if (!isset($state['Source']['entityid'])) { + \SimpleSAML\Logger::warning('saml:CDC: Could not find IdP entityID.'); + return; + } + + // Save state and build request + $id = \SimpleSAML\Auth\State::saveState($state, 'cdc:resume'); + + $returnTo = \SimpleSAML\Module::getModuleURL('cdc/resume.php', ['domain' => $this->domain]); + + $params = [ + 'id' => $id, + 'entityID' => $state['Source']['entityid'], + ]; + $this->client->sendRequest($returnTo, 'append', $params); + } } diff --git a/vendor/simplesamlphp/simplesamlphp/modules/cdc/lib/Client.php b/vendor/simplesamlphp/simplesamlphp/modules/cdc/lib/Client.php index 7be24d22c7..609aef63f4 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/cdc/lib/Client.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/cdc/lib/Client.php @@ -1,66 +1,70 @@ <?php +namespace SimpleSAML\Module\cdc; + /** * CDC client class. * * @package SimpleSAMLphp */ -class sspmod_cdc_Client { - - /** - * Our CDC domain. - * - * @var string - */ - private $domain; - - /** - * The CDC server we send requests to. - * - * @var sspmod_cdc_Server|NULL - */ - private $server; +class Client +{ + /** + * Our CDC domain. + * + * @var string + */ + private $domain; - /** - * Initialize a CDC client. - * - * @param string $domain The domain we should query the server for. - */ - public function __construct($domain) { - assert('is_string($domain)'); + /** + * The CDC server we send requests to. + * + * @var Server|NULL + */ + private $server; - $this->domain = $domain; - $this->server = new sspmod_cdc_Server($domain); - } + /** + * Initialize a CDC client. + * + * @param string $domain The domain we should query the server for. + */ + public function __construct($domain) + { + assert(is_string($domain)); - /** - * Receive a CDC response. - * - * @return array|NULL The response, or NULL if no response is received. - */ - public function getResponse() { + $this->domain = $domain; + $this->server = new Server($domain); + } - return $this->server->getResponse(); - } + /** + * Receive a CDC response. + * + * @return array|NULL The response, or NULL if no response is received. + */ + public function getResponse() + { + return $this->server->getResponse(); + } - /** - * Send a request. - * - * @param string $returnTo The URL we should return to afterwards. - * @param string $op The operation we are performing. - * @param array $params Additional parameters. - */ - public function sendRequest($returnTo, $op, array $params = array()) { - assert('is_string($returnTo)'); - assert('is_string($op)'); - $params['op'] = $op; - $params['return'] = $returnTo; - $this->server->sendRequest($params); - } + /** + * Send a request. + * + * @param string $returnTo The URL we should return to afterwards. + * @param string $op The operation we are performing. + * @param array $params Additional parameters. + */ + public function sendRequest($returnTo, $op, array $params = []) + { + assert(is_string($returnTo)); + assert(is_string($op)); + $params['op'] = $op; + $params['return'] = $returnTo; + $this->server->sendRequest($params); + } } diff --git a/vendor/simplesamlphp/simplesamlphp/modules/cdc/lib/Server.php b/vendor/simplesamlphp/simplesamlphp/modules/cdc/lib/Server.php index b97af02a34..affcf668ac 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/cdc/lib/Server.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/cdc/lib/Server.php @@ -1,413 +1,426 @@ <?php +namespace SimpleSAML\Module\cdc; + /** * CDC server class. * * @package SimpleSAMLphp */ -class sspmod_cdc_Server { - - /** - * The domain. - * - * @var string - */ - private $domain; - - - /** - * The URL to the server. - * - * @var string - */ - private $server; - - - /** - * Our shared key. - * - * @var string - */ - private $key; - - - /** - * The lifetime of our cookie, in seconds. - * - * If this is 0, the cookie will expire when the browser is closed. - * - * @param int - */ - private $cookieLifetime; - - - /** - * Initialize a CDC server. - * - * @param string $domain The domain we are a server for. - */ - public function __construct($domain) { - assert('is_string($domain)'); - - $cdcConfig = SimpleSAML_Configuration::getConfig('module_cdc.php'); - $config = $cdcConfig->getConfigItem($domain, NULL); - - if ($config === NULL) { - throw new SimpleSAML_Error_Exception('Unknown CDC domain: ' . var_export($domain, TRUE)); - } - - $this->domain = $domain; - $this->server = $config->getString('server'); - $this->key = $config->getString('key'); - $this->cookieLifetime = $config->getInteger('cookie.lifetime', 0); - - if ($this->key === 'ExampleSharedKey') { - throw new SimpleSAML_Error_Exception('Key for CDC domain ' . var_export($domain, TRUE) . ' not changed from default.'); - } - } - - - /** - * Send a request to this CDC server. - * - * @param array $request The CDC request. - */ - public function sendRequest(array $request) { - assert('isset($request["return"])'); - assert('isset($request["op"])'); - - $request['domain'] = $this->domain; - $this->send($this->server, 'CDCRequest', $request); - } - - - /** - * Parse and validate response received from a CDC server. - * - * @return array|NULL The response, or NULL if no response is received. - */ - public function getResponse() { - - $response = self::get('CDCResponse'); - if ($response === NULL) { - return NULL; - } - - if ($response['domain'] !== $this->domain) { - throw new SimpleSAML_Error_Exception('Response received from wrong domain.'); - } - - $this->validate('CDCResponse'); - - return $response; - } - - - /** - * Parse and process a CDC request. - */ - public static function processRequest() { - $request = self::get('CDCRequest'); - if ($request === NULL) { - throw new SimpleSAML_Error_BadRequest('Missing "CDCRequest" parameter.'); - } - - $domain = $request['domain']; - $server = new sspmod_cdc_Server($domain); - - $server->validate('CDCRequest'); - - $server->handleRequest($request); - } - - - /** - * Handle a parsed CDC requst. - * - * @param array $request - */ - private function handleRequest(array $request) { - - if (!isset($request['op'])) { - throw new SimpleSAML_Error_BadRequest('Missing "op" in CDC request.'); - } - $op = (string)$request['op']; - - SimpleSAML\Logger::info('Received CDC request with "op": ' . var_export($op, TRUE)); - - if (!isset($request['return'])) { - throw new SimpleSAML_Error_BadRequest('Missing "return" in CDC request.'); - } - $return = (string)$request['return']; - - switch ($op) { - case 'append': - $response = $this->handleAppend($request); - break; - case 'delete': - $response = $this->handleDelete($request); - break; - case 'read': - $response = $this->handleRead($request); - break; - default: - $response = 'unknown-op'; - } - - if (is_string($response)) { - $response = array( - 'status' => $response, - ); - } - - $response['op'] = $op; - if (isset($request['id'])) { - $response['id'] = (string)$request['id']; - } - $response['domain'] = $this->domain; - - $this->send($return, 'CDCResponse', $response); - } - - - /** - * Handle an append request. - * - * @param array $request The request. - * @return array The response. - */ - private function handleAppend(array $request) { - - if (!isset($request['entityID'])) { - throw new SimpleSAML_Error_BadRequest('Missing entityID in append request.'); - } - $entityID = (string)$request['entityID']; - - $list = $this->getCDC(); - - $prevIndex = array_search($entityID, $list, TRUE); - if ($prevIndex !== FALSE) { - unset($list[$prevIndex]); - } - $list[] = $entityID; - - $this->setCDC($list); - - return 'ok'; - } - - - /** - * Handle a delete request. - * - * @param array $request The request. - * @return array The response. - */ - private function handleDelete(array $request) { - $params = array( - 'path' => '/', - 'domain' => '.' . $this->domain, - 'secure' => TRUE, - 'httponly' => FALSE, - ); - - \SimpleSAML\Utils\HTTP::setCookie('_saml_idp', NULL, $params, FALSE); - return 'ok'; - } - - - /** - * Handle a read request. - * - * @param array $request The request. - * @return array The response. - */ - private function handleRead(array $request) { - - $list = $this->getCDC(); - - return array( - 'status' => 'ok', - 'cdc' => $list, - ); - } - - - /** - * Helper function for parsing and validating a CDC message. - * - * @param string $parameter The name of the query parameter. - * @return array|NULL The response, or NULL if no response is received. - */ - private static function get($parameter) { - assert('is_string($parameter)'); - - if (!isset($_REQUEST[$parameter])) { - return NULL; - } - $message = (string)$_REQUEST[$parameter]; - - $message = @base64_decode($message); - if ($message === FALSE) { - throw new SimpleSAML_Error_BadRequest('Error base64-decoding CDC message.'); - } - - $message = @json_decode($message, TRUE); - if ($message === FALSE) { - throw new SimpleSAML_Error_BadRequest('Error json-decoding CDC message.'); - } - - if (!isset($message['timestamp'])) { - throw new SimpleSAML_Error_BadRequest('Missing timestamp in CDC message.'); - } - $timestamp = (int)$message['timestamp']; - - if ($timestamp + 60 < time()) { - throw new SimpleSAML_Error_BadRequest('CDC signature has expired.'); - } - if ($timestamp - 60 > time()) { - throw new SimpleSAML_Error_BadRequest('CDC signature from the future.'); - } - - if (!isset($message['domain'])) { - throw new SimpleSAML_Error_BadRequest('Missing domain in CDC message.'); - } - - return $message; - } - - - /** - * Helper function for validating the signature on a CDC message. - * - * Will throw an exception if the message is invalid. - * - * @param string $parameter The name of the query parameter. - */ - private function validate($parameter) { - assert('is_string($parameter)'); - assert('isset($_REQUEST[$parameter])'); - - $message = (string)$_REQUEST[$parameter]; - - if (!isset($_REQUEST['Signature'])) { - throw new SimpleSAML_Error_BadRequest('Missing Signature on CDC message.'); - } - $signature = (string)$_REQUEST['Signature']; - - $cSignature = $this->calcSignature($message); - if ($signature !== $cSignature) { - throw new SimpleSAML_Error_BadRequest('Invalid signature on CDC message.'); - } - } - - - /** - * Helper function for sending CDC messages. - * - * @param string $to The URL the message should be delivered to. - * @param string $parameter The query parameter the message should be sent in. - * @param array $message The CDC message. - */ - private function send($to, $parameter, array $message) { - assert('is_string($to)'); - assert('is_string($parameter)'); - - $message['timestamp'] = time(); - $message = json_encode($message); - $message = base64_encode($message); - - $signature = $this->calcSignature($message); - - $params = array( - $parameter => $message, - 'Signature' => $signature, - ); - - $url = \SimpleSAML\Utils\HTTP::addURLParameters($to, $params); - if (strlen($url) < 2048) { - \SimpleSAML\Utils\HTTP::redirectTrustedURL($url); - } else { - \SimpleSAML\Utils\HTTP::submitPOSTData($to, $params); - } - } - - - /** - * Calculate the signature on the given message. - * - * @param string $rawMessage The base64-encoded message. - * @return string The signature. - */ - private function calcSignature($rawMessage) { - assert('is_string($rawMessage)'); - - return sha1($this->key . $rawMessage . $this->key); - } - - - /** - * Get the IdP entities saved in the common domain cookie. - * - * @return array List of IdP entities. - */ - private function getCDC() { - - if (!isset($_COOKIE['_saml_idp'])) { - return array(); - } - - $ret = (string)$_COOKIE['_saml_idp']; - $ret = explode(' ', $ret); - foreach ($ret as &$idp) { - $idp = base64_decode($idp); - if ($idp === FALSE) { - // Not properly base64 encoded - SimpleSAML\Logger::warning('CDC - Invalid base64-encoding of CDC entry.'); - return array(); - } - } - - return $ret; - } - - - /** - * Build a CDC cookie string. - * - * @param array $list The list of IdPs. - * @return string The CDC cookie value. - */ - function setCDC(array $list) { - - foreach ($list as &$value) { - $value = base64_encode($value); - } - - $cookie = implode(' ', $list); - - while (strlen($cookie) > 4000) { - // The cookie is too long. Remove the oldest elements until it is short enough - $tmp = explode(' ', $cookie, 2); - if (count($tmp) === 1) { - /* - * We are left with a single entityID whose base64 - * representation is too long to fit in a cookie. - */ - break; - } - $cookie = $tmp[1]; - } - - $params = array( - 'lifetime' => $this->cookieLifetime, - 'path' => '/', - 'domain' => '.' . $this->domain, - 'secure' => TRUE, - 'httponly' => FALSE, - ); - - \SimpleSAML\Utils\HTTP::setCookie('_saml_idp', $cookie, $params, FALSE); - } +class Server +{ + /** + * The domain. + * + * @var string + */ + private $domain; + + + /** + * The URL to the server. + * + * @var string + */ + private $server; + + + /** + * Our shared key. + * + * @var string + */ + private $key; + + + /** + * The lifetime of our cookie, in seconds. + * + * If this is 0, the cookie will expire when the browser is closed. + * + * @param int + */ + private $cookieLifetime; + + + /** + * Initialize a CDC server. + * + * @param string $domain The domain we are a server for. + */ + public function __construct($domain) + { + assert(is_string($domain)); + + $cdcConfig = \SimpleSAML\Configuration::getConfig('module_cdc.php'); + $config = $cdcConfig->getConfigItem($domain, null); + + if ($config === null) { + throw new \SimpleSAML\Error\Exception('Unknown CDC domain: '.var_export($domain, true)); + } + + $this->domain = $domain; + $this->server = $config->getString('server'); + $this->key = $config->getString('key'); + $this->cookieLifetime = $config->getInteger('cookie.lifetime', 0); + + if ($this->key === 'ExampleSharedKey') { + throw new \SimpleSAML\Error\Exception( + 'Key for CDC domain '.var_export($domain, true).' not changed from default.' + ); + } + } + + + /** + * Send a request to this CDC server. + * + * @param array $request The CDC request. + */ + public function sendRequest(array $request) + { + assert(isset($request['return'])); + assert(isset($request['op'])); + + $request['domain'] = $this->domain; + $this->send($this->server, 'CDCRequest', $request); + } + + + /** + * Parse and validate response received from a CDC server. + * + * @return array|NULL The response, or NULL if no response is received. + */ + public function getResponse() + { + $response = self::get('CDCResponse'); + if ($response === null) { + return null; + } + + if ($response['domain'] !== $this->domain) { + throw new \SimpleSAML\Error\Exception('Response received from wrong domain.'); + } + + $this->validate('CDCResponse'); + + return $response; + } + + + /** + * Parse and process a CDC request. + */ + public static function processRequest() + { + $request = self::get('CDCRequest'); + if ($request === null) { + throw new \SimpleSAML\Error\BadRequest('Missing "CDCRequest" parameter.'); + } + + $domain = $request['domain']; + $server = new Server($domain); + + $server->validate('CDCRequest'); + $server->handleRequest($request); + } + + + /** + * Handle a parsed CDC requst. + * + * @param array $request + */ + private function handleRequest(array $request) + { + if (!isset($request['op'])) { + throw new \SimpleSAML\Error\BadRequest('Missing "op" in CDC request.'); + } + $op = (string) $request['op']; + + \SimpleSAML\Logger::info('Received CDC request with "op": '.var_export($op, true)); + + if (!isset($request['return'])) { + throw new \SimpleSAML\Error\BadRequest('Missing "return" in CDC request.'); + } + $return = (string) $request['return']; + + switch ($op) { + case 'append': + $response = $this->handleAppend($request); + break; + case 'delete': + $response = $this->handleDelete($request); + break; + case 'read': + $response = $this->handleRead($request); + break; + default: + $response = 'unknown-op'; + } + + if (is_string($response)) { + $response = [ + 'status' => $response, + ]; + } + + $response['op'] = $op; + if (isset($request['id'])) { + $response['id'] = (string) $request['id']; + } + $response['domain'] = $this->domain; + + $this->send($return, 'CDCResponse', $response); + } + + + /** + * Handle an append request. + * + * @param array $request The request. + * @return string The response. + */ + private function handleAppend(array $request) + { + if (!isset($request['entityID'])) { + throw new \SimpleSAML\Error\BadRequest('Missing entityID in append request.'); + } + $entityID = (string) $request['entityID']; + + $list = $this->getCDC(); + + $prevIndex = array_search($entityID, $list, true); + if ($prevIndex !== false) { + unset($list[$prevIndex]); + } + $list[] = $entityID; + + $this->setCDC($list); + + return 'ok'; + } + + + /** + * Handle a delete request. + * + * @param array $request The request. + * @return string The response. + */ + private function handleDelete(array $request) + { + $params = [ + 'path' => '/', + 'domain' => '.'.$this->domain, + 'secure' => true, + 'httponly' => false, + ]; + + \SimpleSAML\Utils\HTTP::setCookie('_saml_idp', null, $params, false); + return 'ok'; + } + + + /** + * Handle a read request. + * + * @param array $request The request. + * @return array The response. + */ + private function handleRead(array $request) + { + $list = $this->getCDC(); + + return [ + 'status' => 'ok', + 'cdc' => $list, + ]; + } + + + /** + * Helper function for parsing and validating a CDC message. + * + * @param string $parameter The name of the query parameter. + * @return array|NULL The response, or NULL if no response is received. + */ + private static function get($parameter) + { + assert(is_string($parameter)); + + if (!isset($_REQUEST[$parameter])) { + return null; + } + $message = (string) $_REQUEST[$parameter]; + + $message = @base64_decode($message); + if ($message === false) { + throw new \SimpleSAML\Error\BadRequest('Error base64-decoding CDC message.'); + } + + $message = @json_decode($message, true); + if ($message === false) { + throw new \SimpleSAML\Error\BadRequest('Error json-decoding CDC message.'); + } + + if (!isset($message['timestamp'])) { + throw new \SimpleSAML\Error\BadRequest('Missing timestamp in CDC message.'); + } + $timestamp = (int) $message['timestamp']; + + if ($timestamp + 60 < time()) { + throw new \SimpleSAML\Error\BadRequest('CDC signature has expired.'); + } + if ($timestamp - 60 > time()) { + throw new \SimpleSAML\Error\BadRequest('CDC signature from the future.'); + } + + if (!isset($message['domain'])) { + throw new \SimpleSAML\Error\BadRequest('Missing domain in CDC message.'); + } + + return $message; + } + + + /** + * Helper function for validating the signature on a CDC message. + * + * Will throw an exception if the message is invalid. + * + * @param string $parameter The name of the query parameter. + */ + private function validate($parameter) + { + assert(is_string($parameter)); + assert(isset($_REQUEST[$parameter])); + + $message = (string) $_REQUEST[$parameter]; + + if (!isset($_REQUEST['Signature'])) { + throw new \SimpleSAML\Error\BadRequest('Missing Signature on CDC message.'); + } + $signature = (string) $_REQUEST['Signature']; + + $cSignature = $this->calcSignature($message); + if ($signature !== $cSignature) { + throw new \SimpleSAML\Error\BadRequest('Invalid signature on CDC message.'); + } + } + + + /** + * Helper function for sending CDC messages. + * + * @param string $to The URL the message should be delivered to. + * @param string $parameter The query parameter the message should be sent in. + * @param array $message The CDC message. + */ + private function send($to, $parameter, array $message) + { + assert(is_string($to)); + assert(is_string($parameter)); + + $message['timestamp'] = time(); + $message = json_encode($message); + $message = base64_encode($message); + + $signature = $this->calcSignature($message); + + $params = [ + $parameter => $message, + 'Signature' => $signature, + ]; + + $url = \SimpleSAML\Utils\HTTP::addURLParameters($to, $params); + if (strlen($url) < 2048) { + \SimpleSAML\Utils\HTTP::redirectTrustedURL($url); + } else { + \SimpleSAML\Utils\HTTP::submitPOSTData($to, $params); + } + } + + + /** + * Calculate the signature on the given message. + * + * @param string $rawMessage The base64-encoded message. + * @return string The signature. + */ + private function calcSignature($rawMessage) + { + assert(is_string($rawMessage)); + + return sha1($this->key.$rawMessage.$this->key); + } + + + /** + * Get the IdP entities saved in the common domain cookie. + * + * @return array List of IdP entities. + */ + private function getCDC() + { + if (!isset($_COOKIE['_saml_idp'])) { + return []; + } + + $ret = (string) $_COOKIE['_saml_idp']; + $ret = explode(' ', $ret); + foreach ($ret as &$idp) { + $idp = base64_decode($idp); + if ($idp === false) { + // Not properly base64 encoded + \SimpleSAML\Logger::warning('CDC - Invalid base64-encoding of CDC entry.'); + return []; + } + } + + return $ret; + } + + + /** + * Build a CDC cookie string. + * + * @param array $list The list of IdPs. + * @return string The CDC cookie value. + */ + private function setCDC(array $list) + { + foreach ($list as &$value) { + $value = base64_encode($value); + } + + $cookie = implode(' ', $list); + + while (strlen($cookie) > 4000) { + // The cookie is too long. Remove the oldest elements until it is short enough + $tmp = explode(' ', $cookie, 2); + if (count($tmp) === 1) { + /* + * We are left with a single entityID whose base64 + * representation is too long to fit in a cookie. + */ + break; + } + $cookie = $tmp[1]; + } + + $params = [ + 'lifetime' => $this->cookieLifetime, + 'path' => '/', + 'domain' => '.'.$this->domain, + 'secure' => true, + 'httponly' => false, + ]; + + \SimpleSAML\Utils\HTTP::setCookie('_saml_idp', $cookie, $params, false); + + return '_saml_idp'; + } } diff --git a/vendor/simplesamlphp/simplesamlphp/modules/cdc/www/resume.php b/vendor/simplesamlphp/simplesamlphp/modules/cdc/www/resume.php index a7f821998c..ebe6b1cc9f 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/cdc/www/resume.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/cdc/www/resume.php @@ -1,21 +1,20 @@ <?php - if (!array_key_exists('domain', $_REQUEST)) { - throw new SimpleSAML_Error_BadRequest('Missing domain to CDC resume handler.'); + throw new \SimpleSAML\Error\BadRequest('Missing domain to CDC resume handler.'); } -$domain = (string)$_REQUEST['domain']; -$client = new sspmod_cdc_Client($domain); +$domain = (string) $_REQUEST['domain']; +$client = new \SimpleSAML\Module\cdc\Client($domain); $response = $client->getResponse(); -if ($response === NULL) { - throw new SimpleSAML_Error_BadRequest('Missing CDC response to CDC resume handler.'); +if ($response === null) { + throw new \SimpleSAML\Error\BadRequest('Missing CDC response to CDC resume handler.'); } if (!isset($response['id'])) { - throw new SimpleSAML_Error_BadRequest('CDCResponse without id.'); + throw new \SimpleSAML\Error\BadRequest('CDCResponse without id.'); } -$state = SimpleSAML_Auth_State::loadState($response['id'], 'cdc:resume'); +$state = \SimpleSAML\Auth\State::loadState($response['id'], 'cdc:resume'); -SimpleSAML_Auth_ProcessingChain::resumeProcessing($state); +\SimpleSAML\Auth\ProcessingChain::resumeProcessing($state); diff --git a/vendor/simplesamlphp/simplesamlphp/modules/cdc/www/server.php b/vendor/simplesamlphp/simplesamlphp/modules/cdc/www/server.php index f84b7a9061..d5cfd16ece 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/cdc/www/server.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/cdc/www/server.php @@ -1,3 +1,3 @@ <?php -sspmod_cdc_Server::processRequest(); \ No newline at end of file +\SimpleSAML\Module\cdc\Server::processRequest(); diff --git a/vendor/simplesamlphp/simplesamlphp/modules/authlinkedin/default-disable b/vendor/simplesamlphp/simplesamlphp/modules/consent/default-disable similarity index 100% rename from vendor/simplesamlphp/simplesamlphp/modules/authlinkedin/default-disable rename to vendor/simplesamlphp/simplesamlphp/modules/consent/default-disable diff --git a/vendor/simplesamlphp/simplesamlphp/modules/consent/default-enable b/vendor/simplesamlphp/simplesamlphp/modules/consent/default-enable deleted file mode 100644 index 25615cb47c..0000000000 --- a/vendor/simplesamlphp/simplesamlphp/modules/consent/default-enable +++ /dev/null @@ -1,3 +0,0 @@ -This file indicates that the default state of this module -is enabled. To disable, create a file named disable in the -same directory as this file. diff --git a/vendor/simplesamlphp/simplesamlphp/modules/consent/dictionaries/consent.definition.json b/vendor/simplesamlphp/simplesamlphp/modules/consent/dictionaries/consent.definition.json index 02ff486b58..6c44516104 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/consent/dictionaries/consent.definition.json +++ b/vendor/simplesamlphp/simplesamlphp/modules/consent/dictionaries/consent.definition.json @@ -1,68 +1,68 @@ { - "yes": { - "en": "Yes, continue" - }, - "no": { - "en": "No, cancel" - }, - "remember": { - "en": "Remember" - }, - "consent_accept": { - "en": "SPNAME requires that the information below is transferred." - }, - "login": { - "en": "login" - }, - "service_providers_for": { - "en": "Service Providers for" - }, - "service_provider_header": { - "en": "Service Provider" - }, - "status_header": { - "en": "Consent status" - }, - "show_hide_attributes": { - "en": "show\/hide attributes" - }, - "consent_privacypolicy": { - "en": "Privacy policy for the service" - }, - "noconsent_title": { - "en": "No consent given" - }, - "noconsent_text": { - "en": "You did not give consent for transfering your attributes to SPNAME." - }, - "noconsent_return": { - "en": "Return to consent page" - }, - "consent_header": { - "en": "Consent about releasing personal information" - }, - "consent_attributes_header": { - "en": "Information that will be sent to SPNAME" - }, - "show_attributes": { - "en": "Show attributes" - }, - "noconsent_goto_about": { - "en": "Go to information page for the service" - }, - "consent_purpose": { - "en": "The purpose of SPNAME is SPDESC" - }, - "table_caption": { - "en": "User information" - }, - "table_summary": { - "en": "List the information about you that is about to be transmitted to the service you are going to login to" - }, - "show_attribute": { - "en": "Show content" - }, - "abort": { - "en": "Abort login to SPNAME" - } + "yes": { + "en": "Yes, continue" + }, + "no": { + "en": "No, cancel" + }, + "remember": { + "en": "Remember" + }, + "consent_accept": { + "en": "SPNAME requires that the information below is transferred." + }, + "login": { + "en": "login" + }, + "service_providers_for": { + "en": "Service Providers for" + }, + "service_provider_header": { + "en": "Service Provider" + }, + "status_header": { + "en": "Consent status" + }, + "show_hide_attributes": { + "en": "show\/hide attributes" + }, + "consent_privacypolicy": { + "en": "Privacy policy for the service" + }, + "noconsent_title": { + "en": "No consent given" + }, + "noconsent_text": { + "en": "You did not give consent for transfering your attributes to SPNAME." + }, + "noconsent_return": { + "en": "Return to consent page" + }, + "consent_header": { + "en": "Consent about releasing personal information" + }, + "consent_attributes_header": { + "en": "Information that will be sent to SPNAME" + }, + "show_attributes": { + "en": "Show attributes" + }, + "noconsent_goto_about": { + "en": "Go to information page for the service" + }, + "consent_purpose": { + "en": "The purpose of SPNAME is SPDESC" + }, + "table_caption": { + "en": "User information" + }, + "table_summary": { + "en": "List the information about you that is about to be transmitted to the service you are going to login to" + }, + "show_attribute": { + "en": "Show content" + }, + "abort": { + "en": "Abort login to SPNAME" + } } diff --git a/vendor/simplesamlphp/simplesamlphp/modules/consent/dictionaries/consent.php b/vendor/simplesamlphp/simplesamlphp/modules/consent/dictionaries/consent.php index c04851e54a..90932786ab 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/consent/dictionaries/consent.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/consent/dictionaries/consent.php @@ -1,379 +1,378 @@ <?php -$lang = array( - 'yes' => array ( - 'no' => 'Ja, fortsett', - 'nn' => 'Ja, fortsett', - 'da' => 'Ja, jeg accepterer', - 'en' => 'Yes, continue', - 'de' => 'Ja, ich stimmte zu', - 'sv' => 'Ja', - 'fi' => 'Kyllä', - 'es' => 'Sí', - 'fr' => 'Oui', - 'nl' => 'Ja, ik ga akkoord', - 'lb' => 'Jo', - 'sl' => 'Da, nadaljuj', - 'hr' => 'Da, prihvaćam', - 'hu' => 'Igen, elfogadom', - 'pl' => 'Tak, akceptuję', - 'pt' => 'Sim, Aceito', - 'pt-br' => 'Sim, Aceito', - 'tr' => 'Evet, devam et', - ), - 'no' => array ( - 'no' => 'Nei, avbryt', - 'nn' => 'Nei, avbryt', - 'da' => 'Nej, jeg accepterer ikke', - 'en' => 'No, cancel', - 'de' => 'Nein, ich stimmte nicht zu', - 'sv' => 'Nej', - 'fi' => 'ei', - 'es' => 'No', - 'fr' => 'Non', - 'nl' => 'Nee, ik weiger', - 'lb' => 'Nee', - 'sl' => 'Ne, prekliči', - 'hr' => 'Ne privaćam', - 'hu' => 'Nem, nem fogadom el', - 'pl' => 'Nie, nie akceptuję', - 'pt' => 'Não aceito', - 'pt-br' => 'Não, não aceito', - 'tr' => 'Hayır, iptal et', - ), - 'remember' => array ( - 'no' => 'Godta også for fremtiden', - 'nn' => 'Godta også for framtida', - 'da' => 'Husk samtykke', - 'en' => 'Remember', - 'de' => 'Zustimmung merken', - 'sv' => 'Spara samtycke', - 'fi' => 'Muista', - 'es' => 'Recordar el consentimiento', - 'fr' => 'Se souvenir du consentement', - 'nl' => 'Bewaar toestemming', - 'lb' => 'Zoustëmmung verhalen', - 'sl' => 'Zapomni si privolitev.', - 'hr' => 'Zapamti dozvole', - 'hu' => 'Emlékezzen a hozzájárulásra', - 'pl' => 'Pamiętaj moją zgodę', - 'pt' => 'Lembrar a minha escolha', - 'pt-br' => 'Lembrar Consentimento', - 'tr' => 'Hatırla', - ), - 'consent_header' => array ( - 'no' => 'Samtykke om overføring av personinformasjon', - 'nn' => 'Samtykke til overføring av personinformasjon', - 'da' => 'Samtykke til at frigive personlige oplysninger', - 'en' => 'Consent about releasing personal information', - 'de' => 'Zustimmung zur Weitergabe persönlicher Daten ', - 'sv' => 'Samtycke gällande överföring av personinformation', - 'fi' => 'Henkilötietojen luovutuksen hyväksyntä', - 'es' => 'Consentimiento para la liberación de información personal', - 'nl' => 'Toestemming voor het vrijgeven van persoonsgegevens', - 'sl' => 'Odločitev o privolitvi posredovanja vaših osebnih podatkov', - 'hr' => 'Dozvola za isporuku osobnih podataka', - 'hu' => 'Hozzájárulás személyes adatok kiadásához', - 'pl' => 'Zgoda na wysłanie danych osobistych', - 'pt' => 'Consentimento do envio de informação pessoal', - 'tr' => 'Kişisel bilgilerin verilmesi hakkında onay', - ), - 'consent_accept' => array ( - 'no' => 'For å fullføre innloggingen må du godta at opplysningene nedenfor sendes til SPNAME.', - 'nn' => 'For å fullføra innlogginga må du godta at opplysningane under blir sende til SPNAME', - 'da' => 'SPNAME kræver at nedenstående oplysninger overføres fra IDPNAME. Vil du acceptere dette?', - 'en' => 'SPNAME requires that the information below is transferred.', - 'de' => 'SPNAME erfordert die Übertragung untenstehender Information von IDPNAME. Akzeptieren Sie das?', - 'sv' => 'Du är på väg att logga in i tjänsten SPNAME. Tjänsten kräver att informationen nedan skickas från IDPNAME. Är detta okej?', - 'fi' => 'Olet kirjautumassa palveluun SPNAME. Identiteetilähteesi henkilötietojasi palvelun tarjoajalle. Hyväksytkö tietojen siirron?', - 'es' => 'Está a punto de acceder al servicio SPNAME. El servicio requiere que la información que se muestra a continuación sea transferida desde IDPNAME. ¿Acepta esto? ', - 'fr' => 'Vous êtes sur le point de vous connecter au service SPNAME. Lors de l\'ouverture de session, le fournisseur d\'identité enverra des informations sur votre identité à ce service. Acceptez-vous cela ?', - 'nl' => 'U gaat inloggen bij een dienst SPNAME. Tijdens het loginproces stuurt de identity provider zgn. attributen met daarin informatie over uw identiteit voor deze dienst. Bent u het daarmee eens?', - 'lb' => 'Daer sid dobai aerch um service unzemellen SPNAME. Waerend dem Login Prozess schéckt den Identity Provider Attributer, déi Informatiounen iwert aer Identitéit enthaalen. Akzeptéier daer daat?', - 'sl' => 'Pravkar se nameravate prijaviti v storitev SPNAME. Med postopkom prijave bo IdP tej storitvi posredoval atribute, ki vsebujejo informacije o vaši identiteti. Ali se s tem strinjate? ', - 'hr' => 'U tijeku je proces prijave za pristup servisu SPNAME. Servis zahtjeva da IDPNAME isporuči dolje navedene podatke. Slažete li se s time?', - 'hu' => 'Ön azonosítja magát ehhez a szolgáltatáshoz SPNAME. Az azonosítás során IDPNAME az alábbi adatokat fogja küldeni a szolgáltatásnak. Engedélyezi?', - 'pl' => 'SPNAME wymaga aby poniższa informacja została przesłana.', - 'pt' => 'O serviço SPNAME necessita que a informação apresentada em baixo seja transferida.', - 'pt-br' => 'Você está prestes a acessar o serviço SPNAME. O serviço exige que as informações a seguir sejam transferidas do IDPNAME. Você aceita isso?', - 'tr' => 'SPNAME aşağıdaki bilgilerin gönderilmesine ihtiyaç duyuyor.', - ), - 'consent_purpose' => array ( - 'no' => 'Formålet med SPNAME er SPDESC', - 'nn' => 'Hensikta med SPNAME er SPDESC', - 'da' => 'SPNAME har til formål at SPDESC', - 'en' => 'The purpose of SPNAME is SPDESC', - 'de' => 'Der Zweck von SPNAME ist SPDESC', - 'sv' => 'Syftet med SPNAME är SPDESC', - 'fi' => 'Palvelun SPNAME käyttötarkoitus on SPDESC', - 'es' => 'El propósito de SPNAME es SPDESC', - 'nl' => 'Het doel van SPNAME is SPDESC', - 'sl' => 'Namen %SPNAME%: %SPDESC%', - 'hr' => 'Svrha SPNAME je SPDESC', - 'hu' => 'A szolgáltatás (SPNAME) ezt a célt szolgálja: SPDESC', - 'pl' => 'Celem SPNAME jest SPDESC', - 'pt' => 'O propósito de SPNAME é SPDESC', - 'tr' => 'SPNAME\'in amacı SPDESC\'tir', - ), - 'consent_privacypolicy' => array ( - 'no' => 'Personvern for tjenesten', - 'nn' => 'Personvern for tenesta', - 'da' => 'Tjenestens politik vedrørende personoplysninger', - 'en' => 'Privacy policy for the service', - 'de' => 'Datenschutzrichtlinie des Dienstes', - 'sv' => 'Tjänstens policy för personlig integritet', - 'fi' => 'Tietosuojaseloste palvelulle', - 'es' => 'Política de privacidad para el servicio', - 'nl' => 'Privacybeleid voor de dienst', - 'sl' => 'Politika zasebnosti za ta SP', - 'hr' => 'Politika zaštite privatnosti', - 'hu' => 'A szolgáltatás adatvádelmi nyilatkozata', - 'pl' => 'Polityka prywatności dla serwisu', - 'pt' => 'Política de privacidade do serviço', - 'pt-br' => 'Política de Privacidade deste serviço', - 'tr' => 'Servis için gizlilik politikası', - ), - 'consent_attributes_header' => array ( - 'no' => 'Opplysninger som vil bli sendt til SPNAME', - 'nn' => 'Opplysningar som blir sende til SPNAME', - 'da' => 'Attributter som bliver sendt til SPNAME', - 'en' => 'Information that will be sent to SPNAME', - 'de' => 'Informationen, die an SPNAME gesandt werden', - 'sv' => 'Attribut som kommer att skickas till tjänsten', - 'fi' => 'Tiedot lähetetään palvelulle SPNAME', - 'es' => 'Atributos que serán enviados al servicio', - 'nl' => 'Informatie die naar SPNAME zal worden gestuurd', - 'sl' => 'Atributi, ki bodo poslani SPju', - 'hr' => 'Atributi koji će biti poslani servisu', - 'hu' => 'A(z) SPNAME szolgáltatónak küldött adatok', - 'pl' => 'Atrybuty, które zostaną przesłane do serwisu', - 'pt' => 'Informação que irá ser enviada para SPNAME', - 'tr' => 'SPNAME\'e gönderilecek bilgiler', - ), - 'show_attributes' => array ( - 'no' => 'Vis opplysninger', - 'nn' => 'Vis opplysingar', - 'da' => 'Vis attributter', - 'en' => 'Show attributes', - 'de' => 'Attribute zeigen', - 'sv' => 'Visa attribut', - 'fi' => 'Näytä henkilötiedot', - 'es' => 'Mostrar atributos', - 'nl' => 'Toon attributen', - 'sl' => 'Prikaži atribute', - 'hr' => 'Prikaži atribute', - 'hu' => 'Mutasd az attribútumokat', - 'pl' => 'Wyświetl atrybuty', - 'pt' => 'Mostrar atributos', - 'tr' => 'Özellikleri göster', - ), - 'show_attribute' => array ( - 'no' => 'Vis innhold', - 'nn' => 'Vis innhald', - 'da' => 'Vis indhold', - 'en' => 'Show content', - 'sv' => 'Visa samtycke', - 'es' => 'Mostrart consentimiento', - 'nl' => 'Toon inhoud', - 'sl' => 'Prikaži vsebino', - ), - 'login' => array ( - 'no' => 'innlogging', - 'nn' => 'Logg inn', - 'da' => 'login', - 'en' => 'login', - 'de' => 'anmelden', - 'sv' => 'Logga in', - 'fi' => 'Tunnus', - 'es' => 'login', - 'fr' => 'ouvrir une session', - 'nl' => 'Login', - 'lb' => 'anloggen', - 'sl' => 'Prijava', - 'hr' => 'prijava', - 'hu' => 'bejelentkezés', - 'pl' => 'login', - 'pt' => 'Entrar', - 'pt-br' => 'login', - 'tr' => 'Giriş', - ), - 'service_providers_for' => array ( - 'no' => 'Tjenesteleverandør for', - 'nn' => 'Tenesteleverandørar for', - 'da' => 'Tjenesteudbyder for', - 'en' => 'Service Providers for', - 'de' => 'Service-Provider für', - 'sv' => 'Tjänsteleverantörer för', - 'fi' => 'Palveluntarjoaja', - 'es' => 'Proveedores de servicio para', - 'fr' => 'Fournisseurs de services pour', - 'nl' => 'Service Providers voor', - 'lb' => 'Service Provider fir', - 'sl' => 'SP za', - 'hr' => 'Davatelji usluge za', - 'hu' => 'Alkalmazásszolgáltatók a következő számára', - 'pl' => 'Dostawca Serwisu dla', - 'pt' => 'Fornecedores de Serviço (SP) para', - 'pt-br' => 'Provedor de serviços para', - 'tr' => 'için Servis Sağlayıcılar', - ), - 'service_provider_header' => array ( - 'no' => 'Tjenesteleverandør', - 'nn' => 'Tenesteleverandør', - 'da' => 'Tjenesteudbyder', - 'en' => 'Service Provider', - 'de' => 'Service-Provider', - 'sv' => 'Tjänsteleverantör', - 'fi' => 'Palveluntarjoaja', - 'es' => 'Proveedor de servicio', - 'fr' => 'Fournisseur de service', - 'nl' => 'Service Provider', - 'lb' => 'Service Provider', - 'sl' => 'SP', - 'hr' => 'Davatelj usluge', - 'hu' => 'Alkalmazásszolgáltató', - 'pl' => 'Dostawca serwisu', - 'pt' => 'Fornecedor de Serviço (SP)', - 'pt-br' => 'Provedor de Serviços', - 'tr' => 'Servis Sağlayıcı', - ), - 'status_header' => array ( - 'no' => 'Samtykke-status', - 'nn' => 'Samtykkestatus', - 'da' => 'Samtykke status', - 'en' => 'Consent status', - 'de' => 'Zustimmungsstatus', - 'sv' => 'Status för samtycke', - 'fi' => 'Hyväksynnään tila', - 'es' => 'Estado del consentimiento', - 'fr' => 'État des consentements', - 'nl' => 'Toestemming status', - 'lb' => 'Zoustëmmungsstatus', - 'sl' => 'Stanje privolitve', - 'hr' => 'Status dozvole', - 'hu' => 'Hozzájárulás állapota', - 'pl' => 'Status zgody', - 'pt' => 'Consentimento', - 'pt-br' => 'Status do Consentimento', - 'tr' => 'Onay durumu', - ), - 'show_hide_attributes' => array ( - 'no' => 'Vis/skjul opplysninger', - 'nn' => 'Vis/skjul opplysningar', - 'da' => 'vis/skjul attributter', - 'en' => 'show/hide attributes', - 'de' => 'zeige/verstecke Eigenschaften', - 'sv' => 'visa/göm attribut', - 'fi' => 'Näytä/piilota attribuutteja', - 'es' => 'Mostrar/ocultar atributos', - 'fr' => 'montrer/cacher les attributs', - 'nl' => 'toon/verberg attributen', - 'lb' => 'Attributer weisen/verstoppen', - 'sl' => 'prikaži/skrij atribute', - 'hr' => 'prikaži/sakrij atribute', - 'hu' => 'attribútumok mutatása/elrejtése', - 'pl' => 'pokaż/ukryj atrybuty', - 'pt' => 'Mostrar/Ocultar atributos', - 'pt-br' => 'mostra/esconder Atributos', - 'tr' => 'bilgileri göster/gizle ', - ), - 'noconsent_title' => array ( - 'no' => 'Ikke akseptert overføring av informasjon', - 'nn' => 'Ikkje akseptert overføring av informasjon', - 'da' => 'Manglende samtykke', - 'en' => 'No consent given', - 'de' => 'Zustimmung verweigert', - 'sv' => 'Inget samtycket givet', - 'fi' => 'Lupaa ei annettu', - 'es' => 'No se dió el consentimiento', - 'nl' => 'Geen toestemming gegeven', - 'sl' => 'Privolitev ni bila dana.', - 'hr' => 'Nema pristanka', - 'hu' => 'Nincs hozzájárulás', - 'pl' => 'Nie wyrażono zgody', - 'pt' => 'Consentimento negado', - 'pt-br' => 'Nenhum consentimento dado', - 'tr' => 'Onay verilmemiş', - ), - 'noconsent_text' => array ( - 'no' => 'Du har ikke akseptert å overlevere opplysninger til tjenesteleverandøren.', - 'nn' => 'Du har ikkje akseptert til at dine opplysningar kan sendast til tenesteleverandøren', - 'da' => 'Du har ikke givet samtykke til overleveringen af oplysninger til tjenesten', - 'en' => 'You did not give consent for transfering your attributes to the service provider.', - 'de' => 'Sie haben der Weitergabe ihrer Daten an den Service Provider nicht zugestimmt.', - 'sv' => 'Du gav inte samtycke för att överföra dina attribut till tjänsteleverantören.', - 'fi' => 'Et antanut lupaa siirtää henkilötietojasi palveluntarjoajalle', - 'es' => 'No ha dado su consentimiento para tranferir sus atributos al proveedor de servicio.', - 'nl' => 'U heeft geen toestemming gegeven om uw attributen naar de Service Provider te versturen', - 'sl' => 'Niste podali privolitve za posredovanje atributov SP-ju.', - 'hr' => 'Niste dali pristanak da se vaši podaci isporuče davatelju usluge.', - 'hu' => 'Nem adta hozzájárulását, hogy adatait továbbadjuk a szolgáltatónak.', - 'pl' => 'Nie wyraziłeś zgody na przesłanie Twoich atrybutów do Dostawcy Serwisu.', - 'pt' => 'Negou o consentimento para a transferência dos seus atributos para o fornecedor de serviço.', - 'pt-br' => 'Você não deu o consentimento para a transferência de seus atributos para o provedor de serviços.', - 'tr' => 'Bilgilerinizin servis sağlayıcıya gönderilmesi için onay vermediniz.', - ), - 'noconsent_return' => array ( - 'no' => 'Gå tilbake til aksept-siden med opplysninger', - 'nn' => 'Gå tilbake til aksept-sida for overføring av opplysningar', - 'da' => 'Gå tilbage', - 'en' => 'Return to consent page', - 'de' => 'Zurück', - 'sv' => 'Åter till sidan för samtycke', - 'fi' => 'Palaa hyväksyntäsivulle', - 'es' => 'Volver a la página de consentimiento', - 'nl' => 'Keer terug naar de toestemmingspagina', - 'sl' => 'Vrnitev na privolitveno stran', - 'hr' => 'Povratak na stranicu s dozvolama', - 'hu' => 'Vissza az hozzájárulás-kezelő oldalra', - 'pl' => 'Powrót do strony wydania zezwolenia.', - 'pt' => 'Voltar à página de consentimento', - 'pt-br' => 'Retornar a página de consentimento', - 'tr' => 'Onay sayfasına geri dön', - ), - 'noconsent_goto_about' => array ( - 'no' => 'Gå til informasjonsside om tjenesten', - 'nn' => 'Gå til informasjonssida for tenesta', - 'da' => 'Gå til side med information om tjenesten', - 'en' => 'Go to information page for the service', - 'de' => 'Gehe zur Informationsseite dieses Dienstes', - 'sv' => 'Gå till tjänstens informationssida', - 'fi' => 'Siirry palvelun tiedot -sivulle', - 'es' => 'Ir a la página de información del servicio', - 'nl' => 'Ga naar de informatiepagina voor de service', - 'sl' => 'Pojdi na spletno stran z informacijami o storitvi', - 'hr' => 'Idi na stranicu s informacijama o servisu', - 'hu' => 'A szolgáltatás információs oldalára', - 'pl' => 'Przejdź do strony informacyjnej dla tego serwisu', - 'pt' => 'Ir para página de informação do serviço', - 'tr' => 'Servis için bilgi sayfasına git', - ), - 'table_caption' => array ( - 'no' => 'Bruker innformasjon', - 'da' => 'Bruger information', - 'en' => 'User information', - 'de' => 'Benutzerdaten', - 'sv' => 'Användarinformation', - 'fi' => 'Käyttäjätiedot', - 'es' => 'Información del usuario', - 'nl' => 'Gerbuikersinformatie', - 'sl' => 'Podatki o uporabniku', - 'hu' => 'Felhasználói információk', - 'pt' => 'Informação do utilizador', - 'tr' => 'Kullanıcı bilgisi', - ), - 'table_summary' => array ( - 'no' => 'Her listes den innformasjonen om deg som blir send til den tjenesten du er i ferd med å logge på', - 'da' => 'Informationer som vil blive sendt til den service du er ved at logge in på', - 'en' => 'List the information about you that is about to be transmitted to the service you are going to login to', - 'sv' => 'Visa den nformation om din användare som kommer att skickas till tjänsten som du är på väg att logga in i', - 'fi' => 'Näytä tietosi, joita ollaan siirtämässä palveluun', - 'es' => 'Muestra que información relativa a usted va a ser transmitida al servicio en el que se va a identificar', - 'nl' => 'De informatie die over jou bekend is en naar de service waarop je wilt inloggen verstuurd zal worden', - 'sl' => 'Seznam podatkov o vas, ki bodo posredovani storitvi, v katero se nameravate prijaviti', - 'hu' => 'Ezeket az adatokat fogjuk elküldeni Önről annak a szolgáltatásnak, ahová be kíván jelentkezni', - 'pt' => 'Listar a informação acerca de si que será enviada para o serviço no qual se está autenticar', - 'tr' => 'Girmek istediğiniz servise gönderilecek bilginizi listeleyin', - ), - -); +$lang = [ + 'yes' => [ + 'no' => 'Ja, fortsett', + 'nn' => 'Ja, fortsett', + 'da' => 'Ja, jeg accepterer', + 'en' => 'Yes, continue', + 'de' => 'Ja, ich stimmte zu', + 'sv' => 'Ja', + 'fi' => 'Kyllä', + 'es' => 'Sí', + 'fr' => 'Oui', + 'nl' => 'Ja, ik ga akkoord', + 'lb' => 'Jo', + 'sl' => 'Da, nadaljuj', + 'hr' => 'Da, prihvaćam', + 'hu' => 'Igen, elfogadom', + 'pl' => 'Tak, akceptuję', + 'pt' => 'Sim, Aceito', + 'pt-br' => 'Sim, Aceito', + 'tr' => 'Evet, devam et', + ], + 'no' => [ + 'no' => 'Nei, avbryt', + 'nn' => 'Nei, avbryt', + 'da' => 'Nej, jeg accepterer ikke', + 'en' => 'No, cancel', + 'de' => 'Nein, ich stimmte nicht zu', + 'sv' => 'Nej', + 'fi' => 'ei', + 'es' => 'No', + 'fr' => 'Non', + 'nl' => 'Nee, ik weiger', + 'lb' => 'Nee', + 'sl' => 'Ne, prekliči', + 'hr' => 'Ne privaćam', + 'hu' => 'Nem, nem fogadom el', + 'pl' => 'Nie, nie akceptuję', + 'pt' => 'Não aceito', + 'pt-br' => 'Não, não aceito', + 'tr' => 'Hayır, iptal et', + ], + 'remember' => [ + 'no' => 'Godta også for fremtiden', + 'nn' => 'Godta også for framtida', + 'da' => 'Husk samtykke', + 'en' => 'Remember', + 'de' => 'Zustimmung merken', + 'sv' => 'Spara samtycke', + 'fi' => 'Muista', + 'es' => 'Recordar el consentimiento', + 'fr' => 'Se souvenir du consentement', + 'nl' => 'Bewaar toestemming', + 'lb' => 'Zoustëmmung verhalen', + 'sl' => 'Zapomni si privolitev.', + 'hr' => 'Zapamti dozvole', + 'hu' => 'Emlékezzen a hozzájárulásra', + 'pl' => 'Pamiętaj moją zgodę', + 'pt' => 'Lembrar a minha escolha', + 'pt-br' => 'Lembrar Consentimento', + 'tr' => 'Hatırla', + ], + 'consent_header' => [ + 'no' => 'Samtykke om overføring av personinformasjon', + 'nn' => 'Samtykke til overføring av personinformasjon', + 'da' => 'Samtykke til at frigive personlige oplysninger', + 'en' => 'Consent about releasing personal information', + 'de' => 'Zustimmung zur Weitergabe persönlicher Daten ', + 'sv' => 'Samtycke gällande överföring av personinformation', + 'fi' => 'Henkilötietojen luovutuksen hyväksyntä', + 'es' => 'Consentimiento para la liberación de información personal', + 'nl' => 'Toestemming voor het vrijgeven van persoonsgegevens', + 'sl' => 'Odločitev o privolitvi posredovanja vaših osebnih podatkov', + 'hr' => 'Dozvola za isporuku osobnih podataka', + 'hu' => 'Hozzájárulás személyes adatok kiadásához', + 'pl' => 'Zgoda na wysłanie danych osobistych', + 'pt' => 'Consentimento do envio de informação pessoal', + 'tr' => 'Kişisel bilgilerin verilmesi hakkında onay', + ], + 'consent_accept' => [ + 'no' => 'For å fullføre innloggingen må du godta at opplysningene nedenfor sendes til SPNAME.', + 'nn' => 'For å fullføra innlogginga må du godta at opplysningane under blir sende til SPNAME', + 'da' => 'SPNAME kræver at nedenstående oplysninger overføres fra IDPNAME. Vil du acceptere dette?', + 'en' => 'SPNAME requires that the information below is transferred.', + 'de' => 'SPNAME erfordert die Übertragung untenstehender Information von IDPNAME. Akzeptieren Sie das?', + 'sv' => 'Du är på väg att logga in i tjänsten SPNAME. Tjänsten kräver att informationen nedan skickas från IDPNAME. Är detta okej?', + 'fi' => 'Olet kirjautumassa palveluun SPNAME. Identiteetilähteesi henkilötietojasi palvelun tarjoajalle. Hyväksytkö tietojen siirron?', + 'es' => 'Está a punto de acceder al servicio SPNAME. El servicio requiere que la información que se muestra a continuación sea transferida desde IDPNAME. ¿Acepta esto? ', + 'fr' => 'Vous êtes sur le point de vous connecter au service SPNAME. Lors de l\'ouverture de session, le fournisseur d\'identité enverra des informations sur votre identité à ce service. Acceptez-vous cela ?', + 'nl' => 'U gaat inloggen bij een dienst SPNAME. Tijdens het loginproces stuurt de identity provider zgn. attributen met daarin informatie over uw identiteit voor deze dienst. Bent u het daarmee eens?', + 'lb' => 'Daer sid dobai aerch um service unzemellen SPNAME. Waerend dem Login Prozess schéckt den Identity Provider Attributer, déi Informatiounen iwert aer Identitéit enthaalen. Akzeptéier daer daat?', + 'sl' => 'Pravkar se nameravate prijaviti v storitev SPNAME. Med postopkom prijave bo IdP tej storitvi posredoval atribute, ki vsebujejo informacije o vaši identiteti. Ali se s tem strinjate? ', + 'hr' => 'U tijeku je proces prijave za pristup servisu SPNAME. Servis zahtjeva da IDPNAME isporuči dolje navedene podatke. Slažete li se s time?', + 'hu' => 'Ön azonosítja magát ehhez a szolgáltatáshoz SPNAME. Az azonosítás során IDPNAME az alábbi adatokat fogja küldeni a szolgáltatásnak. Engedélyezi?', + 'pl' => 'SPNAME wymaga aby poniższa informacja została przesłana.', + 'pt' => 'O serviço SPNAME necessita que a informação apresentada em baixo seja transferida.', + 'pt-br' => 'Você está prestes a acessar o serviço SPNAME. O serviço exige que as informações a seguir sejam transferidas do IDPNAME. Você aceita isso?', + 'tr' => 'SPNAME aşağıdaki bilgilerin gönderilmesine ihtiyaç duyuyor.', + ], + 'consent_purpose' => [ + 'no' => 'Formålet med SPNAME er SPDESC', + 'nn' => 'Hensikta med SPNAME er SPDESC', + 'da' => 'SPNAME har til formål at SPDESC', + 'en' => 'The purpose of SPNAME is SPDESC', + 'de' => 'Der Zweck von SPNAME ist SPDESC', + 'sv' => 'Syftet med SPNAME är SPDESC', + 'fi' => 'Palvelun SPNAME käyttötarkoitus on SPDESC', + 'es' => 'El propósito de SPNAME es SPDESC', + 'nl' => 'Het doel van SPNAME is SPDESC', + 'sl' => 'Namen %SPNAME%: %SPDESC%', + 'hr' => 'Svrha SPNAME je SPDESC', + 'hu' => 'A szolgáltatás (SPNAME) ezt a célt szolgálja: SPDESC', + 'pl' => 'Celem SPNAME jest SPDESC', + 'pt' => 'O propósito de SPNAME é SPDESC', + 'tr' => 'SPNAME\'in amacı SPDESC\'tir', + ], + 'consent_privacypolicy' => [ + 'no' => 'Personvern for tjenesten', + 'nn' => 'Personvern for tenesta', + 'da' => 'Tjenestens politik vedrørende personoplysninger', + 'en' => 'Privacy policy for the service', + 'de' => 'Datenschutzrichtlinie des Dienstes', + 'sv' => 'Tjänstens policy för personlig integritet', + 'fi' => 'Tietosuojaseloste palvelulle', + 'es' => 'Política de privacidad para el servicio', + 'nl' => 'Privacybeleid voor de dienst', + 'sl' => 'Politika zasebnosti za ta SP', + 'hr' => 'Politika zaštite privatnosti', + 'hu' => 'A szolgáltatás adatvádelmi nyilatkozata', + 'pl' => 'Polityka prywatności dla serwisu', + 'pt' => 'Política de privacidade do serviço', + 'pt-br' => 'Política de Privacidade deste serviço', + 'tr' => 'Servis için gizlilik politikası', + ], + 'consent_attributes_header' => [ + 'no' => 'Opplysninger som vil bli sendt til SPNAME', + 'nn' => 'Opplysningar som blir sende til SPNAME', + 'da' => 'Attributter som bliver sendt til SPNAME', + 'en' => 'Information that will be sent to SPNAME', + 'de' => 'Informationen, die an SPNAME gesandt werden', + 'sv' => 'Attribut som kommer att skickas till tjänsten', + 'fi' => 'Tiedot lähetetään palvelulle SPNAME', + 'es' => 'Atributos que serán enviados al servicio', + 'nl' => 'Informatie die naar SPNAME zal worden gestuurd', + 'sl' => 'Atributi, ki bodo poslani SPju', + 'hr' => 'Atributi koji će biti poslani servisu', + 'hu' => 'A(z) SPNAME szolgáltatónak küldött adatok', + 'pl' => 'Atrybuty, które zostaną przesłane do serwisu', + 'pt' => 'Informação que irá ser enviada para SPNAME', + 'tr' => 'SPNAME\'e gönderilecek bilgiler', + ], + 'show_attributes' => [ + 'no' => 'Vis opplysninger', + 'nn' => 'Vis opplysingar', + 'da' => 'Vis attributter', + 'en' => 'Show attributes', + 'de' => 'Attribute zeigen', + 'sv' => 'Visa attribut', + 'fi' => 'Näytä henkilötiedot', + 'es' => 'Mostrar atributos', + 'nl' => 'Toon attributen', + 'sl' => 'Prikaži atribute', + 'hr' => 'Prikaži atribute', + 'hu' => 'Mutasd az attribútumokat', + 'pl' => 'Wyświetl atrybuty', + 'pt' => 'Mostrar atributos', + 'tr' => 'Özellikleri göster', + ], + 'show_attribute' => [ + 'no' => 'Vis innhold', + 'nn' => 'Vis innhald', + 'da' => 'Vis indhold', + 'en' => 'Show content', + 'sv' => 'Visa samtycke', + 'es' => 'Mostrart consentimiento', + 'nl' => 'Toon inhoud', + 'sl' => 'Prikaži vsebino', + ], + 'login' => [ + 'no' => 'innlogging', + 'nn' => 'Logg inn', + 'da' => 'login', + 'en' => 'login', + 'de' => 'anmelden', + 'sv' => 'Logga in', + 'fi' => 'Tunnus', + 'es' => 'login', + 'fr' => 'ouvrir une session', + 'nl' => 'Login', + 'lb' => 'anloggen', + 'sl' => 'Prijava', + 'hr' => 'prijava', + 'hu' => 'bejelentkezés', + 'pl' => 'login', + 'pt' => 'Entrar', + 'pt-br' => 'login', + 'tr' => 'Giriş', + ], + 'service_providers_for' => [ + 'no' => 'Tjenesteleverandør for', + 'nn' => 'Tenesteleverandørar for', + 'da' => 'Tjenesteudbyder for', + 'en' => 'Service Providers for', + 'de' => 'Service-Provider für', + 'sv' => 'Tjänsteleverantörer för', + 'fi' => 'Palveluntarjoaja', + 'es' => 'Proveedores de servicio para', + 'fr' => 'Fournisseurs de services pour', + 'nl' => 'Service Providers voor', + 'lb' => 'Service Provider fir', + 'sl' => 'SP za', + 'hr' => 'Davatelji usluge za', + 'hu' => 'Alkalmazásszolgáltatók a következő számára', + 'pl' => 'Dostawca Serwisu dla', + 'pt' => 'Fornecedores de Serviço (SP) para', + 'pt-br' => 'Provedor de serviços para', + 'tr' => 'için Servis Sağlayıcılar', + ], + 'service_provider_header' => [ + 'no' => 'Tjenesteleverandør', + 'nn' => 'Tenesteleverandør', + 'da' => 'Tjenesteudbyder', + 'en' => 'Service Provider', + 'de' => 'Service-Provider', + 'sv' => 'Tjänsteleverantör', + 'fi' => 'Palveluntarjoaja', + 'es' => 'Proveedor de servicio', + 'fr' => 'Fournisseur de service', + 'nl' => 'Service Provider', + 'lb' => 'Service Provider', + 'sl' => 'SP', + 'hr' => 'Davatelj usluge', + 'hu' => 'Alkalmazásszolgáltató', + 'pl' => 'Dostawca serwisu', + 'pt' => 'Fornecedor de Serviço (SP)', + 'pt-br' => 'Provedor de Serviços', + 'tr' => 'Servis Sağlayıcı', + ], + 'status_header' => [ + 'no' => 'Samtykke-status', + 'nn' => 'Samtykkestatus', + 'da' => 'Samtykke status', + 'en' => 'Consent status', + 'de' => 'Zustimmungsstatus', + 'sv' => 'Status för samtycke', + 'fi' => 'Hyväksynnään tila', + 'es' => 'Estado del consentimiento', + 'fr' => 'État des consentements', + 'nl' => 'Toestemming status', + 'lb' => 'Zoustëmmungsstatus', + 'sl' => 'Stanje privolitve', + 'hr' => 'Status dozvole', + 'hu' => 'Hozzájárulás állapota', + 'pl' => 'Status zgody', + 'pt' => 'Consentimento', + 'pt-br' => 'Status do Consentimento', + 'tr' => 'Onay durumu', + ], + 'show_hide_attributes' => [ + 'no' => 'Vis/skjul opplysninger', + 'nn' => 'Vis/skjul opplysningar', + 'da' => 'vis/skjul attributter', + 'en' => 'show/hide attributes', + 'de' => 'zeige/verstecke Eigenschaften', + 'sv' => 'visa/göm attribut', + 'fi' => 'Näytä/piilota attribuutteja', + 'es' => 'Mostrar/ocultar atributos', + 'fr' => 'montrer/cacher les attributs', + 'nl' => 'toon/verberg attributen', + 'lb' => 'Attributer weisen/verstoppen', + 'sl' => 'prikaži/skrij atribute', + 'hr' => 'prikaži/sakrij atribute', + 'hu' => 'attribútumok mutatása/elrejtése', + 'pl' => 'pokaż/ukryj atrybuty', + 'pt' => 'Mostrar/Ocultar atributos', + 'pt-br' => 'mostra/esconder Atributos', + 'tr' => 'bilgileri göster/gizle ', + ], + 'noconsent_title' => [ + 'no' => 'Ikke akseptert overføring av informasjon', + 'nn' => 'Ikkje akseptert overføring av informasjon', + 'da' => 'Manglende samtykke', + 'en' => 'No consent given', + 'de' => 'Zustimmung verweigert', + 'sv' => 'Inget samtycket givet', + 'fi' => 'Lupaa ei annettu', + 'es' => 'No se dió el consentimiento', + 'nl' => 'Geen toestemming gegeven', + 'sl' => 'Privolitev ni bila dana.', + 'hr' => 'Nema pristanka', + 'hu' => 'Nincs hozzájárulás', + 'pl' => 'Nie wyrażono zgody', + 'pt' => 'Consentimento negado', + 'pt-br' => 'Nenhum consentimento dado', + 'tr' => 'Onay verilmemiş', + ], + 'noconsent_text' => [ + 'no' => 'Du har ikke akseptert å overlevere opplysninger til tjenesteleverandøren.', + 'nn' => 'Du har ikkje akseptert til at dine opplysningar kan sendast til tenesteleverandøren', + 'da' => 'Du har ikke givet samtykke til overleveringen af oplysninger til tjenesten', + 'en' => 'You did not give consent for transfering your attributes to the service provider.', + 'de' => 'Sie haben der Weitergabe ihrer Daten an den Service Provider nicht zugestimmt.', + 'sv' => 'Du gav inte samtycke för att överföra dina attribut till tjänsteleverantören.', + 'fi' => 'Et antanut lupaa siirtää henkilötietojasi palveluntarjoajalle', + 'es' => 'No ha dado su consentimiento para tranferir sus atributos al proveedor de servicio.', + 'nl' => 'U heeft geen toestemming gegeven om uw attributen naar de Service Provider te versturen', + 'sl' => 'Niste podali privolitve za posredovanje atributov SP-ju.', + 'hr' => 'Niste dali pristanak da se vaši podaci isporuče davatelju usluge.', + 'hu' => 'Nem adta hozzájárulását, hogy adatait továbbadjuk a szolgáltatónak.', + 'pl' => 'Nie wyraziłeś zgody na przesłanie Twoich atrybutów do Dostawcy Serwisu.', + 'pt' => 'Negou o consentimento para a transferência dos seus atributos para o fornecedor de serviço.', + 'pt-br' => 'Você não deu o consentimento para a transferência de seus atributos para o provedor de serviços.', + 'tr' => 'Bilgilerinizin servis sağlayıcıya gönderilmesi için onay vermediniz.', + ], + 'noconsent_return' => [ + 'no' => 'Gå tilbake til aksept-siden med opplysninger', + 'nn' => 'Gå tilbake til aksept-sida for overføring av opplysningar', + 'da' => 'Gå tilbage', + 'en' => 'Return to consent page', + 'de' => 'Zurück', + 'sv' => 'Åter till sidan för samtycke', + 'fi' => 'Palaa hyväksyntäsivulle', + 'es' => 'Volver a la página de consentimiento', + 'nl' => 'Keer terug naar de toestemmingspagina', + 'sl' => 'Vrnitev na privolitveno stran', + 'hr' => 'Povratak na stranicu s dozvolama', + 'hu' => 'Vissza az hozzájárulás-kezelő oldalra', + 'pl' => 'Powrót do strony wydania zezwolenia.', + 'pt' => 'Voltar à página de consentimento', + 'pt-br' => 'Retornar a página de consentimento', + 'tr' => 'Onay sayfasına geri dön', + ], + 'noconsent_goto_about' => [ + 'no' => 'Gå til informasjonsside om tjenesten', + 'nn' => 'Gå til informasjonssida for tenesta', + 'da' => 'Gå til side med information om tjenesten', + 'en' => 'Go to information page for the service', + 'de' => 'Gehe zur Informationsseite dieses Dienstes', + 'sv' => 'Gå till tjänstens informationssida', + 'fi' => 'Siirry palvelun tiedot -sivulle', + 'es' => 'Ir a la página de información del servicio', + 'nl' => 'Ga naar de informatiepagina voor de service', + 'sl' => 'Pojdi na spletno stran z informacijami o storitvi', + 'hr' => 'Idi na stranicu s informacijama o servisu', + 'hu' => 'A szolgáltatás információs oldalára', + 'pl' => 'Przejdź do strony informacyjnej dla tego serwisu', + 'pt' => 'Ir para página de informação do serviço', + 'tr' => 'Servis için bilgi sayfasına git', + ], + 'table_caption' => [ + 'no' => 'Bruker innformasjon', + 'da' => 'Bruger information', + 'en' => 'User information', + 'de' => 'Benutzerdaten', + 'sv' => 'Användarinformation', + 'fi' => 'Käyttäjätiedot', + 'es' => 'Información del usuario', + 'nl' => 'Gerbuikersinformatie', + 'sl' => 'Podatki o uporabniku', + 'hu' => 'Felhasználói információk', + 'pt' => 'Informação do utilizador', + 'tr' => 'Kullanıcı bilgisi', + ], + 'table_summary' => [ + 'no' => 'Her listes den innformasjonen om deg som blir send til den tjenesten du er i ferd med å logge på', + 'da' => 'Informationer som vil blive sendt til den service du er ved at logge in på', + 'en' => 'List the information about you that is about to be transmitted to the service you are going to login to', + 'sv' => 'Visa den nformation om din användare som kommer att skickas till tjänsten som du är på väg att logga in i', + 'fi' => 'Näytä tietosi, joita ollaan siirtämässä palveluun', + 'es' => 'Muestra que información relativa a usted va a ser transmitida al servicio en el que se va a identificar', + 'nl' => 'De informatie die over jou bekend is en naar de service waarop je wilt inloggen verstuurd zal worden', + 'sl' => 'Seznam podatkov o vas, ki bodo posredovani storitvi, v katero se nameravate prijaviti', + 'hu' => 'Ezeket az adatokat fogjuk elküldeni Önről annak a szolgáltatásnak, ahová be kíván jelentkezni', + 'pt' => 'Listar a informação acerca de si que será enviada para o serviço no qual se está autenticar', + 'tr' => 'Girmek istediğiniz servise gönderilecek bilginizi listeleyin', + ], +]; diff --git a/vendor/simplesamlphp/simplesamlphp/modules/consent/dictionaries/consent.translation.json b/vendor/simplesamlphp/simplesamlphp/modules/consent/dictionaries/consent.translation.json index 12ddfefed1..9901beb5a2 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/consent/dictionaries/consent.translation.json +++ b/vendor/simplesamlphp/simplesamlphp/modules/consent/dictionaries/consent.translation.json @@ -1,762 +1,807 @@ { - "yes": { - "no": "Ja, fortsett", - "nn": "Ja, fortsett", - "sv": "Ja", - "es": "S\u00ed", - "fr": "Oui", - "de": "Ja, ich stimme zu", - "nl": "Ja, ik ga akkoord", - "lb": "Jo", - "sl": "Da, nadaljuj", - "da": "Ja, jeg accepterer", - "hr": "Da, nastavi", - "hu": "Igen, elfogadom", - "fi": "Kyll\u00e4", - "pt-br": "Sim, Aceito", - "pt": "Sim, Aceito", - "pl": "Tak, akceptuj\u0119", - "cs": "Ano, akceptuji", - "tr": "Evet, devam et", - "it": "S\u00ec, continuare", - "lt": "Taip, t\u0119sti", - "ja": "\u306f\u3044\u3001\u7d9a\u3051\u307e\u3059", - "zh-tw": "\u662f\uff0c\u7e7c\u7e8c", - "et": "Jah, j\u00e4tka", - "he": "\u05db\u05df, \u05d4\u05de\u05e9\u05da", - "ru": "\u0414\u0430, \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442\u044c", - "zh": "\u662f\u7684\uff0c\u7ee7\u7eed", - "ar": "\u0646\u0639\u0645\u060c \u0648\u0627\u0635\u0644", - "lv": "J\u0101, turpin\u0101t", - "id": "Yam lanjutkan", - "sr": "Da, nastavi", - "ro": "Da, continu\u0103", - "eu": "Bai, jarraitu", - "af": "Ja, voortgaan", - "el": "\u0391\u03c0\u03bf\u03b4\u03bf\u03c7\u03ae" - }, - "no": { - "no": "Nei, avbryt", - "nn": "Nei, avbryt", - "sv": "Nej", - "es": "No", - "fr": "Non", - "de": "Nein, ich stimme nicht zu", - "nl": "Nee, ik weiger", - "lb": "Nee", - "sl": "Ne, prekli\u010di", - "da": "Nej, jeg accepterer ikke", - "hr": "Ne, odustani", - "hu": "Nem, nem fogadom el", - "fi": "ei", - "pt-br": "N\u00e3o, n\u00e3o aceito", - "pt": "N\u00e3o aceito", - "pl": "Nie, nie akceptuj\u0119", - "cs": "Ne, neakceptuji", - "tr": "Hay\u0131r, iptal et", - "it": "No, cancellare", - "lt": "Ne, nutraukti", - "ja": "\u3044\u3044\u3048\u3001\u30ad\u30e3\u30f3\u30bb\u30eb\u3057\u307e\u3059", - "zh-tw": "\u4e0d\uff0c\u53d6\u6d88", - "et": "Ei, loobu", - "he": "\u05dc\u05d0, \u05d1\u05d8\u05dc", - "ru": "\u041d\u0435\u0442, \u043e\u0442\u043c\u0435\u043d\u0438\u0442\u044c", - "zh": "\u4e0d\uff0c\u53d6\u6d88", - "ar": "\u0644\u0627\u060c \u0627\u0644\u063a", - "lv": "N\u0113, atcelt", - "id": "Tidak, batalkan", - "sr": "Ne, odustani", - "ro": "Nu, renun\u021b", - "eu": "Ez, utzi", - "af": "Nee, kanselleer", - "el": "\u0391\u03c0\u03cc\u03c1\u03c1\u03b9\u03c8\u03b7" - }, - "remember": { - "no": "Godta ogs\u00e5 for fremtiden", - "nn": "Godta ogs\u00e5 for framtida", - "sv": "Spara samtycke", - "es": "Recordar el consentimiento", - "fr": "Se souvenir du consentement", - "de": "Zustimmung merken", - "nl": "Bewaar toestemming", - "lb": "Zoust\u00ebmmung verhalen", - "sl": "Zapomni si privolitev.", - "da": "Husk samtykke", - "hr": "Zapamti moj odabir", - "hu": "Eml\u00e9kezzen a hozz\u00e1j\u00e1rul\u00e1sra", - "fi": "Muista", - "pt-br": "Lembrar Consentimento", - "pt": "Lembrar a minha escolha", - "pl": "Pami\u0119taj moj\u0105 zgod\u0119", - "cs": "Zapamatuj", - "tr": "Hat\u0131rla", - "it": "Ricordare", - "lt": "\u012esiminti", - "ja": "\u8a18\u61b6\u3059\u308b", - "zh-tw": "\u8a18\u4f4f", - "et": "J\u00e4ta meelde", - "he": "\u05d6\u05db\u05d5\u05e8", - "ru": "\u0417\u0430\u043f\u043e\u043c\u043d\u0438\u0442\u044c", - "zh": "\u8bb0\u4f4f", - "ar": "\u062a\u0630\u0643\u0631\u0623\u0644\u063a\u062a \u0630\u0643\u0631", - "lv": "Atcer\u0113ties", - "id": "Ingat", - "sr": "Zapamti moj izbor", - "ro": "\u021aine minte", - "eu": "Onespena gogoratu", - "af": "Onthou", - "el": "\u039d\u03b1 \u03b8\u03c5\u03bc\u03ac\u03c3\u03b1\u03b9 \u03c4\u03b7\u03bd \u03b5\u03c0\u03b9\u03bb\u03bf\u03b3\u03ae \u03bc\u03bf\u03c5" - }, - "consent_accept": { - "no": "For \u00e5 fullf\u00f8re innloggingen m\u00e5 du godta at opplysningene nedenfor sendes til SPNAME.", - "nn": "For \u00e5 fullf\u00f8ra innlogginga m\u00e5 du godta at opplysningane under blir sende til SPNAME", - "sv": "Du \u00e4r p\u00e5 v\u00e4g att logga in i tj\u00e4nsten SPNAME. Tj\u00e4nsten kr\u00e4ver att informationen nedan skickas fr\u00e5n IDPNAME. \u00c4r detta okej?", - "es": "Est\u00e1 a punto de acceder al servicio SPNAME. El servicio requiere que la informaci\u00f3n que se muestra a continuaci\u00f3n sea transferida desde IDPNAME. \u00bfAcepta esto?", - "fr": "Vous \u00eates sur le point de vous connecter au service SPNAME. Lors de l'ouverture de session, le fournisseur d'identit\u00e9 enverra des informations sur votre identit\u00e9 \u00e0 ce service. Acceptez-vous cela ?", - "de": "SPNAME erfordert die \u00dcbertragung untenstehender Information von IDPNAME. Akzeptieren Sie das?", - "nl": "U gaat inloggen bij een dienst SPNAME. Tijdens het loginproces stuurt de identity provider zgn. attributen met daarin informatie over uw identiteit voor deze dienst. Bent u het daarmee eens?", - "lb": "Daer sid dobai aerch um service unzemellen SPNAME. Waerend dem Login Prozess sch\u00e9ckt den Identity Provider Attributer, d\u00e9i Informatiounen iwert aer Identit\u00e9it enthaalen. Akzept\u00e9ier daer daat?", - "sl": "Pravkar se nameravate prijaviti v storitev SPNAME. Med postopkom prijave bo IdP tej storitvi posredoval atribute, ki vsebujejo informacije o va\u0161i identiteti. Ali se s tem strinjate? ", - "da": "SPNAME kr\u00e6ver at nedenst\u00e5ende oplysninger overf\u00f8res fra IDPNAME. Vil du acceptere dette?", - "hr": "Servis SPNAME zahtjeva isporuku dolje navedenih podataka.", - "hu": "\u00d6n azonos\u00edtja mag\u00e1t ehhez a szolg\u00e1ltat\u00e1shoz SPNAME. Az azonos\u00edt\u00e1s sor\u00e1n IDPNAME az al\u00e1bbi adatokat fogja k\u00fcldeni a szolg\u00e1ltat\u00e1snak. Enged\u00e9lyezi?", - "fi": "Olet kirjautumassa palveluun SPNAME. Identiteetil\u00e4hteesi henkil\u00f6tietojasi palvelun tarjoajalle. Hyv\u00e4ksytk\u00f6 tietojen siirron?", - "pt-br": "Voc\u00ea est\u00e1 prestes a acessar o servi\u00e7o SPNAME. O servi\u00e7o exige que as informa\u00e7\u00f5es a seguir sejam transferidas do IDPNAME. Voc\u00ea aceita isso?", - "pt": "O servi\u00e7o SPNAME necessita que a informa\u00e7\u00e3o apresentada em baixo seja transferida.", - "pl": "SPNAME wymaga aby poni\u017csza informacja zosta\u0142a przes\u0142ana.", - "cs": "M\u016f\u017eete se p\u0159ihl\u00e1sit do slu\u017eby SPNAME", - "tr": "SPNAME a\u015fa\u011f\u0131daki bilgilerin g\u00f6nderilmesine ihtiya\u00e7 duyuyor.", - "it": "SPNAME richiede che l'informazione sotto riportata sia trasferita.", - "lt": "SPNAME reikalauja persi\u0173sti \u017eemiau pateikt\u0105 informacij\u0105", - "ja": "SPNAME\u306f\u4ee5\u4e0b\u306e\u5909\u63db\u3055\u308c\u305f\u60c5\u5831\u3092\u8981\u6c42\u3057\u307e\u3059\u3002", - "zh-tw": "SPNAME \u8981\u6c42\u8a72\u8cc7\u8a0a\u65bc\u9019\u500b\u50b3\u9001\u3002", - "et": "SPNAME n\u00f5uab allpool oleva info edastamist.", - "he": "SPNAME \u05d3\u05d5\u05e8\u05e9 \u05e9\u05de\u05d9\u05d3\u05e2 \u05d4\u05e0\"\u05dc \u05d9\u05d5\u05e2\u05d1\u05e8", - "ru": "SPNAME \u0442\u0440\u0435\u0431\u0443\u0435\u0442, \u0447\u0442\u043e\u0431\u044b \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f, \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u0430\u044f \u043d\u0438\u0436\u0435, \u0431\u044b\u043b\u0430 \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u0430.", - "zh": "SPNAME\u8bf7\u6c42\u7684\u4fe1\u606f\u5df2\u7ecf\u88ab\u4f20\u8f93\u51fa\u53bb", - "ar": "\u064a\u062d\u062a\u0627\u062c SPNAME \u062a\u062d\u0648\u064a\u0644 \u0627\u0644\u0628\u064a\u0627\u0646\u0627\u062a \u0623\u062f\u0646\u0627\u0647 ", - "lv": "SPNAME prasa p\u0101rraid\u012bt pa t\u012bklu zem\u0101k eso\u0161o inform\u0101ciju.", - "id": "SPNAME mensyaratkan informasi dibawah ini harus ditransder.", - "sr": "Servis SPNAME zahteva slanje dole navedenih podataka.", - "ro": "SPNAME solicit\u0103 trimiterea informa\u021biilor de mai jos.", - "eu": "Zerbitzuak, hemen agertzen den informazioa lekualdatzea eskatzen du.", - "af": "SPNAME vereis dat die inligting hieronder oorgedra word.", - "el": "\u0395\u03ac\u03bd \u03c0\u03c1\u03bf\u03c7\u03c9\u03c1\u03ae\u03c3\u03b5\u03c4\u03b5\u002c \u03c4\u03b1 \u03c3\u03c4\u03bf\u03b9\u03c7\u03b5\u03af\u03b1 \u03c0\u03bf\u03c5 \u03b1\u03ba\u03bf\u03bb\u03bf\u03c5\u03b8\u03bf\u03cd\u03bd \u03b8\u03b1 \u03b4\u03b9\u03b1\u03bc\u03bf\u03b9\u03c1\u03b1\u03c3\u03c4\u03bf\u03cd\u03bd \u03bc\u03b5 \u03c4\u03b7\u03bd \u03c5\u03c0\u03b7\u03c1\u03b5\u03c3\u03af\u03b1 <b>SPNAME<\/b>. \u03a3\u03c5\u03bc\u03c6\u03c9\u03bd\u03b5\u03af\u03c4\u03b5 \u03bc\u03b5 \u03c4\u03b7\u03bd \u03b1\u03c0\u03b5\u03bb\u03b5\u03c5\u03b8\u03ad\u03c1\u03c9\u03c3\u03b7 \u03c4\u03c9\u03bd \u03c3\u03c4\u03bf\u03b9\u03c7\u03b5\u03af\u03c9\u03bd \u03b1\u03c5\u03c4\u03ce\u03bd \u03c3\u03c4\u03b7\u03bd \u03c5\u03c0\u03b7\u03c1\u03b5\u03c3\u03af\u03b1 \u03ba\u03ac\u03b8\u03b5 \u03c6\u03bf\u03c1\u03ac \u03c0\u03bf\u03c5 \u03b5\u03c0\u03b9\u03b8\u03c5\u03bc\u03b5\u03af\u03c4\u03b5 \u03c0\u03c1\u03cc\u03c3\u03b2\u03b1\u03c3\u03b7 \u03c3\u03b5 \u03b1\u03c5\u03c4\u03ae\u003b" - }, - "login": { - "no": "innlogging", - "nn": "Logg inn", - "sv": "Logga in", - "es": "login", - "fr": "ouvrir une session", - "de": "anmelden", - "nl": "Login", - "lb": "anloggen", - "sl": "Prijava", - "da": "login", - "hr": "prijavi se", - "hu": "bejelentkez\u00e9s", - "fi": "Tunnus", - "pt-br": "login", - "pt": "Entrar", - "pl": "login", - "cs": "Login", - "tr": "Giri\u015f", - "it": "connessione", - "lt": "Prisijungti", - "ja": "\u30ed\u30b0\u30a4\u30f3", - "zh-tw": "\u767b\u5165", - "et": "logi sisse", - "he": "\u05db\u05e0\u05d9\u05e1\u05d4", - "ru": "\u041b\u043e\u0433\u0438\u043d", - "zh": "\u767b\u5f55", - "ar": "\u062a\u0633\u062c\u064a\u0644 \u0627\u0644\u062f\u062e\u0648\u0644", - "lv": "piesl\u0113gties", - "id": "login", - "sr": "prijavi se", - "ro": "autentificare", - "eu": "hasi saioa", - "af": "meld aan", - "el": "\u0395\u03af\u03c3\u03bf\u03b4\u03bf\u03c2" - }, - "service_providers_for": { - "no": "Tjenesteleverand\u00f8r for", - "nn": "Tenesteleverand\u00f8rar for", - "sv": "Tj\u00e4nsteleverant\u00f6rer f\u00f6r", - "es": "Proveedores de servicio para", - "fr": "Fournisseurs de services pour", - "de": "Service-Provider f\u00fcr", - "nl": "Service Providers voor", - "lb": "Service Provider fir", - "sl": "SP za", - "da": "Tjenesteudbyder for", - "hr": "Davatelji usluge za", - "hu": "Alkalmaz\u00e1sszolg\u00e1ltat\u00f3k a k\u00f6vetkez\u0151 sz\u00e1m\u00e1ra", - "fi": "Palveluntarjoaja", - "pt-br": "Provedor de servi\u00e7os para", - "pt": "Fornecedores de Servi\u00e7o (SP) para", - "pl": "Dostawca Serwisu dla", - "cs": "Poskytovatel slu\u017eby pro", - "tr": "i\u00e7in Servis Sa\u011flay\u0131c\u0131lar", - "it": "Service Provider per", - "lt": "Paslaug\u0173 teik\u0117jai", - "ja": "\u30b5\u30fc\u30d3\u30b9\u30d7\u30ed\u30d0\u30a4\u30c0: ", - "zh-tw": "\u7d66\u670d\u52d9\u63d0\u4f9b\u8005", - "et": "Teenusepakkujad", - "he": "\u05e1\u05e4\u05e7\u05d9 \u05e9\u05d9\u05e8\u05d5\u05ea \u05e2\u05d1\u05d5\u05e8", - "ru": "\u041f\u043e\u0441\u0442\u0430\u0432\u0449\u0438\u043a\u0438 \u0443\u0441\u043b\u0443\u0433 \u0434\u043b\u044f", - "zh": "\u670d\u52a1\u63d0\u4f9b\u8005\u7ed9", - "ar": "\u0645\u0642\u062f\u0645\u064a \u062e\u062f\u0645\u0627\u062a \u0644", - "lv": "Servisa pieg\u0101d\u0101t\u0101ji priek\u0161", - "id": "Service Provider untuk", - "sr": "Davaoci Servisa za", - "ro": "Furnizor de servicii pentru", - "eu": "Zerbitzu hornitzaileak hontarako: ", - "af": "Diens Verskaffers vir", - "el": "\u03a0\u03ac\u03c1\u03bf\u03c7\u03bf\u03b9 \u03c5\u03c0\u03b7\u03c1\u03b5\u03c3\u03b9\u03ce\u03bd \u03b3\u03b9\u03b1" - }, - "service_provider_header": { - "no": "Tjenesteleverand\u00f8r", - "nn": "Tenesteleverand\u00f8r", - "sv": "Tj\u00e4nsteleverant\u00f6r", - "es": "Proveedor de servicio", - "fr": "Fournisseur de service", - "de": "Service-Provider", - "nl": "Service Provider", - "lb": "Service Provider", - "sl": "SP", - "da": "Tjenesteudbyder", - "hr": "Davatelj usluge", - "hu": "Alkalmaz\u00e1sszolg\u00e1ltat\u00f3", - "fi": "Palveluntarjoaja", - "pt-br": "Provedor de Servi\u00e7os", - "pt": "Fornecedor de Servi\u00e7o (SP)", - "pl": "Dostawca serwisu", - "cs": "Poskytovatel slu\u017eby", - "tr": "Servis Sa\u011flay\u0131c\u0131", - "it": "Service Provider", - "lt": "Paslaugos teik\u0117jas", - "ja": "\u30b5\u30fc\u30d3\u30b9\u30d7\u30ed\u30d0\u30a4\u30c0", - "zh-tw": "\u670d\u52d9\u63d0\u4f9b\u8005", - "et": "Teenusepakkuja", - "he": "\u05e1\u05e4\u05e7 \u05e9\u05d9\u05e8\u05d5\u05ea", - "ru": "\u041f\u043e\u0441\u0442\u0430\u0432\u0449\u0438\u043a \u0443\u0441\u043b\u0443\u0433", - "zh": "\u670d\u52a1\u63d0\u4f9b\u8005", - "ar": "\u0645\u0642\u062f\u0645 \u062e\u062f\u0645\u0627\u062a", - "lv": "Servisa pieg\u0101d\u0101t\u0101js", - "id": "Service Provider", - "sr": "Davalac Servisa", - "ro": "Furnizor de servicii", - "eu": "Zerbitzu hornitzailea", - "af": "Diens Verskaffer", - "el": "\u03a0\u03ac\u03c1\u03bf\u03c7\u03bf\u03c2 \u03c5\u03c0\u03b7\u03c1\u03b5\u03c3\u03af\u03b1\u03c2" - }, - "status_header": { - "no": "Samtykke-status", - "nn": "Samtykkestatus", - "sv": "Status f\u00f6r samtycke", - "es": "Estado del consentimiento", - "fr": "\u00c9tat des consentements", - "de": "Zustimmungsstatus", - "nl": "Toestemming status", - "lb": "Zoust\u00ebmmungsstatus", - "sl": "Stanje privolitve", - "da": "Samtykke status", - "hr": "Status odobrenja", - "hu": "Hozz\u00e1j\u00e1rul\u00e1s \u00e1llapota", - "fi": "Hyv\u00e4ksynn\u00e4\u00e4n tila", - "pt-br": "Status do Consentimento", - "pt": "Consentimento", - "pl": "Status zgody", - "cs": "Status souhlasu", - "tr": "Onay durumu", - "it": "Stato del consenso", - "lt": "Leidimo b\u016bsena", - "ja": "\u627f\u8a8d\u30b9\u30c6\u30fc\u30bf\u30b9", - "zh-tw": "\u540c\u610f\u72c0\u614b", - "et": "N\u00f5usoleku olek", - "he": "\u05de\u05e6\u05d1 \u05d4\u05e1\u05db\u05de\u05d4", - "ru": "\u0420\u0430\u0437\u0440\u0435\u0448\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0441\u0442\u0430\u0442\u0443\u0441", - "zh": "\u540c\u610f\u72b6\u6001", - "ar": "\u062d\u0627\u0644\u0629 \u0645\u0648\u0627\u0641\u0642\u0629", - "lv": "Noteikumu statuss", - "id": "Status persetujuan", - "sr": "Status odobrenja", - "ro": "Stare acord", - "eu": "Onespen egoera", - "af": "Toestemming status", - "el": "\u039a\u03b1\u03c4\u03ac\u03c3\u03c4\u03b1\u03c3\u03b7 \u03c3\u03c5\u03b3\u03ba\u03b1\u03c4\u03ac\u03b8\u03b5\u03c3\u03b7\u03c2" - }, - "show_hide_attributes": { - "no": "Vis\/skjul opplysninger", - "nn": "Vis\/skjul opplysningar", - "sv": "visa\/g\u00f6m attribut", - "es": "Mostrar\/ocultar atributos", - "fr": "montrer\/cacher les attributs", - "de": "zeige\/verstecke Eigenschaften", - "nl": "toon\/verberg attributen", - "lb": "Attributer weisen\/verstoppen", - "sl": "prika\u017ei\/skrij atribute", - "da": "vis\/skjul attributter", - "hr": "prika\u017ei\/sakrij atribute", - "hu": "attrib\u00fatumok mutat\u00e1sa\/elrejt\u00e9se", - "fi": "N\u00e4yt\u00e4\/piilota attribuutteja", - "pt-br": "mostra\/esconder Atributos", - "pt": "Mostrar\/Ocultar atributos", - "pl": "poka\u017c\/ukryj atrybuty", - "cs": "zobraz\/skryj atributy", - "tr": "bilgileri g\u00f6ster\/gizle ", - "it": "Mostra\/nascondi attributi", - "lt": "rodyti\/sl\u0117pti atributus", - "ja": "\u8868\u793a\/\u975e\u8868\u793a\u5c5e\u6027", - "zh-tw": "\u986f\u793a\/\u96b1\u85cf\u5c6c\u6027", - "et": "n\u00e4ita\/peida atribuudid", - "he": "\u05d4\u05e8\u05d0\u05d4\\\u05d4\u05e1\u05ea\u05e8 \u05ea\u05db\u05d5\u05e0\u05d5\u05ea ", - "ru": "\u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c\/\u0441\u043a\u0440\u044b\u0442\u044c \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b", - "zh": "\u663e\u793a\/\u9690\u85cf\u5c5e\u6027", - "ar": "\u0627\u0638\u0647\u0631\/\u0627\u0644\u063a\u064a \u0627\u0644\u0633\u0645\u0627\u062a", - "lv": "r\u0101d\u012bt\/sl\u0113pt atrib\u016btus", - "id": "perlihatkan\/sembunyikan attribut", - "sr": "prika\u017ei\/sakrij atribute", - "ro": "arat\u0103\/ascunde atributele", - "eu": "erakutsi\/gorde atributuak", - "af": "vertoon\/verberg eienskappe", - "el": "\u03b5\u03bc\u03c6\u03ac\u03bd\u03b9\u03c3\u03b7\/\u03b1\u03c0\u03cc\u03ba\u03c1\u03c5\u03c8\u03b7 \u03c3\u03c4\u03bf\u03b9\u03c7\u03b5\u03af\u03c9\u03bd" - }, - "consent_privacypolicy": { - "no": "Personvern for tjenesten", - "nn": "Personvern for tenesta", - "sv": "Tj\u00e4nstens policy f\u00f6r personlig integritet", - "es": "Pol\u00edtica de privacidad para el servicio", - "de": "Datenschutzrichtlinie des Dienstes", - "nl": "Privacybeleid voor de dienst", - "sl": "Politika zasebnosti za ta SP", - "da": "Tjenestens politik vedr\u00f8rende personoplysninger", - "hr": "Politika za\u0161tite privatnosti kod servisa", - "hu": "A szolg\u00e1ltat\u00e1s adatv\u00e1delmi nyilatkozata", - "fi": "Tietosuojaseloste palvelulle", - "pt-br": "Pol\u00edtica de Privacidade deste servi\u00e7o", - "pt": "Pol\u00edtica de privacidade do servi\u00e7o", - "pl": "Polityka prywatno\u015bci dla serwisu", - "cs": "Bezpe\u010dnostn\u00ed politika slu\u017eby", - "tr": "Servis i\u00e7in gizlilik politikas\u0131", - "fr": "Politique de confidentialit\u00e9 pour ce service", - "it": "Politica della privacy per il servizio", - "lt": "\u0160ios paslaugos privatumo politika", - "ja": "\u30b5\u30fc\u30d3\u30b9\u306e\u30d7\u30e9\u30a4\u30d0\u30b7\u30dd\u30ea\u30b7\u30fc", - "zh-tw": "\u670d\u52d9\u96b1\u79c1\u6b0a\u653f\u7b56", - "et": "Teenuse privaatsuspoliitika", - "he": "\u05de\u05d3\u05d9\u05e0\u05d9\u05d5\u05ea \u05d4\u05e4\u05e8\u05d8\u05d9\u05d5\u05ea \u05e9\u05dc \u05d4\u05e9\u05d9\u05e8\u05d5\u05ea", - "ru": "\u041f\u043e\u043b\u0438\u0442\u0438\u043a\u0430 \u043a\u043e\u043d\u0444\u0438\u0434\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0434\u043b\u044f \u0441\u043b\u0443\u0436\u0431\u044b", - "zh": "\u8be5\u670d\u52a1\u7684\u9690\u79c1\u7b56\u7565", - "ar": "\u0633\u064a\u0627\u0633\u0629 \u0627\u0644\u062e\u0635\u0648\u0635\u064a\u0629 \u0644\u0644\u062e\u062f\u0645\u0629", - "lv": "Servisa dro\u0161\u012bbas noteikumi", - "id": "Kebijakan privasi untuk layanan", - "sr": "Politika za\u0161tite privatnosti kod servisa", - "ro": "Politica de confiden\u021bialitate pentru serviciu", - "eu": "Zerbitzuarentzako pribatutasun-politika", - "af": "Privaatheidsbeleid vir die diens", - "el": "\u03a0\u03bf\u03bb\u03b9\u03c4\u03b9\u03ba\u03ae \u03c0\u03c1\u03bf\u03c3\u03c4\u03b1\u03c3\u03af\u03b1\u03c2 \u03b1\u03c0\u03bf\u03c1\u03c1\u03ae\u03c4\u03bf\u03c5 \u03c5\u03c0\u03b7\u03c1\u03b5\u03c3\u03af\u03b1\u03c2" - }, - "noconsent_title": { - "no": "Ikke akseptert overf\u00f8ring av informasjon", - "nn": "Ikkje akseptert overf\u00f8ring av informasjon", - "sv": "Inget samtycket givet", - "es": "No se di\u00f3 el consentimiento", - "de": "Zustimmung verweigert", - "nl": "Geen toestemming gegeven", - "sl": "Privolitev ni bila dana.", - "da": "Manglende samtykke", - "hr": "Isporuka podataka nije odobrena", - "hu": "Nincs hozz\u00e1j\u00e1rul\u00e1s", - "fi": "Lupaa ei annettu", - "pt-br": "Nenhum consentimento dado", - "pt": "Consentimento negado", - "pl": "Nie wyra\u017cono zgody", - "cs": "Souhlas nebyl vyd\u00e1n", - "tr": "Onay verilmemi\u015f", - "fr": "Aucun consentement n'a \u00e9t\u00e9 donn\u00e9", - "it": "Nessun consenso dato", - "lt": "Leidimas neduotas", - "ja": "\u627f\u8a8d\u306f\u3042\u308a\u307e\u305b\u3093", - "zh-tw": "\u5c1a\u672a\u540c\u610f", - "et": "N\u00f5usolekut pole antud", - "he": "\u05dc\u05d0 \u05e0\u05d9\u05ea\u05e0\u05d4 \u05d4\u05e1\u05db\u05de\u05d4", - "ru": "\u041d\u0435\u0442 \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0441\u043e\u0433\u043b\u0430\u0441\u0438\u044f", - "zh": "\u672a\u540c\u610f", - "ar": "\u0644\u0645 \u062a\u0639\u0637\u064a \u0627\u0644\u0645\u0648\u0627\u0641\u0642\u0629", - "lv": "Nav noteikumu", - "id": "Tidan ada persetujuan yang diberikan", - "sr": "Slanje podataka nije odobreno", - "ro": "Nu a fost dat acordul (consim\u021b\u0103m\u00e2ntul)", - "eu": "Ez da onespena eman", - "af": "Geen toestemming is gegee nie", - "el": "\u039c\u03b7 \u03b1\u03c0\u03bf\u03b4\u03bf\u03c7\u03ae \u03c3\u03c5\u03b3\u03ba\u03b1\u03c4\u03ac\u03b8\u03b5\u03c3\u03b7\u03c2" - }, - "noconsent_text": { - "no": "Du har ikke akseptert \u00e5 overlevere opplysninger til SPNAME.", - "nn": "Du har ikkje akseptert til at dine opplysningar kan sendast til SPNAME.", - "sv": "Du gav inte samtycke f\u00f6r att \u00f6verf\u00f6ra dina attribut till tj\u00e4nsteleverant\u00f6ren.", - "es": "No ha dado su consentimiento para tranferir sus atributos al proveedor de servicio.", - "de": "Sie haben der Weitergabe ihrer Daten an den Service Provider nicht zugestimmt.", - "nl": "U heeft geen toestemming gegeven om uw attributen naar de Service Provider te versturen", - "sl": "Niste podali privolitve za posredovanje atributov SP-ju.", - "da": "Du har ikke givet samtykke til overleveringen af oplysninger til tjenesten", - "hr": "Niste dali pristanak da se va\u0161i podaci isporu\u010de davatelju usluge.", - "hu": "Nem adta hozz\u00e1j\u00e1rul\u00e1s\u00e1t, hogy adatait tov\u00e1bbadjuk a szolg\u00e1ltat\u00f3nak.", - "fi": "Et antanut lupaa siirt\u00e4\u00e4 henkil\u00f6tietojasi palveluntarjoajalle", - "pt-br": "Voc\u00ea n\u00e3o deu o consentimento para a transfer\u00eancia de seus atributos para o provedor de servi\u00e7os.", - "pt": "Negou o consentimento para a transfer\u00eancia dos seus atributos para o fornecedor de servi\u00e7o.", - "pl": "Nie wyrazi\u0142e\u015b zgody na przes\u0142anie Twoich atrybut\u00f3w do Dostawcy Serwisu.", - "cs": "Nedal jste souhlas pro zasl\u00e1n\u00ed sv\u00fdch atribut\u016f poskytovateli slu\u017eeb.", - "tr": "Bilgilerinizin servis sa\u011flay\u0131c\u0131ya g\u00f6nderilmesi i\u00e7in onay vermediniz.", - "fr": "Vous n'avez pas donn\u00e9 votre consentement \u00e0 la divulgation de vos attributs pour ce fournisseur de service.", - "it": "Non hai dato il consenso per trasferire i tuoi attributi al service provider.", - "lt": "J\u016bs nedav\u0117te sutikimo persi\u0173sti J\u016bs\u0173 atributus SPNAME paslaugos teik\u0117jui.", - "ja": "\u3042\u306a\u305f\u306f\u30b5\u30fc\u30d3\u30b9\u30d7\u30ed\u30d0\u30a4\u30c0\u306b\u5c5e\u6027\u3092\u8ee2\u9001\u3059\u308b\u4e8b\u3092\u627f\u8a8d\u3057\u3066\u3044\u307e\u305b\u3093\u3002", - "zh-tw": "\u60a8\u4e0d\u540c\u610f\u50b3\u8f38\u60a8\u7684\u5c6c\u6027\u81f3\u670d\u52d9\u63d0\u4f9b\u8005\u3002", - "et": "Sa ei andnud n\u00f5usolekut sinu atribuutide teenusepakkujale edastamiseks.", - "he": "\u05dc\u05d0 \u05e0\u05ea\u05e0\u05ea \u05d4\u05e1\u05db\u05de\u05d4 \u05dc\u05d4\u05e2\u05d1\u05e8\u05ea \u05d4\u05de\u05d0\u05e4\u05d9\u05d9\u05e0\u05d9\u05dd \u05dc\u05e1\u05e4\u05e7 \u05d4\u05e9\u05d9\u05e8\u05d5\u05ea.", - "ru": "\u0412\u044b \u043d\u0435 \u0434\u0430\u043b\u0438 \u0441\u043e\u0433\u043b\u0430\u0441\u0438\u044f \u043d\u0430 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0443 \u0432\u0430\u0448\u0438\u0445 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432 \u043a \u043f\u043e\u0441\u0442\u0430\u0432\u0449\u0438\u043a\u0443 \u0443\u0441\u043b\u0443\u0433.", - "zh": "\u4f60\u6ca1\u6709\u540c\u610f\u4f20\u8f93\u4f60\u7684\u76f8\u5173\u5c5e\u6027\u7ed9\u670d\u52a1\u63d0\u4f9b\u8005", - "ar": "\u0644\u0645 \u062a\u0648\u0627\u0641\u0642 \u0639\u0644\u064a \u062a\u062d\u0648\u064a\u0644 \u0633\u0645\u0627\u062a\u0643 \u0644\u0645\u0642\u062f\u0645 \u0627\u0644\u062e\u062f\u0645\u0629", - "lv": "J\u016bs neesat devis at\u013cauju p\u0101rraid\u012bt inform\u0101ciju servisa pieg\u0101d\u0101t\u0101jam.", - "id": "Anda tidak memberikan persetujuan untuk mentransfer atribut-atribute Anda ke service provider.", - "sr": "Niste odobrili da se va\u0161i podaci po\u0161alju davaocu servisa.", - "ro": "Nu a\u021bi fost de acord s\u0103 trimite\u021bi atributele c\u0103tre SPNAME.", - "eu": "Ez duzu onespena eman zure atributuak zerbitzuari transferitzeko.", - "af": "Jy het nie toestemming gegee vir die oordrag van jou eienskappe na SPNAME nie.", - "el": "\u0394\u03b5\u03bd \u03ad\u03c7\u03b5\u03c4\u03b5 \u03b4\u03ce\u03c3\u03b5\u03b9 \u03c3\u03c5\u03b3\u03ba\u03b1\u03c4\u03ac\u03b8\u03b5\u03c3\u03b7 \u03b3\u03b9\u03b1 \u03c4\u03bf\u03bd \u03b4\u03b9\u03b1\u03bc\u03bf\u03b9\u03c1\u03b1\u03c3\u03bc\u03cc \u03c0\u03c1\u03bf\u03c3\u03c9\u03c0\u03b9\u03ba\u03ce\u03bd \u03b4\u03b5\u03b4\u03bf\u03bc\u03ad\u03bd\u03c9\u03bd \u03bc\u03b5 \u03c4\u03b7\u03bd \u03c5\u03c0\u03b7\u03c1\u03b5\u03c3\u03af\u03b1 SPNAME" - }, - "noconsent_return": { - "no": "G\u00e5 tilbake til samtykkesiden", - "nn": "G\u00e5 tilbake til samtykkesida", - "sv": "\u00c5ter till sidan f\u00f6r samtycke", - "es": "Volver a la p\u00e1gina de consentimiento", - "de": "Zur\u00fcck", - "nl": "Keer terug naar de toestemmingspagina", - "sl": "Vrnitev na privolitveno stran", - "da": "G\u00e5 tilbage", - "hr": "Povratak na stranicu za kreiranje dozvola", - "hu": "Vissza az hozz\u00e1j\u00e1rul\u00e1s-kezel\u0151 oldalra", - "fi": "Palaa hyv\u00e4ksynt\u00e4sivulle", - "pt-br": "Retornar a p\u00e1gina de consentimento", - "pt": "Voltar \u00e0 p\u00e1gina de consentimento", - "pl": "Powr\u00f3t do strony wydania zezwolenia.", - "cs": "Zp\u00e1tky na str\u00e1nku pro souhlas", - "tr": "Onay sayfas\u0131na geri d\u00f6n", - "fr": "Retour \u00e0 la page de consentement", - "it": "Torna alla pagina del consenso", - "lt": "Gr\u012f\u017eti \u012f leidim\u0173 puslap\u012f", - "ja": "\u627f\u8a8d\u30da\u30fc\u30b8\u306b\u623b\u308b", - "zh-tw": "\u56de\u5230\u540c\u610f\u9801\u9762", - "et": "Tagasi n\u00f5usoleku lehele", - "he": "\u05d7\u05d6\u05d5\u05e8 \u05dc\u05d3\u05e3 \u05d4\u05e1\u05db\u05de\u05d4", - "zh": "\u8fd4\u56de\u540c\u610f\u754c\u9762", - "ar": "\u0639\u062f \u0644\u0635\u0641\u062d\u0629 \u0627\u0644\u0645\u0648\u0627\u0641\u0642\u0629", - "lv": "Atgriezties uz noteikumu lapu", - "id": "Kembali ke halaman persetujuan", - "sr": "Povratak na stranicu za kreiranje pristanka", - "ro": "\u00centoarcere la pagina de consim\u021b\u0103m\u00e2nt", - "ru": "\u0412\u0435\u0440\u043d\u0443\u0442\u044c\u0441\u044f \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u0434\u043b\u044f \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0441\u043e\u0433\u043b\u0430\u0441\u0438\u044f", - "eu": "Itzuli onespen orrira", - "af": "Keer terug na die toestemmingsbladsy", - "el": "\u0395\u03c0\u03b9\u03c3\u03c4\u03c1\u03bf\u03c6\u03ae \u03c3\u03c4\u03b7 \u03c3\u03b5\u03bb\u03af\u03b4\u03b1 \u03b4\u03ae\u03bb\u03c9\u03c3\u03b7\u03c2 \u03c3\u03c5\u03b3\u03ba\u03b1\u03c4\u03ac\u03b8\u03b5\u03c3\u03b7\u03c2" - }, - "consent_header": { - "no": "Samtykke om overf\u00f8ring av personinformasjon", - "nn": "Samtykke til overf\u00f8ring av personinformasjon", - "sv": "Samtycke g\u00e4llande \u00f6verf\u00f6ring av personinformation", - "es": "Consentimiento para la liberaci\u00f3n de informaci\u00f3n personal", - "de": "Zustimmung zur Weitergabe pers\u00f6nlicher Daten", - "nl": "Toestemming voor het vrijgeven van persoonsgegevens", - "sl": "Odlo\u010ditev o privolitvi posredovanja va\u0161ih osebnih podatkov", - "da": "Samtykke til at frigive personlige oplysninger", - "hr": "Dozvola za isporuku osobnih podataka", - "hu": "Hozz\u00e1j\u00e1rul\u00e1s szem\u00e9lyes adatok kiad\u00e1s\u00e1hoz", - "fi": "Henkil\u00f6tietojen luovutuksen hyv\u00e4ksynt\u00e4", - "pt": "Consentimento do envio de informa\u00e7\u00e3o pessoal", - "pl": "Zgoda na wys\u0142anie danych osobistych", - "cs": "Obsah odes\u00edlan\u00fdch osobn\u00edch informac\u00ed", - "tr": "Ki\u015fisel bilgilerin verilmesi hakk\u0131nda onay", - "fr": "Consentement pour la divulgation d'informations personnelles", - "it": "Consenso al rilascio delle informazioni personali", - "lt": "Leidimas perduoti asmenin\u0119 informacij\u0105", - "ja": "\u500b\u4eba\u60c5\u5831\u306e\u627f\u8a8d\u3092\u89e3\u9664", - "zh-tw": "\u540c\u610f\u6709\u95dc\u65bc\u500b\u4eba\u95dc\u4fc2\u8cc7\u8a0a", - "et": "N\u00f5usolek isikuandmete edastamiseks", - "he": "\u05d4\u05e1\u05db\u05de\u05d4 \u05dc\u05d4\u05e2\u05d1\u05e8\u05ea \u05de\u05d9\u05d3\u05e2 \u05d0\u05d9\u05e9\u05d9", - "pt-br": "Consentimento sobre a libera\u00e7\u00e3o de informa\u00e7\u00f5es pessoais", - "zh": "\u540c\u610f\u5f00\u653e\u4e2a\u4eba\u4fe1\u606f", - "ar": "\u0627\u0648\u0627\u0641\u0642 \u0639\u0644\u064a \u0646\u0634\u0631 \u0633\u0645\u0627\u062a\u064a \u0627\u0644\u0634\u062e\u0635\u064a\u0629", - "lv": "Noteikumi par person\u012bg\u0101s inform\u0101cijas nodo\u0161anu", - "id": "Persetujuan tentang melepas informasi personal", - "sr": "Pristanak za slanje li\u010dnih podataka", - "ro": "Acordul pentru a furniza informa\u021bii personale", - "ru": "\u0421\u043e\u0433\u043b\u0430\u0441\u0438\u0435 \u043d\u0430 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0443 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043f\u0435\u0440\u0441\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445", - "eu": "Informazio pertsonala askatzeko onespena ", - "af": "Toestemming mbt. die vrystelling van persoonlike informasie", - "el": "\u0394\u03ae\u03bb\u03c9\u03c3\u03b7 \u03c3\u03c5\u03b3\u03ba\u03b1\u03c4\u03ac\u03b8\u03b5\u03c3\u03b7\u03c2 \u03b3\u03b9\u03b1 \u03c4\u03bf\u03bd \u03b4\u03b9\u03b1\u03bc\u03bf\u03b9\u03c1\u03b1\u03c3\u03bc\u03cc \u03c0\u03c1\u03bf\u03c3\u03c9\u03c0\u03b9\u03ba\u03ce\u03bd \u03b4\u03b5\u03b4\u03bf\u03bc\u03ad\u03bd\u03c9\u03bd" - }, - "consent_attributes_header": { - "no": "Opplysninger som vil bli sendt til SPNAME", - "nn": "Opplysningar som blir sende til SPNAME", - "sv": "Attribut som kommer att skickas till tj\u00e4nsten", - "es": "Atributos que ser\u00e1n enviados al servicio", - "de": "Informationen, die an SPNAME gesandt werden", - "nl": "Informatie die naar SPNAME zal worden gestuurd", - "sl": "Atributi, ki bodo poslani SPju", - "da": "Attributter som bliver sendt til SPNAME", - "hr": "Informacije koje \u0107e biti poslane servisu SPNAME", - "hu": "A(z) SPNAME szolg\u00e1ltat\u00f3nak k\u00fcld\u00f6tt adatok", - "fi": "Tiedot l\u00e4hetet\u00e4\u00e4n palvelulle SPNAME", - "pt": "Informa\u00e7\u00e3o que ir\u00e1 ser enviada para SPNAME", - "pl": "Atrybuty, kt\u00f3re zostan\u0105 przes\u0142ane do serwisu", - "cs": "Atributy, kter\u00e9 mohou b\u00fdt zasl\u00e1ny slu\u017eb\u011b", - "tr": "SPNAME'e g\u00f6nderilecek bilgiler", - "fr": "Informations qui seront envoy\u00e9es \u00e0 SPNAME", - "it": "Informazioni che saranno inviate a SPNAME", - "lt": "Informacija, kuri bus persi\u0173sta \u012f SPNAME", - "ja": "SPNAME\u3068\u3057\u3066\u9001\u4fe1\u3055\u308c\u308b\u60c5\u5831", - "zh-tw": "\u8cc7\u8a0a\u5c07\u88ab\u50b3\u9001\u81f3 SPNAME", - "et": "Andmed saadetakse SPNAME-le", - "he": "\u05d4\u05de\u05d9\u05d3\u05e2 \u05d9\u05e9\u05dc\u05d7 \u05dc SPNAME", - "zh": "\u4fe1\u606f\u5c06\u4f1a\u53d1\u9001\u7ed9SPNAME", - "ar": "\u0627\u0644\u0645\u0639\u0644\u0648\u0645\u0627\u062a \u0627\u0644\u062a\u064a \u0633\u064a\u062a\u0645 \u0625\u0631\u0633\u0627\u0644\u0647\u0627 \u0644 SPNAME", - "lv": "Inform\u0101cija, kas tiks s\u016bt\u012bta SPNAME", - "id": "Informasi yang akan dikirim ke SPNAME", - "sr": "Informacije koje \u0107e biti poslate servisu SPNAME", - "ro": "Informa\u021bii care vor fi trimise la SPNAME", - "ru": "\u0418\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u0430 \u0432 SPNAME ", - "eu": "Zerbitzura bidaliko diren atributuak", - "af": "Informasie wat gestuur sal word na SPNAME", - "el": "\u03a0\u03bb\u03b7\u03c1\u03bf\u03c6\u03bf\u03c1\u03af\u03b5\u03c2 \u03c0\u03bf\u03c5 \u03b8\u03b1 \u03b4\u03b9\u03b1\u03bc\u03bf\u03b9\u03c1\u03b1\u03c3\u03c4\u03bf\u03cd\u03bd \u03bc\u03b5 \u03c4\u03b7\u03bd \u03c5\u03c0\u03b7\u03c1\u03b5\u03c3\u03af\u03b1 SPNAME" - }, - "show_attributes": { - "no": "Vis opplysninger", - "nn": "Vis opplysingar", - "sv": "Visa attribut", - "es": "Mostrar atributos", - "de": "Attribute zeigen", - "nl": "Toon attributen", - "sl": "Prika\u017ei atribute", - "da": "Vis attributter", - "hr": "Prika\u017ei atribute", - "hu": "Mutasd az attrib\u00fatumokat", - "fi": "N\u00e4yt\u00e4 henkil\u00f6tiedot", - "pt": "Mostrar atributos", - "pl": "Wy\u015bwietl atrybuty", - "cs": "Zobraz atributy", - "tr": "\u00d6zellikleri g\u00f6ster", - "fr": "Montrer les attributs", - "it": "Mostra attributi", - "lt": "Parodyti atributus", - "ja": "\u5c5e\u6027\u3092\u8868\u793a\u3059\u308b", - "zh-tw": "\u986f\u793a\u5c6c\u6027", - "et": "N\u00e4ita andmeid", - "he": "\u05d4\u05e6\u05d2 \u05de\u05d0\u05e4\u05d9\u05d9\u05e0\u05d9\u05dd", - "pt-br": "Mostrar atributos", - "zh": "\u663e\u793a\u5c5e\u6027", - "ar": "\u0627\u0638\u0647\u0631 \u0627\u0644\u0633\u0645\u0627\u062a", - "lv": "R\u0101d\u012bt atrib\u016btus", - "id": "Perlihatkan atribut-atribut", - "sr": "Prika\u017ei atribute", - "ro": "Arat\u0103 atributele", - "ru": "\u041f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b", - "eu": "Erakutsi atributuak", - "af": "Vertoon eienskappe" - }, - "noconsent_goto_about": { - "no": "G\u00e5 til informasjonsside om tjenesten", - "nn": "G\u00e5 til informasjonssida for tenesta", - "sv": "G\u00e5 till tj\u00e4nstens informationssida", - "es": "Ir a la p\u00e1gina de informaci\u00f3n del servicio", - "de": "Gehe zur Informationsseite dieses Dienstes", - "nl": "Ga naar de informatiepagina voor de service", - "sl": "Pojdi na spletno stran z informacijami o storitvi", - "da": "G\u00e5 til side med information om tjenesten", - "hr": "Idi na stranicu s informacijama o servisu", - "hu": "A szolg\u00e1ltat\u00e1s inform\u00e1ci\u00f3s oldal\u00e1ra", - "fi": "Siirry palvelun tiedot -sivulle", - "pt": "Ir para p\u00e1gina de informa\u00e7\u00e3o do servi\u00e7o", - "pl": "Przejd\u017a do strony informacyjnej dla tego serwisu", - "cs": "Jdi na str\u00e1nku s informacemi o slu\u017eb\u011b", - "tr": "Servis i\u00e7in bilgi sayfas\u0131na git", - "fr": "Aller \u00e0 la page d'information sur ce service", - "it": "Vai alla pagina di informazioni per il servizio", - "lt": "Pereiti \u012f \u0161ios paslaugos informacin\u012f puslap\u012f", - "ja": "\u30b5\u30fc\u30d3\u30b9\u306e\u70ba\u306e\u60c5\u5831\u30da\u30fc\u30b8\u3092\u53c2\u7167", - "zh-tw": "\u81f3\u670d\u52d9\u8cc7\u8a0a\u9801\u9762", - "et": "Mine teenuse infolehele", - "he": "\u05dc\u05da \u05d0\u05dc \u05d3\u05e3 \u05d4\u05de\u05d9\u05d3\u05e2 \u05e9\u05dc \u05d4\u05e9\u05d9\u05e8\u05d5\u05ea", - "pt-br": "Ir para a P\u00e1gina de Informa\u00e7\u00e3o do servi\u00e7o", - "zh": "\u83b7\u53d6\u8be5\u670d\u52a1\u7684\u4fe1\u606f", - "ar": "\u0627\u0630\u0647\u0628 \u0644\u0635\u0641\u062d\u0629 \u0627\u0644\u0645\u0639\u0644\u0648\u0645\u0627\u062a \u0639\u0646 \u0627\u0644\u062e\u062f\u0645\u0629", - "lv": "Iet uz servisa inform\u0101cijas lapu", - "id": "Pergi ke halaman informasi untul layanan", - "sr": "Idi na stranicu sa informacijama o servisu", - "ro": "Link la pagina serviciului", - "ru": "\u041f\u0435\u0440\u0435\u0439\u0442\u0438 \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u0441 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0435\u0439 \u043e \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u043b\u0443\u0436\u0431\u0435", - "eu": "Joan zerbitzuaren informazio orrira", - "af": "Gaan na die informasie bladsy vir die diens", - "el": "\u0395\u03c0\u03b9\u03c0\u03bb\u03ad\u03bf\u03bd \u03c0\u03bb\u03b7\u03c1\u03bf\u03c6\u03bf\u03c1\u03af\u03b5\u03c2 \u03b3\u03b9\u03b1 \u03c4\u03b7\u03bd \u03c5\u03c0\u03b7\u03c1\u03b5\u03c3\u03af\u03b1" - }, - "consent_purpose": { - "no": "Form\u00e5let med SPNAME er SPDESC", - "nn": "Hensikta med SPNAME er SPDESC", - "sv": "Syftet med SPNAME \u00e4r SPDESC", - "es": "El prop\u00f3sito de SPNAME es SPDESC", - "de": "Der Zweck von SPNAME ist SPDESC", - "nl": "Het doel van SPNAME is SPDESC", - "sl": "Namen %SPNAME%: %SPDESC%", - "da": "SPNAME har til form\u00e5l at SPDESC", - "hr": "Namjena servisa SPNAME je SPDESC", - "hu": "A szolg\u00e1ltat\u00e1s (SPNAME) ezt a c\u00e9lt szolg\u00e1lja: SPDESC", - "fi": "Palvelun SPNAME k\u00e4ytt\u00f6tarkoitus on SPDESC", - "pt": "O prop\u00f3sito de SPNAME \u00e9 SPDESC", - "pl": "Celem SPNAME jest SPDESC", - "cs": "C\u00edl SPNAME v SPDESC", - "tr": "SPNAME'in amac\u0131 SPDESC'tir", - "fr": "L'objet de SPNAME est SPDESC", - "it": "Lo scopo di SPNAME \u00e8 SPDESC", - "lt": "SPNAME paskirtis yra SPDESC", - "ja": "SPNAME\u306e\u76ee\u7684\u306fSPDESC\u3067\u3059", - "zh-tw": "SPNAME \u7684\u76ee\u7684\u5730\u70ba SPDESC", - "et": "Teenuse SPNAME eesm\u00e4rk on SPDESC", - "he": "\u05d4\u05de\u05d8\u05e8\u05d4 \u05e9\u05dc SPNAME \u05d4\u05d9\u05d0 SPDESC", - "zh": "SPNAME\u7684\u76ee\u7684\u662fSPDESC", - "ar": "\u0627\u0644\u063a\u0631\u0636 \u0645\u0646 SPNAME \u0647\u0648 SPDESC", - "lv": "SPNAME nol\u016bks ir SPDESC", - "id": "Tujuan dari SPNAME adalah SPDESC", - "sr": "Namena servisa SPNAME je SPDESC", - "ro": "Scopul SPNAME este SPDESC", - "ru": "\u0426\u0435\u043b\u044c SPNAME - SPDESC", - "eu": "Zerbtizuaren xedea SPDESC da", - "af": "Die doel van SPNAME is SPDESC", - "el": "\u03a0\u03b5\u03c1\u03b9\u03b3\u03c1\u03b1\u03c6\u03ae \u03cc\u03c0\u03c9\u03c2 \u03c0\u03b1\u03c1\u03ad\u03c7\u03b5\u03c4\u03b1\u03b9 \u03b1\u03c0\u03cc \u03c4\u03b7\u03bd \u03c5\u03c0\u03b7\u03c1\u03b5\u03c3\u03af\u03b1\u003a SPDESC" - }, - "table_caption": { - "no": "Bruker innformasjon", - "sv": "Anv\u00e4ndarinformation", - "es": "Informaci\u00f3n del usuario", - "de": "Benutzerdaten", - "nl": "Gerbuikersinformatie", - "sl": "Podatki o uporabniku", - "da": "Bruger information", - "hu": "Felhaszn\u00e1l\u00f3i inform\u00e1ci\u00f3k", - "fi": "K\u00e4ytt\u00e4j\u00e4tiedot", - "pt": "Informa\u00e7\u00e3o do utilizador", - "tr": "Kullan\u0131c\u0131 bilgisi", - "fr": "Information sur l'usager", - "hr": "Informacije o korisniku", - "nn": "Brukarinformasjon", - "it": "Informazioni utente", - "lt": "Vartotojo informacija", - "ja": "\u30e6\u30fc\u30b6\u30fc\u60c5\u5831", - "zh-tw": "\u4f7f\u7528\u8005\u8cc7\u8a0a", - "et": "Kasutajainfo", - "he": "\u05de\u05d9\u05d3\u05e2 \u05e2\u05dc \u05d4\u05de\u05e9\u05ea\u05de\u05e9", - "pt-br": "Informa\u00e7\u00f5es do Usu\u00e1rio", - "zh": "\u7528\u6237\u4fe1\u606f", - "ar": "\u0645\u0639\u0644\u0648\u0645\u0627\u062a \u0627\u0644\u0645\u0633\u062a\u062e\u062f\u0645", - "lv": "Lietot\u0101ja inform\u0101cija", - "id": "Informasi User", - "sr": "Informacije o korisniku", - "ro": "Informa\u021bii despre utilizator", - "ru": "\u0418\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435", - "cs": "U\u017eivatelsk\u00e9 informace", - "eu": "Erabiltzailearen informazioa", - "af": "Gebruiker informasie", - "el": "\u03a0\u03bb\u03b7\u03c1\u03bf\u03c6\u03bf\u03c1\u03af\u03b5\u03c2 \u03c7\u03c1\u03ae\u03c3\u03c4\u03b7" - }, - "table_summary": { - "no": "Her listes den innformasjonen om deg som blir send til den tjenesten du er i ferd med \u00e5 logge p\u00e5", - "sv": "Visa den nformation om din anv\u00e4ndare som kommer att skickas till tj\u00e4nsten som du \u00e4r p\u00e5 v\u00e4g att logga in i", - "es": "Muestra que informaci\u00f3n relativa a usted va a ser transmitida al servicio en el que se va a identificar", - "nl": "De informatie die over jou bekend is en naar de service waarop je wilt inloggen verstuurd zal worden", - "sl": "Seznam podatkov o vas, ki bodo posredovani storitvi, v katero se nameravate prijaviti", - "da": "Informationer som vil blive sendt til den service du er ved at logge in p\u00e5", - "hu": "Ezeket az adatokat fogjuk elk\u00fcldeni \u00d6nr\u0151l annak a szolg\u00e1ltat\u00e1snak, ahov\u00e1 be k\u00edv\u00e1n jelentkezni", - "fi": "N\u00e4yt\u00e4 tietosi, joita ollaan siirt\u00e4m\u00e4ss\u00e4 palveluun", - "pt": "Listar a informa\u00e7\u00e3o acerca de si que ser\u00e1 enviada para o servi\u00e7o no qual se est\u00e1 autenticar", - "tr": "Girmek istedi\u011finiz servise g\u00f6nderilecek bilginizi listeleyin", - "de": "Zeige die Information \u00fcber Sie, die an den Service, auf dem Sie sich einloggen werden, \u00fcbermittelt werden", - "fr": "Liste des informations vous concernant qui seront envoy\u00e9es au service auquel vous allez vous connecter", - "hr": "Prika\u017ei popis va\u0161ih podataka koji \u0107e biti proslje\u0111eni servisu kojem \u017eelite pristupiti", - "nn": "List informasjon om deg som blir overf\u00f8rt til tenesta du skal logga inn p\u00e5", - "it": "Mostra le informazioni su di te che stanno per essere trasferire al servizio a cui ti vuoi collegare", - "lt": "Per\u017ei\u016br\u0117ti informacij\u0105 apie jus, kuri bus persi\u0173sta paslaugai, \u012f kuri\u0105 jungiat\u0117s", - "ja": "\u4e00\u89a7\u306e\u60c5\u5831\u306f\u3042\u306a\u305f\u304c\u30ed\u30b0\u30a4\u30f3\u3059\u308b\u969b\u306b\u30b5\u30fc\u30d3\u30b9\u306b\u8ee2\u9001\u3055\u308c\u307e\u3059\u3002", - "zh-tw": "\u5c07\u95dc\u65bc\u6211\u50b3\u9001\u81f3\u60a8\u9810\u8a08\u8981\u767b\u5165\u7684\u670d\u52d9", - "et": "Teave sinu kohta, mis edastatakse teenusele, millesse asud sisse logima", - "he": "\u05d4\u05e6\u05d2 \u05d0\u05ea \u05d4\u05de\u05d9\u05d3\u05e2 \u05e2\u05dc\u05d9\u05da \u05d0\u05e9\u05e8 \u05d9\u05d5\u05e2\u05d1\u05e8 \u05dc\u05e9\u05d9\u05e8\u05d5\u05ea \u05e9\u05d0\u05ea\u05d4 \u05e2\u05d5\u05de\u05d3 \u05dc\u05d4\u05ea\u05d7\u05d1\u05e8 \u05d0\u05dc\u05d9\u05d5", - "pt-br": "Liste as informa\u00e7\u00f5es sobre voc\u00ea que est\u00e1 prestes a ser transmitida para o servi\u00e7o que voc\u00ea est\u00e1 acessando", - "zh": "\u5f53\u4f60\u767b\u5f55\u65f6\u5c06\u8981\u4f20\u8f93\u7ed9\u670d\u52a1\u7684\u4fe1\u606f\u5217\u8868", - "ar": "\u0642\u0627\u0626\u0645\u0629 \u0645\u0639\u0644\u0648\u0645\u0627\u062a\u0643 \u0627\u0644\u062a\u064a \u0633\u062a\u062d\u0648\u0644 \u0644\u0645\u0642\u062f\u0645 \u0627\u0644\u062e\u062f\u0645\u0629 \u0627\u0644\u0630\u064a \u062a\u0631\u063a\u0628 \u0628\u062a\u0633\u062c\u064a\u0644 \u0627\u0644\u062f\u062e\u0648\u0644 \u0627\u0644\u064a\u0647", - "lv": "Inform\u0101cija par Jums, kas tiks s\u016bt\u012bta servisam, kuram J\u016bs piesl\u0113dzaties", - "id": "Daftar informasi tentang Anda yang akan dikirimkan ke service tujuan login Anda.", - "sr": "Prika\u017ei spisak podataka o vama koji \u0107e biti prosle\u0111eni servisu kome \u017eelite pristupiti", - "ro": "Afi\u0219eaz\u0103 informa\u021biile care vor fi trimise la serviciul unde dori\u021bi s\u0103 v\u0103 autentifica\u021bi", - "ru": "\u0412\u044b\u0434\u0430\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u0430 \u0441\u043b\u0443\u0436\u0431\u0435, \u0432 \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0432\u044b \u043f\u044b\u0442\u0430\u0435\u0442\u0435\u0441\u044c \u0432\u043e\u0439\u0442\u0438", - "cs": "Seznam informac\u00ed o v\u00e1s, kter\u00e9 budou p\u0159ed\u00e1ny slu\u017eb\u011b, ke kter\u00e9 se p\u0159ihla\u0161ujete", - "eu": "Zu identifikatuko zaren zerbitzura zure ze informazio bidaliko den erakusten du ", - "af": "Lys die informasie mbt. jou wat op die punt is om gestuur te word vir die diens waarby jy wil aanmeld.", - "el": "\u0395\u03bc\u03c6\u03ac\u03bd\u03b9\u03c3\u03b7 \u03c0\u03bb\u03b7\u03c1\u03bf\u03c6\u03bf\u03c1\u03b9\u03ce\u03bd \u03c0\u03bf\u03c5 \u03b8\u03b1 \u03b4\u03b9\u03b1\u03bc\u03bf\u03b9\u03c1\u03b1\u03c3\u03c4\u03bf\u03cd\u03bd \u03bc\u03b5 \u03c4\u03b7\u03bd \u03c5\u03c0\u03b7\u03c1\u03b5\u03c3\u03af\u03b1 \u03ba\u03b1\u03c4\u03ac \u03c4\u03b7\u03bd \u03c0\u03c1\u03cc\u03c3\u03b2\u03b1\u03c3\u03b7 \u03c3\u03b5 \u03b1\u03c5\u03c4\u03ae" - }, - "show_attribute": { - "no": "Vis innhold", - "nn": "Vis innhald", - "sv": "Visa samtycke", - "es": "Mostrart consentimiento", - "nl": "Toon inhoud", - "sl": "Prika\u017ei vsebino", - "da": "Vis indhold", - "de": "Zeige Inhalt", - "pt": "Mostrar conte\u00fado", - "fr": "Montrer le contenu", - "hr": "Prika\u017ei sadr\u017eaj", - "it": "Mostra contenuto", - "hu": "R\u00e9szletek", - "lt": "Parodyti leidim\u0105", - "ja": "\u5185\u5bb9\u3092\u8868\u793a\u3059\u308b", - "zh-tw": "\u986f\u793a\u5167\u5bb9", - "pl": "Wy\u015bwietl zawarto\u015b\u0107", - "et": "N\u00e4ita sisu", - "he": "\u05d4\u05e6\u05d2 \u05ea\u05d5\u05db\u05df", - "pt-br": "Mostrar Conte\u00fado", - "zh": "\u663e\u793a\u5185\u5bb9", - "ar": "\u0627\u0638\u0647\u0631\u0627\u0644\u064a\u0647\u0627 \u0638\u0647\u0631 \u0627\u0644\u0645\u062d\u062a\u0648\u064a", - "lv": "R\u0101d\u012bt saturu", - "id": "Perlihatkan konten", - "sr": "Prika\u017ei sadr\u017eaj", - "ro": "Arat\u0103 con\u021binutul", - "ru": "\u041f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435", - "cs": "Zobrazit obsah", - "eu": "Erakutsi onespena", - "af": "Vertoon inhoud", - "el": "\u0395\u03bc\u03c6\u03ac\u03bd\u03b9\u03c3\u03b7 \u03bb\u03b5\u03c0\u03c4\u03bf\u03bc\u03b5\u03c1\u03b5\u03b9\u03ce\u03bd" - }, - "abort": { - "no": "Avbryt innlogging til SPNAME", - "nn": "Avbryt innlogging til SPNAME", - "lt": "At\u0161aukti prisijungim\u0105 prie SPNAME", - "sr": "Prekini prijavu na SPNAME", - "it": "Login interrotto a SPNAME", - "fr": "Annuler la connexion au fournisseur de service SPNAME", - "de": "Anmeldung am Service Provider SPNAME abbrechen", - "et": "Katkesta sisselogimine: SPNAME", - "nl": "Inloggen op SPNAME afbreken", - "es": "Cancelar la identificaci\u00f3n en SPNAME", - "ro": "Anuleaz\u0103 cererea de autentificare la SPNAME", - "ar": "\u0625\u0644\u063a\u0627\u0621 \u0639\u0645\u0644\u064a\u0629 \u0627\u0644\u062f\u062e\u0648\u0644 \u0644SPNAME", - "ru": "\u041f\u0440\u0435\u043a\u0440\u0430\u0442\u0438\u0442\u044c \u043b\u043e\u0433\u0438\u043d \u0432 SPNAME", - "cs": "Zru\u0161it p\u0159ihl\u00e1\u0161en\u00ed k SPNAME", - "hr": "Odustani od prijave u SPNAME", - "zh": "\u4e2d\u6b62\u767b\u5f55\u5230SPNAME", - "eu": "Bertan behera utzi zerbitzuan identifikazioa", - "zh-tw": "\u95dc\u65bc\u767b\u5165\u81f3 SPNAME", - "da": "Afbryd login til SPNAME", - "af": "Kanseleer aanmelding na SPNAME", - "el": "\u0391\u03ba\u03cd\u03c1\u03c9\u03c3\u03b7 \u03b5\u03b9\u03c3\u03cc\u03b4\u03bf\u03c5 \u03c3\u03c4\u03b7\u03bd \u03c5\u03c0\u03b7\u03c1\u03b5\u03c3\u03af\u03b1 SPNAME" - } + "yes": { + "no": "Ja, fortsett", + "nn": "Ja, fortsett", + "sv": "Ja", + "es": "S\u00ed", + "fr": "Oui", + "de": "Ja, ich stimme zu", + "nl": "Ja, ik ga akkoord", + "lb": "Jo", + "sl": "Da, nadaljuj", + "da": "Ja, jeg accepterer", + "hr": "Da, nastavi", + "hu": "Igen, elfogadom", + "fi": "Kyll\u00e4", + "pt-br": "Sim, Aceito", + "pt": "Sim, Aceito", + "pl": "Tak, akceptuj\u0119", + "cs": "Ano, akceptuji", + "tr": "Evet, devam et", + "it": "S\u00ec, continuare", + "lt": "Taip, t\u0119sti", + "ja": "\u306f\u3044\u3001\u7d9a\u3051\u307e\u3059", + "zh-tw": "\u662f\uff0c\u7e7c\u7e8c", + "et": "Jah, j\u00e4tka", + "he": "\u05db\u05df, \u05d4\u05de\u05e9\u05da", + "ru": "\u0414\u0430, \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442\u044c", + "zh": "\u662f\u7684\uff0c\u7ee7\u7eed", + "ar": "\u0646\u0639\u0645\u060c \u0648\u0627\u0635\u0644", + "lv": "J\u0101, turpin\u0101t", + "id": "Yam lanjutkan", + "sr": "Da, nastavi", + "ro": "Da, continu\u0103", + "eu": "Bai, jarraitu", + "af": "Ja, voortgaan", + "el": "\u0391\u03c0\u03bf\u03b4\u03bf\u03c7\u03ae", + "zu": "Yebo, qhubeka", + "xh": "Ewe, qhubeka" + }, + "no": { + "no": "Nei, avbryt", + "nn": "Nei, avbryt", + "sv": "Nej", + "es": "No", + "fr": "Non", + "de": "Nein, ich stimme nicht zu", + "nl": "Nee, ik weiger", + "lb": "Nee", + "sl": "Ne, prekli\u010di", + "da": "Nej, jeg accepterer ikke", + "hr": "Ne, odustani", + "hu": "Nem, nem fogadom el", + "fi": "ei", + "pt-br": "N\u00e3o, n\u00e3o aceito", + "pt": "N\u00e3o aceito", + "pl": "Nie, nie akceptuj\u0119", + "cs": "Ne, neakceptuji", + "tr": "Hay\u0131r, iptal et", + "it": "No, cancellare", + "lt": "Ne, nutraukti", + "ja": "\u3044\u3044\u3048\u3001\u30ad\u30e3\u30f3\u30bb\u30eb\u3057\u307e\u3059", + "zh-tw": "\u4e0d\uff0c\u53d6\u6d88", + "et": "Ei, loobu", + "he": "\u05dc\u05d0, \u05d1\u05d8\u05dc", + "ru": "\u041d\u0435\u0442, \u043e\u0442\u043c\u0435\u043d\u0438\u0442\u044c", + "zh": "\u4e0d\uff0c\u53d6\u6d88", + "ar": "\u0644\u0627\u060c \u0627\u0644\u063a", + "lv": "N\u0113, atcelt", + "id": "Tidak, batalkan", + "sr": "Ne, odustani", + "ro": "Nu, renun\u021b", + "eu": "Ez, utzi", + "af": "Nee, kanselleer", + "el": "\u0391\u03c0\u03cc\u03c1\u03c1\u03b9\u03c8\u03b7", + "xh": "Hayi, rhoxisa", + "zu": "Cha, khansela" + }, + "remember": { + "no": "Godta ogs\u00e5 for fremtiden", + "nn": "Godta ogs\u00e5 for framtida", + "sv": "Spara samtycke", + "es": "Recordar el consentimiento", + "fr": "Se souvenir du consentement", + "de": "Zustimmung merken", + "nl": "Bewaar toestemming", + "lb": "Zoust\u00ebmmung verhalen", + "sl": "Zapomni si privolitev.", + "da": "Husk samtykke", + "hr": "Zapamti moj odabir", + "hu": "Eml\u00e9kezzen a hozz\u00e1j\u00e1rul\u00e1sra", + "fi": "Muista", + "pt-br": "Lembrar Consentimento", + "pt": "Lembrar a minha escolha", + "pl": "Pami\u0119taj moj\u0105 zgod\u0119", + "cs": "Zapamatuj", + "tr": "Hat\u0131rla", + "it": "Ricordare", + "lt": "\u012esiminti", + "ja": "\u8a18\u61b6\u3059\u308b", + "zh-tw": "\u8a18\u4f4f", + "et": "J\u00e4ta meelde", + "he": "\u05d6\u05db\u05d5\u05e8", + "ru": "\u0417\u0430\u043f\u043e\u043c\u043d\u0438\u0442\u044c", + "zh": "\u8bb0\u4f4f", + "ar": "\u062a\u0630\u0643\u0631\u0623\u0644\u063a\u062a \u0630\u0643\u0631", + "lv": "Atcer\u0113ties", + "id": "Ingat", + "sr": "Zapamti moj izbor", + "ro": "\u021aine minte", + "eu": "Onespena gogoratu", + "af": "Onthou", + "el": "\u039d\u03b1 \u03b8\u03c5\u03bc\u03ac\u03c3\u03b1\u03b9 \u03c4\u03b7\u03bd \u03b5\u03c0\u03b9\u03bb\u03bf\u03b3\u03ae \u03bc\u03bf\u03c5", + "zu": "Khumbula", + "xh": "Khumbula" + }, + "consent_accept": { + "no": "For \u00e5 fullf\u00f8re innloggingen m\u00e5 du godta at opplysningene nedenfor sendes til SPNAME.", + "nn": "For \u00e5 fullf\u00f8ra innlogginga m\u00e5 du godta at opplysningane under blir sende til SPNAME", + "sv": "Du \u00e4r p\u00e5 v\u00e4g att logga in i tj\u00e4nsten SPNAME. Tj\u00e4nsten kr\u00e4ver att informationen nedan skickas fr\u00e5n IDPNAME. \u00c4r detta okej?", + "es": "Est\u00e1 a punto de acceder al servicio SPNAME. El servicio requiere que la informaci\u00f3n que se muestra a continuaci\u00f3n sea transferida desde IDPNAME. \u00bfAcepta esto?", + "fr": "Vous \u00eates sur le point de vous connecter au service SPNAME. Lors de l'ouverture de session, le fournisseur d'identit\u00e9 enverra des informations sur votre identit\u00e9 \u00e0 ce service. Acceptez-vous cela ?", + "de": "SPNAME erfordert die \u00dcbertragung untenstehender Information von IDPNAME. Akzeptieren Sie das?", + "nl": "U gaat inloggen bij een dienst SPNAME. Tijdens het loginproces stuurt de identity provider zgn. attributen met daarin informatie over uw identiteit voor deze dienst. Bent u het daarmee eens?", + "lb": "Daer sid dobai aerch um service unzemellen SPNAME. Waerend dem Login Prozess sch\u00e9ckt den Identity Provider Attributer, d\u00e9i Informatiounen iwert aer Identit\u00e9it enthaalen. Akzept\u00e9ier daer daat?", + "sl": "Pravkar se nameravate prijaviti v storitev SPNAME. Med postopkom prijave bo IdP tej storitvi posredoval atribute, ki vsebujejo informacije o va\u0161i identiteti. Ali se s tem strinjate? ", + "da": "SPNAME kr\u00e6ver at nedenst\u00e5ende oplysninger overf\u00f8res fra IDPNAME. Vil du acceptere dette?", + "hr": "Servis SPNAME zahtjeva isporuku dolje navedenih podataka.", + "hu": "\u00d6n azonos\u00edtja mag\u00e1t ehhez a szolg\u00e1ltat\u00e1shoz SPNAME. Az azonos\u00edt\u00e1s sor\u00e1n IDPNAME az al\u00e1bbi adatokat fogja k\u00fcldeni a szolg\u00e1ltat\u00e1snak. Enged\u00e9lyezi?", + "fi": "Olet kirjautumassa palveluun SPNAME. Identiteetil\u00e4hteesi henkil\u00f6tietojasi palvelun tarjoajalle. Hyv\u00e4ksytk\u00f6 tietojen siirron?", + "pt-br": "Voc\u00ea est\u00e1 prestes a acessar o servi\u00e7o SPNAME. O servi\u00e7o exige que as informa\u00e7\u00f5es a seguir sejam transferidas do IDPNAME. Voc\u00ea aceita isso?", + "pt": "O servi\u00e7o SPNAME necessita que a informa\u00e7\u00e3o apresentada em baixo seja transferida.", + "pl": "SPNAME wymaga aby poni\u017csza informacja zosta\u0142a przes\u0142ana.", + "cs": "M\u016f\u017eete se p\u0159ihl\u00e1sit do slu\u017eby SPNAME", + "tr": "SPNAME a\u015fa\u011f\u0131daki bilgilerin g\u00f6nderilmesine ihtiya\u00e7 duyuyor.", + "it": "SPNAME richiede che l'informazione sotto riportata sia trasferita.", + "lt": "SPNAME reikalauja persi\u0173sti \u017eemiau pateikt\u0105 informacij\u0105", + "ja": "SPNAME\u306f\u4ee5\u4e0b\u306e\u5909\u63db\u3055\u308c\u305f\u60c5\u5831\u3092\u8981\u6c42\u3057\u307e\u3059\u3002", + "zh-tw": "SPNAME \u8981\u6c42\u8a72\u8cc7\u8a0a\u65bc\u9019\u500b\u50b3\u9001\u3002", + "et": "SPNAME n\u00f5uab allpool oleva info edastamist.", + "he": "SPNAME \u05d3\u05d5\u05e8\u05e9 \u05e9\u05de\u05d9\u05d3\u05e2 \u05d4\u05e0\"\u05dc \u05d9\u05d5\u05e2\u05d1\u05e8", + "ru": "SPNAME \u0442\u0440\u0435\u0431\u0443\u0435\u0442, \u0447\u0442\u043e\u0431\u044b \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f, \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u0430\u044f \u043d\u0438\u0436\u0435, \u0431\u044b\u043b\u0430 \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u0430.", + "zh": "SPNAME\u8bf7\u6c42\u7684\u4fe1\u606f\u5df2\u7ecf\u88ab\u4f20\u8f93\u51fa\u53bb", + "ar": "\u064a\u062d\u062a\u0627\u062c SPNAME \u062a\u062d\u0648\u064a\u0644 \u0627\u0644\u0628\u064a\u0627\u0646\u0627\u062a \u0623\u062f\u0646\u0627\u0647 ", + "lv": "SPNAME prasa p\u0101rraid\u012bt pa t\u012bklu zem\u0101k eso\u0161o inform\u0101ciju.", + "id": "SPNAME mensyaratkan informasi dibawah ini harus ditransder.", + "sr": "Servis SPNAME zahteva slanje dole navedenih podataka.", + "ro": "SPNAME solicit\u0103 trimiterea informa\u021biilor de mai jos.", + "eu": "Zerbitzuak, hemen agertzen den informazioa lekualdatzea eskatzen du.", + "af": "SPNAME vereis dat die inligting hieronder oorgedra word.", + "el": "\u0395\u03ac\u03bd \u03c0\u03c1\u03bf\u03c7\u03c9\u03c1\u03ae\u03c3\u03b5\u03c4\u03b5\u002c \u03c4\u03b1 \u03c3\u03c4\u03bf\u03b9\u03c7\u03b5\u03af\u03b1 \u03c0\u03bf\u03c5 \u03b1\u03ba\u03bf\u03bb\u03bf\u03c5\u03b8\u03bf\u03cd\u03bd \u03b8\u03b1 \u03b4\u03b9\u03b1\u03bc\u03bf\u03b9\u03c1\u03b1\u03c3\u03c4\u03bf\u03cd\u03bd \u03bc\u03b5 \u03c4\u03b7\u03bd \u03c5\u03c0\u03b7\u03c1\u03b5\u03c3\u03af\u03b1 <b>SPNAME<\/b>. \u03a3\u03c5\u03bc\u03c6\u03c9\u03bd\u03b5\u03af\u03c4\u03b5 \u03bc\u03b5 \u03c4\u03b7\u03bd \u03b1\u03c0\u03b5\u03bb\u03b5\u03c5\u03b8\u03ad\u03c1\u03c9\u03c3\u03b7 \u03c4\u03c9\u03bd \u03c3\u03c4\u03bf\u03b9\u03c7\u03b5\u03af\u03c9\u03bd \u03b1\u03c5\u03c4\u03ce\u03bd \u03c3\u03c4\u03b7\u03bd \u03c5\u03c0\u03b7\u03c1\u03b5\u03c3\u03af\u03b1 \u03ba\u03ac\u03b8\u03b5 \u03c6\u03bf\u03c1\u03ac \u03c0\u03bf\u03c5 \u03b5\u03c0\u03b9\u03b8\u03c5\u03bc\u03b5\u03af\u03c4\u03b5 \u03c0\u03c1\u03cc\u03c3\u03b2\u03b1\u03c3\u03b7 \u03c3\u03b5 \u03b1\u03c5\u03c4\u03ae\u003b", + "xh": "I-SPNAME idinga ukuba inkcazelo engezantsi idluliselwe.", + "zu": "I-SPNAME idinga ukuthi ulwazi olungezansi ludluliswe." + }, + "login": { + "no": "innlogging", + "nn": "Logg inn", + "sv": "Logga in", + "es": "login", + "fr": "ouvrir une session", + "de": "anmelden", + "nl": "Login", + "lb": "anloggen", + "sl": "Prijava", + "da": "login", + "hr": "prijavi se", + "hu": "bejelentkez\u00e9s", + "fi": "Tunnus", + "pt-br": "login", + "pt": "Entrar", + "pl": "login", + "cs": "Login", + "tr": "Giri\u015f", + "it": "connessione", + "lt": "Prisijungti", + "ja": "\u30ed\u30b0\u30a4\u30f3", + "zh-tw": "\u767b\u5165", + "et": "logi sisse", + "he": "\u05db\u05e0\u05d9\u05e1\u05d4", + "ru": "\u041b\u043e\u0433\u0438\u043d", + "zh": "\u767b\u5f55", + "ar": "\u062a\u0633\u062c\u064a\u0644 \u0627\u0644\u062f\u062e\u0648\u0644", + "lv": "piesl\u0113gties", + "id": "login", + "sr": "prijavi se", + "ro": "autentificare", + "eu": "hasi saioa", + "af": "meld aan", + "el": "\u0395\u03af\u03c3\u03bf\u03b4\u03bf\u03c2", + "xh": "ngena", + "zu": "ngena" + }, + "service_providers_for": { + "no": "Tjenesteleverand\u00f8r for", + "nn": "Tenesteleverand\u00f8rar for", + "sv": "Tj\u00e4nsteleverant\u00f6rer f\u00f6r", + "es": "Proveedores de servicio para", + "fr": "Fournisseurs de services pour", + "de": "Service-Provider f\u00fcr", + "nl": "Service Providers voor", + "lb": "Service Provider fir", + "sl": "SP za", + "da": "Tjenesteudbyder for", + "hr": "Davatelji usluge za", + "hu": "Alkalmaz\u00e1sszolg\u00e1ltat\u00f3k a k\u00f6vetkez\u0151 sz\u00e1m\u00e1ra", + "fi": "Palveluntarjoaja", + "pt-br": "Provedor de servi\u00e7os para", + "pt": "Fornecedores de Servi\u00e7o (SP) para", + "pl": "Dostawca Serwisu dla", + "cs": "Poskytovatel slu\u017eby pro", + "tr": "i\u00e7in Servis Sa\u011flay\u0131c\u0131lar", + "it": "Service Provider per", + "lt": "Paslaug\u0173 teik\u0117jai", + "ja": "\u30b5\u30fc\u30d3\u30b9\u30d7\u30ed\u30d0\u30a4\u30c0: ", + "zh-tw": "\u7d66\u670d\u52d9\u63d0\u4f9b\u8005", + "et": "Teenusepakkujad", + "he": "\u05e1\u05e4\u05e7\u05d9 \u05e9\u05d9\u05e8\u05d5\u05ea \u05e2\u05d1\u05d5\u05e8", + "ru": "\u041f\u043e\u0441\u0442\u0430\u0432\u0449\u0438\u043a\u0438 \u0443\u0441\u043b\u0443\u0433 \u0434\u043b\u044f", + "zh": "\u670d\u52a1\u63d0\u4f9b\u8005\u7ed9", + "ar": "\u0645\u0642\u062f\u0645\u064a \u062e\u062f\u0645\u0627\u062a \u0644", + "lv": "Servisa pieg\u0101d\u0101t\u0101ji priek\u0161", + "id": "Service Provider untuk", + "sr": "Davaoci Servisa za", + "ro": "Furnizor de servicii pentru", + "eu": "Zerbitzu hornitzaileak hontarako: ", + "af": "Diens Verskaffers vir", + "el": "\u03a0\u03ac\u03c1\u03bf\u03c7\u03bf\u03b9 \u03c5\u03c0\u03b7\u03c1\u03b5\u03c3\u03b9\u03ce\u03bd \u03b3\u03b9\u03b1", + "zu": "Abahlinzeki Besevisi bokuthi", + "xh": "Umboneleli enkonzo we-" + }, + "service_provider_header": { + "no": "Tjenesteleverand\u00f8r", + "nn": "Tenesteleverand\u00f8r", + "sv": "Tj\u00e4nsteleverant\u00f6r", + "es": "Proveedor de servicio", + "fr": "Fournisseur de service", + "de": "Service-Provider", + "nl": "Service Provider", + "lb": "Service Provider", + "sl": "SP", + "da": "Tjenesteudbyder", + "hr": "Davatelj usluge", + "hu": "Alkalmaz\u00e1sszolg\u00e1ltat\u00f3", + "fi": "Palveluntarjoaja", + "pt-br": "Provedor de Servi\u00e7os", + "pt": "Fornecedor de Servi\u00e7o (SP)", + "pl": "Dostawca serwisu", + "cs": "Poskytovatel slu\u017eby", + "tr": "Servis Sa\u011flay\u0131c\u0131", + "it": "Service Provider", + "lt": "Paslaugos teik\u0117jas", + "ja": "\u30b5\u30fc\u30d3\u30b9\u30d7\u30ed\u30d0\u30a4\u30c0", + "zh-tw": "\u670d\u52d9\u63d0\u4f9b\u8005", + "et": "Teenusepakkuja", + "he": "\u05e1\u05e4\u05e7 \u05e9\u05d9\u05e8\u05d5\u05ea", + "ru": "\u041f\u043e\u0441\u0442\u0430\u0432\u0449\u0438\u043a \u0443\u0441\u043b\u0443\u0433", + "zh": "\u670d\u52a1\u63d0\u4f9b\u8005", + "ar": "\u0645\u0642\u062f\u0645 \u062e\u062f\u0645\u0627\u062a", + "lv": "Servisa pieg\u0101d\u0101t\u0101js", + "id": "Service Provider", + "sr": "Davalac Servisa", + "ro": "Furnizor de servicii", + "eu": "Zerbitzu hornitzailea", + "af": "Diens Verskaffer", + "el": "\u03a0\u03ac\u03c1\u03bf\u03c7\u03bf\u03c2 \u03c5\u03c0\u03b7\u03c1\u03b5\u03c3\u03af\u03b1\u03c2", + "zu": "Umhlinzeki Wesevisi", + "xh": "Umboneleli Wenkonzo" + }, + "status_header": { + "no": "Samtykke-status", + "nn": "Samtykkestatus", + "sv": "Status f\u00f6r samtycke", + "es": "Estado del consentimiento", + "fr": "\u00c9tat des consentements", + "de": "Zustimmungsstatus", + "nl": "Toestemming status", + "lb": "Zoust\u00ebmmungsstatus", + "sl": "Stanje privolitve", + "da": "Samtykke status", + "hr": "Status odobrenja", + "hu": "Hozz\u00e1j\u00e1rul\u00e1s \u00e1llapota", + "fi": "Hyv\u00e4ksynn\u00e4\u00e4n tila", + "pt-br": "Status do Consentimento", + "pt": "Consentimento", + "pl": "Status zgody", + "cs": "Status souhlasu", + "tr": "Onay durumu", + "it": "Stato del consenso", + "lt": "Leidimo b\u016bsena", + "ja": "\u627f\u8a8d\u30b9\u30c6\u30fc\u30bf\u30b9", + "zh-tw": "\u540c\u610f\u72c0\u614b", + "et": "N\u00f5usoleku olek", + "he": "\u05de\u05e6\u05d1 \u05d4\u05e1\u05db\u05de\u05d4", + "ru": "\u0420\u0430\u0437\u0440\u0435\u0448\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0441\u0442\u0430\u0442\u0443\u0441", + "zh": "\u540c\u610f\u72b6\u6001", + "ar": "\u062d\u0627\u0644\u0629 \u0645\u0648\u0627\u0641\u0642\u0629", + "lv": "Noteikumu statuss", + "id": "Status persetujuan", + "sr": "Status odobrenja", + "ro": "Stare acord", + "eu": "Onespen egoera", + "af": "Toestemming status", + "el": "\u039a\u03b1\u03c4\u03ac\u03c3\u03c4\u03b1\u03c3\u03b7 \u03c3\u03c5\u03b3\u03ba\u03b1\u03c4\u03ac\u03b8\u03b5\u03c3\u03b7\u03c2", + "zu": "Isimo semvume", + "xh": "Ubume bemvume" + }, + "show_hide_attributes": { + "no": "Vis\/skjul opplysninger", + "nn": "Vis\/skjul opplysningar", + "sv": "visa\/g\u00f6m attribut", + "es": "Mostrar\/ocultar atributos", + "fr": "montrer\/cacher les attributs", + "de": "zeige\/verstecke Eigenschaften", + "nl": "toon\/verberg attributen", + "lb": "Attributer weisen\/verstoppen", + "sl": "prika\u017ei\/skrij atribute", + "da": "vis\/skjul attributter", + "hr": "prika\u017ei\/sakrij atribute", + "hu": "attrib\u00fatumok mutat\u00e1sa\/elrejt\u00e9se", + "fi": "N\u00e4yt\u00e4\/piilota attribuutteja", + "pt-br": "mostra\/esconder Atributos", + "pt": "Mostrar\/Ocultar atributos", + "pl": "poka\u017c\/ukryj atrybuty", + "cs": "zobraz\/skryj atributy", + "tr": "bilgileri g\u00f6ster\/gizle ", + "it": "Mostra\/nascondi attributi", + "lt": "rodyti\/sl\u0117pti atributus", + "ja": "\u8868\u793a\/\u975e\u8868\u793a\u5c5e\u6027", + "zh-tw": "\u986f\u793a\/\u96b1\u85cf\u5c6c\u6027", + "et": "n\u00e4ita\/peida atribuudid", + "he": "\u05d4\u05e8\u05d0\u05d4\\\u05d4\u05e1\u05ea\u05e8 \u05ea\u05db\u05d5\u05e0\u05d5\u05ea ", + "ru": "\u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c\/\u0441\u043a\u0440\u044b\u0442\u044c \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b", + "zh": "\u663e\u793a\/\u9690\u85cf\u5c5e\u6027", + "ar": "\u0627\u0638\u0647\u0631\/\u0627\u0644\u063a\u064a \u0627\u0644\u0633\u0645\u0627\u062a", + "lv": "r\u0101d\u012bt\/sl\u0113pt atrib\u016btus", + "id": "perlihatkan\/sembunyikan attribut", + "sr": "prika\u017ei\/sakrij atribute", + "ro": "arat\u0103\/ascunde atributele", + "eu": "erakutsi\/gorde atributuak", + "af": "vertoon\/verberg eienskappe", + "el": "\u03b5\u03bc\u03c6\u03ac\u03bd\u03b9\u03c3\u03b7\/\u03b1\u03c0\u03cc\u03ba\u03c1\u03c5\u03c8\u03b7 \u03c3\u03c4\u03bf\u03b9\u03c7\u03b5\u03af\u03c9\u03bd", + "xh": "bonisa/fihla iimpawu", + "zu": "bonisa/fihla izici" + }, + "consent_privacypolicy": { + "no": "Personvern for tjenesten", + "nn": "Personvern for tenesta", + "sv": "Tj\u00e4nstens policy f\u00f6r personlig integritet", + "es": "Pol\u00edtica de privacidad para el servicio", + "de": "Datenschutzrichtlinie des Dienstes", + "nl": "Privacybeleid voor de dienst", + "sl": "Politika zasebnosti za ta SP", + "da": "Tjenestens politik vedr\u00f8rende personoplysninger", + "hr": "Politika za\u0161tite privatnosti kod servisa", + "hu": "A szolg\u00e1ltat\u00e1s adatv\u00e1delmi nyilatkozata", + "fi": "Tietosuojaseloste palvelulle", + "pt-br": "Pol\u00edtica de Privacidade deste servi\u00e7o", + "pt": "Pol\u00edtica de privacidade do servi\u00e7o", + "pl": "Polityka prywatno\u015bci dla serwisu", + "cs": "Bezpe\u010dnostn\u00ed politika slu\u017eby", + "tr": "Servis i\u00e7in gizlilik politikas\u0131", + "fr": "Politique de confidentialit\u00e9 pour ce service", + "it": "Politica della privacy per il servizio", + "lt": "\u0160ios paslaugos privatumo politika", + "ja": "\u30b5\u30fc\u30d3\u30b9\u306e\u30d7\u30e9\u30a4\u30d0\u30b7\u30dd\u30ea\u30b7\u30fc", + "zh-tw": "\u670d\u52d9\u96b1\u79c1\u6b0a\u653f\u7b56", + "et": "Teenuse privaatsuspoliitika", + "he": "\u05de\u05d3\u05d9\u05e0\u05d9\u05d5\u05ea \u05d4\u05e4\u05e8\u05d8\u05d9\u05d5\u05ea \u05e9\u05dc \u05d4\u05e9\u05d9\u05e8\u05d5\u05ea", + "ru": "\u041f\u043e\u043b\u0438\u0442\u0438\u043a\u0430 \u043a\u043e\u043d\u0444\u0438\u0434\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0434\u043b\u044f \u0441\u043b\u0443\u0436\u0431\u044b", + "zh": "\u8be5\u670d\u52a1\u7684\u9690\u79c1\u7b56\u7565", + "ar": "\u0633\u064a\u0627\u0633\u0629 \u0627\u0644\u062e\u0635\u0648\u0635\u064a\u0629 \u0644\u0644\u062e\u062f\u0645\u0629", + "lv": "Servisa dro\u0161\u012bbas noteikumi", + "id": "Kebijakan privasi untuk layanan", + "sr": "Politika za\u0161tite privatnosti kod servisa", + "ro": "Politica de confiden\u021bialitate pentru serviciu", + "eu": "Zerbitzuarentzako pribatutasun-politika", + "af": "Privaatheidsbeleid vir die diens", + "el": "\u03a0\u03bf\u03bb\u03b9\u03c4\u03b9\u03ba\u03ae \u03c0\u03c1\u03bf\u03c3\u03c4\u03b1\u03c3\u03af\u03b1\u03c2 \u03b1\u03c0\u03bf\u03c1\u03c1\u03ae\u03c4\u03bf\u03c5 \u03c5\u03c0\u03b7\u03c1\u03b5\u03c3\u03af\u03b1\u03c2", + "zu": "Inqubomgomo yobumfihlo yesevisi", + "xh": "Ipolisi yokugcinwa kwemfihlelo yenkonzo" + }, + "noconsent_title": { + "no": "Ikke akseptert overf\u00f8ring av informasjon", + "nn": "Ikkje akseptert overf\u00f8ring av informasjon", + "sv": "Inget samtycket givet", + "es": "No se di\u00f3 el consentimiento", + "de": "Zustimmung verweigert", + "nl": "Geen toestemming gegeven", + "sl": "Privolitev ni bila dana.", + "da": "Manglende samtykke", + "hr": "Isporuka podataka nije odobrena", + "hu": "Nincs hozz\u00e1j\u00e1rul\u00e1s", + "fi": "Lupaa ei annettu", + "pt-br": "Nenhum consentimento dado", + "pt": "Consentimento negado", + "pl": "Nie wyra\u017cono zgody", + "cs": "Souhlas nebyl vyd\u00e1n", + "tr": "Onay verilmemi\u015f", + "fr": "Aucun consentement n'a \u00e9t\u00e9 donn\u00e9", + "it": "Nessun consenso dato", + "lt": "Leidimas neduotas", + "ja": "\u627f\u8a8d\u306f\u3042\u308a\u307e\u305b\u3093", + "zh-tw": "\u5c1a\u672a\u540c\u610f", + "et": "N\u00f5usolekut pole antud", + "he": "\u05dc\u05d0 \u05e0\u05d9\u05ea\u05e0\u05d4 \u05d4\u05e1\u05db\u05de\u05d4", + "ru": "\u041d\u0435\u0442 \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0441\u043e\u0433\u043b\u0430\u0441\u0438\u044f", + "zh": "\u672a\u540c\u610f", + "ar": "\u0644\u0645 \u062a\u0639\u0637\u064a \u0627\u0644\u0645\u0648\u0627\u0641\u0642\u0629", + "lv": "Nav noteikumu", + "id": "Tidan ada persetujuan yang diberikan", + "sr": "Slanje podataka nije odobreno", + "ro": "Nu a fost dat acordul (consim\u021b\u0103m\u00e2ntul)", + "eu": "Ez da onespena eman", + "af": "Geen toestemming is gegee nie", + "el": "\u039c\u03b7 \u03b1\u03c0\u03bf\u03b4\u03bf\u03c7\u03ae \u03c3\u03c5\u03b3\u03ba\u03b1\u03c4\u03ac\u03b8\u03b5\u03c3\u03b7\u03c2", + "zu": "Ayikho imvume enikeziwe", + "xh": "Akukho mvume inikelweyo" + }, + "noconsent_text": { + "no": "Du har ikke akseptert \u00e5 overlevere opplysninger til SPNAME.", + "nn": "Du har ikkje akseptert til at dine opplysningar kan sendast til SPNAME.", + "sv": "Du gav inte samtycke f\u00f6r att \u00f6verf\u00f6ra dina attribut till tj\u00e4nsteleverant\u00f6ren.", + "es": "No ha dado su consentimiento para tranferir sus atributos al proveedor de servicio.", + "de": "Sie haben der Weitergabe ihrer Daten an den Service Provider nicht zugestimmt.", + "nl": "U heeft geen toestemming gegeven om uw attributen naar de Service Provider te versturen", + "sl": "Niste podali privolitve za posredovanje atributov SP-ju.", + "da": "Du har ikke givet samtykke til overleveringen af oplysninger til tjenesten", + "hr": "Niste dali pristanak da se va\u0161i podaci isporu\u010de davatelju usluge.", + "hu": "Nem adta hozz\u00e1j\u00e1rul\u00e1s\u00e1t, hogy adatait tov\u00e1bbadjuk a szolg\u00e1ltat\u00f3nak.", + "fi": "Et antanut lupaa siirt\u00e4\u00e4 henkil\u00f6tietojasi palveluntarjoajalle", + "pt-br": "Voc\u00ea n\u00e3o deu o consentimento para a transfer\u00eancia de seus atributos para o provedor de servi\u00e7os.", + "pt": "Negou o consentimento para a transfer\u00eancia dos seus atributos para o fornecedor de servi\u00e7o.", + "pl": "Nie wyrazi\u0142e\u015b zgody na przes\u0142anie Twoich atrybut\u00f3w do Dostawcy Serwisu.", + "cs": "Nedal jste souhlas pro zasl\u00e1n\u00ed sv\u00fdch atribut\u016f poskytovateli slu\u017eeb.", + "tr": "Bilgilerinizin servis sa\u011flay\u0131c\u0131ya g\u00f6nderilmesi i\u00e7in onay vermediniz.", + "fr": "Vous n'avez pas donn\u00e9 votre consentement \u00e0 la divulgation de vos attributs pour ce fournisseur de service.", + "it": "Non hai dato il consenso per trasferire i tuoi attributi al service provider.", + "lt": "J\u016bs nedav\u0117te sutikimo persi\u0173sti J\u016bs\u0173 atributus SPNAME paslaugos teik\u0117jui.", + "ja": "\u3042\u306a\u305f\u306f\u30b5\u30fc\u30d3\u30b9\u30d7\u30ed\u30d0\u30a4\u30c0\u306b\u5c5e\u6027\u3092\u8ee2\u9001\u3059\u308b\u4e8b\u3092\u627f\u8a8d\u3057\u3066\u3044\u307e\u305b\u3093\u3002", + "zh-tw": "\u60a8\u4e0d\u540c\u610f\u50b3\u8f38\u60a8\u7684\u5c6c\u6027\u81f3\u670d\u52d9\u63d0\u4f9b\u8005\u3002", + "et": "Sa ei andnud n\u00f5usolekut sinu atribuutide teenusepakkujale edastamiseks.", + "he": "\u05dc\u05d0 \u05e0\u05ea\u05e0\u05ea \u05d4\u05e1\u05db\u05de\u05d4 \u05dc\u05d4\u05e2\u05d1\u05e8\u05ea \u05d4\u05de\u05d0\u05e4\u05d9\u05d9\u05e0\u05d9\u05dd \u05dc\u05e1\u05e4\u05e7 \u05d4\u05e9\u05d9\u05e8\u05d5\u05ea.", + "ru": "\u0412\u044b \u043d\u0435 \u0434\u0430\u043b\u0438 \u0441\u043e\u0433\u043b\u0430\u0441\u0438\u044f \u043d\u0430 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0443 \u0432\u0430\u0448\u0438\u0445 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432 \u043a \u043f\u043e\u0441\u0442\u0430\u0432\u0449\u0438\u043a\u0443 \u0443\u0441\u043b\u0443\u0433.", + "zh": "\u4f60\u6ca1\u6709\u540c\u610f\u4f20\u8f93\u4f60\u7684\u76f8\u5173\u5c5e\u6027\u7ed9\u670d\u52a1\u63d0\u4f9b\u8005", + "ar": "\u0644\u0645 \u062a\u0648\u0627\u0641\u0642 \u0639\u0644\u064a \u062a\u062d\u0648\u064a\u0644 \u0633\u0645\u0627\u062a\u0643 \u0644\u0645\u0642\u062f\u0645 \u0627\u0644\u062e\u062f\u0645\u0629", + "lv": "J\u016bs neesat devis at\u013cauju p\u0101rraid\u012bt inform\u0101ciju servisa pieg\u0101d\u0101t\u0101jam.", + "id": "Anda tidak memberikan persetujuan untuk mentransfer atribut-atribute Anda ke service provider.", + "sr": "Niste odobrili da se va\u0161i podaci po\u0161alju davaocu servisa.", + "ro": "Nu a\u021bi fost de acord s\u0103 trimite\u021bi atributele c\u0103tre SPNAME.", + "eu": "Ez duzu onespena eman zure atributuak zerbitzuari transferitzeko.", + "af": "Jy het nie toestemming gegee vir die oordrag van jou eienskappe na SPNAME nie.", + "el": "\u0394\u03b5\u03bd \u03ad\u03c7\u03b5\u03c4\u03b5 \u03b4\u03ce\u03c3\u03b5\u03b9 \u03c3\u03c5\u03b3\u03ba\u03b1\u03c4\u03ac\u03b8\u03b5\u03c3\u03b7 \u03b3\u03b9\u03b1 \u03c4\u03bf\u03bd \u03b4\u03b9\u03b1\u03bc\u03bf\u03b9\u03c1\u03b1\u03c3\u03bc\u03cc \u03c0\u03c1\u03bf\u03c3\u03c9\u03c0\u03b9\u03ba\u03ce\u03bd \u03b4\u03b5\u03b4\u03bf\u03bc\u03ad\u03bd\u03c9\u03bd \u03bc\u03b5 \u03c4\u03b7\u03bd \u03c5\u03c0\u03b7\u03c1\u03b5\u03c3\u03af\u03b1 SPNAME", + "xh": "Awuyinikelanga imvume yokudluliselwa iimpawu zakho kwi-SPNAME.", + "zu": "Awuzange uyinikeze imvume yokudlulisa izici zakho ku-SPNAME." + }, + "noconsent_return": { + "no": "G\u00e5 tilbake til samtykkesiden", + "nn": "G\u00e5 tilbake til samtykkesida", + "sv": "\u00c5ter till sidan f\u00f6r samtycke", + "es": "Volver a la p\u00e1gina de consentimiento", + "de": "Zur\u00fcck", + "nl": "Keer terug naar de toestemmingspagina", + "sl": "Vrnitev na privolitveno stran", + "da": "G\u00e5 tilbage", + "hr": "Povratak na stranicu za kreiranje dozvola", + "hu": "Vissza az hozz\u00e1j\u00e1rul\u00e1s-kezel\u0151 oldalra", + "fi": "Palaa hyv\u00e4ksynt\u00e4sivulle", + "pt-br": "Retornar a p\u00e1gina de consentimento", + "pt": "Voltar \u00e0 p\u00e1gina de consentimento", + "pl": "Powr\u00f3t do strony wydania zezwolenia.", + "cs": "Zp\u00e1tky na str\u00e1nku pro souhlas", + "tr": "Onay sayfas\u0131na geri d\u00f6n", + "fr": "Retour \u00e0 la page de consentement", + "it": "Torna alla pagina del consenso", + "lt": "Gr\u012f\u017eti \u012f leidim\u0173 puslap\u012f", + "ja": "\u627f\u8a8d\u30da\u30fc\u30b8\u306b\u623b\u308b", + "zh-tw": "\u56de\u5230\u540c\u610f\u9801\u9762", + "et": "Tagasi n\u00f5usoleku lehele", + "he": "\u05d7\u05d6\u05d5\u05e8 \u05dc\u05d3\u05e3 \u05d4\u05e1\u05db\u05de\u05d4", + "zh": "\u8fd4\u56de\u540c\u610f\u754c\u9762", + "ar": "\u0639\u062f \u0644\u0635\u0641\u062d\u0629 \u0627\u0644\u0645\u0648\u0627\u0641\u0642\u0629", + "lv": "Atgriezties uz noteikumu lapu", + "id": "Kembali ke halaman persetujuan", + "sr": "Povratak na stranicu za kreiranje pristanka", + "ro": "\u00centoarcere la pagina de consim\u021b\u0103m\u00e2nt", + "ru": "\u0412\u0435\u0440\u043d\u0443\u0442\u044c\u0441\u044f \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u0434\u043b\u044f \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0441\u043e\u0433\u043b\u0430\u0441\u0438\u044f", + "eu": "Itzuli onespen orrira", + "af": "Keer terug na die toestemmingsbladsy", + "el": "\u0395\u03c0\u03b9\u03c3\u03c4\u03c1\u03bf\u03c6\u03ae \u03c3\u03c4\u03b7 \u03c3\u03b5\u03bb\u03af\u03b4\u03b1 \u03b4\u03ae\u03bb\u03c9\u03c3\u03b7\u03c2 \u03c3\u03c5\u03b3\u03ba\u03b1\u03c4\u03ac\u03b8\u03b5\u03c3\u03b7\u03c2", + "xh": "Buyela kwikhasi lemvume", + "zu": "Buyela ekhasini lemvume" + }, + "consent_header": { + "no": "Samtykke om overf\u00f8ring av personinformasjon", + "nn": "Samtykke til overf\u00f8ring av personinformasjon", + "sv": "Samtycke g\u00e4llande \u00f6verf\u00f6ring av personinformation", + "es": "Consentimiento para la liberaci\u00f3n de informaci\u00f3n personal", + "de": "Zustimmung zur Weitergabe pers\u00f6nlicher Daten", + "nl": "Toestemming voor het vrijgeven van persoonsgegevens", + "sl": "Odlo\u010ditev o privolitvi posredovanja va\u0161ih osebnih podatkov", + "da": "Samtykke til at frigive personlige oplysninger", + "hr": "Dozvola za isporuku osobnih podataka", + "hu": "Hozz\u00e1j\u00e1rul\u00e1s szem\u00e9lyes adatok kiad\u00e1s\u00e1hoz", + "fi": "Henkil\u00f6tietojen luovutuksen hyv\u00e4ksynt\u00e4", + "pt": "Consentimento do envio de informa\u00e7\u00e3o pessoal", + "pl": "Zgoda na wys\u0142anie danych osobistych", + "cs": "Obsah odes\u00edlan\u00fdch osobn\u00edch informac\u00ed", + "tr": "Ki\u015fisel bilgilerin verilmesi hakk\u0131nda onay", + "fr": "Consentement pour la divulgation d'informations personnelles", + "it": "Consenso al rilascio delle informazioni personali", + "lt": "Leidimas perduoti asmenin\u0119 informacij\u0105", + "ja": "\u500b\u4eba\u60c5\u5831\u306e\u627f\u8a8d\u3092\u89e3\u9664", + "zh-tw": "\u540c\u610f\u6709\u95dc\u65bc\u500b\u4eba\u95dc\u4fc2\u8cc7\u8a0a", + "et": "N\u00f5usolek isikuandmete edastamiseks", + "he": "\u05d4\u05e1\u05db\u05de\u05d4 \u05dc\u05d4\u05e2\u05d1\u05e8\u05ea \u05de\u05d9\u05d3\u05e2 \u05d0\u05d9\u05e9\u05d9", + "pt-br": "Consentimento sobre a libera\u00e7\u00e3o de informa\u00e7\u00f5es pessoais", + "zh": "\u540c\u610f\u5f00\u653e\u4e2a\u4eba\u4fe1\u606f", + "ar": "\u0627\u0648\u0627\u0641\u0642 \u0639\u0644\u064a \u0646\u0634\u0631 \u0633\u0645\u0627\u062a\u064a \u0627\u0644\u0634\u062e\u0635\u064a\u0629", + "lv": "Noteikumi par person\u012bg\u0101s inform\u0101cijas nodo\u0161anu", + "id": "Persetujuan tentang melepas informasi personal", + "sr": "Pristanak za slanje li\u010dnih podataka", + "ro": "Acordul pentru a furniza informa\u021bii personale", + "ru": "\u0421\u043e\u0433\u043b\u0430\u0441\u0438\u0435 \u043d\u0430 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0443 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043f\u0435\u0440\u0441\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445", + "eu": "Informazio pertsonala askatzeko onespena ", + "af": "Toestemming mbt. die vrystelling van persoonlike informasie", + "el": "\u0394\u03ae\u03bb\u03c9\u03c3\u03b7 \u03c3\u03c5\u03b3\u03ba\u03b1\u03c4\u03ac\u03b8\u03b5\u03c3\u03b7\u03c2 \u03b3\u03b9\u03b1 \u03c4\u03bf\u03bd \u03b4\u03b9\u03b1\u03bc\u03bf\u03b9\u03c1\u03b1\u03c3\u03bc\u03cc \u03c0\u03c1\u03bf\u03c3\u03c9\u03c0\u03b9\u03ba\u03ce\u03bd \u03b4\u03b5\u03b4\u03bf\u03bc\u03ad\u03bd\u03c9\u03bd", + "xh": "Imvume malunga nokukhutshwa kwenkcazelo yobuqu", + "zu": "Imvume mayelana nokukhulula ulwazi lomuntu siqu" + }, + "consent_attributes_header": { + "no": "Opplysninger som vil bli sendt til SPNAME", + "nn": "Opplysningar som blir sende til SPNAME", + "sv": "Attribut som kommer att skickas till tj\u00e4nsten", + "es": "Atributos que ser\u00e1n enviados al servicio", + "de": "Informationen, die an SPNAME gesandt werden", + "nl": "Informatie die naar SPNAME zal worden gestuurd", + "sl": "Atributi, ki bodo poslani SPju", + "da": "Attributter som bliver sendt til SPNAME", + "hr": "Informacije koje \u0107e biti poslane servisu SPNAME", + "hu": "A(z) SPNAME szolg\u00e1ltat\u00f3nak k\u00fcld\u00f6tt adatok", + "fi": "Tiedot l\u00e4hetet\u00e4\u00e4n palvelulle SPNAME", + "pt": "Informa\u00e7\u00e3o que ir\u00e1 ser enviada para SPNAME", + "pl": "Atrybuty, kt\u00f3re zostan\u0105 przes\u0142ane do serwisu", + "cs": "Atributy, kter\u00e9 mohou b\u00fdt zasl\u00e1ny slu\u017eb\u011b", + "tr": "SPNAME'e g\u00f6nderilecek bilgiler", + "fr": "Informations qui seront envoy\u00e9es \u00e0 SPNAME", + "it": "Informazioni che saranno inviate a SPNAME", + "lt": "Informacija, kuri bus persi\u0173sta \u012f SPNAME", + "ja": "SPNAME\u3068\u3057\u3066\u9001\u4fe1\u3055\u308c\u308b\u60c5\u5831", + "zh-tw": "\u8cc7\u8a0a\u5c07\u88ab\u50b3\u9001\u81f3 SPNAME", + "et": "Andmed saadetakse SPNAME-le", + "he": "\u05d4\u05de\u05d9\u05d3\u05e2 \u05d9\u05e9\u05dc\u05d7 \u05dc SPNAME", + "zh": "\u4fe1\u606f\u5c06\u4f1a\u53d1\u9001\u7ed9SPNAME", + "ar": "\u0627\u0644\u0645\u0639\u0644\u0648\u0645\u0627\u062a \u0627\u0644\u062a\u064a \u0633\u064a\u062a\u0645 \u0625\u0631\u0633\u0627\u0644\u0647\u0627 \u0644 SPNAME", + "lv": "Inform\u0101cija, kas tiks s\u016bt\u012bta SPNAME", + "id": "Informasi yang akan dikirim ke SPNAME", + "sr": "Informacije koje \u0107e biti poslate servisu SPNAME", + "ro": "Informa\u021bii care vor fi trimise la SPNAME", + "ru": "\u0418\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u0430 \u0432 SPNAME ", + "eu": "Zerbitzura bidaliko diren atributuak", + "af": "Informasie wat gestuur sal word na SPNAME", + "el": "\u03a0\u03bb\u03b7\u03c1\u03bf\u03c6\u03bf\u03c1\u03af\u03b5\u03c2 \u03c0\u03bf\u03c5 \u03b8\u03b1 \u03b4\u03b9\u03b1\u03bc\u03bf\u03b9\u03c1\u03b1\u03c3\u03c4\u03bf\u03cd\u03bd \u03bc\u03b5 \u03c4\u03b7\u03bd \u03c5\u03c0\u03b7\u03c1\u03b5\u03c3\u03af\u03b1 SPNAME", + "xh": "Inkcazelo eza kuthunyelwa ku-SPNAME", + "zu": "Ulwazi oluzothunyelwa ku-SPNAME" + }, + "show_attributes": { + "no": "Vis opplysninger", + "nn": "Vis opplysingar", + "sv": "Visa attribut", + "es": "Mostrar atributos", + "de": "Attribute zeigen", + "nl": "Toon attributen", + "sl": "Prika\u017ei atribute", + "da": "Vis attributter", + "hr": "Prika\u017ei atribute", + "hu": "Mutasd az attrib\u00fatumokat", + "fi": "N\u00e4yt\u00e4 henkil\u00f6tiedot", + "pt": "Mostrar atributos", + "pl": "Wy\u015bwietl atrybuty", + "cs": "Zobraz atributy", + "tr": "\u00d6zellikleri g\u00f6ster", + "fr": "Montrer les attributs", + "it": "Mostra attributi", + "lt": "Parodyti atributus", + "ja": "\u5c5e\u6027\u3092\u8868\u793a\u3059\u308b", + "zh-tw": "\u986f\u793a\u5c6c\u6027", + "et": "N\u00e4ita andmeid", + "he": "\u05d4\u05e6\u05d2 \u05de\u05d0\u05e4\u05d9\u05d9\u05e0\u05d9\u05dd", + "pt-br": "Mostrar atributos", + "zh": "\u663e\u793a\u5c5e\u6027", + "ar": "\u0627\u0638\u0647\u0631 \u0627\u0644\u0633\u0645\u0627\u062a", + "lv": "R\u0101d\u012bt atrib\u016btus", + "id": "Perlihatkan atribut-atribut", + "sr": "Prika\u017ei atribute", + "ro": "Arat\u0103 atributele", + "ru": "\u041f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b", + "eu": "Erakutsi atributuak", + "af": "Vertoon eienskappe", + "zu": "Bonisa okuqukethwe", + "xh": "Bonisa isiqulatho" + }, + "noconsent_goto_about": { + "no": "G\u00e5 til informasjonsside om tjenesten", + "nn": "G\u00e5 til informasjonssida for tenesta", + "sv": "G\u00e5 till tj\u00e4nstens informationssida", + "es": "Ir a la p\u00e1gina de informaci\u00f3n del servicio", + "de": "Gehe zur Informationsseite dieses Dienstes", + "nl": "Ga naar de informatiepagina voor de service", + "sl": "Pojdi na spletno stran z informacijami o storitvi", + "da": "G\u00e5 til side med information om tjenesten", + "hr": "Idi na stranicu s informacijama o servisu", + "hu": "A szolg\u00e1ltat\u00e1s inform\u00e1ci\u00f3s oldal\u00e1ra", + "fi": "Siirry palvelun tiedot -sivulle", + "pt": "Ir para p\u00e1gina de informa\u00e7\u00e3o do servi\u00e7o", + "pl": "Przejd\u017a do strony informacyjnej dla tego serwisu", + "cs": "Jdi na str\u00e1nku s informacemi o slu\u017eb\u011b", + "tr": "Servis i\u00e7in bilgi sayfas\u0131na git", + "fr": "Aller \u00e0 la page d'information sur ce service", + "it": "Vai alla pagina di informazioni per il servizio", + "lt": "Pereiti \u012f \u0161ios paslaugos informacin\u012f puslap\u012f", + "ja": "\u30b5\u30fc\u30d3\u30b9\u306e\u70ba\u306e\u60c5\u5831\u30da\u30fc\u30b8\u3092\u53c2\u7167", + "zh-tw": "\u81f3\u670d\u52d9\u8cc7\u8a0a\u9801\u9762", + "et": "Mine teenuse infolehele", + "he": "\u05dc\u05da \u05d0\u05dc \u05d3\u05e3 \u05d4\u05de\u05d9\u05d3\u05e2 \u05e9\u05dc \u05d4\u05e9\u05d9\u05e8\u05d5\u05ea", + "pt-br": "Ir para a P\u00e1gina de Informa\u00e7\u00e3o do servi\u00e7o", + "zh": "\u83b7\u53d6\u8be5\u670d\u52a1\u7684\u4fe1\u606f", + "ar": "\u0627\u0630\u0647\u0628 \u0644\u0635\u0641\u062d\u0629 \u0627\u0644\u0645\u0639\u0644\u0648\u0645\u0627\u062a \u0639\u0646 \u0627\u0644\u062e\u062f\u0645\u0629", + "lv": "Iet uz servisa inform\u0101cijas lapu", + "id": "Pergi ke halaman informasi untul layanan", + "sr": "Idi na stranicu sa informacijama o servisu", + "ro": "Link la pagina serviciului", + "ru": "\u041f\u0435\u0440\u0435\u0439\u0442\u0438 \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u0441 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0435\u0439 \u043e \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u043b\u0443\u0436\u0431\u0435", + "eu": "Joan zerbitzuaren informazio orrira", + "af": "Gaan na die informasie bladsy vir die diens", + "el": "\u0395\u03c0\u03b9\u03c0\u03bb\u03ad\u03bf\u03bd \u03c0\u03bb\u03b7\u03c1\u03bf\u03c6\u03bf\u03c1\u03af\u03b5\u03c2 \u03b3\u03b9\u03b1 \u03c4\u03b7\u03bd \u03c5\u03c0\u03b7\u03c1\u03b5\u03c3\u03af\u03b1", + "xh": "Yiya kwikhasi lenkcazelo ukuze ufumane inkonzo", + "zu": "Iya ekhasini lolwazi lesevisi" + }, + "consent_purpose": { + "no": "Form\u00e5let med SPNAME er SPDESC", + "nn": "Hensikta med SPNAME er SPDESC", + "sv": "Syftet med SPNAME \u00e4r SPDESC", + "es": "El prop\u00f3sito de SPNAME es SPDESC", + "de": "Der Zweck von SPNAME ist SPDESC", + "nl": "Het doel van SPNAME is SPDESC", + "sl": "Namen %SPNAME%: %SPDESC%", + "da": "SPNAME har til form\u00e5l at SPDESC", + "hr": "Namjena servisa SPNAME je SPDESC", + "hu": "A szolg\u00e1ltat\u00e1s (SPNAME) ezt a c\u00e9lt szolg\u00e1lja: SPDESC", + "fi": "Palvelun SPNAME k\u00e4ytt\u00f6tarkoitus on SPDESC", + "pt": "O prop\u00f3sito de SPNAME \u00e9 SPDESC", + "pl": "Celem SPNAME jest SPDESC", + "cs": "C\u00edl SPNAME v SPDESC", + "tr": "SPNAME'in amac\u0131 SPDESC'tir", + "fr": "L'objet de SPNAME est SPDESC", + "it": "Lo scopo di SPNAME \u00e8 SPDESC", + "lt": "SPNAME paskirtis yra SPDESC", + "ja": "SPNAME\u306e\u76ee\u7684\u306fSPDESC\u3067\u3059", + "zh-tw": "SPNAME \u7684\u76ee\u7684\u5730\u70ba SPDESC", + "et": "Teenuse SPNAME eesm\u00e4rk on SPDESC", + "he": "\u05d4\u05de\u05d8\u05e8\u05d4 \u05e9\u05dc SPNAME \u05d4\u05d9\u05d0 SPDESC", + "zh": "SPNAME\u7684\u76ee\u7684\u662fSPDESC", + "ar": "\u0627\u0644\u063a\u0631\u0636 \u0645\u0646 SPNAME \u0647\u0648 SPDESC", + "lv": "SPNAME nol\u016bks ir SPDESC", + "id": "Tujuan dari SPNAME adalah SPDESC", + "sr": "Namena servisa SPNAME je SPDESC", + "ro": "Scopul SPNAME este SPDESC", + "ru": "\u0426\u0435\u043b\u044c SPNAME - SPDESC", + "eu": "Zerbtizuaren xedea SPDESC da", + "af": "Die doel van SPNAME is SPDESC", + "el": "\u03a0\u03b5\u03c1\u03b9\u03b3\u03c1\u03b1\u03c6\u03ae \u03cc\u03c0\u03c9\u03c2 \u03c0\u03b1\u03c1\u03ad\u03c7\u03b5\u03c4\u03b1\u03b9 \u03b1\u03c0\u03cc \u03c4\u03b7\u03bd \u03c5\u03c0\u03b7\u03c1\u03b5\u03c3\u03af\u03b1\u003a SPDESC", + "zu": "Injongo ye-SPNAME yi-SPDESC", + "xh": "Injongo ye-SPNAME yi-SPDESC" + }, + "table_caption": { + "no": "Bruker innformasjon", + "sv": "Anv\u00e4ndarinformation", + "es": "Informaci\u00f3n del usuario", + "de": "Benutzerdaten", + "nl": "Gebruikersinformatie", + "sl": "Podatki o uporabniku", + "da": "Bruger information", + "hu": "Felhaszn\u00e1l\u00f3i inform\u00e1ci\u00f3k", + "fi": "K\u00e4ytt\u00e4j\u00e4tiedot", + "pt": "Informa\u00e7\u00e3o do utilizador", + "tr": "Kullan\u0131c\u0131 bilgisi", + "fr": "Information sur l'usager", + "hr": "Informacije o korisniku", + "nn": "Brukarinformasjon", + "it": "Informazioni utente", + "lt": "Vartotojo informacija", + "ja": "\u30e6\u30fc\u30b6\u30fc\u60c5\u5831", + "zh-tw": "\u4f7f\u7528\u8005\u8cc7\u8a0a", + "et": "Kasutajainfo", + "he": "\u05de\u05d9\u05d3\u05e2 \u05e2\u05dc \u05d4\u05de\u05e9\u05ea\u05de\u05e9", + "pt-br": "Informa\u00e7\u00f5es do Usu\u00e1rio", + "zh": "\u7528\u6237\u4fe1\u606f", + "ar": "\u0645\u0639\u0644\u0648\u0645\u0627\u062a \u0627\u0644\u0645\u0633\u062a\u062e\u062f\u0645", + "lv": "Lietot\u0101ja inform\u0101cija", + "id": "Informasi User", + "sr": "Informacije o korisniku", + "ro": "Informa\u021bii despre utilizator", + "ru": "\u0418\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435", + "cs": "U\u017eivatelsk\u00e9 informace", + "eu": "Erabiltzailearen informazioa", + "af": "Gebruiker informasie", + "el": "\u03a0\u03bb\u03b7\u03c1\u03bf\u03c6\u03bf\u03c1\u03af\u03b5\u03c2 \u03c7\u03c1\u03ae\u03c3\u03c4\u03b7", + "xh": "Inkcazelo yomsebenzisi", + "zu": "Ulwazi lomsebenzisi" + }, + "table_summary": { + "no": "Her listes den innformasjonen om deg som blir send til den tjenesten du er i ferd med \u00e5 logge p\u00e5", + "sv": "Visa den nformation om din anv\u00e4ndare som kommer att skickas till tj\u00e4nsten som du \u00e4r p\u00e5 v\u00e4g att logga in i", + "es": "Muestra que informaci\u00f3n relativa a usted va a ser transmitida al servicio en el que se va a identificar", + "nl": "De informatie die over jou bekend is en naar de service waarop je wilt inloggen verstuurd zal worden", + "sl": "Seznam podatkov o vas, ki bodo posredovani storitvi, v katero se nameravate prijaviti", + "da": "Informationer som vil blive sendt til den service du er ved at logge in p\u00e5", + "hu": "Ezeket az adatokat fogjuk elk\u00fcldeni \u00d6nr\u0151l annak a szolg\u00e1ltat\u00e1snak, ahov\u00e1 be k\u00edv\u00e1n jelentkezni", + "fi": "N\u00e4yt\u00e4 tietosi, joita ollaan siirt\u00e4m\u00e4ss\u00e4 palveluun", + "pt": "Listar a informa\u00e7\u00e3o acerca de si que ser\u00e1 enviada para o servi\u00e7o no qual se est\u00e1 autenticar", + "tr": "Girmek istedi\u011finiz servise g\u00f6nderilecek bilginizi listeleyin", + "de": "Zeige die Information \u00fcber Sie, die an den Service, auf dem Sie sich einloggen werden, \u00fcbermittelt werden", + "fr": "Liste des informations vous concernant qui seront envoy\u00e9es au service auquel vous allez vous connecter", + "hr": "Prika\u017ei popis va\u0161ih podataka koji \u0107e biti proslje\u0111eni servisu kojem \u017eelite pristupiti", + "nn": "List informasjon om deg som blir overf\u00f8rt til tenesta du skal logga inn p\u00e5", + "it": "Mostra le informazioni su di te che stanno per essere trasferire al servizio a cui ti vuoi collegare", + "lt": "Per\u017ei\u016br\u0117ti informacij\u0105 apie jus, kuri bus persi\u0173sta paslaugai, \u012f kuri\u0105 jungiat\u0117s", + "ja": "\u4e00\u89a7\u306e\u60c5\u5831\u306f\u3042\u306a\u305f\u304c\u30ed\u30b0\u30a4\u30f3\u3059\u308b\u969b\u306b\u30b5\u30fc\u30d3\u30b9\u306b\u8ee2\u9001\u3055\u308c\u307e\u3059\u3002", + "zh-tw": "\u5c07\u95dc\u65bc\u6211\u50b3\u9001\u81f3\u60a8\u9810\u8a08\u8981\u767b\u5165\u7684\u670d\u52d9", + "et": "Teave sinu kohta, mis edastatakse teenusele, millesse asud sisse logima", + "he": "\u05d4\u05e6\u05d2 \u05d0\u05ea \u05d4\u05de\u05d9\u05d3\u05e2 \u05e2\u05dc\u05d9\u05da \u05d0\u05e9\u05e8 \u05d9\u05d5\u05e2\u05d1\u05e8 \u05dc\u05e9\u05d9\u05e8\u05d5\u05ea \u05e9\u05d0\u05ea\u05d4 \u05e2\u05d5\u05de\u05d3 \u05dc\u05d4\u05ea\u05d7\u05d1\u05e8 \u05d0\u05dc\u05d9\u05d5", + "pt-br": "Liste as informa\u00e7\u00f5es sobre voc\u00ea que est\u00e1 prestes a ser transmitida para o servi\u00e7o que voc\u00ea est\u00e1 acessando", + "zh": "\u5f53\u4f60\u767b\u5f55\u65f6\u5c06\u8981\u4f20\u8f93\u7ed9\u670d\u52a1\u7684\u4fe1\u606f\u5217\u8868", + "ar": "\u0642\u0627\u0626\u0645\u0629 \u0645\u0639\u0644\u0648\u0645\u0627\u062a\u0643 \u0627\u0644\u062a\u064a \u0633\u062a\u062d\u0648\u0644 \u0644\u0645\u0642\u062f\u0645 \u0627\u0644\u062e\u062f\u0645\u0629 \u0627\u0644\u0630\u064a \u062a\u0631\u063a\u0628 \u0628\u062a\u0633\u062c\u064a\u0644 \u0627\u0644\u062f\u062e\u0648\u0644 \u0627\u0644\u064a\u0647", + "lv": "Inform\u0101cija par Jums, kas tiks s\u016bt\u012bta servisam, kuram J\u016bs piesl\u0113dzaties", + "id": "Daftar informasi tentang Anda yang akan dikirimkan ke service tujuan login Anda.", + "sr": "Prika\u017ei spisak podataka o vama koji \u0107e biti prosle\u0111eni servisu kome \u017eelite pristupiti", + "ro": "Afi\u0219eaz\u0103 informa\u021biile care vor fi trimise la serviciul unde dori\u021bi s\u0103 v\u0103 autentifica\u021bi", + "ru": "\u0412\u044b\u0434\u0430\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u0430 \u0441\u043b\u0443\u0436\u0431\u0435, \u0432 \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0432\u044b \u043f\u044b\u0442\u0430\u0435\u0442\u0435\u0441\u044c \u0432\u043e\u0439\u0442\u0438", + "cs": "Seznam informac\u00ed o v\u00e1s, kter\u00e9 budou p\u0159ed\u00e1ny slu\u017eb\u011b, ke kter\u00e9 se p\u0159ihla\u0161ujete", + "eu": "Zu identifikatuko zaren zerbitzura zure ze informazio bidaliko den erakusten du ", + "af": "Lys die informasie mbt. jou wat op die punt is om gestuur te word vir die diens waarby jy wil aanmeld.", + "el": "\u0395\u03bc\u03c6\u03ac\u03bd\u03b9\u03c3\u03b7 \u03c0\u03bb\u03b7\u03c1\u03bf\u03c6\u03bf\u03c1\u03b9\u03ce\u03bd \u03c0\u03bf\u03c5 \u03b8\u03b1 \u03b4\u03b9\u03b1\u03bc\u03bf\u03b9\u03c1\u03b1\u03c3\u03c4\u03bf\u03cd\u03bd \u03bc\u03b5 \u03c4\u03b7\u03bd \u03c5\u03c0\u03b7\u03c1\u03b5\u03c3\u03af\u03b1 \u03ba\u03b1\u03c4\u03ac \u03c4\u03b7\u03bd \u03c0\u03c1\u03cc\u03c3\u03b2\u03b1\u03c3\u03b7 \u03c3\u03b5 \u03b1\u03c5\u03c4\u03ae", + "zu": "Enza uhlu olumayelana nolwazi lwakho oluzodluliselwa kusevisi ozongena kuyo", + "xh": "Dwelisa inkcazelo engawe eza kudluliselwa kwinkonzo oza kungena kuyo" + }, + "show_attribute": { + "no": "Vis innhold", + "nn": "Vis innhald", + "sv": "Visa samtycke", + "es": "Mostrart consentimiento", + "nl": "Toon inhoud", + "sl": "Prika\u017ei vsebino", + "da": "Vis indhold", + "de": "Zeige Inhalt", + "pt": "Mostrar conte\u00fado", + "fr": "Montrer le contenu", + "hr": "Prika\u017ei sadr\u017eaj", + "it": "Mostra contenuto", + "hu": "R\u00e9szletek", + "lt": "Parodyti leidim\u0105", + "ja": "\u5185\u5bb9\u3092\u8868\u793a\u3059\u308b", + "zh-tw": "\u986f\u793a\u5167\u5bb9", + "pl": "Wy\u015bwietl zawarto\u015b\u0107", + "et": "N\u00e4ita sisu", + "he": "\u05d4\u05e6\u05d2 \u05ea\u05d5\u05db\u05df", + "pt-br": "Mostrar Conte\u00fado", + "zh": "\u663e\u793a\u5185\u5bb9", + "ar": "\u0627\u0638\u0647\u0631\u0627\u0644\u064a\u0647\u0627 \u0638\u0647\u0631 \u0627\u0644\u0645\u062d\u062a\u0648\u064a", + "lv": "R\u0101d\u012bt saturu", + "id": "Perlihatkan konten", + "sr": "Prika\u017ei sadr\u017eaj", + "ro": "Arat\u0103 con\u021binutul", + "ru": "\u041f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435", + "cs": "Zobrazit obsah", + "eu": "Erakutsi onespena", + "af": "Vertoon inhoud", + "el": "\u0395\u03bc\u03c6\u03ac\u03bd\u03b9\u03c3\u03b7 \u03bb\u03b5\u03c0\u03c4\u03bf\u03bc\u03b5\u03c1\u03b5\u03b9\u03ce\u03bd", + "zu": "Bonisa izici", + "xh": "Bonisa iimpawu" + }, + "abort": { + "no": "Avbryt innlogging til SPNAME", + "nn": "Avbryt innlogging til SPNAME", + "lt": "At\u0161aukti prisijungim\u0105 prie SPNAME", + "sr": "Prekini prijavu na SPNAME", + "it": "Login interrotto a SPNAME", + "fr": "Annuler la connexion au fournisseur de service SPNAME", + "de": "Anmeldung am Service Provider SPNAME abbrechen", + "et": "Katkesta sisselogimine: SPNAME", + "nl": "Inloggen op SPNAME afbreken", + "es": "Cancelar la identificaci\u00f3n en SPNAME", + "ro": "Anuleaz\u0103 cererea de autentificare la SPNAME", + "ar": "\u0625\u0644\u063a\u0627\u0621 \u0639\u0645\u0644\u064a\u0629 \u0627\u0644\u062f\u062e\u0648\u0644 \u0644SPNAME", + "ru": "\u041f\u0440\u0435\u043a\u0440\u0430\u0442\u0438\u0442\u044c \u043b\u043e\u0433\u0438\u043d \u0432 SPNAME", + "cs": "Zru\u0161it p\u0159ihl\u00e1\u0161en\u00ed k SPNAME", + "hr": "Odustani od prijave u SPNAME", + "zh": "\u4e2d\u6b62\u767b\u5f55\u5230SPNAME", + "eu": "Bertan behera utzi zerbitzuan identifikazioa", + "zh-tw": "\u95dc\u65bc\u767b\u5165\u81f3 SPNAME", + "da": "Afbryd login til SPNAME", + "af": "Kanseleer aanmelding na SPNAME", + "el": "\u0391\u03ba\u03cd\u03c1\u03c9\u03c3\u03b7 \u03b5\u03b9\u03c3\u03cc\u03b4\u03bf\u03c5 \u03c3\u03c4\u03b7\u03bd \u03c5\u03c0\u03b7\u03c1\u03b5\u03c3\u03af\u03b1 SPNAME", + "xh": "Yeka ungeno kwi-SPNAME", + "zu": "Yeka ukungena ku-SPNAME", + "sl": "Prekini prijavo na SPNAME" + } } diff --git a/vendor/simplesamlphp/simplesamlphp/modules/consent/docs/consent.md b/vendor/simplesamlphp/simplesamlphp/modules/consent/docs/consent.md index 886d6fcbd1..3725020154 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/consent/docs/consent.md +++ b/vendor/simplesamlphp/simplesamlphp/modules/consent/docs/consent.md @@ -42,7 +42,7 @@ the user logs in. Example: 90 => array( - 'class:Consent', + 'class' => 'consent:Consent', ), Using storage @@ -72,8 +72,8 @@ database. Here is the initialization SQL script: CREATE TABLE consent ( - consent_date TIMESTAMP NOT NULL, - usage_date TIMESTAMP NOT NULL, + consent_date TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + usage_date TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, hashed_user_id VARCHAR(80) NOT NULL, service_id VARCHAR(255) NOT NULL, attribute VARCHAR(80) NOT NULL, @@ -103,27 +103,27 @@ and defaults to `consent`. Example config using PostgreSQL database: - 90 => array( - 'class' => 'consent:Consent', - 'store' => array( - 'consent:Database', - 'dsn' => 'pgsql:host=sql.example.org;dbname=consent', - 'username' => 'simplesaml', - 'password' => 'sdfsdf', - ), - ), + 90 => array( + 'class' => 'consent:Consent', + 'store' => array( + 'consent:Database', + 'dsn' => 'pgsql:host=sql.example.org;dbname=consent', + 'username' => 'simplesaml', + 'password' => 'sdfsdf', + ), + ), Example config using MySQL database: - 90 => array( - 'class' => 'consent:Consent', - 'store' => array( - 'consent:Database', + 90 => array( + 'class' => 'consent:Consent', + 'store' => array( + 'consent:Database', 'dsn' => 'mysql:host=db.example.org;dbname=simplesaml', - 'username' => 'simplesaml', - 'password' => 'sdfsdf', - ), - ), + 'username' => 'simplesaml', + 'password' => 'sdfsdf', + ), + ), Options @@ -149,7 +149,7 @@ The following options can be used when configuring the Consent module: `store` : Configuration of the Consent storage backend. The store option is given in the format <module>:<class> and refers to the class - sspmod_<module>_Consent_Store_<class>. The consent module comes with two + \SimpleSAML\Module\<module>\Consent\Store\<class>. The consent module comes with two built in storage backends: 'consent:Cookie' and 'consent:Database'. See the separate section on setting up consent using different storage methods. This option is optional. If the option is not set, then the user is asked to @@ -160,9 +160,15 @@ The following options can be used when configuring the Consent module: the attributes that should have their value hidden. Default behaviour is that all attribute values are shown. +`attributes.exclude` +: Allows certain attributes to be excluded from the attribute hash when + `includeValues` is `true` (and as a side effect, to be hidden from display + as `hiddenAttributes` does). Set to an array of the attributes that should + be excluded. Default behaviour is to include all values in the hash. + `showNoConsentAboutService` : Whether we will show a link to more information about the service from the - no consent page. Defaults to `TRUE`. + no consent page. Defaults to `true`. External options ---------------- diff --git a/vendor/simplesamlphp/simplesamlphp/modules/consent/lib/Auth/Process/Consent.php b/vendor/simplesamlphp/simplesamlphp/modules/consent/lib/Auth/Process/Consent.php index efa36bca58..f5b6bfc810 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/consent/lib/Auth/Process/Consent.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/consent/lib/Auth/Process/Consent.php @@ -1,5 +1,6 @@ <?php +namespace SimpleSAML\Module\consent\Auth\Process; /** * Consent Authentication Processing filter @@ -9,57 +10,62 @@ * * @package SimpleSAMLphp */ -class sspmod_consent_Auth_Process_Consent extends SimpleSAML_Auth_ProcessingFilter -{ +use SimpleSAML\Logger; +use SimpleSAML\Module; +use SimpleSAML\Stats; +use SimpleSAML\Utils; + +class Consent extends \SimpleSAML\Auth\ProcessingFilter +{ /** * Button to receive focus * * @var string|null */ - private $_focus = null; + private $focus = null; /** * Include attribute values * * @var bool */ - private $_includeValues = false; + private $includeValues = false; /** * Check remember consent * * @var bool */ - private $_checked = false; + private $checked = false; /** * Consent backend storage configuration * - * @var array + * @var \SimpleSAML\Module\consent\Store|null */ - private $_store = null; + private $store = null; /** * Attributes where the value should be hidden * * @var array */ - private $_hiddenAttributes = array(); + private $hiddenAttributes = []; /** * Attributes which should not require consent * - * @var aray + * @var array */ - private $_noconsentattributes = array(); + private $noconsentattributes = []; /** * Whether we should show the "about service"-link on the no consent page. * * @var bool */ - private $_showNoConsentAboutService = true; + private $showNoConsentAboutService = true; /** @@ -70,68 +76,77 @@ class sspmod_consent_Auth_Process_Consent extends SimpleSAML_Auth_ProcessingFilt * @param array $config Configuration information. * @param mixed $reserved For future use. * - * @throws SimpleSAML_Error_Exception if the configuration is not valid. + * @throws \SimpleSAML\Error\Exception if the configuration is not valid. */ public function __construct($config, $reserved) { - assert('is_array($config)'); + assert(is_array($config)); parent::__construct($config, $reserved); if (array_key_exists('includeValues', $config)) { if (!is_bool($config['includeValues'])) { - throw new SimpleSAML_Error_Exception( + throw new \SimpleSAML\Error\Exception( 'Consent: includeValues must be boolean. '. var_export($config['includeValues'], true).' given.' ); } - $this->_includeValues = $config['includeValues']; + $this->includeValues = $config['includeValues']; } if (array_key_exists('checked', $config)) { if (!is_bool($config['checked'])) { - throw new SimpleSAML_Error_Exception( + throw new \SimpleSAML\Error\Exception( 'Consent: checked must be boolean. '. var_export($config['checked'], true).' given.' ); } - $this->_checked = $config['checked']; + $this->checked = $config['checked']; } if (array_key_exists('focus', $config)) { - if (!in_array($config['focus'], array('yes', 'no'), true)) { - throw new SimpleSAML_Error_Exception( + if (!in_array($config['focus'], ['yes', 'no'], true)) { + throw new \SimpleSAML\Error\Exception( 'Consent: focus must be a string with values `yes` or `no`. '. var_export($config['focus'], true).' given.' ); } - $this->_focus = $config['focus']; + $this->focus = $config['focus']; } if (array_key_exists('hiddenAttributes', $config)) { if (!is_array($config['hiddenAttributes'])) { - throw new SimpleSAML_Error_Exception( + throw new \SimpleSAML\Error\Exception( 'Consent: hiddenAttributes must be an array. '. var_export($config['hiddenAttributes'], true).' given.' ); } - $this->_hiddenAttributes = $config['hiddenAttributes']; + $this->hiddenAttributes = $config['hiddenAttributes']; } - if (array_key_exists('noconsentattributes', $config)) { + if (array_key_exists('attributes.exclude', $config)) { + if (!is_array($config['attributes.exclude'])) { + throw new \SimpleSAML\Error\Exception( + 'Consent: attributes.exclude must be an array. '. + var_export($config['attributes.exclude'], true).' given.' + ); + } + $this->noconsentattributes = $config['attributes.exclude']; + } elseif (array_key_exists('noconsentattributes', $config)) { + Logger::warning("The 'noconsentattributes' option has been deprecated in favour of 'attributes.exclude'."); if (!is_array($config['noconsentattributes'])) { - throw new SimpleSAML_Error_Exception( + throw new \SimpleSAML\Error\Exception( 'Consent: noconsentattributes must be an array. '. var_export($config['noconsentattributes'], true).' given.' ); } - $this->_noconsentattributes = $config['noconsentattributes']; + $this->noconsentattributes = $config['noconsentattributes']; } if (array_key_exists('store', $config)) { try { - $this->_store = sspmod_consent_Store::parseStoreConfig($config['store']); - } catch (Exception $e) { - SimpleSAML\Logger::error( + $this->store = \SimpleSAML\Module\consent\Store::parseStoreConfig($config['store']); + } catch (\Exception $e) { + Logger::error( 'Consent: Could not create consent storage: '. $e->getMessage() ); @@ -140,9 +155,9 @@ public function __construct($config, $reserved) if (array_key_exists('showNoConsentAboutService', $config)) { if (!is_bool($config['showNoConsentAboutService'])) { - throw new SimpleSAML_Error_Exception('Consent: showNoConsentAboutService must be a boolean.'); + throw new \SimpleSAML\Error\Exception('Consent: showNoConsentAboutService must be a boolean.'); } - $this->_showNoConsentAboutService = $config['showNoConsentAboutService']; + $this->showNoConsentAboutService = $config['showNoConsentAboutService']; } } @@ -214,22 +229,22 @@ private static function checkDisable($option, $entityId) * * @return void * - * @throws SimpleSAML_Error_NoPassive if the request was passive and consent is needed. + * @throws \SimpleSAML\Error\NoPassive if the request was passive and consent is needed. */ public function process(&$state) { - assert('is_array($state)'); - assert('array_key_exists("UserID", $state)'); - assert('array_key_exists("Destination", $state)'); - assert('array_key_exists("entityid", $state["Destination"])'); - assert('array_key_exists("metadata-set", $state["Destination"])'); - assert('array_key_exists("entityid", $state["Source"])'); - assert('array_key_exists("metadata-set", $state["Source"])'); + assert(is_array($state)); + assert(array_key_exists('UserID', $state)); + assert(array_key_exists('Destination', $state)); + assert(array_key_exists('entityid', $state['Destination'])); + assert(array_key_exists('metadata-set', $state['Destination'])); + assert(array_key_exists('entityid', $state['Source'])); + assert(array_key_exists('metadata-set', $state['Source'])); $spEntityId = $state['Destination']['entityid']; $idpEntityId = $state['Source']['entityid']; - $metadata = SimpleSAML_Metadata_MetaDataStorageHandler::getMetadataHandler(); + $metadata = \SimpleSAML\Metadata\MetaDataStorageHandler::getMetadataHandler(); /** * If the consent module is active on a bridge $state['saml:sp:IdP'] @@ -243,90 +258,93 @@ public function process(&$state) $state['Source'] = $idpmeta; } - $statsData = array('spEntityID' => $spEntityId); + $statsData = ['spEntityID' => $spEntityId]; // Do not use consent if disabled if (isset($state['Source']['consent.disable']) && self::checkDisable($state['Source']['consent.disable'], $spEntityId) ) { - SimpleSAML\Logger::debug('Consent: Consent disabled for entity '.$spEntityId.' with IdP '.$idpEntityId); - SimpleSAML_Stats::log('consent:disabled', $statsData); + Logger::debug('Consent: Consent disabled for entity '.$spEntityId.' with IdP '.$idpEntityId); + Stats::log('consent:disabled', $statsData); return; } if (isset($state['Destination']['consent.disable']) && self::checkDisable($state['Destination']['consent.disable'], $idpEntityId) ) { - SimpleSAML\Logger::debug('Consent: Consent disabled for entity '.$spEntityId.' with IdP '.$idpEntityId); - SimpleSAML_Stats::log('consent:disabled', $statsData); + Logger::debug('Consent: Consent disabled for entity '.$spEntityId.' with IdP '.$idpEntityId); + Stats::log('consent:disabled', $statsData); return; } - if ($this->_store !== null) { + if ($this->store !== null) { $source = $state['Source']['metadata-set'].'|'.$idpEntityId; $destination = $state['Destination']['metadata-set'].'|'.$spEntityId; $attributes = $state['Attributes']; // Remove attributes that do not require consent foreach ($attributes as $attrkey => $attrval) { - if (in_array($attrkey, $this->_noconsentattributes, true)) { + if (in_array($attrkey, $this->noconsentattributes, true)) { unset($attributes[$attrkey]); } } - SimpleSAML\Logger::debug('Consent: userid: '.$state['UserID']); - SimpleSAML\Logger::debug('Consent: source: '.$source); - SimpleSAML\Logger::debug('Consent: destination: '.$destination); + Logger::debug('Consent: userid: '.$state['UserID']); + Logger::debug('Consent: source: '.$source); + Logger::debug('Consent: destination: '.$destination); $userId = self::getHashedUserID($state['UserID'], $source); $targetedId = self::getTargetedID($state['UserID'], $source, $destination); - $attributeSet = self::getAttributeHash($attributes, $this->_includeValues); + $attributeSet = self::getAttributeHash($attributes, $this->includeValues); - SimpleSAML\Logger::debug( + Logger::debug( 'Consent: hasConsent() ['.$userId.'|'.$targetedId.'|'. $attributeSet.']' ); try { - if ($this->_store->hasConsent($userId, $targetedId, $attributeSet)) { + if ($this->store->hasConsent($userId, $targetedId, $attributeSet)) { // Consent already given - SimpleSAML\Logger::stats('consent found'); - SimpleSAML_Stats::log('consent:found', $statsData); + Logger::stats('consent found'); + Stats::log('consent:found', $statsData); return; } - SimpleSAML\Logger::stats('consent notfound'); - SimpleSAML_Stats::log('consent:notfound', $statsData); + Logger::stats('consent notfound'); + Stats::log('consent:notfound', $statsData); - $state['consent:store'] = $this->_store; + $state['consent:store'] = $this->store; $state['consent:store.userId'] = $userId; $state['consent:store.destination'] = $targetedId; $state['consent:store.attributeSet'] = $attributeSet; - } catch (Exception $e) { - SimpleSAML\Logger::error('Consent: Error reading from storage: '.$e->getMessage()); - SimpleSAML\Logger::stats('Ccnsent failed'); - SimpleSAML_Stats::log('consent:failed', $statsData); + } catch (\Exception $e) { + Logger::error('Consent: Error reading from storage: '.$e->getMessage()); + Logger::stats('Consent failed'); + Stats::log('consent:failed', $statsData); } } else { - SimpleSAML\Logger::stats('consent nostorage'); - SimpleSAML_Stats::log('consent:nostorage', $statsData); + Logger::stats('consent nostorage'); + Stats::log('consent:nostorage', $statsData); } - $state['consent:focus'] = $this->_focus; - $state['consent:checked'] = $this->_checked; - $state['consent:hiddenAttributes'] = $this->_hiddenAttributes; - $state['consent:noconsentattributes'] = $this->_noconsentattributes; - $state['consent:showNoConsentAboutService'] = $this->_showNoConsentAboutService; + $state['consent:focus'] = $this->focus; + $state['consent:checked'] = $this->checked; + $state['consent:hiddenAttributes'] = $this->hiddenAttributes; + $state['consent:noconsentattributes'] = $this->noconsentattributes; + $state['consent:showNoConsentAboutService'] = $this->showNoConsentAboutService; // user interaction necessary. Throw exception on isPassive request if (isset($state['isPassive']) && $state['isPassive'] === true) { - SimpleSAML_Stats::log('consent:nopassive', $statsData); - throw new SimpleSAML_Error_NoPassive('Unable to give consent on passive request.'); + Stats::log('consent:nopassive', $statsData); + throw new Module\saml\Error\NoPassive( + \SAML2\Constants::STATUS_REQUESTER, + 'Unable to give consent on passive request.' + ); } // Save state and redirect - $id = SimpleSAML_Auth_State::saveState($state, 'consent:request'); - $url = SimpleSAML\Module::getModuleURL('consent/getconsent.php'); - \SimpleSAML\Utils\HTTP::redirectTrustedURL($url, array('StateId' => $id)); + $id = \SimpleSAML\Auth\State::saveState($state, 'consent:request'); + $url = Module::getModuleURL('consent/getconsent.php'); + Utils\HTTP::redirectTrustedURL($url, ['StateId' => $id]); } @@ -340,7 +358,7 @@ public function process(&$state) */ public static function getHashedUserID($userid, $source) { - return hash('sha1', $userid.'|'.SimpleSAML\Utils\Config::getSecretSalt().'|'.$source); + return hash('sha1', $userid.'|'.Utils\Config::getSecretSalt().'|'.$source); } @@ -355,7 +373,7 @@ public static function getHashedUserID($userid, $source) */ public static function getTargetedID($userid, $source, $destination) { - return hash('sha1', $userid.'|'.SimpleSAML\Utils\Config::getSecretSalt().'|'.$source.'|'.$destination); + return hash('sha1', $userid.'|'.Utils\Config::getSecretSalt().'|'.$source.'|'.$destination); } @@ -372,8 +390,10 @@ public static function getTargetedID($userid, $source, $destination) */ public static function getAttributeHash($attributes, $includeValues = false) { - $hashBase = null; if ($includeValues) { + foreach ($attributes as &$values) { + sort($values); + } ksort($attributes); $hashBase = serialize($attributes); } else { diff --git a/vendor/simplesamlphp/simplesamlphp/modules/consent/lib/Consent/Store/Cookie.php b/vendor/simplesamlphp/simplesamlphp/modules/consent/lib/Consent/Store/Cookie.php index 39ecec6498..1a87807352 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/consent/lib/Consent/Store/Cookie.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/consent/lib/Consent/Store/Cookie.php @@ -1,4 +1,7 @@ <?php + +namespace SimpleSAML\Module\consent\Consent\Store; + /** * Cookie storage for consent * @@ -18,7 +21,8 @@ * @author Olav Morken <olav.morken@uninett.no> * @package SimpleSAMLphp */ -class sspmod_consent_Consent_Store_Cookie extends sspmod_consent_Store + +class Cookie extends \SimpleSAML\Module\consent\Store { /** * Check for consent. @@ -34,41 +38,40 @@ class sspmod_consent_Consent_Store_Cookie extends sspmod_consent_Store */ public function hasConsent($userId, $destinationId, $attributeSet) { - assert('is_string($userId)'); - assert('is_string($destinationId)'); - assert('is_string($attributeSet)'); + assert(is_string($userId)); + assert(is_string($destinationId)); + assert(is_string($attributeSet)); - $cookieName = self::_getCookieName($userId, $destinationId); + $cookieName = self::getCookieName($userId, $destinationId); - $data = $userId . ':' . $attributeSet . ':' . $destinationId; + $data = $userId.':'.$attributeSet.':'.$destinationId; - SimpleSAML\Logger::debug('Consent cookie - Get [' . $data . ']'); + \SimpleSAML\Logger::debug('Consent cookie - Get ['.$data.']'); if (!array_key_exists($cookieName, $_COOKIE)) { - SimpleSAML\Logger::debug( - 'Consent cookie - no cookie with name \'' . - $cookieName . '\'.' + \SimpleSAML\Logger::debug( + 'Consent cookie - no cookie with name \''.$cookieName.'\'.' ); return false; } if (!is_string($_COOKIE[$cookieName])) { - SimpleSAML\Logger::warning( - 'Value of consent cookie wasn\'t a string. Was: ' . + \SimpleSAML\Logger::warning( + 'Value of consent cookie wasn\'t a string. Was: '. var_export($_COOKIE[$cookieName], true) ); return false; } - $data = self::_sign($data); + $data = self::sign($data); if ($_COOKIE[$cookieName] !== $data) { - SimpleSAML\Logger::info( + \SimpleSAML\Logger::info( 'Attribute set changed from the last time consent was given.' ); return false; } - SimpleSAML\Logger::debug( + \SimpleSAML\Logger::debug( 'Consent cookie - found cookie with correct name and value.' ); @@ -90,17 +93,17 @@ public function hasConsent($userId, $destinationId, $attributeSet) */ public function saveConsent($userId, $destinationId, $attributeSet) { - assert('is_string($userId)'); - assert('is_string($destinationId)'); - assert('is_string($attributeSet)'); + assert(is_string($userId)); + assert(is_string($destinationId)); + assert(is_string($attributeSet)); - $name = self::_getCookieName($userId, $destinationId); - $value = $userId . ':' . $attributeSet . ':' . $destinationId; + $name = self::getCookieName($userId, $destinationId); + $value = $userId.':'.$attributeSet.':'.$destinationId; - SimpleSAML\Logger::debug('Consent cookie - Set [' . $value . ']'); + \SimpleSAML\Logger::debug('Consent cookie - Set ['.$value.']'); - $value = self::_sign($value); - $this->_setConsentCookie($name, $value); + $value = self::sign($value); + $this->setConsentCookie($name, $value); } @@ -116,11 +119,11 @@ public function saveConsent($userId, $destinationId, $attributeSet) */ public function deleteConsent($userId, $destinationId) { - assert('is_string($userId)'); - assert('is_string($destinationId)'); + assert(is_string($userId)); + assert(is_string($destinationId)); - $name = self::_getCookieName($userId, $destinationId); - $this->_setConsentCookie($name, null); + $name = self::getCookieName($userId, $destinationId); + $this->setConsentCookie($name, null); } @@ -131,14 +134,14 @@ public function deleteConsent($userId, $destinationId) * * @return void This method does not return. * - * @throws Exception This method always throws an exception indicating that it is not possible to delete all given + * @throws \Exception This method always throws an exception indicating that it is not possible to delete all given * consents with this handler. */ public function deleteAllConsents($userId) { - assert('is_string($userId)'); + assert(is_string($userId)); - throw new Exception( + throw new \Exception( 'The cookie consent handler does not support delete of all consents...' ); } @@ -155,26 +158,26 @@ public function deleteAllConsents($userId) */ public function getConsents($userId) { - assert('is_string($userId)'); + assert(is_string($userId)); - $ret = array(); + $ret = []; - $cookieNameStart = 'sspmod_consent:'; + $cookieNameStart = '\SimpleSAML\Module\consent:'; $cookieNameStartLen = strlen($cookieNameStart); foreach ($_COOKIE as $name => $value) { if (substr($name, 0, $cookieNameStartLen) !== $cookieNameStart) { continue; } - $value = self::_verify($value); + $value = self::verify($value); if ($value === false) { continue; } $tmp = explode(':', $value, 3); if (count($tmp) !== 3) { - SimpleSAML\Logger::warning( - 'Consent cookie with invalid value: ' . $value + \SimpleSAML\Logger::warning( + 'Consent cookie with invalid value: '.$value ); continue; } @@ -201,13 +204,13 @@ public function getConsents($userId) * * @return string The signed data. */ - private static function _sign($data) + private static function sign($data) { - assert('is_string($data)'); + assert(is_string($data)); - $secretSalt = SimpleSAML\Utils\Config::getSecretSalt(); + $secretSalt = \SimpleSAML\Utils\Config::getSecretSalt(); - return sha1($secretSalt . $data . $secretSalt) . ':' . $data; + return sha1($secretSalt.$data.$secretSalt).':'.$data; } @@ -220,20 +223,20 @@ private static function _sign($data) * * @return string|false The data, or false if the signature is invalid. */ - private static function _verify($signedData) + private static function verify($signedData) { - assert('is_string($signedData)'); + assert(is_string($signedData)); $data = explode(':', $signedData, 2); if (count($data) !== 2) { - SimpleSAML\Logger::warning('Consent cookie: Missing signature.'); + \SimpleSAML\Logger::warning('Consent cookie: Missing signature.'); return false; } $data = $data[1]; - $newSignedData = self::_sign($data); + $newSignedData = self::sign($data); if ($newSignedData !== $signedData) { - SimpleSAML\Logger::warning('Consent cookie: Invalid signature.'); + \SimpleSAML\Logger::warning('Consent cookie: Invalid signature.'); return false; } @@ -251,12 +254,12 @@ private static function _verify($signedData) * * @return string The cookie name */ - private static function _getCookieName($userId, $destinationId) + private static function getCookieName($userId, $destinationId) { - assert('is_string($userId)'); - assert('is_string($destinationId)'); + assert(is_string($userId)); + assert(is_string($destinationId)); - return 'sspmod_consent:' . sha1($userId . ':' . $destinationId); + return '\SimpleSAML\Module\consent:'.sha1($userId.':'.$destinationId); } @@ -268,24 +271,18 @@ private static function _getCookieName($userId, $destinationId) * * @return void */ - private function _setConsentCookie($name, $value) + private function setConsentCookie($name, $value) { - assert('is_string($name)'); - assert('is_string($value) || is_null($value)'); + assert(is_string($name)); + assert(is_string($value) || $value === null); - $globalConfig = SimpleSAML_Configuration::getInstance(); - $params = array( - 'lifetime' => (90*24*60*60), + $globalConfig = \SimpleSAML\Configuration::getInstance(); + $params = [ + 'lifetime' => 7776000, // (90*24*60*60) 'path' => ($globalConfig->getBasePath()), - 'httponly' => false, - ); - - if (\SimpleSAML\Utils\HTTP::isHTTPS()) { - // Enable secure cookie for https-requests - $params['secure'] = true; - } else { - $params['secure'] = false; - } + 'httponly' => true, + 'secure' => \SimpleSAML\Utils\HTTP::isHTTPS(), + ]; \SimpleSAML\Utils\HTTP::setCookie($name, $value, $params, false); } diff --git a/vendor/simplesamlphp/simplesamlphp/modules/consent/lib/Consent/Store/Database.php b/vendor/simplesamlphp/simplesamlphp/modules/consent/lib/Consent/Store/Database.php index 31b4e7fd8a..ba1975bc5b 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/consent/lib/Consent/Store/Database.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/consent/lib/Consent/Store/Database.php @@ -1,4 +1,7 @@ <?php + +namespace SimpleSAML\Module\consent\Consent\Store; + /** * Store consent in database. * @@ -15,46 +18,52 @@ * @author Olav Morken <olav.morken@uninett.no> * @package SimpleSAMLphp */ -class sspmod_consent_Consent_Store_Database extends sspmod_consent_Store + +class Database extends \SimpleSAML\Module\consent\Store { /** * DSN for the database. */ - private $_dsn; + private $dsn; /** * The DATETIME SQL function to use */ - private $_dateTime; + private $dateTime; /** * Username for the database. */ - private $_username; + private $username; /** * Password for the database; */ - private $_password; + private $password; + + /** + * Options for the database; + */ + private $options; /** * Table with consent. */ - private $_table; + private $table; /** * The timeout of the database connection. * - * @var int|NULL + * @var int|null */ - private $_timeout = NULL; + private $timeout = null; /** * Database handle. * * This variable can't be serialized. */ - private $_db; + private $db; /** @@ -64,55 +73,62 @@ class sspmod_consent_Consent_Store_Database extends sspmod_consent_Store * * @param array $config Configuration for database consent store. * - * @throws Exception in case of a configuration error. + * @throws \Exception in case of a configuration error. */ public function __construct($config) { parent::__construct($config); - if (!array_key_exists('dsn', $config)) { - throw new Exception('consent:Database - Missing required option \'dsn\'.'); + throw new \Exception('consent:Database - Missing required option \'dsn\'.'); } if (!is_string($config['dsn'])) { - throw new Exception('consent:Database - \'dsn\' is supposed to be a string.'); + throw new \Exception('consent:Database - \'dsn\' is supposed to be a string.'); } - $this->_dsn = $config['dsn']; - $this->_dateTime = (0 === strpos($this->_dsn, 'sqlite:')) ? 'DATETIME("NOW")' : 'NOW()'; + $this->dsn = $config['dsn']; + $this->dateTime = (0 === strpos($this->dsn, 'sqlite:')) ? 'DATETIME("NOW")' : 'NOW()'; if (array_key_exists('username', $config)) { if (!is_string($config['username'])) { - throw new Exception('consent:Database - \'username\' is supposed to be a string.'); + throw new \Exception('consent:Database - \'username\' is supposed to be a string.'); } - $this->_username = $config['username']; + $this->username = $config['username']; } else { - $this->_username = null; + $this->username = null; } if (array_key_exists('password', $config)) { if (!is_string($config['password'])) { - throw new Exception('consent:Database - \'password\' is supposed to be a string.'); + throw new \Exception('consent:Database - \'password\' is supposed to be a string.'); } - $this->_password = $config['password']; + $this->password = $config['password']; } else { - $this->_password = null; + $this->password = null; } + if (array_key_exists('options', $config)) { + if (!is_array($config['options'])) { + throw new \Exception('consent:Database - \'options\' is supposed to be an array.'); + } + $this->options = $config['options']; + } else { + $this->options = null; + } if (array_key_exists('table', $config)) { if (!is_string($config['table'])) { - throw new Exception('consent:Database - \'table\' is supposed to be a string.'); + throw new \Exception('consent:Database - \'table\' is supposed to be a string.'); } - $this->_table = $config['table']; + $this->table = $config['table']; } else { - $this->_table = 'consent'; + $this->table = 'consent'; } if (isset($config['timeout'])) { if (!is_int($config['timeout'])) { - throw new Exception('consent:Database - \'timeout\' is supposed to be an integer.'); + throw new \Exception('consent:Database - \'timeout\' is supposed to be an integer.'); } - $this->_timeout = $config['timeout']; + $this->timeout = $config['timeout']; } } @@ -124,14 +140,14 @@ public function __construct($config) */ public function __sleep() { - return array( - '_dsn', - '_dateTime', - '_username', - '_password', - '_table', - '_timeout', - ); + return [ + 'dsn', + 'dateTime', + 'username', + 'password', + 'table', + 'timeout', + ]; } @@ -150,15 +166,15 @@ public function __sleep() */ public function hasConsent($userId, $destinationId, $attributeSet) { - assert('is_string($userId)'); - assert('is_string($destinationId)'); - assert('is_string($attributeSet)'); + assert(is_string($userId)); + assert(is_string($destinationId)); + assert(is_string($attributeSet)); - $st = $this->_execute( - 'UPDATE ' . $this->_table . ' ' . - 'SET usage_date = ' . $this->_dateTime . ' ' . + $st = $this->execute( + 'UPDATE '.$this->table.' '. + 'SET usage_date = '.$this->dateTime.' '. 'WHERE hashed_user_id = ? AND service_id = ? AND attribute = ?', - array($userId, $destinationId, $attributeSet) + [$userId, $destinationId, $attributeSet] ); if ($st === false) { @@ -167,10 +183,10 @@ public function hasConsent($userId, $destinationId, $attributeSet) $rowCount = $st->rowCount(); if ($rowCount === 0) { - SimpleSAML\Logger::debug('consent:Database - No consent found.'); + \SimpleSAML\Logger::debug('consent:Database - No consent found.'); return false; } else { - SimpleSAML\Logger::debug('consent:Database - Consent found.'); + \SimpleSAML\Logger::debug('consent:Database - Consent found.'); return true; } } @@ -190,16 +206,16 @@ public function hasConsent($userId, $destinationId, $attributeSet) */ public function saveConsent($userId, $destinationId, $attributeSet) { - assert('is_string($userId)'); - assert('is_string($destinationId)'); - assert('is_string($attributeSet)'); + assert(is_string($userId)); + assert(is_string($destinationId)); + assert(is_string($attributeSet)); // Check for old consent (with different attribute set) - $st = $this->_execute( - 'UPDATE ' . $this->_table . ' ' . - 'SET consent_date = ' . $this->_dateTime . ', usage_date = ' . $this->_dateTime . ', attribute = ? ' . + $st = $this->execute( + 'UPDATE '.$this->table.' '. + 'SET consent_date = '.$this->dateTime.', usage_date = '.$this->dateTime.', attribute = ? '. 'WHERE hashed_user_id = ? AND service_id = ?', - array($attributeSet, $userId, $destinationId) + [$attributeSet, $userId, $destinationId] ); if ($st === false) { @@ -208,19 +224,19 @@ public function saveConsent($userId, $destinationId, $attributeSet) if ($st->rowCount() > 0) { // Consent has already been stored in the database - SimpleSAML\Logger::debug('consent:Database - Updated old consent.'); + \SimpleSAML\Logger::debug('consent:Database - Updated old consent.'); return; } // Add new consent - $st = $this->_execute( - 'INSERT INTO ' . $this->_table . ' (' . 'consent_date, usage_date, hashed_user_id, service_id, attribute' . - ') ' . 'VALUES (' . $this->_dateTime . ', ' . $this->_dateTime . ', ?, ?, ?)', - array($userId, $destinationId, $attributeSet) + $st = $this->execute( + 'INSERT INTO '.$this->table.' ('.'consent_date, usage_date, hashed_user_id, service_id, attribute'. + ') '.'VALUES ('.$this->dateTime.', '.$this->dateTime.', ?, ?, ?)', + [$userId, $destinationId, $attributeSet] ); if ($st !== false) { - SimpleSAML\Logger::debug('consent:Database - Saved new consent.'); + \SimpleSAML\Logger::debug('consent:Database - Saved new consent.'); } return true; } @@ -238,26 +254,25 @@ public function saveConsent($userId, $destinationId, $attributeSet) */ public function deleteConsent($userId, $destinationId) { - assert('is_string($userId)'); - assert('is_string($destinationId)'); + assert(is_string($userId)); + assert(is_string($destinationId)); - $st = $this->_execute( - 'DELETE FROM ' . $this->_table . ' WHERE hashed_user_id = ? AND service_id = ?;', - array($userId, $destinationId) + $st = $this->execute( + 'DELETE FROM '.$this->table.' WHERE hashed_user_id = ? AND service_id = ?;', + [$userId, $destinationId] ); if ($st === false) { - return; + return 0; } if ($st->rowCount() > 0) { - SimpleSAML\Logger::debug('consent:Database - Deleted consent.'); + \SimpleSAML\Logger::debug('consent:Database - Deleted consent.'); return $st->rowCount(); - } else { - SimpleSAML\Logger::warning( - 'consent:Database - Attempted to delete nonexistent consent' - ); } + + \SimpleSAML\Logger::warning('consent:Database - Attempted to delete nonexistent consent'); + return 0; } @@ -270,23 +285,24 @@ public function deleteConsent($userId, $destinationId) */ public function deleteAllConsents($userId) { - assert('is_string($userId)'); + assert(is_string($userId)); - $st = $this->_execute( - 'DELETE FROM ' . $this->_table . ' WHERE hashed_user_id = ?', - array($userId) + $st = $this->execute( + 'DELETE FROM '.$this->table.' WHERE hashed_user_id = ?', + [$userId] ); if ($st === false) { - return; + return 0; } if ($st->rowCount() > 0) { - SimpleSAML\Logger::debug('consent:Database - Deleted (' . $st->rowCount() . ') consent(s).'); + \SimpleSAML\Logger::debug('consent:Database - Deleted ('.$st->rowCount().') consent(s).'); return $st->rowCount(); - } else { - SimpleSAML\Logger::warning('consent:Database - Attempted to delete nonexistent consent'); } + + \SimpleSAML\Logger::warning('consent:Database - Attempted to delete nonexistent consent'); + return 0; } @@ -301,21 +317,21 @@ public function deleteAllConsents($userId) */ public function getConsents($userId) { - assert('is_string($userId)'); + assert(is_string($userId)); - $ret = array(); + $ret = []; - $st = $this->_execute( - 'SELECT service_id, attribute, consent_date, usage_date FROM ' . $this->_table . + $st = $this->execute( + 'SELECT service_id, attribute, consent_date, usage_date FROM '.$this->table. ' WHERE hashed_user_id = ?', - array($userId) + [$userId] ); if ($st === false) { - return array(); + return []; } - while ($row = $st->fetch(PDO::FETCH_NUM)) { + while ($row = $st->fetch(\PDO::FETCH_NUM)) { $ret[] = $row; } @@ -332,31 +348,31 @@ public function getConsents($userId) * @param string $statement The statement which should be executed. * @param array $parameters Parameters for the statement. * - * @return PDOStatement|false The statement, or false if execution failed. + * @return \PDOStatement|bool The statement, or false if execution failed. */ - private function _execute($statement, $parameters) + private function execute($statement, $parameters) { - assert('is_string($statement)'); - assert('is_array($parameters)'); + assert(is_string($statement)); + assert(is_array($parameters)); - $db = $this->_getDB(); + $db = $this->getDB(); if ($db === false) { return false; } $st = $db->prepare($statement); if ($st === false) { - SimpleSAML\Logger::error( - 'consent:Database - Error preparing statement \'' . - $statement . '\': ' . self::_formatError($db->errorInfo()) + \SimpleSAML\Logger::error( + 'consent:Database - Error preparing statement \''. + $statement.'\': '.self::formatError($db->errorInfo()) ); return false; } if ($st->execute($parameters) !== true) { - SimpleSAML\Logger::error( - 'consent:Database - Error executing statement \'' . - $statement . '\': ' . self::_formatError($st->errorInfo()) + \SimpleSAML\Logger::error( + 'consent:Database - Error executing statement \''. + $statement.'\': '.self::formatError($st->errorInfo()) ); return false; } @@ -374,49 +390,48 @@ private function _execute($statement, $parameters) * ' services: Total number of services that has been given consent to * * @return array Array containing the statistics - * @TODO Change fixed table name to config option */ public function getStatistics() { - $ret = array(); + $ret = []; // Get total number of consents - $st = $this->_execute('SELECT COUNT(*) AS no FROM consent', array()); - + $st = $this->execute('SELECT COUNT(*) AS no FROM '.$this->table, []); + if ($st === false) { - return array(); + return []; } - if ($row = $st->fetch(PDO::FETCH_NUM)) { + if ($row = $st->fetch(\PDO::FETCH_NUM)) { $ret['total'] = $row[0]; } // Get total number of users that has given consent - $st = $this->_execute( - 'SELECT COUNT(*) AS no ' . - 'FROM (SELECT DISTINCT hashed_user_id FROM consent ) AS foo', - array() + $st = $this->execute( + 'SELECT COUNT(*) AS no '. + 'FROM (SELECT DISTINCT hashed_user_id FROM '.$this->table.' ) AS foo', + [] ); - + if ($st === false) { - return array(); + return []; } - if ($row = $st->fetch(PDO::FETCH_NUM)) { + if ($row = $st->fetch(\PDO::FETCH_NUM)) { $ret['users'] = $row[0]; } // Get total number of services that has been given consent to - $st = $this->_execute( - 'SELECT COUNT(*) AS no FROM (SELECT DISTINCT service_id FROM consent) AS foo', - array() + $st = $this->execute( + 'SELECT COUNT(*) AS no FROM (SELECT DISTINCT service_id FROM '.$this->table.') AS foo', + [] ); - + if ($st === false) { - return array(); + return []; } - if ($row = $st->fetch(PDO::FETCH_NUM)) { + if ($row = $st->fetch(\PDO::FETCH_NUM)) { $ret['services'] = $row[0]; } @@ -424,55 +439,30 @@ public function getStatistics() } - /** - * Create consent table. - * - * This function creates the table with consent data. - * - * @return True if successful, false if not. - * - * @TODO Remove this function since it is not used - */ - private function _createTable() - { - $db = $this->_getDB(); - if ($db === false) { - return false; - } - - $res = $this->db->exec( - 'CREATE TABLE ' . $this->_table . ' (consent_date TIMESTAMP NOT null, usage_date TIMESTAMP NOT null,' . - 'hashed_user_id VARCHAR(80) NOT null, service_id VARCHAR(255) NOT null, attribute VARCHAR(80) NOT null,' . - 'UNIQUE (hashed_user_id, service_id)' - ); - if ($res === false) { - SimpleSAML\Logger::error('consent:Database - Failed to create table \'' . $this->_table . '\'.'); - return false; - } - - return true; - } - - /** * Get database handle. * - * @return PDO|false Database handle, or false if we fail to connect. + * @return \PDO|false Database handle, or false if we fail to connect. */ - private function _getDB() + private function getDB() { - if ($this->_db !== null) { - return $this->_db; + if ($this->db !== null) { + return $this->db; } - $driver_options = array(); - if (isset($this->_timeout)) { - $driver_options[PDO::ATTR_TIMEOUT] = $this->_timeout; + $driver_options = []; + if (isset($this->timeout)) { + $driver_options[\PDO::ATTR_TIMEOUT] = $this->timeout; + } + if (isset($this->options)) { + $this->options = array_merge($driver_options, $this->options); + } else { + $this->options = $driver_options; } - $this->_db = new PDO($this->_dsn, $this->_username, $this->_password, $driver_options); + $this->db = new \PDO($this->dsn, $this->username, $this->password, $this->options); - return $this->_db; + return $this->db; } @@ -485,12 +475,12 @@ private function _getDB() * * @return string Error text. */ - private static function _formatError($error) + private static function formatError($error) { - assert('is_array($error)'); - assert('count($error) >= 3'); + assert(is_array($error)); + assert(count($error) >= 3); - return $error[0] . ' - ' . $error[2] . ' (' . $error[1] . ')'; + return $error[0].' - '.$error[2].' ('.$error[1].')'; } @@ -501,9 +491,9 @@ private static function _formatError($error) */ public function selftest() { - $st = $this->_execute( - 'SELECT * FROM ' . $this->_table . ' WHERE hashed_user_id = ? AND service_id = ? AND attribute = ?', - array('test', 'test', 'test') + $st = $this->execute( + 'SELECT * FROM '.$this->table.' WHERE hashed_user_id = ? AND service_id = ? AND attribute = ?', + ['test', 'test', 'test'] ); if ($st === false) { diff --git a/vendor/simplesamlphp/simplesamlphp/modules/consent/lib/Logout.php b/vendor/simplesamlphp/simplesamlphp/modules/consent/lib/Logout.php index 821a5fdeeb..f82961ee3d 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/consent/lib/Logout.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/consent/lib/Logout.php @@ -1,17 +1,18 @@ <?php +namespace SimpleSAML\Module\consent; /** * Class defining the logout completed handler for the consent page. * * @package SimpleSAMLphp */ -class sspmod_consent_Logout -{ - public static function postLogout(SimpleSAML_IdP $idp, array $state) +class Logout +{ + public static function postLogout(\SimpleSAML\IdP $idp, array $state) { - $url = SimpleSAML\Module::getModuleURL('consent/logout_completed.php'); + $url = \SimpleSAML\Module::getModuleURL('consent/logout_completed.php'); \SimpleSAML\Utils\HTTP::redirectTrustedURL($url); } } diff --git a/vendor/simplesamlphp/simplesamlphp/modules/consent/lib/Store.php b/vendor/simplesamlphp/simplesamlphp/modules/consent/lib/Store.php index 262fbacfcd..5e14d37720 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/consent/lib/Store.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/consent/lib/Store.php @@ -1,4 +1,7 @@ <?php + +namespace SimpleSAML\Module\consent; + /** * Base class for consent storage handlers. * @@ -6,7 +9,8 @@ * @author Olav Morken <olav.morken@uninett.no> * @author JAcob Christiansen <jach@wayf.dk> */ -abstract class sspmod_consent_Store + +abstract class Store { /** * Constructor for the base class. @@ -17,7 +21,7 @@ abstract class sspmod_consent_Store */ protected function __construct(&$config) { - assert('is_array($config)'); + assert(is_array($config)); } @@ -74,11 +78,11 @@ abstract public function deleteConsent($userId, $destinationId); * * @return mixed Should be the number of consent removed * - * @throws Exception + * @throws \Exception */ public function deleteAllConsents($userId) { - throw new Exception('Not implemented: deleteAllConsents()'); + throw new \Exception('Not implemented: deleteAllConsents()'); } @@ -87,11 +91,11 @@ public function deleteAllConsents($userId) * * @return mixed Statistics from the consent store * - * @throws Exception + * @throws \Exception */ public function getStatistics() { - throw new Exception('Not implemented: getStatistics()'); + throw new \Exception('Not implemented: getStatistics()'); } @@ -115,28 +119,28 @@ abstract public function getConsents($userId); * * @param mixed $config The configuration. * - * @return sspmod_consent_Store An object which implements the sspmod_consent_Store class. + * @return \SimpleSAML\Module\consent\Store An object which implements the \SimpleSAML\Module\consent\Store class. * - * @throws Exception if the configuration is invalid. + * @throws \Exception if the configuration is invalid. */ public static function parseStoreConfig($config) { if (is_string($config)) { - $config = array($config); + $config = [$config]; } if (!is_array($config)) { - throw new Exception('Invalid configuration for consent store option: '.var_export($config, true)); + throw new \Exception('Invalid configuration for consent store option: '.var_export($config, true)); } if (!array_key_exists(0, $config)) { - throw new Exception('Consent store without name given.'); + throw new \Exception('Consent store without name given.'); } - $className = SimpleSAML\Module::resolveClass( + $className = \SimpleSAML\Module::resolveClass( $config[0], - 'Consent_Store', - 'sspmod_consent_Store' + 'Consent\Store', + '\SimpleSAML\Module\consent\Store' ); unset($config[0]); diff --git a/vendor/simplesamlphp/simplesamlphp/modules/consent/locales/xh/LC_MESSAGES/consent.po b/vendor/simplesamlphp/simplesamlphp/modules/consent/locales/xh/LC_MESSAGES/consent.po new file mode 100644 index 0000000000..dc5d79f5eb --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/modules/consent/locales/xh/LC_MESSAGES/consent.po @@ -0,0 +1,82 @@ + +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: SimpleSAMLphp 1.15\n" +"Report-Msgid-Bugs-To: simplesamlphp-translation@googlegroups.com\n" +"POT-Creation-Date: 2018-11-15 14:49+0200\n" +"PO-Revision-Date: 2018-11-15 14:49+0200\n" +"Last-Translator: \n" +"Language-Team: \n" +"Plural-Forms: nplurals=2; plural=(n != 1)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 1.3\n" + +msgid "{consent:consent:show_attribute}" +msgstr "Bonisa iimpawu" + +msgid "{consent:consent:noconsent_return}" +msgstr "Buyela kwikhasi lemvume" + +msgid "{consent:consent:yes}" +msgstr "Ewe, qhubeka" + +msgid "{consent:consent:service_providers_for}" +msgstr "Umboneleli enkonzo we-" + +msgid "{consent:consent:show_attributes}" +msgstr "Bonisa isiqulatho" + +msgid "{consent:consent:status_header}" +msgstr "Ubume bemvume" + +msgid "{consent:consent:noconsent_title}" +msgstr "Akukho mvume inikelweyo" + +msgid "{consent:consent:show_hide_attributes}" +msgstr "bonisa/fihla iimpawu" + +msgid "{consent:consent:service_provider_header}" +msgstr "Umboneleli Wenkonzo" + +msgid "{consent:consent:noconsent_text}" +msgstr "Awuyinikelanga imvume yokudluliselwa iimpawu zakho kwi-SPNAME." + +msgid "{consent:consent:consent_header}" +msgstr "Imvume malunga nokukhutshwa kwenkcazelo yobuqu" + +msgid "{consent:consent:consent_purpose}" +msgstr "Injongo ye-SPNAME yi-SPDESC" + +msgid "{consent:consent:noconsent_goto_about}" +msgstr "Yiya kwikhasi lenkcazelo ukuze ufumane inkonzo" + +msgid "{consent:consent:table_caption}" +msgstr "Inkcazelo yomsebenzisi" + +msgid "{consent:consent:consent_attributes_header}" +msgstr "Inkcazelo eza kuthunyelwa ku-SPNAME" + +msgid "{consent:consent:abort}" +msgstr "Yeka ungeno kwi-SPNAME" + +msgid "{consent:consent:login}" +msgstr "ngena" + +msgid "{consent:consent:consent_accept}" +msgstr "I-SPNAME idinga ukuba inkcazelo engezantsi idluliselwe." + +msgid "{consent:consent:no}" +msgstr "Hayi, rhoxisa" + +msgid "{consent:consent:consent_privacypolicy}" +msgstr "Ipolisi yokugcinwa kwemfihlelo yenkonzo" + +msgid "{consent:consent:table_summary}" +msgstr "Dwelisa inkcazelo engawe eza kudluliselwa kwinkonzo oza kungena kuyo" + +msgid "{consent:consent:remember}" +msgstr "Khumbula" + diff --git a/vendor/simplesamlphp/simplesamlphp/modules/consent/locales/zu/LC_MESSAGES/consent.po b/vendor/simplesamlphp/simplesamlphp/modules/consent/locales/zu/LC_MESSAGES/consent.po new file mode 100644 index 0000000000..2738559d80 --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/modules/consent/locales/zu/LC_MESSAGES/consent.po @@ -0,0 +1,84 @@ + +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: SimpleSAMLphp 1.15\n" +"Report-Msgid-Bugs-To: simplesamlphp-translation@googlegroups.com\n" +"POT-Creation-Date: 2018-11-15 14:49+0200\n" +"PO-Revision-Date: 2018-11-15 14:49+0200\n" +"Last-Translator: \n" +"Language-Team: \n" +"Plural-Forms: nplurals=2; plural=(n != 1)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 1.3\n" + +msgid "{consent:consent:show_attribute}" +msgstr "Bonisa izici" + +msgid "{consent:consent:noconsent_return}" +msgstr "Buyela ekhasini lemvume" + +msgid "{consent:consent:yes}" +msgstr "Yebo, qhubeka" + +msgid "{consent:consent:service_providers_for}" +msgstr "Abahlinzeki Besevisi bokuthi" + +msgid "{consent:consent:show_attributes}" +msgstr "Bonisa okuqukethwe" + +msgid "{consent:consent:status_header}" +msgstr "Isimo semvume" + +msgid "{consent:consent:noconsent_title}" +msgstr "Ayikho imvume enikeziwe" + +msgid "{consent:consent:show_hide_attributes}" +msgstr "bonisa/fihla izici" + +msgid "{consent:consent:service_provider_header}" +msgstr "Umhlinzeki Wesevisi" + +msgid "{consent:consent:noconsent_text}" +msgstr "Awuzange uyinikeze imvume yokudlulisa izici zakho ku-SPNAME." + +msgid "{consent:consent:consent_header}" +msgstr "Imvume mayelana nokukhulula ulwazi lomuntu siqu" + +msgid "{consent:consent:consent_purpose}" +msgstr "Injongo ye-SPNAME yi-SPDESC" + +msgid "{consent:consent:noconsent_goto_about}" +msgstr "Iya ekhasini lolwazi lesevisi" + +msgid "{consent:consent:table_caption}" +msgstr "Ulwazi lomsebenzisi" + +msgid "{consent:consent:consent_attributes_header}" +msgstr "Ulwazi oluzothunyelwa ku-SPNAME" + +msgid "{consent:consent:abort}" +msgstr "Yeka ukungena ku-SPNAME" + +msgid "{consent:consent:login}" +msgstr "ngena" + +msgid "{consent:consent:consent_accept}" +msgstr "I-SPNAME idinga ukuthi ulwazi olungezansi ludluliswe." + +msgid "{consent:consent:no}" +msgstr "Cha, khansela" + +msgid "{consent:consent:consent_privacypolicy}" +msgstr "Inqubomgomo yobumfihlo yesevisi" + +msgid "{consent:consent:table_summary}" +msgstr "" +"Enza uhlu olumayelana nolwazi lwakho oluzodluliselwa kusevisi ozongena " +"kuyo" + +msgid "{consent:consent:remember}" +msgstr "Khumbula" + diff --git a/vendor/simplesamlphp/simplesamlphp/modules/consent/templates/consentform.php b/vendor/simplesamlphp/simplesamlphp/modules/consent/templates/consentform.php index 162bb435c4..90907e0ed2 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/consent/templates/consentform.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/consent/templates/consentform.php @@ -3,119 +3,50 @@ * Template form for giving consent. * * Parameters: - * - 'srcMetadata': Metadata/configuration for the source. - * - 'dstMetadata': Metadata/configuration for the destination. * - 'yesTarget': Target URL for the yes-button. This URL will receive a POST request. - * - 'yesData': Parameters which should be included in the yes-request. * - 'noTarget': Target URL for the no-button. This URL will receive a GET request. - * - 'noData': Parameters which should be included in the no-request. - * - 'attributes': The attributes which are about to be released. * - 'sppp': URL to the privacy policy of the destination, or FALSE. * * @package SimpleSAMLphp */ -assert('is_array($this->data["srcMetadata"])'); -assert('is_array($this->data["dstMetadata"])'); -assert('is_string($this->data["yesTarget"])'); -assert('is_array($this->data["yesData"])'); -assert('is_string($this->data["noTarget"])'); -assert('is_array($this->data["noData"])'); -assert('is_array($this->data["attributes"])'); -assert('is_array($this->data["hiddenAttributes"])'); -assert('$this->data["sppp"] === false || is_string($this->data["sppp"])'); +assert(is_string($this->data['yesTarget'])); +assert(is_string($this->data['noTarget'])); +assert($this->data['sppp'] === false || is_string($this->data['sppp'])); // Parse parameters -if (array_key_exists('name', $this->data['srcMetadata'])) { - $srcName = $this->data['srcMetadata']['name']; -} elseif (array_key_exists('OrganizationDisplayName', $this->data['srcMetadata'])) { - $srcName = $this->data['srcMetadata']['OrganizationDisplayName']; -} else { - $srcName = $this->data['srcMetadata']['entityid']; -} - -if (is_array($srcName)) { - $srcName = $this->t($srcName); -} - -if (array_key_exists('name', $this->data['dstMetadata'])) { - $dstName = $this->data['dstMetadata']['name']; -} elseif (array_key_exists('OrganizationDisplayName', $this->data['dstMetadata'])) { - $dstName = $this->data['dstMetadata']['OrganizationDisplayName']; -} else { - $dstName = $this->data['dstMetadata']['entityid']; -} - -if (is_array($dstName)) { - $dstName = $this->t($dstName); -} - -$srcName = htmlspecialchars($srcName); -$dstName = htmlspecialchars($dstName); - -$attributes = $this->data['attributes']; +$dstName = $this->data['dstName']; +$srcName = $this->data['srcName']; $this->data['header'] = $this->t('{consent:consent:consent_header}'); -$this->data['head'] = '<link rel="stylesheet" type="text/css" href="/' . - $this->data['baseurlpath'] . 'module.php/consent/style.css" />' . "\n"; +$this->data['head'] = '<link rel="stylesheet" type="text/css" href="'. + SimpleSAML\Module::getModuleURL("consent/assets/css/consent.css").'" />'."\n"; $this->includeAtTemplateBase('includes/header.php'); ?> -<p> -<?php -echo $this->t( - '{consent:consent:consent_accept}', - array( 'SPNAME' => $dstName, 'IDPNAME' => $srcName) -); +<p><?php echo $this->data['consent_accept']; ?></p> -if (array_key_exists('descr_purpose', $this->data['dstMetadata'])) { - echo '</p><p>' . $this->t( - '{consent:consent:consent_purpose}', - array( - 'SPNAME' => $dstName, - 'SPDESC' => $this->getTranslator()->getPreferredTranslation( - SimpleSAML\Utils\Arrays::arrayize( - $this->data['dstMetadata']['descr_purpose'], - 'en' - ) - ), - ) - ); +<?php +if (isset($this->data['consent_purpose'])) { + echo '<p>'.$this->data['consent_purpose'].'</p>'; } ?> -</p> - -<form style="display: inline; margin: 0px; padding: 0px" - action="<?php echo htmlspecialchars($this->data['yesTarget']); ?>"> -<p style="margin: 1em"> +<form id="consent_yes" action="<?php echo htmlspecialchars($this->data['yesTarget']); ?>"> <?php if ($this->data['usestorage']) { $checked = ($this->data['checked'] ? 'checked="checked"' : ''); - echo '<input type="checkbox" name="saveconsent" ' . $checked . - ' value="1" /> ' . $this->t('{consent:consent:remember}'); -} - -// Embed hidden fields... -foreach ($this->data['yesData'] as $name => $value) { - echo '<input type="hidden" name="' . htmlspecialchars($name) . - '" value="' . htmlspecialchars($value) . '" />'; -} + echo '<input type="checkbox" name="saveconsent" '.$checked. + ' value="1" /> '.$this->t('{consent:consent:remember}'); +} // Embed hidden fields... ?> - </p> + <input type="hidden" name="StateId" value="<?php echo htmlspecialchars($this->data['stateId']); ?>" /> <button type="submit" name="yes" class="btn" id="yesbutton"> <?php echo htmlspecialchars($this->t('{consent:consent:yes}')) ?> </button> </form> -<form style="display: inline; margin-left: .5em;" action="<?php echo htmlspecialchars($this->data['noTarget']); ?>" - method="get"> - -<?php -foreach ($this->data['noData'] as $name => $value) { - echo('<input type="hidden" name="' . htmlspecialchars($name) . - '" value="' . htmlspecialchars($value) . '" />'); -} -?> +<form id="consent_no" action="<?php echo htmlspecialchars($this->data['noTarget']); ?>"> + <input type="hidden" name="StateId" value="<?php echo htmlspecialchars($this->data['stateId']); ?>" /> <button type="submit" class="btn" name="no" id="nobutton"> <?php echo htmlspecialchars($this->t('{consent:consent:no}')) ?> </button> @@ -123,113 +54,13 @@ <?php if ($this->data['sppp'] !== false) { - echo "<p>" . htmlspecialchars($this->t('{consent:consent:consent_privacypolicy}')) . " "; - echo '<a target="_blank" href="' . htmlspecialchars($this->data['sppp']) . '">' . $dstName . "</a>"; + echo "<p>".htmlspecialchars($this->t('{consent:consent:consent_privacypolicy}'))." "; + echo '<a target="_blank" href="'.htmlspecialchars($this->data['sppp']).'">'.$dstName."</a>"; echo "</p>"; } -/** - * Recursive attribute array listing function - * - * @param SimpleSAML_XHTML_Template $t Template object - * @param array $attributes Attributes to be presented - * @param string $nameParent Name of parent element - * - * @return string HTML representation of the attributes - */ -function present_attributes($t, $attributes, $nameParent) -{ - $translator = $t->getTranslator(); - - $alternate = array('odd', 'even'); - $i = 0; - $summary = 'summary="' . $t->t('{consent:consent:table_summary}') . '"'; - - if (strlen($nameParent) > 0) { - $parentStr = strtolower($nameParent) . '_'; - $str = '<table class="attributes" ' . $summary . '>'; - } else { - $parentStr = ''; - $str = '<table id="table_with_attributes" class="attributes" '. $summary .'>'; - $str .= "\n" . '<caption>' . $t->t('{consent:consent:table_caption}') . - '</caption>'; - } - - foreach ($attributes as $name => $value) { - $nameraw = $name; - $name = $translator->getAttributeTranslation($parentStr . $nameraw); - - if (preg_match('/^child_/', $nameraw)) { - // insert child table - $parentName = preg_replace('/^child_/', '', $nameraw); - foreach ($value as $child) { - $str .= "\n" . '<tr class="odd"><td style="padding: 2em">' . - present_attributes($t, $child, $parentName) . '</td></tr>'; - } - } else { - // insert values directly - - $str .= "\n" . '<tr class="' . $alternate[($i++ % 2)] . - '"><td><span class="attrname">' . htmlspecialchars($name) . '</span>'; - - $isHidden = in_array($nameraw, $t->data['hiddenAttributes'], true); - if ($isHidden) { - $hiddenId = SimpleSAML\Utils\Random::generateID(); - - $str .= '<div class="attrvalue" style="display: none;" id="hidden_' . $hiddenId . '">'; - } else { - $str .= '<div class="attrvalue">'; - } - - if (sizeof($value) > 1) { - // we hawe several values - $str .= '<ul>'; - foreach ($value as $listitem) { - if ($nameraw === 'jpegPhoto') { - $str .= '<li><img src="data:image/jpeg;base64,' . - htmlspecialchars($listitem) . - '" alt="User photo" /></li>'; - } else { - $str .= '<li>' . htmlspecialchars($listitem) . '</li>'; - } - } - $str .= '</ul>'; - } elseif (isset($value[0])) { - // we hawe only one value - if ($nameraw === 'jpegPhoto') { - $str .= '<img src="data:image/jpeg;base64,' . - htmlspecialchars($value[0]) . - '" alt="User photo" />'; - } else { - $str .= htmlspecialchars($value[0]); - } - } // end of if multivalue - $str .= '</div>'; - - if ($isHidden) { - $str .= '<div class="attrvalue consent_showattribute" id="visible_' . $hiddenId . '">'; - $str .= '... '; - $str .= '<a class="consent_showattributelink" href="javascript:SimpleSAML_show(\'hidden_' . $hiddenId; - $str .= '\'); SimpleSAML_hide(\'visible_' . $hiddenId . '\');">'; - $str .= $t->t('{consent:consent:show_attribute}'); - $str .= '</a>'; - $str .= '</div>'; - } - - $str .= '</td></tr>'; - } // end else: not child table - } // end foreach - $str .= isset($attributes)? '</table>':''; - return $str; -} - -echo '<h3 id="attributeheader">' . - $this->t( - '{consent:consent:consent_attributes_header}', - array( 'SPNAME' => $dstName, 'IDPNAME' => $srcName) - ) . - '</h3>'; +echo '<h3 id="attributeheader">'.$this->data['consent_attributes_header'].'</h3>'; -echo present_attributes($this, $attributes, ''); +echo $this->data['attributes_html']; $this->includeAtTemplateBase('includes/footer.php'); diff --git a/vendor/simplesamlphp/simplesamlphp/modules/consent/templates/consentform.twig b/vendor/simplesamlphp/simplesamlphp/modules/consent/templates/consentform.twig new file mode 100644 index 0000000000..b1433046a9 --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/modules/consent/templates/consentform.twig @@ -0,0 +1,38 @@ +{% set pagetitle = '{consent:consent:consent_header}'|trans %} +{% extends "base.twig" %} + +{% block preload %} +<link rel="stylesheet" type="text/css" href="{{ baseurlpath }}assets/css/consent.css" /> +{% endblock %} + +{% block content %} +<p>{{ consent_accept}}</p> + +{% if consent_purpose is defined %} + <p>{{ consent_purpose }}</p> +{% endif %} + +<form id="consent_yes" action="{{ yesTarget }}"> + {% if usestorage is defined %} + <input type="checkbox" name="saveconsent"{% if checked %} checked="checked"{% endif %} value="1" /> + {{ '{consent:consent:remember}'|trans }} + {% endif %} + + <input type="hidden" name="StateId" value="{{ stateId }}" /> + <button type="submit" name="yes" class="btn" id="yesbutton"{%- if autofocus == 'yesbutton' %} autofocus{% endif -%}>{{ '{consent:consent:yes}'|trans }}</button> +</form> + +<form id="consent_no" action="{{ noTarget }}"> + <input type="hidden" name="StateId" value="{{ stateId }}" /> + <button type="submit" class="btn" name="no" id="nobutton"{%- if autofocus == 'nobutton' %} autofocus{% endif -%}>{{ '{consent:consent:no}'|trans }}</button> +</form> + +{% if sppp != false %} +<p>{{ '{consent:consent:consent_privacypolicy}'|trans }} + <a target='_blank' href='{{ sppp|escape('url') }} '>{{ dstName }}</a> +</p> +{% endif %} + +<h3 id="attributeheader">{{ consent_attributes_header }}</h3> +{{ attributes_html|raw }} +{% endblock %} diff --git a/vendor/simplesamlphp/simplesamlphp/modules/consent/templates/logout_completed.php b/vendor/simplesamlphp/simplesamlphp/modules/consent/templates/logout_completed.php index 978931c2bd..d488d490dd 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/consent/templates/logout_completed.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/consent/templates/logout_completed.php @@ -3,7 +3,7 @@ $this->data['header'] = $this->t('{logout:title}'); $this->includeAtTemplateBase('includes/header.php'); -echo('<h2>' . $this->data['header'] . '</h2>'); -echo('<p>' . $this->t('{logout:logged_out_text}') . '</p>'); +echo '<h2>'.$this->data['header'].'</h2>'; +echo '<p>'.$this->t('{logout:logged_out_text}').'</p>'; $this->includeAtTemplateBase('includes/footer.php'); diff --git a/vendor/simplesamlphp/simplesamlphp/modules/consent/templates/logout_completed.twig b/vendor/simplesamlphp/simplesamlphp/modules/consent/templates/logout_completed.twig new file mode 100644 index 0000000000..75503847c5 --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/modules/consent/templates/logout_completed.twig @@ -0,0 +1,7 @@ +{% set pagetitle = '{logout:title}'|trans %} +{% extends "base.twig" %} + +{% block content %} +<h2>{{ header }}</h2> +<p>{{ '{logout:logged_out_text}'|trans }}</p> +{% endblock %} diff --git a/vendor/simplesamlphp/simplesamlphp/modules/consent/templates/noconsent.php b/vendor/simplesamlphp/simplesamlphp/modules/consent/templates/noconsent.php index f0bc375b39..4ed911533a 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/consent/templates/noconsent.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/consent/templates/noconsent.php @@ -1,38 +1,24 @@ <?php -if (array_key_exists('name', $this->data['dstMetadata'])) { - $dstName = $this->data['dstMetadata']['name']; -} elseif (array_key_exists('OrganizationDisplayName', $this->data['dstMetadata'])) { - $dstName = $this->data['dstMetadata']['OrganizationDisplayName']; -} else { - $dstName = $this->data['dstMetadata']['entityid']; -} -if (is_array($dstName)) { - $dstName = $this->t($dstName); -} -$dstName = htmlspecialchars($dstName); - - -$this->data['header'] = $this->t('{consent:consent:noconsent_title}');; +$this->data['header'] = $this->t('{consent:consent:noconsent_title}'); $this->includeAtTemplateBase('includes/header.php'); -echo '<h2>' . $this->data['header'] . '</h2>'; -echo '<p>' . $this->t('{consent:consent:noconsent_text}', array('SPNAME' => $dstName)) . '</p>'; +echo '<h2>'.$this->data['header'].'</h2>'; +echo '<p>'.$this->data['noconsent_text'].'</p>'; if ($this->data['resumeFrom']) { - echo('<p><a href="' . htmlspecialchars($this->data['resumeFrom']) . '">'); + echo('<p><a href="'.htmlspecialchars($this->data['resumeFrom']).'">'); echo($this->t('{consent:consent:noconsent_return}')); echo('</a></p>'); } if ($this->data['aboutService']) { - echo('<p><a href="' . htmlspecialchars($this->data['aboutService']) . '">'); + echo('<p><a href="'.htmlspecialchars($this->data['aboutService']).'">'); echo($this->t('{consent:consent:noconsent_goto_about}')); echo('</a></p>'); } -echo('<p><a href="' . htmlspecialchars($this->data['logoutLink']) . '">' . $this->t('{consent:consent:abort}', array('SPNAME' => $dstName)) . '</a></p>'); - +echo('<p><a href="'.htmlspecialchars($this->data['logoutLink']).'">'.$this->data['noconsent_abort'].'</a></p>'); $this->includeAtTemplateBase('includes/footer.php'); diff --git a/vendor/simplesamlphp/simplesamlphp/modules/consent/templates/noconsent.twig b/vendor/simplesamlphp/simplesamlphp/modules/consent/templates/noconsent.twig new file mode 100644 index 0000000000..b76036697d --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/modules/consent/templates/noconsent.twig @@ -0,0 +1,16 @@ +{% set pagetitle = '{consent:consent:noconsent_title}'|trans %} +{% extends "base.twig" %} +{% block content %} + <h2>{{ header }}</h2> + <p>{{ noconsent_text }}</p> + + {% if resumeFrom %} + <p><a href="{{ resumeFrom }}">{{ '{consent:consent:noconsent_return}'|trans }}</a></p> + {% endif %} + + {% if aboutService %} + <p><a href="{{ aboutService }}">{{ '{consent:consent:noconsent_goto_about}'|trans }}</a></p> + {% endif %} + + <p><a href="{{ logoutLink }}">{{ noconsent_abort }}</a></p> +{% endblock %} diff --git a/vendor/simplesamlphp/simplesamlphp/modules/consent/www/style.css b/vendor/simplesamlphp/simplesamlphp/modules/consent/www/assets/consent.css similarity index 72% rename from vendor/simplesamlphp/simplesamlphp/modules/consent/www/style.css rename to vendor/simplesamlphp/simplesamlphp/modules/consent/www/assets/consent.css index 573ca554bd..33bef3d64a 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/consent/www/style.css +++ b/vendor/simplesamlphp/simplesamlphp/modules/consent/www/assets/consent.css @@ -33,3 +33,22 @@ table#table_with_attributes ul { margin: 0px; padding-left: 1em; } + +form#consent_yes { + display: inline; + margin: 0px; + padding: 0px; +} + +form#consent_no { + display: inline; + margin-left: .5em; +} + +.hidden { + display: none; +} + +td.td_odd { + padding: 2em; +} diff --git a/vendor/simplesamlphp/simplesamlphp/modules/consent/www/assets/css/consent.css b/vendor/simplesamlphp/simplesamlphp/modules/consent/www/assets/css/consent.css new file mode 100644 index 0000000000..33bef3d64a --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/modules/consent/www/assets/css/consent.css @@ -0,0 +1,54 @@ +fieldset { + padding: 0px; +} + +fieldset legend { + background: #eee; +} + +h3#attributeheader { + margin: 1.5em 0em 0.5em 0em; +} + +table#table_with_attributes .attrname { + text-align: right; + font-weight: bold; +} + +table#table_with_attributes .attrvalue { + padding-left: 1em; + margin: 0.5em 0em; +} + +table#table_with_attributes tr:last-child td { + border-bottom: none; +} + +table#table_with_attributes img { + border: 1px solid #777; + margin: 4px; +} + +table#table_with_attributes ul { + margin: 0px; + padding-left: 1em; +} + +form#consent_yes { + display: inline; + margin: 0px; + padding: 0px; +} + +form#consent_no { + display: inline; + margin-left: .5em; +} + +.hidden { + display: none; +} + +td.td_odd { + padding: 2em; +} diff --git a/vendor/simplesamlphp/simplesamlphp/modules/consent/www/getconsent.php b/vendor/simplesamlphp/simplesamlphp/modules/consent/www/getconsent.php index 34572b231f..2da2fc870e 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/consent/www/getconsent.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/consent/www/getconsent.php @@ -6,11 +6,10 @@ * authorizes the release of attributes. * * @package SimpleSAMLphp - */ -/** - * Explicit instruct consent page to send no-cache header to browsers to make + * + * Explicit instruct consent page to send no-cache header to browsers to make * sure the users attribute information are not store on client disk. - * + * * In an vanilla apache-php installation is the php variables set to: * * session.cache_limiter = nocache @@ -19,22 +18,22 @@ */ session_cache_limiter('nocache'); -$globalConfig = SimpleSAML_Configuration::getInstance(); +$globalConfig = \SimpleSAML\Configuration::getInstance(); -SimpleSAML\Logger::info('Consent - getconsent: Accessing consent interface'); +\SimpleSAML\Logger::info('Consent - getconsent: Accessing consent interface'); if (!array_key_exists('StateId', $_REQUEST)) { - throw new SimpleSAML_Error_BadRequest( + throw new \SimpleSAML\Error\BadRequest( 'Missing required StateId query parameter.' ); } $id = $_REQUEST['StateId']; -$state = SimpleSAML_Auth_State::loadState($id, 'consent:request'); +$state = \SimpleSAML\Auth\State::loadState($id, 'consent:request'); if (array_key_exists('core:SP', $state)) { $spentityid = $state['core:SP']; -} else if (array_key_exists('saml:sp:State', $state)) { +} elseif (array_key_exists('saml:sp:State', $state)) { $spentityid = $state['saml:sp:State']['core:SP']; } else { $spentityid = 'UNKNOWN'; @@ -44,20 +43,20 @@ // The user has pressed the yes-button if (array_key_exists('yes', $_REQUEST)) { if (array_key_exists('saveconsent', $_REQUEST)) { - SimpleSAML\Logger::stats('consentResponse remember'); + \SimpleSAML\Logger::stats('consentResponse remember'); } else { - SimpleSAML\Logger::stats('consentResponse rememberNot'); + \SimpleSAML\Logger::stats('consentResponse rememberNot'); } - $statsInfo = array( + $statsInfo = [ 'remember' => array_key_exists('saveconsent', $_REQUEST), - ); + ]; if (isset($state['Destination']['entityid'])) { $statsInfo['spEntityID'] = $state['Destination']['entityid']; } - SimpleSAML_Stats::log('consent:accept', $statsInfo); + \SimpleSAML\Stats::log('consent:accept', $statsInfo); - if ( array_key_exists('consent:store', $state) + if (array_key_exists('consent:store', $state) && array_key_exists('saveconsent', $_REQUEST) && $_REQUEST['saveconsent'] === '1' ) { @@ -67,18 +66,17 @@ $targetedId = $state['consent:store.destination']; $attributeSet = $state['consent:store.attributeSet']; - SimpleSAML\Logger::debug( - 'Consent - saveConsent() : [' . $userId . '|' . - $targetedId . '|' . $attributeSet . ']' - ); + \SimpleSAML\Logger::debug( + 'Consent - saveConsent() : ['.$userId.'|'.$targetedId.'|'.$attributeSet.']' + ); try { $store->saveConsent($userId, $targetedId, $attributeSet); - } catch (Exception $e) { - SimpleSAML\Logger::error('Consent: Error writing to storage: ' . $e->getMessage()); + } catch (\Exception $e) { + \SimpleSAML\Logger::error('Consent: Error writing to storage: '.$e->getMessage()); } } - SimpleSAML_Auth_ProcessingChain::resumeProcessing($state); + \SimpleSAML\Auth\ProcessingChain::resumeProcessing($state); } // Prepare attributes for presentation @@ -86,28 +84,78 @@ $noconsentattributes = $state['consent:noconsentattributes']; // Remove attributes that do not require consent -foreach ($attributes AS $attrkey => $attrval) { +foreach ($attributes as $attrkey => $attrval) { if (in_array($attrkey, $noconsentattributes, true)) { unset($attributes[$attrkey]); } } -$para = array( +$para = [ 'attributes' => &$attributes -); +]; // Reorder attributes according to attributepresentation hooks -SimpleSAML\Module::callHooks('attributepresentation', $para); +\SimpleSAML\Module::callHooks('attributepresentation', $para); + +// Parse parameters +if (array_key_exists('name', $state['Source'])) { + $srcName = $state['Source']['name']; +} elseif (array_key_exists('OrganizationDisplayName', $state['Source'])) { + $srcName = $state['Source']['OrganizationDisplayName']; +} else { + $srcName = $state['Source']['entityid']; +} + +if (array_key_exists('name', $state['Destination'])) { + $dstName = $state['Destination']['name']; +} elseif (array_key_exists('OrganizationDisplayName', $state['Destination'])) { + $dstName = $state['Destination']['OrganizationDisplayName']; +} else { + $dstName = $state['Destination']['entityid']; +} // Make, populate and layout consent form -$t = new SimpleSAML_XHTML_Template($globalConfig, 'consent:consentform.php'); +$t = new \SimpleSAML\XHTML\Template($globalConfig, 'consent:consentform.php'); +$translator = $t->getTranslator(); $t->data['srcMetadata'] = $state['Source']; $t->data['dstMetadata'] = $state['Destination']; -$t->data['yesTarget'] = SimpleSAML\Module::getModuleURL('consent/getconsent.php'); -$t->data['yesData'] = array('StateId' => $id); -$t->data['noTarget'] = SimpleSAML\Module::getModuleURL('consent/noconsent.php'); -$t->data['noData'] = array('StateId' => $id); +$t->data['yesTarget'] = \SimpleSAML\Module::getModuleURL('consent/getconsent.php'); +$t->data['yesData'] = ['StateId' => $id]; +$t->data['noTarget'] = \SimpleSAML\Module::getModuleURL('consent/noconsent.php'); +$t->data['noData'] = ['StateId' => $id]; $t->data['attributes'] = $attributes; $t->data['checked'] = $state['consent:checked']; +$t->data['stateId'] = $id; + +$srcName = htmlspecialchars(is_array($srcName) ? $translator->t($srcName) : $srcName); +$dstName = htmlspecialchars(is_array($dstName) ? $translator->t($dstName) : $dstName); + +$t->data['consent_attributes_header'] = $translator->t( + '{consent:consent:consent_attributes_header}', + ['SPNAME' => $dstName, 'IDPNAME' => $srcName] +); + +$t->data['consent_accept'] = $translator->t( + '{consent:consent:consent_accept}', + ['SPNAME' => $dstName, 'IDPNAME' => $srcName] +); + +if (array_key_exists('descr_purpose', $state['Destination'])) { + $t->data['consent_purpose'] = $translator->t( + '{consent:consent:consent_purpose}', + [ + 'SPNAME' => $dstName, + 'SPDESC' => $translator->getPreferredTranslation( + \SimpleSAML\Utils\Arrays::arrayize( + $state['Destination']['descr_purpose'], + 'en' + ) + ), + ] + ); +} + +$t->data['srcName'] = $srcName; +$t->data['dstName'] = $dstName; // Fetch privacypolicy if (array_key_exists('privacypolicy', $state['Destination'])) { @@ -120,7 +168,7 @@ if ($privacypolicy !== false) { $privacypolicy = str_replace( '%SPENTITYID%', - urlencode($spentityid), + urlencode($spentityid), $privacypolicy ); } @@ -128,27 +176,117 @@ // Set focus element switch ($state['consent:focus']) { -case 'yes': - $t->data['autofocus'] = 'yesbutton'; - break; -case 'no': - $t->data['autofocus'] = 'nobutton'; - break; -case null: -default: - break; + case 'yes': + $t->data['autofocus'] = 'yesbutton'; + break; + case 'no': + $t->data['autofocus'] = 'nobutton'; + break; + case null: + default: + break; } -if (array_key_exists('consent:store', $state)) { - $t->data['usestorage'] = true; -} else { - $t->data['usestorage'] = false; -} +$t->data['usestorage'] = array_key_exists('consent:store', $state); if (array_key_exists('consent:hiddenAttributes', $state)) { $t->data['hiddenAttributes'] = $state['consent:hiddenAttributes']; } else { - $t->data['hiddenAttributes'] = array(); + $t->data['hiddenAttributes'] = []; } +$t->data['attributes_html'] = present_attributes($t, $attributes, ''); + $t->show(); + + +/** + * Recursive attribute array listing function + * + * @param \SimpleSAML\XHTML\Template $t Template object + * @param array $attributes Attributes to be presented + * @param string $nameParent Name of parent element + * + * @return string HTML representation of the attributes + */ +function present_attributes($t, $attributes, $nameParent) +{ + $translator = $t->getTranslator(); + + $alternate = ['odd', 'even']; + $i = 0; + $summary = 'summary="'.$translator->t('{consent:consent:table_summary}').'"'; + + if (strlen($nameParent) > 0) { + $parentStr = strtolower($nameParent).'_'; + $str = '<table class="attributes" '.$summary.'>'; + } else { + $parentStr = ''; + $str = '<table id="table_with_attributes" class="attributes" '.$summary.'>'; + $str .= "\n".'<caption>'.$translator->t('{consent:consent:table_caption}').'</caption>'; + } + + foreach ($attributes as $name => $value) { + $nameraw = $name; + $name = $translator->getAttributeTranslation($parentStr.$nameraw); + + if (preg_match('/^child_/', $nameraw)) { + // insert child table + $parentName = preg_replace('/^child_/', '', $nameraw); + foreach ($value as $child) { + $str .= "\n".'<tr class="odd"><td class="td_odd">'. + present_attributes($t, $child, $parentName).'</td></tr>'; + } + } else { + // insert values directly + + $str .= "\n".'<tr class="'.$alternate[($i++ % 2)]. + '"><td><span class="attrname">'.htmlspecialchars($name).'</span></td>'; + + $isHidden = in_array($nameraw, $t->data['hiddenAttributes'], true); + if ($isHidden) { + $hiddenId = \SimpleSAML\Utils\Random::generateID(); + $str .= '<td><span class="attrvalue hidden" id="hidden_'.$hiddenId.'">'; + } else { + $str .= '<td><span class="attrvalue">'; + } + + if (sizeof($value) > 1) { + // we hawe several values + $str .= '<ul>'; + foreach ($value as $listitem) { + if ($nameraw === 'jpegPhoto') { + $str .= '<li><img src="data:image/jpeg;base64,'. + htmlspecialchars($listitem).'" alt="User photo" /></li>'; + } else { + $str .= '<li>'.htmlspecialchars($listitem).'</li>'; + } + } + $str .= '</ul>'; + } elseif (isset($value[0])) { + // we hawe only one value + if ($nameraw === 'jpegPhoto') { + $str .= '<img src="data:image/jpeg;base64,'. + htmlspecialchars($value[0]).'" alt="User photo" />'; + } else { + $str .= htmlspecialchars($value[0]); + } + } // end of if multivalue + $str .= '</span>'; + + if ($isHidden) { + $str .= '<div class="attrvalue consent_showattribute" id="visible_'.$hiddenId.'">'; + $str .= '... '; + $str .= '<a class="consent_showattributelink" href="javascript:SimpleSAML_show(\'hidden_'.$hiddenId; + $str .= '\'); SimpleSAML_hide(\'visible_'.$hiddenId.'\');">'; + $str .= $t->t('{consent:consent:show_attribute}'); + $str .= '</a>'; + $str .= '</div>'; + } + + $str .= '</td></tr>'; + } // end else: not child table + } // end foreach + $str .= isset($attributes) ? '</table>' : ''; + return $str; +} diff --git a/vendor/simplesamlphp/simplesamlphp/modules/consent/www/logout.php b/vendor/simplesamlphp/simplesamlphp/modules/consent/www/logout.php index 6b3412c8d9..f84a51bb24 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/consent/www/logout.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/consent/www/logout.php @@ -6,12 +6,12 @@ */ if (!array_key_exists('StateId', $_GET)) { - throw new SimpleSAML_Error_BadRequest('Missing required StateId query parameter.'); + throw new \SimpleSAML\Error\BadRequest('Missing required StateId query parameter.'); } -$state = SimpleSAML_Auth_State::loadState($_GET['StateId'], 'consent:request'); +$state = \SimpleSAML\Auth\State::loadState($_GET['StateId'], 'consent:request'); -$state['Responder'] = array('sspmod_consent_Logout', 'postLogout'); +$state['Responder'] = ['\SimpleSAML\Module\consent\Logout', 'postLogout']; -$idp = SimpleSAML_IdP::getByState($state); -$idp->handleLogoutRequest($state, NULL); -assert('FALSE'); +$idp = \SimpleSAML\IdP::getByState($state); +$idp->handleLogoutRequest($state, null); +assert(false); diff --git a/vendor/simplesamlphp/simplesamlphp/modules/consent/www/logout_completed.php b/vendor/simplesamlphp/simplesamlphp/modules/consent/www/logout_completed.php index a543c30574..a5124704f3 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/consent/www/logout_completed.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/consent/www/logout_completed.php @@ -5,6 +5,6 @@ * @package SimpleSAMLphp */ -$globalConfig = SimpleSAML_Configuration::getInstance(); -$t = new SimpleSAML_XHTML_Template($globalConfig, 'consent:logout_completed.php'); +$globalConfig = \SimpleSAML\Configuration::getInstance(); +$t = new \SimpleSAML\XHTML\Template($globalConfig, 'consent:logout_completed.php'); $t->show(); diff --git a/vendor/simplesamlphp/simplesamlphp/modules/consent/www/noconsent.php b/vendor/simplesamlphp/simplesamlphp/modules/consent/www/noconsent.php index 7fcd57b128..acd6ffc065 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/consent/www/noconsent.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/consent/www/noconsent.php @@ -1,47 +1,63 @@ <?php + /** * This is the page the user lands on when choosing "no" in the consent form. * * @package SimpleSAMLphp */ + if (!array_key_exists('StateId', $_REQUEST)) { - throw new SimpleSAML_Error_BadRequest( + throw new \SimpleSAML\Error\BadRequest( 'Missing required StateId query parameter.' ); } $id = $_REQUEST['StateId']; -$state = SimpleSAML_Auth_State::loadState($id, 'consent:request'); +$state = \SimpleSAML\Auth\State::loadState($id, 'consent:request'); -$resumeFrom = SimpleSAML\Module::getModuleURL( +$resumeFrom = \SimpleSAML\Module::getModuleURL( 'consent/getconsent.php', - array('StateId' => $id) + ['StateId' => $id] ); -$logoutLink = SimpleSAML\Module::getModuleURL( +$logoutLink = \SimpleSAML\Module::getModuleURL( 'consent/logout.php', - array('StateId' => $id) + ['StateId' => $id] ); - $aboutService = null; if (!isset($state['consent:showNoConsentAboutService']) || $state['consent:showNoConsentAboutService']) { - if (isset($state['Destination']['url.about'])) { - $aboutService = $state['Destination']['url.about']; - } + if (isset($state['Destination']['url.about'])) { + $aboutService = $state['Destination']['url.about']; + } } -$statsInfo = array(); +$statsInfo = []; if (isset($state['Destination']['entityid'])) { $statsInfo['spEntityID'] = $state['Destination']['entityid']; } -SimpleSAML_Stats::log('consent:reject', $statsInfo); +\SimpleSAML\Stats::log('consent:reject', $statsInfo); + +if (array_key_exists('name', $state['Destination'])) { + $dstName = $state['Destination']['name']; +} elseif (array_key_exists('OrganizationDisplayName', $state['Destination'])) { + $dstName = $state['Destination']['OrganizationDisplayName']; +} else { + $dstName = $state['Destination']['entityid']; +} -$globalConfig = SimpleSAML_Configuration::getInstance(); +$globalConfig = \SimpleSAML\Configuration::getInstance(); -$t = new SimpleSAML_XHTML_Template($globalConfig, 'consent:noconsent.php'); +$t = new \SimpleSAML\XHTML\Template($globalConfig, 'consent:noconsent.php'); +$translator = $t->getTranslator(); $t->data['dstMetadata'] = $state['Destination']; $t->data['resumeFrom'] = $resumeFrom; $t->data['aboutService'] = $aboutService; $t->data['logoutLink'] = $logoutLink; + +$dstName = htmlspecialchars(is_array($dstName) ? $translator->t($dstName) : $dstName); + +$t->data['noconsent_text'] = $translator->t('{consent:consent:noconsent_text}', ['SPNAME' => $dstName]); +$t->data['noconsent_abort'] = $translator->t('{consent:consent:abort}', ['SPNAME' => $dstName]); + $t->show(); diff --git a/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/config-templates/module_consentAdmin.php b/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/config-templates/module_consentAdmin.php index 418065c14e..9c5420387e 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/config-templates/module_consentAdmin.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/config-templates/module_consentAdmin.php @@ -5,28 +5,31 @@ * @author Jacob Christiansen, <jach@wayf.dk> * @package SimpleSAMLphp */ -$config = array( - /* - * Configuration for the database connection. - */ - 'consentadmin' => array( - 'consent:Database', - 'dsn' => 'mysql:host=DBHOST;dbname=DBNAME', - 'username' => 'USERNAME', - 'password' => 'PASSWORD', - ), - - // Hash attributes including values or not - 'attributes.hash' => TRUE, +$config = [ + /* + * Configuration for the database connection. + */ + 'consentadmin' => [ + 'consent:Database', + 'dsn' => 'mysql:host=DBHOST;dbname=DBNAME', + 'username' => 'USERNAME', + 'password' => 'PASSWORD', + ], - // Where to direct the user after logout - // REMEMBER to prefix with http:// otherwise the relaystate is only appended + // Hash attributes including values or not + 'attributes.hash' => true, + + // If you set attributes.exclude in the consent module, this must match + // 'attributes.exclude' => [], + + // Where to direct the user after logout + // REMEMBER to prefix with http:// otherwise the relaystate is only appended // to saml2 logout URL - 'returnURL' => 'http://www.wayf.dk', + 'returnURL' => 'http://www.wayf.dk', // Shows description of the services if set to true (defaults to true) 'showDescription' => true, // Set authority 'authority' => 'saml2', -); +]; diff --git a/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/dictionaries/consentadmin.definition.json b/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/dictionaries/consentadmin.definition.json index a887cf3b76..7864ff142f 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/dictionaries/consentadmin.definition.json +++ b/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/dictionaries/consentadmin.definition.json @@ -1,7 +1,4 @@ { - "sp_empty_name": { - "en": "(name not specified)" - }, "sp_empty_description": { "en": "(no description)" }, @@ -61,5 +58,8 @@ }, "consentadmin_purpose": { "en": "The purpose of the service is" + }, + "link_consentAdmin": { + "en": "Consent administration" } -} \ No newline at end of file +} diff --git a/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/dictionaries/consentadmin.translation.json b/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/dictionaries/consentadmin.translation.json index f138c56d0a..fcc1ef52f8 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/dictionaries/consentadmin.translation.json +++ b/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/dictionaries/consentadmin.translation.json @@ -1,34 +1,4 @@ { - "sp_empty_name": { - "da": "(navn ikke angivet)", - "no": "(navn ikke spesifisert)", - "de": "(Name nicht angegeben)", - "sl": "(brez naziva)", - "pt": "(nome n\u00e3o especificado)", - "sv": "(namn ej angivet)", - "fr": "(nom non indiqu\u00e9)", - "hr": "(naziv nije specificiran)", - "hu": "(nincs n\u00e9v)", - "it": "(nome non specificato)", - "es": "(nombre no especificado)", - "lt": "(pavadinimas nenurodytas)", - "nl": "(naam niet opgegeven)", - "ja": "(\u540d\u524d\u7121\u3057)", - "zh-tw": "(\u672a\u5b9a\u7fa9\u540d\u7a31)", - "nn": "(namn ikkje spesifisert)", - "et": "(nimi m\u00e4\u00e4ramata)", - "he": "(\u05dc\u05d0 \u05e0\u05d9\u05ea\u05df \u05e9\u05dd)", - "zh": "\uff08\u6ca1\u6709\u6307\u5b9a\u540d\u5b57\uff09", - "ar": "\u0627\u0644\u0627\u0633\u0645 \u063a\u064a\u0631 \u0645\u062d\u062f\u062f", - "lv": "(v\u0101rds nav nor\u0101d\u012bts)", - "id": "(Nama tidak diisi)", - "sr": "(ime nije specificirano)", - "ro": "(nu a fost specificat numele)", - "ru": "(\u0438\u043c\u044f \u043d\u0435 \u0443\u043a\u0430\u0437\u0430\u043d\u043e)", - "cs": "(jm\u00e9no nespecifikov\u00e1no)", - "eu": "(izena ez da zehaztu)", - "el": "(\u03c7\u03c9\u03c1\u03af\u03c2 \u03cc\u03bd\u03bf\u03bc\u03b1)" - }, "sp_empty_description": { "da": "(ingen beskrivelse)", "no": "(ingen beskrivelse)", @@ -435,7 +405,7 @@ "ja": "<h3>\u627f\u8a8d\u306e\u524a\u9664\u65b9\u6cd5<\/h3> \u8a72\u5f53\u3059\u308b\u30b5\u30fc\u30d3\u30b9\u30d7\u30ed\u30d0\u30a4\u30c0\u306e\u30c1\u30a7\u30c3\u30af\u3092\u5916\u3057\u307e\u3059\u3002<h3>\u30ea\u30f3\u30af<\/h3> <ul> <li><a href=\"https:\/\/www.wayf.dk\">Start<\/a> <\/li> <li><a href=\"https:\/\/www.wayf.dk\/index.php\/en\/about-wayf\/faq-frequently-asked-questions\">FAQ<\/a> <\/li> <\/ul> ", "zh-tw": "<h3>\u5728\u9019\u522a\u9664\u60a8\u7684\u6388\u6b0a<\/h3> \u53d6\u6d88\u52fe\u9078\u670d\u52d9\u63d0\u4f9b\u8005\u5c0d\u61c9\u7684\u6838\u53d6\u65b9\u584a <h3>\u9023\u7d50<\/h3> <ul> <li><a href=\"https:\/\/www.wayf.dk\">\u958b\u59cb<\/a> <\/li> <li><a href=\"https:\/\/www.wayf.dk\/index.php\/en\/about-wayf\/faq-frequently-asked-questions\">\u8aaa\u660e<\/a> <\/li> <\/ul> ", "nn": "<h3>Korleis dra tilbake samtykke<\/h3> Fjern haka i boksen for enkelte tenester <h3>Lenker<\/h3> <ul> <li><a href=\"https:\/\/www.wayf.dk\">Start<\/a> <\/li> <li><a href=\"https:\/\/www.wayf.dk\/index.php\/da\/om-wayf\/faq-ofte-stillede-sporgsmal\">Ofte stilte sp\u00f8rsm\u00e5l<\/a> <\/li> <\/ul> ", - "nl": "<h3>Hoe verwijderdt u toestemmingen<\/h3> Vinkt u het vakje af dat overeenkomt met de dienstverlener <h3>Links<\/h3> <ul> <li><a href=\"https:\/\/www.wayf.dk\">Start<\/a> <\/li> <li><a href=\"https:\/\/www.wayf.dk\/index.php\/en\/about-wayf\/faq-frequently-asked-questions\">FAQ<\/a> <\/li> <\/ul>", + "nl": "<h3>Hoe verwijdert u toestemmingen<\/h3> Vinkt u het vakje af dat overeenkomt met de dienstverlener <h3>Links<\/h3> <ul> <li><a href=\"https:\/\/www.wayf.dk\">Start<\/a> <\/li> <li><a href=\"https:\/\/www.wayf.dk\/index.php\/en\/about-wayf\/faq-frequently-asked-questions\">FAQ<\/a> <\/li> <\/ul>", "et": "<h3>Kuidas eemaldada n\u00f5usolekut<\/h3> Eemalda vastava teenusepakkuja juurest m\u00e4rge <h3>Viited<\/h3> <ul> <li><a href=\"https:\/\/www.wayf.dk\">Start<\/a> <\/li> <li><a href=\"https:\/\/www.wayf.dk\/index.php\/en\/about-wayf\/faq-frequently-asked-questions\">KKK<\/a> <\/li> <\/ul>", "he": "<h3>\u05d0\u05d9\u05da \u05dc\u05d4\u05e1\u05d9\u05e8 \u05d0\u05ea \u05d4\u05e1\u05db\u05de\u05ea\u05da<\/h3> \u05dc\u05d7\u05e5 \u05d1\u05ea\u05d9\u05d1\u05d4 \u05d4\u05de\u05ea\u05d0\u05d9\u05de\u05d4 \u05dc\u05e1\u05e4\u05e7 \u05d4\u05e9\u05d9\u05e8\u05d5\u05ea <h3>\u05e7\u05d9\u05e9\u05d5\u05e8\u05d9\u05dd<\/h3> <ul> <li><a href=\"https:\/\/www.wayf.dk\">\u05d4\u05ea\u05d7\u05dc\u05d4<\/a> <\/li> <li><a href=\"https:\/\/www.wayf.dk\/index.php\/en\/about-wayf\/faq-frequently-asked-questions\">\u05e9\u05d0\u05dc\u05d5\u05ea \u05e0\u05e4\u05d5\u05e6\u05d5\u05ea<\/a> <\/li> <\/ul> ", "zh": "<h3>\u5982\u4f55\u5220\u9664\u4f60\u7684\u8bb8\u53ef<\/h3>\u53cd\u9009\u76f8\u5e94\u7684SP\u9009\u62e9\u6846<h3>Links<\/h3> <ul> <li><a href=\"https:\/\/www.wayf.dk\">\u5f00\u59cb<\/a> <\/li> <li><a href=\"https:\/\/www.wayf.dk\/index.php\/en\/about-wayf\/faq-frequently-asked-questions\">FAQ<\/a> <\/li> <\/ul>", @@ -628,5 +598,10 @@ "cs": "\u00da\u010del slu\u017eby je", "eu": "Zerbitzuaren xedea hau da", "el": "\u039f \u03c3\u03ba\u03bf\u03c0\u03cc\u03c2 \u03c4\u03b7\u03c2 \u03c5\u03c0\u03b7\u03c1\u03b5\u03c3\u03af\u03b1\u03c2 \u03b5\u03af\u03bd\u03b1\u03b9" + }, + "link_consentAdmin": { + "es": "Administración del consentimiento", + "no": "Samtykke administrasjon", + "nn": "Samtykke administrasjon" } } diff --git a/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/docs/consentAdmin.md b/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/docs/consentAdmin.md index 454cd5f478..1dc342e7f9 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/docs/consentAdmin.md +++ b/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/docs/consentAdmin.md @@ -44,7 +44,9 @@ Setting optional parameters In order to make the consentAdmin module work together with the consent module correctly, you need to set the configuration 'attributes.hash' according to the value of 'includeValues' configuration in the consent -module. +module. Likewise, if you've used the 'attributes.exclude' configuration +option in the consent module, you should also set the 'attributes.exclude' +configuration option here to match. You should also set the 'returnURL' configuration in order to pass on your users when the press the 'Logout' link. diff --git a/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/hooks/hook_configpage.php b/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/hooks/hook_configpage.php new file mode 100644 index 0000000000..2ea75afb11 --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/hooks/hook_configpage.php @@ -0,0 +1,15 @@ +<?php +/** + * Hook to add the consentAdmin module to the config page. + * + * @param \SimpleSAML\XHTML\Template $template The template that we should alter in this hook. + */ + +function consentAdmin_hook_configpage(\SimpleSAML\XHTML\Template &$template) +{ + $template->data['links']['consentAdmin'] = [ + 'href' => SimpleSAML\Module::getModuleURL('consentAdmin/consentAdmin.php'), + 'text' => \SimpleSAML\Locale\Translate::noop('Consent administration'), + ]; + $template->getLocalization()->addModuleDomain('consentAdmin'); +} diff --git a/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/hooks/hook_frontpage.php b/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/hooks/hook_frontpage.php index 0231a5b36c..b1903a580a 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/hooks/hook_frontpage.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/hooks/hook_frontpage.php @@ -4,12 +4,15 @@ * * @param array &$links The links on the frontpage, split into sections. */ -function consentAdmin_hook_frontpage(&$links) { - assert('is_array($links)'); - assert('array_key_exists("links", $links)'); - $links['config'][] = array( - 'href' => SimpleSAML\Module::getModuleURL('consentAdmin/consentAdmin.php'), - 'text' => '{consentAdmin:consentadmin:consentadmin_header}', - ); +function consentAdmin_hook_frontpage(&$links) +{ + assert(is_array($links)); + assert(array_key_exists('links', $links)); + + $links['config'][] = [ + 'href' => SimpleSAML\Module::getModuleURL('consentAdmin/consentAdmin.php'), + 'text' => '{consentAdmin:consentadmin:link_consentAdmin}', + ]; } + diff --git a/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/locales/ar/LC_MESSAGES/consentAdmin.po b/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/locales/ar/LC_MESSAGES/consentAdmin.po index ed203049a1..d778277bbb 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/locales/ar/LC_MESSAGES/consentAdmin.po +++ b/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/locales/ar/LC_MESSAGES/consentAdmin.po @@ -55,9 +55,6 @@ msgstr "لا يوجد وصف" msgid "{consentAdmin:consentadmin:service_providers_for}" msgstr "مشغلي الخدمة ل" -msgid "{consentAdmin:consentadmin:sp_empty_name}" -msgstr "الاسم غير محدد" - msgid "{consentAdmin:consentadmin:consentadmin_description2}" msgstr "" "لحذف موافقتك</h3>الغي صندوق مشغل الخدمة<h3>روابط</h3> <ul> <li><a " diff --git a/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/locales/cs/LC_MESSAGES/consentAdmin.po b/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/locales/cs/LC_MESSAGES/consentAdmin.po index 7709b6911b..42b3f52777 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/locales/cs/LC_MESSAGES/consentAdmin.po +++ b/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/locales/cs/LC_MESSAGES/consentAdmin.po @@ -55,9 +55,6 @@ msgstr "(žádný popis)" msgid "{consentAdmin:consentadmin:service_providers_for}" msgstr "Poskytovatelé služeb pro" -msgid "{consentAdmin:consentadmin:sp_empty_name}" -msgstr "(jméno nespecifikováno)" - msgid "{consentAdmin:consentadmin:consentadmin_description2}" msgstr "" "<h3>Jak smazat vaše povolení</h3> Odznačte políčko odpovídající " diff --git a/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/locales/da/LC_MESSAGES/consentAdmin.po b/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/locales/da/LC_MESSAGES/consentAdmin.po index 8961aba825..bdd2573a10 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/locales/da/LC_MESSAGES/consentAdmin.po +++ b/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/locales/da/LC_MESSAGES/consentAdmin.po @@ -54,9 +54,6 @@ msgstr "(ingen beskrivelse)" msgid "{consentAdmin:consentadmin:service_providers_for}" msgstr "Service Providers for" -msgid "{consentAdmin:consentadmin:sp_empty_name}" -msgstr "(navn ikke angivet)" - msgid "{consentAdmin:consentadmin:consentadmin_description2}" msgstr "" "<h3>Sådan sletter du et samtykke</h3>Fjern fluebenet ud for tjenesten, " diff --git a/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/locales/de/LC_MESSAGES/consentAdmin.po b/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/locales/de/LC_MESSAGES/consentAdmin.po index 2e53b5ce2c..72b0ae0fa9 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/locales/de/LC_MESSAGES/consentAdmin.po +++ b/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/locales/de/LC_MESSAGES/consentAdmin.po @@ -54,9 +54,6 @@ msgstr "(keine Beschreibung)" msgid "{consentAdmin:consentadmin:service_providers_for}" msgstr "Diensteanbieter für" -msgid "{consentAdmin:consentadmin:sp_empty_name}" -msgstr "(Name nicht angegeben)" - msgid "{consentAdmin:consentadmin:consentadmin_description2}" msgstr "" "<h3>Wie Sie Ihre Einverständniserklärung löschen</h3> Entfernen Sie das " diff --git a/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/locales/el/LC_MESSAGES/consentAdmin.po b/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/locales/el/LC_MESSAGES/consentAdmin.po index 207fb949db..15e128a24f 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/locales/el/LC_MESSAGES/consentAdmin.po +++ b/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/locales/el/LC_MESSAGES/consentAdmin.po @@ -54,9 +54,6 @@ msgstr "(χωρίς περιγραφή)" msgid "{consentAdmin:consentadmin:service_providers_for}" msgstr "Πάροχοι Υπηρεσιών για" -msgid "{consentAdmin:consentadmin:sp_empty_name}" -msgstr "(χωρίς όνομα)" - msgid "{consentAdmin:consentadmin:consentadmin_description2}" msgstr "" "<h3>Πώς να αναιρέσετε τη συγκατάθεσή σας</h3>Αποεπιλέξτε το κουτί " diff --git a/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/locales/en/LC_MESSAGES/consentAdmin.po b/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/locales/en/LC_MESSAGES/consentAdmin.po index 9d68f7f24b..8d8ec9af93 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/locales/en/LC_MESSAGES/consentAdmin.po +++ b/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/locales/en/LC_MESSAGES/consentAdmin.po @@ -54,9 +54,6 @@ msgstr "(no description)" msgid "{consentAdmin:consentadmin:service_providers_for}" msgstr "Service Providers for" -msgid "{consentAdmin:consentadmin:sp_empty_name}" -msgstr "(name not specified)" - msgid "{consentAdmin:consentadmin:consentadmin_description2}" msgstr "" "\n" @@ -171,3 +168,6 @@ msgstr "show/hide attributes" msgid "Organisation" msgstr "Organisation" +msgid "Consent administration" +msgstr "Consent administration" + diff --git a/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/locales/es/LC_MESSAGES/consentAdmin.po b/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/locales/es/LC_MESSAGES/consentAdmin.po index 8ddfa631c7..21b40476c6 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/locales/es/LC_MESSAGES/consentAdmin.po +++ b/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/locales/es/LC_MESSAGES/consentAdmin.po @@ -54,9 +54,6 @@ msgstr "(sin descripción)" msgid "{consentAdmin:consentadmin:service_providers_for}" msgstr "Proveedores de servicio para" -msgid "{consentAdmin:consentadmin:sp_empty_name}" -msgstr "(nombre no especificado)" - msgid "{consentAdmin:consentadmin:consentadmin_description2}" msgstr "" "<h3>Como eliminar su consentimiento</h3> Desmarque la opción " @@ -165,3 +162,5 @@ msgstr "Mostrar/ocultar atributos" msgid "Organisation" msgstr "Organización" +msgid "Consent administration" +msgstr "Administración del consentimiento" diff --git a/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/locales/et/LC_MESSAGES/consentAdmin.po b/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/locales/et/LC_MESSAGES/consentAdmin.po index 37219898d7..4a815ad5bd 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/locales/et/LC_MESSAGES/consentAdmin.po +++ b/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/locales/et/LC_MESSAGES/consentAdmin.po @@ -54,9 +54,6 @@ msgstr "(kirjeldus puudub)" msgid "{consentAdmin:consentadmin:service_providers_for}" msgstr "Teenusepakkujad" -msgid "{consentAdmin:consentadmin:sp_empty_name}" -msgstr "(nimi määramata)" - msgid "{consentAdmin:consentadmin:consentadmin_description2}" msgstr "" "<h3>Kuidas eemaldada nõusolekut</h3> Eemalda vastava teenusepakkuja " diff --git a/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/locales/eu/LC_MESSAGES/consentAdmin.po b/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/locales/eu/LC_MESSAGES/consentAdmin.po index 6d67389b76..adeb050e04 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/locales/eu/LC_MESSAGES/consentAdmin.po +++ b/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/locales/eu/LC_MESSAGES/consentAdmin.po @@ -54,9 +54,6 @@ msgstr "(deskribapenik gabe)" msgid "{consentAdmin:consentadmin:service_providers_for}" msgstr "Zerbitzu hornitzaileak hontarako: " -msgid "{consentAdmin:consentadmin:sp_empty_name}" -msgstr "(izena ez da zehaztu)" - msgid "{consentAdmin:consentadmin:consentadmin_description2}" msgstr "" "<h3>Zure onespena nola ezabatu</h3> Zerbitzu hornitzaileari dagokion " diff --git a/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/locales/fr/LC_MESSAGES/consentAdmin.po b/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/locales/fr/LC_MESSAGES/consentAdmin.po index ca3bde7f12..65abab4fd1 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/locales/fr/LC_MESSAGES/consentAdmin.po +++ b/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/locales/fr/LC_MESSAGES/consentAdmin.po @@ -54,9 +54,6 @@ msgstr "(pas de description)" msgid "{consentAdmin:consentadmin:service_providers_for}" msgstr "Fournisseurs de service pour" -msgid "{consentAdmin:consentadmin:sp_empty_name}" -msgstr "(nom non indiqué)" - msgid "{consentAdmin:consentadmin:consentadmin_description2}" msgstr "" "<h3>Comment révoquer un consentement</h3>Décochez la case correspondante " diff --git a/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/locales/he/LC_MESSAGES/consentAdmin.po b/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/locales/he/LC_MESSAGES/consentAdmin.po index 30a632e9d8..4cb1b7703e 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/locales/he/LC_MESSAGES/consentAdmin.po +++ b/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/locales/he/LC_MESSAGES/consentAdmin.po @@ -54,9 +54,6 @@ msgstr "(אין תיאור)" msgid "{consentAdmin:consentadmin:service_providers_for}" msgstr "ספקי שירות עבור" -msgid "{consentAdmin:consentadmin:sp_empty_name}" -msgstr "(לא ניתן שם)" - msgid "{consentAdmin:consentadmin:consentadmin_description2}" msgstr "" "<h3>איך להסיר את הסכמתך</h3> לחץ בתיבה המתאימה לספק השירות " diff --git a/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/locales/hr/LC_MESSAGES/consentAdmin.po b/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/locales/hr/LC_MESSAGES/consentAdmin.po index 4643672517..b7be441fd7 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/locales/hr/LC_MESSAGES/consentAdmin.po +++ b/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/locales/hr/LC_MESSAGES/consentAdmin.po @@ -55,9 +55,6 @@ msgstr "(nema opisa)" msgid "{consentAdmin:consentadmin:service_providers_for}" msgstr "Davatelji usluga za" -msgid "{consentAdmin:consentadmin:sp_empty_name}" -msgstr "(naziv nije specificiran)" - msgid "{consentAdmin:consentadmin:consentadmin_description2}" msgstr "" "<h3>Kako obrisati dozvolu</h3> Maknite kvačicu iz polja koje se odnosi na" diff --git a/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/locales/hu/LC_MESSAGES/consentAdmin.po b/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/locales/hu/LC_MESSAGES/consentAdmin.po index 78b785ca9b..51f0166a13 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/locales/hu/LC_MESSAGES/consentAdmin.po +++ b/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/locales/hu/LC_MESSAGES/consentAdmin.po @@ -54,9 +54,6 @@ msgstr "(nincs leírás)" msgid "{consentAdmin:consentadmin:service_providers_for}" msgstr "Szolgáltató" -msgid "{consentAdmin:consentadmin:sp_empty_name}" -msgstr "(nincs név)" - msgid "{consentAdmin:consentadmin:consentadmin_description2}" msgstr "" "<h3>Hogyan kell visszavonni egy hozzájárulást?</h3> A szolgáltatóhoz " diff --git a/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/locales/id/LC_MESSAGES/consentAdmin.po b/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/locales/id/LC_MESSAGES/consentAdmin.po index 04468f2620..64e517dbd6 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/locales/id/LC_MESSAGES/consentAdmin.po +++ b/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/locales/id/LC_MESSAGES/consentAdmin.po @@ -54,9 +54,6 @@ msgstr "(Tidak ada penjelasan)" msgid "{consentAdmin:consentadmin:service_providers_for}" msgstr "Service Provider untuk" -msgid "{consentAdmin:consentadmin:sp_empty_name}" -msgstr "(Nama tidak diisi)" - msgid "{consentAdmin:consentadmin:consentadmin_description2}" msgstr "" "<h3>Bagaimana cara menghapus consent anda</h3> Hapus centak pada kotak " diff --git a/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/locales/it/LC_MESSAGES/consentAdmin.po b/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/locales/it/LC_MESSAGES/consentAdmin.po index 6b4875d91e..10b213d142 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/locales/it/LC_MESSAGES/consentAdmin.po +++ b/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/locales/it/LC_MESSAGES/consentAdmin.po @@ -54,9 +54,6 @@ msgstr "(nessuna descrizione)" msgid "{consentAdmin:consentadmin:service_providers_for}" msgstr "Service provider per" -msgid "{consentAdmin:consentadmin:sp_empty_name}" -msgstr "(nome non specificato)" - msgid "{consentAdmin:consentadmin:consentadmin_description2}" msgstr "" "<h3>Come rimuovere il consenso></h3> Togliere il segno di spunta al " diff --git a/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/locales/ja/LC_MESSAGES/consentAdmin.po b/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/locales/ja/LC_MESSAGES/consentAdmin.po index 6cf0c9dc01..5a26c6aa45 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/locales/ja/LC_MESSAGES/consentAdmin.po +++ b/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/locales/ja/LC_MESSAGES/consentAdmin.po @@ -54,9 +54,6 @@ msgstr "(記述無し)" msgid "{consentAdmin:consentadmin:service_providers_for}" msgstr "サービスプロバイダ - " -msgid "{consentAdmin:consentadmin:sp_empty_name}" -msgstr "(名前無し)" - msgid "{consentAdmin:consentadmin:consentadmin_description2}" msgstr "" "<h3>承認の削除方法</h3> 該当するサービスプロバイダのチェックを外します。<h3>リンク</h3> <ul> <li><a " diff --git a/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/locales/lt/LC_MESSAGES/consentAdmin.po b/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/locales/lt/LC_MESSAGES/consentAdmin.po index 41e8fb3b0d..7596d5e822 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/locales/lt/LC_MESSAGES/consentAdmin.po +++ b/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/locales/lt/LC_MESSAGES/consentAdmin.po @@ -55,9 +55,6 @@ msgstr "(apibūdinimas nenurodytas)" msgid "{consentAdmin:consentadmin:service_providers_for}" msgstr "Paslaugos tiekėjai" -msgid "{consentAdmin:consentadmin:sp_empty_name}" -msgstr "(pavadinimas nenurodytas)" - msgid "{consentAdmin:consentadmin:consentadmin_description2}" msgstr "" "<h3>Kaip pašalinti savo leidimą</h3> Panaikinkite pažymėjimą ties " diff --git a/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/locales/lv/LC_MESSAGES/consentAdmin.po b/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/locales/lv/LC_MESSAGES/consentAdmin.po index fea6d8bd60..6f5ff436fc 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/locales/lv/LC_MESSAGES/consentAdmin.po +++ b/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/locales/lv/LC_MESSAGES/consentAdmin.po @@ -55,9 +55,6 @@ msgstr "(nav apraksta)" msgid "{consentAdmin:consentadmin:service_providers_for}" msgstr "Servisa piegādātāji priekš" -msgid "{consentAdmin:consentadmin:sp_empty_name}" -msgstr "(vārds nav norādīts)" - msgid "{consentAdmin:consentadmin:consentadmin_description2}" msgstr "" "<h3>Kā dzēst noteikumus</h3> Izņemiet ķeksīti pie atbilstošā servisa " diff --git a/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/locales/nb/LC_MESSAGES/consentAdmin.po b/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/locales/nb/LC_MESSAGES/consentAdmin.po index c6d1c68b30..a82000525a 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/locales/nb/LC_MESSAGES/consentAdmin.po +++ b/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/locales/nb/LC_MESSAGES/consentAdmin.po @@ -54,9 +54,6 @@ msgstr "(ingen beskrivelse)" msgid "{consentAdmin:consentadmin:service_providers_for}" msgstr "Tjenesteleverandører for" -msgid "{consentAdmin:consentadmin:sp_empty_name}" -msgstr "(navn ikke spesifisert)" - msgid "{consentAdmin:consentadmin:consentadmin_description2}" msgstr "" "<h3>Hvordan trekke samtykke tilbake</h3> Fjern haken i boksen for gitte " @@ -161,3 +158,5 @@ msgstr "vis/skjul persondata" msgid "Organisation" msgstr "Organisasjon" +msgid "Consent administration" +msgstr "Samtykke administrasjon" diff --git a/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/locales/nl/LC_MESSAGES/consentAdmin.po b/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/locales/nl/LC_MESSAGES/consentAdmin.po index 9e031e9cb0..77c74edc95 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/locales/nl/LC_MESSAGES/consentAdmin.po +++ b/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/locales/nl/LC_MESSAGES/consentAdmin.po @@ -54,12 +54,9 @@ msgstr "(geen omschrijving)" msgid "{consentAdmin:consentadmin:service_providers_for}" msgstr "Service Providers voor" -msgid "{consentAdmin:consentadmin:sp_empty_name}" -msgstr "(naam niet opgegeven)" - msgid "{consentAdmin:consentadmin:consentadmin_description2}" msgstr "" -"<h3>Hoe verwijderdt u toestemmingen</h3> Vinkt u het vakje af dat " +"<h3>Hoe verwijdert u toestemmingen</h3> Vinkt u het vakje af dat " "overeenkomt met de dienstverlener <h3>Links</h3> <ul> <li><a " "href=\"https://www.wayf.dk\">Start</a> </li> <li><a " "href=\"https://www.wayf.dk/index.php/en/about-wayf/faq-frequently-asked-" diff --git a/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/locales/nn/LC_MESSAGES/consentAdmin.po b/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/locales/nn/LC_MESSAGES/consentAdmin.po index 35aba2cd01..e4a7127178 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/locales/nn/LC_MESSAGES/consentAdmin.po +++ b/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/locales/nn/LC_MESSAGES/consentAdmin.po @@ -54,9 +54,6 @@ msgstr "(mangler informasjon)" msgid "{consentAdmin:consentadmin:service_providers_for}" msgstr "Tenesteleverandør for " -msgid "{consentAdmin:consentadmin:sp_empty_name}" -msgstr "(namn ikkje spesifisert)" - msgid "{consentAdmin:consentadmin:consentadmin_description2}" msgstr "" "<h3>Korleis dra tilbake samtykke</h3> Fjern haka i boksen for enkelte " @@ -161,3 +158,5 @@ msgstr "vis/skjul personinformasjon" msgid "Organisation" msgstr "Organisasjon" +msgid "Consent administration" +msgstr "Samtykke administrasjon" diff --git a/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/locales/pt/LC_MESSAGES/consentAdmin.po b/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/locales/pt/LC_MESSAGES/consentAdmin.po index 0673dcb7e9..85983c36f7 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/locales/pt/LC_MESSAGES/consentAdmin.po +++ b/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/locales/pt/LC_MESSAGES/consentAdmin.po @@ -54,9 +54,6 @@ msgstr "(sem descrição)" msgid "{consentAdmin:consentadmin:service_providers_for}" msgstr "Fornecedores de Serviços para" -msgid "{consentAdmin:consentadmin:sp_empty_name}" -msgstr "(nome não especificado)" - msgid "{consentAdmin:consentadmin:consentadmin_description2}" msgstr "" "<h3>Como remover o seu consentimento</h3> Retire a marca correspondente " diff --git a/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/locales/ro/LC_MESSAGES/consentAdmin.po b/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/locales/ro/LC_MESSAGES/consentAdmin.po index e83dbf9713..6c1943bfc7 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/locales/ro/LC_MESSAGES/consentAdmin.po +++ b/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/locales/ro/LC_MESSAGES/consentAdmin.po @@ -55,9 +55,6 @@ msgstr "(fără descriere)" msgid "{consentAdmin:consentadmin:service_providers_for}" msgstr "Furnizori de servicii pentru" -msgid "{consentAdmin:consentadmin:sp_empty_name}" -msgstr "(nu a fost specificat numele)" - msgid "{consentAdmin:consentadmin:consentadmin_description2}" msgstr "" "<h3>Cum poate fi anulat acordul dumneavoastră</h3>Debifați căsuța " diff --git a/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/locales/ru/LC_MESSAGES/consentAdmin.po b/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/locales/ru/LC_MESSAGES/consentAdmin.po index 9169cfd913..a641ee0e4c 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/locales/ru/LC_MESSAGES/consentAdmin.po +++ b/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/locales/ru/LC_MESSAGES/consentAdmin.po @@ -55,9 +55,6 @@ msgstr "(описание отсутствует)" msgid "{consentAdmin:consentadmin:service_providers_for}" msgstr "Сервис провайдеры для" -msgid "{consentAdmin:consentadmin:sp_empty_name}" -msgstr "(имя не указано)" - msgid "{consentAdmin:consentadmin:consentadmin_description2}" msgstr "" "<h3>Как удалить ваше согласие</h3> Снимите выделение с сервис провайдера " diff --git a/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/locales/sl/LC_MESSAGES/consentAdmin.po b/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/locales/sl/LC_MESSAGES/consentAdmin.po index 7afe72a12d..915d1669df 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/locales/sl/LC_MESSAGES/consentAdmin.po +++ b/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/locales/sl/LC_MESSAGES/consentAdmin.po @@ -55,9 +55,6 @@ msgstr "(brez opisa)" msgid "{consentAdmin:consentadmin:service_providers_for}" msgstr "Ponudniki storitev za" -msgid "{consentAdmin:consentadmin:sp_empty_name}" -msgstr "(brez naziva)" - msgid "{consentAdmin:consentadmin:consentadmin_description2}" msgstr "" "<h3>Kako razveljavim dano privolitev?</h3> Odstranite kljukico pred " diff --git a/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/locales/sr/LC_MESSAGES/consentAdmin.po b/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/locales/sr/LC_MESSAGES/consentAdmin.po index 5cd0b78871..6099ce86fc 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/locales/sr/LC_MESSAGES/consentAdmin.po +++ b/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/locales/sr/LC_MESSAGES/consentAdmin.po @@ -55,9 +55,6 @@ msgstr "(nema opisa)" msgid "{consentAdmin:consentadmin:service_providers_for}" msgstr "Davaoci Servisa za" -msgid "{consentAdmin:consentadmin:sp_empty_name}" -msgstr "(ime nije specificirano)" - msgid "{consentAdmin:consentadmin:consentadmin_description2}" msgstr "" "<h3>Kako obrisati dozvolu</h3> Uklonite kvačicu iz polja koje se odnosi " diff --git a/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/locales/sv/LC_MESSAGES/consentAdmin.po b/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/locales/sv/LC_MESSAGES/consentAdmin.po index d825178b11..6777d22f6b 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/locales/sv/LC_MESSAGES/consentAdmin.po +++ b/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/locales/sv/LC_MESSAGES/consentAdmin.po @@ -54,9 +54,6 @@ msgstr "(ingen beskrivning)" msgid "{consentAdmin:consentadmin:service_providers_for}" msgstr "Tjänsteleverantörer för" -msgid "{consentAdmin:consentadmin:sp_empty_name}" -msgstr "(namn ej angivet)" - msgid "{consentAdmin:consentadmin:consentadmin_description2}" msgstr "" "<h3>Hur du tar bort ditt samtycke</h3> Ta bort markeringen i rutan " diff --git a/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/locales/zh-tw/LC_MESSAGES/consentAdmin.po b/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/locales/zh-tw/LC_MESSAGES/consentAdmin.po index b7d2e43bea..7976654705 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/locales/zh-tw/LC_MESSAGES/consentAdmin.po +++ b/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/locales/zh-tw/LC_MESSAGES/consentAdmin.po @@ -54,9 +54,6 @@ msgstr "(無描述)" msgid "{consentAdmin:consentadmin:service_providers_for}" msgstr "服務提供者的" -msgid "{consentAdmin:consentadmin:sp_empty_name}" -msgstr "(未定義名稱)" - msgid "{consentAdmin:consentadmin:consentadmin_description2}" msgstr "" "<h3>在這刪除您的授權</h3> 取消勾選服務提供者對應的核取方塊 <h3>連結</h3> <ul> <li><a " diff --git a/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/locales/zh/LC_MESSAGES/consentAdmin.po b/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/locales/zh/LC_MESSAGES/consentAdmin.po index 0a3b247785..ab6ab8d229 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/locales/zh/LC_MESSAGES/consentAdmin.po +++ b/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/locales/zh/LC_MESSAGES/consentAdmin.po @@ -54,9 +54,6 @@ msgstr "(没有描述)" msgid "{consentAdmin:consentadmin:service_providers_for}" msgstr "服务提供商服务于" -msgid "{consentAdmin:consentadmin:sp_empty_name}" -msgstr "(没有指定名字)" - msgid "{consentAdmin:consentadmin:consentadmin_description2}" msgstr "" "<h3>如何删除你的许可</h3>反选相应的SP选择框<h3>Links</h3> <ul> <li><a " diff --git a/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/templates/consentadmin.php b/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/templates/consentadmin.php index ce3386c4c8..e8c3bcc839 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/templates/consentadmin.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/templates/consentadmin.php @@ -1,56 +1,11 @@ -<?php $this->includeAtTemplateBase('includes/header.php'); ?> -<!-- default theme --> - -<script> - function setConsentText(consentStatus, show_spid) { - document.getElementById("consentText" + show_spid).innerHTML = consentStatus; - } -</script> - -<script src="includes/consentSimpleAjax.js"></script> - -<style> -.caSPName { - font-weight: bold; -} - -td.caSPName { - vertical-align: top; -} - -.caAllowed { - -} - -td.caAllowed { - vertical-align: top; -} - -td.caAttributes { - -} - -tr.row0 td { - background-color: #888888; - color: black; -} - -tr.row1 td { - background-color: #aaaaaa; - color: black; -} - -a.orange { - color: #ffd633; -} - -span.showhide { - -} -</style> - - - <!-- <h2><?php if (isset($this->data['header'])) { echo $this->t($this->data['header']); } else { echo "Some error occurred"; } ?></h2> --> +<?php + $this->data['head'] = '<link rel="stylesheet" type="text/css" href="'. + SimpleSAML\Module::getModuleURL("consentAdmin/assets/css/consentAdmin.css").'" />'."\n"; + $this->data['head'] .= '<script type="text/javascript" src="'. + SimpleSAML\Module::getModuleURL("consentAdmin/assets/js/consentAdmin.js").'"></script>'; + // default theme + $this->includeAtTemplateBase('includes/header.php'); +?> <h2><?php echo $this->t('{consentAdmin:consentadmin:consentadmin_header}') ?></h2> <p> <?php echo $this->t('{consentAdmin:consentadmin:consentadmin_description1}') ?> </p> @@ -59,7 +14,7 @@ function setConsentText(consentStatus, show_spid) { <table> <tr> <th width="80%"><?php echo $this->t('{consentAdmin:consentadmin:service_provider_header}') ?></th> - <th width="140"><?php echo $this->t('{consentAdmin:consentadmin:status_header}') ?></th> + <th><?php echo $this->t('{consentAdmin:consentadmin:status_header}') ?></th> </tr> <?php $spList = $this->data['spList']; @@ -67,15 +22,14 @@ function setConsentText(consentStatus, show_spid) { $show_text = $this->t('{consentAdmin:consentadmin:show}'); $hide_text = $this->t('{consentAdmin:consentadmin:hide}'); $attributes_text = $this->t('{consentAdmin:consentadmin:attributes_text}'); - foreach ($spList AS $spName => $spValues) { - $this->getTranslator()->includeInlineTranslation('spname', $spValues['name']); - $this->getTranslator()->includeInlineTranslation('spdescription', $spValues['description']); + foreach ($spList as $spName => $spValues) { if (!is_null($spValues['serviceurl'])) { - $htmlSpName = '<a href="' . $spValues['serviceurl'] . '" style="color: black; font-weight: bold;">' . htmlspecialchars($this->t('spname', array(), false, true)) . '</a>'; + $htmlSpName = '<a class="serviceUrl" href="'.$spValues['serviceurl'].'">'. + htmlspecialchars($spValues['name']).'</a>'; } else { - $htmlSpName = htmlspecialchars($this->t('spname', array(), false, true)); + $htmlSpName = htmlspecialchars($spValues['name']); } - $spDescription = htmlspecialchars($this->t('spdescription',array(), false, true)); + $spDescription = htmlspecialchars($spValues['description']); $checkedAttr = $spValues['consentStatus'] == 'ok' ? 'checked="checked"' : ''; $consentValue = $spValues['consentValue']; $consentText = $spValues['consentStatus'] == 'changed' ? "attributes has changed" : ""; @@ -84,28 +38,26 @@ function setConsentText(consentStatus, show_spid) { <tr class="$row_class"> <td> <table> - <tr class="$row_class"><td><span class='caSPName'><span title='$spDescription'>$htmlSpName</span> <span style="font-size: 80%;"onclick="javascript:toggleShowAttributes('$show_spid');"><span id=showing_$show_spid >$show_text</span><span id=hiding_$show_spid style='display:none;'>$hide_text</span> $attributes_text</span></span></td> - <tr><td colspan="2" class="caAttributes"><div id="attributes_$show_spid" style="display: none;"> + <tr class="$row_class"> + <td><span class='caSPName'><span title='$spDescription'>$htmlSpName</span>  + <span class="show_hide" id="show_hide_$show_spid"><span id='showing_$show_spid'>$show_text</span> + <span id='hiding_$show_spid'>$hide_text</span> $attributes_text</span></span></td></tr> + <tr><td colspan="2" class="caAttributes"><div id="attributes_$show_spid"> TRSTART; $attributes = $spValues['attributes_by_sp']; if ($this->data['showDescription']) { - echo '<p>' . $this->t('{consentAdmin:consentadmin:consentadmin_purpose}') . ' ' . $spDescription . '</p>'; + echo '<p>'.$this->t('{consentAdmin:consentadmin:consentadmin_purpose}').' '.$spDescription.'</p>'; } echo "\n<ul>\n"; - foreach ($attributes AS $name => $value) { - - if (isset($this->data['attribute_' . htmlspecialchars(strtolower($name)) ])) { - $name = $this->data['attribute_' . htmlspecialchars(strtolower($name))]; - } - $name = $this->getTranslator()->getAttributeTranslation($name); // translate - if (sizeof($value) > 1) { - echo "<li>" . htmlspecialchars($name) . ":\n<ul>\n"; - foreach ($value AS $v) { - echo '<li>' . htmlspecialchars($v) . "</li>\n"; + foreach ($attributes as $name => $value) { + if (sizeof($value) > 1) { + echo "<li>".htmlspecialchars($name).":\n<ul>\n"; + foreach ($value as $v) { + echo '<li>'.htmlspecialchars($v)."</li>\n"; } echo "</ul>\n</li>\n"; } else { - echo "<li>" . htmlspecialchars($name) . ": " . htmlspecialchars($value[0]) . "</li>\n"; + echo "<li>".htmlspecialchars($name).": ".htmlspecialchars($value[0])."</li>\n"; } } echo "</ul>"; @@ -114,10 +66,12 @@ function setConsentText(consentStatus, show_spid) { </table> </td> -<td class='caAllowed'><input onClick="javascript:checkConsent(this.value, $show_spid, this.checked)" value='$consentValue' type='checkbox' $checkedAttr><span id="consentText$show_spid">$consentText</span></td> +<td class='caAllowed'> + <input id="checkbox_$show_spid" class="checkbox" value='$consentValue' type='checkbox' $checkedAttr /> + <span id="consentText_$show_spid">$consentText</span></td> TRSTART; - echo "</td></tr>\n"; - $show_spid++; + echo "</tr>\n"; + $show_spid++; } ?> </table> @@ -126,7 +80,11 @@ function setConsentText(consentStatus, show_spid) { <?php echo $this->t('{consentAdmin:consentadmin:consentadmin_description2}') ?> </p> <h2>Logout</h2> - - <p><a href="<?php echo \SimpleSAML\Module::getModuleURL('consentAdmin/consentAdmin.php', array('logout' => 1)); ?>">Logout</a></p> + <p> + <a href=" + <?php + echo \SimpleSAML\Module::getModuleURL('consentAdmin/consentAdmin.php', ['logout' => 1]); + ?>">Logout</a> + </p> <?php $this->includeAtTemplateBase('includes/footer.php'); diff --git a/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/templates/consentadmin.twig b/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/templates/consentadmin.twig new file mode 100644 index 0000000000..b3197b5304 --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/templates/consentadmin.twig @@ -0,0 +1,82 @@ +{% set pagetitle = '{consentAdmin:consentadmin:consentadmin_header}'|trans %} +{% extends "base.twig" %} + +{% block preload %} +<link rel="stylesheet" href="/{{ baseurlpath }}module.php/consentAdmin/assets/css/consentAdmin.css"> +{% endblock %} + +{% block postload %} +<script src="/{{ baseurlpath }}module.php/consentAdmin/assets/js/consentAdmin.js"></script> +{% endblock %} + +{% block content %} + +<h2>{{ '{consentAdmin:consentadmin:consentadmin_header}'|trans }}</h2> +<p>{{ '{consentAdmin:consentadmin:consentadmin_description1}'|trans }}</p> + +<table> + <tr> + <th colspan="2" width="80%">{{ '{consentAdmin:consentadmin:service_provider_header}'|trans }}</th> + <th width="140">{{ '{consentAdmin:consentadmin:status_header}'|trans }}</th> + </tr> + +{% for spName, spValues in spList %} + + {% if loop.index0 % 2 == 0 %} + {% set rowClass = 'row0' %} + {% else %} + {% set rowClass = 'row1' %} + {% endif %} + + <tr class="{{ rowClass }}"> + <td> + <span class='caSPName'> + <span title='{{ spValues.description|escape('html') }}'> + {% if spValues.serviceurl is defined %} + {{ spValues.name|escape('html') }} + {% else %} + <a class="serviceUrl" href="{{ spValues.serviceurl }}">{{ spValues.name|escape('html') }}</a> + {% endif %} + </span> + <span class="show_hide" id="show_hide_{{ loop.index0 }}"> + <span id="showing_{{ loop.index0 }}">{{ '{consentAdmin:consentadmin:show}'|trans }}</span> + <span id="hiding_{{ loop.index0 }}">{{ '{consentAdmin:consentadmin:hide}'|trans }}</span> + {{ '{consentAdmin:consentadmin:attributes_text}'|trans }} + </span> + </span> + </td> + <td class="caAttributes"> + <div id="attributes_{{ loop.index0 }}"> + {% if showDescription %} + <p>{{ '{consentAdmin:consentadmin:consentadmin_purpose}'|trans }}{{ spValues.description|escape('html') }}</p> + {% endif %} + <ul> + {% for attrName, attrValue in spValues.attributes_by_sp %} + {% if attrValue|length > 1 %} + <li>{{ attrName|escape('html') }}: + <ul> + {% for valKey, value in attrValue %} + <li>{{ value|escape('html') }}</li> + {% endfor %} + </ul> + </li> + {% else %} + <li>{{ attrName|escape('html') }}: {{ attrValue|first|escape('html') }}</li> + {% endif %} + {% endfor %} + </ul> + </div> + </td> + <td class="caAllowed"> + <input class="checkbox" id="checkbox_{{ loop.index0 }}" value='{{ spValues.consentValue }}' type='checkbox'{% if spValues.consentStatus == 'ok'%} checked="checked"{% endif %} /><span id="consentText_{{ loop.index0 }}">{% if spValues.consentStatus == 'changed' %}attributes has changed{% endif %}</span> + </td> + </tr> +{% endfor %} +</table> + +<p>{{ '{consentAdmin:consentadmin:consentadmin_description2}'|trans|raw }}</p> + +<h2>Logout</h2> +<p><a href="{{ baseurlpath }}consentAdmin.php?logout=1">Logout</a></p> + +{% endblock %} diff --git a/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/templates/consentadminajax.php b/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/templates/consentadminajax.php index 6055428960..c8520b0855 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/templates/consentadminajax.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/templates/consentadminajax.php @@ -1,2 +1,2 @@ -<?php -print $this->t($this->data['res']); +<?php +echo $res; diff --git a/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/templates/consentadminajax.twig b/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/templates/consentadminajax.twig new file mode 100644 index 0000000000..2b8211892e --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/templates/consentadminajax.twig @@ -0,0 +1,3 @@ +{% block content %} +{{ res }} +{% endblock %} diff --git a/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/www/assets/css/consentAdmin.css b/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/www/assets/css/consentAdmin.css new file mode 100644 index 0000000000..94c4a190c4 --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/www/assets/css/consentAdmin.css @@ -0,0 +1,39 @@ +.caSPName { + font-weight: bold; +} +td.caSPName { + vertical-align: top; +} +td.caAllowed { + vertical-align: top; +} +td.caAttributes { +} +tr.row0 td { + background-color: #888888; + color: black; +} +tr.row1 td { + background-color: #aaaaaa; + color: black; +} +a.orange { + color: #ffd633; +} + +span.show_hide { + font-size: 80%; +} + +a.serviceUrl { + color: black; + font-weight: bold; +} + +span[id^='hiding_'], span[id*='hiding_'] { + display: none; +} + +div[id^='attributes_'], div[id*='attributes_'] { + display: none; +} diff --git a/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/www/assets/js/consentAdmin.js b/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/www/assets/js/consentAdmin.js new file mode 100644 index 0000000000..59cf4e17b4 --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/www/assets/js/consentAdmin.js @@ -0,0 +1,79 @@ +var xmlHttp; + +function checkConsent() +{ + var show_spid = this.id.charAt(this.id.length-1); + var checkbox = document.getElementById("checkbox_"+show_spid); + + xmlHttp = GetXmlHttpObject() + if (xmlHttp == null) { + alert("Browser does not support HTTP Request") + return + } + + var url = "consentAdmin.php" + url = url+"?cv="+checkbox.value + url = url+"&action="+checkbox.checked + url = url+"&sid="+Math.random() + + xmlHttp.onreadystatechange = function () { + if (xmlHttp.readyState == 4 || xmlHttp.readyState == "complete") { + document.getElementById("consentText_" + show_spid).innerHTML = xmlHttp.responseText; + } + } + + xmlHttp.open("GET", url, true) + xmlHttp.send(null) +} + +// This function creates an XMLHttpRequest +function GetXmlHttpObject() +{ + var xmlHttp = null; + try { + // Firefox, Opera 8.0+, Safari + xmlHttp = new XMLHttpRequest(); + } catch (e) { + //Internet Explorer + try { + xmlHttp = new ActiveXObject("Msxml2.XMLHTTP"); + } catch (e) { + xmlHttp = new ActiveXObject("Microsoft.XMLHTTP"); + } + } + return xmlHttp; +} + +function toggleShowAttributes() +{ + var show_spid = this.id.charAt(this.id.length-1); + + var disp = document.getElementById('attributes_' + show_spid); + var showing = document.getElementById('showing_' + show_spid); + var hiding = document.getElementById('hiding_' + show_spid); + + disp.style.display = (disp.style.display == 'none' ? 'block' : 'none'); + showing.style.display = (disp.style.display == 'none' ? 'inline' : 'none'); + hiding.style.display = (disp.style.display == 'none' ? 'none' : 'inline'); +} + +document.addEventListener( + 'DOMContentLoaded', + function () { + var show_hide = document.getElementsByClassName("show_hide"); + for (var i = 0; i < show_hide.length; i++) { + show_hide[i].addEventListener( + 'click', + toggleShowAttributes + ); + } + + var checkbox = document.getElementsByClassName("checkbox"); + for (var i = 0; i < checkbox.length; i++) { + checkbox[i].addEventListener( + 'click', + checkConsent + ); + } + } +); diff --git a/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/www/consentAdmin.php b/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/www/consentAdmin.php index f3760a6480..17a091d087 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/www/consentAdmin.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/www/consentAdmin.php @@ -22,24 +22,30 @@ function driveProcessingChain( $sp_entityid, $attributes, $userid, - $hashAttributes = false + $hashAttributes = false, + $excludeAttributes = [] ) { - /* * Create a new processing chain */ - $pc = new SimpleSAML_Auth_ProcessingChain($idp_metadata, $sp_metadata, 'idp'); + $pc = new \SimpleSAML\Auth\ProcessingChain($idp_metadata, $sp_metadata, 'idp'); /* * Construct the state. * REMEMBER: Do not set Return URL if you are calling processStatePassive */ - $authProcState = array( + $authProcState = [ 'Attributes' => $attributes, 'Destination' => $sp_metadata, + 'SPMetadata' => $sp_metadata, 'Source' => $idp_metadata, + 'IdPMetadata' => $idp_metadata, 'isPassive' => true, - ); + ]; + /* we're being bridged, so add that info to the state */ + if (strpos($source, '-idp-remote|') !== false) { + $authProcState['saml:sp:IdP'] = substr($source, strpos($source, '|') + 1); + } /* * Call processStatePAssive. @@ -48,26 +54,32 @@ function driveProcessingChain( $pc->processStatePassive($authProcState); $attributes = $authProcState['Attributes']; + // Remove attributes that do not require consent/should be excluded + foreach ($attributes as $attrkey => $attrval) { + if (in_array($attrkey, $excludeAttributes)) { + unset($attributes[$attrkey]); + } + } /* * Generate identifiers and hashes */ $destination = $sp_metadata['metadata-set'].'|'.$sp_entityid; - $targeted_id = sspmod_consent_Auth_Process_Consent::getTargetedID($userid, $source, $destination); - $attribute_hash = sspmod_consent_Auth_Process_Consent::getAttributeHash($attributes, $hashAttributes); + $targeted_id = \SimpleSAML\Module\consent\Auth\Process\Consent::getTargetedID($userid, $source, $destination); + $attribute_hash = \SimpleSAML\Module\consent\Auth\Process\Consent::getAttributeHash($attributes, $hashAttributes); - SimpleSAML\Logger::info('consentAdmin: user: '.$userid); - SimpleSAML\Logger::info('consentAdmin: target: '.$targeted_id); - SimpleSAML\Logger::info('consentAdmin: attribute: '.$attribute_hash); + \SimpleSAML\Logger::info('consentAdmin: user: '.$userid); + \SimpleSAML\Logger::info('consentAdmin: target: '.$targeted_id); + \SimpleSAML\Logger::info('consentAdmin: attribute: '.$attribute_hash); // Return values - return array($targeted_id, $attribute_hash, $attributes); + return [$targeted_id, $attribute_hash, $attributes]; } // Get config object -$config = SimpleSAML_Configuration::getInstance(); -$cA_config = SimpleSAML_Configuration::getConfig('module_consentAdmin.php'); +$config = \SimpleSAML\Configuration::getInstance(); +$cA_config = \SimpleSAML\Configuration::getConfig('module_consentAdmin.php'); $authority = $cA_config->getValue('authority'); $as = new \SimpleSAML\Auth\Simple($authority); @@ -80,6 +92,8 @@ function driveProcessingChain( $hashAttributes = $cA_config->getValue('attributes.hash'); +$excludeAttributes = $cA_config->getValue('attributes.exclude', []); + // Check if valid local session exists $as->requireAuth(); @@ -87,33 +101,36 @@ function driveProcessingChain( $attributes = $as->getAttributes(); // Get metadata storage handler -$metadata = SimpleSAML_Metadata_MetaDataStorageHandler::getMetadataHandler(); +$metadata = \SimpleSAML\Metadata\MetaDataStorageHandler::getMetadataHandler(); /* * Get IdP id and metadata */ -$local_idp_entityid = $metadata->getMetaDataCurrentEntityID('saml20-idp-hosted'); -$local_idp_metadata = $metadata->getMetaData($local_idp_entityid, 'saml20-idp-hosted'); +$idp_entityid = $metadata->getMetaDataCurrentEntityID('saml20-idp-hosted'); +$idp_metadata = $metadata->getMetaData($idp_entityid, 'saml20-idp-hosted'); +// Calc correct source if ($as->getAuthData('saml:sp:IdP') !== null) { // from a remote idp (as bridge) - $idp_entityid = $as->getAuthData('saml:sp:IdP'); - $idp_metadata = $metadata->getMetaData($idp_entityid, 'saml20-idp-remote'); + $source = 'saml20-idp-remote|'.$as->getAuthData('saml:sp:IdP'); } else { // from the local idp - $idp_entityid = $local_idp_entityid; - $idp_metadata = $local_idp_metadata; + $source = $idp_metadata['metadata-set'].'|'.$idp_entityid; } // Get user ID -$userid_attributename = (isset($local_idp_metadata['userid.attribute']) && is_string($local_idp_metadata['userid.attribute'])) ? $local_idp_metadata['userid.attribute'] : 'eduPersonPrincipalName'; +if (isset($idp_metadata['userid.attribute']) && is_string($idp_metadata['userid.attribute'])) { + $userid_attributename = $idp_metadata['userid.attribute']; +} else { + $userid_attributename = 'eduPersonPrincipalName'; +} $userids = $attributes[$userid_attributename]; if (empty($userids)) { - throw new Exception('Could not generate useridentifier for storing consent. Attribute ['. + throw new \Exception('Could not generate useridentifier for storing consent. Attribute ['. $userid_attributename.'] was not available.'); } @@ -132,61 +149,71 @@ function driveProcessingChain( $action = $_GET["action"]; } -SimpleSAML\Logger::critical('consentAdmin: sp: '.$sp_entityid.' action: '.$action); +\SimpleSAML\Logger::critical('consentAdmin: sp: '.$sp_entityid.' action: '.$action); // Remove services, whitch have consent disabled if (isset($idp_metadata['consent.disable'])) { - foreach ($idp_metadata['consent.disable'] AS $disable) { + foreach ($idp_metadata['consent.disable'] as $disable) { if (array_key_exists($disable, $all_sp_metadata)) { unset($all_sp_metadata[$disable]); } } } -SimpleSAML\Logger::info('consentAdmin: '.$idp_entityid); - -// Calc correct source -$source = $idp_metadata['metadata-set'].'|'.$idp_entityid; +\SimpleSAML\Logger::info('consentAdmin: '.$idp_entityid); // Parse consent config -$consent_storage = sspmod_consent_Store::parseStoreConfig($cA_config->getValue('consentadmin')); +$consent_storage = \SimpleSAML\Module\consent\Store::parseStoreConfig($cA_config->getValue('consentadmin')); // Calc correct user ID hash -$hashed_user_id = sspmod_consent_Auth_Process_Consent::getHashedUserID($userid, $source); +$hashed_user_id = \SimpleSAML\Module\consent\Auth\Process\Consent::getHashedUserID($userid, $source); // If a checkbox have been clicked if ($action !== null && $sp_entityid !== null) { + // init template to enable translation of status messages + $template = new \SimpleSAML\XHTML\Template( + $config, + 'consentAdmin:consentadminajax.php', + 'consentAdmin:consentadmin' + ); + // Get SP metadata $sp_metadata = $metadata->getMetaData($sp_entityid, 'saml20-sp-remote'); // Run AuthProc filters - list($targeted_id, $attribute_hash, $attributes_new) = driveProcessingChain($idp_metadata, $source, $sp_metadata, - $sp_entityid, $attributes, $userid, $hashAttributes); + list($targeted_id, $attribute_hash, $attributes_new) = driveProcessingChain( + $idp_metadata, + $source, + $sp_metadata, + $sp_entityid, + $attributes, + $userid, + $hashAttributes, + $excludeAttributes + ); // Add a consent (or update if attributes have changed and old consent for SP and IdP exists) if ($action == 'true') { $isStored = $consent_storage->saveConsent($hashed_user_id, $targeted_id, $attribute_hash); if ($isStored) { - $res = "added"; + $res = $translator->t("added"); } else { - $res = "updated"; + $res = $translator->t("updated"); } // Remove consent } else { if ($action == 'false') { // Got consent, so this is a request to remove it - $rowcount = $consent_storage->deleteConsent($hashed_user_id, $targeted_id, $attribute_hash); + $rowcount = $consent_storage->deleteConsent($hashed_user_id, $targeted_id); if ($rowcount > 0) { - $res = "removed"; + $res = $translator->t("removed"); } // Unknown action (should not happen) } else { - SimpleSAML\Logger::info('consentAdmin: unknown action'); - $res = "unknown"; + \SimpleSAML\Logger::info('consentAdmin: unknown action'); + $res = $translator->t("unknown"); } } - // init template to enable translation of status messages - $template = new SimpleSAML_XHTML_Template($config, 'consentAdmin:consentadminajax.php', 'consentAdmin:consentadmin'); $template->data['res'] = $res; $template->show(); exit; @@ -196,18 +223,18 @@ function driveProcessingChain( $user_consent_list = $consent_storage->getConsents($hashed_user_id); // Parse list of consents -$user_consent = array(); +$user_consent = []; foreach ($user_consent_list as $c) { $user_consent[$c[0]] = $c[1]; } -$template_sp_content = array(); +$template_sp_content = []; // Init template -$template = new SimpleSAML_XHTML_Template($config, 'consentAdmin:consentadmin.php', 'consentAdmin:consentadmin'); +$template = new \SimpleSAML\XHTML\Template($config, 'consentAdmin:consentadmin.php', 'consentAdmin:consentadmin'); $translator = $template->getTranslator(); -$translator->includeLanguageFile('attributes.php'); // attribute listings translated by this dictionary -$sp_empty_name = $translator->getTag('sp_empty_name'); +$translator->includeLanguageFile('attributes'); // attribute listings translated by this dictionary + $sp_empty_description = $translator->getTag('sp_empty_description'); // Process consents for all SP @@ -216,16 +243,35 @@ function driveProcessingChain( $sp_metadata = $metadata->getMetaData($sp_entityid, 'saml20-sp-remote'); // Run attribute filters - list($targeted_id, $attribute_hash, $attributes_new) = driveProcessingChain($idp_metadata, $source, $sp_metadata, - $sp_entityid, $attributes, $userid, $hashAttributes); + list($targeted_id, $attribute_hash, $attributes_new) = driveProcessingChain( + $idp_metadata, + $source, + $sp_metadata, + $sp_entityid, + $attributes, + $userid, + $hashAttributes, + $excludeAttributes + ); + + // Translate attribute-names + foreach ($attributes_new as $orig_name => $value) { + if (isset($template->data['attribute_'.htmlspecialchars(strtolower($orig_name))])) { + $old_name = $template->data['attribute_'.htmlspecialchars(strtolower($orig_name))]; + } + $name = $translator->getAttributeTranslation(strtolower($orig_name)); // translate + + $attributes_new[$name] = $value; + unset($attributes_new[$orig_name]); + } // Check if consent exists if (array_key_exists($targeted_id, $user_consent)) { $sp_status = "changed"; - SimpleSAML\Logger::info('consentAdmin: changed'); + \SimpleSAML\Logger::info('consentAdmin: changed'); // Check if consent is valid. (Possible that attributes has changed) if ($user_consent[$targeted_id] == $attribute_hash) { - SimpleSAML\Logger::info('consentAdmin: ok'); + \SimpleSAML\Logger::info('consentAdmin: ok'); $sp_status = "ok"; } // Consent does not exists @@ -243,7 +289,7 @@ function driveProcessingChain( } elseif (isset($sp_values['OrganizationDisplayName']) && is_array($sp_values['OrganizationDisplayName'])) { $sp_name = $sp_metadata['OrganizationDisplayName']; } else { - $sp_name = $sp_empty_name; + $sp_name = $sp_entityid; } } @@ -257,8 +303,15 @@ function driveProcessingChain( // Add a URL to the service if present in metadata $sp_service_url = isset($sp_metadata['ServiceURL']) ? $sp_metadata['ServiceURL'] : null; + // Translate SP name and description + $translator->includeInlineTranslation('spname', $sp_name); + $translator->includeInlineTranslation('spdescription', $sp_description); + + $sp_name = $translator->getPreferredTranslation($translator->getTag('spname')); + $sp_description = $translator->getPreferredTranslation($translator->getTag('spdescription')); + // Fill out array for the template - $sp_list[$sp_entityid] = array( + $sp_list[$sp_entityid] = [ 'spentityid' => $sp_entityid, 'name' => $sp_name, 'description' => $sp_description, @@ -266,7 +319,7 @@ function driveProcessingChain( 'consentValue' => $sp_entityid, 'attributes_by_sp' => $attributes_new, 'serviceurl' => $sp_service_url, - ); + ]; } $template->data['header'] = 'Consent Administration'; diff --git a/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/www/includes/consentSimpleAjax.js b/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/www/includes/consentSimpleAjax.js deleted file mode 100644 index 7ea896c630..0000000000 --- a/vendor/simplesamlphp/simplesamlphp/modules/consentAdmin/www/includes/consentSimpleAjax.js +++ /dev/null @@ -1,70 +0,0 @@ -var xmlHttp; - -function checkConsent(consentValue, show_spid, checkAction) -{ - xmlHttp=GetXmlHttpObject() - if (xmlHttp==null) { - alert ("Browser does not support HTTP Request") - - return - } - - var url="consentAdmin.php" - url=url+"?cv="+consentValue - url=url+"&action="+checkAction - url=url+"&sid="+Math.random() - xmlHttp.onreadystatechange=function() { - if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") - { - setConsentText(xmlHttp.responseText, show_spid); - } -} - - xmlHttp.open("GET",url,true) - xmlHttp.send(null) -} - -// This function will be automaticly called when the Ajax call is done returning data -function stateChanged() { - if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") - { - //Alert("Status of consent:" + xmlHttp.responseText ); - } -} - -// This function creates an XMLHttpRequest -function GetXmlHttpObject() { - var xmlHttp=null; - try - { - // Firefox, Opera 8.0+, Safari - xmlHttp=new XMLHttpRequest(); - } - catch (e) - { - //Internet Explorer - try - { - xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); - } - catch (e) - { - xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); - } - } - - return xmlHttp; -} - -function toggleShowAttributes(show_spid) { - var disp = document.getElementById('attributes_' + show_spid); - //var showhide = document.getElementById('showhide_' + show_spid); - var showing = document.getElementById('showing_' + show_spid); - var hiding = document.getElementById('hiding_' + show_spid); - - disp.style.display = (disp.style.display == 'none' ? 'block' : 'none'); - //showhide.innerHTML = (disp.style.display == 'none' ? 'Show' : 'Hide') - showing.style.display = (disp.style.display == 'none' ? 'inline' : 'none'); - hiding.style.display = (disp.style.display == 'none' ? 'none' : 'inline'); - //alert('hiding display'+hiding.display); -} diff --git a/vendor/simplesamlphp/simplesamlphp/modules/core/dictionaries/cardinality.definition.json b/vendor/simplesamlphp/simplesamlphp/modules/core/dictionaries/cardinality.definition.json new file mode 100644 index 0000000000..b9059cb93a --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/modules/core/dictionaries/cardinality.definition.json @@ -0,0 +1,14 @@ +{ + "cardinality_header": { + "en": "Incorrect Attributes" + }, + "cardinality_text": { + "en": "One or more of the attributes supplied by your identity provider did not contain the expected number of values." + }, + "problematic_attributes": { + "en": "The problematic attribute(s) are:" + }, + "got_want": { + "en": "got %GOT% values, want %WANT%" + } +} diff --git a/vendor/simplesamlphp/simplesamlphp/modules/core/dictionaries/cardinality.translation.json b/vendor/simplesamlphp/simplesamlphp/modules/core/dictionaries/cardinality.translation.json new file mode 100644 index 0000000000..a0a31ded62 --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/modules/core/dictionaries/cardinality.translation.json @@ -0,0 +1,34 @@ +{ + "cardinality_header": { + "af": "Verkeerde Eienskappe", + "nl": "Niet de juiste attributen", + "es": "Atributos inválidos", + "no": "Ugyldige atributter", + "zu": "Izici Ezingalungile", + "xh": "Iimpawu Ezingachanekanga" + }, + "cardinality_text": { + "af": "Een of meer van die eienskappe wat deur u identiteits-verskaffer voorsien was, bevat nie die verwagte aantal waardes nie.", + "nl": "Één of meer door de Identity Provider geleverde attributen bevat niet het vereiste aantal attributen.", + "es": "Uno o más atributos proporcionados por su proveedor de identidad no contiene la cantidad de valores esperada.", + "no": "Én eller flere atributter levert av din identitetsleverandør har ikke så mange verdier som forventes.", + "zu": "Isici esisodwa noma ngaphezulu esinikezwe umhlinzeki wakho kamazisi asizange siqukathe inani lezinombolo ezilindelwe.", + "xh": "Uphawu olunye okanye olungakumbi olunikelwe ngumboonelei wesazisi sakho aluqulethanga inani lamaxabiso alindelekileyo." + }, + "problematic_attributes": { + "af": "Die problematiese eienskap(pe) is:", + "nl": "De onjuiste attributen zijn:", + "es": "Los atributos problemáticos son:", + "no": "De ugyldige atributter er:", + "zu": "Isici(izici) esiyinkinga sithi:", + "xh": "Iimpawu eziyingxaki zezi:" + }, + "got_want": { + "af": "%GOT% waarde ontvang, %WANT% nodig", + "nl": "%GOT% ontvangen waarden, %WANT% vereist", + "es": "contiene %GOT% valores, se esperaban %WANT%", + "no": "har %GOT% verdier, forventer %WANT%", + "zu": "uthole amanani angu-%GOT%, ufuna %WANT%", + "xh": "kukho amaxabiso e-%GOT%, sifuna %WANT%" + } +} diff --git a/vendor/simplesamlphp/simplesamlphp/modules/core/dictionaries/frontpage.definition.json b/vendor/simplesamlphp/simplesamlphp/modules/core/dictionaries/frontpage.definition.json index ee509f4b53..98efa68a1d 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/core/dictionaries/frontpage.definition.json +++ b/vendor/simplesamlphp/simplesamlphp/modules/core/dictionaries/frontpage.definition.json @@ -17,12 +17,6 @@ "checkphp": { "en": "Checking your PHP installation" }, - "about_header": { - "en": "About SimpleSAMLphp" - }, - "about_text": { - "en": "This SimpleSAMLphp thing is pretty cool, where can I read more about it? You can find more information about it at the <a href=\"https:\/\/simplesamlphp.org\/\">SimpleSAMLphp web page <\/a> over at <a href=\"http:\/\/uninett.no\">UNINETT<\/a>." - }, "required": { "en": "Required" }, @@ -41,6 +35,9 @@ "warnings": { "en": "Warnings" }, + "warnings_curlmissing": { + "en": "PHP cURL extension missing. Cannot check for SimpleSAMLphp updates." + }, "warnings_https": { "en": "<strong>You are not using HTTPS<\/strong> - encrypted communication with the user. HTTP works fine for test purposes, but in a production environment, you should use HTTPS. [ <a href=\"https:\/\/simplesamlphp.org\/docs\/stable\/simplesamlphp-maintenance\">Read more about SimpleSAMLphp maintenance<\/a> ]" }, @@ -113,6 +110,12 @@ "link_cleardiscochoices": { "en": "Delete my choices of IdP in the IdP discovery services" }, + "link_oauth": { + "en": "OAuth Consumer Registry" + }, + "link_metarefresh": { + "en": "Metarefresh: fetch metadata" + }, "welcome": { "en": "Welcome" }, @@ -134,6 +137,9 @@ "loggedin_as_admin": { "en": "You are logged in as administrator" }, + "logout": { + "en": "Logout" + }, "auth": { "en": "Authentication" }, diff --git a/vendor/simplesamlphp/simplesamlphp/modules/core/dictionaries/frontpage.translation.json b/vendor/simplesamlphp/simplesamlphp/modules/core/dictionaries/frontpage.translation.json index 767bf766fc..0cb5eed172 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/core/dictionaries/frontpage.translation.json +++ b/vendor/simplesamlphp/simplesamlphp/modules/core/dictionaries/frontpage.translation.json @@ -174,76 +174,6 @@ "ro": "Verificarea instal\u0103rii PHP", "el": "\u0388\u03bb\u03b5\u03b3\u03c7\u03bf\u03c2 \u03b5\u03b3\u03ba\u03b1\u03c4\u03ac\u03c3\u03c4\u03b1\u03c3\u03b7\u03c2 PHP" }, - "about_header": { - "no": "Om SimpleSAMLphp", - "nn": "Om SimpleSAMLphp", - "sv": "Om SimpleSAMLphp", - "es": "Sobre SimpleSAMLphp", - "fr": "\u00c0 propos de SimpleSAMLphp", - "de": "\u00dcber SimpleSAMLphp", - "nl": "Over SimpleSAMLphp", - "lb": "Iwwert SimpleSAMLphp", - "sl": "O SimpleSAMLphp", - "da": "Om SimpleSAMLphp", - "hr": "O programskom alatu SimpleSAMLphp", - "hu": "A SimpleSAMLphp-r\u00f3l b\u0151vebben", - "fi": "SimpleSAMLphp:st\u00e4", - "pt-br": "Sobre o SimpleSAMLphp", - "pt": "Sobre o SimpleSAMLphp", - "pl": "O SimpleSAMLphp", - "cs": "O aplikaci SimpleSAMLphp", - "eu": "SimpleSAMLphp-ari buruz", - "tr": "SimpleSAMLphp hakk\u0131nda", - "it": "A proposito di SimpleSAMLphp", - "lt": "Apie SimpleSAMLphp", - "ja": "SimpleSAMLphp \u306b\u3064\u3044\u3066", - "zh-tw": "\u6709\u95dc SimpleSAMLphp", - "ru": "\u041e SimpleSAMLphp", - "et": "Teave SimpleSAMLphp kohta", - "he": "\u05d0\u05d5\u05d3\u05d5\u05ea SimpleSAMLphp", - "zh": "\u5173\u4e8eSimpleSAMLphp", - "ar": "\u0639\u0646 SimpleSAMLphp", - "id": "Tentang SimpleSAMLphp", - "lv": "Par SimpleSAMLphp", - "sr": "O SimpleSAMLphp-u", - "ro": "Despre SimpleSAMLphp", - "el": "\u03a3\u03c7\u03b5\u03c4\u03b9\u03ba\u03ac \u03bc\u03b5 \u03c4\u03bf SimpleSAMLphp" - }, - "about_text": { - "no": "Yey! SimpleSAMLphp virker jammen kult, hvor kan jeg finne ut mer om det? Du kan lese mer om SimpleSAMLphp p\u00e5 <a href=\"http:\/\/rnd.feide.no\/simplesamlphp\">SimpleSAMLphp sin hjemmeside<\/a>.", - "nn": "Yey! SimpleSAMLphp er jammen kult, kvar finn eg ut meir? Du kan lesa meir om SimpleSAMLphp p\u00e5 <a href=\"http:\/\/rnd.feide.no\/simplesamlphp\">heimesida til SimpleSAMLphp<\/a>.", - "sv": "SimpleSAMLphp \u00e4r cool, var kan jag l\u00e4sa mer om det? Du kan hitta mer information om <a href=\"http:\/\/rnd.feide.no\/simplesamlphp\">SimpleSAMLphp p\u00e5 Feide RnD blogg<\/a> hos <a href=\"http:\/\/uninett.no\">UNINETT<\/a>.", - "es": "¡Eh! Esto de SimpleSAMLphp es interesante, ¿dónde puedo averiguar más? Puedes encontrar más información en la <a href=\"https:\/\/simplesamlphp.org\/\">página web de SimpleSAMLphp<\/a>, en <a href=\"http:\/\/uninett.no\">UNINETT<\/a>.", - "fr": "Ce logiciel SimpleSAMLphp est plut\u00f4t sympa, o\u00f9 puis-je en lire plus \u00e0 son sujet? Vous trouverez plus d'informations sur <a href=\"http:\/\/rnd.feide.no\/simplesamlphp\">SimpleSAMLphp sur le blog de la R&D de Feide<\/a> sur <a href=\"http:\/\/uninett.no\">UNINETT<\/a>.", - "de": "Hey, dieses SimpleSAMLphp ist eine ziemlich coole Sache, wo kann ich mehr dar\u00fcber lesen? Sie finden mehr Informationen \u00fcber <a href=\"http:\/\/rnd.feide.no\/simplesamlphp\">SimpleSAMLphp auf dem Feide RnD blog<\/a> auf <a href=\"http:\/\/uninett.no\">UNINETT<\/a>.", - "nl": "H\u00e9, dat SimpleSAMLphp dingetje is vet cool, waar kan ik er meer over vinden? Je kan meer informatie over <a href=\"http:\/\/rnd.feide.no\/simplesamlphp\">SimpleSAMLphp<\/a> vinden op de Feide RnD blog van <a href=\"http:\/\/uninett.no\">UNINETT<\/a>.", - "lb": "Desen SimpleSAMLphp system as nach ew\u00ebll d\u00ebcken Gas, wou kann ech m\u00e9i doriwwer gewuer gin? Mei Informatiounen iwer <a href=\"http:\/\/rnd.feide.no\/simplesamlphp\">SimpleSAMLphp at the Feide RnD blog<\/a> op <a href=\"http:\/\/uninett.no\">UNINETT<\/a>", - "sl": "Da! SimpleSAMLphp je zares kul! Kje si lahko preberem kaj ve\u010d o tem? Dodatne informacije se nahajajo na <a href=\"http:\/\/rnd.feide.no\/simplesamlphp\">SimpleSAMLphp Feide RnD blogu<\/a>.", - "da": "Yes, det er cool! Hvor kan jeg l\u00e6se mere om det? G\u00e5 til <a href=\"http:\/\/rnd.feide.no\/simplesamlphp\">SimpleSAMLphp's hjemmeside<\/a>", - "hr": "Vi\u0161e informacija o programskom alatu SimpleSAMLphp mo\u017eete prona\u0107i na <a href=\"http:\/\/rnd.feide.no\/simplesamlphp\">SimpleSAMLphp stranici Feide RnD bloga<\/a>.", - "hu": "Ez a SimpleSAMLphp-dolog nagyon hasznos, hol olvashatn\u00e9k t\u00f6bbet r\u00f3la? Tov\u00e1bbi inform\u00e1ci\u00f3kat a <a href=\"http:\/\/rnd.feide.no\/simplesamlphp\"> Feide RnD SimpleSAMLphp-r\u00f3l sz\u00f3l\u00f3 blogj\u00e1ban <\/a> tal\u00e1lhat a <a href=\"http:\/\/uninett.no\">UNINETT-en<\/a>.", - "fi": "T\u00e4\u00e4 simpleSAMPphp on aiga magee, mutta mist\u00e4 voin lukea enemm\u00e4n asiasta? L\u00f6yd\u00e4t enemm\u00e4n tietoa <a href=\"http:\/\/rnd.feide.no\/simplesamlphp\">SimpleSAMLphp blogista Feide RnD:ll\u00e4<\/a> <a href=\"http:\/\/uninett.no\">UNINETT<\/a>issa.", - "pt-br": "Este SimpleSAMLphp \u00e9 uma coisa muito legal, onde posso ler mais sobre isso? Voc\u00ea pode encontrar mais informa\u00e7\u00f5es sobre o <a href=\"http:\/\/rnd.feide.no\/simplesamlphp\">SimpleSAMLphp no blog de Feide RnD<\/a> durante a <a href=\"http:\/\/uninett.no\">UNINETT<\/a>.", - "pt": "Pode encontrar mais informa\u00e7\u00e3o sobre o <a href=\"http:\/\/rnd.feide.no\/simplesamlphp\">SimpleSAMLphp no blog da Feide RnD<\/a> em <a href=\"http:\/\/uninett.no\">UNINETT<\/a>.", - "pl": "Ten SimpleSAMLphp jest niez\u0142y, gdzie mog\u0119 poczyta\u0107 o tym? Mo\u017cesz znale\u017a\u0107 wi\u0119cej informacji o <a href=\"http:\/\/rnd.feide.no\/simplesamlphp\">SimpleSAMLphp na blogu Feide RnD<\/a> oraz na stronie <a href=\"http:\/\/uninett.no\">UNINETT<\/a>.", - "cs": "Tato vlastnost SimpleSAMLphp je velmi p\u011bkn\u00e1, kde se o n\u00ed mohu do\u010d\u00edst v\u00edce? Dal\u0161\u00ed informace o SimpleSAMLphp z\u00edsk\u00e1te <a href=\"http:\/\/rnd.feide.no\/simplesamlphp\">na blogu Feide RnD<\/a> na <a href=\"http:\/\/uninett.no\">UNINETT<\/a>.", - "tr": "Bu SimpleSAMLphp olduk\u00e7a iyiymi\u015f, daha fazla bilgiyi nereden okuyabilirim? <a href=\"http:\/\/uninett.no\">UNINETT<\/a> \u00fczerinde <a href=\"http:\/\/rnd.feide.no\/simplesamlphp\">Feide RnD blog'unda SimpleSAMLphp <\/a> hakk\u0131nda daha fazlas\u0131n\u0131 bulabilirsiniz.", - "it": "Questo SimpleSAMLphp è davvero un bel prodotto, dove trovo ulteriori informazioni a riguardo? Puoi trovare maggiori informazioni su <a href=\"http:\/\/rnd.feide.no\/simplesamlphp\">SimpleSAMLphp nel Blog di Feide RnD<\/a> oltre che <a href=\"http:\/\/uninett.no\">UNINETT<\/a>.", - "lt": "\u0160is SimpleSAMLphp dalykas yra gana puikus, kur gal\u0117\u010diau daugiau apie j\u012f paskaityti? Daugiau informacijos apie <a href=\"http:\/\/rnd.feide.no\/simplesamlphp\">SimpleSAMLphp galite rasti Feide RnD blog'e<\/a> bei <a href=\"http:\/\/uninett.no\">UNINETT<\/a> svetain\u0117je.", - "ja": "\u3053\u306e SimpleSAMLphp \u306f\u7d20\u6674\u3089\u3057\u3044\u3082\u306e\u3067\u3059\u3002\u3053\u308c\u4ee5\u4e0a\u306e\u8aac\u660e\u304c\u5728\u308a\u307e\u3059\u304b\uff1f\u3053\u3061\u3089\u306e\u30ea\u30f3\u30af\u3067\u66f4\u306a\u308b\u60c5\u5831\u3092\u898b\u3064\u3051\u308b\u3053\u3068\u304c\u51fa\u6765\u307e\u3059 <a href=\"http:\/\/rnd.feide.no\/simplesamlphp\">SimpleSAMLphp at the Feide RnD blog<\/a>", - "zh-tw": "\u89ba\u5f97 SimpleSAMLphp \u9084\u883b\u9177\u7684\u561b\uff0c\u5728\u54ea\u53ef\u4ee5\u627e\u5230\u66f4\u591a\u76f8\u95dc\u8cc7\u8a0a\u5462\uff1f\u4f60\u53ef\u4ee5\u5728\u4e0b\u5217\u7db2\u5740\u627e\u5230\u66f4\u591a\u76f8\u95dc\u8cc7\u8a0a\uff0c\u65bc <a href=\"http:\/\/uninett.no\">UNINETT<\/a> \u7684 <a href=\"https:\/\/simplesamlphp.org\/\">SimpleSAMLphp<\/a>", - "ru": "SimpleSAMLphp - \u0432\u0435\u0449\u044c \u043a\u043b\u0430\u0441\u0441\u043d\u0430\u044f, \u0433\u0434\u0435 \u044f \u043c\u043e\u0433\u0443 \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435 \u043e\u0431 \u044d\u0442\u043e\u043c? \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043d\u0430\u0439\u0442\u0438 \u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e <a href=\"http:\/\/rnd.feide.no\/simplesamlphp\">SimpleSAMLphp \u0432 \u0431\u043b\u043e\u0433\u0435 Feide RnD<\/a> \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0430 <a href=\"http:\/\/uninett.no\">UNINETT<\/a>.", - "et": "See SimpleSAMLphp on p\u00e4ris \u00e4ge! Kust ma saaks selle kohta t\u00e4psemalt lugeda? Rohkem infot leiad <a href=\"http:\/\/rnd.feide.no\/simplesamlphp\">SimpleSAMLphp blogist<\/a>, mis asub <a href=\"http:\/\/uninett.no\">UNINETT<\/a>-is.", - "he": "\u05d4-SimpleSAMLphp \u05d4\u05d6\u05d4 \u05d4\u05d5\u05d0 \u05de\u05d4 \u05d6\u05d4 \u05de\u05d2\u05e0\u05d9\u05d1, \u05d0\u05d9\u05dd\u05d4 \u05d0\u05e0\u05d9 \u05d9\u05db\u05d5\u05dc \u05dc\u05e7\u05e8\u05d5\u05d0 \u05d9\u05d5\u05ea\u05e8 \u05e2\u05dc\u05d9\u05d5?\u05d0\u05ea\u05d4 \u05d9\u05db\u05d5\u05dc \u05dc\u05de\u05e6\u05d5\u05d0 \u05de\u05d9\u05d3\u05e2 \u05e0\u05d5\u05e1\u05e3 \u05d1- <a href=\"http:\/\/rnd.feide.no\/simplesamlphp\"> SimpleSAMLphp \u05d1 Feide \u05d1\u05d1\u05dc\u05d5\u05d2 \u05d4\u05e4\u05d9\u05ea\u05d5\u05d7 \u05e9\u05dc \u05e9\u05e0\u05de\u05e6\u05d0 \u05d1- <a href=\"http:\/\/uninett.no\">UNINETT<\/a>. ", - "zh": "\u662f\u4e0d\u662f\u89c9\u5f97SimpleSAMLphp\u5f88\u9177\uff1f\u6211\u5728\u54ea\u91cc\u80fd\u627e\u5230\u66f4\u591a\u8d44\u6599\u5462\uff1f\u4f60\u53ef\u4ee5\u5728\u4e0b\u5217\u7f51\u5740\u627e\u5230\u66f4\u591a\u4fe1\u606f\uff1a <a href=\"http:\/\/uninett.no\">UNINETT<\/a> \u7684 <a href=\"http:\/\/rnd.feide.no\/simplesamlphp\">SimpleSAMLphp at the Feide RnD \u5f00\u53d1\u8005\u535a\u5ba2<\/a>", - "ar": "\u0644\u0644\u0645\u0632\u064a\u062f \u0639\u0646 SimpleSAMLphp \u0627\u0630\u0647\u0628 \u0627\u0644\u064a<a href=\"http:\/\/rnd.feide.no\/simplesamlphp\">SimpleSAMLphp \u0628\u0645\u062f\u0648\u0646\u0629 Feide RnD <\/a> over at <a href=\"http:\/\/uninett.no\">UNINETT<\/a>", - "lv": "SimpleSAMLphp ir baigi for\u0161s, kur par to var palas\u012bt vair\u0101k? Vair\u0101k inform\u0101cijas ir <a href=\"http:\/\/rnd.feide.no\/simplesamlphp\">SimpleSAMLphp Feide RnD blog\u0101<\/a> pie <a href=\"http:\/\/uninett.no\">UNINETT<\/a>.", - "id": "SimpleSAMLphp sangat menarik, dimana Saya bisa membaca lebih jauh tentang hal ini ? Anda dapat mencari informasi lebih jauh tentang <a href=\"http:\/\/rnd.feide.no\/simplesamlphp\">SimpleSAMLphp pada blog Feide RnD<\/a> ke arah <a href=\"http:\/\/uninett.no\">UNINETT<\/a>.", - "sr": "SimpleSAMLphp je veoma kul, gde mogu da pro\u010ditam vi\u0161e o njemu? Vi\u0161e informacija o SimpleSAMLphp-u mo\u017eete prona\u0107i na <a href=\"http:\/\/rnd.feide.no\/simplesamlphp\">SimpleSAMLphp stranici Feide RnD bloga<\/a>.", - "ro": "Acest SimpleSAMLphp este interesant, unde pot g\u0103si mai multe informa\u021bii ? Pute\u021bi g\u0103si mai multe informa\u021bii despre <a href=\"http:\/\/rnd.feide.no\/simplesamlphp\"> la blog-ul Feide despre SimpleSAMLphp<\/a> de la <a href=\"http:\/\/uninett.no\">UNINETT<\/a>.", - "eu": "SimpleSAMLphp-en kontu hau interesgarria da benetan, non bila nezake informazio gehiago honen inguruan? <a href=\"http:\/\/rnd.feide.no\/simplesamlphp\">SimpleSAMLphp Feideren I+G blogeko <a href=\"http:\/\/uninett.no\">UNINETT<\/a>n.", - "el": "\u03a4\u03bf SimpleSAMLphp \u03b5\u03af\u03bd\u03b1\u03b9 \u03c0\u03bf\u03bb\u03cd \u03b5\u03bd\u03b4\u03b9\u03b1\u03c6\u03ad\u03c1\u03bf\u03bd, \u03c0\u03bf\u03cd \u03bc\u03c0\u03bf\u03c1\u03ce \u03bd\u03b1 \u03bc\u03ac\u03b8\u03c9 \u03c0\u03b5\u03c1\u03b9\u03c3\u03c3\u03cc\u03c4\u03b5\u03c1\u03b1 \u03b3\u03b9\u0027 \u03b1\u03c5\u03c4\u03cc\u003b \u039c\u03c0\u03bf\u03c1\u03b5\u03af\u03c4\u03b5 \u03bd\u03b1 \u03b2\u03c1\u03b5\u03af\u03c4\u03b5 \u03c0\u03b5\u03c1\u03b9\u03c3\u03c3\u03cc\u03c4\u03b5\u03c1\u03b5\u03c2 \u03c0\u03bb\u03b7\u03c1\u03bf\u03c6\u03bf\u03c1\u03af\u03b5\u03c2 \u03c3\u03c4\u03bf\u03bd <a href=\"http:\/\/rnd.feide.no\/simplesamlphp\">\u03b9\u03c3\u03c4\u03cc\u03c4\u03bf\u03c0\u03bf \u03c4\u03bf\u03c5 SimpleSAMLphp<\/a> \u03c0\u03bf\u03c5 \u03c6\u03b9\u03bb\u03bf\u03be\u03b5\u03bd\u03b5\u03af\u03c4\u03b1\u03b9 \u03b1\u03c0\u03cc \u03c4\u03bf <a href=\"http:\/\/uninett.no\">UNINETT<\/a>." - }, "required": { "no": "P\u00e5krevd", "nn": "Naudsynt", @@ -455,39 +385,39 @@ "el": "\u03a0\u03c1\u03bf\u03b5\u03b9\u03b4\u03bf\u03c0\u03bf\u03b9\u03ae\u03c3\u03b5\u03b9\u03c2" }, "warnings_https": { - "no": "<strong>Du bruker ikke HTTPS<\/strong> - kryptert kommunikasjon med brukeren. HTTP fungerer utmerket til testform\u00e5l, men i et produksjonsmilj\u00f8 anbefales sterkt \u00e5 skru p\u00e5 sikker kommunikasjon med HTTPS. [ <a href=\"http:\/\/rnd.feide.no\/content\/simplesamlphp-maintenance-and-configuration\">Les mer i dokumentet: SimpleSAMLphp maintenance<\/a> ]", - "nn": "<strong>Du bruker ikkje HTTPS<\/strong> - kryptert kommunikasjon med brukaren. Du kan bruka SimpleSAMLphp uten HTTPS til testform\u00e5l, men dersom du skal bruka SimpleSAMLphp i eit produksjonsmilj\u00f8, vil vi sterkt tilr\u00e5 \u00e5 skru p\u00e5 sikker kommunikasjon med HTTPS. [ Les meir i dokumentet: <a href=\"http:\/\/rnd.feide.no\/content\/simplesamlphp-maintenance-and-configuration\">SimpleSAMLphp maintenance<\/a> ]", - "sv": "<strong>Du anv\u00e4nder inte HTTPS<\/strong> - krypterad kommunikation med anv\u00e4ndaren. HTTP fungerar bra under test men i produktion ska du anv\u00e4nda HTTPS. [ <a href=\"http:\/\/rnd.feide.no\/content\/simplesamlphp-maintenance-and-configuration\">L\u00e4s mer i dokumentet SimpleSAMLphp maintenance<\/a> ]", + "no": "<strong>Du bruker ikke HTTPS<\/strong> - kryptert kommunikasjon med brukeren. HTTP fungerer utmerket til testform\u00e5l, men i et produksjonsmilj\u00f8 anbefales sterkt \u00e5 skru p\u00e5 sikker kommunikasjon med HTTPS. [ <a href=\"https:\/\/simplesamlphp.org\/docs\/stable\/simplesamlphp-maintenance\">Les mer i dokumentet: SimpleSAMLphp maintenance<\/a> ]", + "nn": "<strong>Du bruker ikkje HTTPS<\/strong> - kryptert kommunikasjon med brukaren. Du kan bruka SimpleSAMLphp uten HTTPS til testform\u00e5l, men dersom du skal bruka SimpleSAMLphp i eit produksjonsmilj\u00f8, vil vi sterkt tilr\u00e5 \u00e5 skru p\u00e5 sikker kommunikasjon med HTTPS. [ Les meir i dokumentet: <a href=\"https:\/\/simplesamlphp.org\/docs\/stable\/simplesamlphp-maintenance\">SimpleSAMLphp maintenance<\/a> ]", + "sv": "<strong>Du anv\u00e4nder inte HTTPS<\/strong> - krypterad kommunikation med anv\u00e4ndaren. HTTP fungerar bra under test men i produktion ska du anv\u00e4nda HTTPS. [ <a href=\"https:\/\/simplesamlphp.org\/docs\/stable\/simplesamlphp-maintenance\">L\u00e4s mer i dokumentet SimpleSAMLphp maintenance<\/a> ]", "es": "<strong>No est\u00e1 usando HTTPS<\/strong> - comunicaciones cifradas con el usuario. HTTP funciona bien en entornos de evaluaci\u00f3n, pero si va a emplearlo en producci\u00f3n, deber\u00eda emplear HTTPS. [ <a href=\"https:\/\/simplesamlphp.org\/docs\/stable\/simplesamlphp-maintenance\">Lea m\u00e1s acerca del mantenimiento de SimpleSAMLphp <\/a> ]", - "fr": "<strong>Vous n'utilisez pas HTTPS<\/strong> - communications chiffr\u00e9es avec l'utilisateur. Utiliser SimpleSAMLphp marchera parfaitement avec HTTP pour des tests, mais si vous voulez l'utiliser dans un environnement de production, vous devriez utiliser HTTPS. [ <a href=\"http:\/\/rnd.feide.no\/content\/simplesamlphp-maintenance-and-configuration\">En lire plus sur la maintenance de SimpleSAMLphp<\/a> ]", - "de": "<strong>Sie benutzen keine HTTPS<\/strong> - verschl\u00fcsselte Kommunikation mit dem Nutzer. SimpleSAMLphp funktioniert zum Testen auch mit HTTP problemlos, aber in einer Produktionsumgebung sollten Sie HTTPS benutzen. [ <a href=\"http:\/\/rnd.feide.no\/content\/simplesamlphp-maintenance-and-configuration\">Lesen sie mehr \u00fcber die Verwaltung von SimpleSAMLphp<\/a> ]", - "nl": "<strong>Je gebruikt geen HTTPS<\/strong> - versleutelde communicatie met de gebruiker. SimpleSAMLphp werkt prima op HTTP voor testdoeleinden, maar als je SimpleSAMLphp in een productieomgeving gaat gebruiken, zou je dat moeten doen over HTTPS. [ <a href=\"http:\/\/rnd.feide.no\/content\/simplesamlphp-maintenance-and-configuration\">lees meer over SimpleSAMLphp-onderhoud<\/a> ]", - "lb": "<strong>Der benotzt ken HTTPS<\/strong> - verschl\u00ebsselt Kommunikatioun mat dem Benotzer. SimpleSAMLphp funktion\u00e9iert einwandfr\u00e4i mat HTTP fir Testzw\u00e9ecker mais an engem produktiven Emfeld sollt et besser mat HTTPS lafen. [ <a href=\"http:\/\/rnd.feide.no\/content\/simplesamlphp-maintenance-and-configuration\">Liest m\u00e9i iwert Maintenance vun SimpleSAMLphp<\/a> ]", - "sl": "<strong>Ne uporabljate HTTPS<\/strong>-\u0161ifrirane komunikacije. SimpleSAMLphp deluje brez te\u017eav na HTTP, vendar le za testne namene, za uporabo SimpleSAMLphp v produkcijskem okolju uporabite HTTPS. [ <a href=\"http:\/\/rnd.feide.no\/content\/simplesamlphp-maintenance-and-configuration\">Preberite ve\u010d o SimpleSAMLphp vzdr\u017eevanju<\/a> ]", - "da": "<strong>Du benytter ikke HTTPS<\/strong>-krypteret kommunikation med brugeren. SimpleSAMLphp vil fungere uden problemer med HTTP alene, men hvis du anvender systemet i produktionssystemer, anbefales det st\u00e6rkt at benytte sikker kommunikation i form af HTTPS. [ <a href=\"http:\/\/rnd.feide.no\/content\/simplesamlphp-maintenance-and-configuration\">l\u00e6s mere i dokumentet: SimpleSAMLphp maintenance<\/a> ] ", - "hr": "<strong>Ne koristite HTTPS<\/strong> - kriptiranu komunikaciju s korisnikom. HTTP se mo\u017ee koristiti za potrebe testiranja, ali u produkcijskom okru\u017eenju trebali biste koristiti HTTPS. [ <a href=\"http:\/\/rnd.feide.no\/content\/simplesamlphp-maintenance-and-configuration\">Pro\u010ditajte vi\u0161e o SimpleSAMLphp postavkama<\/a> ]", - "hu": "<strong>Nem HTTPS protokollt haszn\u00e1l<\/strong> - nem titkos\u00edtott a kommunik\u00e1ci\u00f3! HTTP j\u00f3 megold\u00e1s lehet teszt rendszerek eset\u00e9ben, de az \u00e9les rendszerben lehet\u0151s\u00e9g szerint haszn\u00e1ljon HTTPS-t! [ <a href=\"http:\/\/rnd.feide.no\/content\/simplesamlphp-maintenance-and-configuration\">T\u00f6bbet olvashat a SimpleSAMLphp be\u00e1ll\u00edt\u00e1s\u00e1r\u00f3l<\/a> ]", - "fi": "<strong>Et k\u00e4yt\u00e4 HTTPS<\/strong> - vahvaa yhteyst\u00e4 k\u00e4ytt\u00e4j\u00e4\u00e4n. HTTP-protokolla on sopiva testeihin, mutta tuotantoj\u00e4rjestelm\u00e4ss\u00e4 sinun tulee k\u00e4ytt\u00e4\u00e4 HTTPS:\u00e4\u00e4. [ <a href=\"http:\/\/rnd.feide.no\/content\/simplesamlphp-maintenance-and-configuration\">Lue SimpleSAMLphp yll\u00e4pidosta (eng)<\/a> ]", - "pt-br": "<strong>Voc\u00ea n\u00e3o est\u00e1 utilizando HTTPS<\/strong> - comunica\u00e7\u00e3o encriptada com o usu\u00e1rio. HTTP funciona bem para testes, mas voc\u00ea deve utilizar HTTPS para produ\u00e7\u00e3o. [ <a href=\"http:\/\/rnd.feide.no\/content\/simplesamlphp-maintenance-and-configuration\">Leia mais sobre manuten\u00e7\u00e3o do SimpleSAMLphp<\/a> ]", - "pt": "<strong>N\u00e3o est\u00e1 a ser usado HTTPS<\/strong> - comunica\u00e7\u00e3o cifrada com o utilizador. Para ambientes de teste, liga\u00e7\u00f5es HTTP s\u00e3o suficientes, mas num ambiente de produ\u00e7\u00e3o deve ser usado HTTPS. [ <a href=\"http:\/\/rnd.feide.no\/content\/simplesamlphp-maintenance-and-configuration\">Ler mais sobre manuten\u00e7\u00e3o do SimpleSAMLphp<\/a> ]", - "pl": "<strong>Nie u\u017cywasz HTTPS<\/strong> - szyfrowana komunikacja z u\u017cytkownikiem. HTTP jest OK dla test\u00f3w, ale na produkcji powiniene\u015b u\u017cywa\u0107 tylko HTTPS. [ <a href=\"http:\/\/rnd.feide.no\/content\/simplesamlphp-maintenance-and-configuration\">Przeczytaj wi\u0119cej o zarz\u0105dzaniu SimpleSAMLphp<\/a> ]", - "cs": "<strong>Nepou\u017e\u00edv\u00e1te HTTPS<\/strong> - \u0161ivrovanou komunikaci s u\u017eivatelem. HTTP je vhodn\u00e9 jen k testovac\u00edm \u00fa\u010del\u016fm, pro produk\u010dn\u00ed \u00fa\u010dely pou\u017eijte HTTPS. [ <a href=\"http:\/\/rnd.feide.no\/content\/simplesamlphp-maintenance-and-configuration\">\u010ctete v\u00edce o \u00fadr\u017eb\u011b SimpleSAMLphp<\/a> ]", - "tr": "Kullan\u0131c\u0131yla \u015fifreli ileti\u015fim -<strong>HTTPS kullanm\u0131yorsunuz<\/strong>. HTTP test ama\u00e7l\u0131 olarak kullan\u0131labilir, ancak \u00fcretim ortam\u0131nda, HTTPS kullanmal\u0131s\u0131n\u0131z. [ <a href=\"http:\/\/rnd.feide.no\/content\/simplesamlphp-maintenance-and-configuration\">SimpleSAMLphp bak\u0131m\u0131 hakk\u0131nda daha fazlas\u0131n\u0131 okuyun<\/a> ]", - "it": "<strong>Non stai usando HTTPS<\/strong> - comunicazione cifrata con l'utente. HTTP può funzionare per i test, ma in un ambiente di produzione si dovrebbe usare HTTPS. [ <a href=\"http:\/\/rnd.feide.no\/content\/simplesamlphp-maintenance-and-configuration\">Maggiori informazioni sulla manutenzione di SimpleSAMLphp<\/a> ]", - "lt": "<strong>J\u016bs nenaudojate HTTPS<\/strong> - \u0161ifruotos komunikacijos su vartotoju. HTTP puikiai tinka testavimo reikm\u0117ms, ta\u010diau realioje aplinkoje tur\u0117tum\u0117te naudoti HTTPS. [ <a href=\"http:\/\/rnd.feide.no\/content\/simplesamlphp-maintenance-and-configuration\">Skaityti daugiau apie SimpleSAMLphp prie\u017ei\u016br\u0105<\/a> ]", - "ja": "<strong>\u3042\u306a\u305f\u306fHTTPS(\u6697\u53f7\u5316\u901a\u4fe1)\u3092\u884c\u3063\u3066\u3044\u307e\u305b\u3093\u3002<\/strong>HTTP\u306f\u30c6\u30b9\u30c8\u74b0\u5883\u3067\u3042\u308c\u3070\u6b63\u5e38\u306b\u52d5\u4f5c\u3057\u307e\u3059\u3001\u3057\u304b\u3057\u88fd\u54c1\u74b0\u5883\u3067\u306fHTTPS\u3092\u4f7f\u7528\u3059\u308b\u3079\u304d\u3067\u3059\u3002[ <a href=\"http:\/\/rnd.feide.no\/content\/simplesamlphp-maintenance-and-configuration\">\u8a73\u3057\u304f\u306f SimpleSAMLphp \u30e1\u30f3\u30c6\u30ca\u30f3\u30b9\u60c5\u5831\u3092\u8aad\u3093\u3067\u304f\u3060\u3055\u3044\u3002<\/a> ]", + "fr": "<strong>Vous n'utilisez pas HTTPS<\/strong> - communications chiffr\u00e9es avec l'utilisateur. Utiliser SimpleSAMLphp marchera parfaitement avec HTTP pour des tests, mais si vous voulez l'utiliser dans un environnement de production, vous devriez utiliser HTTPS. [ <a href=\"https:\/\/simplesamlphp.org\/docs\/stable\/simplesamlphp-maintenance\">En lire plus sur la maintenance de SimpleSAMLphp<\/a> ]", + "de": "<strong>Sie benutzen keine HTTPS<\/strong> - verschl\u00fcsselte Kommunikation mit dem Nutzer. SimpleSAMLphp funktioniert zum Testen auch mit HTTP problemlos, aber in einer Produktionsumgebung sollten Sie HTTPS benutzen. [ <a href=\"https:\/\/simplesamlphp.org\/docs\/stable\/simplesamlphp-maintenance\">Lesen sie mehr \u00fcber die Verwaltung von SimpleSAMLphp<\/a> ]", + "nl": "<strong>Je gebruikt geen HTTPS<\/strong> - versleutelde communicatie met de gebruiker. SimpleSAMLphp werkt prima op HTTP voor testdoeleinden, maar als je SimpleSAMLphp in een productieomgeving gaat gebruiken, zou je dat moeten doen over HTTPS. [ <a href=\"https:\/\/simplesamlphp.org\/docs\/stable\/simplesamlphp-maintenance\">lees meer over SimpleSAMLphp-onderhoud<\/a> ]", + "lb": "<strong>Der benotzt ken HTTPS<\/strong> - verschl\u00ebsselt Kommunikatioun mat dem Benotzer. SimpleSAMLphp funktion\u00e9iert einwandfr\u00e4i mat HTTP fir Testzw\u00e9ecker mais an engem produktiven Emfeld sollt et besser mat HTTPS lafen. [ <a href=\"https:\/\/simplesamlphp.org\/docs\/stable\/simplesamlphp-maintenance\">Liest m\u00e9i iwert Maintenance vun SimpleSAMLphp<\/a> ]", + "sl": "<strong>Ne uporabljate HTTPS<\/strong>-\u0161ifrirane komunikacije. SimpleSAMLphp deluje brez te\u017eav na HTTP, vendar le za testne namene, za uporabo SimpleSAMLphp v produkcijskem okolju uporabite HTTPS. [ <a href=\"https:\/\/simplesamlphp.org\/docs\/stable\/simplesamlphp-maintenance\">Preberite ve\u010d o SimpleSAMLphp vzdr\u017eevanju<\/a> ]", + "da": "<strong>Du benytter ikke HTTPS<\/strong>-krypteret kommunikation med brugeren. SimpleSAMLphp vil fungere uden problemer med HTTP alene, men hvis du anvender systemet i produktionssystemer, anbefales det st\u00e6rkt at benytte sikker kommunikation i form af HTTPS. [ <a href=\"https:\/\/simplesamlphp.org\/docs\/stable\/simplesamlphp-maintenance\">l\u00e6s mere i dokumentet: SimpleSAMLphp maintenance<\/a> ] ", + "hr": "<strong>Ne koristite HTTPS<\/strong> - kriptiranu komunikaciju s korisnikom. HTTP se mo\u017ee koristiti za potrebe testiranja, ali u produkcijskom okru\u017eenju trebali biste koristiti HTTPS. [ <a href=\"https:\/\/simplesamlphp.org\/docs\/stable\/simplesamlphp-maintenance\">Pro\u010ditajte vi\u0161e o SimpleSAMLphp postavkama<\/a> ]", + "hu": "<strong>Nem HTTPS protokollt haszn\u00e1l<\/strong> - nem titkos\u00edtott a kommunik\u00e1ci\u00f3! HTTP j\u00f3 megold\u00e1s lehet teszt rendszerek eset\u00e9ben, de az \u00e9les rendszerben lehet\u0151s\u00e9g szerint haszn\u00e1ljon HTTPS-t! [ <a href=\"https:\/\/simplesamlphp.org\/docs\/stable\/simplesamlphp-maintenance\">T\u00f6bbet olvashat a SimpleSAMLphp be\u00e1ll\u00edt\u00e1s\u00e1r\u00f3l<\/a> ]", + "fi": "<strong>Et k\u00e4yt\u00e4 HTTPS<\/strong> - vahvaa yhteyst\u00e4 k\u00e4ytt\u00e4j\u00e4\u00e4n. HTTP-protokolla on sopiva testeihin, mutta tuotantoj\u00e4rjestelm\u00e4ss\u00e4 sinun tulee k\u00e4ytt\u00e4\u00e4 HTTPS:\u00e4\u00e4. [ <a href=\"https:\/\/simplesamlphp.org\/docs\/stable\/simplesamlphp-maintenance\">Lue SimpleSAMLphp yll\u00e4pidosta (eng)<\/a> ]", + "pt-br": "<strong>Voc\u00ea n\u00e3o est\u00e1 utilizando HTTPS<\/strong> - comunica\u00e7\u00e3o encriptada com o usu\u00e1rio. HTTP funciona bem para testes, mas voc\u00ea deve utilizar HTTPS para produ\u00e7\u00e3o. [ <a href=\"https:\/\/simplesamlphp.org\/docs\/stable\/simplesamlphp-maintenance\">Leia mais sobre manuten\u00e7\u00e3o do SimpleSAMLphp<\/a> ]", + "pt": "<strong>N\u00e3o est\u00e1 a ser usado HTTPS<\/strong> - comunica\u00e7\u00e3o cifrada com o utilizador. Para ambientes de teste, liga\u00e7\u00f5es HTTP s\u00e3o suficientes, mas num ambiente de produ\u00e7\u00e3o deve ser usado HTTPS. [ <a href=\"https:\/\/simplesamlphp.org\/docs\/stable\/simplesamlphp-maintenance\">Ler mais sobre manuten\u00e7\u00e3o do SimpleSAMLphp<\/a> ]", + "pl": "<strong>Nie u\u017cywasz HTTPS<\/strong> - szyfrowana komunikacja z u\u017cytkownikiem. HTTP jest OK dla test\u00f3w, ale na produkcji powiniene\u015b u\u017cywa\u0107 tylko HTTPS. [ <a href=\"https:\/\/simplesamlphp.org\/docs\/stable\/simplesamlphp-maintenance\">Przeczytaj wi\u0119cej o zarz\u0105dzaniu SimpleSAMLphp<\/a> ]", + "cs": "<strong>Nepou\u017e\u00edv\u00e1te HTTPS<\/strong> - \u0161ivrovanou komunikaci s u\u017eivatelem. HTTP je vhodn\u00e9 jen k testovac\u00edm \u00fa\u010del\u016fm, pro produk\u010dn\u00ed \u00fa\u010dely pou\u017eijte HTTPS. [ <a href=\"https:\/\/simplesamlphp.org\/docs\/stable\/simplesamlphp-maintenance\">\u010ctete v\u00edce o \u00fadr\u017eb\u011b SimpleSAMLphp<\/a> ]", + "tr": "Kullan\u0131c\u0131yla \u015fifreli ileti\u015fim -<strong>HTTPS kullanm\u0131yorsunuz<\/strong>. HTTP test ama\u00e7l\u0131 olarak kullan\u0131labilir, ancak \u00fcretim ortam\u0131nda, HTTPS kullanmal\u0131s\u0131n\u0131z. [ <a href=\"https:\/\/simplesamlphp.org\/docs\/stable\/simplesamlphp-maintenance\">SimpleSAMLphp bak\u0131m\u0131 hakk\u0131nda daha fazlas\u0131n\u0131 okuyun<\/a> ]", + "it": "<strong>Non stai usando HTTPS<\/strong> - comunicazione cifrata con l'utente. HTTP può funzionare per i test, ma in un ambiente di produzione si dovrebbe usare HTTPS. [ <a href=\"https:\/\/simplesamlphp.org\/docs\/stable\/simplesamlphp-maintenance\">Maggiori informazioni sulla manutenzione di SimpleSAMLphp<\/a> ]", + "lt": "<strong>J\u016bs nenaudojate HTTPS<\/strong> - \u0161ifruotos komunikacijos su vartotoju. HTTP puikiai tinka testavimo reikm\u0117ms, ta\u010diau realioje aplinkoje tur\u0117tum\u0117te naudoti HTTPS. [ <a href=\"https:\/\/simplesamlphp.org\/docs\/stable\/simplesamlphp-maintenance\">Skaityti daugiau apie SimpleSAMLphp prie\u017ei\u016br\u0105<\/a> ]", + "ja": "<strong>\u3042\u306a\u305f\u306fHTTPS(\u6697\u53f7\u5316\u901a\u4fe1)\u3092\u884c\u3063\u3066\u3044\u307e\u305b\u3093\u3002<\/strong>HTTP\u306f\u30c6\u30b9\u30c8\u74b0\u5883\u3067\u3042\u308c\u3070\u6b63\u5e38\u306b\u52d5\u4f5c\u3057\u307e\u3059\u3001\u3057\u304b\u3057\u88fd\u54c1\u74b0\u5883\u3067\u306fHTTPS\u3092\u4f7f\u7528\u3059\u308b\u3079\u304d\u3067\u3059\u3002[ <a href=\"https:\/\/simplesamlphp.org\/docs\/stable\/simplesamlphp-maintenance\">\u8a73\u3057\u304f\u306f SimpleSAMLphp \u30e1\u30f3\u30c6\u30ca\u30f3\u30b9\u60c5\u5831\u3092\u8aad\u3093\u3067\u304f\u3060\u3055\u3044\u3002<\/a> ]", "zh-tw": "<strong>\u60a8\u672a\u4f7f\u7528 HTTPS <\/strong> \u5c0d\u50b3\u8f38\u904e\u7a0b\u9032\u884c\u52a0\u5bc6\u901a\u8a0a\u3002HTTP \u53ef\u4ee5\u6b63\u5e38\u7684\u904b\u4f5c\u65bc\u6e2c\u8a66\u74b0\u5883\u3002\u4f46\u5728\u6b63\u5f0f\u74b0\u5883\u88e1\uff0c\u60a8\u61c9\u8a72\u8981\u4f7f\u7528 HTTPS\u3002[ <a href=\"https:\/\/simplesamlphp.org\/docs\/stable\/simplesamlphp-maintenance\">\u95b1\u8b80\u66f4\u591a\u6709\u95dc\u65bc SimpleSAMLphp \u7684\u7dad\u8b77\u65b9\u5f0f<\/a> ]", - "ru": "<strong>\u0412\u044b \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435 HTTPS<\/strong> - \u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0435 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u0441 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c. HTTP \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0445\u043e\u0440\u043e\u0448\u043e \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0445 \u0446\u0435\u043b\u0435\u0439, \u043d\u043e \u0432 \u044d\u043a\u043f\u043b\u0443\u0430\u0442\u0430\u0446\u0438\u0438 \u0432\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c HTTPS. [ <a href=\"http:\/\/rnd.feide.no\/content\/simplesamlphp-maintenance-and-configuration\">\u0423\u0437\u043d\u0430\u0439\u0442\u0435 \u0431\u043e\u043b\u044c\u0448\u0435 \u043e\u0431 \u043e\u0431\u0441\u043b\u0443\u0436\u0438\u0432\u0430\u043d\u0438\u0438 SimpleSAMLphp<\/a> ]", - "et": "<strong>Sa ei kasuta andmete vahetamiseks HTTPS kr\u00fcpteeritud sidet<\/strong>. HTTP sobib testimiseks h\u00e4sti, kuid toodangus peaksid kindlasti HTTPS-i kasutama. [ <a href=\"http:\/\/rnd.feide.no\/content\/simplesamlphp-maintenance-and-configuration\">Loe t\u00e4psemalt SimpleSAMLphp hooldamisest<\/a> ]", - "he": "<strong>\u05d0\u05ea\u05d4 \u05dc\u05d0 \u05de\u05e9\u05ea\u05de\u05e9 \u05d1- HTTPS <\/strong> - \u05d4\u05ea\u05e7\u05e9\u05e8\u05d5\u05ea \u05de\u05d5\u05e6\u05e4\u05e0\u05ea \u05e2\u05dd \u05d4\u05de\u05e9\u05ea\u05de\u05e9. HTTP \u05e2\u05d5\u05d1\u05d3 \u05d1\u05e1\u05d3\u05e8 \u05dc\u05de\u05d8\u05e8\u05d5\u05ea \u05d1\u05d3\u05d9\u05e7\u05d4, \u05d0\u05d5\u05dc\u05dd \u05dc\u05de\u05e2\u05e8\u05db\u05d5\u05ea \u05d0\u05de\u05d9\u05ea\u05d9\u05d5\u05ea, \u05db\u05d3\u05d9 \u05dc\u05d4\u05e9\u05ea\u05de\u05e9 \u05d4 HTTPS. [ <a href=\"http:\/\/rnd.feide.no\/content\/simplesamlphp-maintenance-and-configuration\"> \u05e7\u05e8\u05d0 \u05e2\u05d5\u05d3 \u05e2\u05dc \u05ea\u05d7\u05d6\u05d5\u05e7 SimpleSAMLphp <\/a> ]", - "zh": "<strong>\u4f60\u6ca1\u6709\u4f7f\u7528HTTPS<\/strong> - \u548c\u7528\u6237\u52a0\u5bc6\u7684\u901a\u4fe1\u3002HTTP\u5728\u6d4b\u8bd5\u76ee\u7684\u4e0b\u5f88\u597d,\u4f46\u751f\u4ea7\u73af\u5883\u8bf7\u4f7f\u7528HTTPS. [ <a href=\"http:\/\/rnd.feide.no\/content\/simplesamlphp-maintenance-and-configuration\">\u83b7\u53d6\u66f4\u591aSimpleSAMLphp\u7ef4\u62a4\u7684\u4fe1\u606f<\/a> ]", - "ar": "<strong>\u0627\u0646\u062a \u0644\u0627 \u062a\u0633\u062a\u062e\u062f\u0645 HTTPS<\/strong> - \u0645\u062d\u0627\u062f\u062b\u0629 \u0645\u0634\u0641\u0631\u0629 \u0645\u0639 \u0627\u0644\u0645\u0633\u062a\u062e\u062f\u0645. HTTP \u062c\u064a\u062f \u0644\u0644\u0627\u062e\u062a\u0628\u0627\u0631\u0627\u062a \u0644\u0643\u0646 \u0641\u064a \u0628\u064a\u0626\u0629 \u0627\u0644\u0646\u0638\u0627\u0645 \u0627\u0644\u0645\u0628\u062f\u0626\u064a \u064a\u0646\u0628\u063a\u064a \u0627\u0633\u062a\u062e\u062f\u0627\u0645 HTTPS. [ <a href=\"http:\/\/rnd.feide.no\/contents\/simplesamlphp-maintenance-and-configuration\">read more about SimpleSAMLphp maintenance<\/a>]", - "lv": "<strong>J\u016bs neizmantojat HTTPS<\/strong> - \u0161ifr\u0113tu komunik\u0101ciju ar lietot\u0101ju. HTTP ir labs testa nol\u016bkiem, bet ra\u017eo\u0161an\u0101 j\u0101izmanto HTTPS. [ <a href=\"http:\/\/rnd.feide.no\/content\/simplesamlphp-maintenance-and-configuration\">Lasiet vair\u0101k par SimpleSAMLphp uztur\u0113\u0161anu<\/a> ]", - "id": "<strong>Anda tidak menggunakan HTTPS<\/strong> - komunikasi yang dienkripsi dengan user. HTTP bekerja baik-baik saja untuk tujuan pengetesan , tapi dalam lingkungan produksi, Anda sebaiknya menggunakan HTTPS. [ <a href=\"http:\/\/rnd.feide.no\/content\/simplesamlphp-maintenance-and-configuration\">Baca lebih lanjut tentang proses pemeliraan SimpleSAMLphp.<\/a> ]", - "sr": "<strong>Ne koristite HTTPS<\/strong> - kriptovanu komunikaciju s korisnikom. HTTP se mo\u017ee koristiti za potrebe testiranja, ali u produkcionom okru\u017eenju trebali biste koristiti HTTPS. [ <a href=\"http:\/\/rnd.feide.no\/content\/simplesamlphp-maintenance-and-configuration\">Pro\u010ditajte vi\u0161e o SimpleSAMLphp pode\u0161avanjima<\/a> ]", - "ro": "<strong>Aten\u021bie, nu utiliza\u021bi HTTPS<\/strong> - comunicare criptat\u0103 cu utilizatorul. HTTP func\u021bioneaza bine pentru teste, dar \u00een produc\u021bie trebuie folosit HTTPS. [<a href=\"http:\/\/rnd.feide.no\/content\/simplesamlphp-maintenance-and-configuration\">Citi\u021bi mai multe despre \u00eentre\u021binerea SimpleSAMLphp<\/a> ]", - "eu": "<strong>Ez zara erabiltzen ari HTTPSak<\/strong> - erabiltzailearekin zifratutako komunikazioak. HTTP zuzen ibiltzen da ebaluaketa ingurunetan, baina ustiapenean erabili behar baduzu, HTTPS erabili beharko zenuke. [ <a href=\"http:\/\/rnd.feide.no\/content\/simplesamlphp-maintenance-and-configuration\">Irakur ezazu gehiago SimpleSAMLphp-ren mantentze-lanei buruz <\/a> ]", - "el": "\u0394\u03b5\u03bd \u03c7\u03c1\u03b7\u03c3\u03b9\u03bc\u03bf\u03c0\u03bf\u03b9\u03b5\u03af\u03c4\u03b5 <strong>HTTPS<\/strong> \u03b3\u03b9\u03b1 \u03ba\u03c1\u03c5\u03c0\u03c4\u03bf\u03b3\u03c1\u03b1\u03c6\u03b7\u03bc\u03ad\u03bd\u03b7 \u03b5\u03c0\u03b9\u03ba\u03bf\u03b9\u03bd\u03c9\u03bd\u03af\u03b1 \u03bc\u03b5 \u03c4\u03bf\u03bd \u03c7\u03c1\u03ae\u03c3\u03c4\u03b7. \u03a4\u03bf HTTP \u03b5\u03c0\u03b1\u03c1\u03ba\u03b5\u03af \u03b3\u03b9\u03b1 \u03b4\u03bf\u03ba\u03b9\u03bc\u03b1\u03c3\u03c4\u03b9\u03ba\u03bf\u03cd\u03c2 \u03c3\u03ba\u03bf\u03c0\u03bf\u03cd\u03c2, \u03c9\u03c3\u03c4\u03cc\u03c3\u03bf \u03c3\u03b5 \u03c0\u03b5\u03c1\u03b9\u03b2\u03ac\u03bb\u03bb\u03bf\u03bd \u03c0\u03b1\u03c1\u03b1\u03b3\u03c9\u03b3\u03ae\u03c2 \u03b8\u03b1 \u03c0\u03c1\u03ad\u03c0\u03b5\u03b9 \u03bd\u03b1 \u03c7\u03c1\u03b7\u03c3\u03b9\u03bc\u03bf\u03c0\u03bf\u03b9\u03ae\u03c3\u03b5\u03c4\u03b5 \u0048\u0054\u0054\u0050\u0053. [ <a href=\"http:\/\/rnd.feide.no\/content\/simplesamlphp-maintenance-and-configuration\">\u0394\u03b9\u03b1\u03b2\u03ac\u03c3\u03c4\u03b5 \u03c0\u03b5\u03c1\u03b9\u03c3\u03c3\u03cc\u03c4\u03b5\u03c1\u03b1...<\/a> ]" + "ru": "<strong>\u0412\u044b \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435 HTTPS<\/strong> - \u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0435 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u0441 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c. HTTP \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0445\u043e\u0440\u043e\u0448\u043e \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0445 \u0446\u0435\u043b\u0435\u0439, \u043d\u043e \u0432 \u044d\u043a\u043f\u043b\u0443\u0430\u0442\u0430\u0446\u0438\u0438 \u0432\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c HTTPS. [ <a href=\"https:\/\/simplesamlphp.org\/docs\/stable\/simplesamlphp-maintenance\">\u0423\u0437\u043d\u0430\u0439\u0442\u0435 \u0431\u043e\u043b\u044c\u0448\u0435 \u043e\u0431 \u043e\u0431\u0441\u043b\u0443\u0436\u0438\u0432\u0430\u043d\u0438\u0438 SimpleSAMLphp<\/a> ]", + "et": "<strong>Sa ei kasuta andmete vahetamiseks HTTPS kr\u00fcpteeritud sidet<\/strong>. HTTP sobib testimiseks h\u00e4sti, kuid toodangus peaksid kindlasti HTTPS-i kasutama. [ <a href=\"https:\/\/simplesamlphp.org\/docs\/stable\/simplesamlphp-maintenance\">Loe t\u00e4psemalt SimpleSAMLphp hooldamisest<\/a> ]", + "he": "<strong>\u05d0\u05ea\u05d4 \u05dc\u05d0 \u05de\u05e9\u05ea\u05de\u05e9 \u05d1- HTTPS <\/strong> - \u05d4\u05ea\u05e7\u05e9\u05e8\u05d5\u05ea \u05de\u05d5\u05e6\u05e4\u05e0\u05ea \u05e2\u05dd \u05d4\u05de\u05e9\u05ea\u05de\u05e9. HTTP \u05e2\u05d5\u05d1\u05d3 \u05d1\u05e1\u05d3\u05e8 \u05dc\u05de\u05d8\u05e8\u05d5\u05ea \u05d1\u05d3\u05d9\u05e7\u05d4, \u05d0\u05d5\u05dc\u05dd \u05dc\u05de\u05e2\u05e8\u05db\u05d5\u05ea \u05d0\u05de\u05d9\u05ea\u05d9\u05d5\u05ea, \u05db\u05d3\u05d9 \u05dc\u05d4\u05e9\u05ea\u05de\u05e9 \u05d4 HTTPS. [ <a href=\"https:\/\/simplesamlphp.org\/docs\/stable\/simplesamlphp-maintenance\"> \u05e7\u05e8\u05d0 \u05e2\u05d5\u05d3 \u05e2\u05dc \u05ea\u05d7\u05d6\u05d5\u05e7 SimpleSAMLphp <\/a> ]", + "zh": "<strong>\u4f60\u6ca1\u6709\u4f7f\u7528HTTPS<\/strong> - \u548c\u7528\u6237\u52a0\u5bc6\u7684\u901a\u4fe1\u3002HTTP\u5728\u6d4b\u8bd5\u76ee\u7684\u4e0b\u5f88\u597d,\u4f46\u751f\u4ea7\u73af\u5883\u8bf7\u4f7f\u7528HTTPS. [ <a href=\"https:\/\/simplesamlphp.org\/docs\/stable\/simplesamlphp-maintenance\">\u83b7\u53d6\u66f4\u591aSimpleSAMLphp\u7ef4\u62a4\u7684\u4fe1\u606f<\/a> ]", + "ar": "<strong>\u0627\u0646\u062a \u0644\u0627 \u062a\u0633\u062a\u062e\u062f\u0645 HTTPS<\/strong> - \u0645\u062d\u0627\u062f\u062b\u0629 \u0645\u0634\u0641\u0631\u0629 \u0645\u0639 \u0627\u0644\u0645\u0633\u062a\u062e\u062f\u0645. HTTP \u062c\u064a\u062f \u0644\u0644\u0627\u062e\u062a\u0628\u0627\u0631\u0627\u062a \u0644\u0643\u0646 \u0641\u064a \u0628\u064a\u0626\u0629 \u0627\u0644\u0646\u0638\u0627\u0645 \u0627\u0644\u0645\u0628\u062f\u0626\u064a \u064a\u0646\u0628\u063a\u064a \u0627\u0633\u062a\u062e\u062f\u0627\u0645 HTTPS. [ <a href=\"https:\/\/simplesamlphp.org\/docs\/stable\/simplesamlphp-maintenance\">read more about SimpleSAMLphp maintenance<\/a>]", + "lv": "<strong>J\u016bs neizmantojat HTTPS<\/strong> - \u0161ifr\u0113tu komunik\u0101ciju ar lietot\u0101ju. HTTP ir labs testa nol\u016bkiem, bet ra\u017eo\u0161an\u0101 j\u0101izmanto HTTPS. [ <a href=\"https:\/\/simplesamlphp.org\/docs\/stable\/simplesamlphp-maintenance\">Lasiet vair\u0101k par SimpleSAMLphp uztur\u0113\u0161anu<\/a> ]", + "id": "<strong>Anda tidak menggunakan HTTPS<\/strong> - komunikasi yang dienkripsi dengan user. HTTP bekerja baik-baik saja untuk tujuan pengetesan , tapi dalam lingkungan produksi, Anda sebaiknya menggunakan HTTPS. [ <a href=\"https:\/\/simplesamlphp.org\/docs\/stable\/simplesamlphp-maintenance\">Baca lebih lanjut tentang proses pemeliraan SimpleSAMLphp.<\/a> ]", + "sr": "<strong>Ne koristite HTTPS<\/strong> - kriptovanu komunikaciju s korisnikom. HTTP se mo\u017ee koristiti za potrebe testiranja, ali u produkcionom okru\u017eenju trebali biste koristiti HTTPS. [ <a href=\"https:\/\/simplesamlphp.org\/docs\/stable\/simplesamlphp-maintenance\">Pro\u010ditajte vi\u0161e o SimpleSAMLphp pode\u0161avanjima<\/a> ]", + "ro": "<strong>Aten\u021bie, nu utiliza\u021bi HTTPS<\/strong> - comunicare criptat\u0103 cu utilizatorul. HTTP func\u021bioneaza bine pentru teste, dar \u00een produc\u021bie trebuie folosit HTTPS. [<a href=\"https:\/\/simplesamlphp.org\/docs\/stable\/simplesamlphp-maintenance\">Citi\u021bi mai multe despre \u00eentre\u021binerea SimpleSAMLphp<\/a> ]", + "eu": "<strong>Ez zara erabiltzen ari HTTPSak<\/strong> - erabiltzailearekin zifratutako komunikazioak. HTTP zuzen ibiltzen da ebaluaketa ingurunetan, baina ustiapenean erabili behar baduzu, HTTPS erabili beharko zenuke. [ <a href=\"https:\/\/simplesamlphp.org\/docs\/stable\/simplesamlphp-maintenance\">Irakur ezazu gehiago SimpleSAMLphp-ren mantentze-lanei buruz <\/a> ]", + "el": "\u0394\u03b5\u03bd \u03c7\u03c1\u03b7\u03c3\u03b9\u03bc\u03bf\u03c0\u03bf\u03b9\u03b5\u03af\u03c4\u03b5 <strong>HTTPS<\/strong> \u03b3\u03b9\u03b1 \u03ba\u03c1\u03c5\u03c0\u03c4\u03bf\u03b3\u03c1\u03b1\u03c6\u03b7\u03bc\u03ad\u03bd\u03b7 \u03b5\u03c0\u03b9\u03ba\u03bf\u03b9\u03bd\u03c9\u03bd\u03af\u03b1 \u03bc\u03b5 \u03c4\u03bf\u03bd \u03c7\u03c1\u03ae\u03c3\u03c4\u03b7. \u03a4\u03bf HTTP \u03b5\u03c0\u03b1\u03c1\u03ba\u03b5\u03af \u03b3\u03b9\u03b1 \u03b4\u03bf\u03ba\u03b9\u03bc\u03b1\u03c3\u03c4\u03b9\u03ba\u03bf\u03cd\u03c2 \u03c3\u03ba\u03bf\u03c0\u03bf\u03cd\u03c2, \u03c9\u03c3\u03c4\u03cc\u03c3\u03bf \u03c3\u03b5 \u03c0\u03b5\u03c1\u03b9\u03b2\u03ac\u03bb\u03bb\u03bf\u03bd \u03c0\u03b1\u03c1\u03b1\u03b3\u03c9\u03b3\u03ae\u03c2 \u03b8\u03b1 \u03c0\u03c1\u03ad\u03c0\u03b5\u03b9 \u03bd\u03b1 \u03c7\u03c1\u03b7\u03c3\u03b9\u03bc\u03bf\u03c0\u03bf\u03b9\u03ae\u03c3\u03b5\u03c4\u03b5 \u0048\u0054\u0054\u0050\u0053. [ <a href=\"https:\/\/simplesamlphp.org\/docs\/stable\/simplesamlphp-maintenance\">\u0394\u03b9\u03b1\u03b2\u03ac\u03c3\u03c4\u03b5 \u03c0\u03b5\u03c1\u03b9\u03c3\u03c3\u03cc\u03c4\u03b5\u03c1\u03b1...<\/a> ]" }, "link_saml2example": { "no": "SAML 2.0 SP eksempel - test innlogging med SAML 2.0 via din IdP", @@ -1425,6 +1355,10 @@ "ro": "V-a\u021bi autentificat ca administrator", "el": "\u03a3\u03c5\u03bd\u03b4\u03b5\u03b4\u03b5\u03bc\u03ad\u03bd\u03bf\u03c2 \u03c9\u03c2 \u03b4\u03b9\u03b1\u03c7\u03b5\u03b9\u03c1\u03b9\u03c3\u03c4\u03ae\u03c2" }, + "logout": { + "en": "Logout", + "nl": "Uitloggen" + }, "auth": { "no": "Autentisering", "sv": "Autentisering", @@ -1630,5 +1564,8 @@ "es": "Su instalación de SimpleSAMLphp está desactualizada. Por favor, actualice a la <a href=\"%LATEST_URL%\">última versión</a> lo antes posible.", "zh-tw": "\u60a8\u6b63\u5728\u4f7f\u7528\u5df2\u904e\u6642\u7684 SimpleSAMLphp \u7248\u672c\uff0c\u8acb\u76e1\u5feb\u66f4\u65b0\u81f3<a href=\"%LATEST_URL%\">\u6700\u65b0\u7248\u672c</a>\u3002", "nl": "Deze installatie van SimpleSAMLphp is verouderd. Het is aan te raden zo snel mogelijk te upgraden naar <a href=\"%LATEST_URL%\">de meest recente versie</a>." + }, + "warnings_curlmissing": { + "nl": "PHP cURL-extensie ontbreekt. Kan niet controleren op updates voor simpleSAMLphp." } } diff --git a/vendor/simplesamlphp/simplesamlphp/modules/core/dictionaries/no_cookie.translation.json b/vendor/simplesamlphp/simplesamlphp/modules/core/dictionaries/no_cookie.translation.json index 56dde57f62..0da9ef717a 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/core/dictionaries/no_cookie.translation.json +++ b/vendor/simplesamlphp/simplesamlphp/modules/core/dictionaries/no_cookie.translation.json @@ -29,7 +29,9 @@ "ru": "\u041e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 cookie-\u0444\u0430\u0439\u043b", "eu": "Cookie-a falta da", "af": "Verlore cookie", - "el": "\u03a0\u03c1\u03cc\u03b2\u03bb\u03b7\u03bc\u03b1 \u03bb\u03b5\u03b9\u03c4\u03bf\u03c5\u03c1\u03b3\u03af\u03b1\u03c2 cookie" + "el": "\u03a0\u03c1\u03cc\u03b2\u03bb\u03b7\u03bc\u03b1 \u03bb\u03b5\u03b9\u03c4\u03bf\u03c5\u03c1\u03b3\u03af\u03b1\u03c2 cookie", + "xh": "Ikhuki engekhoyo", + "zu": "Ikhukhi engatholakali" }, "description": { "no": "Du ser ut til \u00e5 ha deaktivert informasjonskapsler. Kontroller innstillingene i nettleseren din og pr\u00f8v igjen.", @@ -61,7 +63,9 @@ "ru": "\u0412\u0438\u0434\u0438\u043c\u043e, \u0432\u044b \u043e\u0442\u043a\u043b\u044e\u0447\u0438\u043b\u0438 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 cookies \u0432 \u0432\u0430\u0448\u0435\u043c \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435. \u041f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u043f\u0440\u043e\u0432\u0435\u0440\u044c\u0442\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0432\u0430\u0448\u0435\u0433\u043e \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430 \u0438 \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u0435 \u043f\u043e\u043f\u044b\u0442\u043a\u0443.", "eu": "Badirudi zure nabigatzaileko cookie-ak desgaitu dituzula. Mesedez, berrikusi zure nabigatzaileko lehentasunak eta saiatu berriro.", "af": "Dit blyk dat jy cookies in jou webblaaier af geskakel het. Gaan asseblief die stellings in jou webblaaier na en probeer weer.", - "el": "\u0395\u03bd\u03b4\u03ad\u03c7\u03b5\u03c4\u03b1\u03b9 \u03c4\u03b1 cookie \u03c4\u03bf\u03c5 \u03c0\u03c1\u03bf\u03b3\u03c1\u03ac\u03bc\u03bc\u03b1\u03c4\u03bf\u03c2 \u03c0\u03b5\u03c1\u03b9\u03ae\u03b3\u03b7\u03c3\u03ae\u03c2 \u03c3\u03b1\u03c2 \u03bd\u03b1 \u03ad\u03c7\u03bf\u03c5\u03bd \u03b1\u03c0\u03b5\u03bd\u03b5\u03c1\u03b3\u03bf\u03c0\u03bf\u03b9\u03b7\u03b8\u03b5\u03af. \u03a0\u03b1\u03c1\u03b1\u03ba\u03b1\u03bb\u03bf\u03cd\u03bc\u03b5 \u03b5\u03bb\u03ad\u03b3\u03be\u03c4\u03b5 \u03c4\u03b9\u03c2 \u03c3\u03c7\u03b5\u03c4\u03b9\u03ba\u03ad\u03c2 \u03c1\u03c5\u03b8\u03bc\u03af\u03c3\u03b5\u03b9\u03c2 \u03ba\u03b1\u03b9 \u03ba\u03b1\u03b9 \u03b4\u03bf\u03ba\u03b9\u03bc\u03ac\u03c3\u03c4\u03b5 \u03be\u03b1\u03bd\u03ac." + "el": "\u0395\u03bd\u03b4\u03ad\u03c7\u03b5\u03c4\u03b1\u03b9 \u03c4\u03b1 cookie \u03c4\u03bf\u03c5 \u03c0\u03c1\u03bf\u03b3\u03c1\u03ac\u03bc\u03bc\u03b1\u03c4\u03bf\u03c2 \u03c0\u03b5\u03c1\u03b9\u03ae\u03b3\u03b7\u03c3\u03ae\u03c2 \u03c3\u03b1\u03c2 \u03bd\u03b1 \u03ad\u03c7\u03bf\u03c5\u03bd \u03b1\u03c0\u03b5\u03bd\u03b5\u03c1\u03b3\u03bf\u03c0\u03bf\u03b9\u03b7\u03b8\u03b5\u03af. \u03a0\u03b1\u03c1\u03b1\u03ba\u03b1\u03bb\u03bf\u03cd\u03bc\u03b5 \u03b5\u03bb\u03ad\u03b3\u03be\u03c4\u03b5 \u03c4\u03b9\u03c2 \u03c3\u03c7\u03b5\u03c4\u03b9\u03ba\u03ad\u03c2 \u03c1\u03c5\u03b8\u03bc\u03af\u03c3\u03b5\u03b9\u03c2 \u03ba\u03b1\u03b9 \u03ba\u03b1\u03b9 \u03b4\u03bf\u03ba\u03b9\u03bc\u03ac\u03c3\u03c4\u03b5 \u03be\u03b1\u03bd\u03ac.", + "xh": "Ubonakala uzenze azasebenza iikhuki kwibhrawuza yakho. Nceda ujonge iisetingi ezikwibhrawuza yakho, uzame kwakhona.", + "zu": "Kubonakala sengathi uyekise amakhukhi kusiphequluli sakho. Sicela uhlole amasethingi kusiphequluli sakho, bese uzame futhi." }, "retry": { "no": "Pr\u00f8v igjen", @@ -93,6 +97,8 @@ "ro": "\u00cencearc\u0103 din nou", "eu": "Saiatu berriro", "af": "Probeer weer", - "el": "\u0394\u03bf\u03ba\u03b9\u03bc\u03ac\u03c3\u03c4\u03b5 \u03be\u03b1\u03bd\u03ac" + "el": "\u0394\u03bf\u03ba\u03b9\u03bc\u03ac\u03c3\u03c4\u03b5 \u03be\u03b1\u03bd\u03ac", + "zu": "Zama futhi", + "xh": "Zama kwakhona" } } diff --git a/vendor/simplesamlphp/simplesamlphp/modules/core/dictionaries/no_metadata.translation.json b/vendor/simplesamlphp/simplesamlphp/modules/core/dictionaries/no_metadata.translation.json index e580e40c62..2ebd8b0f46 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/core/dictionaries/no_metadata.translation.json +++ b/vendor/simplesamlphp/simplesamlphp/modules/core/dictionaries/no_metadata.translation.json @@ -28,7 +28,9 @@ "cs": "Metadata nebyla nalezena", "eu": "Ez da aurkitu metadaturik", "af": "Metadata nie gevind nie", - "el": "\u0394\u03b5\u03bd \u03b2\u03c1\u03ad\u03b8\u03b7\u03ba\u03b1\u03bd \u03bc\u03b5\u03c4\u03b1\u03b4\u03b5\u03b4\u03bf\u03bc\u03ad\u03bd\u03b1" + "el": "\u0394\u03b5\u03bd \u03b2\u03c1\u03ad\u03b8\u03b7\u03ba\u03b1\u03bd \u03bc\u03b5\u03c4\u03b1\u03b4\u03b5\u03b4\u03bf\u03bc\u03ad\u03bd\u03b1", + "zu": "Imethadatha ayitholakali", + "xh": "I-Metadata ayifunyenwanga" }, "not_found_for": { "no": "Vi fant ikke metadataene for:", @@ -59,7 +61,9 @@ "cs": "Nebyla nalezena metadata pro entitu:", "eu": "Ezinezkoa izan da erakunde honentzat metadaturik aurkitzea: ", "af": "Ons was nie in staat om die metadata vir die entiteit op te spoor nie:", - "el": "\u0394\u03b5\u03bd \u03ae\u03c4\u03b1\u03bd \u03b4\u03c5\u03bd\u03b1\u03c4\u03cc \u03bd\u03b1 \u03b2\u03c1\u03b5\u03b8\u03bf\u03cd\u03bd \u03bc\u03b5\u03c4\u03b1\u03b4\u03b5\u03b4\u03bf\u03bc\u03ad\u03bd\u03b1 \u03b3\u03b9\u03b1 \u03c4\u03b7\u03bd \u03bf\u03bd\u03c4\u03cc\u03c4\u03b7\u03c4\u03b1:" + "el": "\u0394\u03b5\u03bd \u03ae\u03c4\u03b1\u03bd \u03b4\u03c5\u03bd\u03b1\u03c4\u03cc \u03bd\u03b1 \u03b2\u03c1\u03b5\u03b8\u03bf\u03cd\u03bd \u03bc\u03b5\u03c4\u03b1\u03b4\u03b5\u03b4\u03bf\u03bc\u03ad\u03bd\u03b1 \u03b3\u03b9\u03b1 \u03c4\u03b7\u03bd \u03bf\u03bd\u03c4\u03cc\u03c4\u03b7\u03c4\u03b1:", + "xh": "Asikwazanga ukufumana imetadata ye-entithi:", + "zu": "Asikwazanga ukuthola imethadatha yenhlangano:" }, "config_problem": { "no": "Dette er sannsynligvis et konfigurasjonsproblem hos enten tjenesteleverand\u00f8ren eller identitetsleverand\u00f8ren.", @@ -90,7 +94,9 @@ "cs": "Toto je pravd\u011bpodobn\u011b konfigura\u010dn\u00ed probl\u00e9m na stran\u011b poskytovatele slu\u017eby nebo poskytovatele identity.", "eu": "Hau ziurrenik konfigurazio arazo bat izango da zerbitzu hornitzailean edota identitate hornitzailean. ", "af": "Di\u00e9 is waarskynlik 'n probleem met die konfigurasie by die diensverskaffer \u00f3f die identiteit verskaffer.", - "el": "\u0391\u03c5\u03c4\u03cc \u03c5\u03c0\u03bf\u03b4\u03b5\u03b9\u03ba\u03bd\u03cd\u03b5\u03b9 \u03c0\u03c1\u03cc\u03b2\u03bb\u03b7\u03bc\u03b1 \u03bc\u03b5 \u03c4\u03b9\u03c2 \u03c1\u03c5\u03b8\u03bc\u03af\u03c3\u03b5\u03b9\u03c2 \u03b5\u03af\u03c4\u03b5 \u03c4\u03bf\u03c5 \u03c0\u03b1\u03c1\u03cc\u03c7\u03bf\u03c5 \u03c5\u03c0\u03b7\u03c1\u03b5\u03c3\u03b9\u03ce\u03bd \u03b5\u03af\u03c4\u03b5 \u03c4\u03bf\u03c5 \u03c0\u03b1\u03c1\u03cc\u03c7\u03bf\u03c5 \u03c4\u03b1\u03c5\u03c4\u03cc\u03c4\u03b7\u03c4\u03b1\u03c2." + "el": "\u0391\u03c5\u03c4\u03cc \u03c5\u03c0\u03bf\u03b4\u03b5\u03b9\u03ba\u03bd\u03cd\u03b5\u03b9 \u03c0\u03c1\u03cc\u03b2\u03bb\u03b7\u03bc\u03b1 \u03bc\u03b5 \u03c4\u03b9\u03c2 \u03c1\u03c5\u03b8\u03bc\u03af\u03c3\u03b5\u03b9\u03c2 \u03b5\u03af\u03c4\u03b5 \u03c4\u03bf\u03c5 \u03c0\u03b1\u03c1\u03cc\u03c7\u03bf\u03c5 \u03c5\u03c0\u03b7\u03c1\u03b5\u03c3\u03b9\u03ce\u03bd \u03b5\u03af\u03c4\u03b5 \u03c4\u03bf\u03c5 \u03c0\u03b1\u03c1\u03cc\u03c7\u03bf\u03c5 \u03c4\u03b1\u03c5\u03c4\u03cc\u03c4\u03b7\u03c4\u03b1\u03c2.", + "xh": "Kusenokwenzeka yingxaki yolungiselelo kumboneleli wenkonzo okanye umboneleli wesazisi.", + "zu": "Lokhu kungenzeka ukuthi kubangelwa inkinga yomiso yomhlinzeki wesevisi noma umhlinzeki kamazisi." }, "suggestion_user_link": { "no": "Hvis du er en bruker som fikk denne feilen etter at du fulgte en link p\u00e5 en nettside, s\u00e5 b\u00f8r du rapportere denne feilen til eieren av den nettsiden.", @@ -121,7 +127,9 @@ "cs": "Pokud jste u\u017eivatel, kter\u00fd obdr\u017eel chybu po n\u00e1sledov\u00e1n\u00ed odkazu na webov\u00e9 str\u00e1nce, m\u011bli byste o t\u00e9to chyb\u011b informovat vlastn\u00edka t\u00e9to str\u00e1nky. ", "eu": "Gune bateko lotura bat jarraituz errore hau jasotzen duen erabiltzaile bat bazara, guneko jabeari eman behar diozu errorearen berri.", "af": "As jy 'n gebruiker is wat na aanleiding van 'n skakel op 'n webwerf hierdie fout ontvang het, moet jy hierdie fout aan die eienaar van die webwerf aan stuur.", - "el": "\u0391\u03bd \u03bb\u03ac\u03b2\u03b1\u03c4\u03b5 \u03b1\u03c5\u03c4\u03cc \u03c4\u03bf \u03c3\u03c6\u03ac\u03bb\u03bc\u03b1 \u03b1\u03ba\u03bf\u03bb\u03bf\u03c5\u03b8\u03ce\u03bd\u03c4\u03b1\u03c2 \u03ad\u03bd\u03b1\u03bd \u03c3\u03cd\u03bd\u03b4\u03b5\u03c3\u03bc\u03bf \u03c3\u03b5 \u03ba\u03ac\u03c0\u03bf\u03b9\u03bf\u03bd \u03b9\u03c3\u03c4\u03cc\u03c4\u03bf\u03c0\u03bf, \u03b8\u03b1 \u03c0\u03c1\u03ad\u03c0\u03b5\u03b9 \u03bd\u03b1 \u03c4\u03bf \u03b1\u03bd\u03b1\u03c6\u03ad\u03c1\u03b5\u03c4\u03b5 \u03c3\u03c4\u03bf\u03bd \u03b9\u03b4\u03b9\u03bf\u03ba\u03c4\u03ae\u03c4\u03b7 \u03c4\u03bf\u03c5 \u03b5\u03bd \u03bb\u03cc\u03b3\u03c9 \u03b9\u03c3\u03c4\u03cc\u03c4\u03bf\u03c0\u03bf\u03c5." + "el": "\u0391\u03bd \u03bb\u03ac\u03b2\u03b1\u03c4\u03b5 \u03b1\u03c5\u03c4\u03cc \u03c4\u03bf \u03c3\u03c6\u03ac\u03bb\u03bc\u03b1 \u03b1\u03ba\u03bf\u03bb\u03bf\u03c5\u03b8\u03ce\u03bd\u03c4\u03b1\u03c2 \u03ad\u03bd\u03b1\u03bd \u03c3\u03cd\u03bd\u03b4\u03b5\u03c3\u03bc\u03bf \u03c3\u03b5 \u03ba\u03ac\u03c0\u03bf\u03b9\u03bf\u03bd \u03b9\u03c3\u03c4\u03cc\u03c4\u03bf\u03c0\u03bf, \u03b8\u03b1 \u03c0\u03c1\u03ad\u03c0\u03b5\u03b9 \u03bd\u03b1 \u03c4\u03bf \u03b1\u03bd\u03b1\u03c6\u03ad\u03c1\u03b5\u03c4\u03b5 \u03c3\u03c4\u03bf\u03bd \u03b9\u03b4\u03b9\u03bf\u03ba\u03c4\u03ae\u03c4\u03b7 \u03c4\u03bf\u03c5 \u03b5\u03bd \u03bb\u03cc\u03b3\u03c9 \u03b9\u03c3\u03c4\u03cc\u03c4\u03bf\u03c0\u03bf\u03c5.", + "xh": "Ukuba ngaba ungumsebenzisi ofumene le mpazamo emva kokulandela ilinki kwisayithi, ufanele uchaze le mpazamo kumnini walo sayithi.", + "zu": "Uma ungumsebenzisi othole leli phutha ngemva kokulandela ilinki ekusayithi, kufanele ubike leli phutha kumnikazi waleyo sayithi." }, "suggestion_developer": { "no": "Hvis du er en utvikler som setter opp en \"single sign-on\" l\u00f8sning, s\u00e5 har du et problem med metadataoppsettet. Kontroller at metadata er riktig konfigurert hos b\u00e5de identitetsleverand\u00f8ren og tjenesteleverand\u00f8ren.", @@ -152,6 +160,8 @@ "cs": "Pokud jste v\u00fdvoj\u00e1\u0159 nasazuj\u00edc\u00ed \u0159e\u0161en\u00ed jednotn\u00e9ho p\u0159ihla\u0161ov\u00e1n\u00ed, m\u00e1te probl\u00e9m s konfigurac\u00ed metadat. Ov\u011b\u0159te, zda jsou metadata nakonfigurov\u00e1na spr\u00e1vn\u011b jak u poskytovatele identity tak u poskytovatele slu\u017eby.", "eu": "Hasiera-bakarreko sistema bat zabaltzen ari zaren garatzaile bat bazara, arazo bat duzu zure metadatuen kongigurazioarekin. Egiazta ezazu metadatuak zuzen konfiguratuak daudela identitate hornitzailean eta zerbitzu hornitzailean.", "af": "As jy 'n programmeerder is wat die 'single sign-on' oplossing implementeer, het jy 'n probleem met die metadata opset. Bevestig dat die metadata korrek ingestel is op beide die identiteit verskaffer en diensverskaffer.", - "el": "\u0395\u03ac\u03bd \u03b5\u03af\u03c3\u03c4\u03b5 \u03b4\u03b9\u03b1\u03c7\u03b5\u03b9\u03c1\u03b9\u03c3\u03c4\u03ae\u03c2 \u03c4\u03b7\u03c2 \u03c5\u03c0\u03b7\u03c1\u03b5\u03c3\u03af\u03b1\u03c2 \u03c4\u03b1\u03c5\u03c4\u03bf\u03c0\u03bf\u03af\u03b7\u03c3\u03b7\u03c2 \u03ba\u03b1\u03b9 \u03b5\u03be\u03bf\u03c5\u03c3\u03b9\u03bf\u03b4\u03cc\u03c4\u03b7\u03c3\u03b7\u03c2, \u03c4\u03cc\u03c4\u03b5 \u03b1\u03bd\u03c4\u03b9\u03bc\u03b5\u03c4\u03c9\u03c0\u03af\u03b6\u03b5\u03c4\u03b5 \u03ba\u03ac\u03c0\u03bf\u03b9\u03bf \u03c0\u03c1\u03cc\u03b2\u03bb\u03b7\u03bc\u03b1 \u03bc\u03b5 \u03c4\u03b7 \u03b4\u03b9\u03b1\u03bc\u03cc\u03c1\u03c6\u03c9\u03c3\u03b7 \u03c4\u03c9\u03bd \u03bc\u03b5\u03c4\u03b1\u03b4\u03b5\u03b4\u03bf\u03bc\u03ad\u03bd\u03c9\u03bd. \u0392\u03b5\u03b2\u03b1\u03b9\u03c9\u03b8\u03b5\u03af\u03c4\u03b5 \u03cc\u03c4\u03b9 \u03c4\u03b1 \u03bc\u03b5\u03c4\u03b1\u03b4\u03b5\u03b4\u03bf\u03bc\u03ad\u03bd\u03b1 \u03ad\u03c7\u03bf\u03c5\u03bd \u03c1\u03c5\u03b8\u03bc\u03b9\u03c3\u03c4\u03b5\u03af \u03c3\u03c9\u03c3\u03c4\u03ac \u03c4\u03cc\u03c3\u03bf \u03c3\u03c4\u03bf\u03bd \u03c0\u03ac\u03c1\u03bf\u03c7\u03bf \u03c4\u03b1\u03c5\u03c4\u03cc\u03c4\u03b7\u03c4\u03b1\u03c2 \u03cc\u03c3\u03bf \u03ba\u03b1\u03b9 \u03c3\u03c4\u03bf\u03bd \u03c0\u03ac\u03c1\u03bf\u03c7\u03bf \u03c5\u03c0\u03b7\u03c1\u03b5\u03c3\u03b9\u03ce\u03bd." + "el": "\u0395\u03ac\u03bd \u03b5\u03af\u03c3\u03c4\u03b5 \u03b4\u03b9\u03b1\u03c7\u03b5\u03b9\u03c1\u03b9\u03c3\u03c4\u03ae\u03c2 \u03c4\u03b7\u03c2 \u03c5\u03c0\u03b7\u03c1\u03b5\u03c3\u03af\u03b1\u03c2 \u03c4\u03b1\u03c5\u03c4\u03bf\u03c0\u03bf\u03af\u03b7\u03c3\u03b7\u03c2 \u03ba\u03b1\u03b9 \u03b5\u03be\u03bf\u03c5\u03c3\u03b9\u03bf\u03b4\u03cc\u03c4\u03b7\u03c3\u03b7\u03c2, \u03c4\u03cc\u03c4\u03b5 \u03b1\u03bd\u03c4\u03b9\u03bc\u03b5\u03c4\u03c9\u03c0\u03af\u03b6\u03b5\u03c4\u03b5 \u03ba\u03ac\u03c0\u03bf\u03b9\u03bf \u03c0\u03c1\u03cc\u03b2\u03bb\u03b7\u03bc\u03b1 \u03bc\u03b5 \u03c4\u03b7 \u03b4\u03b9\u03b1\u03bc\u03cc\u03c1\u03c6\u03c9\u03c3\u03b7 \u03c4\u03c9\u03bd \u03bc\u03b5\u03c4\u03b1\u03b4\u03b5\u03b4\u03bf\u03bc\u03ad\u03bd\u03c9\u03bd. \u0392\u03b5\u03b2\u03b1\u03b9\u03c9\u03b8\u03b5\u03af\u03c4\u03b5 \u03cc\u03c4\u03b9 \u03c4\u03b1 \u03bc\u03b5\u03c4\u03b1\u03b4\u03b5\u03b4\u03bf\u03bc\u03ad\u03bd\u03b1 \u03ad\u03c7\u03bf\u03c5\u03bd \u03c1\u03c5\u03b8\u03bc\u03b9\u03c3\u03c4\u03b5\u03af \u03c3\u03c9\u03c3\u03c4\u03ac \u03c4\u03cc\u03c3\u03bf \u03c3\u03c4\u03bf\u03bd \u03c0\u03ac\u03c1\u03bf\u03c7\u03bf \u03c4\u03b1\u03c5\u03c4\u03cc\u03c4\u03b7\u03c4\u03b1\u03c2 \u03cc\u03c3\u03bf \u03ba\u03b1\u03b9 \u03c3\u03c4\u03bf\u03bd \u03c0\u03ac\u03c1\u03bf\u03c7\u03bf \u03c5\u03c0\u03b7\u03c1\u03b5\u03c3\u03b9\u03ce\u03bd.", + "xh": "Ukuba ungumvelisi osebenzisa isisombululo sokusayina ungene kanye, unengxaki nolungiselelo lwe-metadata. Qinisekisa ukuba i-metadata ilungiselelwe ngokuchanekileyo kuzo zombini umbonelei wesazisi nomboneleli wenkonzo.", + "zu": "Uma ungunjiniyela osebenzisa isixazululo sokusayinela ukungena esisodwa, unenkinga ngomiso lwemethadatha. Qinisekisa ukuthi imethadatha imiswe ngendlela efanele kokubili kumhlinzeki womazisi nomhlinzeki wesevisi." } } diff --git a/vendor/simplesamlphp/simplesamlphp/modules/core/dictionaries/no_state.definition.json b/vendor/simplesamlphp/simplesamlphp/modules/core/dictionaries/no_state.definition.json index 9ce452a0cc..b10bbead87 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/core/dictionaries/no_state.definition.json +++ b/vendor/simplesamlphp/simplesamlphp/modules/core/dictionaries/no_state.definition.json @@ -8,6 +8,9 @@ "suggestions": { "en": "Suggestions for resolving this problem:" }, + "suggestion_badlink": { + "en": "Check that the link you used to access the web site is correct." + }, "suggestion_goback": { "en": "Go back to the previous page and try again." }, @@ -17,6 +20,9 @@ "causes": { "en": "This error may be caused by:" }, + "cause_badlink": { + "en": "The link used to get here was bad, perhaps a bookmark." + }, "cause_backforward": { "en": "Using the back and forward buttons in the web browser." }, diff --git a/vendor/simplesamlphp/simplesamlphp/modules/core/dictionaries/no_state.translation.json b/vendor/simplesamlphp/simplesamlphp/modules/core/dictionaries/no_state.translation.json index b0ad8c5f64..30f0440f6f 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/core/dictionaries/no_state.translation.json +++ b/vendor/simplesamlphp/simplesamlphp/modules/core/dictionaries/no_state.translation.json @@ -26,7 +26,9 @@ "ru": "\u0418\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438 \u0443\u0442\u0435\u0440\u044f\u043d\u0430", "cs": "Stavov\u00e1 informace ztracena", "eu": "Egoeraren informazioa galdu da", - "el": "\u0394\u03b5\u03bd \u03b2\u03c1\u03ad\u03b8\u03b7\u03ba\u03b1\u03bd \u03c0\u03bb\u03b7\u03c1\u03bf\u03c6\u03bf\u03c1\u03af\u03b5\u03c2 \u03ba\u03b1\u03c4\u03ac\u03c3\u03c4\u03b1\u03c3\u03b7\u03c2" + "el": "\u0394\u03b5\u03bd \u03b2\u03c1\u03ad\u03b8\u03b7\u03ba\u03b1\u03bd \u03c0\u03bb\u03b7\u03c1\u03bf\u03c6\u03bf\u03c1\u03af\u03b5\u03c2 \u03ba\u03b1\u03c4\u03ac\u03c3\u03c4\u03b1\u03c3\u03b7\u03c2", + "zu": "Ulwazi lwesifunda lulahlekile", + "xh": "Inkcazelo yobume ilahlekile" }, "description": { "no": "Vi kunne ikke finne tilstandsinformasjonen for denne foresp\u00f8rselen.", @@ -55,7 +57,9 @@ "ru": "\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438 \u0434\u043b\u044f \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430.", "cs": "Nebylo mo\u017en\u00e9 naj\u00edt stavovou informaci pro sou\u010dasn\u00fd po\u017eadavek.", "eu": "Ez dugu aurkitu egoeraren informaziorik eskaera honentzat.", - "el": "\u0394\u03b5\u03bd \u03ae\u03c4\u03b1\u03bd \u03b4\u03c5\u03bd\u03b1\u03c4\u03cc \u03bd\u03b1 \u03b5\u03bd\u03c4\u03bf\u03c0\u03b9\u03c3\u03c4\u03bf\u03cd\u03bd \u03c0\u03bb\u03b7\u03c1\u03bf\u03c6\u03bf\u03c1\u03af\u03b5\u03c2 \u03ba\u03b1\u03c4\u03ac\u03c3\u03c4\u03b1\u03c3\u03b7\u03c2 \u03b3\u03b9\u03b1 \u03c4\u03bf \u03c4\u03c1\u03ad\u03c7\u03bf\u03bd \u03b1\u03af\u03c4\u03b7\u03bc\u03b1." + "el": "\u0394\u03b5\u03bd \u03ae\u03c4\u03b1\u03bd \u03b4\u03c5\u03bd\u03b1\u03c4\u03cc \u03bd\u03b1 \u03b5\u03bd\u03c4\u03bf\u03c0\u03b9\u03c3\u03c4\u03bf\u03cd\u03bd \u03c0\u03bb\u03b7\u03c1\u03bf\u03c6\u03bf\u03c1\u03af\u03b5\u03c2 \u03ba\u03b1\u03c4\u03ac\u03c3\u03c4\u03b1\u03c3\u03b7\u03c2 \u03b3\u03b9\u03b1 \u03c4\u03bf \u03c4\u03c1\u03ad\u03c7\u03bf\u03bd \u03b1\u03af\u03c4\u03b7\u03bc\u03b1.", + "xh": "Asikwazanga ukufumana inkcazelo yobume yesicelo sangoku.", + "zu": "Asikwazanga ukuthola ulwazi lwesifunda lwesicelo samanje." }, "suggestions": { "no": "Forslag for \u00e5 l\u00f8se dette problemet:", @@ -84,7 +88,13 @@ "ru": "\u0412\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b:", "cs": "N\u00e1vrhy pro vy\u0159e\u0161en\u00ed tohoto probl\u00e9mu:", "eu": "Arazo hau konpontzeko iradokizunak:", - "el": "\u03a0\u03c1\u03bf\u03c4\u03ac\u03c3\u03b5\u03b9\u03c2 \u03b3\u03b9\u03b1 \u03c4\u03b7\u03bd \u03b5\u03c0\u03af\u03bb\u03c5\u03c3\u03b7 \u03b1\u03c5\u03c4\u03bf\u03cd \u03c4\u03bf\u03c5 \u03c0\u03c1\u03bf\u03b2\u03bb\u03ae\u03bc\u03b1\u03c4\u03bf\u03c2:" + "el": "\u03a0\u03c1\u03bf\u03c4\u03ac\u03c3\u03b5\u03b9\u03c2 \u03b3\u03b9\u03b1 \u03c4\u03b7\u03bd \u03b5\u03c0\u03af\u03bb\u03c5\u03c3\u03b7 \u03b1\u03c5\u03c4\u03bf\u03cd \u03c4\u03bf\u03c5 \u03c0\u03c1\u03bf\u03b2\u03bb\u03ae\u03bc\u03b1\u03c4\u03bf\u03c2:", + "zu": "Iziphakamiso zokuxazulula le nkinga:", + "xh": "Iingcebiso zokulungisa le ngxaki:" + }, + "suggestion_badlink": { + "sv": "Kontrollera att länken du använde för att komma åt webplatsen är korrekt.", + "nl": "Controleer of u de juiste link gebruikt om de website te benaderen." }, "suggestion_goback": { "no": "G\u00e5 tilbake til forrige side og pr\u00f8v p\u00e5 nytt.", @@ -113,7 +123,9 @@ "ru": "\u0412\u0435\u0440\u043d\u0443\u0442\u044c\u0441\u044f \u043a \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u0438 \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u0441\u043d\u043e\u0432\u0430.", "cs": "J\u00edt zp\u011bt na p\u0159edchoz\u00ed str\u00e1nku a zkusit znovu.", "eu": "Itzul zaitez aurreko orrira eta saiatu berriro", - "el": "\u0395\u03c0\u03b9\u03c3\u03c4\u03c1\u03ad\u03c8\u03c4\u03b5 \u03c3\u03c4\u03b7\u03bd \u03c0\u03c1\u03bf\u03b7\u03b3\u03bf\u03cd\u03bc\u03b5\u03bd\u03b7 \u03c3\u03b5\u03bb\u03af\u03b4\u03b1 \u03ba\u03b1\u03b9 \u03c0\u03c1\u03bf\u03c3\u03c0\u03b1\u03b8\u03ae\u03c3\u03c4\u03b5 \u03be\u03b1\u03bd\u03ac." + "el": "\u0395\u03c0\u03b9\u03c3\u03c4\u03c1\u03ad\u03c8\u03c4\u03b5 \u03c3\u03c4\u03b7\u03bd \u03c0\u03c1\u03bf\u03b7\u03b3\u03bf\u03cd\u03bc\u03b5\u03bd\u03b7 \u03c3\u03b5\u03bb\u03af\u03b4\u03b1 \u03ba\u03b1\u03b9 \u03c0\u03c1\u03bf\u03c3\u03c0\u03b1\u03b8\u03ae\u03c3\u03c4\u03b5 \u03be\u03b1\u03bd\u03ac.", + "zu": "Buyela emuva ekhasini langaphambilini bese uzame futhi.", + "xh": "Buyela emva kwikhasi elidlulileyo uzame kwakhona." }, "suggestion_closebrowser": { "no": "Lukk nettleseren, og pr\u00f8v p\u00e5 nytt.", @@ -142,7 +154,9 @@ "ru": "\u0417\u0430\u043a\u0440\u044b\u0442\u044c \u0432\u0435\u0431 \u0431\u0440\u0430\u0443\u0437\u0435\u0440 \u0438 \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u0441\u043d\u043e\u0432\u0430.", "cs": "Zav\u0159\u00edt webov\u00fd prohl\u00ed\u017ee\u010d a zkusit znovu.", "eu": "Nabigatzailea itxi eta saiatu berriro", - "el": "\u039a\u03bb\u03b5\u03af\u03c3\u03c4\u03b5 \u03c4\u03bf \u03c0\u03c1\u03cc\u03b3\u03c1\u03b1\u03bc\u03bc\u03b1 \u03c0\u03b5\u03c1\u03b9\u03ae\u03b3\u03b7\u03c3\u03b7\u03c2 \u03b9\u03c3\u03c4\u03bf\u03cd (web browser) \u03ba\u03b1\u03b9 \u03c0\u03c1\u03bf\u03c3\u03c0\u03b1\u03b8\u03ae\u03c3\u03c4\u03b5 \u03be\u03b1\u03bd\u03ac" + "el": "\u039a\u03bb\u03b5\u03af\u03c3\u03c4\u03b5 \u03c4\u03bf \u03c0\u03c1\u03cc\u03b3\u03c1\u03b1\u03bc\u03bc\u03b1 \u03c0\u03b5\u03c1\u03b9\u03ae\u03b3\u03b7\u03c3\u03b7\u03c2 \u03b9\u03c3\u03c4\u03bf\u03cd (web browser) \u03ba\u03b1\u03b9 \u03c0\u03c1\u03bf\u03c3\u03c0\u03b1\u03b8\u03ae\u03c3\u03c4\u03b5 \u03be\u03b1\u03bd\u03ac", + "zu": "Vala isiphequluli sewebhu, bese uzame futhi.", + "xh": "Vala ibhrawuza yewebhu, uzame kwakhona." }, "causes": { "no": "Denne feilen kan v\u00e6re for\u00e5rsaket av:", @@ -171,7 +185,13 @@ "ru": "\u042d\u0442\u0430 \u043e\u0448\u0438\u0431\u043a\u0430 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0432\u044b\u0437\u0432\u0430\u043d\u0430:", "cs": "Tato chyba m\u016f\u017ee b\u00fdt zp\u016fsoben\u00e1:", "eu": "Errore hau honek eragin dezake:", - "el": "\u0391\u03c5\u03c4\u03cc \u03c4\u03bf \u03c3\u03c6\u03ac\u03bb\u03bc\u03b1 \u03bc\u03c0\u03bf\u03c1\u03b5\u03af \u03bd\u03b1 \u03c0\u03c1\u03bf\u03ba\u03cd\u03c8\u03b5\u03b9, \u03b5\u03ac\u03bd:" + "el": "\u0391\u03c5\u03c4\u03cc \u03c4\u03bf \u03c3\u03c6\u03ac\u03bb\u03bc\u03b1 \u03bc\u03c0\u03bf\u03c1\u03b5\u03af \u03bd\u03b1 \u03c0\u03c1\u03bf\u03ba\u03cd\u03c8\u03b5\u03b9, \u03b5\u03ac\u03bd:", + "zu": "Leli phutha kungenzeka libangelwa ukuthi:", + "xh": "Le mpazamo isenokuba ibangelwe:" + }, + "cause_badlink": { + "sv": "Länken till websidan var felaktig, kanske till följd av elak automatisk ifyllning, en trasig länk eller ett trasigt bokmärke.", + "nl": "Verkeerde link gebruikt, bijvoorbeeld een bookmark (bladwijzer)." }, "cause_backforward": { "no": "Bruk av \"frem\"- og \"tilbake\"-knappene i nettleseren.", @@ -187,7 +207,7 @@ "da": "Brug frem- og tilbage-knappen i browseren.", "hr": "Kori\u0161tenjem gumba za prethodnu (back) i sljede\u0107u (forward) stranicu u web pregledniku.", "zh-tw": "\u8acb\u4f7f\u7528\u7db2\u9801\u700f\u89bd\u5668\u4e2d\u7684\u4e0a\u4e00\u9801\u53ca\u4e0b\u4e00\u9801\u3002", - "nl": "Gebruik de Volgende en Terug knoppen in de web browser.", + "nl": "Gebruik van de 'Volgende'- en 'Terug'-knoppen in de web browser.", "et": "brauseri edasi-tagasi nuppude kasutamisest", "he": "\u05e9\u05d9\u05de\u05d5\u05e9 \u05d1\u05db\u05e4\u05ea\u05d5\u05e8\u05d9 \u05d4\u05d1\u05d0 \u05d5\u05d4\u05e7\u05d5\u05d3\u05dd \u05d1\u05d3\u05e4\u05d3\u05e4\u05df.", "de": "Das Benutzen der Zur\u00fcck- und Vorw\u00e4rts-Schaltfl\u00e4chen im Web-Browser.", @@ -200,7 +220,9 @@ "ru": "\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u043a\u043b\u0430\u0432\u0438\u0448\u0438 \"\u0412\u043f\u0435\u0440\u0435\u0434\" \"\u041d\u0430\u0437\u0430\u0434\" \u0432 \u0431\u0440\u043e\u0443\u0437\u0435\u0440\u0435.", "cs": "Pou\u017eit\u00edm tla\u010d\u00edtek zp\u011bt a vp\u0159ed ve webv\u00e9m prohl\u00ed\u017ee\u010di.", "eu": "Zure web nabigatzaileko atzera eta aurrera botoiak erabiltzen.", - "el": "\u039c\u03b5\u03c4\u03b1\u03b2\u03ae\u03ba\u03b1\u03c4\u03b5 \u03c0\u03af\u03c3\u03c9 \u03ba\u03b1\u03b9 \u03b5\u03bc\u03c0\u03c1\u03cc\u03c2 \u03c3\u03c4\u03bf \u03b9\u03c3\u03c4\u03bf\u03c1\u03b9\u03ba\u03cc \u03c4\u03bf\u03c5 \u03c0\u03c1\u03bf\u03b3\u03c1\u03ac\u03bc\u03bc\u03b1\u03c4\u03bf\u03c2 \u03c0\u03b5\u03c1\u03b9\u03ae\u03b3\u03b7\u03c3\u03b7\u03c2 \u03b9\u03c3\u03c4\u03bf\u03cd." + "el": "\u039c\u03b5\u03c4\u03b1\u03b2\u03ae\u03ba\u03b1\u03c4\u03b5 \u03c0\u03af\u03c3\u03c9 \u03ba\u03b1\u03b9 \u03b5\u03bc\u03c0\u03c1\u03cc\u03c2 \u03c3\u03c4\u03bf \u03b9\u03c3\u03c4\u03bf\u03c1\u03b9\u03ba\u03cc \u03c4\u03bf\u03c5 \u03c0\u03c1\u03bf\u03b3\u03c1\u03ac\u03bc\u03bc\u03b1\u03c4\u03bf\u03c2 \u03c0\u03b5\u03c1\u03b9\u03ae\u03b3\u03b7\u03c3\u03b7\u03c2 \u03b9\u03c3\u03c4\u03bf\u03cd.", + "zu": "Ukusebenzisa izinkinobho ezithi emuva naphambili kusiphequluli sewebhu.", + "xh": "Ukusebenzisa amaqhosha okuya emva naphambili kwibhrawuza yewebhu." }, "cause_openbrowser": { "no": "Starte nettleseren med faner lagret fra forrige gang.", @@ -229,7 +251,9 @@ "ru": "\u041e\u0442\u043a\u0440\u044b\u0442 \u0431\u0440\u0430\u0443\u0437\u0435\u0440 \u0441 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u043d\u044b\u043c\u0438 \u0437\u0430\u043a\u043b\u0430\u0434\u043a\u0430\u043c\u0438 \u043e\u0442 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0441\u0435\u0441\u0441\u0438\u0438.", "cs": "Otev\u0159en\u00edm webov\u00e9ho prohl\u00ed\u017ee\u010de se z\u00e1lo\u017ekami z p\u0159edchoz\u00edho sezen\u00ed.", "eu": "Zure web nabigatzailea aurreko saiotik gordeta zeuden fitxekin ireki duzu.", - "el": "\u0391\u03bd\u03bf\u03af\u03be\u03b1\u03c4\u03b5 \u03c4\u03bf \u03c0\u03c1\u03cc\u03b3\u03c1\u03b1\u03bc\u03bc\u03b1 \u03c0\u03b5\u03c1\u03b9\u03ae\u03b3\u03b7\u03c3\u03b7\u03c2 \u03b9\u03c3\u03c4\u03bf\u03cd \u03ba\u03b1\u03b9 \u03b5\u03c0\u03b1\u03bd\u03b1\u03c6\u03ad\u03c1\u03b1\u03c4\u03b5 \u03ba\u03b1\u03c1\u03c4\u03ad\u03bb\u03b5\u03c2 \u03c0\u03c1\u03bf\u03b7\u03b3\u03bf\u03cd\u03bc\u03b5\u03bd\u03b7\u03c2 \u03c3\u03c5\u03bd\u03b5\u03b4\u03c1\u03af\u03b1\u03c2." + "el": "\u0391\u03bd\u03bf\u03af\u03be\u03b1\u03c4\u03b5 \u03c4\u03bf \u03c0\u03c1\u03cc\u03b3\u03c1\u03b1\u03bc\u03bc\u03b1 \u03c0\u03b5\u03c1\u03b9\u03ae\u03b3\u03b7\u03c3\u03b7\u03c2 \u03b9\u03c3\u03c4\u03bf\u03cd \u03ba\u03b1\u03b9 \u03b5\u03c0\u03b1\u03bd\u03b1\u03c6\u03ad\u03c1\u03b1\u03c4\u03b5 \u03ba\u03b1\u03c1\u03c4\u03ad\u03bb\u03b5\u03c2 \u03c0\u03c1\u03bf\u03b7\u03b3\u03bf\u03cd\u03bc\u03b5\u03bd\u03b7\u03c2 \u03c3\u03c5\u03bd\u03b5\u03b4\u03c1\u03af\u03b1\u03c2.", + "xh": "Kuvulwe ibhrawuza yewebhu ngeethebhu eziseyivwe kwiseshoni edlulileyo.", + "zu": "Kuvulwe isiphequluli sewebhu ngamathebhu alondolozwe kuseshini yangaphambilini." }, "cause_nocookie": { "no": "At informasjonskapsler ikke er aktivert i nettleseren.", @@ -258,7 +282,9 @@ "ru": "\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435 \u043e\u0442\u043a\u043b\u044e\u0447\u0435\u043d\u044b Cookies.", "cs": "Ve webov\u00e9m prohl\u00ed\u017ee\u010di mohou b\u00fdt zak\u00e1z\u00e1ny cookies.", "eu": "Cookie-ak desgaituta egon litezke nabigatzailean.", - "el": "\u0397 \u03bb\u03b5\u03b9\u03c4\u03bf\u03c5\u03c1\u03b3\u03af\u03b1 cookie \u03b5\u03af\u03bd\u03b1\u03b9 \u03b1\u03c0\u03b5\u03bd\u03b5\u03c1\u03b3\u03bf\u03c0\u03bf\u03b9\u03b7\u03bc\u03ad\u03bd\u03b7 \u03c3\u03c4\u03bf \u03c0\u03c1\u03cc\u03b3\u03c1\u03b1\u03bc\u03bc\u03b1 \u03c0\u03b5\u03c1\u03b9\u03ae\u03b3\u03b7\u03c3\u03b7\u03c2 \u03b9\u03c3\u03c4\u03bf\u03cd." + "el": "\u0397 \u03bb\u03b5\u03b9\u03c4\u03bf\u03c5\u03c1\u03b3\u03af\u03b1 cookie \u03b5\u03af\u03bd\u03b1\u03b9 \u03b1\u03c0\u03b5\u03bd\u03b5\u03c1\u03b3\u03bf\u03c0\u03bf\u03b9\u03b7\u03bc\u03ad\u03bd\u03b7 \u03c3\u03c4\u03bf \u03c0\u03c1\u03cc\u03b3\u03c1\u03b1\u03bc\u03bc\u03b1 \u03c0\u03b5\u03c1\u03b9\u03ae\u03b3\u03b7\u03c3\u03b7\u03c2 \u03b9\u03c3\u03c4\u03bf\u03cd.", + "xh": "Iikhuki zisenokwenziwa zingasebenzi kwibhrawuza yewebhu.", + "zu": "Amakhukhi kungenzeka ukuthi ayekisiwe kusiphequluli sewebhu." }, "report_header": { "no": "Rapporter denne feilen", @@ -287,7 +313,9 @@ "ru": "\u0421\u043e\u043e\u0431\u0449\u0438\u0442\u044c \u043e \u0434\u0430\u043d\u043d\u043e\u0439 \u043e\u0448\u0438\u0431\u043a\u0435", "cs": "Nahl\u00e1sit tuto chybu", "eu": "Errore honen berri eman", - "el": "\u0391\u03bd\u03b1\u03c6\u03bf\u03c1\u03ac \u03c3\u03c6\u03ac\u03bb\u03bc\u03b1\u03c4\u03bf\u03c2" + "el": "\u0391\u03bd\u03b1\u03c6\u03bf\u03c1\u03ac \u03c3\u03c6\u03ac\u03bb\u03bc\u03b1\u03c4\u03bf\u03c2", + "xh": "Chaza le mpazamo", + "zu": "Bika leli phutha" }, "report_text": { "no": "Hvis problemet vedvarer, kan du rapportere det til systemadministratorene.", @@ -316,6 +344,8 @@ "ru": "\u0415\u0441\u043b\u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f, \u0441\u043e\u043e\u0431\u0449\u0438\u0442\u044c \u043e\u0431 \u044d\u0442\u043e\u043c \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0443.", "cs": "Pokud probl\u00e9m p\u0159etrv\u00e1v\u00e1, m\u016f\u017eete ho nahl\u00e1sit spr\u00e1vci.", "eu": "Arazoak bere horretan badirau, sistemaren administratzaileei berri eman diezaiekezu.", - "el": "\u0391\u03bd \u03c4\u03bf \u03c0\u03c1\u03cc\u03b2\u03bb\u03b7\u03bc\u03b1 \u03b5\u03be\u03b1\u03ba\u03bf\u03bb\u03bf\u03c5\u03b8\u03b5\u03af \u03bd\u03b1 \u03c5\u03c6\u03af\u03c3\u03c4\u03b1\u03c4\u03b1\u03b9, \u03bc\u03c0\u03bf\u03c1\u03b5\u03af\u03c4\u03b5 \u03bd\u03b1 \u03c4\u03bf \u03b1\u03bd\u03b1\u03c6\u03ad\u03c1\u03b5\u03c4\u03b5 \u03c3\u03c4\u03bf\u03c5\u03c2 \u03b4\u03b9\u03b1\u03c7\u03b5\u03b9\u03c1\u03b9\u03c3\u03c4\u03ad\u03c2 \u03c4\u03bf\u03c5 \u03c3\u03c5\u03c3\u03c4\u03ae\u03bc\u03b1\u03c4\u03bf\u03c2." + "el": "\u0391\u03bd \u03c4\u03bf \u03c0\u03c1\u03cc\u03b2\u03bb\u03b7\u03bc\u03b1 \u03b5\u03be\u03b1\u03ba\u03bf\u03bb\u03bf\u03c5\u03b8\u03b5\u03af \u03bd\u03b1 \u03c5\u03c6\u03af\u03c3\u03c4\u03b1\u03c4\u03b1\u03b9, \u03bc\u03c0\u03bf\u03c1\u03b5\u03af\u03c4\u03b5 \u03bd\u03b1 \u03c4\u03bf \u03b1\u03bd\u03b1\u03c6\u03ad\u03c1\u03b5\u03c4\u03b5 \u03c3\u03c4\u03bf\u03c5\u03c2 \u03b4\u03b9\u03b1\u03c7\u03b5\u03b9\u03c1\u03b9\u03c3\u03c4\u03ad\u03c2 \u03c4\u03bf\u03c5 \u03c3\u03c5\u03c3\u03c4\u03ae\u03bc\u03b1\u03c4\u03bf\u03c2.", + "xh": "Ukuba le ngxaki iyaqhubeka, ungayichaza kubalawuli besistim.", + "zu": "Uma le nkinga iphikelela, ungayibika kubalawuli besistimu." } } diff --git a/vendor/simplesamlphp/simplesamlphp/modules/core/docs/authproc_attributelimit.md b/vendor/simplesamlphp/simplesamlphp/modules/core/docs/authproc_attributelimit.md index 5b640fd821..73c4406efd 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/core/docs/authproc_attributelimit.md +++ b/vendor/simplesamlphp/simplesamlphp/modules/core/docs/authproc_attributelimit.md @@ -32,6 +32,41 @@ Allow `eduPersonTargetedID` and `eduPersonAffiliation` by default, but allow the ), ), +Only allow specific values for an attribute. + + 'authproc' => array( + 50 => array( + 'class' => 'core:AttributeLimit', + 'eduPersonEntitlement' => array('urn:x-surfnet:surf.nl:surfdrive:quota:100') + ), + ), + +Only allow specific values for an attribute ignoring case. + + 'authproc' => array( + 50 => array( + 'class' => 'core:AttributeLimit', + 'eduPersonEntitlement' => array( + 'ignoreCase' => true, + 'URN:x-surfnet:surf.nl:SURFDRIVE:quota:100' + ) + ), + ), + +Only allow specific values for an attribute that match a regex pattern + + 'authproc' => array( + 50 => array( + 'class' => 'core:AttributeLimit', + 'eduPersonEntitlement' => array( + 'regex' => true, + '/^urn:x-surfnet:surf/', + '/^urn:x-IGNORE_Case/i', + ) + ), + ), + + Don't allow any attributes by default, but allow the metadata to override it. 'authproc' => array( diff --git a/vendor/simplesamlphp/simplesamlphp/modules/core/docs/authproc_cardinality.md b/vendor/simplesamlphp/simplesamlphp/modules/core/docs/authproc_cardinality.md new file mode 100644 index 0000000000..97b73f8661 --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/modules/core/docs/authproc_cardinality.md @@ -0,0 +1,49 @@ +`core:Cardinality` +================== + +Ensure the number of attribute values is within the specified multiplicity. + +This filter should contain a set of attribute name => rule pairs describing the multiplicity rules for an attribute. + +The special parameter `%ignoreEntities` can be used to give an array of entity IDs that should be ignored for testing, etc purposes. + +A separate [`core:CardinalitySingle`](./core:authproc_cardinalitysingle) authproc filter provides additional functionality for the special case where attributes are single valued. + +Specifying Rules +---------------- + +Multiplicity rules are specified as an associative array containing one or more of the following parameters: + +`min` +: The minimum number of values (participation) this attribute should have. Defaults to `zero`. + +`max` +: The maximum number of values (cardinality) this attribute should have. Defaults to no upper bound. + +`warn` +: Log a warning rather than generating an error. Defaults to `false`. + +For convenience, minimum and maximum values can also be specified using a shorthand list notation. + +Examples +-------- + +Require at least one `givenName`, no more than two email addresses, and between two and four values for `eduPersonScopedAffiliation`. + + 'authproc' => array( + 50 => array( + 'class' => 'core:Cardinality', + 'givenName' => array('min' => 1), + 'mail' => array('max' => 2), + 'eduPersonScopedAffiliation' => array('min' => 2, 'max' => 4), + ), + ), + +Use the shorthand notation for min, max: + + 'authproc' => array( + 50 => array( + 'class' => 'core:Cardinality', + 'mail' => array(0, 2), + ), + ), diff --git a/vendor/simplesamlphp/simplesamlphp/modules/core/docs/authproc_cardinalitysingle.md b/vendor/simplesamlphp/simplesamlphp/modules/core/docs/authproc_cardinalitysingle.md new file mode 100644 index 0000000000..62d2fa7998 --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/modules/core/docs/authproc_cardinalitysingle.md @@ -0,0 +1,88 @@ +`core:CardinalitySingle` +======================== + +Ensure the correct cardinality of single-valued attributes. This filter is a special case +of the more generic [`core:Cardinality`](./core:authproc_cardinality) filter that allows for optional corrective measures +when multi-valued attributes are received where single-valued ones are expected. + +Parameters +---------- + +This filter implements a number of optional parameters: + +`singleValued` +: array of attribute names that *must* be single-valued, or a 403 error is generated. + +`firstValue` +: array of attribute names where only the first value of a multi-valued assertion should be returned. + +`flatten` +: array of attribute names where a multi-valued assertion is flattened into a single delimited string. + +`flattenWith` +: the delimiter for `flatten`. Defaults to ";". + +`ignoreEntities` +: array of entity IDs that should be ignored for testing, etc purposes. + +When the same attribute name appears in multiple stanzas, they are processed in the order above. + +Examples +-------- + +Abort with an error if any attribute defined as single-valued in the eduPerson or SCHAC schemas exists and has more than one value: + + 'authproc' => array( + 50 => array( + 'class' => 'core:CardinalitySingle', + 'singleValued' => array( + /* from eduPerson (internet2-mace-dir-eduperson-201602) */ + 'eduPersonOrgDN', 'eduPersonPrimaryAffiliation', 'eduPersonPrimaryOrgUnitDN', + 'eduPersonPrincipalName', 'eduPersonUniqueId', + /* from inetOrgPerson (RFC2798), referenced by internet2-mace-dir-eduperson-201602 */ + 'displayName', 'preferredLanguage', + /* from SCHAC-IAD Version 1.3.0 */ + 'schacMotherTongue', 'schacGender', 'schacDateOfBirth', 'schacPlaceOfBirth', + 'schacPersonalTitle', 'schacHomeOrganization', 'schacHomeOrganizationType', + 'schacExpiryDate', + ), + ), + ), + +Abort if multiple values are received for `eduPersonPrincipalName`, but take the first value for `eduPersonPrimaryAffiliation`: + + 'authproc' => array( + 50 => array( + 'class' => 'core:CardinalitySingle', + 'singleValued' => array('eduPersonPrincipalName'), + 'firstValue' => array('eduPersonPrimaryAffiliation'), + ), + ), + ), + +Construct `eduPersonPrimaryAffiliation` using the first value in `eduPersonAffiliation`: + + 'authproc' => array( + 50 => array( + 'class' => 'core:AttributeCopy', + 'eduPersonAffiliation' => 'eduPersonPrimaryAffiliation', + ), + 51 => array( + 'class' => 'core:CardinalitySingle', + 'firstValue' => array('eduPersonPrimaryAffiliation'), + ), + ), + +Construct a single, comma-separated value version of `eduPersonAffiliation`: + + 'authproc' => array( + 50 => array( + 'class' => 'core:AttributeCopy', + 'eduPersonAffiliation' => 'eduPersonAffiliationWithCommas', + ), + 51 => array( + 'class' => 'core:CardinalitySingle', + 'flatten' => array('eduPersonAffiliationWithCommas'), + 'flattenWith' => ',', + ), + ), diff --git a/vendor/simplesamlphp/simplesamlphp/modules/core/docs/authproc_languageadaptor.md b/vendor/simplesamlphp/simplesamlphp/modules/core/docs/authproc_languageadaptor.md index 1464b0540f..c6d681db8d 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/core/docs/authproc_languageadaptor.md +++ b/vendor/simplesamlphp/simplesamlphp/modules/core/docs/authproc_languageadaptor.md @@ -37,6 +37,6 @@ Custon attribute: 'authproc' => array( 50 => array( 'class' => 'core:LanguageAdaptor', - 'attributename' => 'lang', + 'attributename' => 'lang', ), ), diff --git a/vendor/simplesamlphp/simplesamlphp/modules/core/docs/authproc_php.md b/vendor/simplesamlphp/simplesamlphp/modules/core/docs/authproc_php.md index 66968eda1a..3f8125bd1b 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/core/docs/authproc_php.md +++ b/vendor/simplesamlphp/simplesamlphp/modules/core/docs/authproc_php.md @@ -1,7 +1,7 @@ `core:PHP` ========== -This is a filter which makes it possible to run arbitrary PHP code to modify the attributes of an user. +This is a filter which makes it possible to run arbitrary PHP code to modify the attributes or state of an user. Parameters ---------- @@ -11,8 +11,14 @@ Parameters It must be `'core:PHP'`. `code` -: The PHP code that should be run. This code will have only one variable available: `$attributes`. +: The PHP code that should be run. This code will have two variables available: + +* `$attributes`. This is an associative array of attributes, and can be modified to add or remove attributes. + +* `$state`. + This is an associative array of request state. It can be modified to adjust data related to the authentication + such as desired NameId, requested Attributes, authnContextRef and many more. Examples -------- @@ -43,3 +49,10 @@ Create a random number variable: ); ', ), + +Force a specific NameIdFormat. Useful if an SP misbehaves and requests (or publishes) an incorrect NameId + + 90 => array( + 'class' => 'core:PHP', + 'code' => '$state["saml:NameIDFormat"] = ["Format" => "urn:oasis:names:tc:SAML:2.0:nameid-format:transient", "AllowCreate" => true];' + ), diff --git a/vendor/simplesamlphp/simplesamlphp/modules/core/docs/authproc_scopefromattribute.md b/vendor/simplesamlphp/simplesamlphp/modules/core/docs/authproc_scopefromattribute.md index 0b7f92b988..5eba851b9f 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/core/docs/authproc_scopefromattribute.md +++ b/vendor/simplesamlphp/simplesamlphp/modules/core/docs/authproc_scopefromattribute.md @@ -25,7 +25,7 @@ Set the `scope` attribute to the scope from the `eduPersonPrincipalName` attribu 'authproc' => array( 50 => array( 'class' => 'core:ScopeFromAttribute', - 'sourceAttribute' => 'eduPersonPrincipal' - 'targetAttribute' => 'scope' + 'sourceAttribute' => 'eduPersonPrincipalName', + 'targetAttribute' => 'scope', ), ), diff --git a/vendor/simplesamlphp/simplesamlphp/modules/core/docs/authproc_statisticswithattribute.md b/vendor/simplesamlphp/simplesamlphp/modules/core/docs/authproc_statisticswithattribute.md index 53753f9dbc..4607c059ea 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/core/docs/authproc_statisticswithattribute.md +++ b/vendor/simplesamlphp/simplesamlphp/modules/core/docs/authproc_statisticswithattribute.md @@ -12,6 +12,9 @@ Parameters `type` : The type of the statistics entry. +`skipPassive` +: A boolean indicating whether passive requests should be skipped. Defaults to `FALSE`, in which case the type tag is prefixed with 'passive-'. + Example ------- diff --git a/vendor/simplesamlphp/simplesamlphp/modules/core/hooks/hook_frontpage.php b/vendor/simplesamlphp/simplesamlphp/modules/core/hooks/hook_frontpage.php index aa39e76254..d2b6eef9c0 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/core/hooks/hook_frontpage.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/core/hooks/hook_frontpage.php @@ -4,29 +4,30 @@ * * @param array &$links The links on the frontpage, split into sections. */ -function core_hook_frontpage(&$links) { - assert('is_array($links)'); - assert('array_key_exists("links", $links)'); - $links['links']['frontpage_welcome'] = array( - 'href' => SimpleSAML\Module::getModuleURL('core/frontpage_welcome.php'), - 'text' => '{core:frontpage:welcome}', - 'shorttext' => '{core:frontpage:welcome}', - ); - $links['links']['frontpage_config'] = array( - 'href' => SimpleSAML\Module::getModuleURL('core/frontpage_config.php'), - 'text' => '{core:frontpage:configuration}', - 'shorttext' => '{core:frontpage:configuration}', - ); - $links['links']['frontpage_auth'] = array( - 'href' => SimpleSAML\Module::getModuleURL('core/frontpage_auth.php'), - 'text' => '{core:frontpage:auth}', - 'shorttext' => '{core:frontpage:auth}', - ); - $links['links']['frontpage_federation'] = array( - 'href' => SimpleSAML\Module::getModuleURL('core/frontpage_federation.php'), - 'text' => '{core:frontpage:federation}', - 'shorttext' => '{core:frontpage:federation}', - ); +function core_hook_frontpage(&$links) +{ + assert(is_array($links)); + assert(array_key_exists('links', $links)); + $links['links']['frontpage_welcome'] = [ + 'href' => SimpleSAML\Module::getModuleURL('core/frontpage_welcome.php'), + 'text' => '{core:frontpage:welcome}', + 'shorttext' => '{core:frontpage:welcome}', + ]; + $links['links']['frontpage_config'] = [ + 'href' => SimpleSAML\Module::getModuleURL('core/frontpage_config.php'), + 'text' => '{core:frontpage:configuration}', + 'shorttext' => '{core:frontpage:configuration}', + ]; + $links['links']['frontpage_auth'] = [ + 'href' => SimpleSAML\Module::getModuleURL('core/frontpage_auth.php'), + 'text' => '{core:frontpage:auth}', + 'shorttext' => '{core:frontpage:auth}', + ]; + $links['links']['frontpage_federation'] = [ + 'href' => SimpleSAML\Module::getModuleURL('core/frontpage_federation.php'), + 'text' => '{core:frontpage:federation}', + 'shorttext' => '{core:frontpage:federation}', + ]; } diff --git a/vendor/simplesamlphp/simplesamlphp/modules/core/hooks/hook_sanitycheck.php b/vendor/simplesamlphp/simplesamlphp/modules/core/hooks/hook_sanitycheck.php index 0ba7de6181..ef4af3049f 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/core/hooks/hook_sanitycheck.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/core/hooks/hook_sanitycheck.php @@ -4,45 +4,47 @@ * * @param array &$hookinfo hookinfo */ -function core_hook_sanitycheck(&$hookinfo) { - assert('is_array($hookinfo)'); - assert('array_key_exists("errors", $hookinfo)'); - assert('array_key_exists("info", $hookinfo)'); - $config = SimpleSAML_Configuration::getInstance(); - - if($config->getString('auth.adminpassword', '123') === '123') { - $hookinfo['errors'][] = '[core] Password in config.php is not set properly'; - } else { - $hookinfo['info'][] = '[core] Password in config.php is set properly'; - } +function core_hook_sanitycheck(&$hookinfo) +{ + assert(is_array($hookinfo)); + assert(array_key_exists('errors', $hookinfo)); + assert(array_key_exists('info', $hookinfo)); - if($config->getString('technicalcontact_email', 'na@example.org') === 'na@example.org') { - $hookinfo['errors'][] = '[core] In config.php technicalcontact_email is not set properly'; - } else { - $hookinfo['info'][] = '[core] In config.php technicalcontact_email is set properly'; - } - - if (version_compare(phpversion(), '5.4', '>=')) { - $hookinfo['info'][] = '[core] You are running a PHP version suitable for SimpleSAMLphp.'; - } else { - $hookinfo['errors'][] = '[core] You are running an old PHP installation. Please check the requirements for your SimpleSAMLphp version and upgrade.'; - } - - $info = array(); - $mihookinfo = array( - 'info' => &$info, - ); - $availmodules = SimpleSAML\Module::getModules(); - SimpleSAML\Module::callHooks('moduleinfo', $mihookinfo); - foreach($info AS $mi => $i) { - if (isset($i['dependencies']) && is_array($i['dependencies'])) { - foreach ($i['dependencies'] AS $dep) { - if (!in_array($dep, $availmodules, true)) { - $hookinfo['errors'][] = '[core] Module dependency not met: ' . $mi . ' requires ' . $dep; - } - } - } - } - + $config = \SimpleSAML\Configuration::getInstance(); + + if ($config->getString('auth.adminpassword', '123') === '123') { + $hookinfo['errors'][] = '[core] Password in config.php is not set properly'; + } else { + $hookinfo['info'][] = '[core] Password in config.php is set properly'; + } + + if ($config->getString('technicalcontact_email', 'na@example.org') === 'na@example.org') { + $hookinfo['errors'][] = '[core] In config.php technicalcontact_email is not set properly'; + } else { + $hookinfo['info'][] = '[core] In config.php technicalcontact_email is set properly'; + } + + if (version_compare(phpversion(), '5.5', '>=')) { + $hookinfo['info'][] = '[core] You are running a PHP version suitable for SimpleSAMLphp.'; + } else { + $hookinfo['errors'][] = '[core] You are running an old PHP installation. '. + 'Please check the requirements for your SimpleSAMLphp version and upgrade.'; + } + + $info = []; + $mihookinfo = [ + 'info' => &$info, + ]; + $availmodules = SimpleSAML\Module::getModules(); + SimpleSAML\Module::callHooks('moduleinfo', $mihookinfo); + foreach ($info as $mi => $i) { + if (isset($i['dependencies']) && is_array($i['dependencies'])) { + foreach ($i['dependencies'] as $dep) { + if (!in_array($dep, $availmodules, true)) { + $hookinfo['errors'][] = '[core] Module dependency not met: '.$mi.' requires '.$dep; + } + } + } + } } diff --git a/vendor/simplesamlphp/simplesamlphp/modules/core/lib/ACL.php b/vendor/simplesamlphp/simplesamlphp/modules/core/lib/ACL.php index fcfa7ecadc..2c682a3e08 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/core/lib/ACL.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/core/lib/ACL.php @@ -1,306 +1,301 @@ <?php +namespace SimpleSAML\Module\core; + /** * Generic library for access control lists. * * @package SimpleSAMLphp */ -class sspmod_core_ACL { - - /** - * The access control list, as an array. - * - * @var array - */ - private $acl; - - - /** - * Initializer for this access control list. - * - * @param array|string $acl The access control list. - */ - public function __construct($acl) { - assert('is_string($acl) || is_array($acl)'); - - if (is_string($acl)) { - $acl = self::getById($acl); - } - - foreach ($acl as $rule) { - if (!is_array($rule)) { - throw new SimpleSAML_Error_Exception('Invalid rule in access control list: ' . var_export($rule, TRUE)); - } - if (count($rule) === 0) { - throw new SimpleSAML_Error_Exception('Empty rule in access control list.'); - } - - $action = array_shift($rule); - if ($action !== 'allow' && $action !== 'deny') { - throw new SimpleSAML_Error_Exception('Invalid action in rule in access control list: ' . var_export($action, TRUE)); - } - - } - - $this->acl = $acl; - } - - - /** - * Retrieve an access control list with the given id. - * - * @param string $id The id of the access control list. - * @return array The access control list array. - */ - private static function getById($id) { - assert('is_string($id)'); - - $config = SimpleSAML_Configuration::getOptionalConfig('acl.php'); - if (!$config->hasValue($id)) { - throw new SimpleSAML_Error_Exception('No ACL with id ' . var_export($id, TRUE) . ' in config/acl.php.'); - } - - return $config->getArray($id); - } - - - /** - * Match the attributes against the access control list. - * - * @param array $attributes The attributes of an user. - * @return boolean TRUE if the user is allowed to access the resource, FALSE if not. - */ - public function allows(array $attributes) { - - foreach ($this->acl as $rule) { - $action = array_shift($rule); - - if (!self::match($attributes, $rule)) { - continue; - } - - if ($action === 'allow') { - return TRUE; - } else { - return FALSE; - } - } - } - - - /** - * Match the attributes against the given rule. - * - * @param array $attributes The attributes of an user. - * @param array $rule The rule we should check. - * @return boolean TRUE if the rule matches, FALSE if not. - */ - private static function match(array $attributes, array $rule) { - - $op = array_shift($rule); - if ($op === NULL) { - // An empty rule always matches - return TRUE; - } - - switch($op) { - case 'and': - return self::opAnd($attributes, $rule); - case 'equals': - return self::opEquals($attributes, $rule); - case 'equals-preg': - return self::opEqualsPreg($attributes, $rule); - case 'has': - return self::opHas($attributes, $rule); - case 'has-preg': - return self::opHasPreg($attributes, $rule); - case 'not': - return !self::match($attributes, $rule); - case 'or': - return self::opOr($attributes, $rule); - default: - throw new SimpleSAML_Error_Exception('Invalid ACL operation: ' . var_export($op, TRUE)); - } - } - - - /** - * 'and' match operator. - * - * @param array $attributes The attributes of an user. - * @param array $rule The rule we should check. - * @return boolean TRUE if the rule matches, FALSE if not. - */ - private static function opAnd($attributes, $rule) { - - foreach ($rule as $subRule) { - if (!self::match($attributes, $subRule)) { - return FALSE; - } - } - - // All matches - return TRUE; - } - - - /** - * 'equals' match operator. - * - * @param array $attributes The attributes of an user. - * @param array $rule The rule we should check. - * @return boolean TRUE if the rule matches, FALSE if not. - */ - private static function opEquals($attributes, $rule) { - - $attributeName = array_shift($rule); - - if (!array_key_exists($attributeName, $attributes)) { - $attributeValues = array(); - } else { - $attributeValues = $attributes[$attributeName]; - } - - foreach ($rule as $value) { - $found = FALSE; - foreach ($attributeValues as $i => $v) { - if ($value !== $v) { - continue; - } - unset($attributeValues[$i]); - $found = TRUE; - break; - } - if (!$found) { - return FALSE; - } - } - if (!empty($attributeValues)) { - /* One of the attribute values didn't match. */ - return FALSE; - } - - /* All the values in the attribute matched one in the rule. */ - return TRUE; - } - - - /** - * 'equals-preg' match operator. - * - * @param array $attributes The attributes of an user. - * @param array $rule The rule we should check. - * @return boolean TRUE if the rule matches, FALSE if not. - */ - private static function opEqualsPreg($attributes, $rule) { - - $attributeName = array_shift($rule); - - if (!array_key_exists($attributeName, $attributes)) { - $attributeValues = array(); - } else { - $attributeValues = $attributes[$attributeName]; - } - - foreach ($rule as $pattern) { - $found = FALSE; - foreach ($attributeValues as $i => $v) { - if (!preg_match($pattern, $v)) { - continue; - } - unset($attributeValues[$i]); - $found = TRUE; - break; - } - if (!$found) { - return FALSE; - } - } - - if (!empty($attributeValues)) { - /* One of the attribute values didn't match. */ - return FALSE; - } - - /* All the values in the attribute matched one in the rule. */ - return TRUE; - } - - - /** - * 'has' match operator. - * - * @param array $attributes The attributes of an user. - * @param array $rule The rule we should check. - * @return boolean TRUE if the rule matches, FALSE if not. - */ - private static function opHas($attributes, $rule) { - - $attributeName = array_shift($rule); - - if (!array_key_exists($attributeName, $attributes)) { - $attributeValues = array(); - } else { - $attributeValues = $attributes[$attributeName]; - } - - foreach ($rule as $value) { - if (!in_array($value, $attributeValues, TRUE)) { - return FALSE; - } - } - - /* Found all values in the rule in the attribute. */ - return TRUE; - } - - - /** - * 'has-preg' match operator. - * - * @param array $attributes The attributes of an user. - * @param array $rule The rule we should check. - * @return boolean TRUE if the rule matches, FALSE if not. - */ - private static function opHasPreg($attributes, $rule) { - - $attributeName = array_shift($rule); - - if (!array_key_exists($attributeName, $attributes)) { - $attributeValues = array(); - } else { - $attributeValues = $attributes[$attributeName]; - } - - foreach ($rule as $pattern) { - $matches = preg_grep($pattern, $attributeValues); - if (count($matches) === 0) { - return FALSE; - } - } - - /* Found all values in the rule in the attribute. */ - return TRUE; - } - - - /** - * 'or' match operator. - * - * @param array $attributes The attributes of an user. - * @param array $rule The rule we should check. - * @return boolean TRUE if the rule matches, FALSE if not. - */ - private static function opOr($attributes, $rule) { - - foreach ($rule as $subRule) { - if (self::match($attributes, $subRule)) { - return TRUE; - } - } - - /* None matches. */ - return FALSE; - } +class ACL +{ + /** + * The access control list, as an array. + * + * @var array + */ + private $acl; + + /** + * Initializer for this access control list. + * + * @param array|string $acl The access control list. + */ + public function __construct($acl) + { + assert(is_string($acl) || is_array($acl)); + + if (is_string($acl)) { + $acl = self::getById($acl); + } + + foreach ($acl as $rule) { + if (!is_array($rule)) { + throw new \SimpleSAML\Error\Exception('Invalid rule in access control list: '.var_export($rule, true)); + } + if (count($rule) === 0) { + throw new \SimpleSAML\Error\Exception('Empty rule in access control list.'); + } + + $action = array_shift($rule); + if ($action !== 'allow' && $action !== 'deny') { + throw new \SimpleSAML\Error\Exception( + 'Invalid action in rule in access control list: '.var_export($action, true) + ); + } + } + $this->acl = $acl; + } + + /** + * Retrieve an access control list with the given id. + * + * @param string $id The id of the access control list. + * @return array The access control list array. + */ + private static function getById($id) + { + assert(is_string($id)); + + $config = \SimpleSAML\Configuration::getOptionalConfig('acl.php'); + if (!$config->hasValue($id)) { + throw new \SimpleSAML\Error\Exception('No ACL with id '.var_export($id, true).' in config/acl.php.'); + } + + return $config->getArray($id); + } + + /** + * Match the attributes against the access control list. + * + * @param array $attributes The attributes of an user. + * @return boolean TRUE if the user is allowed to access the resource, FALSE if not. + */ + public function allows(array $attributes) + { + foreach ($this->acl as $rule) { + $action = array_shift($rule); + + if (!self::match($attributes, $rule)) { + continue; + } + + if ($action === 'allow') { + return true; + } else { + return false; + } + } + return false; + } + + /** + * Match the attributes against the given rule. + * + * @param array $attributes The attributes of an user. + * @param array $rule The rule we should check. + * @return boolean TRUE if the rule matches, FALSE if not. + */ + private static function match(array $attributes, array $rule) + { + $op = array_shift($rule); + if ($op === null) { + // An empty rule always matches + return true; + } + + switch ($op) { + case 'and': + return self::opAnd($attributes, $rule); + case 'equals': + return self::opEquals($attributes, $rule); + case 'equals-preg': + return self::opEqualsPreg($attributes, $rule); + case 'has': + return self::opHas($attributes, $rule); + case 'has-preg': + return self::opHasPreg($attributes, $rule); + case 'not': + return !self::match($attributes, $rule); + case 'or': + return self::opOr($attributes, $rule); + default: + throw new \SimpleSAML\Error\Exception('Invalid ACL operation: '.var_export($op, true)); + } + } + + /** + * 'and' match operator. + * + * @param array $attributes The attributes of an user. + * @param array $rule The rule we should check. + * @return boolean TRUE if the rule matches, FALSE if not. + */ + private static function opAnd($attributes, $rule) + { + foreach ($rule as $subRule) { + if (!self::match($attributes, $subRule)) { + return false; + } + } + + // All matches + return true; + } + + /** + * 'equals' match operator. + * + * @param array $attributes The attributes of an user. + * @param array $rule The rule we should check. + * @return boolean TRUE if the rule matches, FALSE if not. + */ + private static function opEquals($attributes, $rule) + { + $attributeName = array_shift($rule); + + if (!array_key_exists($attributeName, $attributes)) { + $attributeValues = []; + } else { + $attributeValues = $attributes[$attributeName]; + } + + foreach ($rule as $value) { + $found = false; + foreach ($attributeValues as $i => $v) { + if ($value !== $v) { + continue; + } + unset($attributeValues[$i]); + $found = true; + break; + } + if (!$found) { + return false; + } + } + if (!empty($attributeValues)) { + // One of the attribute values didn't match + return false; + } + + // All the values in the attribute matched one in the rule + return true; + } + + /** + * 'equals-preg' match operator. + * + * @param array $attributes The attributes of an user. + * @param array $rule The rule we should check. + * @return boolean TRUE if the rule matches, FALSE if not. + */ + private static function opEqualsPreg($attributes, $rule) + { + $attributeName = array_shift($rule); + + if (!array_key_exists($attributeName, $attributes)) { + $attributeValues = []; + } else { + $attributeValues = $attributes[$attributeName]; + } + + foreach ($rule as $pattern) { + $found = false; + foreach ($attributeValues as $i => $v) { + if (!preg_match($pattern, $v)) { + continue; + } + unset($attributeValues[$i]); + $found = true; + break; + } + if (!$found) { + return false; + } + } + + if (!empty($attributeValues)) { + // One of the attribute values didn't match + return false; + } + + // All the values in the attribute matched one in the rule + return true; + } + + /** + * 'has' match operator. + * + * @param array $attributes The attributes of an user. + * @param array $rule The rule we should check. + * @return boolean TRUE if the rule matches, FALSE if not. + */ + private static function opHas($attributes, $rule) + { + $attributeName = array_shift($rule); + + if (!array_key_exists($attributeName, $attributes)) { + $attributeValues = []; + } else { + $attributeValues = $attributes[$attributeName]; + } + + foreach ($rule as $value) { + if (!in_array($value, $attributeValues, true)) { + return false; + } + } + + // Found all values in the rule in the attribute + return true; + } + + /** + * 'has-preg' match operator. + * + * @param array $attributes The attributes of an user. + * @param array $rule The rule we should check. + * @return boolean TRUE if the rule matches, FALSE if not. + */ + private static function opHasPreg($attributes, $rule) + { + $attributeName = array_shift($rule); + + if (!array_key_exists($attributeName, $attributes)) { + $attributeValues = []; + } else { + $attributeValues = $attributes[$attributeName]; + } + + foreach ($rule as $pattern) { + $matches = preg_grep($pattern, $attributeValues); + if (count($matches) === 0) { + return false; + } + } + + // Found all values in the rule in the attribute + return true; + } + + /** + * 'or' match operator. + * + * @param array $attributes The attributes of an user. + * @param array $rule The rule we should check. + * @return boolean TRUE if the rule matches, FALSE if not. + */ + private static function opOr($attributes, $rule) + { + foreach ($rule as $subRule) { + if (self::match($attributes, $subRule)) { + return true; + } + } + + // None matches + return false; + } } diff --git a/vendor/simplesamlphp/simplesamlphp/modules/core/lib/Auth/Process/AttributeAdd.php b/vendor/simplesamlphp/simplesamlphp/modules/core/lib/Auth/Process/AttributeAdd.php index 86c9c3f565..deb3ac310c 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/core/lib/Auth/Process/AttributeAdd.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/core/lib/Auth/Process/AttributeAdd.php @@ -1,5 +1,7 @@ <?php +namespace SimpleSAML\Module\core\Auth\Process; + /** * Filter to add attributes. * @@ -8,78 +10,76 @@ * @author Olav Morken, UNINETT AS. * @package SimpleSAMLphp */ -class sspmod_core_Auth_Process_AttributeAdd extends SimpleSAML_Auth_ProcessingFilter { - - /** - * Flag which indicates wheter this filter should append new values or replace old values. - */ - private $replace = FALSE; - - - /** - * Attributes which should be added/appended. - * - * Assiciative array of arrays. - */ - private $attributes = array(); - - /** - * Initialize this filter. - * - * @param array $config Configuration information about this filter. - * @param mixed $reserved For future use. - */ - public function __construct($config, $reserved) { - parent::__construct($config, $reserved); +class AttributeAdd extends \SimpleSAML\Auth\ProcessingFilter +{ + /** + * Flag which indicates wheter this filter should append new values or replace old values. + */ + private $replace = false; - assert('is_array($config)'); + /** + * Attributes which should be added/appended. + * + * Assiciative array of arrays. + */ + private $attributes = []; - foreach($config as $name => $values) { - if(is_int($name)) { - if($values === '%replace') { - $this->replace = TRUE; - } else { - throw new Exception('Unknown flag: ' . var_export($values, TRUE)); - } - continue; - } + /** + * Initialize this filter. + * + * @param array $config Configuration information about this filter. + * @param mixed $reserved For future use. + */ + public function __construct($config, $reserved) + { + parent::__construct($config, $reserved); - if(!is_array($values)) { - $values = array($values); - } - foreach($values as $value) { - if(!is_string($value)) { - throw new Exception('Invalid value for attribute ' . $name . ': ' . - var_export($values, TRUE)); - } - } + assert(is_array($config)); - $this->attributes[$name] = $values; - } - } + foreach ($config as $name => $values) { + if (is_int($name)) { + if ($values === '%replace') { + $this->replace = true; + } else { + throw new \Exception('Unknown flag: '.var_export($values, true)); + } + continue; + } + if (!is_array($values)) { + $values = [$values]; + } + foreach ($values as $value) { + if (!is_string($value)) { + throw new \Exception('Invalid value for attribute '.$name.': '.var_export($values, true)); + } + } - /** - * Apply filter to add or replace attributes. - * - * Add or replace existing attributes with the configured values. - * - * @param array &$request The current request - */ - public function process(&$request) { - assert('is_array($request)'); - assert('array_key_exists("Attributes", $request)'); + $this->attributes[$name] = $values; + } + } - $attributes =& $request['Attributes']; + /** + * Apply filter to add or replace attributes. + * + * Add or replace existing attributes with the configured values. + * + * @param array &$request The current request + */ + public function process(&$request) + { + assert(is_array($request)); + assert(array_key_exists('Attributes', $request)); - foreach($this->attributes as $name => $values) { - if($this->replace === TRUE || !array_key_exists($name, $attributes)) { - $attributes[$name] = $values; - } else { - $attributes[$name] = array_merge($attributes[$name], $values); - } - } - } + $attributes = &$request['Attributes']; + foreach ($this->attributes as $name => $values) { + if ($this->replace === true || !array_key_exists($name, $attributes)) { + $attributes[$name] = $values; + } else { + $attributes[$name] = array_merge($attributes[$name], $values); + } + } + } } diff --git a/vendor/simplesamlphp/simplesamlphp/modules/core/lib/Auth/Process/AttributeAlter.php b/vendor/simplesamlphp/simplesamlphp/modules/core/lib/Auth/Process/AttributeAlter.php index 0cad0d25ac..0d181a0d7c 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/core/lib/Auth/Process/AttributeAlter.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/core/lib/Auth/Process/AttributeAlter.php @@ -1,4 +1,7 @@ <?php + +namespace SimpleSAML\Module\core\Auth\Process; + /** * Filter to modify attributes using regular expressions * @@ -7,17 +10,18 @@ * @author Jacob Christiansen, WAYF * @package SimpleSAMLphp */ -class sspmod_core_Auth_Process_AttributeAlter extends SimpleSAML_Auth_ProcessingFilter { +class AttributeAlter extends \SimpleSAML\Auth\ProcessingFilter +{ /** * Should the pattern found be replaced? */ - private $replace = FALSE; + private $replace = false; /** * Should the value found be removed? */ - private $remove = FALSE; + private $remove = false; /** * Pattern to search for. @@ -27,7 +31,7 @@ class sspmod_core_Auth_Process_AttributeAlter extends SimpleSAML_Auth_Processing /** * String to replace the pattern found with. */ - private $replacement = FALSE; + private $replacement = false; /** * Attribute to search in @@ -44,44 +48,37 @@ class sspmod_core_Auth_Process_AttributeAlter extends SimpleSAML_Auth_Processing * * @param array $config Configuration information about this filter. * @param mixed $reserved For future use. - * @throws SimpleSAML_Error_Exception In case of invalid configuration. + * @throws \SimpleSAML\Error\Exception In case of invalid configuration. */ - public function __construct($config, $reserved) { + public function __construct($config, $reserved) + { parent::__construct($config, $reserved); - assert('is_array($config)'); + assert(is_array($config)); // parse filter configuration foreach ($config as $name => $value) { if (is_int($name)) { // check if this is an option - if($value === '%replace') { - $this->replace = TRUE; + if ($value === '%replace') { + $this->replace = true; } elseif ($value === '%remove') { - $this->remove = TRUE; + $this->remove = true; } else { - throw new SimpleSAML_Error_Exception('Unknown flag : ' . var_export($value, TRUE)); + throw new \SimpleSAML\Error\Exception('Unknown flag : '.var_export($value, true)); } continue; - } - - // Set pattern - if ($name === 'pattern') { + } elseif ($name === 'pattern') { + // Set pattern $this->pattern = $value; - } - - // Set replacement - if ($name === 'replacement') { + } elseif ($name === 'replacement') { + // Set replacement $this->replacement = $value; - } - - // Set subject - if ($name === 'subject') { + } elseif ($name === 'subject') { + // Set subject $this->subject = $value; - } - - // Set target - if ($name === 'target') { + } elseif ($name === 'target') { + // Set target $this->target = $value; } } @@ -93,31 +90,32 @@ public function __construct($config, $reserved) { * Modify existing attributes with the configured values. * * @param array &$request The current request. - * @throws SimpleSAML_Error_Exception In case of invalid configuration. + * @throws \SimpleSAML\Error\Exception In case of invalid configuration. */ - public function process(&$request) { - assert('is_array($request)'); - assert('array_key_exists("Attributes", $request)'); + public function process(&$request) + { + assert(is_array($request)); + assert(array_key_exists('Attributes', $request)); // get attributes from request - $attributes =& $request['Attributes']; + $attributes = &$request['Attributes']; // check that all required params are set in config if (empty($this->pattern) || empty($this->subject)) { - throw new SimpleSAML_Error_Exception("Not all params set in config."); + throw new \SimpleSAML\Error\Exception("Not all params set in config."); } if (!$this->replace && !$this->remove && $this->replacement === false) { - throw new SimpleSAML_Error_Exception("'replacement' must be set if neither '%replace' nor ". + throw new \SimpleSAML\Error\Exception("'replacement' must be set if neither '%replace' nor ". "'%remove' are set."); } if (!$this->replace && $this->replacement === null) { - throw new SimpleSAML_Error_Exception("'%replace' must be set if 'replacement' is null."); + throw new \SimpleSAML\Error\Exception("'%replace' must be set if 'replacement' is null."); } if ($this->replace && $this->remove) { - throw new SimpleSAML_Error_Exception("'%replace' and '%remove' cannot be used together."); + throw new \SimpleSAML\Error\Exception("'%replace' and '%remove' cannot be used together."); } if (empty($this->target)) { @@ -126,7 +124,7 @@ public function process(&$request) { } if ($this->subject !== $this->target && $this->remove) { - throw new SimpleSAML_Error_Exception("Cannot use '%remove' when 'target' is different than 'subject'."); + throw new \SimpleSAML\Error\Exception("Cannot use '%remove' when 'target' is different than 'subject'."); } if (!array_key_exists($this->subject, $attributes)) { @@ -134,27 +132,29 @@ public function process(&$request) { return; } - if ($this->replace) { // replace the whole value + if ($this->replace) { + // replace the whole value foreach ($attributes[$this->subject] as &$value) { - $matches = array(); + $matches = []; if (preg_match($this->pattern, $value, $matches) > 0) { $new_value = $matches[0]; - if ($this->replacement !== FALSE) { + if ($this->replacement !== false) { $new_value = $this->replacement; } if ($this->subject === $this->target) { $value = $new_value; } else { - $attributes[$this->target] = array($new_value); + $attributes[$this->target] = [$new_value]; } } } - } elseif ($this->remove) { // remove the whole value - $removedAttrs = array(); + } elseif ($this->remove) { + // remove the whole value + $removedAttrs = []; foreach ($attributes[$this->subject] as $value) { - $matches = array(); + $matches = []; if (preg_match($this->pattern, $value, $matches) > 0) { $removedAttrs[] = $value; } @@ -164,14 +164,23 @@ public function process(&$request) { if (empty($attributes[$this->target])) { unset($attributes[$this->target]); } - } else { // replace only the part that matches + } else { + // replace only the part that matches if ($this->subject === $this->target) { - $attributes[$this->target] = preg_replace($this->pattern, $this->replacement, - $attributes[$this->subject]); + $attributes[$this->target] = preg_replace( + $this->pattern, + $this->replacement, + $attributes[$this->subject] + ); } else { - $attributes[$this->target] = array_diff(preg_replace($this->pattern, $this->replacement, - $attributes[$this->subject]), - $attributes[$this->subject]); + $attributes[$this->target] = array_diff( + preg_replace( + $this->pattern, + $this->replacement, + $attributes[$this->subject] + ), + $attributes[$this->subject] + ); } } } diff --git a/vendor/simplesamlphp/simplesamlphp/modules/core/lib/Auth/Process/AttributeCopy.php b/vendor/simplesamlphp/simplesamlphp/modules/core/lib/Auth/Process/AttributeCopy.php index 4b83e05573..1b54da17ae 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/core/lib/Auth/Process/AttributeCopy.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/core/lib/Auth/Process/AttributeCopy.php @@ -1,5 +1,7 @@ <?php +namespace SimpleSAML\Module\core\Auth\Process; + /** * Attribute filter for renaming attributes. * @@ -15,62 +17,61 @@ * ), * */ -class sspmod_core_Auth_Process_AttributeCopy extends SimpleSAML_Auth_ProcessingFilter { - - /** - * Assosiative array with the mappings of attribute names. - */ - private $map = array(); - - - /** - * Initialize this filter, parse configuration - * - * @param array $config Configuration information about this filter. - * @param mixed $reserved For future use. - */ - public function __construct($config, $reserved) { - parent::__construct($config, $reserved); - - assert('is_array($config)'); - foreach($config as $source => $destination) { +class AttributeCopy extends \SimpleSAML\Auth\ProcessingFilter +{ + /** + * Assosiative array with the mappings of attribute names. + */ + private $map = []; - if(!is_string($source)) { - throw new Exception('Invalid source attribute name: ' . var_export($source, TRUE)); - } + /** + * Initialize this filter, parse configuration + * + * @param array $config Configuration information about this filter. + * @param mixed $reserved For future use. + */ + public function __construct($config, $reserved) + { + parent::__construct($config, $reserved); - if(!is_string($destination) && !is_array($destination)) { - throw new Exception('Invalid destination attribute name: ' . var_export($destination, TRUE)); - } + assert(is_array($config)); - $this->map[$source] = $destination; - } - } + foreach ($config as $source => $destination) { + if (!is_string($source)) { + throw new \Exception('Invalid source attribute name: '.var_export($source, true)); + } + if (!is_string($destination) && !is_array($destination)) { + throw new \Exception('Invalid destination attribute name: '.var_export($destination, true)); + } - /** - * Apply filter to rename attributes. - * - * @param array &$request The current request - */ - public function process(&$request) { - assert('is_array($request)'); - assert('array_key_exists("Attributes", $request)'); + $this->map[$source] = $destination; + } + } - $attributes =& $request['Attributes']; + /** + * Apply filter to rename attributes. + * + * @param array &$request The current request + */ + public function process(&$request) + { + assert(is_array($request)); + assert(array_key_exists('Attributes', $request)); - foreach($attributes as $name => $values) { - if (array_key_exists($name,$this->map)){ - if (!is_array($this->map[$name])) { - $attributes[$this->map[$name]] = $values; - } else { - foreach ($this->map[$name] as $to_map) { - $attributes[$to_map] = $values; - } - } - } - } + $attributes = &$request['Attributes']; - } + foreach ($attributes as $name => $values) { + if (array_key_exists($name, $this->map)) { + if (!is_array($this->map[$name])) { + $attributes[$this->map[$name]] = $values; + } else { + foreach ($this->map[$name] as $to_map) { + $attributes[$to_map] = $values; + } + } + } + } + } } diff --git a/vendor/simplesamlphp/simplesamlphp/modules/core/lib/Auth/Process/AttributeLimit.php b/vendor/simplesamlphp/simplesamlphp/modules/core/lib/Auth/Process/AttributeLimit.php index 46d664bc1f..b90d1b0cde 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/core/lib/Auth/Process/AttributeLimit.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/core/lib/Auth/Process/AttributeLimit.php @@ -1,127 +1,169 @@ <?php +namespace SimpleSAML\Module\core\Auth\Process; + /** * A filter for limiting which attributes are passed on. * * @author Olav Morken, UNINETT AS. * @package SimpleSAMLphp */ -class sspmod_core_Auth_Process_AttributeLimit extends SimpleSAML_Auth_ProcessingFilter { - - /** - * List of attributes which this filter will allow through. - */ - private $allowedAttributes = array(); - - - /** - * Whether the 'attributes' option in the metadata takes precedence. - * - * @var bool - */ - private $isDefault = FALSE; - - - /** - * Initialize this filter. - * - * @param array $config Configuration information about this filter. - * @param mixed $reserved For future use - * @throws SimpleSAML_Error_Exception If invalid configuration is found. - */ - public function __construct($config, $reserved) { - parent::__construct($config, $reserved); - assert('is_array($config)'); - - foreach ($config as $index => $value) { - if ($index === 'default') { - $this->isDefault = (bool)$value; - } elseif (is_int($index)) { - if (!is_string($value)) { - throw new SimpleSAML_Error_Exception('AttributeLimit: Invalid attribute name: ' . - var_export($value, TRUE)); - } - $this->allowedAttributes[] = $value; +class AttributeLimit extends \SimpleSAML\Auth\ProcessingFilter +{ + /** + * List of attributes which this filter will allow through. + */ + private $allowedAttributes = []; + + /** + * Whether the 'attributes' option in the metadata takes precedence. + * + * @var bool + */ + private $isDefault = false; + + /** + * Initialize this filter. + * + * @param array $config Configuration information about this filter. + * @param mixed $reserved For future use + * @throws \SimpleSAML\Error\Exception If invalid configuration is found. + */ + public function __construct($config, $reserved) + { + parent::__construct($config, $reserved); + + assert(is_array($config)); + + foreach ($config as $index => $value) { + if ($index === 'default') { + $this->isDefault = (bool) $value; + } elseif (is_int($index)) { + if (!is_string($value)) { + throw new \SimpleSAML\Error\Exception('AttributeLimit: Invalid attribute name: '. + var_export($value, true)); + } + $this->allowedAttributes[] = $value; } elseif (is_string($index)) { if (!is_array($value)) { - throw new SimpleSAML_Error_Exception('AttributeLimit: Values for ' . var_export($index, TRUE) . - ' must be specified in an array.'); + throw new \SimpleSAML\Error\Exception('AttributeLimit: Values for '. + var_export($index, true).' must be specified in an array.'); } $this->allowedAttributes[$index] = $value; - } else { - throw new SimpleSAML_Error_Exception('AttributeLimit: Invalid option: ' . var_export($index, TRUE)); - } - } - } - - - /** - * Get list of allowed from the SP/IdP config. - * - * @param array &$request The current request. - * @return array|NULL Array with attribute names, or NULL if no limit is placed. - */ - private static function getSPIdPAllowed(array &$request) { - - if (array_key_exists('attributes', $request['Destination'])) { - // SP Config - return $request['Destination']['attributes']; - } - if (array_key_exists('attributes', $request['Source'])) { - // IdP Config - return $request['Source']['attributes']; - } - return NULL; - } - - - /** - * Apply filter to remove attributes. - * - * Removes all attributes which aren't one of the allowed attributes. - * - * @param array &$request The current request - * @throws SimpleSAML_Error_Exception If invalid configuration is found. - */ - public function process(&$request) { - assert('is_array($request)'); - assert('array_key_exists("Attributes", $request)'); - - if ($this->isDefault) { - $allowedAttributes = self::getSPIdPAllowed($request); - if ($allowedAttributes === NULL) { - $allowedAttributes = $this->allowedAttributes; - } - } elseif (!empty($this->allowedAttributes)) { - $allowedAttributes = $this->allowedAttributes; - } else { - $allowedAttributes = self::getSPIdPAllowed($request); - if ($allowedAttributes === NULL) { - return; /* No limit on attributes. */ - } - } - - $attributes =& $request['Attributes']; - - foreach ($attributes as $name => $values) { - if (!in_array($name, $allowedAttributes, TRUE)) { + } else { + throw new \SimpleSAML\Error\Exception('AttributeLimit: Invalid option: '.var_export($index, true)); + } + } + } + + /** + * Get list of allowed from the SP/IdP config. + * + * @param array &$request The current request. + * @return array|NULL Array with attribute names, or NULL if no limit is placed. + */ + private static function getSPIdPAllowed(array &$request) + { + if (array_key_exists('attributes', $request['Destination'])) { + // SP Config + return $request['Destination']['attributes']; + } + if (array_key_exists('attributes', $request['Source'])) { + // IdP Config + return $request['Source']['attributes']; + } + return null; + } + + /** + * Apply filter to remove attributes. + * + * Removes all attributes which aren't one of the allowed attributes. + * + * @param array &$request The current request + * @throws \SimpleSAML\Error\Exception If invalid configuration is found. + */ + public function process(&$request) + { + assert(is_array($request)); + assert(array_key_exists('Attributes', $request)); + + if ($this->isDefault) { + $allowedAttributes = self::getSPIdPAllowed($request); + if ($allowedAttributes === null) { + $allowedAttributes = $this->allowedAttributes; + } + } elseif (!empty($this->allowedAttributes)) { + $allowedAttributes = $this->allowedAttributes; + } else { + $allowedAttributes = self::getSPIdPAllowed($request); + if ($allowedAttributes === null) { + // No limit on attributes + return; + } + } + + $attributes = &$request['Attributes']; + + foreach ($attributes as $name => $values) { + if (!in_array($name, $allowedAttributes, true)) { // the attribute name is not in the array of allowed attributes if (array_key_exists($name, $allowedAttributes)) { // but it is an index of the array if (!is_array($allowedAttributes[$name])) { - throw new SimpleSAML_Error_Exception('AttributeLimit: Values for ' . var_export($name, TRUE) . - ' must be specified in an array.'); + throw new \SimpleSAML\Error\Exception('AttributeLimit: Values for '. + var_export($name, true).' must be specified in an array.'); } - $attributes[$name] = array_intersect($attributes[$name], $allowedAttributes[$name]); + $attributes[$name] = $this->filterAttributeValues($attributes[$name], $allowedAttributes[$name]); if (!empty($attributes[$name])) { continue; } } unset($attributes[$name]); - } - } - - } - + } + } + } + + /** + * Perform the filtering of attributes + * @param array $values The current values for a given attribute + * @param array $allowedConfigValues The allowed values, and possibly configuration options. + * @return array The filtered values + */ + private function filterAttributeValues(array $values, array $allowedConfigValues) + { + if (array_key_exists('regex', $allowedConfigValues) && $allowedConfigValues['regex'] === true) { + $matchedValues = []; + foreach ($allowedConfigValues as $option => $pattern) { + if (!is_int($option)) { + // Ignore any configuration options in $allowedConfig. e.g. regex=>true + continue; + } + foreach ($values as $index => $attributeValue) { + /* Suppress errors in preg_match since phpunit is set to fail on warnings, which + * prevents us from testing with invalid regex. + */ + $regexResult = @preg_match($pattern, $attributeValue); + if ($regexResult === false) { + \SimpleSAML\Logger::warning("Error processing regex '$pattern' on value '$attributeValue'"); + break; + } elseif ($regexResult === 1) { + $matchedValues[] = $attributeValue; + // Remove matched value incase a subsequent regex also matches it. + unset($values[$index]); + } + } + } + return $matchedValues; + } elseif (array_key_exists('ignoreCase', $allowedConfigValues) && $allowedConfigValues['ignoreCase'] === true) { + unset($allowedConfigValues['ignoreCase']); + return array_uintersect($values, $allowedConfigValues, "strcasecmp"); + } + // The not true values for these options shouldn't leak through to array_intersect + unset($allowedConfigValues['ignoreCase']); + unset($allowedConfigValues['regex']); + + return array_intersect($values, $allowedConfigValues); + } } diff --git a/vendor/simplesamlphp/simplesamlphp/modules/core/lib/Auth/Process/AttributeMap.php b/vendor/simplesamlphp/simplesamlphp/modules/core/lib/Auth/Process/AttributeMap.php index 2f48b62fa2..7992f8b69d 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/core/lib/Auth/Process/AttributeMap.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/core/lib/Auth/Process/AttributeMap.php @@ -1,5 +1,6 @@ <?php +namespace SimpleSAML\Module\core\Auth\Process; /** * Attribute filter for renaming attributes. @@ -7,13 +8,13 @@ * @author Olav Morken, UNINETT AS. * @package SimpleSAMLphp */ -class sspmod_core_Auth_Process_AttributeMap extends SimpleSAML_Auth_ProcessingFilter -{ +class AttributeMap extends \SimpleSAML\Auth\ProcessingFilter +{ /** * Associative array with the mappings of attribute names. */ - private $map = array(); + private $map = []; /** * Should attributes be duplicated or renamed. @@ -33,8 +34,8 @@ public function __construct($config, $reserved) { parent::__construct($config, $reserved); - assert('is_array($config)'); - $mapFiles = array(); + assert(is_array($config)); + $mapFiles = []; foreach ($config as $origName => $newName) { if (is_int($origName)) { @@ -48,11 +49,11 @@ public function __construct($config, $reserved) } if (!is_string($origName)) { - throw new Exception('Invalid attribute name: '.var_export($origName, true)); + throw new \Exception('Invalid attribute name: '.var_export($origName, true)); } if (!is_string($newName) && !is_array($newName)) { - throw new Exception('Invalid attribute name: '.var_export($newName, true)); + throw new \Exception('Invalid attribute name: '.var_export($newName, true)); } $this->map[$origName] = $newName; @@ -75,26 +76,27 @@ public function __construct($config, $reserved) */ private function loadMapFile($fileName) { - $config = SimpleSAML_Configuration::getInstance(); + $config = \SimpleSAML\Configuration::getInstance(); $m = explode(':', $fileName); - if (count($m) === 2) { // we are asked for a file in a module - if (!SimpleSAML\Module::isModuleEnabled($m[0])) { - throw new Exception("Module '$m[0]' is not enabled."); + if (count($m) === 2) { + // we are asked for a file in a module + if (!\SimpleSAML\Module::isModuleEnabled($m[0])) { + throw new \Exception("Module '$m[0]' is not enabled."); } - $filePath = SimpleSAML\Module::getModuleDir($m[0]).'/attributemap/'.$m[1].'.php'; + $filePath = \SimpleSAML\Module::getModuleDir($m[0]).'/attributemap/'.$m[1].'.php'; } else { $filePath = $config->getPathValue('attributenamemapdir', 'attributemap/').$fileName.'.php'; } if (!file_exists($filePath)) { - throw new Exception('Could not find attribute map file: '.$filePath); + throw new \Exception('Could not find attribute map file: '.$filePath); } $attributemap = null; include($filePath); if (!is_array($attributemap)) { - throw new Exception('Attribute map file "'.$filePath.'" didn\'t define an attribute map.'); + throw new \Exception('Attribute map file "'.$filePath.'" didn\'t define an attribute map.'); } if ($this->duplicate) { @@ -112,27 +114,34 @@ private function loadMapFile($fileName) */ public function process(&$request) { - assert('is_array($request)'); - assert('array_key_exists("Attributes", $request)'); + assert(is_array($request)); + assert(array_key_exists('Attributes', $request)); - $attributes =& $request['Attributes']; + $mapped_attributes = []; - foreach ($attributes as $name => $values) { + foreach ($request['Attributes'] as $name => $values) { if (array_key_exists($name, $this->map)) { if (!is_array($this->map[$name])) { - if (!$this->duplicate) { - unset($attributes[$name]); + if ($this->duplicate) { + $mapped_attributes[$name] = $values; } - $attributes[$this->map[$name]] = $values; + $mapped_attributes[$this->map[$name]] = $values; } else { foreach ($this->map[$name] as $to_map) { - $attributes[$to_map] = $values; + $mapped_attributes[$to_map] = $values; } - if (!$this->duplicate && !in_array($name, $this->map[$name], true)) { - unset($attributes[$name]); + if ($this->duplicate && !in_array($name, $this->map[$name], true)) { + $mapped_attributes[$name] = $values; } } + } else { + if (array_key_exists($name, $mapped_attributes)) { + continue; + } + $mapped_attributes[$name] = $values; } } + + $request['Attributes'] = $mapped_attributes; } } diff --git a/vendor/simplesamlphp/simplesamlphp/modules/core/lib/Auth/Process/AttributeRealm.php b/vendor/simplesamlphp/simplesamlphp/modules/core/lib/Auth/Process/AttributeRealm.php index 9e50d78a44..f6366e9fe6 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/core/lib/Auth/Process/AttributeRealm.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/core/lib/Auth/Process/AttributeRealm.php @@ -1,5 +1,7 @@ <?php +namespace SimpleSAML\Module\core\Auth\Process; + /** * Filter that will take the user ID on the format 'andreas@uninett.no' * and create a new attribute 'realm' that includes the value after the '@' sign. @@ -8,8 +10,9 @@ * @package SimpleSAMLphp * @deprecated Use ScopeFromAttribute instead. */ -class sspmod_core_Auth_Process_AttributeRealm extends SimpleSAML_Auth_ProcessingFilter { +class AttributeRealm extends \SimpleSAML\Auth\ProcessingFilter +{ private $attributename = 'realm'; /** @@ -18,13 +21,14 @@ class sspmod_core_Auth_Process_AttributeRealm extends SimpleSAML_Auth_Processing * @param array $config Configuration information about this filter. * @param mixed $reserved For future use. */ - public function __construct($config, $reserved) { + public function __construct($config, $reserved) + { parent::__construct($config, $reserved); - assert('is_array($config)'); + assert(is_array($config)); - if (array_key_exists('attributename', $config)) + if (array_key_exists('attributename', $config)) { $this->attributename = $config['attributename']; - + } } /** @@ -34,20 +38,21 @@ public function __construct($config, $reserved) { * * @param array &$request The current request */ - public function process(&$request) { - assert('is_array($request)'); - assert('array_key_exists("Attributes", $request)'); - - $attributes =& $request['Attributes']; + public function process(&$request) + { + assert(is_array($request)); + assert(array_key_exists('Attributes', $request)); if (!array_key_exists('UserID', $request)) { - throw new Exception('core:AttributeRealm: Missing UserID for this user. Please' . - ' check the \'userid.attribute\' option in the metadata against the' . + throw new \Exception('core:AttributeRealm: Missing UserID for this user. Please'. + ' check the \'userid.attribute\' option in the metadata against the'. ' attributes provided by the authentication source.'); } $userID = $request['UserID']; $decomposed = explode('@', $userID); - if (count($decomposed) !== 2) return; - $request['Attributes'][$this->attributename] = array($decomposed[1]); + if (count($decomposed) !== 2) { + return; + } + $request['Attributes'][$this->attributename] = [$decomposed[1]]; } } diff --git a/vendor/simplesamlphp/simplesamlphp/modules/core/lib/Auth/Process/AttributeValueMap.php b/vendor/simplesamlphp/simplesamlphp/modules/core/lib/Auth/Process/AttributeValueMap.php index 3e487fd519..9979ea66f2 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/core/lib/Auth/Process/AttributeValueMap.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/core/lib/Auth/Process/AttributeValueMap.php @@ -8,32 +8,32 @@ * @author Martin van Es, m7 * @package SimpleSAMLphp */ -class AttributeValueMap extends \SimpleSAML_Auth_ProcessingFilter -{ +class AttributeValueMap extends \SimpleSAML\Auth\ProcessingFilter +{ /** - * The name of the attribute we should assign values to (ie: the target attribute). - */ + * The name of the attribute we should assign values to (ie: the target attribute). + */ private $targetattribute; /** - * The name of the attribute we should create values from. - */ + * The name of the attribute we should create values from. + */ private $sourceattribute; /** - * The required $sourceattribute values and target affiliations. - */ - private $values = array(); + * The required $sourceattribute values and target affiliations. + */ + private $values = []; /** - * Whether $sourceattribute should be kept or not. - */ + * Whether $sourceattribute should be kept or not. + */ private $keep = false; /** - * Whether $target attribute values should be replaced by new values or not. - */ + * Whether $target attribute values should be replaced by new values or not. + */ private $replace = false; /** @@ -41,13 +41,13 @@ class AttributeValueMap extends \SimpleSAML_Auth_ProcessingFilter * * @param array $config Configuration information about this filter. * @param mixed $reserved For future use. - * @throws \SimpleSAML_Error_Exception If the configuration is not valid. - */ + * @throws \SimpleSAML\Error\Exception If the configuration is not valid. + */ public function __construct($config, $reserved) { parent::__construct($config, $reserved); - assert('is_array($config)'); + assert(is_array($config)); // parse configuration foreach ($config as $name => $value) { @@ -84,13 +84,13 @@ public function __construct($config, $reserved) // now validate it if (!is_string($this->sourceattribute)) { - throw new \SimpleSAML_Error_Exception("AttributeValueMap: 'sourceattribute' configuration option not set."); + throw new \SimpleSAML\Error\Exception("AttributeValueMap: 'sourceattribute' configuration option not set."); } if (!is_string($this->targetattribute)) { - throw new \SimpleSAML_Error_Exception("AttributeValueMap: 'targetattribute' configuration option not set."); + throw new \SimpleSAML\Error\Exception("AttributeValueMap: 'targetattribute' configuration option not set."); } if (!is_array($this->values)) { - throw new \SimpleSAML_Error_Exception("AttributeValueMap: 'values' configuration option is not an array."); + throw new \SimpleSAML\Error\Exception("AttributeValueMap: 'values' configuration option is not an array."); } } @@ -104,9 +104,9 @@ public function process(&$request) { \SimpleSAML\Logger::debug('Processing the AttributeValueMap filter.'); - assert('is_array($request)'); - assert('array_key_exists("Attributes", $request)'); - $attributes =& $request['Attributes']; + assert(is_array($request)); + assert(array_key_exists('Attributes', $request)); + $attributes = &$request['Attributes']; if (!array_key_exists($this->sourceattribute, $attributes)) { // the source attribute does not exist, nothing to do here @@ -114,12 +114,12 @@ public function process(&$request) } $sourceattribute = $attributes[$this->sourceattribute]; - $targetvalues = array(); + $targetvalues = []; if (is_array($sourceattribute)) { foreach ($this->values as $value => $values) { if (!is_array($values)) { - $values = array($values); + $values = [$values]; } if (count(array_intersect($values, $sourceattribute)) > 0) { \SimpleSAML\Logger::debug("AttributeValueMap: intersect match for '$value'"); diff --git a/vendor/simplesamlphp/simplesamlphp/modules/core/lib/Auth/Process/Cardinality.php b/vendor/simplesamlphp/simplesamlphp/modules/core/lib/Auth/Process/Cardinality.php new file mode 100644 index 0000000000..ac4f1aad1e --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/modules/core/lib/Auth/Process/Cardinality.php @@ -0,0 +1,194 @@ +<?php + +namespace SimpleSAML\Module\core\Auth\Process; + +use SimpleSAML\Utils\HttpAdapter; + +/** + * Filter to ensure correct cardinality of attributes + * + * @author Guy Halse, http://orcid.org/0000-0002-9388-8592 + * @package SimpleSAMLphp + */ + +class Cardinality extends \SimpleSAML\Auth\ProcessingFilter +{ + /** @var array Associative array with the mappings of attribute names. */ + private $cardinality = []; + + /** @var array Entities that should be ignored */ + private $ignoreEntities = []; + + /** @var HTTPAdapter */ + private $http; + + /** + * Initialize this filter, parse configuration. + * + * @param array $config Configuration information about this filter. + * @param mixed $reserved For future use. + * @param HTTPAdapter $http HTTP utility service (handles redirects). + * @throws \SimpleSAML\Error\Exception + */ + public function __construct($config, $reserved, HttpAdapter $http = null) + { + parent::__construct($config, $reserved); + assert(is_array($config)); + + $this->http = $http ? : new HttpAdapter(); + + foreach ($config as $attribute => $rules) { + if ($attribute === '%ignoreEntities') { + $this->ignoreEntities = $config['%ignoreEntities']; + continue; + } + + if (!is_string($attribute)) { + throw new \SimpleSAML\Error\Exception('Invalid attribute name: '.var_export($attribute, true)); + } + $this->cardinality[$attribute] = ['warn' => false]; + + /* allow either positional or name-based parameters */ + if (isset($rules[0])) { + $this->cardinality[$attribute]['min'] = $rules[0]; + } elseif (isset($rules['min'])) { + $this->cardinality[$attribute]['min'] = $rules['min']; + } + if (isset($rules[1])) { + $this->cardinality[$attribute]['max'] = $rules[1]; + } elseif (isset($rules['max'])) { + $this->cardinality[$attribute]['max'] = $rules['max']; + } + if (array_key_exists('warn', $rules)) { + $this->cardinality[$attribute]['warn'] = (bool) $rules['warn']; + } + + /* sanity check the rules */ + if (!array_key_exists('min', $this->cardinality[$attribute])) { + $this->cardinality[$attribute]['min'] = 0; + } elseif (!is_int($this->cardinality[$attribute]['min']) || + $this->cardinality[$attribute]['min'] < 0 + ) { + throw new \SimpleSAML\Error\Exception('Minimum cardinality must be a positive integer: '. + var_export($attribute, true)); + } + if (array_key_exists('max', $this->cardinality[$attribute]) && + !is_int($this->cardinality[$attribute]['max']) + ) { + throw new \SimpleSAML\Error\Exception('Maximum cardinality must be a positive integer: '. + var_export($attribute, true)); + } + if (array_key_exists('min', $this->cardinality[$attribute]) && + array_key_exists('max', $this->cardinality[$attribute]) && + $this->cardinality[$attribute]['min'] > $this->cardinality[$attribute]['max'] + ) { + throw new \SimpleSAML\Error\Exception('Minimum cardinality must be less than maximium: '. + var_export($attribute, true)); + } + + /* generate a display expression */ + $this->cardinality[$attribute]['_expr'] = sprintf('%d ≤ n', $this->cardinality[$attribute]['min']); + if (array_key_exists('max', $this->cardinality[$attribute])) { + $this->cardinality[$attribute]['_expr'] .= sprintf(' ≤ %d', $this->cardinality[$attribute]['max']); + } + } + } + + /** + * Process this filter + * + * @param array &$request The current request + */ + public function process(&$request) + { + assert(is_array($request)); + assert(array_key_exists("Attributes", $request)); + + $entityid = false; + if (array_key_exists('Source', $request) && array_key_exists('entityid', $request['Source'])) { + $entityid = $request['Source']['entityid']; + } + if (in_array($entityid, $this->ignoreEntities, true)) { + \SimpleSAML\Logger::debug('Cardinality: Ignoring assertions from '.$entityid); + return; + } + + foreach ($request['Attributes'] as $k => $v) { + if (!array_key_exists($k, $this->cardinality)) { + continue; + } + if (!is_array($v)) { + $v = [$v]; + } + + /* minimum cardinality */ + if (count($v) < $this->cardinality[$k]['min']) { + if ($this->cardinality[$k]['warn']) { + \SimpleSAML\Logger::warning( + sprintf( + 'Cardinality: attribute %s from %s does not meet minimum cardinality of %d (%d)', + $k, + $entityid, + $this->cardinality[$k]['min'], + count($v) + ) + ); + } else { + $request['core:cardinality:errorAttributes'][$k] = [ + count($v), + $this->cardinality[$k]['_expr'] + ]; + } + continue; + } + + /* maximum cardinality */ + if (array_key_exists('max', $this->cardinality[$k]) && count($v) > $this->cardinality[$k]['max']) { + if ($this->cardinality[$k]['warn']) { + \SimpleSAML\Logger::warning( + sprintf( + 'Cardinality: attribute %s from %s does not meet maximum cardinality of %d (%d)', + $k, + $entityid, + $this->cardinality[$k]['max'], + count($v) + ) + ); + } else { + $request['core:cardinality:errorAttributes'][$k] = [ + count($v), + $this->cardinality[$k]['_expr'] + ]; + } + continue; + } + } + + /* check for missing attributes with a minimum cardinality */ + foreach ($this->cardinality as $k => $v) { + if (!$this->cardinality[$k]['min'] || array_key_exists($k, $request['Attributes'])) { + continue; + } + if ($this->cardinality[$k]['warn']) { + \SimpleSAML\Logger::warning(sprintf( + 'Cardinality: attribute %s from %s is missing', + $k, + $entityid + )); + } else { + $request['core:cardinality:errorAttributes'][$k] = [ + 0, + $this->cardinality[$k]['_expr'] + ]; + } + } + + /* abort if we found a problematic attribute */ + if (array_key_exists('core:cardinality:errorAttributes', $request)) { + $id = \SimpleSAML\Auth\State::saveState($request, 'core:cardinality'); + $url = \SimpleSAML\Module::getModuleURL('core/cardinality_error.php'); + $this->http->redirectTrustedURL($url, ['StateId' => $id]); + return; + } + } +} diff --git a/vendor/simplesamlphp/simplesamlphp/modules/core/lib/Auth/Process/CardinalitySingle.php b/vendor/simplesamlphp/simplesamlphp/modules/core/lib/Auth/Process/CardinalitySingle.php new file mode 100644 index 0000000000..ac251319be --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/modules/core/lib/Auth/Process/CardinalitySingle.php @@ -0,0 +1,124 @@ +<?php + +namespace SimpleSAML\Module\core\Auth\Process; + +use SimpleSAML\Utils\HttpAdapter; + +/** + * Filter to ensure correct cardinality of single-valued attributes + * + * This filter implements a special case of the core:Cardinality filter, and + * allows for optional corrections to be made when cardinality errors are encountered. + * + * @author Guy Halse, http://orcid.org/0000-0002-9388-8592 + * @package SimpleSAMLphp + */ + +class CardinalitySingle extends \SimpleSAML\Auth\ProcessingFilter +{ + /** @var array Attributes that should be single-valued or we generate an error */ + private $singleValued = []; + + /** @var array Attributes for which the first value should be taken */ + private $firstValue = []; + + /** @var array Attributes that can be flattened to a single value */ + private $flatten = []; + + /** @var string Separator for flattened value */ + private $flattenWith = ';'; + + /** @var array Entities that should be ignored */ + private $ignoreEntities = []; + + /** @var HTTPAdapter */ + private $http; + + /** + * Initialize this filter, parse configuration. + * + * @param array $config Configuration information about this filter. + * @param mixed $reserved For future use. + * @param HTTPAdapter $http HTTP utility service (handles redirects). + */ + public function __construct($config, $reserved, HttpAdapter $http = null) + { + parent::__construct($config, $reserved); + assert(is_array($config)); + + $this->http = $http ? : new HttpAdapter(); + + if (array_key_exists('singleValued', $config)) { + $this->singleValued = $config['singleValued']; + } + if (array_key_exists('firstValue', $config)) { + $this->firstValue = $config['firstValue']; + } + if (array_key_exists('flattenWith', $config)) { + if (is_array($config['flattenWith'])) { + $this->flattenWith = array_shift($config['flattenWith']); + } else { + $this->flattenWith = $config['flattenWith']; + } + } + if (array_key_exists('flatten', $config)) { + $this->flatten = $config['flatten']; + } + if (array_key_exists('ignoreEntities', $config)) { + $this->ignoreEntities = $config['ignoreEntities']; + } + /* for consistency with core:Cardinality */ + if (array_key_exists('%ignoreEntities', $config)) { + $this->ignoreEntities = $config['%ignoreEntities']; + } + } + + /** + * Process this filter + * + * @param array &$request The current request + */ + public function process(&$request) + { + assert(is_array($request)); + assert(array_key_exists("Attributes", $request)); + + if (array_key_exists('Source', $request) && + array_key_exists('entityid', $request['Source']) && + in_array($request['Source']['entityid'], $this->ignoreEntities, true) + ) { + \SimpleSAML\Logger::debug('CardinalitySingle: Ignoring assertions from '.$request['Source']['entityid']); + return; + } + + foreach ($request['Attributes'] as $k => $v) { + if (!is_array($v)) { + continue; + } + if (count($v) <= 1) { + continue; + } + + if (in_array($k, $this->singleValued)) { + $request['core:cardinality:errorAttributes'][$k] = [count($v), '0 ≤ n ≤ 1']; + continue; + } + if (in_array($k, $this->firstValue)) { + $request['Attributes'][$k] = [array_shift($v)]; + continue; + } + if (in_array($k, $this->flatten)) { + $request['Attributes'][$k] = [implode($this->flattenWith, $v)]; + continue; + } + } + + /* abort if we found a problematic attribute */ + if (array_key_exists('core:cardinality:errorAttributes', $request)) { + $id = \SimpleSAML\Auth\State::saveState($request, 'core:cardinality'); + $url = \SimpleSAML\Module::getModuleURL('core/cardinality_error.php'); + $this->http->redirectTrustedURL($url, ['StateId' => $id]); + return; + } + } +} diff --git a/vendor/simplesamlphp/simplesamlphp/modules/core/lib/Auth/Process/ExtendIdPSession.php b/vendor/simplesamlphp/simplesamlphp/modules/core/lib/Auth/Process/ExtendIdPSession.php index b8382d30c3..92102262b5 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/core/lib/Auth/Process/ExtendIdPSession.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/core/lib/Auth/Process/ExtendIdPSession.php @@ -1,47 +1,52 @@ <?php +namespace SimpleSAML\Module\core\Auth\Process; + /** * Extend IdP session and cookies. -*/ -class sspmod_core_Auth_Process_ExtendIdPSession extends SimpleSAML_Auth_ProcessingFilter { - - public function process(&$state) { - assert('is_array($state)'); - - if (empty($state['Expire']) || empty($state['Authority'])) { - return; - } - - $now = time(); - $delta = $state['Expire'] - $now; - - $globalConfig = SimpleSAML_Configuration::getInstance(); - $sessionDuration = $globalConfig->getInteger('session.duration', 8*60*60); - - // Extend only if half of session duration already passed - if ($delta >= ($sessionDuration * 0.5)) { - return; - } - - // Update authority expire time - $session = SimpleSAML_Session::getSessionFromRequest(); - $session->setAuthorityExpire($state['Authority']); - - /* Update session cookies duration */ - - /* If remember me is active */ - $rememberMeExpire = $session->getRememberMeExpire(); - if (!empty($state['RememberMe']) && $rememberMeExpire !== NULL && $globalConfig->getBoolean('session.rememberme.enable', FALSE)) { - $session->setRememberMeExpire(); - return; - } - - /* Or if session lifetime is more than zero */ - $sessionHandler = \SimpleSAML\SessionHandler::getSessionHandler(); - $cookieParams = $sessionHandler->getCookieParams(); - if ($cookieParams['lifetime'] > 0) { - $session->updateSessionCookies(); - } - } - + */ + +class ExtendIdPSession extends \SimpleSAML\Auth\ProcessingFilter +{ + public function process(&$state) + { + assert(is_array($state)); + + if (empty($state['Expire']) || empty($state['Authority'])) { + return; + } + + $now = time(); + $delta = $state['Expire'] - $now; + + $globalConfig = \SimpleSAML\Configuration::getInstance(); + $sessionDuration = $globalConfig->getInteger('session.duration', 28800); // 8*60*60 + + // Extend only if half of session duration already passed + if ($delta >= ($sessionDuration * 0.5)) { + return; + } + + // Update authority expire time + $session = \SimpleSAML\Session::getSessionFromRequest(); + $session->setAuthorityExpire($state['Authority']); + + // Update session cookies duration + + // If remember me is active + $rememberMeExpire = $session->getRememberMeExpire(); + if (!empty($state['RememberMe']) && $rememberMeExpire !== null && + $globalConfig->getBoolean('session.rememberme.enable', false) + ) { + $session->setRememberMeExpire(); + return; + } + + // Or if session lifetime is more than zero + $sessionHandler = \SimpleSAML\SessionHandler::getSessionHandler(); + $cookieParams = $sessionHandler->getCookieParams(); + if ($cookieParams['lifetime'] > 0) { + $session->updateSessionCookies(); + } + } } diff --git a/vendor/simplesamlphp/simplesamlphp/modules/core/lib/Auth/Process/GenerateGroups.php b/vendor/simplesamlphp/simplesamlphp/modules/core/lib/Auth/Process/GenerateGroups.php index 6bf9df8dfd..ab9d15aad0 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/core/lib/Auth/Process/GenerateGroups.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/core/lib/Auth/Process/GenerateGroups.php @@ -1,142 +1,144 @@ <?php +namespace SimpleSAML\Module\core\Auth\Process; + /** * Filter to generate a groups attribute based on many of the attributes of the user. * * @author Olav Morken, UNINETT AS. * @package SimpleSAMLphp */ -class sspmod_core_Auth_Process_GenerateGroups extends SimpleSAML_Auth_ProcessingFilter { - - - /** - * The attributes we should generate groups from. - */ - private $generateGroupsFrom; - - - /** - * Initialize this filter. - * - * @param array $config Configuration information about this filter. - * @param mixed $reserved For future use. - */ - public function __construct($config, $reserved) { - parent::__construct($config, $reserved); - - assert('is_array($config)'); - - if (count($config) === 0) { - // Use default groups - $this->generateGroupsFrom = array( - 'eduPersonAffiliation', - 'eduPersonOrgUnitDN', - 'eduPersonEntitlement', - ); - - } else { - // Validate configuration - foreach ($config as $attributeName) { - if (!is_string($attributeName)) { - throw new Exception('Invalid attribute name for core:GenerateGroups filter: ' . - var_export($attributeName, TRUE)); - } - } - - $this->generateGroupsFrom = $config; - } - } - - - /** - * Apply filter to add groups attribute. - * - * @param array &$request The current request - */ - public function process(&$request) { - assert('is_array($request)'); - assert('array_key_exists("Attributes", $request)'); - - $groups = array(); - $attributes =& $request['Attributes']; - - $realm = self::getRealm($attributes); - if ($realm !== NULL) { - $groups[] = 'realm-' . $realm; - } - - - foreach ($this->generateGroupsFrom as $name) { - if (!array_key_exists($name, $attributes)) { - SimpleSAML\Logger::debug('GenerateGroups - attribute \'' . $name . '\' not found.'); - /* Attribute not present. */ - continue; - } - - foreach ($attributes[$name] as $value) { - $value = self::escapeIllegalChars($value); - $groups[] = $name . '-' . $value; - if ($realm !== NULL) { - $groups[] = $name . '-' . $realm . '-' . $value; - } - } - } - - if (count($groups) > 0) { - $attributes['groups'] = $groups; - } - } - - - /** - * Determine which realm the user belongs to. - * - * This function will attempt to determine the realm a user belongs to based on the - * eduPersonPrincipalName attribute if it is present. If it isn't, or if it doesn't contain - * a realm, NULL will be returned. - * - * @param array $attributes The attributes of the user. - * @return string|NULL The realm of the user, or NULL if we are unable to determine the realm. - */ - private static function getRealm($attributes) { - assert('is_array($attributes)'); - - if (!array_key_exists('eduPersonPrincipalName', $attributes)) { - return NULL; - } - $eppn = $attributes['eduPersonPrincipalName']; - - if (count($eppn) < 1) { - return NULL; - } - $eppn = $eppn[0]; - - $realm = explode('@', $eppn, 2); - if (count($realm) < 2) { - return NULL; - } - $realm = $realm[1]; - - return self::escapeIllegalChars($realm); - } - - - /** - * Escape special characters in a string. - * - * This function is similar to urlencode, but encodes many more characters. - * This function takes any characters not in [a-zA-Z0-9_@=.] and encodes them with as - * %<hex version>. For example, it will encode '+' as '%2b' and '%' as '%25'. - * - * @param string $string The string which should be escaped. - * @return string The escaped string. - */ - private static function escapeIllegalChars($string) { - assert('is_string($string)'); - - return preg_replace_callback('/([^a-zA-Z0-9_@=.])/', - function ($m) { return sprintf("%%%02x", ord($m[1])); }, - $string); - } +class GenerateGroups extends \SimpleSAML\Auth\ProcessingFilter +{ + /** + * The attributes we should generate groups from. + */ + private $generateGroupsFrom; + + /** + * Initialize this filter. + * + * @param array $config Configuration information about this filter. + * @param mixed $reserved For future use. + */ + public function __construct($config, $reserved) + { + parent::__construct($config, $reserved); + + assert(is_array($config)); + + if (count($config) === 0) { + // Use default groups + $this->generateGroupsFrom = [ + 'eduPersonAffiliation', + 'eduPersonOrgUnitDN', + 'eduPersonEntitlement', + ]; + } else { + // Validate configuration + foreach ($config as $attributeName) { + if (!is_string($attributeName)) { + throw new \Exception('Invalid attribute name for core:GenerateGroups filter: '. + var_export($attributeName, true)); + } + } + $this->generateGroupsFrom = $config; + } + } + + /** + * Apply filter to add groups attribute. + * + * @param array &$request The current request + */ + public function process(&$request) + { + assert(is_array($request)); + assert(array_key_exists('Attributes', $request)); + + $groups = []; + $attributes = &$request['Attributes']; + + $realm = self::getRealm($attributes); + if ($realm !== null) { + $groups[] = 'realm-'.$realm; + } + + foreach ($this->generateGroupsFrom as $name) { + if (!array_key_exists($name, $attributes)) { + \SimpleSAML\Logger::debug('GenerateGroups - attribute \''.$name.'\' not found.'); + // Attribute not present + continue; + } + + foreach ($attributes[$name] as $value) { + $value = self::escapeIllegalChars($value); + $groups[] = $name.'-'.$value; + if ($realm !== null) { + $groups[] = $name.'-'.$realm.'-'.$value; + } + } + } + + if (count($groups) > 0) { + $attributes['groups'] = $groups; + } + } + + /** + * Determine which realm the user belongs to. + * + * This function will attempt to determine the realm a user belongs to based on the + * eduPersonPrincipalName attribute if it is present. If it isn't, or if it doesn't contain + * a realm, NULL will be returned. + * + * @param array $attributes The attributes of the user. + * @return string|NULL The realm of the user, or NULL if we are unable to determine the realm. + */ + private static function getRealm($attributes) + { + assert(is_array($attributes)); + + if (!array_key_exists('eduPersonPrincipalName', $attributes)) { + return null; + } + $eppn = $attributes['eduPersonPrincipalName']; + + if (count($eppn) < 1) { + return null; + } + $eppn = $eppn[0]; + + $realm = explode('@', $eppn, 2); + if (count($realm) < 2) { + return null; + } + $realm = $realm[1]; + + return self::escapeIllegalChars($realm); + } + + /** + * Escape special characters in a string. + * + * This function is similar to urlencode, but encodes many more characters. + * This function takes any characters not in [a-zA-Z0-9_@=.] and encodes them with as + * %<hex version>. For example, it will encode '+' as '%2b' and '%' as '%25'. + * + * @param string $string The string which should be escaped. + * @return string The escaped string. + */ + private static function escapeIllegalChars($string) + { + assert(is_string($string)); + + return preg_replace_callback( + '/([^a-zA-Z0-9_@=.])/', + function ($m) { + return sprintf("%%%02x", ord($m[1])); + }, + $string + ); + } } diff --git a/vendor/simplesamlphp/simplesamlphp/modules/core/lib/Auth/Process/LanguageAdaptor.php b/vendor/simplesamlphp/simplesamlphp/modules/core/lib/Auth/Process/LanguageAdaptor.php index de61a64f58..771fb63572 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/core/lib/Auth/Process/LanguageAdaptor.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/core/lib/Auth/Process/LanguageAdaptor.php @@ -1,66 +1,68 @@ <?php +namespace SimpleSAML\Module\core\Auth\Process; + /** * Filter to set and get language settings from attributes. * * @author Andreas Åkre Solberg, UNINETT AS. * @package SimpleSAMLphp */ -class sspmod_core_Auth_Process_LanguageAdaptor extends SimpleSAML_Auth_ProcessingFilter { - - private $langattr = 'preferredLanguage'; - - - /** - * Initialize this filter. - * - * @param array $config Configuration information about this filter. - * @param mixed $reserved For future use. - */ - public function __construct($config, $reserved) { - parent::__construct($config, $reserved); - assert('is_array($config)'); - - if (array_key_exists('attributename', $config)) { - $this->langattr = $config['attributename']; - } - } - - - /** - * Apply filter to add or replace attributes. - * - * Add or replace existing attributes with the configured values. - * - * @param array &$request The current request - */ - public function process(&$request) { - assert('is_array($request)'); - assert('array_key_exists("Attributes", $request)'); - - $attributes =& $request['Attributes']; - - $attrlang = NULL; - if (array_key_exists($this->langattr, $attributes)) - $attrlang = $attributes[$this->langattr][0]; - - $lang = SimpleSAML\Locale\Language::getLanguageCookie(); - - - if (isset($attrlang)) - SimpleSAML\Logger::debug('LanguageAdaptor: Language in attribute was set [' . $attrlang . ']'); - if (isset($lang)) - SimpleSAML\Logger::debug('LanguageAdaptor: Language in session was set [' . $lang . ']'); - - - if (isset($attrlang) && !isset($lang)) { - // Language set in attribute but not in cookie - update cookie - SimpleSAML\Locale\Language::setLanguageCookie($attrlang); - } elseif (!isset($attrlang) && isset($lang)) { - // Language set in cookie, but not in attribute. Update attribute - $request['Attributes'][$this->langattr] = array($lang); - } - - } +class LanguageAdaptor extends \SimpleSAML\Auth\ProcessingFilter +{ + private $langattr = 'preferredLanguage'; + + /** + * Initialize this filter. + * + * @param array $config Configuration information about this filter. + * @param mixed $reserved For future use. + */ + public function __construct($config, $reserved) + { + parent::__construct($config, $reserved); + assert(is_array($config)); + + if (array_key_exists('attributename', $config)) { + $this->langattr = $config['attributename']; + } + } + + /** + * Apply filter to add or replace attributes. + * + * Add or replace existing attributes with the configured values. + * + * @param array &$request The current request + */ + public function process(&$request) + { + assert(is_array($request)); + assert(array_key_exists('Attributes', $request)); + + $attributes = &$request['Attributes']; + + $attrlang = null; + if (array_key_exists($this->langattr, $attributes)) { + $attrlang = $attributes[$this->langattr][0]; + } + + $lang = \SimpleSAML\Locale\Language::getLanguageCookie(); + + if (isset($attrlang)) { + \SimpleSAML\Logger::debug('LanguageAdaptor: Language in attribute was set ['.$attrlang.']'); + } + if (isset($lang)) { + \SimpleSAML\Logger::debug('LanguageAdaptor: Language in session was set ['.$lang.']'); + } + + if (isset($attrlang) && !isset($lang)) { + // Language set in attribute but not in cookie - update cookie + \SimpleSAML\Locale\Language::setLanguageCookie($attrlang); + } elseif (!isset($attrlang) && isset($lang)) { + // Language set in cookie, but not in attribute. Update attribute + $request['Attributes'][$this->langattr] = [$lang]; + } + } } diff --git a/vendor/simplesamlphp/simplesamlphp/modules/core/lib/Auth/Process/PHP.php b/vendor/simplesamlphp/simplesamlphp/modules/core/lib/Auth/Process/PHP.php index d189d289ea..cd424c76e9 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/core/lib/Auth/Process/PHP.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/core/lib/Auth/Process/PHP.php @@ -1,14 +1,15 @@ <?php +namespace SimpleSAML\Module\core\Auth\Process; /** * Attribute filter for running arbitrary PHP code. * * @package SimpleSAMLphp */ -class sspmod_core_Auth_Process_PHP extends SimpleSAML_Auth_ProcessingFilter -{ +class PHP extends \SimpleSAML\Auth\ProcessingFilter +{ /** * The PHP code that should be run. * @@ -23,16 +24,16 @@ class sspmod_core_Auth_Process_PHP extends SimpleSAML_Auth_ProcessingFilter * @param array $config Configuration information about this filter. * @param mixed $reserved For future use. * - * @throws SimpleSAML_Error_Exception if the 'code' option is not defined. + * @throws \SimpleSAML\Error\Exception if the 'code' option is not defined. */ public function __construct($config, $reserved) { parent::__construct($config, $reserved); - assert('is_array($config)'); + assert(is_array($config)); if (!isset($config['code'])) { - throw new SimpleSAML_Error_Exception("core:PHP: missing mandatory configuration option 'code'."); + throw new \SimpleSAML\Error\Exception("core:PHP: missing mandatory configuration option 'code'."); } $this->code = (string) $config['code']; } @@ -45,10 +46,15 @@ public function __construct($config, $reserved) */ public function process(&$request) { - assert('is_array($request)'); - assert('array_key_exists("Attributes", $request)'); - - $function = create_function('&$attributes', $this->code); - $function($request['Attributes']); + assert(is_array($request)); + assert(array_key_exists('Attributes', $request)); + + $function = function ( + /** @scrutinizer ignore-unused */ &$attributes, + /** @scrutinizer ignore-unused */ &$state + ) { + eval($this->code); + }; + $function($request['Attributes'], $request); } } diff --git a/vendor/simplesamlphp/simplesamlphp/modules/core/lib/Auth/Process/ScopeAttribute.php b/vendor/simplesamlphp/simplesamlphp/modules/core/lib/Auth/Process/ScopeAttribute.php index 6c2c03a93b..1db7d3c18a 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/core/lib/Auth/Process/ScopeAttribute.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/core/lib/Auth/Process/ScopeAttribute.php @@ -1,108 +1,106 @@ <?php +namespace SimpleSAML\Module\core\Auth\Process; + /** * Add a scoped variant of an attribute. * * @package SimpleSAMLphp */ -class sspmod_core_Auth_Process_ScopeAttribute extends SimpleSAML_Auth_ProcessingFilter { - - /** - * The attribute we extract the scope from. - * - * @var string - */ - private $scopeAttribute; - - - /** - * The attribute we want to add scope to. - * - * @var string - */ - private $sourceAttribute; - - - /** - * The attribute we want to add the scoped attributes to. - * - * @var string - */ - private $targetAttribute; - - /** - * Only modify targetAttribute if it doesn't already exist. - * - * @var bool - */ - private $onlyIfEmpty = false; - - - /** - * Initialize this filter, parse configuration - * - * @param array $config Configuration information about this filter. - * @param mixed $reserved For future use. - */ - public function __construct($config, $reserved) { - parent::__construct($config, $reserved); - assert('is_array($config)'); - - $config = SimpleSAML_Configuration::loadFromArray($config, 'ScopeAttribute'); - - $this->scopeAttribute = $config->getString('scopeAttribute'); - $this->sourceAttribute = $config->getString('sourceAttribute'); - $this->targetAttribute = $config->getString('targetAttribute'); - $this->onlyIfEmpty = $config->getBoolean('onlyIfEmpty', false); - } - - - /** - * Apply this filter to the request. - * - * @param array &$request The current request - */ - public function process(&$request) { - assert('is_array($request)'); - assert('array_key_exists("Attributes", $request)'); - - $attributes =& $request['Attributes']; - - if (!isset($attributes[$this->scopeAttribute])) { - return; - } - - if (!isset($attributes[$this->sourceAttribute])) { - return; - } - - if (!isset($attributes[$this->targetAttribute])) { - $attributes[$this->targetAttribute] = array(); - } - - if ($this->onlyIfEmpty and count($attributes[$this->targetAttribute]) > 0) { - return; - } - - foreach ($attributes[$this->scopeAttribute] as $scope) { - - if (strpos($scope, '@') !== FALSE) { - $scope = explode('@', $scope, 2); - $scope = $scope[1]; - } - - foreach ($attributes[$this->sourceAttribute] as $value) { - $value = $value . '@' . $scope; - - if (in_array($value, $attributes[$this->targetAttribute], TRUE)) { - // Already present - continue; - } - - $attributes[$this->targetAttribute][] = $value; - } - } - - } +class ScopeAttribute extends \SimpleSAML\Auth\ProcessingFilter +{ + /** + * The attribute we extract the scope from. + * + * @var string + */ + private $scopeAttribute; + + /** + * The attribute we want to add scope to. + * + * @var string + */ + private $sourceAttribute; + + /** + * The attribute we want to add the scoped attributes to. + * + * @var string + */ + private $targetAttribute; + + /** + * Only modify targetAttribute if it doesn't already exist. + * + * @var bool + */ + private $onlyIfEmpty = false; + + /** + * Initialize this filter, parse configuration + * + * @param array $config Configuration information about this filter. + * @param mixed $reserved For future use. + */ + public function __construct($config, $reserved) + { + parent::__construct($config, $reserved); + assert(is_array($config)); + + $config = \SimpleSAML\Configuration::loadFromArray($config, 'ScopeAttribute'); + + $this->scopeAttribute = $config->getString('scopeAttribute'); + $this->sourceAttribute = $config->getString('sourceAttribute'); + $this->targetAttribute = $config->getString('targetAttribute'); + $this->onlyIfEmpty = $config->getBoolean('onlyIfEmpty', false); + } + + /** + * Apply this filter to the request. + * + * @param array &$request The current request + */ + public function process(&$request) + { + assert(is_array($request)); + assert(array_key_exists('Attributes', $request)); + + $attributes = &$request['Attributes']; + + if (!isset($attributes[$this->scopeAttribute])) { + return; + } + + if (!isset($attributes[$this->sourceAttribute])) { + return; + } + + if (!isset($attributes[$this->targetAttribute])) { + $attributes[$this->targetAttribute] = []; + } + + if ($this->onlyIfEmpty && count($attributes[$this->targetAttribute]) > 0) { + return; + } + + foreach ($attributes[$this->scopeAttribute] as $scope) { + if (strpos($scope, '@') !== false) { + $scope = explode('@', $scope, 2); + $scope = $scope[1]; + } + + foreach ($attributes[$this->sourceAttribute] as $value) { + $value = $value.'@'.$scope; + + if (in_array($value, $attributes[$this->targetAttribute], true)) { + // Already present + continue; + } + + $attributes[$this->targetAttribute][] = $value; + } + } + } } diff --git a/vendor/simplesamlphp/simplesamlphp/modules/core/lib/Auth/Process/ScopeFromAttribute.php b/vendor/simplesamlphp/simplesamlphp/modules/core/lib/Auth/Process/ScopeFromAttribute.php index 95cc863ab0..b043de9fd8 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/core/lib/Auth/Process/ScopeFromAttribute.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/core/lib/Auth/Process/ScopeFromAttribute.php @@ -1,5 +1,7 @@ <?php +namespace SimpleSAML\Module\core\Auth\Process; + /** * Retrieve a scope from a source attribute and add it as a virtual target * attribute. @@ -16,74 +18,77 @@ * to add a virtual 'scope' attribute from the eduPersonPrincipalName * attribute. */ -class sspmod_core_Auth_Process_ScopeFromAttribute extends SimpleSAML_Auth_ProcessingFilter { - /** - * The attribute where the scope is taken from - * - * @var string - */ - private $sourceAttribute; - /** - * The name of the attribute which includes the scope - * - * @var string - */ - private $targetAttribute; - /** - * Initialize this filter, parse configuration - * - * @param array $config Configuration information about this filter. - * @param mixed $reserved For future use. - */ - public function __construct($config, $reserved) { - parent::__construct($config, $reserved); - assert('is_array($config)'); +class ScopeFromAttribute extends \SimpleSAML\Auth\ProcessingFilter +{ + /** + * The attribute where the scope is taken from + * + * @var string + */ + private $sourceAttribute; + + /** + * The name of the attribute which includes the scope + * + * @var string + */ + private $targetAttribute; - $config = SimpleSAML_Configuration::loadFromArray($config, 'ScopeFromAttribute'); - $this->targetAttribute = $config->getString('targetAttribute'); - $this->sourceAttribute = $config->getString('sourceAttribute'); - } // end constructor + /** + * Initialize this filter, parse configuration + * + * @param array $config Configuration information about this filter. + * @param mixed $reserved For future use. + */ + public function __construct($config, $reserved) + { + parent::__construct($config, $reserved); + assert(is_array($config)); + $config = \SimpleSAML\Configuration::loadFromArray($config, 'ScopeFromAttribute'); + $this->targetAttribute = $config->getString('targetAttribute'); + $this->sourceAttribute = $config->getString('sourceAttribute'); + } // end constructor - /** - * Apply this filter. - * - * @param array &$request The current request - */ - public function process(&$request) { - assert('is_array($request)'); - assert('array_key_exists("Attributes", $request)'); + /** + * Apply this filter. + * + * @param array &$request The current request + */ + public function process(&$request) + { + assert(is_array($request)); + assert(array_key_exists('Attributes', $request)); - $attributes =& $request['Attributes']; + $attributes = &$request['Attributes']; - if (!isset($attributes[$this->sourceAttribute])) { - return; - } + if (!isset($attributes[$this->sourceAttribute])) { + return; + } - // will not overwrite existing attribute - if (isset($attributes[$this->targetAttribute])) { - return; - } + // will not overwrite existing attribute + if (isset($attributes[$this->targetAttribute])) { + return; + } - $sourceAttrVal = $attributes[$this->sourceAttribute][0]; + $sourceAttrVal = $attributes[$this->sourceAttribute][0]; - /* the last position of an @ is usually the beginning of the scope - * string */ - $scopeIndex = strrpos($sourceAttrVal, '@'); + /* the last position of an @ is usually the beginning of the + * scope string + */ + $scopeIndex = strrpos($sourceAttrVal, '@'); - if ($scopeIndex !== FALSE) { - $attributes[$this->targetAttribute] = array(); - $scope = substr($sourceAttrVal, $scopeIndex+1); - $attributes[$this->targetAttribute][] = $scope; - SimpleSAML\Logger::debug('ScopeFromAttribute: Inserted new attribute ' . - $this->targetAttribute . ', with scope ' . - $scope); - } else { - SimpleSAML\Logger::warning('ScopeFromAttribute: The configured source attribute ' . - $this->sourceAttribute . - ' does not have a scope. Did not add attribute ' . - $this->targetAttribute . '.'); - } - } /* end process */ + if ($scopeIndex !== false) { + $attributes[$this->targetAttribute] = []; + $scope = substr($sourceAttrVal, $scopeIndex + 1); + $attributes[$this->targetAttribute][] = $scope; + \SimpleSAML\Logger::debug('ScopeFromAttribute: Inserted new attribute '. + $this->targetAttribute.', with scope '.$scope); + } else { + \SimpleSAML\Logger::warning('ScopeFromAttribute: The configured source attribute '. + $this->sourceAttribute.' does not have a scope. Did not add attribute '. + $this->targetAttribute.'.'); + } + } // end process } diff --git a/vendor/simplesamlphp/simplesamlphp/modules/core/lib/Auth/Process/StatisticsWithAttribute.php b/vendor/simplesamlphp/simplesamlphp/modules/core/lib/Auth/Process/StatisticsWithAttribute.php index 3123ff7094..86db3063c5 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/core/lib/Auth/Process/StatisticsWithAttribute.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/core/lib/Auth/Process/StatisticsWithAttribute.php @@ -1,85 +1,116 @@ <?php +namespace SimpleSAML\Module\core\Auth\Process; + /** * Log a line in the STAT log with one attribute. * * @author Andreas Åkre Solberg, UNINETT AS. * @package SimpleSAMLphp */ -class sspmod_core_Auth_Process_StatisticsWithAttribute extends SimpleSAML_Auth_ProcessingFilter { - - - /** - * The attribute to log - */ - private $attribute = NULL; - - private $typeTag = 'saml20-idp-SSO'; - - - /** - * Initialize this filter. - * - * @param array $config Configuration information about this filter. - * @param mixed $reserved For future use. - */ - public function __construct($config, $reserved) { - parent::__construct($config, $reserved); - - assert('is_array($config)'); - - if (array_key_exists('attributename', $config)) { - $this->attribute = $config['attributename']; - if (!is_string($this->attribute)) { - throw new Exception('Invalid attribute name given to core:StatisticsWithAttribute filter.'); - } - } - - if (array_key_exists('type', $config)) { - $this->typeTag = $config['type']; - if (!is_string($this->typeTag)) { - throw new Exception('Invalid typeTag given to core:StatisticsWithAttribute filter.'); - } - } - } - - - /** - * Log line. - * - * @param array &$state The current state. - */ - public function process(&$state) { - assert('is_array($state)'); - assert('array_key_exists("Attributes", $state)'); - - $logAttribute = 'NA'; - $source = 'NA'; - $dest = 'NA'; - - if (array_key_exists($this->attribute, $state['Attributes'])) $logAttribute = $state['Attributes'][$this->attribute][0]; - if (array_key_exists('Source', $state)) { - if (isset($state['Source']['core:statistics-id'])) { - $source = $state['Source']['core:statistics-id']; - } else { - $source = $state['Source']['entityid']; - } - } - - if (array_key_exists('Destination', $state)) { - if (isset($state['Destination']['core:statistics-id'])) { - $dest = $state['Destination']['core:statistics-id']; - } else { - $dest = $state['Destination']['entityid']; - } - } - - if (!array_key_exists('PreviousSSOTimestamp', $state)) { - // The user hasn't authenticated with this SP earlier in this session - SimpleSAML\Logger::stats($this->typeTag . '-first ' . $dest . ' ' . $source . ' ' . $logAttribute); - } - - SimpleSAML\Logger::stats($this->typeTag . ' ' . $dest . ' ' . $source . ' ' . $logAttribute); - } +class StatisticsWithAttribute extends \SimpleSAML\Auth\ProcessingFilter +{ + /** + * The attribute to log + * @var string|null + */ + private $attribute = null; + + /** + * @var string + */ + private $typeTag = 'saml20-idp-SSO'; + + /** + * @var bool + */ + private $skipPassive = false; + + + /** + * Initialize this filter. + * + * @param array $config Configuration information about this filter. + * @param mixed $reserved For future use. + */ + public function __construct($config, $reserved) + { + parent::__construct($config, $reserved); + + assert(is_array($config)); + + if (array_key_exists('attributename', $config)) { + $this->attribute = $config['attributename']; + if (!is_string($this->attribute)) { + throw new \Exception('Invalid attribute name given to core:StatisticsWithAttribute filter.'); + } + } + + if (array_key_exists('type', $config)) { + $this->typeTag = $config['type']; + if (!is_string($this->typeTag)) { + throw new \Exception('Invalid typeTag given to core:StatisticsWithAttribute filter.'); + } + } + + if (array_key_exists('skipPassive', $config)) { + $this->skipPassive = (bool) $config['skipPassive']; + } + } + + + /** + * Log line. + * + * @param array &$state The current state. + */ + public function process(&$state) + { + assert(is_array($state)); + assert(array_key_exists('Attributes', $state)); + + $logAttribute = 'NA'; + $isPassive = ''; + + if (array_key_exists('isPassive', $state) && $state['isPassive'] === true) { + if ($this->skipPassive === true) { + // We have a passive request. Skip logging statistics + return; + } + $isPassive = 'passive-'; + } + + if (array_key_exists($this->attribute, $state['Attributes'])) { + $logAttribute = $state['Attributes'][$this->attribute][0]; + } + + $source = $this->setIdentifier('Source', $state); + $dest = $this->setIdentifier('Destination', $state); + + if (!array_key_exists('PreviousSSOTimestamp', $state)) { + // The user hasn't authenticated with this SP earlier in this session + \SimpleSAML\Logger::stats($isPassive.$this->typeTag.'-first '.$dest.' '.$source.' '.$logAttribute); + } + + \SimpleSAML\Logger::stats($isPassive.$this->typeTag.' '.$dest.' '.$source.' '.$logAttribute); + } + + /** + * @param string &$direction Either 'Source' or 'Destination'. + * @param array $state The current state. + * + * @return string + */ + private function setIdentifier($direction, $state) + { + if (array_key_exists($direction, $state)) { + if (isset($state[$direction]['core:statistics-id'])) { + return $state[$direction]['core:statistics-id']; + } else { + return $state[$direction]['entityid']; + } + } + return 'NA'; + } } diff --git a/vendor/simplesamlphp/simplesamlphp/modules/core/lib/Auth/Process/TargetedID.php b/vendor/simplesamlphp/simplesamlphp/modules/core/lib/Auth/Process/TargetedID.php index 53d6cd77b4..710fa7f648 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/core/lib/Auth/Process/TargetedID.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/core/lib/Auth/Process/TargetedID.php @@ -1,5 +1,7 @@ <?php +namespace SimpleSAML\Module\core\Auth\Process; + /** * Filter to generate the eduPersonTargetedID attribute. * @@ -28,145 +30,143 @@ * @author Olav Morken, UNINETT AS. * @package SimpleSAMLphp */ -class sspmod_core_Auth_Process_TargetedID extends SimpleSAML_Auth_ProcessingFilter { - - - /** - * The attribute we should generate the targeted id from, or NULL if we should use the - * UserID. - */ - private $attribute = NULL; - - - /** - * Whether the attribute should be generated as a NameID value, or as a simple string. - * - * @var boolean - */ - private $generateNameId = FALSE; - - - /** - * Initialize this filter. - * - * @param array $config Configuration information about this filter. - * @param mixed $reserved For future use. - */ - public function __construct($config, $reserved) { - parent::__construct($config, $reserved); - - assert('is_array($config)'); - - if (array_key_exists('attributename', $config)) { - $this->attribute = $config['attributename']; - if (!is_string($this->attribute)) { - throw new Exception('Invalid attribute name given to core:TargetedID filter.'); - } - } - - if (array_key_exists('nameId', $config)) { - $this->generateNameId = $config['nameId']; - if (!is_bool($this->generateNameId)) { - throw new Exception('Invalid value of \'nameId\'-option to core:TargetedID filter.'); - } - } - } - - - /** - * Apply filter to add the targeted ID. - * - * @param array &$state The current state. - */ - public function process(&$state) { - assert('is_array($state)'); - assert('array_key_exists("Attributes", $state)'); - - if ($this->attribute === NULL) { - if (!array_key_exists('UserID', $state)) { - throw new Exception('core:TargetedID: Missing UserID for this user. Please' . - ' check the \'userid.attribute\' option in the metadata against the' . - ' attributes provided by the authentication source.'); - } - - $userID = $state['UserID']; - } else { - if (!array_key_exists($this->attribute, $state['Attributes'])) { - throw new Exception('core:TargetedID: Missing attribute \'' . $this->attribute . - '\', which is needed to generate the targeted ID.'); - } - - $userID = $state['Attributes'][$this->attribute][0]; - } - - - $secretSalt = SimpleSAML\Utils\Config::getSecretSalt(); - - if (array_key_exists('Source', $state)) { - $srcID = self::getEntityId($state['Source']); - } else { - $srcID = ''; - } - - if (array_key_exists('Destination', $state)) { - $dstID = self::getEntityId($state['Destination']); - } else { - $dstID = ''; - } - - $uidData = 'uidhashbase' . $secretSalt; - $uidData .= strlen($srcID) . ':' . $srcID; - $uidData .= strlen($dstID) . ':' . $dstID; - $uidData .= strlen($userID) . ':' . $userID; - $uidData .= $secretSalt; - - $uid = hash('sha1', $uidData); - - if ($this->generateNameId) { - // Convert the targeted ID to a SAML 2.0 name identifier element - $nameId = new \SAML2\XML\saml\NameID(); - $nameId->value = $uid; - $nameId->Format = \SAML2\Constants::NAMEID_PERSISTENT; - - if (isset($state['Source']['entityid'])) { - $nameId->NameQualifier = $state['Source']['entityid']; - } - if (isset($state['Destination']['entityid'])) { - $nameId->SPNameQualifier = $state['Destination']['entityid']; - } - } else { - $nameId = $uid; - } - - $state['Attributes']['eduPersonTargetedID'] = array($nameId); - } - - - /** - * Generate ID from entity metadata. - * - * This function takes in the metadata of an entity, and attempts to generate - * an unique identifier based on that. - * - * @param array $metadata The metadata of the entity. - * @return string The unique identifier for the entity. - */ - private static function getEntityId($metadata) { - assert('is_array($metadata)'); - - $id = ''; - - if (array_key_exists('metadata-set', $metadata)) { - $set = $metadata['metadata-set']; - $id .= 'set' . strlen($set) . ':' . $set; - } - - if (array_key_exists('entityid', $metadata)) { - $entityid = $metadata['entityid']; - $id .= 'set' . strlen($entityid) . ':' . $entityid; - } - - return $id; - } +class TargetedID extends \SimpleSAML\Auth\ProcessingFilter +{ + /** + * The attribute we should generate the targeted id from, or NULL if we should use the + * UserID. + */ + private $attribute = null; + + /** + * Whether the attribute should be generated as a NameID value, or as a simple string. + * + * @var boolean + */ + private $generateNameId = false; + + /** + * Initialize this filter. + * + * @param array $config Configuration information about this filter. + * @param mixed $reserved For future use. + */ + public function __construct($config, $reserved) + { + parent::__construct($config, $reserved); + + assert(is_array($config)); + + if (array_key_exists('attributename', $config)) { + $this->attribute = $config['attributename']; + if (!is_string($this->attribute)) { + throw new \Exception('Invalid attribute name given to core:TargetedID filter.'); + } + } + + if (array_key_exists('nameId', $config)) { + $this->generateNameId = $config['nameId']; + if (!is_bool($this->generateNameId)) { + throw new \Exception('Invalid value of \'nameId\'-option to core:TargetedID filter.'); + } + } + } + + /** + * Apply filter to add the targeted ID. + * + * @param array &$state The current state. + */ + public function process(&$state) + { + assert(is_array($state)); + assert(array_key_exists('Attributes', $state)); + + if ($this->attribute === null) { + if (!array_key_exists('UserID', $state)) { + throw new \Exception('core:TargetedID: Missing UserID for this user. Please'. + ' check the \'userid.attribute\' option in the metadata against the'. + ' attributes provided by the authentication source.'); + } + + $userID = $state['UserID']; + } else { + if (!array_key_exists($this->attribute, $state['Attributes'])) { + throw new \Exception('core:TargetedID: Missing attribute \''.$this->attribute. + '\', which is needed to generate the targeted ID.'); + } + + $userID = $state['Attributes'][$this->attribute][0]; + } + + + $secretSalt = \SimpleSAML\Utils\Config::getSecretSalt(); + + if (array_key_exists('Source', $state)) { + $srcID = self::getEntityId($state['Source']); + } else { + $srcID = ''; + } + + if (array_key_exists('Destination', $state)) { + $dstID = self::getEntityId($state['Destination']); + } else { + $dstID = ''; + } + + $uidData = 'uidhashbase'.$secretSalt; + $uidData .= strlen($srcID).':'.$srcID; + $uidData .= strlen($dstID).':'.$dstID; + $uidData .= strlen($userID).':'.$userID; + $uidData .= $secretSalt; + + $uid = hash('sha1', $uidData); + + if ($this->generateNameId) { + // Convert the targeted ID to a SAML 2.0 name identifier element + $nameId = new \SAML2\XML\saml\NameID(); + $nameId->setValue($uid); + $nameId->setFormat(\SAML2\Constants::NAMEID_PERSISTENT); + + if (isset($state['Source']['entityid'])) { + $nameId->setNameQualifier($state['Source']['entityid']); + } + if (isset($state['Destination']['entityid'])) { + $nameId->setSPNameQualifier($state['Destination']['entityid']); + } + } else { + $nameId = $uid; + } + + $state['Attributes']['eduPersonTargetedID'] = [$nameId]; + } + + /** + * Generate ID from entity metadata. + * + * This function takes in the metadata of an entity, and attempts to generate + * an unique identifier based on that. + * + * @param array $metadata The metadata of the entity. + * @return string The unique identifier for the entity. + */ + private static function getEntityId($metadata) + { + assert(is_array($metadata)); + + $id = ''; + + if (array_key_exists('metadata-set', $metadata)) { + $set = $metadata['metadata-set']; + $id .= 'set'.strlen($set).':'.$set; + } + + if (array_key_exists('entityid', $metadata)) { + $entityid = $metadata['entityid']; + $id .= 'set'.strlen($entityid).':'.$entityid; + } + + return $id; + } } diff --git a/vendor/simplesamlphp/simplesamlphp/modules/core/lib/Auth/Process/WarnShortSSOInterval.php b/vendor/simplesamlphp/simplesamlphp/modules/core/lib/Auth/Process/WarnShortSSOInterval.php index f723079b68..1d488b9db9 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/core/lib/Auth/Process/WarnShortSSOInterval.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/core/lib/Auth/Process/WarnShortSSOInterval.php @@ -1,52 +1,53 @@ <?php +namespace SimpleSAML\Module\core\Auth\Process; + /** * Give a warning to the user if we receive multiple requests in a short time. * * @package SimpleSAMLphp */ -class sspmod_core_Auth_Process_WarnShortSSOInterval extends SimpleSAML_Auth_ProcessingFilter { - - /** - * Process a authentication response. - * - * This function checks how long it is since the last time the user was authenticated. - * If it is to short a while since, we will show a warning to the user. - * - * @param array $state The state of the response. - */ - public function process(&$state) { - assert('is_array($state)'); - - if (!array_key_exists('PreviousSSOTimestamp', $state)) { - /* - * No timestamp from the previous SSO to this SP. This is the first - * time during this session. - */ - return; - } - - $timeDelta = time() - $state['PreviousSSOTimestamp']; - if ($timeDelta >= 10) { - // At least 10 seconds since last attempt - return; - } - - if (array_key_exists('Destination', $state) - && array_key_exists('entityid', $state['Destination'])) { - $entityId = $state['Destination']['entityid']; - } else { - $entityId = 'UNKNOWN'; - } - - SimpleSAML\Logger::warning('WarnShortSSOInterval: Only ' . $timeDelta . - ' seconds since last SSO for this user from the SP ' . - var_export($entityId, TRUE)); - - // Save state and redirect - $id = SimpleSAML_Auth_State::saveState($state, 'core:short_sso_interval'); - $url = SimpleSAML\Module::getModuleURL('core/short_sso_interval.php'); - \SimpleSAML\Utils\HTTP::redirectTrustedURL($url, array('StateId' => $id)); - } +class WarnShortSSOInterval extends \SimpleSAML\Auth\ProcessingFilter +{ + /** + * Process a authentication response. + * + * This function checks how long it is since the last time the user was authenticated. + * If it is to short a while since, we will show a warning to the user. + * + * @param array $state The state of the response. + */ + public function process(&$state) + { + assert(is_array($state)); + + if (!array_key_exists('PreviousSSOTimestamp', $state)) { + /* + * No timestamp from the previous SSO to this SP. This is the first + * time during this session. + */ + return; + } + + $timeDelta = time() - $state['PreviousSSOTimestamp']; + if ($timeDelta >= 10) { + // At least 10 seconds since last attempt + return; + } + + if (array_key_exists('Destination', $state) && array_key_exists('entityid', $state['Destination'])) { + $entityId = $state['Destination']['entityid']; + } else { + $entityId = 'UNKNOWN'; + } + + \SimpleSAML\Logger::warning('WarnShortSSOInterval: Only '.$timeDelta. + ' seconds since last SSO for this user from the SP '.var_export($entityId, true)); + + // Save state and redirect + $id = \SimpleSAML\Auth\State::saveState($state, 'core:short_sso_interval'); + $url = \SimpleSAML\Module::getModuleURL('core/short_sso_interval.php'); + \SimpleSAML\Utils\HTTP::redirectTrustedURL($url, ['StateId' => $id]); + } } diff --git a/vendor/simplesamlphp/simplesamlphp/modules/core/lib/Auth/Source/AdminPassword.php b/vendor/simplesamlphp/simplesamlphp/modules/core/lib/Auth/Source/AdminPassword.php index 7059ecbb13..45ce4c2696 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/core/lib/Auth/Source/AdminPassword.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/core/lib/Auth/Source/AdminPassword.php @@ -1,64 +1,65 @@ <?php +namespace SimpleSAML\Module\core\Auth\Source; + /** * Authentication source which verifies the password against * the 'auth.adminpassword' configuration option. * * @package SimpleSAMLphp */ -class sspmod_core_Auth_Source_AdminPassword extends sspmod_core_Auth_UserPassBase { - - - /** - * Constructor for this authentication source. - * - * @param array $info Information about this authentication source. - * @param array $config Configuration. - */ - public function __construct($info, $config) { - assert('is_array($info)'); - assert('is_array($config)'); - - // Call the parent constructor first, as required by the interface - parent::__construct($info, $config); - - $this->setForcedUsername("admin"); - } +class AdminPassword extends \SimpleSAML\Module\core\Auth\UserPassBase +{ + /** + * Constructor for this authentication source. + * + * @param array $info Information about this authentication source. + * @param array $config Configuration. + */ + public function __construct($info, $config) + { + assert(is_array($info)); + assert(is_array($config)); - /** - * Attempt to log in using the given username and password. - * - * On a successful login, this function should return the users attributes. On failure, - * it should throw an exception. If the error was caused by the user entering the wrong - * username or password, a SimpleSAML_Error_Error('WRONGUSERPASS') should be thrown. - * - * Note that both the username and the password are UTF-8 encoded. - * - * @param string $username The username the user wrote. - * @param string $password The password the user wrote. - * @return array Associative array with the users attributes. - */ - protected function login($username, $password) { - assert('is_string($username)'); - assert('is_string($password)'); + // Call the parent constructor first, as required by the interface + parent::__construct($info, $config); - $config = SimpleSAML_Configuration::getInstance(); - $adminPassword = $config->getString('auth.adminpassword', '123'); - if ($adminPassword === '123') { - // We require that the user changes the password - throw new SimpleSAML_Error_Error('NOTSET'); - } + $this->setForcedUsername("admin"); + } - if ($username !== "admin") { - throw new SimpleSAML_Error_Error('WRONGUSERPASS'); - } + /** + * Attempt to log in using the given username and password. + * + * On a successful login, this function should return the users attributes. On failure, + * it should throw an exception. If the error was caused by the user entering the wrong + * username or password, a \SimpleSAML\Error\Error('WRONGUSERPASS') should be thrown. + * + * Note that both the username and the password are UTF-8 encoded. + * + * @param string $username The username the user wrote. + * @param string $password The password the user wrote. + * @return array Associative array with the users attributes. + */ + protected function login($username, $password) + { + assert(is_string($username)); + assert(is_string($password)); - if (!SimpleSAML\Utils\Crypto::pwValid($adminPassword, $password)) { - throw new SimpleSAML_Error_Error('WRONGUSERPASS'); - } + $config = \SimpleSAML\Configuration::getInstance(); + $adminPassword = $config->getString('auth.adminpassword', '123'); + if ($adminPassword === '123') { + // We require that the user changes the password + throw new \SimpleSAML\Error\Error('NOTSET'); + } - return array('user' => array('admin')); - } + if ($username !== "admin") { + throw new \SimpleSAML\Error\Error('WRONGUSERPASS'); + } + if (!\SimpleSAML\Utils\Crypto::pwValid($adminPassword, $password)) { + throw new \SimpleSAML\Error\Error('WRONGUSERPASS'); + } + return ['user' => ['admin']]; + } } diff --git a/vendor/simplesamlphp/simplesamlphp/modules/core/lib/Auth/UserPassBase.php b/vendor/simplesamlphp/simplesamlphp/modules/core/lib/Auth/UserPassBase.php index 32e4868ac6..8473344666 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/core/lib/Auth/UserPassBase.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/core/lib/Auth/UserPassBase.php @@ -1,5 +1,7 @@ <?php +namespace SimpleSAML\Module\core\Auth; + /** * Helper class for username/password authentication. * @@ -9,50 +11,48 @@ * @author Olav Morken, UNINETT AS. * @package SimpleSAMLphp */ -abstract class sspmod_core_Auth_UserPassBase extends SimpleSAML_Auth_Source { - - - /** - * The string used to identify our states. - */ - const STAGEID = 'sspmod_core_Auth_UserPassBase.state'; - - - /** - * The key of the AuthId field in the state. - */ - const AUTHID = 'sspmod_core_Auth_UserPassBase.AuthId'; - - - /** - * Username we should force. - * - * A forced username cannot be changed by the user. - * If this is NULL, we won't force any username. - */ - private $forcedUsername; - - /** - * Links to pages from login page. - * From configuration - */ - protected $loginLinks; - - /** - * Storage for authsource config option remember.username.enabled - * loginuserpass.php and loginuserpassorg.php pages/templates use this option to - * present users with a checkbox to save their username for the next login request. - * @var bool - */ - protected $rememberUsernameEnabled = FALSE; - - /** - * Storage for authsource config option remember.username.checked - * loginuserpass.php and loginuserpassorg.php pages/templates use this option - * to default the remember username checkbox to checked or not. - * @var bool - */ - protected $rememberUsernameChecked = FALSE; + +abstract class UserPassBase extends \SimpleSAML\Auth\Source +{ + /** + * The string used to identify our states. + */ + const STAGEID = '\SimpleSAML\Module\core\Auth\UserPassBase.state'; + + /** + * The key of the AuthId field in the state. + */ + const AUTHID = '\SimpleSAML\Module\core\Auth\UserPassBase.AuthId'; + + /** + * Username we should force. + * + * A forced username cannot be changed by the user. + * If this is NULL, we won't force any username. + */ + private $forcedUsername; + + /** + * Links to pages from login page. + * From configuration + */ + protected $loginLinks; + + /** + * Storage for authsource config option remember.username.enabled + * loginuserpass.php and loginuserpassorg.php pages/templates use this option to + * present users with a checkbox to save their username for the next login request. + * @var bool + */ + protected $rememberUsernameEnabled = false; + + /** + * Storage for authsource config option remember.username.checked + * loginuserpass.php and loginuserpassorg.php pages/templates use this option + * to default the remember username checkbox to checked or not. + * @var bool + */ + protected $rememberUsernameChecked = false; /** * Storage for general config option session.rememberme.enable. @@ -62,7 +62,7 @@ abstract class sspmod_core_Auth_UserPassBase extends SimpleSAML_Auth_Source { * browser again). * @var bool */ - protected $rememberMeEnabled = FALSE; + protected $rememberMeEnabled = false; /** * Storage for general config option session.rememberme.checked. @@ -70,83 +70,88 @@ abstract class sspmod_core_Auth_UserPassBase extends SimpleSAML_Auth_Source { * the "remember me" checkbox to checked or not. * @var bool */ - protected $rememberMeChecked = FALSE; - - /** - * Constructor for this authentication source. - * - * All subclasses who implement their own constructor must call this constructor before - * using $config for anything. - * - * @param array $info Information about this authentication source. - * @param array &$config Configuration for this authentication source. - */ - public function __construct($info, &$config) { - assert('is_array($info)'); - assert('is_array($config)'); - - if (isset($config['core:loginpage_links'])) { - $this->loginLinks = $config['core:loginpage_links']; - } - - // Call the parent constructor first, as required by the interface - parent::__construct($info, $config); - - // Get the remember username config options - if (isset($config['remember.username.enabled'])) { - $this->rememberUsernameEnabled = (bool) $config['remember.username.enabled']; - unset($config['remember.username.enabled']); - } - if (isset($config['remember.username.checked'])) { - $this->rememberUsernameChecked = (bool) $config['remember.username.checked']; - unset($config['remember.username.checked']); - } + protected $rememberMeChecked = false; + + /** + * Constructor for this authentication source. + * + * All subclasses who implement their own constructor must call this constructor before + * using $config for anything. + * + * @param array $info Information about this authentication source. + * @param array &$config Configuration for this authentication source. + */ + public function __construct($info, &$config) + { + assert(is_array($info)); + assert(is_array($config)); + + if (isset($config['core:loginpage_links'])) { + $this->loginLinks = $config['core:loginpage_links']; + } + + // Call the parent constructor first, as required by the interface + parent::__construct($info, $config); + + // Get the remember username config options + if (isset($config['remember.username.enabled'])) { + $this->rememberUsernameEnabled = (bool) $config['remember.username.enabled']; + unset($config['remember.username.enabled']); + } + if (isset($config['remember.username.checked'])) { + $this->rememberUsernameChecked = (bool) $config['remember.username.checked']; + unset($config['remember.username.checked']); + } // get the "remember me" config options - $sspcnf = SimpleSAML_Configuration::getInstance(); - $this->rememberMeEnabled = $sspcnf->getBoolean('session.rememberme.enable', FALSE); - $this->rememberMeChecked = $sspcnf->getBoolean('session.rememberme.checked', FALSE); - } - - - /** - * Set forced username. - * - * @param string|NULL $forcedUsername The forced username. - */ - public function setForcedUsername($forcedUsername) { - assert('is_string($forcedUsername) || is_null($forcedUsername)'); - $this->forcedUsername = $forcedUsername; - } - - /** - * Return login links from configuration - */ - public function getLoginLinks() { - return $this->loginLinks; - } - - /** - * Getter for the authsource config option remember.username.enabled - * @return bool - */ - public function getRememberUsernameEnabled() { - return $this->rememberUsernameEnabled; - } - - /** - * Getter for the authsource config option remember.username.checked - * @return bool - */ - public function getRememberUsernameChecked() { - return $this->rememberUsernameChecked; - } + $sspcnf = \SimpleSAML\Configuration::getInstance(); + $this->rememberMeEnabled = $sspcnf->getBoolean('session.rememberme.enable', false); + $this->rememberMeChecked = $sspcnf->getBoolean('session.rememberme.checked', false); + } + + /** + * Set forced username. + * + * @param string|NULL $forcedUsername The forced username. + */ + public function setForcedUsername($forcedUsername) + { + assert(is_string($forcedUsername) || $forcedUsername === null); + $this->forcedUsername = $forcedUsername; + } + + /** + * Return login links from configuration + */ + public function getLoginLinks() + { + return $this->loginLinks; + } + + /** + * Getter for the authsource config option remember.username.enabled + * @return bool + */ + public function getRememberUsernameEnabled() + { + return $this->rememberUsernameEnabled; + } + + /** + * Getter for the authsource config option remember.username.checked + * @return bool + */ + public function getRememberUsernameChecked() + { + return $this->rememberUsernameChecked; + } /** * Check if the "remember me" feature is enabled. * @return bool TRUE if enabled, FALSE otherwise. */ - public function isRememberMeEnabled() { + public function isRememberMeEnabled() + { return $this->rememberMeEnabled; } @@ -154,116 +159,142 @@ public function isRememberMeEnabled() { * Check if the "remember me" checkbox should be checked. * @return bool TRUE if enabled, FALSE otherwise. */ - public function isRememberMeChecked() { + public function isRememberMeChecked() + { return $this->rememberMeChecked; } - /** - * Initialize login. - * - * This function saves the information about the login, and redirects to a - * login page. - * - * @param array &$state Information about the current authentication. - */ - public function authenticate(&$state) { - assert('is_array($state)'); - - /* - * Save the identifier of this authentication source, so that we can - * retrieve it later. This allows us to call the login()-function on - * the current object. - */ - $state[self::AUTHID] = $this->authId; - - // What username we should force, if any - if ($this->forcedUsername !== NULL) { - /* - * This is accessed by the login form, to determine if the user - * is allowed to change the username. - */ - $state['forcedUsername'] = $this->forcedUsername; - } - - /* Save the $state-array, so that we can restore it after a redirect. */ - $id = SimpleSAML_Auth_State::saveState($state, self::STAGEID); - - /* - * Redirect to the login form. We include the identifier of the saved - * state array as a parameter to the login form. - */ - $url = SimpleSAML\Module::getModuleURL('core/loginuserpass.php'); - $params = array('AuthState' => $id); - \SimpleSAML\Utils\HTTP::redirectTrustedURL($url, $params); - - /* The previous function never returns, so this code is never executed. */ - assert('FALSE'); - } - - - /** - * Attempt to log in using the given username and password. - * - * On a successful login, this function should return the users attributes. On failure, - * it should throw an exception/error. If the error was caused by the user entering the wrong - * username or password, a SimpleSAML_Error_Error('WRONGUSERPASS') should be thrown. - * - * Note that both the username and the password are UTF-8 encoded. - * - * @param string $username The username the user wrote. - * @param string $password The password the user wrote. - * @return array Associative array with the user's attributes. - */ - abstract protected function login($username, $password); - - - /** - * Handle login request. - * - * This function is used by the login form (core/www/loginuserpass.php) when the user - * enters a username and password. On success, it will not return. On wrong - * username/password failure, and other errors, it will throw an exception. - * - * @param string $authStateId The identifier of the authentication state. - * @param string $username The username the user wrote. - * @param string $password The password the user wrote. - */ - public static function handleLogin($authStateId, $username, $password) { - assert('is_string($authStateId)'); - assert('is_string($username)'); - assert('is_string($password)'); - - /* Here we retrieve the state array we saved in the authenticate-function. */ - $state = SimpleSAML_Auth_State::loadState($authStateId, self::STAGEID); - - /* Retrieve the authentication source we are executing. */ - assert('array_key_exists(self::AUTHID, $state)'); - $source = SimpleSAML_Auth_Source::getById($state[self::AUTHID]); - if ($source === NULL) { - throw new Exception('Could not find authentication source with id ' . $state[self::AUTHID]); - } - - /* - * $source now contains the authentication source on which authenticate() - * was called. We should call login() on the same authentication source. - */ - - /* Attempt to log in. */ - try { - $attributes = $source->login($username, $password); - } catch (Exception $e) { - SimpleSAML\Logger::stats('Unsuccessful login attempt from '.$_SERVER['REMOTE_ADDR'].'.'); - throw $e; - } - - SimpleSAML\Logger::stats('User \''.$username.'\' successfully authenticated from '.$_SERVER['REMOTE_ADDR']); - - /* Save the attributes we received from the login-function in the $state-array. */ - assert('is_array($attributes)'); - $state['Attributes'] = $attributes; - - /* Return control to SimpleSAMLphp after successful authentication. */ - SimpleSAML_Auth_Source::completeAuth($state); - } + /** + * Initialize login. + * + * This function saves the information about the login, and redirects to a + * login page. + * + * @param array &$state Information about the current authentication. + */ + public function authenticate(&$state) + { + assert(is_array($state)); + + /* + * Save the identifier of this authentication source, so that we can + * retrieve it later. This allows us to call the login()-function on + * the current object. + */ + $state[self::AUTHID] = $this->authId; + + // What username we should force, if any + if ($this->forcedUsername !== null) { + /* + * This is accessed by the login form, to determine if the user + * is allowed to change the username. + */ + $state['forcedUsername'] = $this->forcedUsername; + } + + // ECP requests supply authentication credentials with the AuthnRequest + // so we validate them now rather than redirecting. The SAML spec + // doesn't define how the credentials are transferred, but Office 365 + // uses the Authorization header, so we will just use that in lieu of + // other use cases. + if (isset($state['saml:Binding']) && $state['saml:Binding'] === \SAML2\Constants::BINDING_PAOS) { + if (!isset($_SERVER['PHP_AUTH_USER']) || !isset($_SERVER['PHP_AUTH_PW'])) { + \SimpleSAML\Logger::error("ECP AuthnRequest did not contain Basic Authentication header"); + // TODO Return a SOAP fault instead of using the current binding? + throw new \SimpleSAML\Error\Error("WRONGUSERPASS"); + } + + $username = $_SERVER['PHP_AUTH_USER']; + $password = $_SERVER['PHP_AUTH_PW']; + + if (isset($state['forcedUsername'])) { + $username = $state['forcedUsername']; + } + + $attributes = $this->login($username, $password); + assert(is_array($attributes)); + $state['Attributes'] = $attributes; + + return; + } + + // Save the $state-array, so that we can restore it after a redirect + $id = \SimpleSAML\Auth\State::saveState($state, self::STAGEID); + + /* + * Redirect to the login form. We include the identifier of the saved + * state array as a parameter to the login form. + */ + $url = \SimpleSAML\Module::getModuleURL('core/loginuserpass.php'); + $params = ['AuthState' => $id]; + \SimpleSAML\Utils\HTTP::redirectTrustedURL($url, $params); + + // The previous function never returns, so this code is never executed. + assert(false); + } + + /** + * Attempt to log in using the given username and password. + * + * On a successful login, this function should return the users attributes. On failure, + * it should throw an exception/error. If the error was caused by the user entering the wrong + * username or password, a \SimpleSAML\Error\Error('WRONGUSERPASS') should be thrown. + * + * Note that both the username and the password are UTF-8 encoded. + * + * @param string $username The username the user wrote. + * @param string $password The password the user wrote. + * @return array Associative array with the user's attributes. + */ + abstract protected function login($username, $password); + /** + * Handle login request. + * + * This function is used by the login form (core/www/loginuserpass.php) when the user + * enters a username and password. On success, it will not return. On wrong + * username/password failure, and other errors, it will throw an exception. + * + * @param string $authStateId The identifier of the authentication state. + * @param string $username The username the user wrote. + * @param string $password The password the user wrote. + */ + public static function handleLogin($authStateId, $username, $password) + { + assert(is_string($authStateId)); + assert(is_string($username)); + assert(is_string($password)); + + // Here we retrieve the state array we saved in the authenticate-function. + $state = \SimpleSAML\Auth\State::loadState($authStateId, self::STAGEID); + + // Retrieve the authentication source we are executing. + assert(array_key_exists(self::AUTHID, $state)); + $source = \SimpleSAML\Auth\Source::getById($state[self::AUTHID]); + if ($source === null) { + throw new \Exception('Could not find authentication source with id '.$state[self::AUTHID]); + } + + /* + * $source now contains the authentication source on which authenticate() + * was called. We should call login() on the same authentication source. + */ + + // Attempt to log in + try { + $attributes = $source->login($username, $password); + } catch (\Exception $e) { + \SimpleSAML\Logger::stats('Unsuccessful login attempt from '.$_SERVER['REMOTE_ADDR'].'.'); + throw $e; + } + + \SimpleSAML\Logger::stats('User \''.$username.'\' successfully authenticated from '.$_SERVER['REMOTE_ADDR']); + + // Save the attributes we received from the login-function in the $state-array + assert(is_array($attributes)); + $state['Attributes'] = $attributes; + + // Return control to SimpleSAMLphp after successful authentication. + \SimpleSAML\Auth\Source::completeAuth($state); + } } diff --git a/vendor/simplesamlphp/simplesamlphp/modules/core/lib/Auth/UserPassOrgBase.php b/vendor/simplesamlphp/simplesamlphp/modules/core/lib/Auth/UserPassOrgBase.php index 31703322a4..33168524c8 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/core/lib/Auth/UserPassOrgBase.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/core/lib/Auth/UserPassOrgBase.php @@ -1,5 +1,7 @@ <?php +namespace SimpleSAML\Module\core\Auth; + /** * Helper class for username/password/organization authentication. * @@ -11,266 +13,316 @@ * @author Olav Morken, UNINETT AS. * @package SimpleSAMLphp */ -abstract class sspmod_core_Auth_UserPassOrgBase extends SimpleSAML_Auth_Source { - - - /** - * The string used to identify our states. - */ - const STAGEID = 'sspmod_core_Auth_UserPassOrgBase.state'; - - - /** - * The key of the AuthId field in the state. - */ - const AUTHID = 'sspmod_core_Auth_UserPassOrgBase.AuthId'; - - - /** - * The key of the OrgId field in the state, identifies which org was selected. - */ - const ORGID = 'sspmod_core_Auth_UserPassOrgBase.SelectedOrg'; - - - /** - * What way do we handle the organization as part of the username. - * Three values: - * 'none': Force the user to select the correct organization from the dropdown box. - * 'allow': Allow the user to enter the organization as part of the username. - * 'force': Remove the dropdown box. - */ - private $usernameOrgMethod; - - /** - * Storage for authsource config option remember.username.enabled - * loginuserpass.php and loginuserpassorg.php pages/templates use this option to - * present users with a checkbox to save their username for the next login request. - * @var bool - */ - protected $rememberUsernameEnabled = FALSE; - - /** - * Storage for authsource config option remember.username.checked - * loginuserpass.php and loginuserpassorg.php pages/templates use this option - * to default the remember username checkbox to checked or not. - * @var bool - */ - protected $rememberUsernameChecked = FALSE; - - - /** - * Constructor for this authentication source. - * - * All subclasses who implement their own constructor must call this constructor before - * using $config for anything. - * - * @param array $info Information about this authentication source. - * @param array &$config Configuration for this authentication source. - */ - public function __construct($info, &$config) { - assert('is_array($info)'); - assert('is_array($config)'); - - // Call the parent constructor first, as required by the interface - parent::__construct($info, $config); - - // Get the remember username config options - if (isset($config['remember.username.enabled'])) { - $this->rememberUsernameEnabled = (bool) $config['remember.username.enabled']; - unset($config['remember.username.enabled']); - } - if (isset($config['remember.username.checked'])) { - $this->rememberUsernameChecked = (bool) $config['remember.username.checked']; - unset($config['remember.username.checked']); - } - - $this->usernameOrgMethod = 'none'; - } - - - /** - * Configure the way organizations as part of the username is handled. - * - * There are three possible values: - * - 'none': Force the user to select the correct organization from the dropdown box. - * - 'allow': Allow the user to enter the organization as part of the username. - * - 'force': Remove the dropdown box. - * - * If unconfigured, the default is 'none'. - * - * @param string $usernameOrgMethod The method which should be used. - */ - protected function setUsernameOrgMethod($usernameOrgMethod) { - assert('in_array($usernameOrgMethod, array("none", "allow", "force"), TRUE)'); - - $this->usernameOrgMethod = $usernameOrgMethod; - } - - - /** - * Retrieve the way organizations as part of the username should be handled. - * - * There are three possible values: - * - 'none': Force the user to select the correct organization from the dropdown box. - * - 'allow': Allow the user to enter the organization as part of the username. - * - 'force': Remove the dropdown box. - * - * @return string The method which should be used. - */ - public function getUsernameOrgMethod() { - return $this->usernameOrgMethod; - } - - /** - * Getter for the authsource config option remember.username.enabled - * @return bool - */ - public function getRememberUsernameEnabled() { - return $this->rememberUsernameEnabled; - } - - /** - * Getter for the authsource config option remember.username.checked - * @return bool - */ - public function getRememberUsernameChecked() { - return $this->rememberUsernameChecked; - } - - - /** - * Initialize login. - * - * This function saves the information about the login, and redirects to a - * login page. - * - * @param array &$state Information about the current authentication. - */ - public function authenticate(&$state) { - assert('is_array($state)'); - - // We are going to need the authId in order to retrieve this authentication source later - $state[self::AUTHID] = $this->authId; - - $id = SimpleSAML_Auth_State::saveState($state, self::STAGEID); - - $url = SimpleSAML\Module::getModuleURL('core/loginuserpassorg.php'); - $params = array('AuthState' => $id); - \SimpleSAML\Utils\HTTP::redirectTrustedURL($url, $params); - } - - - /** - * Attempt to log in using the given username, password and organization. - * - * On a successful login, this function should return the users attributes. On failure, - * it should throw an exception/error. If the error was caused by the user entering the wrong - * username or password, a SimpleSAML_Error_Error('WRONGUSERPASS') should be thrown. - * - * Note that both the username and the password are UTF-8 encoded. - * - * @param string $username The username the user wrote. - * @param string $password The password the user wrote. - * @param string $organization The id of the organization the user chose. - * @return array Associative array with the user's attributes. - */ - abstract protected function login($username, $password, $organization); - - - /** - * Retrieve list of organizations. - * - * The list of organizations is an associative array. The key of the array is the - * id of the organization, and the value is the description. The value can be another - * array, in which case that array is expected to contain language-code to - * description mappings. - * - * @return array Associative array with the organizations. - */ - abstract protected function getOrganizations(); - - - /** - * Handle login request. - * - * This function is used by the login form (core/www/loginuserpassorg.php) when the user - * enters a username and password. On success, it will not return. On wrong - * username/password failure, and other errors, it will throw an exception. - * - * @param string $authStateId The identifier of the authentication state. - * @param string $username The username the user wrote. - * @param string $password The password the user wrote. - * @param string $organization The id of the organization the user chose. - */ - public static function handleLogin($authStateId, $username, $password, $organization) { - assert('is_string($authStateId)'); - assert('is_string($username)'); - assert('is_string($password)'); - assert('is_string($organization)'); - - /* Retrieve the authentication state. */ - $state = SimpleSAML_Auth_State::loadState($authStateId, self::STAGEID); - - /* Find authentication source. */ - assert('array_key_exists(self::AUTHID, $state)'); - $source = SimpleSAML_Auth_Source::getById($state[self::AUTHID]); - if ($source === NULL) { - throw new Exception('Could not find authentication source with id ' . $state[self::AUTHID]); - } - - $orgMethod = $source->getUsernameOrgMethod(); - if ($orgMethod !== 'none') { - $tmp = explode('@', $username, 2); - if (count($tmp) === 2) { - $username = $tmp[0]; - $organization = $tmp[1]; - } else { - if ($orgMethod === 'force') { - /* The organization should be a part of the username, but isn't. */ - throw new SimpleSAML_Error_Error('WRONGUSERPASS'); - } - } - } - - /* Attempt to log in. */ - $attributes = $source->login($username, $password, $organization); - - // Add the selected Org to the state - $state[self::ORGID] = $organization; - $state['PersistentAuthData'][] = self::ORGID; - - $state['Attributes'] = $attributes; - SimpleSAML_Auth_Source::completeAuth($state); - } - - - /** - * Get available organizations. - * - * This function is used by the login form to get the available organizations. - * - * @param string $authStateId The identifier of the authentication state. - * @return array|NULL Array of organizations. NULL if the user must enter the - * organization as part of the username. - */ - public static function listOrganizations($authStateId) { - assert('is_string($authStateId)'); - - /* Retrieve the authentication state. */ - $state = SimpleSAML_Auth_State::loadState($authStateId, self::STAGEID); - - /* Find authentication source. */ - assert('array_key_exists(self::AUTHID, $state)'); - $source = SimpleSAML_Auth_Source::getById($state[self::AUTHID]); - if ($source === NULL) { - throw new Exception('Could not find authentication source with id ' . $state[self::AUTHID]); - } - - $orgMethod = $source->getUsernameOrgMethod(); - if ($orgMethod === 'force') { - return NULL; - } - - return $source->getOrganizations(); - } + +abstract class UserPassOrgBase extends \SimpleSAML\Auth\Source +{ + /** + * The string used to identify our states. + */ + const STAGEID = '\SimpleSAML\Module\core\Auth\UserPassOrgBase.state'; + + + /** + * The key of the AuthId field in the state. + */ + const AUTHID = '\SimpleSAML\Module\core\Auth\UserPassOrgBase.AuthId'; + + + /** + * The key of the OrgId field in the state, identifies which org was selected. + */ + const ORGID = '\SimpleSAML\Module\core\Auth\UserPassOrgBase.SelectedOrg'; + + + /** + * What way do we handle the organization as part of the username. + * Three values: + * 'none': Force the user to select the correct organization from the dropdown box. + * 'allow': Allow the user to enter the organization as part of the username. + * 'force': Remove the dropdown box. + */ + private $usernameOrgMethod; + + /** + * Storage for authsource config option remember.username.enabled + * loginuserpass.php and loginuserpassorg.php pages/templates use this option to + * present users with a checkbox to save their username for the next login request. + * @var bool + */ + protected $rememberUsernameEnabled = false; + + /** + * Storage for authsource config option remember.username.checked + * loginuserpass.php and loginuserpassorg.php pages/templates use this option + * to default the remember username checkbox to checked or not. + * @var bool + */ + protected $rememberUsernameChecked = false; + + /** + * Storage for authsource config option remember.organization.enabled + * loginuserpassorg.php page/template use this option to present users + * with a checkbox to save their organization choice for the next login request. + * @var bool + */ + protected $rememberOrganizationEnabled = false; + + /** + * Storage for authsource config option remember.organization.checked + * loginuserpassorg.php page/template use this option to + * default the remember organization checkbox to checked or not. + * @var bool + */ + protected $rememberOrganizationChecked = false; + + + /** + * Constructor for this authentication source. + * + * All subclasses who implement their own constructor must call this constructor before + * using $config for anything. + * + * @param array $info Information about this authentication source. + * @param array &$config Configuration for this authentication source. + */ + public function __construct($info, &$config) + { + assert(is_array($info)); + assert(is_array($config)); + + // Call the parent constructor first, as required by the interface + parent::__construct($info, $config); + + // Get the remember username config options + if (isset($config['remember.username.enabled'])) { + $this->rememberUsernameEnabled = (bool) $config['remember.username.enabled']; + unset($config['remember.username.enabled']); + } + if (isset($config['remember.username.checked'])) { + $this->rememberUsernameChecked = (bool) $config['remember.username.checked']; + unset($config['remember.username.checked']); + } + // Get the remember organization config options + if (isset($config['remember.organization.enabled'])) { + $this->rememberOrganizationEnabled = (bool) $config['remember.organization.enabled']; + unset($config['remember.organization.enabled']); + } + if (isset($config['remember.organization.checked'])) { + $this->rememberOrganizationChecked = (bool) $config['remember.organization.checked']; + unset($config['remember.organization.checked']); + } + + $this->usernameOrgMethod = 'none'; + } + + + /** + * Configure the way organizations as part of the username is handled. + * + * There are three possible values: + * - 'none': Force the user to select the correct organization from the dropdown box. + * - 'allow': Allow the user to enter the organization as part of the username. + * - 'force': Remove the dropdown box. + * + * If unconfigured, the default is 'none'. + * + * @param string $usernameOrgMethod The method which should be used. + */ + protected function setUsernameOrgMethod($usernameOrgMethod) + { + assert(in_array($usernameOrgMethod, ['none', 'allow', 'force'], true)); + + $this->usernameOrgMethod = $usernameOrgMethod; + } + + + /** + * Retrieve the way organizations as part of the username should be handled. + * + * There are three possible values: + * - 'none': Force the user to select the correct organization from the dropdown box. + * - 'allow': Allow the user to enter the organization as part of the username. + * - 'force': Remove the dropdown box. + * + * @return string The method which should be used. + */ + public function getUsernameOrgMethod() + { + return $this->usernameOrgMethod; + } + + /** + * Getter for the authsource config option remember.username.enabled + * @return bool + */ + public function getRememberUsernameEnabled() + { + return $this->rememberUsernameEnabled; + } + + /** + * Getter for the authsource config option remember.username.checked + * @return bool + */ + public function getRememberUsernameChecked() + { + return $this->rememberUsernameChecked; + } + + /** + * Getter for the authsource config option remember.organization.enabled + * @return bool + */ + public function getRememberOrganizationEnabled() + { + return $this->rememberOrganizationEnabled; + } + + /** + * Getter for the authsource config option remember.organization.checked + * @return bool + */ + public function getRememberOrganizationChecked() + { + return $this->rememberOrganizationChecked; + } + + /** + * Initialize login. + * + * This function saves the information about the login, and redirects to a + * login page. + * + * @param array &$state Information about the current authentication. + */ + public function authenticate(&$state) + { + assert(is_array($state)); + + // We are going to need the authId in order to retrieve this authentication source later + $state[self::AUTHID] = $this->authId; + + $id = \SimpleSAML\Auth\State::saveState($state, self::STAGEID); + + $url = \SimpleSAML\Module::getModuleURL('core/loginuserpassorg.php'); + $params = ['AuthState' => $id]; + \SimpleSAML\Utils\HTTP::redirectTrustedURL($url, $params); + } + + + /** + * Attempt to log in using the given username, password and organization. + * + * On a successful login, this function should return the users attributes. On failure, + * it should throw an exception/error. If the error was caused by the user entering the wrong + * username or password, a \SimpleSAML\Error\Error('WRONGUSERPASS') should be thrown. + * + * Note that both the username and the password are UTF-8 encoded. + * + * @param string $username The username the user wrote. + * @param string $password The password the user wrote. + * @param string $organization The id of the organization the user chose. + * @return array Associative array with the user's attributes. + */ + abstract protected function login($username, $password, $organization); + + + /** + * Retrieve list of organizations. + * + * The list of organizations is an associative array. The key of the array is the + * id of the organization, and the value is the description. The value can be another + * array, in which case that array is expected to contain language-code to + * description mappings. + * + * @return array Associative array with the organizations. + */ + abstract protected function getOrganizations(); + + + /** + * Handle login request. + * + * This function is used by the login form (core/www/loginuserpassorg.php) when the user + * enters a username and password. On success, it will not return. On wrong + * username/password failure, and other errors, it will throw an exception. + * + * @param string $authStateId The identifier of the authentication state. + * @param string $username The username the user wrote. + * @param string $password The password the user wrote. + * @param string $organization The id of the organization the user chose. + */ + public static function handleLogin($authStateId, $username, $password, $organization) + { + assert(is_string($authStateId)); + assert(is_string($username)); + assert(is_string($password)); + assert(is_string($organization)); + + /* Retrieve the authentication state. */ + $state = \SimpleSAML\Auth\State::loadState($authStateId, self::STAGEID); + + /* Find authentication source. */ + assert(array_key_exists(self::AUTHID, $state)); + $source = \SimpleSAML\Auth\Source::getById($state[self::AUTHID]); + if ($source === null) { + throw new \Exception('Could not find authentication source with id '.$state[self::AUTHID]); + } + + $orgMethod = $source->getUsernameOrgMethod(); + if ($orgMethod !== 'none') { + $tmp = explode('@', $username, 2); + if (count($tmp) === 2) { + $username = $tmp[0]; + $organization = $tmp[1]; + } else { + if ($orgMethod === 'force') { + /* The organization should be a part of the username, but isn't. */ + throw new \SimpleSAML\Error\Error('WRONGUSERPASS'); + } + } + } + + /* Attempt to log in. */ + $attributes = $source->login($username, $password, $organization); + + // Add the selected Org to the state + $state[self::ORGID] = $organization; + $state['PersistentAuthData'][] = self::ORGID; + + $state['Attributes'] = $attributes; + \SimpleSAML\Auth\Source::completeAuth($state); + } + + + /** + * Get available organizations. + * + * This function is used by the login form to get the available organizations. + * + * @param string $authStateId The identifier of the authentication state. + * @return array|NULL Array of organizations. NULL if the user must enter the + * organization as part of the username. + */ + public static function listOrganizations($authStateId) + { + assert(is_string($authStateId)); + + /* Retrieve the authentication state. */ + $state = \SimpleSAML\Auth\State::loadState($authStateId, self::STAGEID); + + /* Find authentication source. */ + assert(array_key_exists(self::AUTHID, $state)); + $source = \SimpleSAML\Auth\Source::getById($state[self::AUTHID]); + if ($source === null) { + throw new \Exception('Could not find authentication source with id '.$state[self::AUTHID]); + } + + $orgMethod = $source->getUsernameOrgMethod(); + if ($orgMethod === 'force') { + return null; + } + + return $source->getOrganizations(); + } } diff --git a/vendor/simplesamlphp/simplesamlphp/modules/core/lib/Controller.php b/vendor/simplesamlphp/simplesamlphp/modules/core/lib/Controller.php new file mode 100644 index 0000000000..8a4563f42d --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/modules/core/lib/Controller.php @@ -0,0 +1,174 @@ +<?php + +namespace SimpleSAML\Module\core; + +use SimpleSAML\Error\Exception; +use SimpleSAML\HTTP\RunnableResponse; + +use Symfony\Component\HttpFoundation\RedirectResponse; +use Symfony\Component\HttpFoundation\Request; + +/** + * Controller class for the core module. + * + * This class serves the different views available in the module. + * + * @package SimpleSAML\Module\core + */ +class Controller +{ + + /** @var \SimpleSAML\Configuration */ + protected $config; + + /** @var \SimpleSAML\Auth\AuthenticationFactory */ + protected $factory; + + /** @var \SimpleSAML\Session */ + protected $session; + + /** @var array */ + protected $sources; + + + /** + * Controller constructor. + * + * It initializes the global configuration and auth source configuration for the controllers implemented here. + * + * @param \SimpleSAML\Configuration $config The configuration to use by the controllers. + * @param \SimpleSAML\Session $session The session to use by the controllers. + * @param \SimpleSAML\Auth\AuthenticationFactory $factory A factory to instantiate \SimpleSAML\Auth\Simple objects. + * + * @throws \Exception + */ + public function __construct( + \SimpleSAML\Configuration $config, + \SimpleSAML\Session $session, + \SimpleSAML\Auth\AuthenticationFactory $factory + ) { + $this->config = $config; + $this->factory = $factory; + $this->sources = $config::getOptionalConfig('authsources.php')->toArray(); + $this->session = $session; + } + + + /** + * Show account information for a given authentication source. + * + * @param string $as The identifier of the authentication source. + * + * @return \SimpleSAML\XHTML\Template|RedirectResponse An HTML template or a redirection if we are not + * authenticated. + * + * @throws \SimpleSAML\Error\Exception An exception in case the auth source specified is invalid. + */ + public function account($as) + { + if (!array_key_exists($as, $this->sources)) { + throw new Exception('Invalid authentication source'); + } + + $auth = $this->factory->create($as); + if (!$auth->isAuthenticated()) { + // not authenticated, start auth with specified source + return new RedirectResponse(\SimpleSAML\Module::getModuleURL('core/login/'.urlencode($as))); + } + + $attributes = $auth->getAttributes(); + + $t = new \SimpleSAML\XHTML\Template($this->config, 'auth_status.twig', 'attributes'); + $t->data['header'] = '{status:header_saml20_sp}'; + $t->data['attributes'] = $attributes; + $t->data['nameid'] = !is_null($auth->getAuthData('saml:sp:NameID')) + ? $auth->getAuthData('saml:sp:NameID') + : false; + $t->data['logouturl'] = \SimpleSAML\Module::getModuleURL('core/logout/'.urlencode($as)); + $t->data['remaining'] = $this->session->getAuthData($as, 'Expire') - time(); + $t->setStatusCode(200); + + return $t; + } + + + /** + * Perform a login operation. + * + * This controller will either start a login operation (if that was requested, or if only one authentication + * source is available), or show a template allowing the user to choose which auth source to use. + * + * @param Request $request The request that lead to this login operation. + * @param string|null $as The name of the authentication source to use, if any. Optional. + * + * @return \SimpleSAML\XHTML\Template|\SimpleSAML\HTTP\RunnableResponse|RedirectResponse An HTML template, a + * redirect or a "runnable" response. + * + * @throws \SimpleSAML\Error\Exception + */ + public function login(Request $request, $as = null) + { + //delete admin + if (isset($this->sources['admin'])) { + unset($this->sources['admin']); + } + + if (count($this->sources) === 1 && $as === null) { // we only have one source available + $as = key($this->sources); + } + + if ($as === null) { // no authentication source specified + $t = new \SimpleSAML\XHTML\Template($this->config, 'core:login.twig'); + $t->data['loginurl'] = \SimpleSAML\Utils\Auth::getAdminLoginURL(); + $t->data['sources'] = $this->sources; + return $t; + } + + // auth source defined, check if valid + if (!array_key_exists($as, $this->sources)) { + throw new Exception('Invalid authentication source'); + } + + // at this point, we have a valid auth source selected, start auth + $auth = $this->factory->create($as); + $as = urlencode($as); + + if ($request->get(\SimpleSAML\Auth\State::EXCEPTION_PARAM, false) !== false) { + // This is just a simple example of an error + + $state = \SimpleSAML\Auth\State::loadExceptionState(); + assert(array_key_exists(\SimpleSAML\Auth\State::EXCEPTION_DATA, $state)); + $e = $state[\SimpleSAML\Auth\State::EXCEPTION_DATA]; + + throw $e; + } + + if ($auth->isAuthenticated()) { + return new RedirectResponse(\SimpleSAML\Module::getModuleURL('core/account/'.$as)); + } + + // we're not logged in, start auth + $url = \SimpleSAML\Module::getModuleURL('core/login/'.$as); + $params = array( + 'ErrorURL' => $url, + 'ReturnTo' => $url, + ); + return new RunnableResponse([$auth, 'login'], [$params]); + } + + + /** + * Log the user out of a given authentication source. + * + * @param string $as The name of the auth source. + * + * @return \SimpleSAML\HTTP\RunnableResponse A runnable response which will actually perform logout. + * + * @throws \SimpleSAML\Error\CriticalConfigurationError + */ + public function logout($as) + { + $auth = new \SimpleSAML\Auth\Simple($as); + return new RunnableResponse([$auth, 'logout'], [$this->config->getBasePath().'logout.php']); + } +} diff --git a/vendor/simplesamlphp/simplesamlphp/modules/core/lib/Stats/Output/File.php b/vendor/simplesamlphp/simplesamlphp/modules/core/lib/Stats/Output/File.php index acd661496c..cac817c83b 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/core/lib/Stats/Output/File.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/core/lib/Stats/Output/File.php @@ -1,97 +1,96 @@ <?php +namespace SimpleSAML\Module\core\Stats\Output; + /** * Statistics logger that writes to a set of log files * * @package SimpleSAMLphp */ -class sspmod_core_Stats_Output_File extends SimpleSAML_Stats_Output { - - /** - * The log directory. - * @var string - */ - private $logDir; - - - /** - * The file handle for the current file. - * @var resource - */ - private $file = NULL; - - /** - * The current file date. - * @var string - */ - private $fileDate = NULL; - - - /** - * Initialize the output. - * - * @param SimpleSAML_Configuration $config The configuration for this output. - */ - public function __construct(SimpleSAML_Configuration $config) { - - $this->logDir = $config->getPathValue('directory'); - if ($this->logDir === NULL) { - throw new Exception('Missing "directory" option for core:File'); - } - if (!is_dir($this->logDir)) { - throw new Exception('Could not find log directory: ' . var_export($this->logDir, TRUE)); - } - - } - - - /** - * Open a log file. - * - * @param string $date The date for the log file. - */ - private function openLog($date) { - assert('is_string($date)'); - - if ($this->file !== NULL && $this->file !== FALSE) { - fclose($this->file); - $this->file = NULL; - } - - $fileName = $this->logDir . '/' . $date . '.log'; - $this->file = @fopen($fileName, 'a'); - if ($this->file === FALSE) { - throw new SimpleSAML_Error_Exception('Error opening log file: ' . var_export($fileName, TRUE)); - } - - // Disable output buffering - stream_set_write_buffer($this->file, 0); - - $this->fileDate = $date; - } - - - /** - * Write a stats event. - * - * @param array $data The event. - */ - public function emit(array $data) { - assert('isset($data["time"])'); - - $time = $data['time']; - $milliseconds = (int)(($time - (int)$time) * 1000); - - $timestamp = gmdate('Y-m-d\TH:i:s', $time) . sprintf('.%03dZ', $milliseconds); - - $outDate = substr($timestamp, 0, 10); // The date-part of the timstamp - - if ($outDate !== $this->fileDate) { - $this->openLog($outDate); - } - - $line = $timestamp . ' ' . json_encode($data) . "\n"; - fwrite($this->file, $line); - } +class File extends \SimpleSAML\Stats\Output +{ + /** + * The log directory. + * @var string + */ + private $logDir; + + /** + * The file handle for the current file. + * @var resource|null|false + */ + private $file = null; + + /** + * The current file date. + * @var string + */ + private $fileDate = null; + + /** + * Initialize the output. + * + * @param \SimpleSAML\Configuration $config The configuration for this output. + */ + public function __construct(\SimpleSAML\Configuration $config) + { + $this->logDir = $config->getPathValue('directory'); + if ($this->logDir === null) { + throw new \Exception('Missing "directory" option for core:File'); + } + if (!is_dir($this->logDir)) { + throw new \Exception('Could not find log directory: '.var_export($this->logDir, true)); + } + } + + /** + * Open a log file. + * + * @param string $date The date for the log file. + */ + private function openLog($date) + { + assert(is_string($date)); + + if ($this->file !== null && $this->file !== false) { + fclose($this->file); + $this->file = null; + } + + $fileName = $this->logDir.'/'.$date.'.log'; + $this->file = @fopen($fileName, 'a'); + if ($this->file === false) { + throw new \SimpleSAML\Error\Exception('Error opening log file: '.var_export($fileName, true)); + } + + // Disable output buffering + stream_set_write_buffer($this->file, 0); + + $this->fileDate = $date; + } + + /** + * Write a stats event. + * + * @param array $data The event. + */ + public function emit(array $data) + { + assert(isset($data['time'])); + + $time = $data['time']; + $milliseconds = (int) (($time - (int) $time) * 1000); + + $timestamp = gmdate('Y-m-d\TH:i:s', $time).sprintf('.%03dZ', $milliseconds); + + $outDate = substr($timestamp, 0, 10); // The date-part of the timstamp + + if ($outDate !== $this->fileDate) { + $this->openLog($outDate); + } + + $line = $timestamp.' '.json_encode($data)."\n"; + fwrite($this->file, $line); + } } diff --git a/vendor/simplesamlphp/simplesamlphp/modules/core/lib/Stats/Output/Log.php b/vendor/simplesamlphp/simplesamlphp/modules/core/lib/Stats/Output/Log.php index 70e914e4bb..e3eff86663 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/core/lib/Stats/Output/Log.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/core/lib/Stats/Output/Log.php @@ -1,42 +1,43 @@ <?php +namespace SimpleSAML\Module\core\Stats\Output; + /** * Statistics logger that writes to the default logging handler. * * @package SimpleSAMLphp */ -class sspmod_core_Stats_Output_Log extends SimpleSAML_Stats_Output { - - /** - * The logging function we should call. - * @var callback - */ - private $logger; - - - /** - * Initialize the output. - * - * @param SimpleSAML_Configuration $config The configuration for this output. - */ - public function __construct(SimpleSAML_Configuration $config) { - - $logLevel = $config->getString('level', 'notice'); - $this->logger = array('SimpleSAML\Logger', $logLevel); - if (!is_callable($this->logger)) { - throw new Exception('Invalid log level: ' . var_export($logLevel, TRUE)); - } - } - - - /** - * Write a stats event. - * - * @param string $data The event (as a JSON string). - */ - public function emit(array $data) { - $str_data = json_encode($data); - call_user_func($this->logger, 'EVENT ' . $str_data); - } +class Log extends \SimpleSAML\Stats\Output +{ + /** + * The logging function we should call. + * @var callback + */ + private $logger; + + /** + * Initialize the output. + * + * @param \SimpleSAML\Configuration $config The configuration for this output. + */ + public function __construct(\SimpleSAML\Configuration $config) + { + $logLevel = $config->getString('level', 'notice'); + $this->logger = ['\SimpleSAML\Logger', $logLevel]; + if (!is_callable($this->logger)) { + throw new \Exception('Invalid log level: '.var_export($logLevel, true)); + } + } + + /** + * Write a stats event. + * + * @param string $data The event (as a JSON string). + */ + public function emit(array $data) + { + $str_data = json_encode($data); + call_user_func($this->logger, 'EVENT '.$str_data); + } } diff --git a/vendor/simplesamlphp/simplesamlphp/modules/core/lib/Storage/SQLPermanentStorage.php b/vendor/simplesamlphp/simplesamlphp/modules/core/lib/Storage/SQLPermanentStorage.php index 54bb5642bf..4360d5e84a 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/core/lib/Storage/SQLPermanentStorage.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/core/lib/Storage/SQLPermanentStorage.php @@ -1,206 +1,219 @@ <?php +namespace SimpleSAML\Module\core\Storage; + /** * SQLPermanentStorage - * + * * Generic SQL Store to store key value pairs. To be used in several other modules that needs * to store data permanently. * * @author Andreas Åkre Solberg <andreas@uninett.no>, UNINETT AS. * @package SimpleSAMLphp */ -class sspmod_core_Storage_SQLPermanentStorage { - - private $db; - - function __construct($name, $config = NULL) { - if (is_null($config)) - $config = SimpleSAML_Configuration::getInstance(); - - $datadir = $config->getPathValue('datadir', 'data/'); - - if (!is_dir($datadir)) - throw new Exception('Data directory [' . $datadir. '] does not exist'); - if (!is_writable($datadir)) - throw new Exception('Data directory [' . $datadir. '] is not writable'); - - $sqllitedir = $datadir . 'sqllite/'; - if (!is_dir($sqllitedir)) { - mkdir($sqllitedir); - } - - $dbfile = $sqllitedir . $name . '.sqllite'; - - if ($this->db = new SQLiteDatabase($dbfile)) { - $q = @$this->db->query('SELECT key1 FROM data LIMIT 1'); - if ($q === false) { - $this->db->queryExec(' - CREATE TABLE data ( - key1 text, - key2 text, - type text, - value text, - created timestamp, - updated timestamp, - expire timestamp, - PRIMARY KEY (key1,key2,type) - ); - '); - } - } else { - throw new Exception('Error creating SQL lite database [' . $dbfile . '].'); - } - } - - public function set($type, $key1, $key2, $value, $duration = NULL) { - if ($this->exists($type, $key1, $key2)) { - $this->update($type, $key1, $key2, $value, $duration); - } else { - $this->insert($type, $key1, $key2, $value, $duration); - } - } - - private function insert($type, $key1, $key2, $value, $duration = NULL) { - - $setDuration = ''; - if (is_null($duration)) { - $setDuration = 'NULL'; - } else { - $setDuration = "'" . sqlite_escape_string(time() + $duration) . "'"; - } - - $query = "INSERT INTO data (key1,key2,type,created,updated,expire,value) VALUES (" . - "'" . sqlite_escape_string($key1) . "'," . - "'" . sqlite_escape_string($key2) . "'," . - "'" . sqlite_escape_string($type) . "'," . - "'" . sqlite_escape_string(time()) . "'," . - "'" . sqlite_escape_string(time()) . "'," . - $setDuration . "," . - "'" . sqlite_escape_string(serialize($value)) . "')"; - $results = $this->db->queryExec($query); - return $results; - } - - private function update($type, $key1, $key2, $value, $duration = NULL) { - - $setDuration = ''; - if (is_null($duration)) { - $setDuration = ", expire = NULL "; - } else { - $setDuration = ", expire = '" . sqlite_escape_string(time() + $duration) . "' "; - } - - $query = "UPDATE data SET " . - "updated = '" . sqlite_escape_string(time()) . "'," . - "value = '" . sqlite_escape_string(serialize($value)) . "'" . - $setDuration . - "WHERE " . - "key1 = '" . sqlite_escape_string($key1) . "' AND " . - "key2 = '" . sqlite_escape_string($key2) . "' AND " . - "type = '" . sqlite_escape_string($type) . "'"; - $results = $this->db->queryExec($query); - return $results; - } - - public function get($type = NULL, $key1 = NULL, $key2 = NULL) { - - $condition = self::getCondition($type, $key1, $key2); - $query = "SELECT * FROM data WHERE " . $condition; - $results = $this->db->arrayQuery($query, SQLITE_ASSOC); - - if (count($results) !== 1) return NULL; - - $res = $results[0]; - $res['value'] = unserialize($res['value']); - return $res; - } - - /* - * Return the value directly (not in a container) - */ - public function getValue($type = NULL, $key1 = NULL, $key2 = NULL) { - $res = $this->get($type, $key1, $key2); - if ($res === NULL) return NULL; - return $res['value']; - } - - public function exists($type, $key1, $key2) { - $query = "SELECT * FROM data WHERE " . - "key1 = '" . sqlite_escape_string($key1) . "' AND " . - "key2 = '" . sqlite_escape_string($key2) . "' AND " . - "type = '" . sqlite_escape_string($type) . "' LIMIT 1"; - $results = $this->db->arrayQuery($query, SQLITE_ASSOC); - return (count($results) == 1); - } - - public function getList($type = NULL, $key1 = NULL, $key2 = NULL) { - - $condition = self::getCondition($type, $key1, $key2); - $query = "SELECT * FROM data WHERE " . $condition; - $results = $this->db->arrayQuery($query, SQLITE_ASSOC); - if (count($results) == 0) return NULL; - - foreach($results AS $key => $value) { - $results[$key]['value'] = unserialize($results[$key]['value']); - } - return $results; - } - - public function getKeys($type = NULL, $key1 = NULL, $key2 = NULL, $whichKey = 'type') { - - if (!in_array($whichKey, array('key1', 'key2', 'type'), true)) - throw new Exception('Invalid key type'); - - $condition = self::getCondition($type, $key1, $key2); - - $query = "SELECT DISTINCT " . $whichKey . " FROM data WHERE " . $condition; - $results = $this->db->arrayQuery($query, SQLITE_ASSOC); - - if (count($results) == 0) return NULL; - - $resarray = array(); - foreach($results AS $key => $value) { - $resarray[] = $value[$whichKey]; - } - - return $resarray; - } - - - public function remove($type, $key1, $key2) { - $query = "DELETE FROM data WHERE " . - "key1 = '" . sqlite_escape_string($key1) . "' AND " . - "key2 = '" . sqlite_escape_string($key2) . "' AND " . - "type = '" . sqlite_escape_string($type) . "'"; - $results = $this->db->arrayQuery($query, SQLITE_ASSOC); - return (count($results) == 1); - } - - public function removeExpired() { - $query = "DELETE FROM data WHERE expire NOT NULL AND expire < " . time(); - $this->db->arrayQuery($query, SQLITE_ASSOC); - $changes = $this->db->changes(); - return $changes; - } - - - /** - * Create a SQL condition statement based on parameters - */ - private static function getCondition($type = NULL, $key1 = NULL, $key2 = NULL) { - $conditions = array(); - - if (!is_null($type)) $conditions[] = "type = '" . sqlite_escape_string($type) . "'"; - if (!is_null($key1)) $conditions[] = "key1 = '" . sqlite_escape_string($key1) . "'"; - if (!is_null($key2)) $conditions[] = "key2 = '" . sqlite_escape_string($key2) . "'"; - - if (count($conditions) === 0) return '1'; - - $condition = join(' AND ', $conditions); - - return $condition; - } - - -} +class SQLPermanentStorage +{ + private $db; + + public function __construct($name, $config = null) + { + if (is_null($config)) { + $config = \SimpleSAML\Configuration::getInstance(); + } + + $datadir = $config->getPathValue('datadir', 'data/'); + + if (!is_dir($datadir)) { + throw new \Exception('Data directory ['.$datadir.'] does not exist'); + } elseif (!is_writable($datadir)) { + throw new \Exception('Data directory ['.$datadir.'] is not writable'); + } + + $sqllitedir = $datadir.'sqllite/'; + if (!is_dir($sqllitedir)) { + mkdir($sqllitedir); + } + + $dbfile = 'sqlite:'.$sqllitedir.$name.'.sqlite'; + if ($this->db = new \PDO($dbfile)) { + $q = @$this->db->query('SELECT key1 FROM data LIMIT 1'); + if ($q === false) { + $this->db->exec(' + CREATE TABLE data ( + key1 text, + key2 text, + type text, + value text, + created timestamp, + updated timestamp, + expire timestamp, + PRIMARY KEY (key1,key2,type) + ); + '); + } + } else { + throw new \Exception('Error creating SQL lite database ['.$dbfile.'].'); + } + } + + public function set($type, $key1, $key2, $value, $duration = null) + { + if ($this->exists($type, $key1, $key2)) { + $this->update($type, $key1, $key2, $value, $duration); + } else { + $this->insert($type, $key1, $key2, $value, $duration); + } + } + + private function insert($type, $key1, $key2, $value, $duration = null) + { + $expire = is_null($duration) ? null : (time() + $duration); + + $query = "INSERT INTO data (key1, key2, type, created, updated, expire, value)". + " VALUES(:key1, :key2, :type, :created, :updated, :expire, :value)"; + $prepared = $this->db->prepare($query); + $data = [':key1' => $key1, ':key2' => $key2, + ':type' => $type, ':created' => time(), + ':updated' => time(), ':expire' => $expire, + ':value' => serialize($value)]; + $prepared->execute($data); + $results = $prepared->fetchAll(\PDO::FETCH_ASSOC); + return $results; + } + + private function update($type, $key1, $key2, $value, $duration = null) + { + $expire = is_null($duration) ? null : (time() + $duration); + + $query = "UPDATE data SET updated = :updated, value = :value, ". + "expire = :expire WHERE key1 = :key1 AND key2 = :key2 AND type = :type"; + $prepared = $this->db->prepare($query); + $data = [':key1' => $key1, ':key2' => $key2, + ':type' => $type, ':updated' => time(), + ':expire' => $expire, ':value' => serialize($value)]; + $prepared->execute($data); + $results = $prepared->fetchAll(\PDO::FETCH_ASSOC); + return $results; + } + + public function get($type = null, $key1 = null, $key2 = null) + { + $conditions = $this->getCondition($type, $key1, $key2); + $query = 'SELECT * FROM data WHERE '.$conditions; + + $prepared = $this->db->prepare($query); + $prepared->execute(); + $results = $prepared->fetchAll(\PDO::FETCH_ASSOC); + if (count($results) !== 1) { + return null; + } + + $res = $results[0]; + $res['value'] = unserialize($res['value']); + return $res; + } + + /* + * Return the value directly (not in a container) + */ + public function getValue($type = null, $key1 = null, $key2 = null) + { + $res = $this->get($type, $key1, $key2); + if ($res === null) { + return null; + } + return $res['value']; + } + + public function exists($type, $key1, $key2) + { + $query = 'SELECT * FROM data WHERE type = :type AND key1 = :key1 AND key2 = :key2 LIMIT 1'; + $prepared = $this->db->prepare($query); + $data = [':type' => $type, ':key1' => $key1, ':key2' => $key2]; + $prepared->execute($data); + $results = $prepared->fetchAll(\PDO::FETCH_ASSOC); + return (count($results) == 1); + } + + public function getList($type = null, $key1 = null, $key2 = null) + { + $conditions = $this->getCondition($type, $key1, $key2); + $query = 'SELECT * FROM data WHERE '.$conditions; + $prepared = $this->db->prepare($query); + $prepared->execute(); + + $results = $prepared->fetchAll(\PDO::FETCH_ASSOC); + if (count($results) == 0) { + return null; + } + + foreach ($results as $key => $value) { + $results[$key]['value'] = unserialize($results[$key]['value']); + } + return $results; + } + + public function getKeys($type = null, $key1 = null, $key2 = null, $whichKey = 'type') + { + if (!in_array($whichKey, ['key1', 'key2', 'type'], true)) { + throw new \Exception('Invalid key type'); + } + + $conditions = $this->getCondition($type, $key1, $key2); + $query = 'SELECT DISTINCT :whichKey FROM data WHERE '.$conditions; + $prepared = $this->db->prepare($query); + $data = ['whichKey' => $whichKey]; + $prepared->execute($data); + $results = $prepared->fetchAll(\PDO::FETCH_ASSOC); + + if (count($results) == 0) { + return null; + } + + $resarray = []; + foreach ($results as $key => $value) { + $resarray[] = $value[$whichKey]; + } + return $resarray; + } + + public function remove($type, $key1, $key2) + { + $query = 'DELETE FROM data WHERE type = :type AND key1 = :key1 AND key2 = :key2'; + $prepared = $this->db->prepare($query); + $data = [':type' => $type, ':key1' => $key1, ':key2' => $key2]; + $prepared->execute($data); + $results = $prepared->fetchAll(\PDO::FETCH_ASSOC); + return (count($results) == 1); + } + + public function removeExpired() + { + $query = "DELETE FROM data WHERE expire IS NOT NULL AND expire < :expire"; + $prepared = $this->db->prepare($query); + $data = [':expire' => time()]; + $prepared->execute($data); + return $prepared->rowCount(); + } + + /** + * Create a SQL condition statement based on parameters + */ + private function getCondition($type = null, $key1 = null, $key2 = null) + { + $conditions = []; + if (!is_null($type)) { + $conditions[] = "type = ".$this->db->quote($type); + } + if (!is_null($key1)) { + $conditions[] = "key1 = ".$this->db->quote($key1); + } + if (!is_null($key2)) { + $conditions[] = "key2 = ".$this->db->quote($key2); + } + + $conditions[] = "(expire IS NULL OR expire >= ".time().")"; + return join(' AND ', $conditions); + } +} diff --git a/vendor/simplesamlphp/simplesamlphp/modules/core/locales/ar/LC_MESSAGES/core.po b/vendor/simplesamlphp/simplesamlphp/modules/core/locales/ar/LC_MESSAGES/core.po index 35c36fccd7..84c0fc10ca 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/core/locales/ar/LC_MESSAGES/core.po +++ b/vendor/simplesamlphp/simplesamlphp/modules/core/locales/ar/LC_MESSAGES/core.po @@ -179,8 +179,8 @@ msgid "{core:frontpage:warnings_https}" msgstr "" "<strong>انت لا تستخدم HTTPS</strong> - محادثة مشفرة مع المستخدم. HTTP جيد" " للاختبارات لكن في بيئة النظام المبدئي ينبغي استخدام HTTPS. [ <a " -"href=\"http://rnd.feide.no/contents/simplesamlphp-maintenance-and-" -"configuration\">read more about SimpleSAMLphp maintenance</a>]" +"href=\"https://simplesamlphp.org/docs/stable/simplesamlphp-maintenance" +"\">read more about SimpleSAMLphp maintenance</a>]" msgid "{core:frontpage:federation}" msgstr "الدخول الموحد" @@ -376,8 +376,8 @@ msgid "" msgstr "" "<strong>انت لا تستخدم HTTPS</strong> - محادثة مشفرة مع المستخدم. HTTP جيد" " للاختبارات لكن في بيئة النظام المبدئي ينبغي استخدام HTTPS. [ <a " -"href=\"http://rnd.feide.no/contents/simplesamlphp-maintenance-and-" -"configuration\">read more about SimpleSAMLphp maintenance</a>]" +"href=\"https://simplesamlphp.org/docs/stable/simplesamlphp-maintenance" +"\">read more about SimpleSAMLphp maintenance</a>]" msgid "Metadata" msgstr "البيانات الوصفية/الميتاداتا " diff --git a/vendor/simplesamlphp/simplesamlphp/modules/core/locales/cs/LC_MESSAGES/core.po b/vendor/simplesamlphp/simplesamlphp/modules/core/locales/cs/LC_MESSAGES/core.po index 5293daa9a8..0c5a0b5c61 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/core/locales/cs/LC_MESSAGES/core.po +++ b/vendor/simplesamlphp/simplesamlphp/modules/core/locales/cs/LC_MESSAGES/core.po @@ -184,8 +184,8 @@ msgid "{core:frontpage:warnings_https}" msgstr "" "<strong>Nepoužíváte HTTPS</strong> - šivrovanou komunikaci s uživatelem. " "HTTP je vhodné jen k testovacím účelům, pro produkční účely použijte " -"HTTPS. [ <a href=\"http://rnd.feide.no/content/simplesamlphp-maintenance-" -"and-configuration\">Čtete více o údržbě SimpleSAMLphp</a> ]" +"HTTPS. [ <a href=\"https://simplesamlphp.org/docs/stable/simplesamlphp-maintenance" +"\">Čtete více o údržbě SimpleSAMLphp</a> ]" msgid "{core:frontpage:federation}" msgstr "Federace" @@ -386,8 +386,8 @@ msgid "" msgstr "" "<strong>Nepoužíváte HTTPS</strong> - šivrovanou komunikaci s uživatelem. " "HTTP je vhodné jen k testovacím účelům, pro produkční účely použijte " -"HTTPS. [ <a href=\"http://rnd.feide.no/content/simplesamlphp-maintenance-" -"and-configuration\">Čtete více o údržbě SimpleSAMLphp</a> ]" +"HTTPS. [ <a href=\"https://simplesamlphp.org/docs/stable/simplesamlphp-maintenance" +"\">Čtete více o údržbě SimpleSAMLphp</a> ]" msgid "Metadata" msgstr "Metadata" diff --git a/vendor/simplesamlphp/simplesamlphp/modules/core/locales/da/LC_MESSAGES/core.po b/vendor/simplesamlphp/simplesamlphp/modules/core/locales/da/LC_MESSAGES/core.po index 6ae96bedf5..ed0dbe54c6 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/core/locales/da/LC_MESSAGES/core.po +++ b/vendor/simplesamlphp/simplesamlphp/modules/core/locales/da/LC_MESSAGES/core.po @@ -188,8 +188,8 @@ msgstr "" "brugeren. SimpleSAMLphp vil fungere uden problemer med HTTP alene, men " "hvis du anvender systemet i produktionssystemer, anbefales det stærkt at " "benytte sikker kommunikation i form af HTTPS. [ <a " -"href=\"http://rnd.feide.no/content/simplesamlphp-maintenance-and-" -"configuration\">læs mere i dokumentet: SimpleSAMLphp maintenance</a> ] " +"href=\"https://simplesamlphp.org/docs/stable/simplesamlphp-maintenance" +"\">læs mere i dokumentet: SimpleSAMLphp maintenance</a> ] " msgid "{core:frontpage:federation}" msgstr "Føderation" @@ -388,8 +388,8 @@ msgstr "" "brugeren. SimpleSAMLphp vil fungere uden problemer med HTTP alene, men " "hvis du anvender systemet i produktionssystemer, anbefales det stærkt at " "benytte sikker kommunikation i form af HTTPS. [ <a " -"href=\"http://rnd.feide.no/content/simplesamlphp-maintenance-and-" -"configuration\">læs mere i dokumentet: SimpleSAMLphp maintenance</a> ] " +"href=\"https://simplesamlphp.org/docs/stable/simplesamlphp-maintenance" +"\">læs mere i dokumentet: SimpleSAMLphp maintenance</a> ] " msgid "Metadata" msgstr "Metadata" diff --git a/vendor/simplesamlphp/simplesamlphp/modules/core/locales/de/LC_MESSAGES/core.po b/vendor/simplesamlphp/simplesamlphp/modules/core/locales/de/LC_MESSAGES/core.po index 5aff6c3654..c6648ced42 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/core/locales/de/LC_MESSAGES/core.po +++ b/vendor/simplesamlphp/simplesamlphp/modules/core/locales/de/LC_MESSAGES/core.po @@ -184,8 +184,8 @@ msgstr "" "<strong>Sie benutzen keine HTTPS</strong> - verschlüsselte Kommunikation " "mit dem Nutzer. SimpleSAMLphp funktioniert zum Testen auch mit HTTP " "problemlos, aber in einer Produktionsumgebung sollten Sie HTTPS benutzen." -" [ <a href=\"http://rnd.feide.no/content/simplesamlphp-maintenance-and-" -"configuration\">Lesen sie mehr über die Verwaltung von SimpleSAMLphp</a> " +" [ <a href=\"https://simplesamlphp.org/docs/stable/simplesamlphp-maintenance" +"\">Lesen sie mehr über die Verwaltung von SimpleSAMLphp</a> " "]" msgid "{core:frontpage:federation}" @@ -393,8 +393,8 @@ msgstr "" "<strong>Sie benutzen keine HTTPS</strong> - verschlüsselte Kommunikation " "mit dem Nutzer. SimpleSAMLphp funktioniert zum Testen auch mit HTTP " "problemlos, aber in einer Produktionsumgebung sollten Sie HTTPS benutzen." -" [ <a href=\"http://rnd.feide.no/content/simplesamlphp-maintenance-and-" -"configuration\">Lesen sie mehr über die Verwaltung von SimpleSAMLphp</a> " +" [ <a href=\"https://simplesamlphp.org/docs/stable/simplesamlphp-maintenance" +"\">Lesen sie mehr über die Verwaltung von SimpleSAMLphp</a> " "]" msgid "Metadata" diff --git a/vendor/simplesamlphp/simplesamlphp/modules/core/locales/el/LC_MESSAGES/core.po b/vendor/simplesamlphp/simplesamlphp/modules/core/locales/el/LC_MESSAGES/core.po index f99d522c28..a2f7c15633 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/core/locales/el/LC_MESSAGES/core.po +++ b/vendor/simplesamlphp/simplesamlphp/modules/core/locales/el/LC_MESSAGES/core.po @@ -206,8 +206,8 @@ msgstr "" "Δεν χρησιμοποιείτε <strong>HTTPS</strong> για κρυπτογραφημένη επικοινωνία" " με τον χρήστη. Το HTTP επαρκεί για δοκιμαστικούς σκοπούς, ωστόσο σε " "περιβάλλον παραγωγής θα πρέπει να χρησιμοποιήσετε HTTPS. [ <a " -"href=\"http://rnd.feide.no/content/simplesamlphp-maintenance-and-" -"configuration\">Διαβάστε περισσότερα...</a> ]" +"href=\"https://simplesamlphp.org/docs/stable/simplesamlphp-maintenance" +"\">Διαβάστε περισσότερα...</a> ]" msgid "{core:frontpage:federation}" msgstr "Ομοσπονδία" @@ -427,8 +427,8 @@ msgstr "" "Δεν χρησιμοποιείτε <strong>HTTPS</strong> για κρυπτογραφημένη επικοινωνία" " με τον χρήστη. Το HTTP επαρκεί για δοκιμαστικούς σκοπούς, ωστόσο σε " "περιβάλλον παραγωγής θα πρέπει να χρησιμοποιήσετε HTTPS. [ <a " -"href=\"http://rnd.feide.no/content/simplesamlphp-maintenance-and-" -"configuration\">Διαβάστε περισσότερα...</a> ]" +"href=\"https://simplesamlphp.org/docs/stable/simplesamlphp-maintenance" +"\">Διαβάστε περισσότερα...</a> ]" msgid "Metadata" msgstr "Μεταδεδομένα" diff --git a/vendor/simplesamlphp/simplesamlphp/modules/core/locales/en/LC_MESSAGES/core.po b/vendor/simplesamlphp/simplesamlphp/modules/core/locales/en/LC_MESSAGES/core.po index bf9ee93f84..b7c59dcf45 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/core/locales/en/LC_MESSAGES/core.po +++ b/vendor/simplesamlphp/simplesamlphp/modules/core/locales/en/LC_MESSAGES/core.po @@ -21,6 +21,9 @@ msgstr "PHP info" msgid "{core:no_state:report_text}" msgstr "If this problem persists, you can report it to the system administrators." +msgid "{core:no_state:cause_badlink}" +msgstr "The link used to get here was bad, perhaps a bookmark." + msgid "{core:no_state:cause_backforward}" msgstr "Using the back and forward buttons in the web browser." @@ -54,9 +57,36 @@ msgstr "OpenID Provider site - Alpha version (test code)" msgid "{core:frontpage:link_doc_install}" msgstr "Installing SimpleSAMLphp" +msgid "{core:frontpage:link_consentAdmin}" +msgstr "Consent Administration" + +msgid "{core:frontpage:link_memcacheMonitor}" +msgstr "MemCache Statistics" + +msgid "{core:frontpage:link_oauth}" +msgstr "OAuth Consumer Registry" + +msgid "{core:frontpage:link_cron}" +msgstr "Cron module information page" + +msgid "{core:frontpage:link_statistics}" +msgstr "Show statistics" + +msgid "{core:frontpage:link_statistics_metadata}" +msgstr "Show statistics metadata" + +msgid "{core:frontpage:link_metarefresh}" +msgstr "Metarefresh: fetch metadata" + +msgid "{core:frontpage:link_sanitycheck}" +msgstr "Sanity check of your SimpleSAMLphp setup" + msgid "{core:frontpage:link_diagnostics}" msgstr "Diagnostics on hostname, port and protocol" +msgid "{core:no_state:suggestion_badlink}" +msgstr "Check that the link you used to access the web site is correct." + msgid "{core:no_state:suggestion_goback}" msgstr "Go back to the previous page and try again." @@ -142,6 +172,9 @@ msgstr "You are logged in as administrator" msgid "{core:frontpage:auth}" msgstr "Authentication" +msgid "{core:frontpage:logout}" +msgstr "Logout" + msgid "{core:no_metadata:suggestion_user_link}" msgstr "" "If you are an user who received this error after following a link on a " @@ -336,6 +369,9 @@ msgstr "Configure Shibboleth 1.3 SP to work with SimpleSAMLphp IdP" msgid "Using the back and forward buttons in the web browser." msgstr "Using the back and forward buttons in the web browser." +msgid "PHP cURL extension missing. Cannot check for SimpleSAMLphp updates." +msgstr "PHP cURL extension missing. Cannot check for SimpleSAMLphp updates." + msgid "" "You are running an outdated version of SimpleSAMLphp. Please update to <a" " href=\"%LATEST_URL%\">the latest version</a> as soon as possible." diff --git a/vendor/simplesamlphp/simplesamlphp/modules/core/locales/eu/LC_MESSAGES/core.po b/vendor/simplesamlphp/simplesamlphp/modules/core/locales/eu/LC_MESSAGES/core.po index 18d8bd793d..d979950a1d 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/core/locales/eu/LC_MESSAGES/core.po +++ b/vendor/simplesamlphp/simplesamlphp/modules/core/locales/eu/LC_MESSAGES/core.po @@ -185,8 +185,8 @@ msgstr "" "<strong>Ez zara erabiltzen ari HTTPSak</strong> - erabiltzailearekin " "zifratutako komunikazioak. HTTP zuzen ibiltzen da ebaluaketa ingurunetan," " baina ustiapenean erabili behar baduzu, HTTPS erabili beharko zenuke. [ " -"<a href=\"http://rnd.feide.no/content/simplesamlphp-maintenance-and-" -"configuration\">Irakur ezazu gehiago SimpleSAMLphp-ren mantentze-lanei " +"<a href=\"https://simplesamlphp.org/docs/stable/simplesamlphp-maintenance" +"\">Irakur ezazu gehiago SimpleSAMLphp-ren mantentze-lanei " "buruz </a> ]" msgid "{core:frontpage:federation}" @@ -392,8 +392,8 @@ msgstr "" "<strong>Ez zara erabiltzen ari HTTPSak</strong> - erabiltzailearekin " "zifratutako komunikazioak. HTTP zuzen ibiltzen da ebaluaketa ingurunetan," " baina ustiapenean erabili behar baduzu, HTTPS erabili beharko zenuke. [ " -"<a href=\"http://rnd.feide.no/content/simplesamlphp-maintenance-and-" -"configuration\">Irakur ezazu gehiago SimpleSAMLphp-ren mantentze-lanei " +"<a href=\"https://simplesamlphp.org/docs/stable/simplesamlphp-maintenance" +"\">Irakur ezazu gehiago SimpleSAMLphp-ren mantentze-lanei " "buruz </a> ]" msgid "Metadata" diff --git a/vendor/simplesamlphp/simplesamlphp/modules/core/locales/fr/LC_MESSAGES/core.po b/vendor/simplesamlphp/simplesamlphp/modules/core/locales/fr/LC_MESSAGES/core.po index c00c93ab2e..188d437f3e 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/core/locales/fr/LC_MESSAGES/core.po +++ b/vendor/simplesamlphp/simplesamlphp/modules/core/locales/fr/LC_MESSAGES/core.po @@ -187,8 +187,8 @@ msgstr "" "avec l'utilisateur. Utiliser SimpleSAMLphp marchera parfaitement avec " "HTTP pour des tests, mais si vous voulez l'utiliser dans un environnement" " de production, vous devriez utiliser HTTPS. [ <a " -"href=\"http://rnd.feide.no/content/simplesamlphp-maintenance-and-" -"configuration\">En lire plus sur la maintenance de SimpleSAMLphp</a> ]" +"href=\"https://simplesamlphp.org/docs/stable/simplesamlphp-maintenance" +"\">En lire plus sur la maintenance de SimpleSAMLphp</a> ]" msgid "{core:frontpage:federation}" msgstr "Fédération" @@ -399,8 +399,8 @@ msgstr "" "avec l'utilisateur. Utiliser SimpleSAMLphp marchera parfaitement avec " "HTTP pour des tests, mais si vous voulez l'utiliser dans un environnement" " de production, vous devriez utiliser HTTPS. [ <a " -"href=\"http://rnd.feide.no/content/simplesamlphp-maintenance-and-" -"configuration\">En lire plus sur la maintenance de SimpleSAMLphp</a> ]" +"href=\"https://simplesamlphp.org/docs/stable/simplesamlphp-maintenance" +"\">En lire plus sur la maintenance de SimpleSAMLphp</a> ]" msgid "Metadata" msgstr "Métadonnées" diff --git a/vendor/simplesamlphp/simplesamlphp/modules/core/locales/he/LC_MESSAGES/core.po b/vendor/simplesamlphp/simplesamlphp/modules/core/locales/he/LC_MESSAGES/core.po index 167d0457e4..ea53dbbe1b 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/core/locales/he/LC_MESSAGES/core.po +++ b/vendor/simplesamlphp/simplesamlphp/modules/core/locales/he/LC_MESSAGES/core.po @@ -174,8 +174,8 @@ msgid "{core:frontpage:warnings_https}" msgstr "" "<strong>אתה לא משתמש ב- HTTPS </strong> - התקשרות מוצפנת עם המשתמש. HTTP " "עובד בסדר למטרות בדיקה, אולם למערכות אמיתיות, כדי להשתמש ה HTTPS. [ <a " -"href=\"http://rnd.feide.no/content/simplesamlphp-maintenance-and-" -"configuration\"> קרא עוד על תחזוק SimpleSAMLphp </a> ]" +"href=\"https://simplesamlphp.org/docs/stable/simplesamlphp-maintenance" +"\"> קרא עוד על תחזוק SimpleSAMLphp </a> ]" msgid "{core:frontpage:federation}" msgstr "איחוד" @@ -369,8 +369,8 @@ msgid "" msgstr "" "<strong>אתה לא משתמש ב- HTTPS </strong> - התקשרות מוצפנת עם המשתמש. HTTP " "עובד בסדר למטרות בדיקה, אולם למערכות אמיתיות, כדי להשתמש ה HTTPS. [ <a " -"href=\"http://rnd.feide.no/content/simplesamlphp-maintenance-and-" -"configuration\"> קרא עוד על תחזוק SimpleSAMLphp </a> ]" +"href=\"https://simplesamlphp.org/docs/stable/simplesamlphp-maintenance" +"\"> קרא עוד על תחזוק SimpleSAMLphp </a> ]" msgid "Metadata" msgstr "מטא-נתונים" diff --git a/vendor/simplesamlphp/simplesamlphp/modules/core/locales/hr/LC_MESSAGES/core.po b/vendor/simplesamlphp/simplesamlphp/modules/core/locales/hr/LC_MESSAGES/core.po index 41bf6b81c1..4e0311f3db 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/core/locales/hr/LC_MESSAGES/core.po +++ b/vendor/simplesamlphp/simplesamlphp/modules/core/locales/hr/LC_MESSAGES/core.po @@ -192,8 +192,8 @@ msgstr "" "<strong>Ne koristite HTTPS</strong> - kriptiranu komunikaciju s " "korisnikom. HTTP se može koristiti za potrebe testiranja, ali u " "produkcijskom okruženju trebali biste koristiti HTTPS. [ <a " -"href=\"http://rnd.feide.no/content/simplesamlphp-maintenance-and-" -"configuration\">Pročitajte više o SimpleSAMLphp postavkama</a> ]" +"href=\"https://simplesamlphp.org/docs/stable/simplesamlphp-maintenance" +"\">Pročitajte više o SimpleSAMLphp postavkama</a> ]" msgid "{core:frontpage:federation}" msgstr "Federacija" @@ -411,8 +411,8 @@ msgstr "" "<strong>Ne koristite HTTPS</strong> - kriptiranu komunikaciju s " "korisnikom. HTTP se može koristiti za potrebe testiranja, ali u " "produkcijskom okruženju trebali biste koristiti HTTPS. [ <a " -"href=\"http://rnd.feide.no/content/simplesamlphp-maintenance-and-" -"configuration\">Pročitajte više o SimpleSAMLphp postavkama</a> ]" +"href=\"https://simplesamlphp.org/docs/stable/simplesamlphp-maintenance" +"\">Pročitajte više o SimpleSAMLphp postavkama</a> ]" msgid "Metadata" msgstr "Metapodaci" diff --git a/vendor/simplesamlphp/simplesamlphp/modules/core/locales/hu/LC_MESSAGES/core.po b/vendor/simplesamlphp/simplesamlphp/modules/core/locales/hu/LC_MESSAGES/core.po index 078427f461..2304e086d4 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/core/locales/hu/LC_MESSAGES/core.po +++ b/vendor/simplesamlphp/simplesamlphp/modules/core/locales/hu/LC_MESSAGES/core.po @@ -189,8 +189,8 @@ msgstr "" "<strong>Nem HTTPS protokollt használ</strong> - nem titkosított a " "kommunikáció! HTTP jó megoldás lehet teszt rendszerek esetében, de az " "éles rendszerben lehetőség szerint használjon HTTPS-t! [ <a " -"href=\"http://rnd.feide.no/content/simplesamlphp-maintenance-and-" -"configuration\">Többet olvashat a SimpleSAMLphp beállításáról</a> ]" +"href=\"https://simplesamlphp.org/docs/stable/simplesamlphp-maintenance" +"\">Többet olvashat a SimpleSAMLphp beállításáról</a> ]" msgid "{core:frontpage:federation}" msgstr "Föderáció" @@ -393,8 +393,8 @@ msgstr "" "<strong>Nem HTTPS protokollt használ</strong> - nem titkosított a " "kommunikáció! HTTP jó megoldás lehet teszt rendszerek esetében, de az " "éles rendszerben lehetőség szerint használjon HTTPS-t! [ <a " -"href=\"http://rnd.feide.no/content/simplesamlphp-maintenance-and-" -"configuration\">Többet olvashat a SimpleSAMLphp beállításáról</a> ]" +"href=\"https://simplesamlphp.org/docs/stable/simplesamlphp-maintenance" +"\">Többet olvashat a SimpleSAMLphp beállításáról</a> ]" msgid "Metadata" msgstr "Metaadat" diff --git a/vendor/simplesamlphp/simplesamlphp/modules/core/locales/id/LC_MESSAGES/core.po b/vendor/simplesamlphp/simplesamlphp/modules/core/locales/id/LC_MESSAGES/core.po index 757ecc8d8f..75646d0a57 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/core/locales/id/LC_MESSAGES/core.po +++ b/vendor/simplesamlphp/simplesamlphp/modules/core/locales/id/LC_MESSAGES/core.po @@ -185,8 +185,8 @@ msgstr "" "<strong>Anda tidak menggunakan HTTPS</strong> - komunikasi yang " "dienkripsi dengan user. HTTP bekerja baik-baik saja untuk tujuan " "pengetesan , tapi dalam lingkungan produksi, Anda sebaiknya menggunakan " -"HTTPS. [ <a href=\"http://rnd.feide.no/content/simplesamlphp-maintenance-" -"and-configuration\">Baca lebih lanjut tentang proses pemeliraan " +"HTTPS. [ <a href=\"https://simplesamlphp.org/docs/stable/simplesamlphp-maintenance" +"\">Baca lebih lanjut tentang proses pemeliraan " "SimpleSAMLphp.</a> ]" msgid "{core:frontpage:federation}" @@ -395,8 +395,8 @@ msgstr "" "<strong>Anda tidak menggunakan HTTPS</strong> - komunikasi yang " "dienkripsi dengan user. HTTP bekerja baik-baik saja untuk tujuan " "pengetesan , tapi dalam lingkungan produksi, Anda sebaiknya menggunakan " -"HTTPS. [ <a href=\"http://rnd.feide.no/content/simplesamlphp-maintenance-" -"and-configuration\">Baca lebih lanjut tentang proses pemeliraan " +"HTTPS. [ <a href=\"https://simplesamlphp.org/docs/stable/simplesamlphp-maintenance" +"\">Baca lebih lanjut tentang proses pemeliraan " "SimpleSAMLphp.</a> ]" msgid "Metadata" diff --git a/vendor/simplesamlphp/simplesamlphp/modules/core/locales/it/LC_MESSAGES/core.po b/vendor/simplesamlphp/simplesamlphp/modules/core/locales/it/LC_MESSAGES/core.po index 1333903f9a..555f86a8e2 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/core/locales/it/LC_MESSAGES/core.po +++ b/vendor/simplesamlphp/simplesamlphp/modules/core/locales/it/LC_MESSAGES/core.po @@ -190,8 +190,8 @@ msgstr "" "<strong>Non stai usando HTTPS</strong> - comunicazione cifrata con " "l'utente. HTTP può funzionare per i test, ma in un ambiente di " "produzione si dovrebbe usare HTTPS. [ <a " -"href=\"http://rnd.feide.no/content/simplesamlphp-maintenance-and-" -"configuration\">Maggiori informazioni sulla manutenzione di " +"href=\"https://simplesamlphp.org/docs/stable/simplesamlphp-maintenance" +"\">Maggiori informazioni sulla manutenzione di " "SimpleSAMLphp</a> ]" msgid "{core:frontpage:federation}" @@ -404,8 +404,8 @@ msgstr "" "<strong>Non stai usando HTTPS</strong> - comunicazione cifrata con " "l'utente. HTTP può funzionare per i test, ma in un ambiente di " "produzione si dovrebbe usare HTTPS. [ <a " -"href=\"http://rnd.feide.no/content/simplesamlphp-maintenance-and-" -"configuration\">Maggiori informazioni sulla manutenzione di " +"href=\"https://simplesamlphp.org/docs/stable/simplesamlphp-maintenance" +"\">Maggiori informazioni sulla manutenzione di " "SimpleSAMLphp</a> ]" msgid "Metadata" diff --git a/vendor/simplesamlphp/simplesamlphp/modules/core/locales/ja/LC_MESSAGES/core.po b/vendor/simplesamlphp/simplesamlphp/modules/core/locales/ja/LC_MESSAGES/core.po index 2e296fb0d9..457a8cc931 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/core/locales/ja/LC_MESSAGES/core.po +++ b/vendor/simplesamlphp/simplesamlphp/modules/core/locales/ja/LC_MESSAGES/core.po @@ -166,8 +166,8 @@ msgstr "" msgid "{core:frontpage:warnings_https}" msgstr "" "<strong>あなたはHTTPS(暗号化通信)を行っていません。</strong>HTTPはテスト環境であれば正常に動作します、しかし製品環境ではHTTPSを使用するべきです。[" -" <a href=\"http://rnd.feide.no/content/simplesamlphp-maintenance-and-" -"configuration\">詳しくは SimpleSAMLphp メンテナンス情報を読んでください。</a> ]" +" <a href=\"https://simplesamlphp.org/docs/stable/simplesamlphp-maintenance" +"\">詳しくは SimpleSAMLphp メンテナンス情報を読んでください。</a> ]" msgid "{core:frontpage:federation}" msgstr "連携" @@ -352,8 +352,8 @@ msgid "" "maintenance\">Read more about SimpleSAMLphp maintenance</a> ]" msgstr "" "<strong>あなたはHTTPS(暗号化通信)を行っていません。</strong>HTTPはテスト環境であれば正常に動作します、しかし製品環境ではHTTPSを使用するべきです。[" -" <a href=\"http://rnd.feide.no/content/simplesamlphp-maintenance-and-" -"configuration\">詳しくは SimpleSAMLphp メンテナンス情報を読んでください。</a> ]" +" <a href=\"https://simplesamlphp.org/docs/stable/simplesamlphp-maintenance" +"\">詳しくは SimpleSAMLphp メンテナンス情報を読んでください。</a> ]" msgid "Metadata" msgstr "メタデータ" diff --git a/vendor/simplesamlphp/simplesamlphp/modules/core/locales/lb/LC_MESSAGES/core.po b/vendor/simplesamlphp/simplesamlphp/modules/core/locales/lb/LC_MESSAGES/core.po index 5c30d24a45..da87760a77 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/core/locales/lb/LC_MESSAGES/core.po +++ b/vendor/simplesamlphp/simplesamlphp/modules/core/locales/lb/LC_MESSAGES/core.po @@ -94,8 +94,8 @@ msgstr "" "<strong>Der benotzt ken HTTPS</strong> - verschlësselt Kommunikatioun mat" " dem Benotzer. SimpleSAMLphp funktionéiert einwandfräi mat HTTP fir " "Testzwéecker mais an engem produktiven Emfeld sollt et besser mat HTTPS " -"lafen. [ <a href=\"http://rnd.feide.no/content/simplesamlphp-maintenance-" -"and-configuration\">Liest méi iwert Maintenance vun SimpleSAMLphp</a> ]" +"lafen. [ <a href=\"https://simplesamlphp.org/docs/stable/simplesamlphp-maintenance" +"\">Liest méi iwert Maintenance vun SimpleSAMLphp</a> ]" msgid "{core:frontpage:required_radius}" msgstr "Néideg fir RADIUS" @@ -187,8 +187,8 @@ msgstr "" "<strong>Der benotzt ken HTTPS</strong> - verschlësselt Kommunikatioun mat" " dem Benotzer. SimpleSAMLphp funktionéiert einwandfräi mat HTTP fir " "Testzwéecker mais an engem produktiven Emfeld sollt et besser mat HTTPS " -"lafen. [ <a href=\"http://rnd.feide.no/content/simplesamlphp-maintenance-" -"and-configuration\">Liest méi iwert Maintenance vun SimpleSAMLphp</a> ]" +"lafen. [ <a href=\"https://simplesamlphp.org/docs/stable/simplesamlphp-maintenance" +"\">Liest méi iwert Maintenance vun SimpleSAMLphp</a> ]" msgid "Metadata" msgstr "Meta Données" diff --git a/vendor/simplesamlphp/simplesamlphp/modules/core/locales/lt/LC_MESSAGES/core.po b/vendor/simplesamlphp/simplesamlphp/modules/core/locales/lt/LC_MESSAGES/core.po index f9d0421e33..aa83f7aaa0 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/core/locales/lt/LC_MESSAGES/core.po +++ b/vendor/simplesamlphp/simplesamlphp/modules/core/locales/lt/LC_MESSAGES/core.po @@ -187,8 +187,8 @@ msgstr "" "<strong>Jūs nenaudojate HTTPS</strong> - šifruotos komunikacijos su " "vartotoju. HTTP puikiai tinka testavimo reikmėms, tačiau realioje " "aplinkoje turėtumėte naudoti HTTPS. [ <a " -"href=\"http://rnd.feide.no/content/simplesamlphp-maintenance-and-" -"configuration\">Skaityti daugiau apie SimpleSAMLphp priežiūrą</a> ]" +"href=\"https://simplesamlphp.org/docs/stable/simplesamlphp-maintenance" +"\">Skaityti daugiau apie SimpleSAMLphp priežiūrą</a> ]" msgid "{core:frontpage:federation}" msgstr "Federacija" @@ -397,8 +397,8 @@ msgstr "" "<strong>Jūs nenaudojate HTTPS</strong> - šifruotos komunikacijos su " "vartotoju. HTTP puikiai tinka testavimo reikmėms, tačiau realioje " "aplinkoje turėtumėte naudoti HTTPS. [ <a " -"href=\"http://rnd.feide.no/content/simplesamlphp-maintenance-and-" -"configuration\">Skaityti daugiau apie SimpleSAMLphp priežiūrą</a> ]" +"href=\"https://simplesamlphp.org/docs/stable/simplesamlphp-maintenance" +"\">Skaityti daugiau apie SimpleSAMLphp priežiūrą</a> ]" msgid "Metadata" msgstr "Metaduomenys" diff --git a/vendor/simplesamlphp/simplesamlphp/modules/core/locales/lv/LC_MESSAGES/core.po b/vendor/simplesamlphp/simplesamlphp/modules/core/locales/lv/LC_MESSAGES/core.po index 9a6df6db53..61743892b8 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/core/locales/lv/LC_MESSAGES/core.po +++ b/vendor/simplesamlphp/simplesamlphp/modules/core/locales/lv/LC_MESSAGES/core.po @@ -177,8 +177,8 @@ msgid "{core:frontpage:warnings_https}" msgstr "" "<strong>Jūs neizmantojat HTTPS</strong> - šifrētu komunikāciju ar " "lietotāju. HTTP ir labs testa nolūkiem, bet ražošanā jāizmanto HTTPS. [ " -"<a href=\"http://rnd.feide.no/content/simplesamlphp-maintenance-and-" -"configuration\">Lasiet vairāk par SimpleSAMLphp uzturēšanu</a> ]" +"<a href=\"https://simplesamlphp.org/docs/stable/simplesamlphp-maintenance" +"\">Lasiet vairāk par SimpleSAMLphp uzturēšanu</a> ]" msgid "{core:frontpage:federation}" msgstr "Federācija" @@ -375,8 +375,8 @@ msgid "" msgstr "" "<strong>Jūs neizmantojat HTTPS</strong> - šifrētu komunikāciju ar " "lietotāju. HTTP ir labs testa nolūkiem, bet ražošanā jāizmanto HTTPS. [ " -"<a href=\"http://rnd.feide.no/content/simplesamlphp-maintenance-and-" -"configuration\">Lasiet vairāk par SimpleSAMLphp uzturēšanu</a> ]" +"<a href=\"https://simplesamlphp.org/docs/stable/simplesamlphp-maintenance" +"\">Lasiet vairāk par SimpleSAMLphp uzturēšanu</a> ]" msgid "Metadata" msgstr "Metadati" diff --git a/vendor/simplesamlphp/simplesamlphp/modules/core/locales/nb/LC_MESSAGES/core.po b/vendor/simplesamlphp/simplesamlphp/modules/core/locales/nb/LC_MESSAGES/core.po index 60b841b6f4..c10d9d2e5c 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/core/locales/nb/LC_MESSAGES/core.po +++ b/vendor/simplesamlphp/simplesamlphp/modules/core/locales/nb/LC_MESSAGES/core.po @@ -185,8 +185,8 @@ msgstr "" "<strong>Du bruker ikke HTTPS</strong> - kryptert kommunikasjon med " "brukeren. HTTP fungerer utmerket til testformål, men i et " "produksjonsmiljø anbefales sterkt å skru på sikker kommunikasjon med " -"HTTPS. [ <a href=\"http://rnd.feide.no/content/simplesamlphp-maintenance-" -"and-configuration\">Les mer i dokumentet: SimpleSAMLphp maintenance</a> ]" +"HTTPS. [ <a href=\"https://simplesamlphp.org/docs/stable/simplesamlphp-maintenance" +"\">Les mer i dokumentet: SimpleSAMLphp maintenance</a> ]" msgid "{core:frontpage:federation}" msgstr "Føderasjon" @@ -389,8 +389,8 @@ msgstr "" "<strong>Du bruker ikke HTTPS</strong> - kryptert kommunikasjon med " "brukeren. HTTP fungerer utmerket til testformål, men i et " "produksjonsmiljø anbefales sterkt å skru på sikker kommunikasjon med " -"HTTPS. [ <a href=\"http://rnd.feide.no/content/simplesamlphp-maintenance-" -"and-configuration\">Les mer i dokumentet: SimpleSAMLphp maintenance</a> ]" +"HTTPS. [ <a href=\"https://simplesamlphp.org/docs/stable/simplesamlphp-maintenance" +"\">Les mer i dokumentet: SimpleSAMLphp maintenance</a> ]" msgid "Metadata" msgstr "Metadata" diff --git a/vendor/simplesamlphp/simplesamlphp/modules/core/locales/nl/LC_MESSAGES/core.po b/vendor/simplesamlphp/simplesamlphp/modules/core/locales/nl/LC_MESSAGES/core.po index edeee369ed..425e4712d9 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/core/locales/nl/LC_MESSAGES/core.po +++ b/vendor/simplesamlphp/simplesamlphp/modules/core/locales/nl/LC_MESSAGES/core.po @@ -22,7 +22,7 @@ msgid "{core:no_state:report_text}" msgstr "If dit probleem behoud, dan kun je het melden aan de systeem beheerders." msgid "{core:no_state:cause_backforward}" -msgstr "Gebruik de Volgende en Terug knoppen in de web browser." +msgstr "Gebruik van de 'Volgende'- en 'Terug'-knoppen in de web browser." msgid "{core:no_metadata:not_found_for}" msgstr "De metadata voor de volgende entity kon niet gevonden worden:" @@ -36,6 +36,9 @@ msgstr "Suggesties om dit probleem op te lossen:" msgid "{core:frontpage:login_as_admin}" msgstr "Login als beheerder" +msgid "{core:frontpage:logout}" +msgstr "Uitloggen" + msgid "{core:short_sso_interval:warning}" msgstr "" "We hebben waargenomen dat u slechts een paar seconden geleden al " @@ -57,6 +60,9 @@ msgstr "Installatie van SimpleSAMLphp" msgid "{core:frontpage:link_diagnostics}" msgstr "Inspectie op hostnaam, poort en protocol" +msgid "{core:no_state:suggestion_badlink}" +msgstr "Controleer of u de juiste link gebruikt om de website te benaderen." + msgid "{core:no_state:suggestion_goback}" msgstr "Ga terug naar de vorige pagina, en probeer opnieuw." @@ -137,6 +143,9 @@ msgstr "" "snel mogelijk te upgraden naar <a href=\"%LATEST_URL%\">de meest recente " "versie</a>." +msgid "{core:frontpage:warnings_curlmissing}" +msgstr "PHP cURL-extensie ontbreekt. Kan niet controleren op updates voor SimpleSAMLphp." + msgid "{core:frontpage:loggedin_as_admin}" msgstr "Je bent ingelogd als beheerder" @@ -205,6 +214,9 @@ msgstr "Federatie" msgid "{core:frontpage:required_radius}" msgstr "Vereist voor Radius" +msgid "{core:no_state:cause_badlink}" +msgstr "Verkeerde link gebruikt, bijvoorbeeld een bookmark (bladwijzer)." + msgid "{core:no_state:cause_openbrowser}" msgstr "Web browser geopend met tabs opgeslagen van de vorige sessie." @@ -342,7 +354,7 @@ msgid "Configure Shibboleth 1.3 SP to work with SimpleSAMLphp IdP" msgstr "Configureer een Shibboleth 1.3 SP voor de SimpleSAMLphp IdP" msgid "Using the back and forward buttons in the web browser." -msgstr "Gebruik de Volgende en Terug knoppen in de web browser." +msgstr "Gebruik van de 'Volgende'- en 'Terug'-knoppen in de web browser." msgid "" "You are running an outdated version of SimpleSAMLphp. Please update to <a" diff --git a/vendor/simplesamlphp/simplesamlphp/modules/core/locales/nn/LC_MESSAGES/core.po b/vendor/simplesamlphp/simplesamlphp/modules/core/locales/nn/LC_MESSAGES/core.po index cdbfc5684a..368dd7e76b 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/core/locales/nn/LC_MESSAGES/core.po +++ b/vendor/simplesamlphp/simplesamlphp/modules/core/locales/nn/LC_MESSAGES/core.po @@ -182,8 +182,8 @@ msgstr "" "brukaren. Du kan bruka SimpleSAMLphp uten HTTPS til testformål, men " "dersom du skal bruka SimpleSAMLphp i eit produksjonsmiljø, vil vi sterkt " "tilrå å skru på sikker kommunikasjon med HTTPS. [ Les meir i dokumentet: " -"<a href=\"http://rnd.feide.no/content/simplesamlphp-maintenance-and-" -"configuration\">SimpleSAMLphp maintenance</a> ]" +"<a href=\"https://simplesamlphp.org/docs/stable/simplesamlphp-maintenance" +"\">SimpleSAMLphp maintenance</a> ]" msgid "{core:frontpage:federation}" msgstr "Føderasjon" @@ -386,8 +386,8 @@ msgstr "" "brukaren. Du kan bruka SimpleSAMLphp uten HTTPS til testformål, men " "dersom du skal bruka SimpleSAMLphp i eit produksjonsmiljø, vil vi sterkt " "tilrå å skru på sikker kommunikasjon med HTTPS. [ Les meir i dokumentet: " -"<a href=\"http://rnd.feide.no/content/simplesamlphp-maintenance-and-" -"configuration\">SimpleSAMLphp maintenance</a> ]" +"<a href=\"https://simplesamlphp.org/docs/stable/simplesamlphp-maintenance" +"\">SimpleSAMLphp maintenance</a> ]" msgid "Metadata" msgstr "Metadata" diff --git a/vendor/simplesamlphp/simplesamlphp/modules/core/locales/pt/LC_MESSAGES/core.po b/vendor/simplesamlphp/simplesamlphp/modules/core/locales/pt/LC_MESSAGES/core.po index c9aec1c5f2..599cf95aac 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/core/locales/pt/LC_MESSAGES/core.po +++ b/vendor/simplesamlphp/simplesamlphp/modules/core/locales/pt/LC_MESSAGES/core.po @@ -138,8 +138,8 @@ msgstr "" "<strong>Não está a ser usado HTTPS</strong> - comunicação cifrada com o " "utilizador. Para ambientes de teste, ligações HTTP são suficientes, mas " "num ambiente de produção deve ser usado HTTPS. [ <a " -"href=\"http://rnd.feide.no/content/simplesamlphp-maintenance-and-" -"configuration\">Ler mais sobre manutenção do SimpleSAMLphp</a> ]" +"href=\"https://simplesamlphp.org/docs/stable/simplesamlphp-maintenance" +"\">Ler mais sobre manutenção do SimpleSAMLphp</a> ]" msgid "{core:frontpage:federation}" msgstr "Federação" @@ -296,8 +296,8 @@ msgstr "" "<strong>Não está a ser usado HTTPS</strong> - comunicação cifrada com o " "utilizador. Para ambientes de teste, ligações HTTP são suficientes, mas " "num ambiente de produção deve ser usado HTTPS. [ <a " -"href=\"http://rnd.feide.no/content/simplesamlphp-maintenance-and-" -"configuration\">Ler mais sobre manutenção do SimpleSAMLphp</a> ]" +"href=\"https://simplesamlphp.org/docs/stable/simplesamlphp-maintenance" +"\">Ler mais sobre manutenção do SimpleSAMLphp</a> ]" msgid "Metadata" msgstr "Metadados" diff --git a/vendor/simplesamlphp/simplesamlphp/modules/core/locales/sl/LC_MESSAGES/core.po b/vendor/simplesamlphp/simplesamlphp/modules/core/locales/sl/LC_MESSAGES/core.po index eaf0bcf67c..802a6f38c9 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/core/locales/sl/LC_MESSAGES/core.po +++ b/vendor/simplesamlphp/simplesamlphp/modules/core/locales/sl/LC_MESSAGES/core.po @@ -177,8 +177,8 @@ msgstr "" "<strong>Ne uporabljate HTTPS</strong>-šifrirane komunikacije. " "SimpleSAMLphp deluje brez težav na HTTP, vendar le za testne namene, za " "uporabo SimpleSAMLphp v produkcijskem okolju uporabite HTTPS. [ <a " -"href=\"http://rnd.feide.no/content/simplesamlphp-maintenance-and-" -"configuration\">Preberite več o SimpleSAMLphp vzdrževanju</a> ]" +"href=\"https://simplesamlphp.org/docs/stable/simplesamlphp-maintenance" +"\">Preberite več o SimpleSAMLphp vzdrževanju</a> ]" msgid "{core:frontpage:federation}" msgstr "Federacija" @@ -380,8 +380,8 @@ msgstr "" "<strong>Ne uporabljate HTTPS</strong>-šifrirane komunikacije. " "SimpleSAMLphp deluje brez težav na HTTP, vendar le za testne namene, za " "uporabo SimpleSAMLphp v produkcijskem okolju uporabite HTTPS. [ <a " -"href=\"http://rnd.feide.no/content/simplesamlphp-maintenance-and-" -"configuration\">Preberite več o SimpleSAMLphp vzdrževanju</a> ]" +"href=\"https://simplesamlphp.org/docs/stable/simplesamlphp-maintenance" +"\">Preberite več o SimpleSAMLphp vzdrževanju</a> ]" msgid "Metadata" msgstr "Metapodatki" diff --git a/vendor/simplesamlphp/simplesamlphp/modules/core/locales/sr/LC_MESSAGES/core.po b/vendor/simplesamlphp/simplesamlphp/modules/core/locales/sr/LC_MESSAGES/core.po index f500a2c6f4..9f7a9ea208 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/core/locales/sr/LC_MESSAGES/core.po +++ b/vendor/simplesamlphp/simplesamlphp/modules/core/locales/sr/LC_MESSAGES/core.po @@ -194,8 +194,8 @@ msgstr "" "<strong>Ne koristite HTTPS</strong> - kriptovanu komunikaciju s " "korisnikom. HTTP se može koristiti za potrebe testiranja, ali u " "produkcionom okruženju trebali biste koristiti HTTPS. [ <a " -"href=\"http://rnd.feide.no/content/simplesamlphp-maintenance-and-" -"configuration\">Pročitajte više o SimpleSAMLphp podešavanjima</a> ]" +"href=\"https://simplesamlphp.org/docs/stable/simplesamlphp-maintenance" +"\">Pročitajte više o SimpleSAMLphp podešavanjima</a> ]" msgid "{core:frontpage:federation}" msgstr "Federacija" @@ -407,8 +407,8 @@ msgstr "" "<strong>Ne koristite HTTPS</strong> - kriptovanu komunikaciju s " "korisnikom. HTTP se može koristiti za potrebe testiranja, ali u " "produkcionom okruženju trebali biste koristiti HTTPS. [ <a " -"href=\"http://rnd.feide.no/content/simplesamlphp-maintenance-and-" -"configuration\">Pročitajte više o SimpleSAMLphp podešavanjima</a> ]" +"href=\"https://simplesamlphp.org/docs/stable/simplesamlphp-maintenance" +"\">Pročitajte više o SimpleSAMLphp podešavanjima</a> ]" msgid "Metadata" msgstr "Medapodaci" diff --git a/vendor/simplesamlphp/simplesamlphp/modules/core/locales/sv/LC_MESSAGES/core.po b/vendor/simplesamlphp/simplesamlphp/modules/core/locales/sv/LC_MESSAGES/core.po index f3d8a2c06f..6adaceec51 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/core/locales/sv/LC_MESSAGES/core.po +++ b/vendor/simplesamlphp/simplesamlphp/modules/core/locales/sv/LC_MESSAGES/core.po @@ -181,8 +181,8 @@ msgid "{core:frontpage:warnings_https}" msgstr "" "<strong>Du använder inte HTTPS</strong> - krypterad kommunikation med " "användaren. HTTP fungerar bra under test men i produktion ska du använda " -"HTTPS. [ <a href=\"http://rnd.feide.no/content/simplesamlphp-maintenance-" -"and-configuration\">Läs mer i dokumentet SimpleSAMLphp maintenance</a> ]" +"HTTPS. [ <a href=\"https://simplesamlphp.org/docs/stable/simplesamlphp-maintenance" +"\">Läs mer i dokumentet SimpleSAMLphp maintenance</a> ]" msgid "{core:frontpage:federation}" msgstr "Federation" @@ -384,8 +384,8 @@ msgid "" msgstr "" "<strong>Du använder inte HTTPS</strong> - krypterad kommunikation med " "användaren. HTTP fungerar bra under test men i produktion ska du använda " -"HTTPS. [ <a href=\"http://rnd.feide.no/content/simplesamlphp-maintenance-" -"and-configuration\">Läs mer i dokumentet SimpleSAMLphp maintenance</a> ]" +"HTTPS. [ <a href=\"https://simplesamlphp.org/docs/stable/simplesamlphp-maintenance" +"\">Läs mer i dokumentet SimpleSAMLphp maintenance</a> ]" msgid "Metadata" msgstr "Metadata" diff --git a/vendor/simplesamlphp/simplesamlphp/modules/core/locales/xh/LC_MESSAGES/core.po b/vendor/simplesamlphp/simplesamlphp/modules/core/locales/xh/LC_MESSAGES/core.po new file mode 100644 index 0000000000..93b8bd5be6 --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/modules/core/locales/xh/LC_MESSAGES/core.po @@ -0,0 +1,97 @@ + +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: SimpleSAMLphp 1.15\n" +"Report-Msgid-Bugs-To: simplesamlphp-translation@googlegroups.com\n" +"POT-Creation-Date: 2018-11-15 14:49+0200\n" +"PO-Revision-Date: 2018-11-15 14:49+0200\n" +"Last-Translator: \n" +"Language-Team: \n" +"Plural-Forms: nplurals=2; plural=(n != 1)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 1.3\n" + +msgid "{core:cardinality:cardinality_text}" +msgstr "" +"Uphawu olunye okanye olungakumbi olunikelwe ngumboonelei wesazisi sakho " +"aluqulethanga inani lamaxabiso alindelekileyo." + +msgid "{core:no_metadata:suggestion_developer}" +msgstr "" +"Ukuba ungumvelisi osebenzisa isisombululo sokusayina ungene kanye, " +"unengxaki nolungiselelo lwe-metadata. Qinisekisa ukuba i-metadata " +"ilungiselelwe ngokuchanekileyo kuzo zombini umbonelei wesazisi " +"nomboneleli wenkonzo." + +msgid "{core:no_cookie:retry}" +msgstr "Zama kwakhona" + +msgid "{core:no_cookie:description}" +msgstr "" +"Ubonakala uzenze azasebenza iikhuki kwibhrawuza yakho. Nceda ujonge " +"iisetingi ezikwibhrawuza yakho, uzame kwakhona." + +msgid "{core:cardinality:problematic_attributes}" +msgstr "Iimpawu eziyingxaki zezi:" + +msgid "{core:no_state:cause_nocookie}" +msgstr "Iikhuki zisenokwenziwa zingasebenzi kwibhrawuza yewebhu." + +msgid "{core:no_state:report_header}" +msgstr "Chaza le mpazamo" + +msgid "{core:no_state:causes}" +msgstr "Le mpazamo isenokuba ibangelwe:" + +msgid "{core:no_state:description}" +msgstr "Asikwazanga ukufumana inkcazelo yobume yesicelo sangoku." + +msgid "{core:no_state:report_text}" +msgstr "Ukuba le ngxaki iyaqhubeka, ungayichaza kubalawuli besistim." + +msgid "{core:no_metadata:header}" +msgstr "I-Metadata ayifunyenwanga" + +msgid "{core:no_metadata:config_problem}" +msgstr "" +"Kusenokwenzeka yingxaki yolungiselelo kumboneleli wenkonzo okanye " +"umboneleli wesazisi." + +msgid "{core:no_state:header}" +msgstr "Inkcazelo yobume ilahlekile" + +msgid "{core:no_metadata:suggestion_user_link}" +msgstr "" +"Ukuba ngaba ungumsebenzisi ofumene le mpazamo emva kokulandela ilinki " +"kwisayithi, ufanele uchaze le mpazamo kumnini walo sayithi." + +msgid "{core:no_state:suggestion_goback}" +msgstr "Buyela emva kwikhasi elidlulileyo uzame kwakhona." + +msgid "{core:cardinality:cardinality_header}" +msgstr "Iimpawu Ezingachanekanga" + +msgid "{core:no_state:cause_openbrowser}" +msgstr "Kuvulwe ibhrawuza yewebhu ngeethebhu eziseyivwe kwiseshoni edlulileyo." + +msgid "{core:no_state:suggestion_closebrowser}" +msgstr "Vala ibhrawuza yewebhu, uzame kwakhona." + +msgid "{core:no_metadata:not_found_for}" +msgstr "Asikwazanga ukufumana imetadata ye-entithi:" + +msgid "{core:no_cookie:header}" +msgstr "Ikhuki engekhoyo" + +msgid "{core:cardinality:got_want}" +msgstr "kukho amaxabiso e-%GOT%, sifuna %WANT%" + +msgid "{core:no_state:suggestions}" +msgstr "Iingcebiso zokulungisa le ngxaki:" + +msgid "{core:no_state:cause_backforward}" +msgstr "Ukusebenzisa amaqhosha okuya emva naphambili kwibhrawuza yewebhu." + diff --git a/vendor/simplesamlphp/simplesamlphp/modules/core/locales/zh/LC_MESSAGES/core.po b/vendor/simplesamlphp/simplesamlphp/modules/core/locales/zh/LC_MESSAGES/core.po index 4cd6c87ff3..f883464c23 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/core/locales/zh/LC_MESSAGES/core.po +++ b/vendor/simplesamlphp/simplesamlphp/modules/core/locales/zh/LC_MESSAGES/core.po @@ -162,8 +162,8 @@ msgstr "请求参数的长度被PHP Suhosin扩展限制了,请增大suhosin.ge msgid "{core:frontpage:warnings_https}" msgstr "" "<strong>你没有使用HTTPS</strong> - 和用户加密的通信。HTTP在测试目的下很好,但生产环境请使用HTTPS. [ <a " -"href=\"http://rnd.feide.no/content/simplesamlphp-maintenance-and-" -"configuration\">获取更多SimpleSAMLphp维护的信息</a> ]" +"href=\"https://simplesamlphp.org/docs/stable/simplesamlphp-maintenance" +"\">获取更多SimpleSAMLphp维护的信息</a> ]" msgid "{core:frontpage:federation}" msgstr "联盟" @@ -347,8 +347,8 @@ msgid "" "maintenance\">Read more about SimpleSAMLphp maintenance</a> ]" msgstr "" "<strong>你没有使用HTTPS</strong> - 和用户加密的通信。HTTP在测试目的下很好,但生产环境请使用HTTPS. [ <a " -"href=\"http://rnd.feide.no/content/simplesamlphp-maintenance-and-" -"configuration\">获取更多SimpleSAMLphp维护的信息</a> ]" +"href=\"https://simplesamlphp.org/docs/stable/simplesamlphp-maintenance" +"\">获取更多SimpleSAMLphp维护的信息</a> ]" msgid "Metadata" msgstr "元信息" diff --git a/vendor/simplesamlphp/simplesamlphp/modules/core/locales/zu/LC_MESSAGES/core.po b/vendor/simplesamlphp/simplesamlphp/modules/core/locales/zu/LC_MESSAGES/core.po new file mode 100644 index 0000000000..f4f1555b64 --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/modules/core/locales/zu/LC_MESSAGES/core.po @@ -0,0 +1,98 @@ + +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: SimpleSAMLphp 1.15\n" +"Report-Msgid-Bugs-To: simplesamlphp-translation@googlegroups.com\n" +"POT-Creation-Date: 2018-11-15 14:49+0200\n" +"PO-Revision-Date: 2018-11-15 14:49+0200\n" +"Last-Translator: \n" +"Language-Team: \n" +"Plural-Forms: nplurals=2; plural=(n != 1)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 1.3\n" + +msgid "{core:cardinality:cardinality_text}" +msgstr "" +"Isici esisodwa noma ngaphezulu esinikezwe umhlinzeki wakho kamazisi " +"asizange siqukathe inani lezinombolo ezilindelwe." + +msgid "{core:no_metadata:suggestion_developer}" +msgstr "" +"Uma ungunjiniyela osebenzisa isixazululo sokusayinela ukungena esisodwa, " +"unenkinga ngomiso lwemethadatha. Qinisekisa ukuthi imethadatha imiswe " +"ngendlela efanele kokubili kumhlinzeki womazisi nomhlinzeki wesevisi." + +msgid "{core:no_cookie:retry}" +msgstr "Zama futhi" + +msgid "{core:no_cookie:description}" +msgstr "" +"Kubonakala sengathi uyekise amakhukhi kusiphequluli sakho. Sicela uhlole " +"amasethingi kusiphequluli sakho, bese uzame futhi." + +msgid "{core:cardinality:problematic_attributes}" +msgstr "Isici(izici) esiyinkinga sithi:" + +msgid "{core:no_state:cause_nocookie}" +msgstr "Amakhukhi kungenzeka ukuthi ayekisiwe kusiphequluli sewebhu." + +msgid "{core:no_state:report_header}" +msgstr "Bika leli phutha" + +msgid "{core:no_state:causes}" +msgstr "Leli phutha kungenzeka libangelwa ukuthi:" + +msgid "{core:no_state:description}" +msgstr "Asikwazanga ukuthola ulwazi lwesifunda lwesicelo samanje." + +msgid "{core:no_state:report_text}" +msgstr "Uma le nkinga iphikelela, ungayibika kubalawuli besistimu." + +msgid "{core:no_metadata:header}" +msgstr "Imethadatha ayitholakali" + +msgid "{core:no_metadata:config_problem}" +msgstr "" +"Lokhu kungenzeka ukuthi kubangelwa inkinga yomiso yomhlinzeki wesevisi " +"noma umhlinzeki kamazisi." + +msgid "{core:no_state:header}" +msgstr "Ulwazi lwesifunda lulahlekile" + +msgid "{core:no_metadata:suggestion_user_link}" +msgstr "" +"Uma ungumsebenzisi othole leli phutha ngemva kokulandela ilinki " +"ekusayithi, kufanele ubike leli phutha kumnikazi waleyo sayithi." + +msgid "{core:no_state:suggestion_goback}" +msgstr "Buyela emuva ekhasini langaphambilini bese uzame futhi." + +msgid "{core:cardinality:cardinality_header}" +msgstr "Izici Ezingalungile" + +msgid "{core:no_state:cause_openbrowser}" +msgstr "" +"Kuvulwe isiphequluli sewebhu ngamathebhu alondolozwe kuseshini " +"yangaphambilini." + +msgid "{core:no_state:suggestion_closebrowser}" +msgstr "Vala isiphequluli sewebhu, bese uzame futhi." + +msgid "{core:no_metadata:not_found_for}" +msgstr "Asikwazanga ukuthola imethadatha yenhlangano:" + +msgid "{core:no_cookie:header}" +msgstr "Ikhukhi engatholakali" + +msgid "{core:cardinality:got_want}" +msgstr "uthole amanani angu-%GOT%, ufuna %WANT%" + +msgid "{core:no_state:suggestions}" +msgstr "Iziphakamiso zokuxazulula le nkinga:" + +msgid "{core:no_state:cause_backforward}" +msgstr "Ukusebenzisa izinkinobho ezithi emuva naphambili kusiphequluli sewebhu." + diff --git a/vendor/simplesamlphp/simplesamlphp/modules/core/routes.yaml b/vendor/simplesamlphp/simplesamlphp/modules/core/routes.yaml new file mode 100644 index 0000000000..80916d2ab5 --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/modules/core/routes.yaml @@ -0,0 +1,9 @@ +core-login: + path: /login/{as} + defaults: { _controller: 'SimpleSAML\Module\core\Controller::login', as: null } +core-account: + path: /account/{as} + defaults: { _controller: 'SimpleSAML\Module\core\Controller::account' } +core-logout: + path: /logout/{as} + defaults: { _controller: 'SimpleSAML\Module\core\Controller::logout' } diff --git a/vendor/simplesamlphp/simplesamlphp/modules/core/templates/_frontpage_menu.twig b/vendor/simplesamlphp/simplesamlphp/modules/core/templates/_frontpage_menu.twig new file mode 100644 index 0000000000..3af6337528 --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/modules/core/templates/_frontpage_menu.twig @@ -0,0 +1,31 @@ +<div class="pure-g frontpage-menu"> + <div class="pure-u-2-3"> + <div class="pure-menu pure-menu-horizontal"> + <ul class="pure-menu-list"> + <li class="pure-menu-item{% if frontpage_section == "welcome" %} pure-menu-selected{% endif %}"> + <a href="frontpage_welcome.php" class="pure-menu-link">Welcome</a> + </li> + <li class="pure-menu-item{% if frontpage_section == "config" %} pure-menu-selected{% endif %}"> + <a href="frontpage_config.php" class="pure-menu-link">Configuration</a> + </li> + <li class="pure-menu-item{% if frontpage_section == "auth" %} pure-menu-selected{% endif %}"> + <a href="frontpage_auth.php" class="pure-menu-link">Authentication</a> + </li> + <li class="pure-menu-item{% if frontpage_section == "federation" %} pure-menu-selected{% endif %}"> + <a href="frontpage_federation.php" class="pure-menu-link">Federation</a> + </li> + </ul> + </div> + </div> + <div class="pure-u-1-3"> + {% if isadmin %} + <p class="float-r youareadmin">{{ '{core:frontpage:loggedin_as_admin}'|trans }} + <a href="{{ logouturl }}"><i class="fa fa-sign-out" title="{{ '{core:frontpage:logout}'|trans }}"></i></a> + </p> + {% else %} + <p class="float-r youareadmin"> + <a href="{{ loginurl }}">{{ '{core:frontpage:login_as_admin}'|trans }}</a> + </p> + {% endif %} + </div> +</div> diff --git a/vendor/simplesamlphp/simplesamlphp/modules/core/templates/authsource_list.tpl.php b/vendor/simplesamlphp/simplesamlphp/modules/core/templates/authsource_list.tpl.php index db0a7cede0..20522518de 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/core/templates/authsource_list.tpl.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/core/templates/authsource_list.tpl.php @@ -4,14 +4,13 @@ * */ $this->data['header'] = 'Test authentication sources'; - $this->includeAtTemplateBase('includes/header.php'); ?> <h1><?php echo $this->data['header']; ?></h1> <ul> <?php foreach ($this->data['sources'] as $id) { - echo '<li><a href="?as=' . htmlspecialchars(urlencode($id)) . '">' . htmlspecialchars($id) . '</a></li>'; + echo '<li><a href="?as='.htmlspecialchars(urlencode($id)).'">'.htmlspecialchars($id).'</a></li>'; } ?> </ul> diff --git a/vendor/simplesamlphp/simplesamlphp/modules/core/templates/base.twig b/vendor/simplesamlphp/simplesamlphp/modules/core/templates/base.twig index 47a732abda..96fcc07bae 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/core/templates/base.twig +++ b/vendor/simplesamlphp/simplesamlphp/modules/core/templates/base.twig @@ -2,23 +2,24 @@ {% block contentwrapper %} {% if tabname %} <div id="portalmenu" class="ui-tabs ui-widget ui-widget-content ui-corner-all"> -<ul class="tabset_tabs ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all"> -{% for name, link in links %} -{% if name == pageid %} -<li class="ui-state-default ui-corner-top ui-tabs-selected ui-state-active"> -<a href="#">{{ link.text|trans }}</a> -</li> -{% else %} -<li class="ui-state-default ui-corner-top"> -<a href="{{ link.href }}">{{ link.text|trans }}</a> -</li> -{% endif %} -{% endfor %} -</ul> -<div id="portalcontent" class="ui-tabs-panel ui-widget-content ui-corner-bottom"> + <ul class="tabset_tabs ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all"> + {% for name, link in links %} + {% if name == pageid %} + <li class="ui-state-default ui-corner-top ui-tabs-selected ui-state-active"> + <a href="#">{{ link.text|trans }}</a> + </li> + {% else %} + <li class="ui-state-default ui-corner-top"> + <a href="{{ link.href }}">{{ link.text|trans }}</a> + </li> + {% endif %} + {% endfor %} + </ul> + <div id="portalcontent" class="ui-tabs-panel ui-widget-content ui-corner-bottom"> {% endif %} {{ block('content') }} {% if tabname %} -</div></div> + </div> +</div> {% endif %} {% endblock %} diff --git a/vendor/simplesamlphp/simplesamlphp/modules/core/templates/cardinality_error.tpl.php b/vendor/simplesamlphp/simplesamlphp/modules/core/templates/cardinality_error.tpl.php new file mode 100644 index 0000000000..6dd78aa1b6 --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/modules/core/templates/cardinality_error.tpl.php @@ -0,0 +1,36 @@ +<?php +/** + * Template which is shown when when an attribute violates a cardinality rule + * + * Parameters: + * - 'target': Target URL. + * - 'params': Parameters which should be included in the request. + * + * @package SimpleSAMLphp + */ + + +$this->data['cardinality_header'] = $this->t('{core:cardinality:cardinality_header}'); +$this->data['cardinality_text'] = $this->t('{core:cardinality:cardinality_text}'); +$this->data['problematic_attributes'] = $this->t('{core:cardinality:problematic_attributes}'); + +$this->includeAtTemplateBase('includes/header.php'); +?> +<h1><?php echo $this->data['cardinality_header']; ?></h1> +<p><?php echo $this->data['cardinality_text']; ?></p> +<h3><?php echo $this->data['problematic_attributes']; ?></h3> +<dl class="cardinalityErrorAttributes"> +<?php +foreach ($this->data['cardinalityErrorAttributes'] as $attr => $v) { + echo '<dt>'.$attr.'</td><dd>'; + echo $this->t( + '{core:cardinality:got_want}', + ['%GOT%' => $v[0], '%WANT%' => htmlspecialchars($v[1])] + ); + echo '</dd></tr>'; +} +echo '</dl>'; +if (isset($this->data['LogoutURL'])) { + echo '<p><a href="'.htmlspecialchars($this->data['LogoutURL']).'>">'.$this->t('{status:logout}').'</a></p>'; +} +$this->includeAtTemplateBase('includes/footer.php'); diff --git a/vendor/simplesamlphp/simplesamlphp/modules/core/templates/frontpage_auth.tpl.php b/vendor/simplesamlphp/simplesamlphp/modules/core/templates/frontpage_auth.tpl.php index f0594948f1..afb55b30d7 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/core/templates/frontpage_auth.tpl.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/core/templates/frontpage_auth.tpl.php @@ -1,34 +1,30 @@ -<?php +<?php $this->data['header'] = $this->t('{core:frontpage:page_title}'); -$this->includeAtTemplateBase('includes/header.php'); +$this->includeAtTemplateBase('includes/header.php'); ?> <?php if ($this->data['isadmin']) { - echo '<p class="float-r youareadmin">' . $this->t('{core:frontpage:loggedin_as_admin}') . '</p>'; + echo '<p class="float-r youareadmin">'.$this->t('{core:frontpage:loggedin_as_admin}').'</p>'; } else { - echo '<p class="float-r youareadmin"><a href="' . $this->data['loginurl'] . '">' . $this->t('{core:frontpage:login_as_admin}') . '</a></p>'; + echo '<p class="float-r youareadmin"><a href="'.$this->data['loginurl'].'">'. + $this->t('{core:frontpage:login_as_admin}').'</a></p>'; } ?> - - -<!-- <h2><?php echo $this->t('{core:frontpage:useful_links_header}'); ?></h2> --> +<!-- <h2><?php echo $this->t('{core:frontpage:useful_links_header}'); ?></h2> --> <ul> <?php - foreach ($this->data['links_auth'] AS $link) { - echo '<li><a href="' . htmlspecialchars($link['href']) . '">' . $this->t($link['text']) . '</a>'; - if (isset($link['deprecated']) && $link['deprecated']) { - echo ' <b>' . $this->t('{core:frontpage:deprecated}') . '</b>'; - } - echo '</li>'; - } +foreach ($this->data['links_auth'] as $link) { + echo '<li><a href="'.htmlspecialchars($link['href']).'">'.$this->t($link['text']).'</a>'; + if (isset($link['deprecated']) && $link['deprecated']) { + echo ' <b>'.$this->t('{core:frontpage:deprecated}').'</b>'; + } + echo '</li>'; +} ?> </ul> - - - <?php $this->includeAtTemplateBase('includes/footer.php'); diff --git a/vendor/simplesamlphp/simplesamlphp/modules/core/templates/frontpage_auth.twig b/vendor/simplesamlphp/simplesamlphp/modules/core/templates/frontpage_auth.twig new file mode 100644 index 0000000000..cfe3c4f9d1 --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/modules/core/templates/frontpage_auth.twig @@ -0,0 +1,18 @@ +{% set pagetitle = '{core:frontpage:page_title}'|trans %} +{% set frontpage_section = 'auth' %} +{% extends "base.twig" %} + +{% block content %} + {% include "@core/_frontpage_menu.twig" %} + + <ul> + {% for key, link in links_auth %} + <li> + <a href="{{ link.href }}">{{ link.text|trans|escape('html') }}</a> + {% if link.deprecated is defined and link.deprecated is not empty %} + <strong>{{ '{core:frontpage:deprecated}'|trans }}</strong> + {% endif %} + </li> + {% endfor %} + </ul> +{% endblock %} diff --git a/vendor/simplesamlphp/simplesamlphp/modules/core/templates/frontpage_config.tpl.php b/vendor/simplesamlphp/simplesamlphp/modules/core/templates/frontpage_config.tpl.php index 4bf19eff93..10f7463cf3 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/core/templates/frontpage_config.tpl.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/core/templates/frontpage_config.tpl.php @@ -5,97 +5,74 @@ ?> - <!-- <div id="tabdiv"> <ul> - <li><a href="#welcome"><?php echo $this->t('{core:frontpage:welcome}'); ?></a></li> - <li><a href="#configuration"><?php echo $this->t('{core:frontpage:configuration}'); ?></a></li> - <li><a href="#metadata"><?php echo $this->t('{core:frontpage:metadata}'); ?></a></li> + <li><a href="#welcome"><?php echo $this->t('{core:frontpage:welcome}'); ?></a></li> + <li><a href="#configuration"><?php echo $this->t('{core:frontpage:configuration}'); ?></a></li> + <li><a href="#metadata"><?php echo $this->t('{core:frontpage:metadata}'); ?></a></li> </ul> --> <?php if ($this->data['isadmin']) { - echo '<p class="float-r youareadmin">' . $this->t('{core:frontpage:loggedin_as_admin}') . '</p>'; + echo '<p class="float-r youareadmin">'.$this->t('{core:frontpage:loggedin_as_admin}').'</p>'; } else { - echo '<p class="float-r youareadmin"><a href="' . $this->data['loginurl'] . '">' . $this->t('{core:frontpage:login_as_admin}') . '</a></p>'; + echo '<p class="float-r youareadmin"><a href="'.$this->data['loginurl'].'">'. + $this->t('{core:frontpage:login_as_admin}').'</a></p>'; } ?> - - - <div style="margin-top: 1em;"> - <code style="background: white; background: #f5f5f5; border: 1px dotted #bbb; padding: 1em; color: #555" ><?php - echo $this->data['directory'] . ' (' . $this->data['version'] . ')'; - ?></code> + <code style="background: white; background: #f5f5f5; border: 1px dotted #bbb; padding: 1em; color: #555" ><?php + echo $this->data['directory'].' ('.$this->data['version'].')'; + ?></code> </div> - - <div style="clear: both" class="enablebox mini"> - <table> - - <?php - $icon_enabled = '<img src="/' . $this->data['baseurlpath'] . 'resources/icons/silk/accept.png" alt="enabled" />'; - $icon_disabled = '<img src="/' . $this->data['baseurlpath'] . 'resources/icons/silk/delete.png" alt="disabled" />'; - ?> - - <tr class="<?php echo $this->data['enablematrix']['saml20-idp'] ? 'enabled' : 'disabled'; ?>"><td>SAML 2.0 IdP</td> - <td><?php echo $this->data['enablematrix']['saml20-idp'] ? $icon_enabled : $icon_disabled; ?></td></tr> - - <tr class="<?php echo $this->data['enablematrix']['shib13-idp'] ? 'enabled' : 'disabled'; ?>"><td>Shib 1.3 IdP</td> - <td><?php echo $this->data['enablematrix']['shib13-idp'] ? $icon_enabled : $icon_disabled; ?></td></tr> - - </table> -</div> + <table> + <?php + $icon_enabled = '<img src="/'.$this->data['baseurlpath'].'resources/icons/silk/accept.png" alt="enabled" />'; + $icon_disabled = '<img src="/'.$this->data['baseurlpath'].'resources/icons/silk/delete.png" alt="disabled" />'; + echo '<tr class="'.($this->data['enablematrix']['saml20idp'] ? 'enabled' : 'disabled').'"><td>SAML 2.0 IdP</td>'; + echo '<td>'.($this->data['enablematrix']['saml20idp'] ? $icon_enabled : $icon_disabled).'</td></tr>'; + echo '<tr class="'.($this->data['enablematrix']['shib13idp'] ? 'enabled' : 'disabled').'"><td>Shib 1.3 IdP</td>'; + echo '<td>'.($this->data['enablematrix']['shib13idp'] ? $icon_enabled : $icon_disabled).'</td></tr>'; + ?> + + </table> +</div> <h2><?php echo $this->t('{core:frontpage:configuration}'); ?></h2> <ul> <?php - foreach ($this->data['links_config'] AS $link) { - echo '<li><a href="' . htmlspecialchars($link['href']) . '">' . $this->t($link['text']) . '</a></li>'; - } +foreach ($this->data['links_config'] as $link) { + echo '<li><a href="'.htmlspecialchars($link['href']).'">'.$this->t($link['text']).'</a></li>'; +} ?> </ul> - <?php - if (array_key_exists('warnings', $this->data) && is_array($this->data['warnings']) && !empty($this->data['warnings'])) { - - echo '<h2>' . $this->t('{core:frontpage:warnings}') . '</h2>'; +if (array_key_exists('warnings', $this->data) && is_array($this->data['warnings']) && !empty($this->data['warnings'])) { + echo '<h2>'.$this->t('{core:frontpage:warnings}').'</h2>'; + foreach ($this->data['warnings'] as $warning) { + echo '<div class="caution">'.$warning.'</div>'; + } +} - foreach($this->data['warnings'] AS $warning) { - if (is_array($warning)) { - echo '<div class="caution">' . $this->t($warning[0], $warning[1]) . '</div>'; - } else { - echo '<div class="caution">'.$this->t($warning).'</div>'; - } - } - } -?> -<?php if ($this->data['isadmin']) { - - echo '<h2>'. $this->t('{core:frontpage:checkphp}') . '</h2>'; - echo '<div class="enablebox"><table>'; - - - $icon_enabled = '<img src="/' . $this->data['baseurlpath'] . 'resources/icons/silk/accept.png" alt="enabled" />'; - $icon_disabled = '<img src="/' . $this->data['baseurlpath'] . 'resources/icons/silk/delete.png" alt="disabled" />'; - - - foreach ($this->data['funcmatrix'] AS $func) { - echo '<tr class="' . ($func['enabled'] ? 'enabled' : 'disabled') . '"><td>' . ($func['enabled'] ? $icon_enabled : $icon_disabled) . '</td>'; - echo '<td>' . $this->t($this->data['requiredmap'][$func['required']]) . '</td><td>' . $func['descr'] . '</td></tr>'; - } - echo('</table></div>'); + echo '<h2>'.$this->t('{core:frontpage:checkphp}').'</h2>'; + echo '<div class="enablebox"><table>'; + + $icon_enabled = '<img src="/'.$this->data['baseurlpath'].'resources/icons/silk/accept.png" alt="enabled" />'; + $icon_disabled = '<img src="/'.$this->data['baseurlpath'].'resources/icons/silk/delete.png" alt="disabled" />'; + + foreach ($this->data['funcmatrix'] as $func) { + echo '<tr class="'.($func['enabled'] ? 'enabled' : 'disabled').'"><td>'. + ($func['enabled'] ? $icon_enabled : $icon_disabled).'</td>'; + echo '<td>'.$this->t($this->data['requiredmap'][$func['required']]).'</td><td>'.$func['descr'].'</td></tr>'; + } + echo '</table></div>'; } -?> - - - - -<?php $this->includeAtTemplateBase('includes/footer.php'); +$this->includeAtTemplateBase('includes/footer.php'); diff --git a/vendor/simplesamlphp/simplesamlphp/modules/core/templates/frontpage_config.twig b/vendor/simplesamlphp/simplesamlphp/modules/core/templates/frontpage_config.twig new file mode 100644 index 0000000000..c0fb87b95d --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/modules/core/templates/frontpage_config.twig @@ -0,0 +1,56 @@ +{% set pagetitle = '{core:frontpage:page_title}'|trans %} +{% set frontpage_section = 'config' %} +{% extends "base.twig" %} + +{% block content %} + {% include "@core/_frontpage_menu.twig" %} + + <div> + <code class="simplesaml_version">{{ directory }} ({{ version }})</code> + </div> + + {% set icon_enabled = '<i class="fa fa-check"></i>' %} + {% set icon_disabled = '<i class="fa fa-ban"></i>' %} + + <div class="enablebox mini"> + <table> + <tr class="{%- if enablematrix.saml20idp %}enabled{% else %}disabled{% endif -%}"> + <td>SAML 2.0 IdP</td> + <td>{%- if enablematrix.saml20idp %}{{ icon_enabled|raw }}{% else %}{{ icon_disabled|raw }}{% endif -%}</td> + </tr> + <tr class="{%- if enablematrix.shib13idp %}enabled{% else %}disabled{% endif -%}"> + <td>Shib 1.3 IdP</td> + <td>{%- if enablematrix.shib13idp %}{{ icon_enabled|raw }}{% else %}{{ icon_disabled|raw }}{% endif -%}</td> + </tr> + </table> + </div> + + <h2>{{ '{core:frontpage:configuration}'|trans }}</h2> + <ul> + {% for key, link in links_config %} + <li><a href="{{ link.href|escape('html') }}">{{ link.text|trans|escape('html') }}</a></li> + {% endfor %} + </ul> + + {% if warnings is defined and warnings is not empty %} + <h2>{{ '{core:frontpage:warnings}'|trans|escape('html') }}</h2> + {% for key, warning in warnings %} + <div class="caution">{{ warning|raw }}</div> + {% endfor %} + {% endif %} + + {% if isadmin %} + <h2>{{ '{core:frontpage:checkphp}'|trans }}</h2> + <div class="enablebox"> + <table> + {% for key, func in funcmatrix %} + <tr class="{%- if func.enabled %}enabled{% else %}disabled{% endif -%}"> + <td>{%- if func.enabled %}{{ icon_enabled|raw }}{% else %}{{ icon_disabled|raw }}{% endif -%}</td> + <td>{{ requiredmap[func.required]|trans }}</td> + <td>{{ func.descr }}</td> + </tr> + {% endfor %} + </table> + </div> + {% endif %} +{% endblock %} diff --git a/vendor/simplesamlphp/simplesamlphp/modules/core/templates/frontpage_federation.tpl.php b/vendor/simplesamlphp/simplesamlphp/modules/core/templates/frontpage_federation.tpl.php index f6e1596c56..6bdce02111 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/core/templates/frontpage_federation.tpl.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/core/templates/frontpage_federation.tpl.php @@ -43,7 +43,6 @@ if (is_array($this->data['metaentries']['remote']) && count($this->data['metaentries']['remote']) > 0) { $now = time(); foreach ($this->data['metaentries']['remote'] as $setkey => $set) { - echo '<fieldset class="fancyfieldset"><legend>'.$this->t($this->data['mtype'][$setkey]).' (Trusted)</legend>'; echo '<ul>'; foreach ($set as $entry) { @@ -52,7 +51,7 @@ htmlspecialchars( SimpleSAML\Module::getModuleURL( 'core/show_metadata.php', - array('entityid' => $entry['entityid'], 'set' => $setkey) + ['entityid' => $entry['entityid'], 'set' => $setkey] ) ).'">'); if (!empty($entry['name'])) { @@ -81,26 +80,26 @@ echo '</fieldset>'; } } + +echo '<h2>'.$this->t('{core:frontpage:tools}').'</h2>'; +echo '<ul>'; +foreach ($this->data['links_federation'] as $link) { + echo '<li><a href="'.htmlspecialchars($link['href']).'">'.$this->t($link['text']).'</a></li>'; +} +echo '</ul>'; +if ($this->data['isadmin']) { ?> - <h2><?php echo $this->t('{core:frontpage:tools}'); ?></h2> - <ul><?php - foreach ($this->data['links_federation'] as $link) { - echo '<li><a href="'.htmlspecialchars($link['href']).'">'.$this->t($link['text']).'</a></li>'; - } -?> - </ul> -<?php - if ($this->data['isadmin']) { ?> <fieldset class="fancyfieldset"> <legend>Lookup metadata</legend> <form action="<?php echo SimpleSAML\Module::getModuleURL('core/show_metadata.php'); ?>" method="get"> <p style="margin: 1em 2em ">Look up metadata for entity: - <select name="set"><?php - if (is_array($this->data['metaentries']['remote']) && count($this->data['metaentries']['remote']) > 0) { - foreach ($this->data['metaentries']['remote'] as $setkey => $set) { - echo '<option value="'.htmlspecialchars($setkey).'">'.$this->t($this->data['mtype'][$setkey]).'</option>'; - } - } + <select name="set"> +<?php + if (is_array($this->data['metaentries']['remote']) && count($this->data['metaentries']['remote']) > 0) { + foreach ($this->data['metaentries']['remote'] as $setkey => $set) { + echo '<option value="'.htmlspecialchars($setkey).'">'.$this->t($this->data['mtype'][$setkey]).'</option>'; + } + } ?> </select> <input type="text" name="entityid" /> @@ -109,5 +108,5 @@ </form> </fieldset> <?php - } +} $this->includeAtTemplateBase('includes/footer.php'); diff --git a/vendor/simplesamlphp/simplesamlphp/modules/core/templates/frontpage_federation.twig b/vendor/simplesamlphp/simplesamlphp/modules/core/templates/frontpage_federation.twig new file mode 100644 index 0000000000..35acde2d64 --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/modules/core/templates/frontpage_federation.twig @@ -0,0 +1,84 @@ +{% set pagetitle = '{core:frontpage:page_title}'|trans %} +{% set frontpage_section = 'federation' %} +{% extends "base.twig" %} + +{% block content %} + {% include "@core/_frontpage_menu.twig" %} + + {% if metaentries.hosted is iterable and metaentries.hosted is not empty %} + <dl> + {% for key, set in metaentries.hosted %} + {% set metadataset = attribute(set, 'metadata-set') %} + <dt>{{ mtype[metadataset]|trans }}</dt> + <dd> + <p>Entity ID: <code>{{ set.entityid }}</code> + {% if set.deprecated is defined and set.deprecated %} + <br /><span class="entity-deprecated">Deprecated</span> + {% endif %} + {% if set.entityid != attribute(set, 'metadata-index') %} + <br />Index: {{ attribute(set, 'metadata-index') }} + {% endif %} + {% if set.name_translated is defined %} + <br /><span class="entity-name">{{ set.name_translated }}</span> + {% endif %} + {% if set.descr_translated is defined %} + <br /><span class="entity-name">{{ set.descr_translated }}</span> + {% endif %} + <br />[ <a href="{{ attribute(set, 'metadata-url') }}">{{'{core:frontpage:show_metadata}'|trans }}</a> ] + </p> + </dd> + {% endfor %} + </dl> + {% endif %} + + {% if metaentries.remote is iterable and metaentries.remote is not empty %} + {% for key, set in metaentries.remote %} + <fieldset class="fancyfieldset"> + <legend>{{ mtype[key]|trans }} (Trusted)</legend> + <ul> + {% for entityid, entity in set %} + <li><a href="{{ (metadata_url ~ '?entityid=' ~ entity.entityid ~ '&set=' ~ key)|escape('html') }}"> + {%- if entity.name_translated is defined %} + {{ entity.name_translated }} + {% elseif entity.organizationdisplayname_translated is defined %} + {{ entity.organizationdisplayname_translated }} + {% else %}{{ entity.entityid|escape('html') }} + {% endif -%}</a> + + {%- if entity.expire is defined %} + {% if entity.expire > date().timestamp %} + <span class="entity-expired"> (expired {{ ((date().timestamp - entity.expire) / 3600) }} hours ago)</span> + {% else %} (expires in {{ ((entity.expire - date().timestamp) / 3600) }} hours){% endif -%}{% endif %} + </li> + {% endfor %} + </ul> + </fieldset> + {% endfor %} + {% endif %} + + <h2>{{ '{core:frontpage:tools}'|trans }}</h2> + <ul> + {% for key, link in links_federation %} + <li><a href="{{ link.href|escape('html') }}">{{ link.text|trans|escape('html') }}</a></li> + {% endfor %} + </ul> + + {% if isadmin %} + <fieldset class="fancyfieldset"> + <legend>Lookup metadata</legend> + <form action="{{ metadata_url }}" method="get"> + <p>Look up metadata for entity: + <select name="set"> + {% if metaentries.remote is defined and metaentries.remote is not empty %} + {% for key, set in metaentries.remote %} + <option value="{{ key|escape('html') }}">{{ mtype[key]|trans }}</option> + {% endfor %} + {% endif %} + </select> + <input type="text" name="entityid" /> + <button class="btn" type="submit">Lookup </button> + </p> + </form> + </fieldset> + {% endif %} +{% endblock %} diff --git a/vendor/simplesamlphp/simplesamlphp/modules/core/templates/frontpage_welcome.tpl.php b/vendor/simplesamlphp/simplesamlphp/modules/core/templates/frontpage_welcome.tpl.php index 33d5ff2511..da5c2e5297 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/core/templates/frontpage_welcome.tpl.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/core/templates/frontpage_welcome.tpl.php @@ -1,36 +1,23 @@ -<?php - +<?php $this->data['header'] = $this->t('{core:frontpage:page_title}'); -$this->includeAtTemplateBase('includes/header.php'); - -?> - +$this->includeAtTemplateBase('includes/header.php'); -<?php if ($this->data['isadmin']) { - echo '<p class="float-r youareadmin">' . $this->t('{core:frontpage:loggedin_as_admin}') . '</p>'; + echo '<p class="float-r youareadmin">'.$this->t('{core:frontpage:loggedin_as_admin}').'</p>'; } else { - echo '<p class="float-r youareadmin"><a href="' . $this->data['loginurl'] . '">' . $this->t('{core:frontpage:login_as_admin}') . '</a></p>'; + echo '<p class="float-r youareadmin"><a href="'.$this->data['loginurl'].'">'. + $this->t('{core:frontpage:login_as_admin}').'</a></p>'; } ?> <p><?php echo $this->t('{core:frontpage:intro}'); ?></p> - <ul> <?php - foreach ($this->data['links_welcome'] AS $link) { - echo '<li><a href="' . htmlspecialchars($link['href']) . '">' . $this->t($link['text']) . '</a></li>'; - } +foreach ($this->data['links_welcome'] as $link) { + echo '<li><a href="'. htmlspecialchars($link['href']).'">'.$this->t($link['text']).'</a></li>'; +} ?> </ul> - - - - <h2><?php echo $this->t('{core:frontpage:about_header}'); ?></h2> - <p><?php echo $this->t('{core:frontpage:about_text}'); ?></p> - - - <?php $this->includeAtTemplateBase('includes/footer.php'); diff --git a/vendor/simplesamlphp/simplesamlphp/modules/core/templates/frontpage_welcome.twig b/vendor/simplesamlphp/simplesamlphp/modules/core/templates/frontpage_welcome.twig new file mode 100644 index 0000000000..653c549352 --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/modules/core/templates/frontpage_welcome.twig @@ -0,0 +1,15 @@ +{% set pagetitle = '{core:frontpage:page_title}'|trans %} +{% set frontpage_section = 'welcome' %} +{% extends "base.twig" %} + +{% block content %} + {% include "@core/_frontpage_menu.twig" %} + + <p>{{ '{core:frontpage:intro}'|trans|raw }}</p> + <ul> + {% for key, link in links_welcome %} + <li><a href="{{ link.href|escape('html') }}">{{ link.text|trans|escape('html') }}</a></li> + {% endfor %} + </ul> + +{% endblock %} diff --git a/vendor/simplesamlphp/simplesamlphp/modules/core/templates/login.twig b/vendor/simplesamlphp/simplesamlphp/modules/core/templates/login.twig new file mode 100644 index 0000000000..be87ded7bf --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/modules/core/templates/login.twig @@ -0,0 +1,24 @@ +{% set pagetitle = 'Authenticate'|trans %} +{% extends "@core/base.twig" %} + +{% block content %} + <h1>{{ pagetitle|trans }}</h1> + <p>Please choose one of the following authentication methods: </p> + +{% if sources is empty -%} + <p>Please check your SimpleSAML configuration.<br> + Follow the link and log in with administrator credentials. <a href="{{ loginurl }}">Admin login.</a></p> +{% else %} + <div class="pure-menu custom-restricted-width"> + <ul class="pure-menu-list auth_methods"> + {% for id, config in sources -%} + <li class="pure-menu-item"> + <a href="/{{ baseurlpath }}module.php/core/login/{{ id|url_encode }}" class="pure-menu-link"> + {{ config.name|translateFromArray|default(id) }} + </a> + </li> + {% endfor -%} + </ul> + </div> +{% endif %} +{% endblock %} diff --git a/vendor/simplesamlphp/simplesamlphp/modules/core/templates/loginuserpass.php b/vendor/simplesamlphp/simplesamlphp/modules/core/templates/loginuserpass.php index d957fc43a2..cfbb1cf7ba 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/core/templates/loginuserpass.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/core/templates/loginuserpass.php @@ -8,26 +8,37 @@ } $this->includeAtTemplateBase('includes/header.php'); -?> - -<?php if ($this->data['errorcode'] !== null) { - ?> +?> <div style="border-left: 1px solid #e8e8e8; border-bottom: 1px solid #e8e8e8; background: #f5f5f5"> <img src="/<?php echo $this->data['baseurlpath']; ?>resources/icons/experience/gtk-dialog-error.48x48.png" class="float-l erroricon" style="margin: 15px" alt=""/> <h2><?php echo $this->t('{login:error_header}'); ?></h2> - <p><strong><?php - echo htmlspecialchars($this->t($this->data['errorcodes']['title'][$this->data['errorcode']], $this->data['errorparams'])); ?></strong></p> - - <p><?php - echo htmlspecialchars($this->t($this->data['errorcodes']['descr'][$this->data['errorcode']], $this->data['errorparams'])); ?></p> + <p><strong> + <?php + echo htmlspecialchars( + $this->t( + $this->data['errorcodes']['title'][$this->data['errorcode']], + $this->data['errorparams'] + ) + ); + ?> + </strong></p> + <p> + <?php + echo htmlspecialchars( + $this->t( + $this->data['errorcodes']['descr'][$this->data['errorcode']], + $this->data['errorparams'] + ) + ); + ?> + </p> </div> <?php } - ?> <h2 style="break: both"><?php echo $this->t('{login:user_pass_header}'); ?></h2> @@ -43,10 +54,8 @@ class="float-l erroricon" style="margin: 15px" alt=""/> <td><label for="username"><?php echo $this->t('{login:username}'); ?></label></td> <td> <input id="username" <?php echo ($this->data['forceUsername']) ? 'disabled="disabled"' : ''; ?> - type="text" name="username" -<?php if (!$this->data['forceUsername']) { - echo 'tabindex="1"'; -} ?> value="<?php echo htmlspecialchars($this->data['username']); ?>"/> + type="text" name="username"<?php echo $this->data['forceUsername'] ? '' : ' tabindex="1"'; ?> + value="<?php echo htmlspecialchars($this->data['username']); ?>" /> </td> <?php if ($this->data['rememberUsernameEnabled'] && !$this->data['forceUsername']) { @@ -55,7 +64,7 @@ class="float-l erroricon" style="margin: 15px" alt=""/> <td id="regular_remember_username"> <input type="checkbox" id="remember_username" tabindex="4" <?php echo ($this->data['rememberUsernameChecked']) ? 'checked="checked"' : ''; ?> - name="remember_username" value="Yes"/> + name="remember_username" value="Yes" /> <small><?php echo $this->t('{login:remember_username}'); ?></small> </td> <?php @@ -65,24 +74,22 @@ class="float-l erroricon" style="margin: 15px" alt=""/> <?php if ($this->data['rememberUsernameEnabled'] && !$this->data['forceUsername']) { // display the "remember my username" checkbox - ?> + ?> <tr id="mobile_remember_username"> <td> </td> <td> <input type="checkbox" id="remember_username" tabindex="4" <?php echo ($this->data['rememberUsernameChecked']) ? 'checked="checked"' : ''; ?> - name="remember_username" value="Yes"/> + name="remember_username" value="Yes" /> <small><?php echo $this->t('{login:remember_username}'); ?></small> </td> </tr> - <?php + <?php } ?> <tr> <td><label for="password"><?php echo $this->t('{login:password}'); ?></label></td> - <td> - <input id="password" type="password" tabindex="2" name="password"/> - </td> + <td><input id="password" type="password" tabindex="2" name="password" /></td> <?php if ($this->data['rememberMeEnabled']) { // display the remember me checkbox (keep me logged in) @@ -90,7 +97,7 @@ class="float-l erroricon" style="margin: 15px" alt=""/> <td id="regular_remember_me"> <input type="checkbox" id="remember_me" tabindex="5" <?php echo ($this->data['rememberMeChecked']) ? 'checked="checked"' : ''; ?> - name="remember_me" value="Yes"/> + name="remember_me" value="Yes" /> <small><?php echo $this->t('{login:remember_me}'); ?></small> </td> <?php @@ -106,7 +113,7 @@ class="float-l erroricon" style="margin: 15px" alt=""/> <td id="mobile_remember_me"> <input type="checkbox" id="remember_me" tabindex="5" <?php echo ($this->data['rememberMeChecked']) ? 'checked="checked"' : ''; ?> - name="remember_me" value="Yes"/> + name="remember_me" value="Yes" /> <small><?php echo $this->t('{login:remember_me}'); ?></small> </td> </tr> @@ -115,51 +122,62 @@ class="float-l erroricon" style="margin: 15px" alt=""/> ?> <?php if (array_key_exists('organizations', $this->data)) { - ?> + ?> <tr> <td></td> <td><label for="organization"><?php echo $this->t('{login:organization}'); ?></label></td> <td><select name="organization" tabindex="3"> - <?php - if (array_key_exists('selectedOrg', $this->data)) { - $selectedOrg = $this->data['selectedOrg']; - } else { - $selectedOrg = null; - } - - foreach ($this->data['organizations'] as $orgId => $orgDesc) { - if (is_array($orgDesc)) { - $orgDesc = $this->t($orgDesc); - } + <?php + if (array_key_exists('selectedOrg', $this->data)) { + $selectedOrg = $this->data['selectedOrg']; + } else { + $selectedOrg = null; + } - if ($orgId === $selectedOrg) { - $selected = 'selected="selected" '; - } else { - $selected = ''; - } + foreach ($this->data['organizations'] as $orgId => $orgDesc) { + if (is_array($orgDesc)) { + $orgDesc = $this->t($orgDesc); + } - echo '<option '.$selected.'value="'.htmlspecialchars($orgId).'">'.htmlspecialchars($orgDesc).'</option>'; + if ($orgId === $selectedOrg) { + $selected = 'selected="selected" '; + } else { + $selected = ''; } - ?> + + echo '<option '.$selected.'value="'.htmlspecialchars($orgId).'">'. + htmlspecialchars($orgDesc).'</option>'; + } + ?> </select></td> + <td style="padding: .4em;"> + <?php + if ($this->data['rememberOrganizationEnabled']) { + echo str_repeat("\t", 4); + echo '<input type="checkbox" id="remember_organization" tabindex="5"'. + ' name="remember_organization" value="Yes" '. + ($this->data['rememberOrganizationChecked'] ? 'checked="Yes" /> ' : '/> '). + $this->t('{login:remember_organization}'); + } + ?> + </td> </tr> - <?php + <?php } ?> <tr id="submit"> <td class="loginicon"></td><td></td> <td> - <button class="btn" - onclick="this.value='<?php echo $this->t('{login:processing}'); ?>'; - this.disabled=true; this.form.submit(); return true;" tabindex="6"> + <button id="submit_button" class="btn" tabindex="6"> <?php echo $this->t('{login:login_button}'); ?> </button> </td> </tr> </table> + <input type="hidden" id="processing_trans" value="<?php echo $this->t('{login:processing}'); ?>" /> <?php foreach ($this->data['stateparams'] as $name => $value) { - echo('<input type="hidden" name="'.htmlspecialchars($name).'" value="'.htmlspecialchars($value).'" />'); + echo '<input type="hidden" name="'.htmlspecialchars($name).'" value="'.htmlspecialchars($value).'" />'; } ?> </form> @@ -171,7 +189,7 @@ class="float-l erroricon" style="margin: 15px" alt=""/> } echo '</ul>'; } -echo('<h2 class="logintext">'.$this->t('{login:help_header}').'</h2>'); -echo('<p class="logintext">'.$this->t('{login:help_text}').'</p>'); +echo '<h2 class="logintext">'.$this->t('{login:help_header}').'</h2>'; +echo '<p class="logintext">'.$this->t('{login:help_text}').'</p>'; $this->includeAtTemplateBase('includes/footer.php'); diff --git a/vendor/simplesamlphp/simplesamlphp/modules/core/templates/loginuserpass.twig b/vendor/simplesamlphp/simplesamlphp/modules/core/templates/loginuserpass.twig new file mode 100644 index 0000000000..59529528bd --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/modules/core/templates/loginuserpass.twig @@ -0,0 +1,126 @@ +{% set pagetitle = 'Enter your username and password'|trans %} + +{% extends "@core/base.twig" %} + +{% block postload %} + <script src="/{{baseurlpath}}module.php/core/assets/js/loginuserpass.js"></script> +{% endblock %} + +{% block content %} + {% if errorcode -%} + <div class="pure-g"> + <div class="pure-u-1"> + <div class="message-box error"> + + {% set errtitles = errorcodes['title'] %} + {% set errtitle = errtitles[errorcode] %} + + <h3>{{ errtitle|trans(errorparams) }}</h3> + + {% set errdescs = errorcodes['descr'] %} + {% set errdesc = errdescs[errorcode] %} + + <p>{{ errdesc|trans(errorparams) }}</p> + + </div> + </div> + </div> + {%- endif %} + + <h1>{{ 'Enter your username and password'|trans }}</h1> + + <p>{{ 'A service has requested you to authenticate yourself. Please enter your username and password in the form below.'|trans }}</p> + <br> + <div class="center"> + <form class="pure-form pure-form-aligned center-form" action="?" method="post" name="f"> + <div class="form-align"> + + <div class="pure-control-group"> + <label for="username">{{ 'Username'|trans }}</label> + <input id="username" {{ forceUsername ? 'disabled="disabled"' }} placeholder="{{ username }}" type="text" name="username" class="edge" + {%- if not forceUsername %} tabindex="1" value="{{ username }}" {% endif %} + {%- if not forceUsername and not username %} autofocus {% endif %} /> + {% if rememberUsernameEnabled and not forceUsername -%} + </div> + <div class="pure-controls pure-form-message"> + <label for="remember_username" class="pure-checkbox"> + <input id="remember_username" type="checkbox" tabindex="4" + {{ rememberUsernameChecked ? 'checked="checked"' }} name="remember_username" value="Yes"/> + <small>{{ 'Remember my username'|trans }}</small> + </label> + {%- endif %} + </div> + + <div class="pure-control-group"> + <label for="password">{{ 'Password'|trans}}</label> + <input id="password" type="password" tabindex="2" name="password" class="edge" + {%- if forceUsername or username %} autofocus {% endif %} /> + + {% if rememberMeEnabled -%} + </div> + <div class="pure-controls pure-form-message"> + <label for="remember_me" class="pure-checkbox"> + <input id="remember_me" type="checkbox" tabindex="5" + {{ rememberMeChecked ? 'checked="checked"' }} name="remember_me" value="Yes"/> + <small>{{ 'Remember me'|trans }}</small> + </label> + {%- endif %} + </div> + {% if organizations is defined -%} + <div class="pure-control-group"> + <label for="organization">{{ 'Organization'|trans }}</label> + <div class="pure-select right pure-input-1-2 pure-input-sm-1-1"> + <select name="organization" class="selectize" id="organization" tabindex="3"> + {{ selectedOrg ?: null }} + {%- for id, orgDesc in organizations -%} + {% if id == selectedOrg -%} + {%- set selected = 'selected="selected"' %} + {%- else -%} + {% set selected = '' -%} + {% endif -%} + {% if orgDesc -%} + <option value="{{ id }}" {{ selected }}>{{ orgDesc|trans }}</option> + {% endif -%} + {% endfor %} + </select> + </div> + {% if rememberOrganizationEnabled is defined -%} + <div class="pure-controls pure-form-message"> + <label for="remember_organization" class="pure-checkbox"> + <input type="checkbox" id="remember_organization" tabindex="5" name="remember_organization" value="Yes" + {{ rememberOrganizationChecked ? 'checked="checked"' }} /> + <small>{{ 'Remember my organization'|trans }}</small> + </label> + </div> + {%- endif %} + </div> <!--pure-control-group--> + {%- endif %} + + </div> <!-- form-align--> + <br><br> + {%- for name, value in stateparams %} + + <input type="hidden" name="{{ name }}" value="{{ value }}"/> + {%- endfor %} + + <button class="pure-button pure-button-red pure-input-1-2 pure-input-sm-1-1 right" id="submit_button" + type="submit" tabindex="6" data-processing="{% trans %}Processing...{% endtrans %}"> + {% trans %}Log in{% endtrans %} + </button> + </form> + </div><!--center--> + {% if links -%} + <ul> + {% for link in links -%} + <li><a href="{{ link.href }}">{{ link['text']|trans }}</a></li> + {% endfor %} + </ul> + {%- endif %} + + <br><br> + <div class="pure-form-message"> + <strong>{{ 'Help! I don\'t remember my password.'|trans }}</strong> + <p>{{ 'Without your username and password you cannot authenticate yourself for access to the service. There may be someone that can help you. Consult the help desk at your organization!'|trans }}</p> + </div> + +{% endblock %} diff --git a/vendor/simplesamlphp/simplesamlphp/modules/core/templates/logout-iframe-wrapper.php b/vendor/simplesamlphp/simplesamlphp/modules/core/templates/logout-iframe-wrapper.php index 4649c289be..3392e4cb4f 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/core/templates/logout-iframe-wrapper.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/core/templates/logout-iframe-wrapper.php @@ -10,8 +10,8 @@ $this->data['header'] = $this->t('{logout:progress}'); $this->includeAtTemplateBase('includes/header.php'); -echo '<iframe style="width:100%; height:'.$iframeHeight.'em; border:0;" src="'.htmlspecialchars($iframeURL). - '"></iframe>'; +echo '<iframe style="width:100%; height:'.$iframeHeight.'em; border:0;" src="'. + htmlspecialchars($iframeURL).'"></iframe>'; foreach ($SPs as $assocId => $sp) { $spId = sha1($assocId); @@ -19,11 +19,11 @@ if ($sp['core:Logout-IFrame:State'] !== 'inprogress') { continue; } - assert('isset($sp["core:Logout-IFrame:URL"])'); + assert(isset($sp['core:Logout-IFrame:URL'])); $url = $sp["core:Logout-IFrame:URL"]; - echo('<iframe style="width:0; height:0; border:0;" src="'.htmlspecialchars($url).'"></iframe>'); + echo '<iframe style="width:0; height:0; border:0;" src="'.htmlspecialchars($url).'"></iframe>'; } $this->includeAtTemplateBase('includes/footer.php'); diff --git a/vendor/simplesamlphp/simplesamlphp/modules/core/templates/logout-iframe-wrapper.twig b/vendor/simplesamlphp/simplesamlphp/modules/core/templates/logout-iframe-wrapper.twig new file mode 100644 index 0000000000..7c9e415d07 --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/modules/core/templates/logout-iframe-wrapper.twig @@ -0,0 +1,16 @@ + +{% set pagetitle = '{logout:progress}'|trans %} +{% extends "base.twig" %} + +{% block content %} + {# pretty arbitrary height, but should have enough safety margins for most cases #} + {% set iframeHeight = (25 + (SPs|length * 4)) %} + + <iframe style="width:100%; height: {{ iframeHeight }}em; border:0;" src="logout-iframe.php?type=embed&id={{ auth_state|escape('url') }}"></iframe> + + {% for assocId, sp in SPs %} + {% if attribute(sp, 'core:Logout-IFrame:State') == 'inprogress' %} + <iframe style="width:0; height:0; border:0;" src="{{ attribute(sp, 'core:Logout-IFrame:URL')|escape('html') }}</iframe> + {% endif %} + {% endfor %} +{% endblock %} diff --git a/vendor/simplesamlphp/simplesamlphp/modules/core/templates/logout-iframe.php b/vendor/simplesamlphp/simplesamlphp/modules/core/templates/logout-iframe.php index de177d0817..54ca2c1829 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/core/templates/logout-iframe.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/core/templates/logout-iframe.php @@ -5,28 +5,28 @@ $from = $this->data['from']; $SPs = $this->data['SPs']; -$stateImage = array( +$stateImage = [ 'unsupported' => '/'.$this->data['baseurlpath'].'resources/icons/silk/delete.png', 'completed' => '/'.$this->data['baseurlpath'].'resources/icons/silk/accept.png', 'onhold' => '/'.$this->data['baseurlpath'].'resources/icons/bullet16_grey.png', 'inprogress' => '/'.$this->data['baseurlpath'].'resources/progress.gif', 'failed' => '/'.$this->data['baseurlpath'].'resources/icons/silk/exclamation.png', -); +]; -$stateText = array( +$stateText = [ 'unsupported' => '', 'completed' => $this->t('{logout:completed}'), 'onhold' => '', 'inprogress' => $this->t('{logout:progress}'), 'failed' => $this->t('{logout:failed}'), -); +]; -$spStatus = array(); -$spTimeout = array(); +$spStatus = []; +$spTimeout = []; $nFailed = 0; $nProgress = 0; foreach ($SPs as $assocId => $sp) { - assert('isset($sp["core:Logout-IFrame:State"])'); + assert(isset($sp['core:Logout-IFrame:State'])); $state = $sp['core:Logout-IFrame:State']; $spStatus[sha1($assocId)] = $state; if (isset($sp['core:Logout-IFrame:Timeout'])) { @@ -71,14 +71,14 @@ $this->includeAtTemplateBase('includes/header.php'); } ?> - <div id="wrap"> - <div id="content"> +<div id="wrap"> + <div id="content"> <?php if ($from !== null) { echo '<div><img style="float: left; margin-right: 12px" src="/'.$this->data['baseurlpath']. - 'resources/icons/checkmark.48x48.png" alt="Successful logout" />'; + 'resources/icons/checkmark.48x48.png" alt="Successful logout" />'; echo '<p style="padding-top: 16px; ">'. - $this->t('{logout:loggedoutfrom}', array('%SP%' => '<strong>'.htmlspecialchars($from).'</strong>')).'</p>'; + $this->t('{logout:loggedoutfrom}', ['%SP%' => '<strong>'.htmlspecialchars($from).'</strong>']).'</p>'; echo '<p style="height: 0px; clear: left;"></p></div>'; } @@ -90,9 +90,9 @@ } else { echo $this->t('{logout:logging_out_from}'); } -echo('</p>'); ?> - <table id="slostatustable"> + </p> + <table id="slostatustable"> <?php foreach ($SPs as $assocId => $sp) { if (isset($sp['core:Logout-IFrame:Name'])) { @@ -101,7 +101,7 @@ $spName = $assocId; } - assert('isset($sp["core:Logout-IFrame:State"])'); + assert(isset($sp['core:Logout-IFrame:State'])); $spState = $sp['core:Logout-IFrame:State']; $spId = sha1($assocId); @@ -110,37 +110,39 @@ echo '<td style="width: 3em;"></td>'; echo '<td>'; echo '<img class="logoutstatusimage" id="statusimage-'.$spId.'" src="'.htmlspecialchars($stateImage[$spState]). - '" alt="'.htmlspecialchars($stateText[$spState]).'"/>'; + '" alt="'.htmlspecialchars($stateText[$spState]).'"/>'; echo '</td>'; echo '<td>'.htmlspecialchars($spName).'</td>'; echo '</tr>'; } if (isset($from)) { - $logoutCancelText = $this->t('{logout:logout_only}', array('%SP%' => htmlspecialchars($from))); + $logoutCancelText = $this->t('{logout:logout_only}', ['%SP%' => htmlspecialchars($from)]); } else { $logoutCancelText = $this->t('{logout:no}'); } ?> - </table> - </div> + </table> +</div> <?php if ($type === 'init') { ?> - <div id="confirmation" style="margin-top: 1em"> - <p><?php echo $this->t('{logout:logout_all_question}'); ?> <br/></p> - <form id="startform" method="get" style="display:inline;" action="logout-iframe.php"> - <input type="hidden" name="id" value="<?php echo $id; ?>"/> - <input type="hidden" id="logout-type-selector" name="type" value="nojs"/> - <button type="submit" id="logout-all" name="ok" class="btn"><?php echo $this->t('{logout:logout_all}'); ?></button> - </form> - <form method="get" style="display:inline;" action="logout-iframe-done.php"> - <input type="hidden" name="id" value="<?php echo $id; ?>"/> - <button type="submit" name="cancel" class="btn"><?php echo $logoutCancelText; ?></button> - </form> - </div> +<div id="confirmation" style="margin-top: 1em"> + <p><?php echo $this->t('{logout:logout_all_question}'); ?> <br/></p> + <form id="startform" method="get" style="display:inline;" action="logout-iframe.php"> + <input type="hidden" name="id" value="<?php echo $id; ?>"/> + <input type="hidden" id="logout-type-selector" name="type" value="nojs"/> + <button type="submit" id="logout-all" name="ok" class="btn"> + <?php echo $this->t('{logout:logout_all}'); ?> + </button> + </form> + <form method="get" style="display:inline;" action="logout-iframe-done.php"> + <input type="hidden" name="id" value="<?php echo $id; ?>"/> + <button type="submit" name="cancel" class="btn"><?php echo $logoutCancelText; ?></button> + </form> +</div> <?php } else { if ($nFailed > 0) { @@ -149,9 +151,10 @@ $displayStyle = 'display: none;'; } echo '<div id="logout-failed-message" style="margin-top: 1em; border: 1px solid #ccc; padding: 1em; '. - 'background: #eaeaea;'.$displayStyle.'">'; - echo '<img src="/'.$this->data['baseurlpath'].'resources/icons/experience/gtk-dialog-warning.48x48.png" alt="" '. - 'style="float: left; margin-right: 5px;" />'; + 'background: #eaeaea;'.$displayStyle.'">'; + echo '<img src="/'.$this->data['baseurlpath']. + 'resources/icons/experience/gtk-dialog-warning.48x48.png" alt="" '. + 'style="float: left; margin-right: 5px;" />'; echo '<p>'.$this->t('{logout:failedsps}').'</p>'; echo '<form method="post" action="logout-iframe-done.php" id="failed-form" target="_top">'; echo '<input type="hidden" name="id" value="'.$id.'" />'; @@ -166,11 +169,11 @@ } echo '<p>'.$this->t('{logout:success}').'</p>'; ?> - <form method="post" action="logout-iframe-done.php" id="done-form" target="_top"> - <input type="hidden" name="id" value="<?php echo $id; ?>"/> - <button type="submit" name="continue" class="btn"><?php echo $this->t('{logout:return}'); ?></button> - </form> - </div> + <form method="post" action="logout-iframe-done.php" id="done-form" target="_top"> + <input type="hidden" name="id" value="<?php echo $id; ?>"/> + <button type="submit" name="continue" class="btn"><?php echo $this->t('{logout:return}'); ?></button> + </form> +</div> <?php if ($type === 'js') { foreach ($SPs as $assocId => $sp) { @@ -178,15 +181,15 @@ if ($sp['core:Logout-IFrame:State'] !== 'inprogress') { continue; } - assert('isset($sp["core:Logout-IFrame:URL"])'); + assert(isset($sp['core:Logout-IFrame:URL'])); echo '<iframe style="width:0; height:0; border:0;" src="'. - htmlspecialchars($sp['core:Logout-IFrame:URL']).'"></iframe>'; + htmlspecialchars($sp['core:Logout-IFrame:URL']).'"></iframe>'; } } } ?> - </div><!-- #content --> - </div><!-- #wrap --> + </div><!-- #content --> + </div><!-- #wrap --> <?php if ($type === 'embed') { $this->includeAtTemplateBase('includes/footer-embed.php'); diff --git a/vendor/simplesamlphp/simplesamlphp/modules/core/templates/no_cookie.tpl.php b/vendor/simplesamlphp/simplesamlphp/modules/core/templates/no_cookie.tpl.php index 40337a6d78..65bdd8ceff 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/core/templates/no_cookie.tpl.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/core/templates/no_cookie.tpl.php @@ -1,6 +1,6 @@ <?php -assert('array_key_exists("retryURL", $this->data)'); +assert(array_key_exists('retryURL', $this->data)); $retryURL = $this->data['retryURL']; $header = htmlspecialchars($this->t('{core:no_cookie:header}')); diff --git a/vendor/simplesamlphp/simplesamlphp/modules/core/templates/no_cookie.twig b/vendor/simplesamlphp/simplesamlphp/modules/core/templates/no_cookie.twig new file mode 100644 index 0000000000..7205318e2a --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/modules/core/templates/no_cookie.twig @@ -0,0 +1,13 @@ + +{% set pagetitle = '{core:no_cookie:header}'|trans %} +{% extends "base.twig" %} + +{% block content %} + <h2>{{ header }}</h2> + <p>{{ description }}</p> + {% if retryURL is not null %} + <ul> + <li><a href="{{ retryURL|escape('html') }}" id="retry">{{ retry }}</a></li> + </ul> + {% endif %} +{% endblock %} diff --git a/vendor/simplesamlphp/simplesamlphp/modules/core/templates/no_metadata.tpl.php b/vendor/simplesamlphp/simplesamlphp/modules/core/templates/no_metadata.tpl.php index d3b638b225..a00f3ce911 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/core/templates/no_metadata.tpl.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/core/templates/no_metadata.tpl.php @@ -1,9 +1,8 @@ <?php -echo('<p>' . $this->t('{core:no_metadata:config_problem}') . '</p>'); - -echo('<ul>'); -echo('<li>' . $this->t('{core:no_metadata:suggestion_user_link}') . '</li>'); -echo('<li>' . $this->t('{core:no_metadata:suggestion_developer}') . '</li>'); -echo('</ul>'); +echo '<p>'.$this->t('{core:no_metadata:config_problem}').'</p>'; +echo '<ul>'; +echo '<li>'.$this->t('{core:no_metadata:suggestion_user_link}').'</li>'; +echo '<li>'.$this->t('{core:no_metadata:suggestion_developer}').'</li>'; +echo '</ul>'; diff --git a/vendor/simplesamlphp/simplesamlphp/modules/core/templates/no_metadata.twig b/vendor/simplesamlphp/simplesamlphp/modules/core/templates/no_metadata.twig new file mode 100644 index 0000000000..0f534fcdab --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/modules/core/templates/no_metadata.twig @@ -0,0 +1,7 @@ +<p>{{ '{core:no_metadata:config_problem}'|trans }}</p> + +<ul> + <li>{{ '{core:no_metadata:suggestion_user_link}'|trans }}</li> + <li>{{ '{core:no_metadata:suggestion_developer}'|trans }}</li> +</ul> + diff --git a/vendor/simplesamlphp/simplesamlphp/modules/core/templates/no_state.tpl.php b/vendor/simplesamlphp/simplesamlphp/modules/core/templates/no_state.tpl.php index f86e346e0e..1327a4b2db 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/core/templates/no_state.tpl.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/core/templates/no_state.tpl.php @@ -1,15 +1,16 @@ <?php -echo('<h3>' . $this->t('{core:no_state:suggestions}') . '</h3>'); -echo('<ul>'); -echo('<li>' . $this->t('{core:no_state:suggestion_goback}') . '</li>'); -echo('<li>' . $this->t('{core:no_state:suggestion_closebrowser}') . '</li>'); -echo('</ul>'); - -echo('<h3>' . $this->t('{core:no_state:causes}') . '</h3>'); -echo('<ul>'); -echo('<li>' . $this->t('{core:no_state:cause_backforward}') . '</li>'); -echo('<li>' . $this->t('{core:no_state:cause_openbrowser}') . '</li>'); -echo('<li>' . $this->t('{core:no_state:cause_nocookie}') . '</li>'); -echo('</ul>'); +echo '<h3>'.$this->t('{core:no_state:suggestions}').'</h3>'; +echo '<ul>'; +echo '<li>'.$this->t('{core:no_state:suggestion_badlink}').'</li>'; +echo '<li>'.$this->t('{core:no_state:suggestion_goback}').'</li>'; +echo '<li>'.$this->t('{core:no_state:suggestion_closebrowser}').'</li>'; +echo '</ul>'; +echo '<h3>'.$this->t('{core:no_state:causes}').'</h3>'; +echo '<ul>'; +echo '<li>'.$this->t('{core:no_state:cause_badlink}').'</li>'; +echo '<li>'.$this->t('{core:no_state:cause_backforward}').'</li>'; +echo '<li>'.$this->t('{core:no_state:cause_openbrowser}').'</li>'; +echo '<li>'.$this->t('{core:no_state:cause_nocookie}').'</li>'; +echo '</ul>'; diff --git a/vendor/simplesamlphp/simplesamlphp/modules/core/templates/no_state.twig b/vendor/simplesamlphp/simplesamlphp/modules/core/templates/no_state.twig new file mode 100644 index 0000000000..25e8af4177 --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/modules/core/templates/no_state.twig @@ -0,0 +1,14 @@ +<h3>{{ '{core:no_state:suggestions}'|trans }}</h3> +<ul> + <li>{{ '{core:no_state:suggestion_badlink}'|trans }}</li> + <li>{{ '{core:no_state:suggestion_goback}'|trans }}</li> + <li>{{ '{core:no_state:suggestion_closebrowser}'|trans }}</li> +</ul> + +<h3>{{ '{core:no_state:causes}'|trans }}</h3> +<ul> + <li>{{ '{core:no_state:cause_badlink}'|trans }}</li> + <li>{{ '{core:no_state:cause_backforward}'|trans }}</li> + <li>{{ '{core:no_state:cause_openbrowser}'|trans }}</li> + <li>{{ '{core:no_state:cause_nocookie}'|trans }}</li> +</ul> diff --git a/vendor/simplesamlphp/simplesamlphp/modules/core/templates/short_sso_interval.php b/vendor/simplesamlphp/simplesamlphp/modules/core/templates/short_sso_interval.php index a50b3b82b7..2e305c2b9d 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/core/templates/short_sso_interval.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/core/templates/short_sso_interval.php @@ -14,27 +14,28 @@ $this->data['autofocus'] = 'contbutton'; $this->includeAtTemplateBase('includes/header.php'); +$target = htmlspecialchars($this->data['target']); +$contButton = htmlspecialchars($this->t('{core:short_sso_interval:retry}')); ?> <h1><?php echo $this->data['header']; ?></h1> -<form style="display: inline; margin: 0px; padding: 0px" action="<?php echo htmlspecialchars($this->data['target']); ?>"> +<form style="display: inline; margin: 0px; padding: 0px" action="<?php echo $target; ?>"> - <?php - // Embed hidden fields... - foreach ($this->data['params'] as $name => $value) { - echo('<input type="hidden" name="' . htmlspecialchars($name) . '" value="' . htmlspecialchars($value) . '" />'); - } - ?> - <p><?php echo $this->t('{core:short_sso_interval:warning}'); ?></p> +<?php +// Embed hidden fields... +foreach ($this->data['params'] as $name => $value) { + echo '<input type="hidden" name="'.htmlspecialchars($name).'" value="'.htmlspecialchars($value).'" />'; +} +?> + <p><?php echo $this->t('{core:short_sso_interval:warning}'); ?></p> <div class="trackidtext"><p> <?php echo $this->t('{errors:report_trackid}'); ?> <span class="trackid"><?php echo $this->data['trackId']; ?></span> </p> </div> - <input type="submit" name="continue" id="contbutton" value="<?php echo htmlspecialchars($this->t('{core:short_sso_interval:retry}')) ?>" /> + <input type="submit" name="continue" id="contbutton" value="<?php echo $contButton; ?>" /> </form> - <?php $this->includeAtTemplateBase('includes/footer.php'); diff --git a/vendor/simplesamlphp/simplesamlphp/modules/core/templates/short_sso_interval.twig b/vendor/simplesamlphp/simplesamlphp/modules/core/templates/short_sso_interval.twig new file mode 100644 index 0000000000..542e174c0a --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/modules/core/templates/short_sso_interval.twig @@ -0,0 +1,16 @@ +{% set pagetitle = 'SimpleSAMLphp'|trans %} +{% extends "base.twig" %} + +{% block content %} + <h1>{{ header }}</h1> + <form style="display: inline; margin: 0px; padding: 0px" action="{{ target|escape('html') }}"> + {% for name, value in params %} + <input type="hidden" name="{{ name|escape('html') }}" value="{{ value|escape('html') }}"> + {% endfor %} + <p>{{ '{core:short_sso_interval:warning}'|trans }}</p> + <div class="trackidtext"> + <p>{{ '{errors:report_trackid}'|trans }}<span class="trackid">{{ trackId }}</span></p> + </div> + <input type="submit" name="continue" id="contbutton" value="'{core:short_sso_interval:retry}'|trans|escape('html') }}" autofocus> + </form> +{% endblock %} diff --git a/vendor/simplesamlphp/simplesamlphp/modules/core/templates/show_metadata.tpl.php b/vendor/simplesamlphp/simplesamlphp/modules/core/templates/show_metadata.tpl.php index 9c5977e584..f217540c77 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/core/templates/show_metadata.tpl.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/core/templates/show_metadata.tpl.php @@ -13,7 +13,7 @@ </pre> </div> <script type="text/javascript"> - var clipboard = new Clipboard('#btncp'); + var clipboard = new ClipboardJS('#btncp'); </script> <br/> <p><a href="<?php echo $this->data['backlink']; ?>"><span class="btn">Back</span></a></p> diff --git a/vendor/simplesamlphp/simplesamlphp/modules/core/templates/show_metadata.twig b/vendor/simplesamlphp/simplesamlphp/modules/core/templates/show_metadata.twig new file mode 100644 index 0000000000..f39aee9fe3 --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/modules/core/templates/show_metadata.twig @@ -0,0 +1,18 @@ +{% set pagetile = 'SimpleSAMLphp Show Metadata'|trans %} +{% extends 'base.twig' %} +{% block content %} + <div class="code-box"> + <div class="code-box-title"> + <h3>{{ 'Metadata'|trans }}</h3> + <button data-clipboard-target="#metadata" id="btn{{ loop.index }}" class="pure-button right clipboard-btn copy"> + <span class="fa fa-copy"></span> + </button> + </div> + <div class="code-box-content"> + <pre id="metadata">$metadata[{{ entityid }}] => {{ metadata|escape }}</pre> + </div> + </div> + <div class="center"> + <a href="{{ backlink }}" class="pure-button pure-button-red">{{ 'Back'|trans }}</a> + </div> +{% endblock content %} diff --git a/vendor/simplesamlphp/simplesamlphp/modules/core/www/as_login.php b/vendor/simplesamlphp/simplesamlphp/modules/core/www/as_login.php index e43a77898b..d73fa8ca0b 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/core/www/as_login.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/core/www/as_login.php @@ -7,26 +7,26 @@ */ if (!isset($_REQUEST['ReturnTo'])) { - throw new SimpleSAML_Error_BadRequest('Missing ReturnTo parameter.'); + throw new \SimpleSAML\Error\BadRequest('Missing ReturnTo parameter.'); } if (!isset($_REQUEST['AuthId'])) { - throw new SimpleSAML_Error_BadRequest('Missing AuthId parameter.'); + throw new \SimpleSAML\Error\BadRequest('Missing AuthId parameter.'); } /* * Setting up the options for the requireAuth() call later.. */ -$options = array( - 'ReturnTo' => \SimpleSAML\Utils\HTTP::checkURLAllowed($_REQUEST['ReturnTo']), -); +$options = [ + 'ReturnTo' => \SimpleSAML\Utils\HTTP::checkURLAllowed($_REQUEST['ReturnTo']), +]; /* * Allows a saml:idp query string parameter specify the IdP entity ID to be used * as used by the DiscoJuice embedded client. */ if (!empty($_REQUEST['saml:idp'])) { - $options['saml:idp'] = $_REQUEST['saml:idp']; + $options['saml:idp'] = $_REQUEST['saml:idp']; } $as = new \SimpleSAML\Auth\Simple($_REQUEST['AuthId']); diff --git a/vendor/simplesamlphp/simplesamlphp/modules/core/www/as_logout.php b/vendor/simplesamlphp/simplesamlphp/modules/core/www/as_logout.php index bfd9234153..6fe7c95ada 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/core/www/as_logout.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/core/www/as_logout.php @@ -7,11 +7,11 @@ */ if (!isset($_REQUEST['ReturnTo']) || !is_string($_REQUEST['ReturnTo'])) { - throw new SimpleSAML_Error_BadRequest('Missing ReturnTo parameter.'); + throw new \SimpleSAML\Error\BadRequest('Missing ReturnTo parameter.'); } if (!isset($_REQUEST['AuthId']) || !is_string($_REQUEST['AuthId'])) { - throw new SimpleSAML_Error_BadRequest('Missing AuthId parameter.'); + throw new \SimpleSAML\Error\BadRequest('Missing AuthId parameter.'); } $as = new \SimpleSAML\Auth\Simple($_REQUEST['AuthId']); diff --git a/vendor/simplesamlphp/simplesamlphp/modules/core/www/assets/js/loginuserpass.js b/vendor/simplesamlphp/simplesamlphp/modules/core/www/assets/js/loginuserpass.js new file mode 100644 index 0000000000..5a3054627c --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/modules/core/www/assets/js/loginuserpass.js @@ -0,0 +1,7 @@ +$(document).ready(function () { + $('#submit_button').on('click', function () { + $(this).attr('disabled', 'disabled'); + $(this).html($(this).data('processing')); + $(this).parents('form').submit(); + }); +}); diff --git a/vendor/simplesamlphp/simplesamlphp/modules/core/www/authenticate.php b/vendor/simplesamlphp/simplesamlphp/modules/core/www/authenticate.php index c6932313b6..e1484e1fed 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/core/www/authenticate.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/core/www/authenticate.php @@ -1,11 +1,11 @@ <?php -$config = SimpleSAML_Configuration::getInstance(); +$config = \SimpleSAML\Configuration::getInstance(); if (!array_key_exists('as', $_REQUEST)) { - $t = new SimpleSAML_XHTML_Template($config, 'core:authsource_list.tpl.php'); + $t = new \SimpleSAML\XHTML\Template($config, 'core:authsource_list.tpl.php'); - $t->data['sources'] = SimpleSAML_Auth_Source::getSources(); + $t->data['sources'] = \SimpleSAML\Auth\Source::getSources(); $t->show(); exit(); } @@ -17,31 +17,33 @@ $as->logout($config->getBasePath().'logout.php'); } -if (array_key_exists(SimpleSAML_Auth_State::EXCEPTION_PARAM, $_REQUEST)) { +if (array_key_exists(\SimpleSAML\Auth\State::EXCEPTION_PARAM, $_REQUEST)) { // This is just a simple example of an error - $state = SimpleSAML_Auth_State::loadExceptionState(); - assert('array_key_exists(SimpleSAML_Auth_State::EXCEPTION_DATA, $state)'); - $e = $state[SimpleSAML_Auth_State::EXCEPTION_DATA]; + $state = \SimpleSAML\Auth\State::loadExceptionState(); + assert(array_key_exists(\SimpleSAML\Auth\State::EXCEPTION_DATA, $state)); + $e = $state[\SimpleSAML\Auth\State::EXCEPTION_DATA]; throw $e; } if (!$as->isAuthenticated()) { - $url = SimpleSAML\Module::getModuleURL('core/authenticate.php', array('as' => $asId)); - $params = array( + $url = \SimpleSAML\Module::getModuleURL('core/authenticate.php', ['as' => $asId]); + $params = [ 'ErrorURL' => $url, 'ReturnTo' => $url, - ); + ]; $as->login($params); } $attributes = $as->getAttributes(); +$authData = $as->getAuthDataArray(); -$t = new SimpleSAML_XHTML_Template($config, 'status.php', 'attributes'); +$t = new \SimpleSAML\XHTML\Template($config, 'status.php', 'attributes'); $t->data['header'] = '{status:header_saml20_sp}'; $t->data['attributes'] = $attributes; +$t->data['authData'] = $authData; $t->data['nameid'] = !is_null($as->getAuthData('saml:sp:NameID')) ? $as->getAuthData('saml:sp:NameID') : false; $t->data['logouturl'] = \SimpleSAML\Utils\HTTP::getSelfURLNoQuery().'?as='.urlencode($asId).'&logout'; $t->show(); diff --git a/vendor/simplesamlphp/simplesamlphp/modules/core/www/cardinality_error.php b/vendor/simplesamlphp/simplesamlphp/modules/core/www/cardinality_error.php new file mode 100644 index 0000000000..b3a3e5b99c --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/modules/core/www/cardinality_error.php @@ -0,0 +1,29 @@ +<?php + +/** + * Show a 403 Forbidden page when an attribute violates a cardinality rule + * + * @package SimpleSAMLphp + */ + +if (!array_key_exists('StateId', $_REQUEST)) { + throw new \SimpleSAML\Error\BadRequest('Missing required StateId query parameter.'); +} +$id = $_REQUEST['StateId']; +$state = \SimpleSAML\Auth\State::loadState($id, 'core:cardinality'); +$session = \SimpleSAML\Session::getSessionFromRequest(); + +\SimpleSAML\Logger::stats('core:cardinality:error '.$state['Destination']['entityid'].' '.$state['saml:sp:IdP']. + ' '.implode(',', array_keys($state['core:cardinality:errorAttributes']))); + +$globalConfig = \SimpleSAML\Configuration::getInstance(); +$t = new \SimpleSAML\XHTML\Template($globalConfig, 'core:cardinality_error.tpl.php'); +$t->data['cardinalityErrorAttributes'] = $state['core:cardinality:errorAttributes']; +if (isset($state['Source']['auth'])) { + $t->data['LogoutURL'] = \SimpleSAML\Module::getModuleURL( + 'core/authenticate.php', + ['as' => $state['Source']['auth']] + )."&logout"; +} +header('HTTP/1.0 403 Forbidden'); +$t->show(); diff --git a/vendor/simplesamlphp/simplesamlphp/modules/core/www/cleardiscochoices.php b/vendor/simplesamlphp/simplesamlphp/modules/core/www/cleardiscochoices.php index 3628a45315..f997f1607f 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/core/www/cleardiscochoices.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/core/www/cleardiscochoices.php @@ -7,31 +7,29 @@ */ // The base path for cookies. This should be the installation directory for SimpleSAMLphp. -$config = SimpleSAML_Configuration::getInstance(); +$config = \SimpleSAML\Configuration::getInstance(); $cookiePath = $config->getBasePath(); // We delete all cookies which starts with 'idpdisco_' -foreach($_COOKIE as $cookieName => $value) { - if (substr($cookieName, 0, 9) !== 'idpdisco_') { - /* Not a idpdisco cookie. */ - continue; - } - - /* Delete the cookie. We delete it once without the secure flag and once with the secure flag. This - * ensures that the cookie will be deleted in any case. - */ - \SimpleSAML\Utils\HTTP::setCookie($cookieName, NULL, array('path' => $cookiePath, 'httponly' => FALSE), FALSE); +foreach ($_COOKIE as $cookieName => $value) { + if (substr($cookieName, 0, 9) !== 'idpdisco_') { + // Not a idpdisco cookie. + continue; + } + + /* Delete the cookie. We delete it once without the secure flag and once with the secure flag. This + * ensures that the cookie will be deleted in any case. + */ + \SimpleSAML\Utils\HTTP::setCookie($cookieName, null, ['path' => $cookiePath, 'httponly' => false], false); } - -/* Find where we should go now. */ -if(array_key_exists('ReturnTo', $_REQUEST)) { - $returnTo = \SimpleSAML\Utils\HTTP::checkURLAllowed($_REQUEST['ReturnTo']); +// Find where we should go now. +if (array_key_exists('ReturnTo', $_REQUEST)) { + $returnTo = \SimpleSAML\Utils\HTTP::checkURLAllowed($_REQUEST['ReturnTo']); } else { - /* Return to the front page if no other destination is given. This is the same as the base cookie path. */ - $returnTo = $cookiePath; + // Return to the front page if no other destination is given. This is the same as the base cookie path. + $returnTo = $cookiePath; } -/* Redirect to destination. */ +// Redirect to destination. \SimpleSAML\Utils\HTTP::redirectTrustedURL($returnTo); - diff --git a/vendor/simplesamlphp/simplesamlphp/modules/core/www/frontpage_auth.php b/vendor/simplesamlphp/simplesamlphp/modules/core/www/frontpage_auth.php index 59e0ee8a5d..a3bf112e15 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/core/www/frontpage_auth.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/core/www/frontpage_auth.php @@ -1,57 +1,48 @@ <?php - -// Load SimpleSAMLphp, configuration -$config = SimpleSAML_Configuration::getInstance(); -$session = SimpleSAML_Session::getSessionFromRequest(); +// Load SimpleSAMLphp configuration +$config = \SimpleSAML\Configuration::getInstance(); +$session = \SimpleSAML\Session::getSessionFromRequest(); // Check if valid local session exists if ($config->getBoolean('admin.protectindexpage', false)) { - SimpleSAML\Utils\Auth::requireAdmin(); + \SimpleSAML\Utils\Auth::requireAdmin(); } -$loginurl = SimpleSAML\Utils\Auth::getAdminLoginURL(); -$isadmin = SimpleSAML\Utils\Auth::isAdmin(); - - - - - -$links = array(); -$links_welcome = array(); -$links_config = array(); -$links_auth = array(); -$links_federation = array(); - - -$links_auth[] = array( - 'href' => 'authenticate.php', - 'text' => '{core:frontpage:authtest}', -); - -$allLinks = array( - 'links' => &$links, - 'welcome' => &$links_welcome, - 'config' => &$links_config, - 'auth' => &$links_auth, - 'federation' => &$links_federation, -); -SimpleSAML\Module::callHooks('frontpage', $allLinks); - - - -$t = new SimpleSAML_XHTML_Template($config, 'core:frontpage_auth.tpl.php'); +$loginurl = \SimpleSAML\Utils\Auth::getAdminLoginURL(); +$isadmin = \SimpleSAML\Utils\Auth::isAdmin(); +$logouturl = \SimpleSAML\Utils\Auth::getAdminLogoutURL(); + +$links = []; +$links_welcome = []; +$links_config = []; +$links_auth = []; +$links_federation = []; + +$links_auth[] = [ + 'href' => 'authenticate.php', + 'text' => '{core:frontpage:authtest}', +]; + +$allLinks = [ + 'links' => &$links, + 'welcome' => &$links_welcome, + 'config' => &$links_config, + 'auth' => &$links_auth, + 'federation' => &$links_federation, +]; +\SimpleSAML\Module::callHooks('frontpage', $allLinks); + +$t = new \SimpleSAML\XHTML\Template($config, 'core:frontpage_auth.tpl.php'); $t->data['pageid'] = 'frontpage_auth'; $t->data['isadmin'] = $isadmin; $t->data['loginurl'] = $loginurl; +$t->data['logouturl'] = $logouturl; +$t->data['header'] = $t->getTranslator()->t('{core:frontpage:page_title}'); $t->data['links'] = $links; $t->data['links_welcome'] = $links_welcome; $t->data['links_config'] = $links_config; $t->data['links_auth'] = $links_auth; $t->data['links_federation'] = $links_federation; - - $t->show(); - - diff --git a/vendor/simplesamlphp/simplesamlphp/modules/core/www/frontpage_config.php b/vendor/simplesamlphp/simplesamlphp/modules/core/www/frontpage_config.php index 776b9e074c..172b75c4cb 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/core/www/frontpage_config.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/core/www/frontpage_config.php @@ -1,179 +1,184 @@ <?php - - -// Load SimpleSAMLphp, configuration -$config = SimpleSAML_Configuration::getInstance(); -$session = SimpleSAML_Session::getSessionFromRequest(); +// Load SimpleSAMLphp configuration +$config = \SimpleSAML\Configuration::getInstance(); +$session = \SimpleSAML\Session::getSessionFromRequest(); // Check if valid local session exists. if ($config->getBoolean('admin.protectindexpage', false)) { - SimpleSAML\Utils\Auth::requireAdmin(); + \SimpleSAML\Utils\Auth::requireAdmin(); } -$loginurl = SimpleSAML\Utils\Auth::getAdminLoginURL(); -$isadmin = SimpleSAML\Utils\Auth::isAdmin(); - +$loginurl = \SimpleSAML\Utils\Auth::getAdminLoginURL(); +$isadmin = \SimpleSAML\Utils\Auth::isAdmin(); +$logouturl = \SimpleSAML\Utils\Auth::getAdminLogoutURL(); -$warnings = array(); +$warnings = []; if (!\SimpleSAML\Utils\HTTP::isHTTPS()) { - $warnings[] = '{core:frontpage:warnings_https}'; + $warnings[] = '{core:frontpage:warnings_https}'; } if ($config->getValue('secretsalt') === 'defaultsecretsalt') { - $warnings[] = '{core:frontpage:warnings_secretsalt}'; + $warnings[] = '{core:frontpage:warnings_secretsalt}'; } if (extension_loaded('suhosin')) { - $suhosinLength = ini_get('suhosin.get.max_value_length'); - if (empty($suhosinLength) || (int)$suhosinLength < 2048) { - $warnings[] = '{core:frontpage:warnings_suhosin_url_length}'; - } + $suhosinLength = ini_get('suhosin.get.max_value_length'); + if (empty($suhosinLength) || (int) $suhosinLength < 2048) { + $warnings[] = '{core:frontpage:warnings_suhosin_url_length}'; + } } - - - - -$links = array(); -$links_welcome = array(); -$links_config = array(); -$links_auth = array(); -$links_federation = array(); - - - -$links_config[] = array( - 'href' => \SimpleSAML\Utils\HTTP::getBaseURL() . 'admin/hostnames.php', - 'text' => '{core:frontpage:link_diagnostics}' -); - -$links_config[] = array( - 'href' => \SimpleSAML\Utils\HTTP::getBaseURL() . 'admin/phpinfo.php', - 'text' => '{core:frontpage:link_phpinfo}' -); - -$allLinks = array( - 'links' => &$links, - 'welcome' => &$links_welcome, - 'config' => &$links_config, - 'auth' => &$links_auth, - 'federation' => &$links_federation, -); -SimpleSAML\Module::callHooks('frontpage', $allLinks); +$links = []; +$links_welcome = []; +$links_config = []; +$links_auth = []; +$links_federation = []; + +$links_config[] = [ + 'href' => \SimpleSAML\Utils\HTTP::getBaseURL().'admin/hostnames.php', + 'text' => '{core:frontpage:link_diagnostics}' +]; + +$links_config[] = [ + 'href' => \SimpleSAML\Utils\HTTP::getBaseURL().'admin/phpinfo.php', + 'text' => '{core:frontpage:link_phpinfo}' +]; + +$allLinks = [ + 'links' => &$links, + 'welcome' => &$links_welcome, + 'config' => &$links_config, + 'auth' => &$links_auth, + 'federation' => &$links_federation, +]; +\SimpleSAML\Module::callHooks('frontpage', $allLinks); +\SimpleSAML\Logger::debug('The "frontpage" hook has been deprecated for the configuration page. Implement the '. + '"configpage" hook instead.'); // Check for updates. Store the remote result in the session so we // don't need to fetch it on every access to this page. $current = $config->getVersion(); if ($config->getBoolean('admin.checkforupdates', true) && $current !== 'master') { - $latest = $session->getData("core:latest_simplesamlphp_version", "version"); - - if (!$latest) { - $api_url = 'https://api.github.com/repos/simplesamlphp/simplesamlphp/releases'; - $ch = curl_init($api_url.'/latest'); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); - curl_setopt($ch, CURLOPT_USERAGENT, 'SimpleSAMLphp'); - curl_setopt($ch, CURLOPT_TIMEOUT, 2); - $response = curl_exec($ch); - - if (curl_getinfo($ch, CURLINFO_HTTP_CODE) === 200) { - $latest = json_decode($response, true); - $session->setData("core:latest_simplesamlphp_version", "version", $latest); - } - curl_close($ch); - } - - if ($latest && version_compare($current, ltrim($latest['tag_name'], 'v'), 'lt')) { - $outdated = true; - $warnings[] = array( - '{core:frontpage:warnings_outdated}', - array('%LATEST_URL%' => $latest['html_url']) - ); - } + if (!function_exists('curl_init')) { + $warnings[] = '{core:frontpage:warnings_curlmissing}'; + } else { + $latest = $session->getData("core:latest_simplesamlphp_version", "version"); + + if (!$latest) { + $api_url = 'https://api.github.com/repos/simplesamlphp/simplesamlphp/releases'; + $ch = curl_init($api_url.'/latest'); + curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); + curl_setopt($ch, CURLOPT_USERAGENT, 'SimpleSAMLphp'); + curl_setopt($ch, CURLOPT_TIMEOUT, 2); + curl_setopt($ch, CURLOPT_PROXY, $config->getString('proxy', null)); + curl_setopt($ch, CURLOPT_PROXYUSERPWD, $config->getValue('proxy.auth', null)); + $response = curl_exec($ch); + + if (curl_getinfo($ch, CURLINFO_HTTP_CODE) === 200) { + $latest = json_decode($response, true); + $session->setData("core:latest_simplesamlphp_version", "version", $latest); + } + curl_close($ch); + } + + if ($latest && version_compare($current, ltrim($latest['tag_name'], 'v'), 'lt')) { + $outdated = true; + $warnings[] = [ + '{core:frontpage:warnings_outdated}', + ['%LATEST_URL%' => $latest['html_url']] + ]; + } + } } -$enablematrix = array( - 'saml20-idp' => $config->getBoolean('enable.saml20-idp', false), - 'shib13-idp' => $config->getBoolean('enable.shib13-idp', false), -); - - -$functionchecks = array( - 'time' => array('required', 'Date/Time Extension'), - 'hash' => array('required', 'Hashing function'), - 'gzinflate' => array('required', 'ZLib'), - 'openssl_sign' => array('required', 'OpenSSL'), - 'dom_import_simplexml' => array('required', 'XML DOM'), - 'preg_match' => array('required', 'RegEx support'), - 'json_decode' => array('required', 'JSON support'), - 'class_implements' => array('required', 'Standard PHP Library (SPL)'), - 'mb_strlen' => array('required', 'Multibyte String Extension'), - 'curl_init' => array('optional', 'cURL (required if automatic version checks are used, also by some modules.'), - 'session_start' => array('optional', 'Session Extension (required if PHP sessions are used)'), - 'pdo_drivers' => array('optional', 'PDO Extension (required if a database backend is used)'), -); -if (SimpleSAML\Module::isModuleEnabled('ldap')) { - $functionchecks['ldap_bind'] = array('optional', 'LDAP Extension (required if an LDAP backend is used)'); +$enablematrix = [ + 'saml20idp' => $config->getBoolean('enable.saml20-idp', false), + 'shib13idp' => $config->getBoolean('enable.shib13-idp', false), +]; + + +$functionchecks = [ + 'time' => ['required', 'Date/Time Extension'], + 'hash' => ['required', 'Hashing function'], + 'gzinflate' => ['required', 'ZLib'], + 'openssl_sign' => ['required', 'OpenSSL'], + 'dom_import_simplexml' => ['required', 'XML DOM'], + 'preg_match' => ['required', 'RegEx support'], + 'json_decode' => ['required', 'JSON support'], + 'class_implements' => ['required', 'Standard PHP Library (SPL)'], + 'mb_strlen' => ['required', 'Multibyte String Extension'], + 'curl_init' => ['optional', 'cURL (required if automatic version checks are used, also by some modules.'], + 'session_start' => ['optional', 'Session Extension (required if PHP sessions are used)'], + 'pdo_drivers' => ['optional', 'PDO Extension (required if a database backend is used)'], +]; +if (\SimpleSAML\Module::isModuleEnabled('ldap')) { + $functionchecks['ldap_bind'] = ['optional', 'LDAP Extension (required if an LDAP backend is used)']; } -if (SimpleSAML\Module::isModuleEnabled('radius')) { - $functionchecks['radius_auth_open'] = array('optional', 'Radius Extension (required if a Radius backend is used)'); +if (\SimpleSAML\Module::isModuleEnabled('radius')) { + $functionchecks['radius_auth_open'] = ['optional', 'Radius Extension (required if a Radius backend is used)']; } -$funcmatrix = array(); -$funcmatrix[] = array( - 'required' => 'required', - 'descr' => 'PHP Version >= 5.4. You run: ' . phpversion(), - 'enabled' => version_compare(phpversion(), '5.4', '>=')); -foreach ($functionchecks AS $func => $descr) { - $funcmatrix[] = array('descr' => $descr[1], 'required' => $descr[0], 'enabled' => function_exists($func)); +$funcmatrix = []; +$funcmatrix[] = [ + 'required' => 'required', + 'descr' => 'PHP Version >= 5.5. You run: '.phpversion(), + 'enabled' => version_compare(phpversion(), '5.5', '>=') +]; +foreach ($functionchecks as $func => $descr) { + $funcmatrix[] = ['descr' => $descr[1], 'required' => $descr[0], 'enabled' => function_exists($func)]; } -$funcmatrix[] = array( +$funcmatrix[] = [ 'required' => 'optional', 'descr' => 'predis/predis (required if the redis data store is used)', 'enabled' => class_exists('\Predis\Client'), -); +]; -$funcmatrix[] = array( +$funcmatrix[] = [ 'required' => 'optional', 'descr' => 'Memcache or Memcached Extension (required if a Memcached backend is used)', 'enabled' => class_exists('Memcache') || class_exists('Memcached'), -); +]; -/* Some basic configuration checks */ +// Some basic configuration checks -if($config->getString('technicalcontact_email', 'na@example.org') === 'na@example.org') { - $mail_ok = FALSE; +if ($config->getString('technicalcontact_email', 'na@example.org') === 'na@example.org') { + $mail_ok = false; } else { - $mail_ok = TRUE; + $mail_ok = true; } -$funcmatrix[] = array( - 'required' => 'recommended', - 'descr' => 'technicalcontact_email option set', - 'enabled' => $mail_ok - ); -if($config->getString('auth.adminpassword', '123') === '123') { - $password_ok = FALSE; +$funcmatrix[] = [ + 'required' => 'recommended', + 'descr' => 'technicalcontact_email option set', + 'enabled' => $mail_ok +]; +if ($config->getString('auth.adminpassword', '123') === '123') { + $password_ok = false; } else { - $password_ok = TRUE; + $password_ok = true; } -$funcmatrix[] = array( - 'required' => 'required', - 'descr' => 'auth.adminpassword option set', - 'enabled' => $password_ok -); - -$funcmatrix[] = array( - 'required' => 'recommended', - 'descr' => 'Magic Quotes should be turned off', - 'enabled' => (get_magic_quotes_runtime() == 0) -); - - -$t = new SimpleSAML_XHTML_Template($config, 'core:frontpage_config.tpl.php'); +$funcmatrix[] = [ + 'required' => 'required', + 'descr' => 'auth.adminpassword option set', + 'enabled' => $password_ok +]; + +$t = new \SimpleSAML\XHTML\Template($config, 'core:frontpage_config.tpl.php'); +$translator = $t->getTranslator(); $t->data['pageid'] = 'frontpage_config'; +$t->data['header'] = $translator->t('{core:frontpage:page_title}'); $t->data['isadmin'] = $isadmin; $t->data['loginurl'] = $loginurl; +$t->data['logouturl'] = $logouturl; + +foreach ($warnings as &$warning) { + if (is_array($warning)) { + $warning = $translator->t($warning[0], $warning[1]); + } else { + $warning = $translator->t($warning); + } +} $t->data['warnings'] = $warnings; @@ -184,17 +189,14 @@ $t->data['links_federation'] = $links_federation; - $t->data['enablematrix'] = $enablematrix; $t->data['funcmatrix'] = $funcmatrix; -$t->data['requiredmap'] = array( - 'recommended' => $t->noop('{core:frontpage:recommended}'), - 'required' => $t->noop('{core:frontpage:required}'), - 'optional' => $t->noop('{core:frontpage:optional}'), -); +$t->data['requiredmap'] = [ + 'recommended' => $translator->noop('{core:frontpage:recommended}'), + 'required' => $translator->noop('{core:frontpage:required}'), + 'optional' => $translator->noop('{core:frontpage:optional}'), +]; $t->data['version'] = $config->getVersion(); $t->data['directory'] = dirname(dirname(dirname(dirname(__FILE__)))); $t->show(); - - diff --git a/vendor/simplesamlphp/simplesamlphp/modules/core/www/frontpage_federation.php b/vendor/simplesamlphp/simplesamlphp/modules/core/www/frontpage_federation.php index 80f8aa7eda..267a54a53f 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/core/www/frontpage_federation.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/core/www/frontpage_federation.php @@ -1,154 +1,175 @@ <?php - - -// Load SimpleSAMLphp, configuration -$config = SimpleSAML_Configuration::getInstance(); -$session = SimpleSAML_Session::getSessionFromRequest(); +// Load SimpleSAMLphp configuration +$config = \SimpleSAML\Configuration::getInstance(); +$session = \SimpleSAML\Session::getSessionFromRequest(); // Check if valid local session exists. if ($config->getBoolean('admin.protectindexpage', false)) { - SimpleSAML\Utils\Auth::requireAdmin(); + \SimpleSAML\Utils\Auth::requireAdmin(); } -$loginurl = SimpleSAML\Utils\Auth::getAdminLoginURL(); -$isadmin = SimpleSAML\Utils\Auth::isAdmin(); - - - - - - - -$links = array(); -$links_welcome = array(); -$links_config = array(); -$links_auth = array(); -$links_federation = array(); - - - - -if($config->getBoolean('idpdisco.enableremember', FALSE)) { - $links_federation[] = array( - 'href' => 'cleardiscochoices.php', - 'text' => '{core:frontpage:link_cleardiscochoices}', - ); +$logouturl = \SimpleSAML\Utils\Auth::getAdminLogoutURL(); +$loginurl = \SimpleSAML\Utils\Auth::getAdminLoginURL(); +$isadmin = \SimpleSAML\Utils\Auth::isAdmin(); + +$links = []; +$links_welcome = []; +$links_config = []; +$links_auth = []; +$links_federation = []; + +if ($config->getBoolean('idpdisco.enableremember', false)) { + $links_federation[] = [ + 'href' => 'cleardiscochoices.php', + 'text' => '{core:frontpage:link_cleardiscochoices}', + ]; } -$links_federation[] = array( - 'href' => \SimpleSAML\Utils\HTTP::getBaseURL() . 'admin/metadata-converter.php', - 'text' => '{core:frontpage:link_xmlconvert}', -); - - - - -$allLinks = array( - 'links' => &$links, - 'welcome' => &$links_welcome, - 'config' => &$links_config, - 'auth' => &$links_auth, - 'federation' => &$links_federation, -); -SimpleSAML\Module::callHooks('frontpage', $allLinks); - - -$metadataHosted = array(); -SimpleSAML\Module::callHooks('metadata_hosted', $metadataHosted); +$links_federation[] = [ + 'href' => \SimpleSAML\Utils\HTTP::getBaseURL().'admin/metadata-converter.php', + 'text' => '{core:frontpage:link_xmlconvert}', +]; +$allLinks = [ + 'links' => &$links, + 'welcome' => &$links_welcome, + 'config' => &$links_config, + 'auth' => &$links_auth, + 'federation' => &$links_federation, +]; +\SimpleSAML\Module::callHooks('frontpage', $allLinks); +$metadataHosted = []; +\SimpleSAML\Module::callHooks('metadata_hosted', $metadataHosted); +$metadata = \SimpleSAML\Metadata\MetaDataStorageHandler::getMetadataHandler(); - - - -$metadata = SimpleSAML_Metadata_MetaDataStorageHandler::getMetadataHandler(); - -$metaentries = array('hosted' => $metadataHosted, 'remote' => array() ); +$metaentries = ['hosted' => $metadataHosted, 'remote' => []]; if ($isadmin) { - $metaentries['remote']['saml20-idp-remote'] = $metadata->getList('saml20-idp-remote'); - $metaentries['remote']['shib13-idp-remote'] = $metadata->getList('shib13-idp-remote'); + $metaentries['remote']['saml20-idp-remote'] = $metadata->getList('saml20-idp-remote'); + $metaentries['remote']['shib13-idp-remote'] = $metadata->getList('shib13-idp-remote'); } -if ($config->getBoolean('enable.saml20-idp', FALSE) === true) { - try { - $metaentries['hosted']['saml20-idp'] = $metadata->getMetaDataCurrent('saml20-idp-hosted'); - $metaentries['hosted']['saml20-idp']['metadata-url'] = $config->getBasePath() . - 'saml2/idp/metadata.php?output=xhtml'; - if ($isadmin) - $metaentries['remote']['saml20-sp-remote'] = $metadata->getList('saml20-sp-remote'); - } catch(Exception $e) { - SimpleSAML\Logger::error('Federation: Error loading saml20-idp: ' . $e->getMessage()); +if ($config->getBoolean('enable.saml20-idp', false) === true) { + try { + $metaentries['hosted']['saml20-idp'] = $metadata->getMetaDataCurrent('saml20-idp-hosted'); + $metaentries['hosted']['saml20-idp']['metadata-url'] = + $config->getBasePath().'saml2/idp/metadata.php?output=xhtml'; + if ($isadmin) { + $metaentries['remote']['saml20-sp-remote'] = $metadata->getList('saml20-sp-remote'); + } + } catch (Exception $e) { + \SimpleSAML\Logger::error('Federation: Error loading saml20-idp: '.$e->getMessage()); } } -if ($config->getBoolean('enable.shib13-idp', FALSE) === true) { - try { - $metaentries['hosted']['shib13-idp'] = $metadata->getMetaDataCurrent('shib13-idp-hosted'); - $metaentries['hosted']['shib13-idp']['metadata-url'] = $config->getBasePath() . - 'shib13/idp/metadata.php?output=xhtml'; - if ($isadmin) - $metaentries['remote']['shib13-sp-remote'] = $metadata->getList('shib13-sp-remote'); - } catch(Exception $e) { - SimpleSAML\Logger::error('Federation: Error loading shib13-idp: ' . $e->getMessage()); +if ($config->getBoolean('enable.shib13-idp', false) === true) { + try { + $metaentries['hosted']['shib13-idp'] = $metadata->getMetaDataCurrent('shib13-idp-hosted'); + $metaentries['hosted']['shib13-idp']['metadata-url'] = + $config->getBasePath().'shib13/idp/metadata.php?output=xhtml'; + if ($isadmin) { + $metaentries['remote']['shib13-sp-remote'] = $metadata->getList('shib13-sp-remote'); + } + } catch (Exception $e) { + \SimpleSAML\Logger::error('Federation: Error loading shib13-idp: '.$e->getMessage()); } } -if ($config->getBoolean('enable.adfs-idp', FALSE) === true) { +if ($config->getBoolean('enable.adfs-idp', false) === true) { try { $metaentries['hosted']['adfs-idp'] = $metadata->getMetaDataCurrent('adfs-idp-hosted'); - $metaentries['hosted']['adfs-idp']['metadata-url'] = SimpleSAML\Module::getModuleURL('adfs/idp/metadata.php', - array('output' => 'xhtml')); - if ($isadmin) + $metaentries['hosted']['adfs-idp']['metadata-url'] = \SimpleSAML\Module::getModuleURL( + 'adfs/idp/metadata.php', + ['output' => 'xhtml'] + ); + if ($isadmin) { $metaentries['remote']['adfs-sp-remote'] = $metadata->getList('adfs-sp-remote'); - } catch(Exception $e) { - SimpleSAML\Logger::error('Federation: Error loading adfs-idp: ' . $e->getMessage()); + } + } catch (Exception $e) { + \SimpleSAML\Logger::error('Federation: Error loading adfs-idp: '.$e->getMessage()); } } foreach ($metaentries['remote'] as $key => $value) { - if (empty($value)) { - unset($metaentries['remote'][$key]); - } + if (empty($value)) { + unset($metaentries['remote'][$key]); + } } -$t = new SimpleSAML_XHTML_Template($config, 'core:frontpage_federation.tpl.php'); +$t = new \SimpleSAML\XHTML\Template($config, 'core:frontpage_federation.tpl.php'); +$translator = $t->getTranslator(); + +$language = $translator->getLanguage()->getLanguage(); +$fallbackLanguage = 'en'; +$defaultLanguage = $config->getString('language.default', $fallbackLanguage); + +$translators = [ + 'name' => 'name_translated', + 'descr' => 'descr_translated', + 'OrganizationDisplayName' => 'organizationdisplayname_translated', +]; + +foreach ($metaentries['hosted'] as $index => $entity) { + foreach ($translators as $old => $new) { + if (isset($entity[$old][$language])) { + $metaentries['hosted'][$index][$new] = $entity[$old][$language]; + } elseif (isset($entity[$old][$defaultLanguage])) { + $metaentries['hosted'][$index][$new] = $entity[$old][$defaultLanguage]; + } elseif (isset($entity[$old][$fallbackLanguage])) { + $metaentries['hosted'][$index][$new] = $entity[$old][$fallbackLanguage]; + } + } +} +foreach ($metaentries['remote'] as $key => $set) { + foreach ($set as $entityid => $entity) { + foreach ($translators as $old => $new) { + if (isset($entity[$old][$language])) { + $metaentries['remote'][$key][$entityid][$new] = $entity[$old][$language]; + } elseif (isset($entity[$old][$defaultLanguage])) { + $metaentries['remote'][$key][$entityid][$new] = $entity[$old][$defaultLanguage]; + } elseif (isset($entity[$old][$fallbackLanguage])) { + $metaentries['remote'][$key][$entityid][$new] = $entity[$old][$fallbackLanguage]; + } elseif (isset($metaentries['remote'][$key][$entityid][$old])) { + $metaentries['remote'][$key][$entityid][$new] = $metaentries['remote'][$key][$entityid][$old]; + } + } + } +} # look up translated string -$mtype = array( - 'saml20-sp-remote' => $t->noop('{admin:metadata_saml20-sp}'), - 'saml20-sp-hosted' => $t->noop('{admin:metadata_saml20-sp}'), - 'saml20-idp-remote' => $t->noop('{admin:metadata_saml20-idp}'), - 'saml20-idp-hosted' => $t->noop('{admin:metadata_saml20-idp}'), - 'shib13-sp-remote' => $t->noop('{admin:metadata_shib13-sp}'), - 'shib13-sp-hosted' => $t->noop('{admin:metadata_shib13-sp}'), - 'shib13-idp-remote' => $t->noop('{admin:metadata_shib13-idp}'), - 'shib13-idp-hosted' => $t->noop('{admin:metadata_shib13-idp}'), - 'adfs-sp-remote' => $t->noop('{admin:metadata_adfs-sp}'), - 'adfs-sp-hosted' => $t->noop('{admin:metadata_adfs-sp}'), - 'adfs-idp-remote' => $t->noop('{admin:metadata_adfs-idp}'), - 'adfs-idp-hosted' => $t->noop('{admin:metadata_adfs-idp}'), -); +$mtype = [ + 'saml20-sp-remote' => $translator->noop('{admin:metadata_saml20-sp}'), + 'saml20-sp-hosted' => $translator->noop('{admin:metadata_saml20-sp}'), + 'saml20-idp-remote' => $translator->noop('{admin:metadata_saml20-idp}'), + 'saml20-idp-hosted' => $translator->noop('{admin:metadata_saml20-idp}'), + 'shib13-sp-remote' => $translator->noop('{admin:metadata_shib13-sp}'), + 'shib13-sp-hosted' => $translator->noop('{admin:metadata_shib13-sp}'), + 'shib13-idp-remote' => $translator->noop('{admin:metadata_shib13-idp}'), + 'shib13-idp-hosted' => $translator->noop('{admin:metadata_shib13-idp}'), + 'adfs-sp-remote' => $translator->noop('{admin:metadata_adfs-sp}'), + 'adfs-sp-hosted' => $translator->noop('{admin:metadata_adfs-sp}'), + 'adfs-idp-remote' => $translator->noop('{admin:metadata_adfs-idp}'), + 'adfs-idp-hosted' => $translator->noop('{admin:metadata_adfs-idp}'), +]; $t->data['pageid'] = 'frontpage_federation'; $t->data['isadmin'] = $isadmin; $t->data['loginurl'] = $loginurl; - +$t->data['logouturl'] = $logouturl; $t->data['links'] = $links; $t->data['links_welcome'] = $links_welcome; $t->data['links_config'] = $links_config; $t->data['links_auth'] = $links_auth; $t->data['links_federation'] = $links_federation; +$t->data['header'] = $translator->t('{core:frontpage:page_title}'); - - +$t->data['metadata_url'] = \SimpleSAML\Module::getModuleURL('core/show_metadata.php'); $t->data['metaentries'] = $metaentries; $t->data['mtype'] = $mtype; - $t->show(); - diff --git a/vendor/simplesamlphp/simplesamlphp/modules/core/www/frontpage_welcome.php b/vendor/simplesamlphp/simplesamlphp/modules/core/www/frontpage_welcome.php index abeeecea12..4dfb4fef19 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/core/www/frontpage_welcome.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/core/www/frontpage_welcome.php @@ -1,66 +1,49 @@ <?php - -// Load SimpleSAMLphp, configuration -$config = SimpleSAML_Configuration::getInstance(); -$session = SimpleSAML_Session::getSessionFromRequest(); +// Load SimpleSAMLphp configuration +$config = \SimpleSAML\Configuration::getInstance(); +$session = \SimpleSAML\Session::getSessionFromRequest(); // Check if valid local session exists. if ($config->getBoolean('admin.protectindexpage', false)) { SimpleSAML\Utils\Auth::requireAdmin(); } -$loginurl = SimpleSAML\Utils\Auth::getAdminLoginURL(); -$isadmin = SimpleSAML\Utils\Auth::isAdmin(); - - - - - -$links = array(); -$links_welcome = array(); -$links_config = array(); -$links_auth = array(); -$links_federation = array(); - - - -$allLinks = array( - 'links' => &$links, - 'welcome' => &$links_welcome, - 'config' => &$links_config, - 'auth' => &$links_auth, - 'federation' => &$links_federation, -); - -$links_welcome[] = array( - 'href' => 'https://simplesamlphp.org/docs/stable/', - 'text' => '{core:frontpage:doc_header}', -); - -SimpleSAML\Module::callHooks('frontpage', $allLinks); - - - - - - - - - -$t = new SimpleSAML_XHTML_Template($config, 'core:frontpage_welcome.tpl.php'); +$logouturl = \SimpleSAML\Utils\Auth::getAdminLogoutURL(); +$loginurl = \SimpleSAML\Utils\Auth::getAdminLoginURL(); +$isadmin = \SimpleSAML\Utils\Auth::isAdmin(); + +$links = []; +$links_welcome = []; +$links_config = []; +$links_auth = []; +$links_federation = []; + +$allLinks = [ + 'links' => &$links, + 'welcome' => &$links_welcome, + 'config' => &$links_config, + 'auth' => &$links_auth, + 'federation' => &$links_federation, +]; + +$links_welcome[] = [ + 'href' => 'https://simplesamlphp.org/docs/stable/', + 'text' => '{core:frontpage:doc_header}', +]; + +\SimpleSAML\Module::callHooks('frontpage', $allLinks); + +$t = new \SimpleSAML\XHTML\Template($config, 'core:frontpage_welcome.tpl.php'); $t->data['pageid'] = 'frontpage_welcome'; $t->data['isadmin'] = $isadmin; $t->data['loginurl'] = $loginurl; +$t->data['logouturl'] = $logouturl; $t->data['links'] = $links; $t->data['links_welcome'] = $links_welcome; $t->data['links_config'] = $links_config; $t->data['links_auth'] = $links_auth; $t->data['links_federation'] = $links_federation; - - - +$t->data['header'] = $t->getTranslator()->t('{core:frontpage:page_title}'); $t->show(); - - diff --git a/vendor/simplesamlphp/simplesamlphp/modules/core/www/idp/logout-iframe-done.php b/vendor/simplesamlphp/simplesamlphp/modules/core/www/idp/logout-iframe-done.php index 6b00621b84..7725754e48 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/core/www/idp/logout-iframe-done.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/core/www/idp/logout-iframe-done.php @@ -1,22 +1,22 @@ <?php if (!isset($_REQUEST['id'])) { - throw new SimpleSAML_Error_BadRequest('Missing required parameter: id'); + throw new \SimpleSAML\Error\BadRequest('Missing required parameter: id'); } -$state = SimpleSAML_Auth_State::loadState($_REQUEST['id'], 'core:Logout-IFrame'); -$idp = SimpleSAML_IdP::getByState($state); +$state = \SimpleSAML\Auth\State::loadState($_REQUEST['id'], 'core:Logout-IFrame'); +$idp = \SimpleSAML\IdP::getByState($state); $associations = $idp->getAssociations(); if (!isset($_REQUEST['cancel'])) { - SimpleSAML\Logger::stats('slo-iframe done'); - SimpleSAML_Stats::log('core:idp:logout-iframe:page', array('type' => 'done')); + \SimpleSAML\Logger::stats('slo-iframe done'); + \SimpleSAML\Stats::log('core:idp:logout-iframe:page', ['type' => 'done']); $SPs = $state['core:Logout-IFrame:Associations']; } else { // user skipped global logout - SimpleSAML\Logger::stats('slo-iframe skip'); - SimpleSAML_Stats::log('core:idp:logout-iframe:page', array('type' => 'skip')); - $SPs = array(); // no SPs should have been logged out + \SimpleSAML\Logger::stats('slo-iframe skip'); + \SimpleSAML\Stats::log('core:idp:logout-iframe:page', ['type' => 'skip']); + $SPs = []; // no SPs should have been logged out $state['core:Failed'] = true; // mark as partial logout } @@ -42,14 +42,14 @@ if ($sp['core:Logout-IFrame:State'] === 'completed') { $idp->terminateAssociation($assocId); } else { - SimpleSAML\Logger::warning('Unable to terminate association with '.var_export($assocId, true).'.'); + \SimpleSAML\Logger::warning('Unable to terminate association with '.var_export($assocId, true).'.'); if (isset($sp['saml:entityID'])) { $spId = $sp['saml:entityID']; } else { $spId = $assocId; } - SimpleSAML\Logger::stats('slo-iframe-fail '.$spId); - SimpleSAML_Stats::log('core:idp:logout-iframe:spfail', array('sp' => $spId)); + \SimpleSAML\Logger::stats('slo-iframe-fail '.$spId); + \SimpleSAML\Stats::log('core:idp:logout-iframe:spfail', ['sp' => $spId]); $state['core:Failed'] = true; } } diff --git a/vendor/simplesamlphp/simplesamlphp/modules/core/www/idp/logout-iframe-post.php b/vendor/simplesamlphp/simplesamlphp/modules/core/www/idp/logout-iframe-post.php index 7079e19aa6..2081dfe26d 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/core/www/idp/logout-iframe-post.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/core/www/idp/logout-iframe-post.php @@ -1,13 +1,13 @@ <?php if (!isset($_REQUEST['idp'])) { - throw new SimpleSAML_Error_BadRequest('Missing "idp" parameter.'); + throw new \SimpleSAML\Error\BadRequest('Missing "idp" parameter.'); } $idp = (string) $_REQUEST['idp']; -$idp = SimpleSAML_IdP::getById($idp); +$idp = \SimpleSAML\IdP::getById($idp); if (!isset($_REQUEST['association'])) { - throw new SimpleSAML_Error_BadRequest('Missing "association" parameter.'); + throw new \SimpleSAML\Error\BadRequest('Missing "association" parameter.'); } $assocId = urldecode($_REQUEST['association']); @@ -18,15 +18,15 @@ $associations = $idp->getAssociations(); if (!isset($associations[$assocId])) { - throw new SimpleSAML_Error_BadRequest('Invalid association id.'); + throw new \SimpleSAML\Error\BadRequest('Invalid association id.'); } $association = $associations[$assocId]; -$metadata = SimpleSAML_Metadata_MetaDataStorageHandler::getMetadataHandler(); +$metadata = \SimpleSAML\Metadata\MetaDataStorageHandler::getMetadataHandler(); $idpMetadata = $idp->getConfig(); $spMetadata = $metadata->getMetaDataConfig($association['saml:entityID'], 'saml20-sp-remote'); -$lr = sspmod_saml_Message::buildLogoutRequest($idpMetadata, $spMetadata); +$lr = \SimpleSAML\Module\saml\Message::buildLogoutRequest($idpMetadata, $spMetadata); $lr->setSessionIndex($association['saml:SessionIndex']); $lr->setNameId($association['saml:NameID']); @@ -41,15 +41,15 @@ $encryptNameId = $idpMetadata->getBoolean('nameid.encryption', false); } if ($encryptNameId) { - $lr->encryptNameId(sspmod_saml_Message::getEncryptionKey($spMetadata)); + $lr->encryptNameId(\SimpleSAML\Module\saml\Message::getEncryptionKey($spMetadata)); } -SimpleSAML_Stats::log('saml:idp:LogoutRequest:sent', array( +\SimpleSAML\Stats::log('saml:idp:LogoutRequest:sent', [ 'spEntityID' => $association['saml:entityID'], 'idpEntityID' => $idpMetadata->getString('entityid'), -)); +]); -$bindings = array(\SAML2\Constants::BINDING_HTTP_POST); +$bindings = [\SAML2\Constants::BINDING_HTTP_POST]; $dst = $spMetadata->getDefaultEndpoint('SingleLogoutService', $bindings); $binding = \SAML2\Binding::getBinding($dst['Binding']); diff --git a/vendor/simplesamlphp/simplesamlphp/modules/core/www/idp/logout-iframe.js b/vendor/simplesamlphp/simplesamlphp/modules/core/www/idp/logout-iframe.js index 6fc4010705..921c23cdfe 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/core/www/idp/logout-iframe.js +++ b/vendor/simplesamlphp/simplesamlphp/modules/core/www/idp/logout-iframe.js @@ -1,8 +1,8 @@ /** * This function updates the global logout status. */ -function updateStatus() { - +function updateStatus() +{ var nFailed = 0; var nProgress = 0; for (sp in window.spStatus) { @@ -33,7 +33,8 @@ function updateStatus() { * @param status The new status. * @param reason The reason for the status change. */ -function updateSPStatus(spId, status, reason) { +function updateSPStatus(spId, status, reason) +{ if (window.spStatus[spId] === status) { // unchanged return; @@ -63,7 +64,8 @@ function updateSPStatus(spId, status, reason) { * * @param spId The SP that completed logout successfully. */ -function logoutCompleted(spId) { +function logoutCompleted(spId) +{ updateSPStatus(spId, 'completed', ''); } @@ -75,7 +77,8 @@ function logoutCompleted(spId) { * @param spId The SP that failed to complete logout. * @param reason The reason why logout failed. */ -function logoutFailed(spId, reason) { +function logoutFailed(spId, reason) +{ updateSPStatus(spId, 'failed', reason); } @@ -84,7 +87,8 @@ function logoutFailed(spId, reason) { * * If an SP didn't reply by the timeout, we'll mark it as failed. */ -function timeoutSPs() { +function timeoutSPs() +{ var cTime = ((new Date()).getTime() - window.startTime) / 1000; for (var sp in window.spStatus) { if (window.spTimeout[sp] <= cTime && window.spStatus[sp] === 'inprogress') { diff --git a/vendor/simplesamlphp/simplesamlphp/modules/core/www/idp/logout-iframe.php b/vendor/simplesamlphp/simplesamlphp/modules/core/www/idp/logout-iframe.php index caf00f11db..27195af6b8 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/core/www/idp/logout-iframe.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/core/www/idp/logout-iframe.php @@ -1,28 +1,29 @@ <?php if (!isset($_REQUEST['id'])) { - throw new SimpleSAML_Error_BadRequest('Missing required parameter: id'); + throw new \SimpleSAML\Error\BadRequest('Missing required parameter: id'); } if (isset($_REQUEST['type'])) { $type = (string) $_REQUEST['type']; - if (!in_array($type, array('init', 'js', 'nojs', 'embed'), true)) { - throw new SimpleSAML_Error_BadRequest('Invalid value for type.'); + if (!in_array($type, ['init', 'js', 'nojs', 'embed'], true)) { + throw new \SimpleSAML\Error\BadRequest('Invalid value for type.'); } } else { $type = 'init'; } if ($type !== 'embed') { - SimpleSAML\Logger::stats('slo-iframe '.$type); - SimpleSAML_Stats::log('core:idp:logout-iframe:page', array('type' => $type)); + \SimpleSAML\Logger::stats('slo-iframe '.$type); + \SimpleSAML\Stats::log('core:idp:logout-iframe:page', ['type' => $type]); } -$state = SimpleSAML_Auth_State::loadState($_REQUEST['id'], 'core:Logout-IFrame'); -$idp = SimpleSAML_IdP::getByState($state); -$mdh = SimpleSAML_Metadata_MetaDataStorageHandler::getMetadataHandler(); +$state = \SimpleSAML\Auth\State::loadState($_REQUEST['id'], 'core:Logout-IFrame'); +$idp = \SimpleSAML\IdP::getByState($state); +$mdh = \SimpleSAML\Metadata\MetaDataStorageHandler::getMetadataHandler(); -if ($type !== 'init') { // update association state +if ($type !== 'init') { + // update association state foreach ($state['core:Logout-IFrame:Associations'] as $assocId => &$sp) { $spId = sha1($assocId); @@ -53,8 +54,8 @@ if (!isset($sp['core:Logout-IFrame:Timeout'])) { if (method_exists($sp['Handler'], 'getAssociationConfig')) { - $assocIdP = SimpleSAML_IdP::getByState($sp); - $assocConfig = call_user_func(array($sp['Handler'], 'getAssociationConfig'), $assocIdP, $sp); + $assocIdP = \SimpleSAML\IdP::getByState($sp); + $assocConfig = call_user_func([$sp['Handler'], 'getAssociationConfig'], $assocIdP, $sp); $sp['core:Logout-IFrame:Timeout'] = $assocConfig->getInteger('core:logout-timeout', 5) + time(); } else { $sp['core:Logout-IFrame:Timeout'] = time() + 5; @@ -71,10 +72,10 @@ } try { - $assocIdP = SimpleSAML_IdP::getByState($sp); - $url = call_user_func(array($sp['Handler'], 'getLogoutURL'), $assocIdP, $sp, null); + $assocIdP = \SimpleSAML\IdP::getByState($sp); + $url = call_user_func([$sp['Handler'], 'getLogoutURL'], $assocIdP, $sp, null); $sp['core:Logout-IFrame:URL'] = $url; - } catch (Exception $e) { + } catch (\Exception $e) { $sp['core:Logout-IFrame:State'] = 'failed'; } } @@ -90,7 +91,7 @@ } // build an array with information about all services currently logged in -$remaining = array(); +$remaining = []; foreach ($state['core:Logout-IFrame:Associations'] as $association) { $key = sha1($association['id']); $mdset = 'saml20-sp-remote'; @@ -98,7 +99,7 @@ $mdset = 'adfs-sp-remote'; } - $remaining[$key] = array( + $remaining[$key] = [ 'id' => $association['id'], 'expires_on' => $association['Expires'], 'entityID' => $association['saml:entityID'], @@ -106,26 +107,27 @@ 'status' => $association['core:Logout-IFrame:State'], 'logoutURL' => $association['core:Logout-IFrame:URL'], 'metadata' => $mdh->getMetaDataConfig($association['saml:entityID'], $mdset)->toArray(), - ); + ]; if (isset($association['core:Logout-IFrame:Timeout'])) { $remaining[$key]['timeout'] = $association['core:Logout-IFrame:Timeout']; } } -$id = SimpleSAML_Auth_State::saveState($state, 'core:Logout-IFrame'); -$globalConfig = SimpleSAML_Configuration::getInstance(); - -$template_id = 'core:logout-iframe.php'; +$globalConfig = \SimpleSAML\Configuration::getInstance(); if ($type === 'nojs') { - $template_id = 'core:logout-iframe-wrapper.php'; + $t = new \SimpleSAML\XHTML\Template($globalConfig, 'core:logout-iframe-wrapper.php'); +} else { + $t = new \SimpleSAML\XHTML\Template($globalConfig, 'core:logout-iframe.php'); } -$t = new SimpleSAML_XHTML_Template($globalConfig, $template_id); -$t->data['auth_state'] = $id; /** * @deprecated The "id" variable will be removed. Please use "auth_state" instead. */ +$id = \SimpleSAML\Auth\State::saveState($state, 'core:Logout-IFrame'); $t->data['id'] = $id; +$t->data['auth_state'] = $id; + +$t->data['header'] = $t->getTranslator()->t('{logout:progress}'); $t->data['type'] = $type; $t->data['terminated_service'] = $terminated; $t->data['remaining_services'] = $remaining; @@ -138,7 +140,7 @@ if ($type !== 'nojs') { /** @deprecated The "jquery" array will be removed in 2.0 */ - $t->data['jquery'] = array('core' => true, 'ui' => false, 'css' => false); + $t->data['jquery'] = ['core' => true, 'ui' => false, 'css' => false]; } $t->show(); diff --git a/vendor/simplesamlphp/simplesamlphp/modules/core/www/idp/resumelogout.php b/vendor/simplesamlphp/simplesamlphp/modules/core/www/idp/resumelogout.php index 199dad3b6f..3e84b3a4e2 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/core/www/idp/resumelogout.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/core/www/idp/resumelogout.php @@ -1,10 +1,10 @@ <?php if (!isset($_REQUEST['id'])) { - throw new SimpleSAML_Error_BadRequest('Missing id-parameter.'); + throw new \SimpleSAML\Error\BadRequest('Missing id-parameter.'); } -$state = SimpleSAML_Auth_State::loadState($_REQUEST['id'], 'core:Logout:afterbridge'); -$idp = SimpleSAML_IdP::getByState($state); +$state = \SimpleSAML\Auth\State::loadState($_REQUEST['id'], 'core:Logout:afterbridge'); +$idp = \SimpleSAML\IdP::getByState($state); $assocId = $state['core:TerminatedAssocId']; diff --git a/vendor/simplesamlphp/simplesamlphp/modules/core/www/login-admin.php b/vendor/simplesamlphp/simplesamlphp/modules/core/www/login-admin.php index 22bc7854ae..59246f6731 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/core/www/login-admin.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/core/www/login-admin.php @@ -1,13 +1,12 @@ <?php + /* * Helper page for starting a admin login. Can be used as a target for links. */ if (!array_key_exists('ReturnTo', $_REQUEST)) { - throw new SimpleSAML_Error_BadRequest('Missing ReturnTo parameter.'); + throw new \SimpleSAML\Error\BadRequest('Missing ReturnTo parameter.'); } -SimpleSAML\Utils\Auth::requireAdmin(); - +\SimpleSAML\Utils\Auth::requireAdmin(); \SimpleSAML\Utils\HTTP::redirectUntrustedURL($_REQUEST['ReturnTo']); - diff --git a/vendor/simplesamlphp/simplesamlphp/modules/core/www/loginuserpass.php b/vendor/simplesamlphp/simplesamlphp/modules/core/www/loginuserpass.php index 78ba32a0a3..747506f898 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/core/www/loginuserpass.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/core/www/loginuserpass.php @@ -2,7 +2,7 @@ /** * This page shows a username/password login form, and passes information from it - * to the sspmod_core_Auth_UserPassBase class, which is a generic class for + * to the \SimpleSAML\Module\core\Auth\UserPassBase class, which is a generic class for * username/password authentication. * * @author Olav Morken, UNINETT AS. @@ -11,97 +11,126 @@ // Retrieve the authentication state if (!array_key_exists('AuthState', $_REQUEST)) { - throw new SimpleSAML_Error_BadRequest('Missing AuthState parameter.'); + throw new \SimpleSAML\Error\BadRequest('Missing AuthState parameter.'); } $authStateId = $_REQUEST['AuthState']; -$state = SimpleSAML_Auth_State::loadState($authStateId, sspmod_core_Auth_UserPassBase::STAGEID); +$state = \SimpleSAML\Auth\State::loadState($authStateId, \SimpleSAML\Module\core\Auth\UserPassBase::STAGEID); -$source = SimpleSAML_Auth_Source::getById($state[sspmod_core_Auth_UserPassBase::AUTHID]); -if ($source === NULL) { - throw new Exception('Could not find authentication source with id ' . $state[sspmod_core_Auth_UserPassBase::AUTHID]); +$source = \SimpleSAML\Auth\Source::getById($state[\SimpleSAML\Module\core\Auth\UserPassBase::AUTHID]); +if ($source === null) { + throw new \Exception( + 'Could not find authentication source with id '.$state[\SimpleSAML\Module\core\Auth\UserPassBase::AUTHID] + ); } if (array_key_exists('username', $_REQUEST)) { - $username = $_REQUEST['username']; -} elseif ($source->getRememberUsernameEnabled() && array_key_exists($source->getAuthId() . '-username', $_COOKIE)) { - $username = $_COOKIE[$source->getAuthId() . '-username']; + $username = $_REQUEST['username']; +} elseif ($source->getRememberUsernameEnabled() && array_key_exists($source->getAuthId().'-username', $_COOKIE)) { + $username = $_COOKIE[$source->getAuthId().'-username']; } elseif (isset($state['core:username'])) { - $username = (string)$state['core:username']; + $username = (string) $state['core:username']; } else { - $username = ''; + $username = ''; } if (array_key_exists('password', $_REQUEST)) { - $password = $_REQUEST['password']; + $password = $_REQUEST['password']; } else { - $password = ''; + $password = ''; } -$errorCode = NULL; -$errorParams = NULL; +$errorCode = null; +$errorParams = null; +$queryParams = []; + +if (isset($state['error'])) { + $errorCode = $state['error']['code']; + $errorParams = $state['error']['params']; + $queryParams = ['AuthState' => $authStateId]; +} if (!empty($_REQUEST['username']) || !empty($password)) { - // Either username or password set - attempt to log in + // Either username or password set - attempt to log in - if (array_key_exists('forcedUsername', $state)) { - $username = $state['forcedUsername']; - } + if (array_key_exists('forcedUsername', $state)) { + $username = $state['forcedUsername']; + } - if ($source->getRememberUsernameEnabled()) { - $sessionHandler = \SimpleSAML\SessionHandler::getSessionHandler(); - $params = $sessionHandler->getCookieParams(); - $params['expire'] = time(); - $params['expire'] += (isset($_REQUEST['remember_username']) && $_REQUEST['remember_username'] == 'Yes' ? 31536000 : -300); - \SimpleSAML\Utils\HTTP::setCookie($source->getAuthId() . '-username', $username, $params, FALSE); - } + if ($source->getRememberUsernameEnabled()) { + $sessionHandler = \SimpleSAML\SessionHandler::getSessionHandler(); + $params = $sessionHandler->getCookieParams(); + + if (isset($_REQUEST['remember_username']) && $_REQUEST['remember_username'] == 'Yes') { + $params['expire'] = time() + 31536000; + } else { + $params['expire'] = time() - 300; + } + \SimpleSAML\Utils\HTTP::setCookie($source->getAuthId().'-username', $username, $params, false); + } if ($source->isRememberMeEnabled()) { if (array_key_exists('remember_me', $_REQUEST) && $_REQUEST['remember_me'] === 'Yes') { - $state['RememberMe'] = TRUE; - $authStateId = SimpleSAML_Auth_State::saveState($state, sspmod_core_Auth_UserPassBase::STAGEID); + $state['RememberMe'] = true; + $authStateId = \SimpleSAML\Auth\State::saveState( + $state, + \SimpleSAML\Module\core\Auth\UserPassBase::STAGEID + ); } } - try { - sspmod_core_Auth_UserPassBase::handleLogin($authStateId, $username, $password); - } catch (SimpleSAML_Error_Error $e) { - /* Login failed. Extract error code and parameters, to display the error. */ - $errorCode = $e->getErrorCode(); - $errorParams = $e->getParameters(); - } + try { + \SimpleSAML\Module\core\Auth\UserPassBase::handleLogin($authStateId, $username, $password); + } catch (\SimpleSAML\Error\Error $e) { + // Login failed. Extract error code and parameters, to display the error + $errorCode = $e->getErrorCode(); + $errorParams = $e->getParameters(); + $state['error'] = [ + 'code' => $errorCode, + 'params' => $errorParams + ]; + $authStateId = \SimpleSAML\Auth\State::saveState($state, \SimpleSAML\Module\core\Auth\UserPassBase::STAGEID); + $queryParams = ['AuthState' => $authStateId]; + } + if (isset($state['error'])) { + unset($state['error']); + } } -$globalConfig = SimpleSAML_Configuration::getInstance(); -$t = new SimpleSAML_XHTML_Template($globalConfig, 'core:loginuserpass.php'); -$t->data['stateparams'] = array('AuthState' => $authStateId); +$globalConfig = \SimpleSAML\Configuration::getInstance(); +$t = new \SimpleSAML\XHTML\Template($globalConfig, 'core:loginuserpass.php'); +$t->data['stateparams'] = ['AuthState' => $authStateId]; if (array_key_exists('forcedUsername', $state)) { - $t->data['username'] = $state['forcedUsername']; - $t->data['forceUsername'] = TRUE; - $t->data['rememberUsernameEnabled'] = FALSE; - $t->data['rememberUsernameChecked'] = FALSE; + $t->data['username'] = $state['forcedUsername']; + $t->data['forceUsername'] = true; + $t->data['rememberUsernameEnabled'] = false; + $t->data['rememberUsernameChecked'] = false; $t->data['rememberMeEnabled'] = $source->isRememberMeEnabled(); $t->data['rememberMeChecked'] = $source->isRememberMeChecked(); } else { - $t->data['username'] = $username; - $t->data['forceUsername'] = FALSE; - $t->data['rememberUsernameEnabled'] = $source->getRememberUsernameEnabled(); - $t->data['rememberUsernameChecked'] = $source->getRememberUsernameChecked(); + $t->data['username'] = $username; + $t->data['forceUsername'] = false; + $t->data['rememberUsernameEnabled'] = $source->getRememberUsernameEnabled(); + $t->data['rememberUsernameChecked'] = $source->getRememberUsernameChecked(); $t->data['rememberMeEnabled'] = $source->isRememberMeEnabled(); $t->data['rememberMeChecked'] = $source->isRememberMeChecked(); - if (isset($_COOKIE[$source->getAuthId() . '-username'])) $t->data['rememberUsernameChecked'] = TRUE; + if (isset($_COOKIE[$source->getAuthId().'-username'])) { + $t->data['rememberUsernameChecked'] = true; + } } $t->data['links'] = $source->getLoginLinks(); $t->data['errorcode'] = $errorCode; $t->data['errorcodes'] = SimpleSAML\Error\ErrorCodes::getAllErrorCodeMessages(); $t->data['errorparams'] = $errorParams; +if (!empty($queryParams)) { + $t->data['queryParams'] = $queryParams; +} if (isset($state['SPMetadata'])) { - $t->data['SPMetadata'] = $state['SPMetadata']; + $t->data['SPMetadata'] = $state['SPMetadata']; } else { - $t->data['SPMetadata'] = NULL; + $t->data['SPMetadata'] = null; } $t->show(); exit(); - diff --git a/vendor/simplesamlphp/simplesamlphp/modules/core/www/loginuserpassorg.php b/vendor/simplesamlphp/simplesamlphp/modules/core/www/loginuserpassorg.php index 81deccf835..2b9ec4dba3 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/core/www/loginuserpassorg.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/core/www/loginuserpassorg.php @@ -2,7 +2,7 @@ /** * This page shows a username/password/organization login form, and passes information from - * itto the sspmod_core_Auth_UserPassBase class, which is a generic class for + * into the \SimpleSAML\Module\core\Auth\UserPassBase class, which is a generic class for * username/password/organization authentication. * * @author Olav Morken, UNINETT AS. @@ -11,90 +11,153 @@ // Retrieve the authentication state if (!array_key_exists('AuthState', $_REQUEST)) { - throw new SimpleSAML_Error_BadRequest('Missing AuthState parameter.'); + throw new \SimpleSAML\Error\BadRequest('Missing AuthState parameter.'); } $authStateId = $_REQUEST['AuthState']; -$state = SimpleSAML_Auth_State::loadState($authStateId, sspmod_core_Auth_UserPassOrgBase::STAGEID); +$state = \SimpleSAML\Auth\State::loadState($authStateId, \SimpleSAML\Module\core\Auth\UserPassOrgBase::STAGEID); -$source = SimpleSAML_Auth_Source::getById($state[sspmod_core_Auth_UserPassOrgBase::AUTHID]); -if ($source === NULL) { - throw new Exception('Could not find authentication source with id ' . $state[sspmod_core_Auth_UserPassOrgBase::AUTHID]); +$source = \SimpleSAML\Auth\Source::getById($state[\SimpleSAML\Module\core\Auth\UserPassOrgBase::AUTHID]); +if ($source === null) { + throw new \Exception( + 'Could not find authentication source with id '.$state[\SimpleSAML\Module\core\Auth\UserPassOrgBase::AUTHID] + ); } -$organizations = sspmod_core_Auth_UserPassOrgBase::listOrganizations($authStateId); +$organizations = \SimpleSAML\Module\core\Auth\UserPassOrgBase::listOrganizations($authStateId); if (array_key_exists('username', $_REQUEST)) { - $username = $_REQUEST['username']; -} elseif ($source->getRememberUsernameEnabled() && array_key_exists($source->getAuthId() . '-username', $_COOKIE)) { - $username = $_COOKIE[$source->getAuthId() . '-username']; + $username = $_REQUEST['username']; +} elseif ($source->getRememberUsernameEnabled() && array_key_exists($source->getAuthId().'-username', $_COOKIE)) { + $username = $_COOKIE[$source->getAuthId().'-username']; } elseif (isset($state['core:username'])) { - $username = (string)$state['core:username']; + $username = (string) $state['core:username']; } else { - $username = ''; + $username = ''; } if (array_key_exists('password', $_REQUEST)) { - $password = $_REQUEST['password']; + $password = $_REQUEST['password']; } else { - $password = ''; + $password = ''; } if (array_key_exists('organization', $_REQUEST)) { - $organization = $_REQUEST['organization']; + $organization = $_REQUEST['organization']; +} elseif ($source->getRememberOrganizationEnabled() && + array_key_exists($source->getAuthId().'-organization', $_COOKIE) + ) { + $organization = $_COOKIE[$source->getAuthId().'-organization']; } elseif (isset($state['core:organization'])) { - $organization = (string)$state['core:organization']; + $organization = (string) $state['core:organization']; } else { - $organization = ''; + $organization = ''; } -$errorCode = NULL; -$errorParams = NULL; -if ($organizations === NULL || !empty($organization)) { - if (!empty($username) && !empty($password)) { - - if ($source->getRememberUsernameEnabled()) { - $sessionHandler = \SimpleSAML\SessionHandler::getSessionHandler(); - $params = $sessionHandler->getCookieParams(); - $params['expire'] = time(); - $params['expire'] += (isset($_REQUEST['remember_username']) && $_REQUEST['remember_username'] == 'Yes' ? 31536000 : -300); - \SimpleSAML\Utils\HTTP::setCookie($source->getAuthId() . '-username', $username, $params, FALSE); - } - - try { - sspmod_core_Auth_UserPassOrgBase::handleLogin($authStateId, $username, $password, $organization); - } catch (SimpleSAML_Error_Error $e) { - // Login failed. Extract error code and parameters, to display the error - $errorCode = $e->getErrorCode(); - $errorParams = $e->getParameters(); - } - } +$errorCode = null; +$errorParams = null; +$queryParams = []; + +if (isset($state['error'])) { + $errorCode = $state['error']['code']; + $errorParams = $state['error']['params']; + $queryParams = ['AuthState' => $authStateId]; +} + +if ($organizations === null || !empty($organization)) { + if (!empty($username) || !empty($password)) { + if ($source->getRememberUsernameEnabled()) { + $sessionHandler = \SimpleSAML\SessionHandler::getSessionHandler(); + $params = $sessionHandler->getCookieParams(); + if (isset($_REQUEST['remember_username']) && $_REQUEST['remember_username'] == 'Yes') { + $params['expire'] = time() + 3153600; + } else { + $params['expire'] = time() - 300; + } + + \SimpleSAML\Utils\HTTP::setCookie($source->getAuthId().'-username', $username, $params, false); + } + + if ($source->getRememberOrganizationEnabled()) { + $sessionHandler = \SimpleSAML\SessionHandler::getSessionHandler(); + $params = $sessionHandler->getCookieParams(); + if (isset($_REQUEST['remember_organization']) && $_REQUEST['remember_organization'] == 'Yes') { + $params['expire'] = time() + 3153600; + } else { + $params['expire'] = time() - 300; + } + setcookie( + $source->getAuthId().'-organization', + $organization, + $params['expire'], + $params['path'], + $params['domain'], + $params['secure'], + $params['httponly'] + ); + } + + try { + \SimpleSAML\Module\core\Auth\UserPassOrgBase::handleLogin( + $authStateId, + $username, + $password, + $organization + ); + } catch (\SimpleSAML\Error\Error $e) { + // Login failed. Extract error code and parameters, to display the error + $errorCode = $e->getErrorCode(); + $errorParams = $e->getParameters(); + $state['error'] = [ + 'code' => $errorCode, + 'params' => $errorParams + ]; + $authStateId = \SimpleSAML\Auth\State::saveState( + $state, + \SimpleSAML\Module\core\Auth\UserPassOrgBase::STAGEID + ); + $queryParams = ['AuthState' => $authStateId]; + } + if (isset($state['error'])) { + unset($state['error']); + } + } } -$globalConfig = SimpleSAML_Configuration::getInstance(); -$t = new SimpleSAML_XHTML_Template($globalConfig, 'core:loginuserpass.php'); -$t->data['stateparams'] = array('AuthState' => $authStateId); +$globalConfig = \SimpleSAML\Configuration::getInstance(); +$t = new \SimpleSAML\XHTML\Template($globalConfig, 'core:loginuserpass.php'); +$t->data['stateparams'] = ['AuthState' => $authStateId]; $t->data['username'] = $username; -$t->data['forceUsername'] = FALSE; +$t->data['forceUsername'] = false; $t->data['rememberUsernameEnabled'] = $source->getRememberUsernameEnabled(); $t->data['rememberUsernameChecked'] = $source->getRememberUsernameChecked(); $t->data['rememberMeEnabled'] = false; $t->data['rememberMeChecked'] = false; -if (isset($_COOKIE[$source->getAuthId() . '-username'])) $t->data['rememberUsernameChecked'] = TRUE; +if (isset($_COOKIE[$source->getAuthId().'-username'])) { + $t->data['rememberUsernameChecked'] = true; +} +$t->data['rememberOrganizationEnabled'] = $source->getRememberOrganizationEnabled(); +$t->data['rememberOrganizationChecked'] = $source->getRememberOrganizationChecked(); +if (isset($_COOKIE[$source->getAuthId().'-organization'])) { + $t->data['rememberOrganizationChecked'] = true; +} $t->data['errorcode'] = $errorCode; -$t->data['errorcodes'] = SimpleSAML\Error\ErrorCodes::getAllErrorCodeMessages(); +$t->data['errorcodes'] = \SimpleSAML\Error\ErrorCodes::getAllErrorCodeMessages(); $t->data['errorparams'] = $errorParams; -if ($organizations !== NULL) { - $t->data['selectedOrg'] = $organization; - $t->data['organizations'] = $organizations; +if (!empty($queryParams)) { + $t->data['queryParams'] = $queryParams; +} + +if ($organizations !== null) { + $t->data['selectedOrg'] = $organization; + $t->data['organizations'] = $organizations; } if (isset($state['SPMetadata'])) { - $t->data['SPMetadata'] = $state['SPMetadata']; + $t->data['SPMetadata'] = $state['SPMetadata']; } else { - $t->data['SPMetadata'] = NULL; + $t->data['SPMetadata'] = null; } $t->show(); exit(); - diff --git a/vendor/simplesamlphp/simplesamlphp/modules/core/www/no_cookie.php b/vendor/simplesamlphp/simplesamlphp/modules/core/www/no_cookie.php index 46e67a5799..3575d85f6b 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/core/www/no_cookie.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/core/www/no_cookie.php @@ -7,7 +7,12 @@ $retryURL = null; } -$globalConfig = SimpleSAML_Configuration::getInstance(); -$t = new SimpleSAML_XHTML_Template($globalConfig, 'core:no_cookie.tpl.php'); +$globalConfig = \SimpleSAML\Configuration::getInstance(); +$t = new \SimpleSAML\XHTML\Template($globalConfig, 'core:no_cookie.tpl.php'); +$translator = $t->getTranslator(); + +$t->data['header'] = htmlspecialchars($translator->t('{core:no_cookie:header}')); +$t->data['description'] = htmlspecialchars($translator->t('{core:no_cookie:description}')); +$t->data['retry'] = htmlspecialchars($translator->t('{core:no_cookie:retry}')); $t->data['retryURL'] = $retryURL; $t->show(); diff --git a/vendor/simplesamlphp/simplesamlphp/modules/core/www/postredirect.php b/vendor/simplesamlphp/simplesamlphp/modules/core/www/postredirect.php index ec4cefb7f9..ac2439b93f 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/core/www/postredirect.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/core/www/postredirect.php @@ -7,45 +7,49 @@ */ if (array_key_exists('RedirId', $_REQUEST)) { - $postId = $_REQUEST['RedirId']; - $session = SimpleSAML_Session::getSessionFromRequest(); + $postId = $_REQUEST['RedirId']; + $session = \SimpleSAML\Session::getSessionFromRequest(); } elseif (array_key_exists('RedirInfo', $_REQUEST)) { - $encData = base64_decode($_REQUEST['RedirInfo']); + $encData = base64_decode($_REQUEST['RedirInfo']); - if (empty($encData)) { - throw new SimpleSAML_Error_BadRequest('Invalid RedirInfo data.'); - } + if (empty($encData)) { + throw new \SimpleSAML\Error\BadRequest('Invalid RedirInfo data.'); + } - list($sessionId, $postId) = explode(':', SimpleSAML\Utils\Crypto::aesDecrypt($encData)); + list($sessionId, $postId) = explode(':', \SimpleSAML\Utils\Crypto::aesDecrypt($encData)); - if (empty($sessionId) || empty($postId)) { - throw new SimpleSAML_Error_BadRequest('Invalid session info data.'); - } + if (empty($sessionId) || empty($postId)) { + throw new \SimpleSAML\Error\BadRequest('Invalid session info data.'); + } - $session = SimpleSAML_Session::getSession($sessionId); + $session = \SimpleSAML\Session::getSession($sessionId); } else { - throw new SimpleSAML_Error_BadRequest('Missing redirection info parameter.'); + throw new \SimpleSAML\Error\BadRequest('Missing redirection info parameter.'); } -if ($session === NULL) { - throw new Exception('Unable to load session.'); +if ($session === null) { + throw new Exception('Unable to load session.'); } $postData = $session->getData('core_postdatalink', $postId); -if ($postData === NULL) { - // The post data is missing, probably because it timed out - throw new Exception('The POST data we should restore was lost.'); +if ($postData === null) { + // The post data is missing, probably because it timed out + throw new Exception('The POST data we should restore was lost.'); } $session->deleteData('core_postdatalink', $postId); -assert('is_array($postData)'); -assert('array_key_exists("url", $postData)'); -assert('array_key_exists("post", $postData)'); +assert(is_array($postData)); +assert(array_key_exists('url', $postData)); +assert(array_key_exists('post', $postData)); -$config = SimpleSAML_Configuration::getInstance(); -$template = new SimpleSAML_XHTML_Template($config, 'post.php'); +if (!\SimpleSAML\Utils\HTTP::isValidURL($postData['url'])) { + throw new \SimpleSAML\Error\Exception('Invalid destination URL.'); +} + +$config = \SimpleSAML\Configuration::getInstance(); +$template = new \SimpleSAML\XHTML\Template($config, 'post.php'); $template->data['destination'] = $postData['url']; $template->data['post'] = $postData['post']; $template->show(); diff --git a/vendor/simplesamlphp/simplesamlphp/modules/core/www/short_sso_interval.php b/vendor/simplesamlphp/simplesamlphp/modules/core/www/short_sso_interval.php index 0690b1b4f5..a9da1cae10 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/core/www/short_sso_interval.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/core/www/short_sso_interval.php @@ -1,4 +1,5 @@ <?php + /** * Show a warning to an user about the SP requesting SSO a short time after * doing it previously. @@ -7,20 +8,23 @@ */ if (!array_key_exists('StateId', $_REQUEST)) { - throw new SimpleSAML_Error_BadRequest('Missing required StateId query parameter.'); + throw new \SimpleSAML\Error\BadRequest('Missing required StateId query parameter.'); } $id = $_REQUEST['StateId']; -$state = SimpleSAML_Auth_State::loadState($id, 'core:short_sso_interval'); -$session = SimpleSAML_Session::getSessionFromRequest(); +$state = \SimpleSAML\Auth\State::loadState($id, 'core:short_sso_interval'); +$session = \SimpleSAML\Session::getSessionFromRequest(); if (array_key_exists('continue', $_REQUEST)) { - // The user has pressed the continue/retry-button - SimpleSAML_Auth_ProcessingChain::resumeProcessing($state); + // The user has pressed the continue/retry-button + \SimpleSAML\Auth\ProcessingChain::resumeProcessing($state); } -$globalConfig = SimpleSAML_Configuration::getInstance(); -$t = new SimpleSAML_XHTML_Template($globalConfig, 'core:short_sso_interval.php'); -$t->data['target'] = SimpleSAML\Module::getModuleURL('core/short_sso_interval.php'); -$t->data['params'] = array('StateId' => $id); +$globalConfig = \SimpleSAML\Configuration::getInstance(); +$t = new \SimpleSAML\XHTML\Template($globalConfig, 'core:short_sso_interval.php'); +$translator = $t->getTranslator(); +$t->data['target'] = \SimpleSAML\Module::getModuleURL('core/short_sso_interval.php'); +$t->data['params'] = ['StateId' => $id]; $t->data['trackId'] = $session->getTrackID(); +$t->data['header'] = $translator->t('{core:short_sso_interval:warning_header}'); +$t->data['autofocus'] = 'contbutton'; $t->show(); diff --git a/vendor/simplesamlphp/simplesamlphp/modules/core/www/show_metadata.php b/vendor/simplesamlphp/simplesamlphp/modules/core/www/show_metadata.php index fd03d9f56a..e8f3bf223e 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/core/www/show_metadata.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/core/www/show_metadata.php @@ -1,10 +1,10 @@ <?php // load configuration -$config = SimpleSAML_Configuration::getInstance(); -$session = SimpleSAML_Session::getSessionFromRequest(); +$config = \SimpleSAML\Configuration::getInstance(); +$session = \SimpleSAML\Session::getSessionFromRequest(); -SimpleSAML\Utils\Auth::requireAdmin(); +\SimpleSAML\Utils\Auth::requireAdmin(); if (!array_key_exists('entityid', $_REQUEST)) { throw new Exception('required parameter [entityid] missing'); @@ -14,21 +14,24 @@ } if (!in_array( $_REQUEST['set'], - array('saml20-idp-remote', 'saml20-sp-remote', 'shib13-idp-remote', 'shib13-sp-remote'), + ['saml20-idp-remote', 'saml20-sp-remote', 'shib13-idp-remote', 'shib13-sp-remote'], true )) { throw new Exception('Invalid set'); } -$metadata = SimpleSAML_Metadata_MetaDataStorageHandler::getMetadataHandler(); +$metadata = \SimpleSAML\Metadata\MetaDataStorageHandler::getMetadataHandler(); -$m = $metadata->getMetadata($_REQUEST['entityid'], $_REQUEST['set']); +$m = $metadata->getMetaData($_REQUEST['entityid'], $_REQUEST['set']); -$t = new SimpleSAML_XHTML_Template($config, 'core:show_metadata.tpl.php'); +$t = new \SimpleSAML\XHTML\Template($config, 'core:show_metadata.tpl.php'); $t->data['clipboard.js'] = true; $t->data['pageid'] = 'show_metadata'; $t->data['header'] = 'SimpleSAMLphp Show Metadata'; -$t->data['backlink'] = SimpleSAML\Module::getModuleURL('core/frontpage_federation.php'); +$t->data['backlink'] = \SimpleSAML\Module::getModuleURL('core/frontpage_federation.php'); $t->data['m'] = $m; +$t->data['entityid'] = $m['metadata-index']; +unset($m['metadata-index']); +$t->data['metadata'] = var_export($m, true); $t->show(); diff --git a/vendor/simplesamlphp/simplesamlphp/modules/cron/bin/cron.php b/vendor/simplesamlphp/simplesamlphp/modules/cron/bin/cron.php old mode 100644 new mode 100755 index 073c278cbe..61e690e0fd --- a/vendor/simplesamlphp/simplesamlphp/modules/cron/bin/cron.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/cron/bin/cron.php @@ -11,12 +11,12 @@ $baseDir = dirname(dirname(dirname(dirname(__FILE__)))); // Add library autoloader. -require_once($baseDir . '/lib/_autoload.php'); +require_once($baseDir.'/lib/_autoload.php'); if (!SimpleSAML\Module::isModuleEnabled('cron')) { - echo("You need to enable the cron module before this script can be used.\n"); - echo("You can enable it by running the following command:\n"); - echo(' echo >"' . $baseDir . '/modules/cron/enable' . "\"\n"); + echo "You need to enable the cron module before this script can be used.\n"; + echo "You can enable it by running the following command:\n"; + echo ' echo >"'.$baseDir.'/modules/cron/enable'."\"\n"; exit(1); } diff --git a/vendor/simplesamlphp/simplesamlphp/modules/cron/config-templates/module_cron.php b/vendor/simplesamlphp/simplesamlphp/modules/cron/config-templates/module_cron.php index 32d5c28e7b..29a35d9e9c 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/cron/config-templates/module_cron.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/cron/config-templates/module_cron.php @@ -1,13 +1,11 @@ <?php -/* +/* * Configuration for the Cron module. */ -$config = array ( - - 'key' => 'secret', - 'allowed_tags' => array('daily', 'hourly', 'frequent'), - 'debug_message' => TRUE, - 'sendemail' => TRUE, - -); +$config = [ + 'key' => 'secret', + 'allowed_tags' => ['daily', 'hourly', 'frequent'], + 'debug_message' => true, + 'sendemail' => true, +]; diff --git a/vendor/simplesamlphp/simplesamlphp/modules/cron/dictionaries/cron.definition.json b/vendor/simplesamlphp/simplesamlphp/modules/cron/dictionaries/cron.definition.json index 74696abe0c..1761506932 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/cron/dictionaries/cron.definition.json +++ b/vendor/simplesamlphp/simplesamlphp/modules/cron/dictionaries/cron.definition.json @@ -22,5 +22,8 @@ }, "cron_report_title": { "en": "Cron report" + }, + "link_cron": { + "en": "Cron module information page" } } \ No newline at end of file diff --git a/vendor/simplesamlphp/simplesamlphp/modules/cron/dictionaries/cron.translation.json b/vendor/simplesamlphp/simplesamlphp/modules/cron/dictionaries/cron.translation.json index 95d78122a8..db5bfa4a29 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/cron/dictionaries/cron.translation.json +++ b/vendor/simplesamlphp/simplesamlphp/modules/cron/dictionaries/cron.translation.json @@ -254,5 +254,10 @@ "af": "Cron verslag", "pt-br": "Relat\u00f3rio do cron", "el": "\u0391\u03bd\u03b1\u03c6\u03bf\u03c1\u03ac cron" + }, + "link_cron": { + "es": "Informe de cron", + "no": "Informasjon om cron", + "nn": "Informasjon om cron" } } diff --git a/vendor/simplesamlphp/simplesamlphp/modules/cron/hooks/hook_configpage.php b/vendor/simplesamlphp/simplesamlphp/modules/cron/hooks/hook_configpage.php new file mode 100644 index 0000000000..dc3c8400b7 --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/modules/cron/hooks/hook_configpage.php @@ -0,0 +1,15 @@ +<?php +/** + * Hook to add the cron module to the config page. + * + * @param \SimpleSAML\XHTML\Template &$template The template that we should alter in this hook. + */ + +function cron_hook_configpage(\SimpleSAML\XHTML\Template &$template) +{ + $template->data['links']['cron'] = [ + 'href' => SimpleSAML\Module::getModuleURL('cron/croninfo.php'), + 'text' => \SimpleSAML\Locale\Translate::noop('Cron module information page'), + ]; + $template->getLocalization()->addModuleDomain('cron'); +} diff --git a/vendor/simplesamlphp/simplesamlphp/modules/cron/hooks/hook_cron.php b/vendor/simplesamlphp/simplesamlphp/modules/cron/hooks/hook_cron.php index 62f6a4cb9d..61812906a2 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/cron/hooks/hook_cron.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/cron/hooks/hook_cron.php @@ -4,16 +4,16 @@ * * @param array &$croninfo Output */ -function cron_hook_cron(&$croninfo) { - assert('is_array($croninfo)'); - assert('array_key_exists("summary", $croninfo)'); - assert('array_key_exists("tag", $croninfo)'); - $cronconfig = SimpleSAML_Configuration::getConfig('module_cron.php'); - - if ($cronconfig->getValue('debug_message', TRUE)) { +function cron_hook_cron(&$croninfo) +{ + assert(is_array($croninfo)); + assert(array_key_exists('summary', $croninfo)); + assert(array_key_exists('tag', $croninfo)); - $croninfo['summary'][] = 'Cron did run tag [' . $croninfo['tag'] . '] at ' . date(DATE_RFC822); - } + $cronconfig = \SimpleSAML\Configuration::getConfig('module_cron.php'); + if ($cronconfig->getValue('debug_message', true)) { + $croninfo['summary'][] = 'Cron did run tag ['.$croninfo['tag'].'] at '.date(DATE_RFC822); + } } diff --git a/vendor/simplesamlphp/simplesamlphp/modules/cron/hooks/hook_frontpage.php b/vendor/simplesamlphp/simplesamlphp/modules/cron/hooks/hook_frontpage.php index 048c36c085..73fcd215b7 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/cron/hooks/hook_frontpage.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/cron/hooks/hook_frontpage.php @@ -4,13 +4,15 @@ * * @param array &$links The links on the frontpage, split into sections. */ -function cron_hook_frontpage(&$links) { - assert('is_array($links)'); - assert('array_key_exists("links", $links)'); - $links['config'][] = array( - 'href' => SimpleSAML\Module::getModuleURL('cron/croninfo.php'), - 'text' => array('en' => 'Cron module information page'), - ); +function cron_hook_frontpage(&$links) +{ + assert(is_array($links)); + assert(array_key_exists('links', $links)); + $links['config'][] = [ + 'href' => SimpleSAML\Module::getModuleURL('cron/croninfo.php'), + 'text' => '{cron:cron:link_cron}', + ]; } + diff --git a/vendor/simplesamlphp/simplesamlphp/modules/cron/lib/Cron.php b/vendor/simplesamlphp/simplesamlphp/modules/cron/lib/Cron.php index bba782afac..f8bda653b8 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/cron/lib/Cron.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/cron/lib/Cron.php @@ -9,18 +9,18 @@ class Cron { /** * The configuration for the Cron module - * @var \SimpleSAML_Configuration + * @var \SimpleSAML\Configuration */ private $cronconfig; /* - * @param \SimpleSAML_Configuration $cronconfig The cron configuration to use. If not specified defaults + * @param \SimpleSAML\Configuration $cronconfig The cron configuration to use. If not specified defaults * to `config/module_cron.php` */ - public function __construct(\SimpleSAML_Configuration $cronconfig = null) + public function __construct(\SimpleSAML\Configuration $cronconfig = null) { if ($cronconfig == null) { - $cronconfig = \SimpleSAML_Configuration::getConfig('module_cron.php'); + $cronconfig = \SimpleSAML\Configuration::getConfig('module_cron.php'); } $this->cronconfig = $cronconfig; } @@ -38,16 +38,16 @@ public function runTag($tag) throw new \Exception("Invalid cron tag '$tag''"); } - $summary = array(); - $croninfo = array( + $summary = []; + $croninfo = [ 'summary' => &$summary, 'tag' => $tag, - ); + ]; \SimpleSAML\Module::callHooks('cron', $croninfo); foreach ($summary as $s) { - \SimpleSAML\Logger::debug('Cron - Summary: ' . $s); + \SimpleSAML\Logger::debug('Cron - Summary: '.$s); } return $croninfo; diff --git a/vendor/simplesamlphp/simplesamlphp/modules/cron/locales/en/LC_MESSAGES/cron.po b/vendor/simplesamlphp/simplesamlphp/modules/cron/locales/en/LC_MESSAGES/cron.po index 21c02a769e..d55e2ff67f 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/cron/locales/en/LC_MESSAGES/cron.po +++ b/vendor/simplesamlphp/simplesamlphp/modules/cron/locales/en/LC_MESSAGES/cron.po @@ -63,3 +63,8 @@ msgstr "Here are the result for the cron job execution:" msgid "Cron result page" msgstr "Cron result page" +msgid "{cron:cron:link_cron}" +msgstr "Cron module information page" + +msgid "Cron module information page" +msgstr "Cron module information page" diff --git a/vendor/simplesamlphp/simplesamlphp/modules/cron/locales/es/LC_MESSAGES/cron.po b/vendor/simplesamlphp/simplesamlphp/modules/cron/locales/es/LC_MESSAGES/cron.po index a8a03ec8ac..826d86fe88 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/cron/locales/es/LC_MESSAGES/cron.po +++ b/vendor/simplesamlphp/simplesamlphp/modules/cron/locales/es/LC_MESSAGES/cron.po @@ -63,3 +63,8 @@ msgstr "Aqui están los resultados de las tareas en la ejecución del cron:" msgid "Cron result page" msgstr "Página de resultado del cron" +msgid "{cron:cron:link_cron}" +msgstr "Informe de cron" + +msgid "Cron module information page" +msgstr "Informe de cron" diff --git a/vendor/simplesamlphp/simplesamlphp/modules/cron/locales/nb/LC_MESSAGES/cron.po b/vendor/simplesamlphp/simplesamlphp/modules/cron/locales/nb/LC_MESSAGES/cron.po index f6ba2ef3c3..224c14a317 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/cron/locales/nb/LC_MESSAGES/cron.po +++ b/vendor/simplesamlphp/simplesamlphp/modules/cron/locales/nb/LC_MESSAGES/cron.po @@ -63,3 +63,8 @@ msgstr "Her er resultatene fra kjøring av cron-jobben:" msgid "Cron result page" msgstr "Cron resultatside" +msgid "{cron:cron:link_cron}" +msgstr "Informasjon om cron" + +msgid "Cron module information page" +msgstr "Informasjon om cron" diff --git a/vendor/simplesamlphp/simplesamlphp/modules/cron/locales/nn/LC_MESSAGES/cron.po b/vendor/simplesamlphp/simplesamlphp/modules/cron/locales/nn/LC_MESSAGES/cron.po index b782c3ad57..a326b56cbf 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/cron/locales/nn/LC_MESSAGES/cron.po +++ b/vendor/simplesamlphp/simplesamlphp/modules/cron/locales/nn/LC_MESSAGES/cron.po @@ -63,3 +63,8 @@ msgstr "Her er resultata frå køyring av cron-jobben:" msgid "Cron result page" msgstr "Cron resultatside" +msgid "{cron:cron:link_cron}" +msgstr "Informasjon om cron" + +msgid "Cron module information page" +msgstr "Informasjon om cron" diff --git a/vendor/simplesamlphp/simplesamlphp/modules/cron/templates/croninfo-result.php b/vendor/simplesamlphp/simplesamlphp/modules/cron/templates/croninfo-result.php index 489cd5d51f..e4f0dc1695 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/cron/templates/croninfo-result.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/cron/templates/croninfo-result.php @@ -3,16 +3,16 @@ $this->data['header'] = $this->t('cron_header'); $this->includeAtTemplateBase('includes/header.php'); ?> - <p><?php echo $this->t('cron_result_title') ?></p> - <pre style="color: #444; padding: 1em; border: 1px solid #eee; margin: .4em "><code> - <?php - echo '<h1>' .$this->t('cron_report_title'). '</h1><p>' .$this->t('ran_text'). ' ' .$this->data['time'] . '</p>' . - '<p>URL: <tt>' . $this->data['url'] . '</tt></p>' . - '<p>Tag: ' . $this->data['tag'] . "</p>\n\n" . - '<ul><li>' . join('</li><li>', $this->data['summary']) . '</li></ul>'; - ?> - </code> - </pre> + <p><?php echo $this->t('cron_result_title') ?></p> + <pre style="color: #444; padding: 1em; border: 1px solid #eee; margin: .4em "><code> +<?php + +echo ' <h1>'.$this->t('cron_report_title').'</h1><p>'.$this->t('ran_text'). + ' '.$this->data['time'].'</p>'.'<p>URL: <code>'.$this->data['url'].'</code></p>'. + '<p>Tag: '.$this->data['tag']."</p>\n\n". + '<ul><li>'.join('</li><li>', $this->data['summary']).'</li></ul>'; +?> + </code></pre> </div> <?php diff --git a/vendor/simplesamlphp/simplesamlphp/modules/cron/templates/croninfo-result.twig b/vendor/simplesamlphp/simplesamlphp/modules/cron/templates/croninfo-result.twig new file mode 100644 index 0000000000..f226ffe07e --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/modules/cron/templates/croninfo-result.twig @@ -0,0 +1,30 @@ +{% set pagetitle = 'Cron result page'|trans %} +{% extends "base.twig" %} + +{% block content %} + +<p> +{{ 'Here are the result for the cron job execution:'|trans }} +</p> + +<div class="code-box code-box-content"> +<h2>{{ 'Cron report'|trans }}</h2> + +<code> +{{ 'Cron ran at'|trans }} {{ time }} +<p> +URL: {{ url }} +</p> +<p> +Tag: {{ tag }} +</p> +<p><ul> +{% for sum in summary %} + <li> {{ sum }}</li> +{% endfor %} +</ul><br /> +</p> +</code> + +</div> +{% endblock %} diff --git a/vendor/simplesamlphp/simplesamlphp/modules/cron/templates/croninfo.tpl.php b/vendor/simplesamlphp/simplesamlphp/modules/cron/templates/croninfo.tpl.php index 49aa3131e0..50efe15a1e 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/cron/templates/croninfo.tpl.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/cron/templates/croninfo.tpl.php @@ -6,31 +6,27 @@ $run_text = $this->t('run_text'); ?> - <p><?php echo $this->t('cron_info') ?></p> + <p><?php echo $this->t('cron_info') ?></p> - <p><?php echo $this->t('cron_suggestion') ?></p> - <pre style="font-size: x-small; color: #444; padding: 1em; border: 1px solid #eee; margin: .4em "><code><?php - - foreach ($this->data['urls'] AS $url ) { - echo "# " . $run_text. ' [' .$url['tag']. ']' . "\n"; - echo "" . $url['int'] . " curl --silent \"" . $url['href'] . "\" > /dev/null 2>&1\n"; - } - - ?> - </code></pre> - - <br><p><?php echo $this->t('cron_execution') ?></p> - <ul> - <?php - - foreach ($this->data['urls'] AS $url ) { - echo '<li><a href="' . $url['href'] . '&output=xhtml">' . $run_text. ' [' .$url['tag']. ']' . '</a></li>'; - } - - ?> - - </ul> + <p><?php echo $this->t('cron_suggestion') ?></p> + <pre style="font-size: x-small; color: #444; padding: 1em; border: 1px solid #eee; margin: .4em "><code> +<?php +foreach ($this->data['urls'] as $url) { + echo "# ".$run_text. ' ['.$url['tag'].']'."\n"; + echo $url['int']." curl --silent \"".$url['href']."\" > /dev/null 2>&1\n"; +} +?> + </code></pre> + <br /> + <p><?php echo $this->t('cron_execution') ?></p> + <ul> +<?php +foreach ($this->data['urls'] as $url) { + echo ' <li><a href="'.$url['href'].'&output=xhtml">'.$run_text.' ['.$url['tag'].']'.'</a></li>'; +} +?> + </ul> </div> <?php diff --git a/vendor/simplesamlphp/simplesamlphp/modules/cron/templates/croninfo.twig b/vendor/simplesamlphp/simplesamlphp/modules/cron/templates/croninfo.twig new file mode 100644 index 0000000000..b00b8905b8 --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/modules/cron/templates/croninfo.twig @@ -0,0 +1,29 @@ +{% set pagetitle = 'Cron result page'|trans %} +{% extends "base.twig" %} + +{% block preload %} +<link rel="stylesheet" type="text/css" href="{{ baseurlpath }}assets/css/cron.css"> +{% endblock %} + +{% block content %} + <h2>{{ 'Cron result page'|trans }}</h2> + <p>{{ 'Cron is a way to run things regularly on unix systems.'|trans }}<br /><br /></p> + <p>{{ 'Here is a suggestion for a crontab file:'|trans }}<br /><br /></p> + + <div class="code-box code-box-content"> + <code id="cronlist"> + {% for url in urls %} + # {{ 'Run cron:'|trans }} [{{ url.tag }}]<br /> + {{ url.int }} curl --silent "{{ url.href }}" > /dev/null 2>&1<br /> + {% endfor %} + </code></div><br /> + + <p>{{ 'Click here to run the cron jobs:'|trans }}</p> + <ul> + {% for url in urls %} + <li><a href="{{ url.href }}&output=xhtml">{{ 'Run cron:'|trans }} {{ url.tag }}</a></li> + {% endfor %} + </ul> + </p> + +{% endblock %} diff --git a/vendor/simplesamlphp/simplesamlphp/modules/cron/www/assets/css/cron.css b/vendor/simplesamlphp/simplesamlphp/modules/cron/www/assets/css/cron.css new file mode 100644 index 0000000000..459178ed6c --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/modules/cron/www/assets/css/cron.css @@ -0,0 +1,3 @@ +code#cronlist { + font-size: 0.8vw; +} diff --git a/vendor/simplesamlphp/simplesamlphp/modules/cron/www/cron.php b/vendor/simplesamlphp/simplesamlphp/modules/cron/www/cron.php index 4f22fc5df0..fb93059281 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/cron/www/cron.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/cron/www/cron.php @@ -1,52 +1,49 @@ <?php -$config = SimpleSAML_Configuration::getInstance(); -$cronconfig = SimpleSAML_Configuration::getConfig('module_cron.php'); +$config = \SimpleSAML\Configuration::getInstance(); +$cronconfig = \SimpleSAML\Configuration::getConfig('module_cron.php'); if (!is_null($cronconfig->getValue('key'))) { - if ($_REQUEST['key'] !== $cronconfig->getValue('key')) { - SimpleSAML\Logger::error('Cron - Wrong key provided. Cron will not run.'); - exit; - } + if ($_REQUEST['key'] !== $cronconfig->getValue('key')) { + \SimpleSAML\Logger::error('Cron - Wrong key provided. Cron will not run.'); + exit; + } } -$cron = new SimpleSAML\Module\cron\Cron(); +$cron = new \SimpleSAML\Module\cron\Cron(); if (!$cron->isValidTag($_REQUEST['tag'])) { - SimpleSAML\Logger::error('Cron - Illegal tag [' . $_REQUEST['tag'] . '].'); + SimpleSAML\Logger::error('Cron - Illegal tag ['.$_REQUEST['tag'].'].'); exit; } - $url = \SimpleSAML\Utils\HTTP::getSelfURL(); $time = date(DATE_RFC822); $croninfo = $cron->runTag($_REQUEST['tag']); $summary = $croninfo['summary']; -if ($cronconfig->getValue('sendemail', TRUE) && count($summary) > 0) { - - $message = '<h1>Cron report</h1><p>Cron ran at ' . $time . '</p>' . - '<p>URL: <tt>' . $url . '</tt></p>' . - '<p>Tag: ' . $croninfo['tag'] . "</p>\n\n" . - '<ul><li>' . join('</li><li>', $summary) . '</li></ul>'; - - $toaddress = $config->getString('technicalcontact_email', 'na@example.org'); - if($toaddress == 'na@example.org') { - SimpleSAML\Logger::error('Cron - Could not send email. [technicalcontact_email] not set in config.'); - } else { - // Use $toaddress for both TO and FROM - $email = new SimpleSAML_XHTML_EMail($toaddress, 'SimpleSAMLphp cron report', $toaddress); - $email->setBody($message); - $email->send(); - } - +if ($cronconfig->getValue('sendemail', true) && count($summary) > 0) { + $message = '<h1>Cron report</h1><p>Cron ran at '.$time.'</p>'. + '<p>URL: <code>'.$url.'</code></p>'. + '<p>Tag: '.$croninfo['tag']."</p>\n\n". + '<ul><li>'.join('</li><li>', $summary).'</li></ul>'; + + $toaddress = $config->getString('technicalcontact_email', 'na@example.org'); + if ($toaddress == 'na@example.org') { + \SimpleSAML\Logger::error('Cron - Could not send email. [technicalcontact_email] not set in config.'); + } else { + // Use $toaddress for both TO and FROM + $email = new \SimpleSAML\XHTML\EMail($toaddress, 'SimpleSAMLphp cron report', $toaddress); + $email->setBody($message); + $email->send(); + } } if (isset($_REQUEST['output']) && $_REQUEST['output'] == "xhtml") { - $t = new SimpleSAML_XHTML_Template($config, 'cron:croninfo-result.php','cron:cron'); - $t->data['tag'] = $croninfo['tag']; - $t->data['time'] = $time; - $t->data['url'] = $url; - $t->data['summary'] = $summary; - $t->show(); + $t = new \SimpleSAML\XHTML\Template($config, 'cron:croninfo-result.php', 'cron:cron'); + $t->data['tag'] = $croninfo['tag']; + $t->data['time'] = $time; + $t->data['url'] = $url; + $t->data['summary'] = $summary; + $t->show(); } diff --git a/vendor/simplesamlphp/simplesamlphp/modules/cron/www/croninfo.php b/vendor/simplesamlphp/simplesamlphp/modules/cron/www/croninfo.php index 93b7acb5b1..8a0aac4d52 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/cron/www/croninfo.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/cron/www/croninfo.php @@ -4,38 +4,36 @@ * The _include script registers a autoloader for the SimpleSAMLphp libraries. It also * initializes the SimpleSAMLphp config class with the correct path. */ -require_once('_include.php'); +require_once('_include.php'); -// Load SimpleSAMLphp, configuration and metadata -$config = SimpleSAML_Configuration::getInstance(); -$session = SimpleSAML_Session::getSessionFromRequest(); +// Load SimpleSAMLphp configuration and metadata +$config = \SimpleSAML\Configuration::getInstance(); +$session = \SimpleSAML\Session::getSessionFromRequest(); -SimpleSAML\Utils\Auth::requireAdmin(); +\SimpleSAML\Utils\Auth::requireAdmin(); -$cronconfig = SimpleSAML_Configuration::getConfig('module_cron.php'); +$cronconfig = \SimpleSAML\Configuration::getConfig('module_cron.php'); $key = $cronconfig->getValue('key', ''); $tags = $cronconfig->getValue('allowed_tags'); -$def = array( - 'weekly' => "22 0 * * 0", - 'daily' => "02 0 * * *", - 'hourly' => "01 * * * *", - 'default' => "XXXXXXXXXX", -); - -$urls = array(); -foreach ($tags AS $tag) { - $urls[] = array( - 'href' => SimpleSAML\Module::getModuleURL('cron/cron.php', array('key' => $key, 'tag' => $tag)), - 'tag' => $tag, - 'int' => (array_key_exists($tag, $def) ? $def[$tag] : $def['default']), - ); +$def = [ + 'weekly' => "22 0 * * 0", + 'daily' => "02 0 * * *", + 'hourly' => "01 * * * *", + 'default' => "XXXXXXXXXX", +]; + +$urls = []; +foreach ($tags as $tag) { + $urls[] = [ + 'href' => \SimpleSAML\Module::getModuleURL('cron/cron.php', ['key' => $key, 'tag' => $tag]), + 'tag' => $tag, + 'int' => (array_key_exists($tag, $def) ? $def[$tag] : $def['default']), + ]; } - - -$t = new SimpleSAML_XHTML_Template($config, 'cron:croninfo.tpl.php', 'cron:cron'); +$t = new \SimpleSAML\XHTML\Template($config, 'cron:croninfo.tpl.php', 'cron:cron'); $t->data['urls'] = $urls; $t->show(); diff --git a/vendor/simplesamlphp/simplesamlphp/modules/discopower/config-templates/module_discopower.php b/vendor/simplesamlphp/simplesamlphp/modules/discopower/config-templates/module_discopower.php index 5f5507f764..498cadad83 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/discopower/config-templates/module_discopower.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/discopower/config-templates/module_discopower.php @@ -1,46 +1,45 @@ <?php -/* +/* * Configuration for the DiscoPower module. */ -$config = array ( +$config = [ + // Which tab should be set as default. 0 is the first tab + 'defaulttab' => 0, - // Which tab should be set as default. 0 is the first tab - 'defaulttab' => 0, - - /* - * List a set of tags (Tabs) that should be listed in a specific order. - * All other available tabs will be listed after the ones specified below. - */ - 'taborder' => array('norway'), - /* - * the 'tab' parameter allows you to limit the tabs to a specific list. (excluding unlisted tags) - * - * 'tabs' => array('norway', 'finland'), - */ - - /** - * If you want to change the scoring algorithm to a more google suggest like one - * (filters by start of words) uncomment this ... - * - * 'score' => 'suggest', - */ + /* + * List a set of tags (Tabs) that should be listed in a specific order. + * All other available tabs will be listed after the ones specified below. + */ + 'taborder' => ['norway'], - /* - * The domain to use for common domain cookie support. - * This must be a parent domain of the domain hosting the discovery service. - * - * If this is NULL (the default), common domain cookie support will be disabled. - */ - 'cdc.domain' => NULL, + /* + * the 'tab' parameter allows you to limit the tabs to a specific list. (excluding unlisted tags) + * + * 'tabs' => array('norway', 'finland'), + */ - /* - * The lifetime of the common domain cookie, in seconds. - * - * If this is NULL (the default), the common domain cookie will be deleted when the browser closes. - * - * Example: 'cdc.lifetime' => 180*24*60*60, // 180 days - */ - 'cdc.lifetime' => NULL, + /* + * If you want to change the scoring algorithm to a more google suggest like one + * (filters by start of words) uncomment this ... + * + * 'score' => 'suggest', + */ -); + /* + * The domain to use for common domain cookie support. + * This must be a parent domain of the domain hosting the discovery service. + * + * If this is NULL (the default), common domain cookie support will be disabled. + */ + 'cdc.domain' => null, + + /* + * The lifetime of the common domain cookie, in seconds. + * + * If this is NULL (the default), the common domain cookie will be deleted when the browser closes. + * + * Example: 'cdc.lifetime' => 180*24*60*60, // 180 days + */ + 'cdc.lifetime' => null, +]; diff --git a/vendor/simplesamlphp/simplesamlphp/modules/discopower/dictionaries/tabs.definition.json b/vendor/simplesamlphp/simplesamlphp/modules/discopower/dictionaries/tabs.definition.json index 51c3ca41b8..323a7165c8 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/discopower/dictionaries/tabs.definition.json +++ b/vendor/simplesamlphp/simplesamlphp/modules/discopower/dictionaries/tabs.definition.json @@ -37,5 +37,8 @@ }, "ukacessfederation": { "en": "UK Access Federation" + }, + "incremental_search": { + "en": "Incremental search..." } } diff --git a/vendor/simplesamlphp/simplesamlphp/modules/discopower/dictionaries/tabs.translation.json b/vendor/simplesamlphp/simplesamlphp/modules/discopower/dictionaries/tabs.translation.json index 558d2d572f..cfa48b63ed 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/discopower/dictionaries/tabs.translation.json +++ b/vendor/simplesamlphp/simplesamlphp/modules/discopower/dictionaries/tabs.translation.json @@ -7,7 +7,9 @@ "gl": "Noruega", "da": "Norge", "af": "Noorwe\u00eb", - "el": "\u039d\u03bf\u03c1\u03b2\u03b7\u03b3\u03af\u03b1" + "el": "\u039d\u03bf\u03c1\u03b2\u03b7\u03b3\u03af\u03b1", + "xh": "Norowe", + "zu": "ENorway" }, "kalmar": { "es": "Kalmar", @@ -26,7 +28,8 @@ "gl": "Finlandia", "da": "Finland", "af": "Finland", - "el": "\u03a6\u03b9\u03bd\u03bb\u03b1\u03bd\u03b4\u03af\u03b1" + "el": "\u03a6\u03b9\u03bd\u03bb\u03b1\u03bd\u03b4\u03af\u03b1", + "xh": "Finlend" }, "sweden": { "es": "Suecia", @@ -36,7 +39,9 @@ "gl": "Suecia", "da": "Sverige", "af": "Swede", - "el": "\u03a3\u03bf\u03c5\u03b7\u03b4\u03af\u03b1" + "el": "\u03a3\u03bf\u03c5\u03b7\u03b4\u03af\u03b1", + "xh": "Swiden", + "zu": "Sweden" }, "iceland": { "es": "Islandia", @@ -46,7 +51,9 @@ "gl": "Islandia", "da": "Island", "af": "Ysland", - "el": "\u0399\u03c3\u03bb\u03b1\u03bd\u03b4\u03af\u03b1" + "el": "\u0399\u03c3\u03bb\u03b1\u03bd\u03b4\u03af\u03b1", + "xh": "Ayisilend", + "zu": "I-Iceland" }, "denmark": { "es": "Dinamarca", @@ -56,7 +63,8 @@ "gl": "Dinamarca", "da": "Danmark", "af": "Denmark", - "el": "\u0394\u03b1\u03bd\u03af\u03b1" + "el": "\u0394\u03b1\u03bd\u03af\u03b1", + "xh": "Dominikha" }, "switzerland": { "es": "Suiza", @@ -66,17 +74,19 @@ "gl": "Suiza", "da": "Schweiz", "af": "Switserland", - "el": "\u0395\u03bb\u03b2\u03b5\u03c4\u03af\u03b1" + "el": "\u0395\u03bb\u03b2\u03b5\u03c4\u03af\u03b1", + "xh": "Swizalend", + "zu": "ESwitzerland" }, "greece": { "es": "Grecia", - "ru": "\u0413\u0440\u0435\u0446\u0438\u044f", "nl": "Griekenland", "gl": "Grecia", "ru": "\u0413\u0440\u0435\u0446\u0438\u044f", "da": "Gr\u00e6kenland", "af": "Griekeland", - "el": "\u0395\u03bb\u03bb\u03ac\u03b4\u03b1" + "el": "\u0395\u03bb\u03bb\u03ac\u03b4\u03b1", + "xh": "Grisi" }, "southafrica": { "es": "Sud\u00e1frica", @@ -98,7 +108,9 @@ "gl": "Europa (eduGAIN)", "da": "Europa (eduGAIN)", "af": "Europa (eduGAIN)", - "el": "\u0395\u03c5\u03c1\u03ce\u03c0\u03b7 (eduGAIN)" + "el": "\u0395\u03c5\u03c1\u03ce\u03c0\u03b7 (eduGAIN)", + "xh": "Yurophu (eduGAIN)", + "zu": "IYurophu (eduGAIN)" }, "misc": { "es": "Otros", @@ -108,7 +120,9 @@ "gl": "Miscelanea", "da": "Forskellige", "af": "Verskeie", - "el": "\u0386\u03bb\u03bb\u03bf\u03b9 \u03c6\u03bf\u03c1\u03b5\u03af\u03c2" + "el": "\u0386\u03bb\u03bb\u03bf\u03b9 \u03c6\u03bf\u03c1\u03b5\u03af\u03c2", + "xh": "Ezahlukahlukeneyo", + "zu": "Ezihlukahlukene" }, "incommon": { "es": "InCommon", @@ -125,5 +139,10 @@ "da": "Storbritanniens adgangsf\u00f8deration", "af": "UK Toegangs Federasie", "el": "\u039f\u03bc\u03bf\u03c3\u03c0\u03bf\u03bd\u03b4\u03af\u03b1 UK Access" + }, + "incremental_search": { + "af": "Inkrementele soektog...", + "zu": "Ukucinga okukhulayo...", + "xh": "Ukhangelo oluqhubekayo..." } } diff --git a/vendor/simplesamlphp/simplesamlphp/modules/discopower/lib/PowerIdPDisco.php b/vendor/simplesamlphp/simplesamlphp/modules/discopower/lib/PowerIdPDisco.php index a20da4dfd1..a0955cb32d 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/discopower/lib/PowerIdPDisco.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/discopower/lib/PowerIdPDisco.php @@ -1,5 +1,6 @@ <?php +namespace SimpleSAML\Module\discopower; /** * This class implements a generic IdP discovery service, for use in various IdP discovery service pages. This should @@ -10,14 +11,13 @@ * @author Andreas Åkre Solberg <andreas@uninett.no>, UNINETT AS. * @package SimpleSAMLphp */ -class sspmod_discopower_PowerIdPDisco extends SimpleSAML_XHTML_IdPDisco -{ - +class PowerIdPDisco extends \SimpleSAML\XHTML\IdPDisco +{ /** * The configuration for this instance. * - * @var SimpleSAML_Configuration + * @var \SimpleSAML\Configuration */ private $discoconfig; @@ -51,7 +51,7 @@ public function __construct(array $metadataSets, $instance) { parent::__construct($metadataSets, $instance); - $this->discoconfig = SimpleSAML_Configuration::getConfig('module_discopower.php'); + $this->discoconfig = \SimpleSAML\Configuration::getConfig('module_discopower.php'); $this->cdcDomain = $this->discoconfig->getString('cdc.domain', null); if ($this->cdcDomain !== null && $this->cdcDomain[0] !== '.') { @@ -72,7 +72,7 @@ public function __construct(array $metadataSets, $instance) */ protected function log($message) { - SimpleSAML\Logger::info('PowerIdPDisco.'.$this->instance.': '.$message); + \SimpleSAML\Logger::info('PowerIdPDisco.'.$this->instance.': '.$message); } @@ -110,24 +110,24 @@ public static function mcmp(array $a, array $b) */ protected function idplistStructured($list) { - $slist = array(); + $slist = []; $order = $this->discoconfig->getValue('taborder'); if (is_array($order)) { foreach ($order as $oe) { - $slist[$oe] = array(); + $slist[$oe] = []; } } $enableTabs = $this->discoconfig->getValue('tabs', null); foreach ($list as $key => $val) { - $tags = array('misc'); + $tags = ['misc']; if (array_key_exists('tags', $val)) { $tags = $val['tags']; } foreach ($tags as $tag) { - if (!empty($enableTabs) && !in_array($tag, $enableTabs, true)) { + if (!empty($enableTabs) && !in_array($tag, $enableTabs)) { continue; } $slist[$tag][$key] = $val; @@ -135,7 +135,7 @@ protected function idplistStructured($list) } foreach ($slist as $tab => $tbslist) { - uasort($slist[$tab], array('sspmod_discopower_PowerIdPDisco', 'mcmp')); + uasort($slist[$tab], ['\SimpleSAML\Module\discopower\PowerIdPDisco', 'mcmp']); } return $slist; @@ -153,21 +153,21 @@ protected function idplistStructured($list) */ private function processFilter($filter, $entry, $default = true) { - if (in_array($entry['entityid'], $filter['entities.include'], true)) { + if (in_array($entry['entityid'], $filter['entities.include'])) { return true; } - if (in_array($entry['entityid'], $filter['entities.exclude'], true)) { + if (in_array($entry['entityid'], $filter['entities.exclude'])) { return false; } if (array_key_exists('tags', $entry)) { foreach ($filter['tags.include'] as $fe) { - if (in_array($fe, $entry['tags'], true)) { + if (in_array($fe, $entry['tags'])) { return true; } } foreach ($filter['tags.exclude'] as $fe) { - if (in_array($fe, $entry['tags'], true)) { + if (in_array($fe, $entry['tags'])) { return false; } } @@ -190,7 +190,7 @@ protected function filterList($list) try { $spmd = $this->metadata->getMetaData($this->spEntityId, 'saml20-sp-remote'); - } catch (Exception $e) { + } catch (\Exception $e) { return $list; } @@ -203,27 +203,26 @@ protected function filterList($list) $filter = $spmd['discopower.filter']; if (!array_key_exists('entities.include', $filter)) { - $filter['entities.include'] = array(); + $filter['entities.include'] = []; } if (!array_key_exists('entities.exclude', $filter)) { - $filter['entities.exclude'] = array(); + $filter['entities.exclude'] = []; } if (!array_key_exists('tags.include', $filter)) { - $filter['tags.include'] = array(); + $filter['tags.include'] = []; } if (!array_key_exists('tags.exclude', $filter)) { - $filter['tags.exclude'] = array(); + $filter['tags.exclude'] = []; } $defaultrule = true; if (array_key_exists('entities.include', $spmd['discopower.filter']) || array_key_exists('tags.include', $spmd['discopower.filter']) ) { - $defaultrule = false; } - $returnlist = array(); + $returnlist = []; foreach ($list as $key => $entry) { if ($this->processFilter($filter, $entry, $defaultrule)) { $returnlist[$key] = $entry; @@ -246,44 +245,123 @@ public function handleRequest() $idpList = $this->getIdPList(); $idpList = $this->idplistStructured($this->filterList($idpList)); $preferredIdP = $this->getRecommendedIdP(); - $faventry = NULL; - foreach ($idpList AS $tab => $slist) { + + $t = new \SimpleSAML\XHTML\Template($this->config, 'discopower:disco.tpl.php', 'disco'); + $discoPowerTabs = [ + 'denmark' => \SimpleSAML\Locale\Translate::noop('{discopower:tabs:denmark}'), + 'edugain' => \SimpleSAML\Locale\Translate::noop('{discopower:tabs:edugain}'), + 'finland' => \SimpleSAML\Locale\Translate::noop('{discopower:tabs:finland}'), + 'greece' => \SimpleSAML\Locale\Translate::noop('{discopower:tabs:greece}'), + 'southafrica' => \SimpleSAML\Locale\Translate::noop('{discopower:tabs:southafrica}'), + 'iceland' => \SimpleSAML\Locale\Translate::noop('{discopower:tabs:iceland}'), + 'incommon' => \SimpleSAML\Locale\Translate::noop('{discopower:tabs:incommon}'), + 'kalmar' => \SimpleSAML\Locale\Translate::noop('{discopower:tabs:kalmar}'), + 'misc' => \SimpleSAML\Locale\Translate::noop('{discopower:tabs:misc}'), + 'norway' => \SimpleSAML\Locale\Translate::noop('{discopower:tabs:norway}'), + 'sweden' => \SimpleSAML\Locale\Translate::noop('{discopower:tabs:sweden}'), + 'switzerland' => \SimpleSAML\Locale\Translate::noop('{discopower:tabs:switzerland}'), + 'ukacessfederation' => \SimpleSAML\Locale\Translate::noop('{discopower:tabs:ukacessfederation}'), + ]; + + $t->data['return'] = $this->returnURL; + $t->data['returnIDParam'] = $this->returnIdParam; + $t->data['entityID'] = $this->spEntityId; + $t->data['defaulttab'] = $this->discoconfig->getValue('defaulttab', 0); + + $idpList = $this->processMetadata($t, $idpList, $preferredIdP); + + $t->data['idplist'] = $idpList; + foreach ($idpList as $tab => $slist) { if (!empty($preferredIdP) && array_key_exists($preferredIdP, $slist)) { - $faventry = $slist[$preferredIdP]; + $t->data['faventry'] = $slist[$preferredIdP]; + break; } } - $t = new SimpleSAML_XHTML_Template($this->config, 'discopower:disco.tpl.php', 'disco'); - $discoPowerTabs = array( - 'denmark' => $t->noop('{discopower:tabs:denmark}'), - 'edugain' => $t->noop('{discopower:tabs:edugain}'), - 'finland' => $t->noop('{discopower:tabs:finland}'), - 'greece' => $t->noop('{discopower:tabs:greece}'), - 'southafrica' => $t->noop('{discopower:tabs:southafrica}'), - 'iceland' => $t->noop('{discopower:tabs:iceland}'), - 'incommon' => $t->noop('{discopower:tabs:incommon}'), - 'kalmar' => $t->noop('{discopower:tabs:kalmar}'), - 'misc' => $t->noop('{discopower:tabs:misc}'), - 'norway' => $t->noop('{discopower:tabs:norway}'), - 'sweden' => $t->noop('{discopower:tabs:sweden}'), - 'switzerland' => $t->noop('{discopower:tabs:switzerland}'), - 'ukacessfederation' => $t->noop('{discopower:tabs:ukacessfederation}'), - ); - $t->data['faventry'] = $faventry; + if (!empty($t->data['faventry'])) { + $t->data['autofocus'] = 'favouritesubmit'; + } + + $search = '<script type="text/javascript"> + $(document).ready(function() { + $("#tabdiv").tabs({ selected: '.$t->data['defaulttab'].' });'; + $i = 0; + foreach ($idpList as $tab => $slist) { + $search .= "\n".'$("#query_'.$tab.'").liveUpdate("#list_'.$tab.'")'. + (($i++ == 0) && (empty($this->data['faventry'])) ? '.focus()' : '').';'; + } + $search .= "});\n</script>"; + + $t->data['search'] = $search; + $t->data['score'] = $this->discoconfig->getValue('score', 'quicksilver'); $t->data['tabNames'] = $discoPowerTabs; - $t->data['idplist'] = $idpList; $t->data['preferredidp'] = $preferredIdP; - $t->data['return'] = $this->returnURL; - $t->data['returnIDParam'] = $this->returnIdParam; - $t->data['entityID'] = $this->spEntityId; $t->data['urlpattern'] = htmlspecialchars(\SimpleSAML\Utils\HTTP::getSelfURLNoQuery()); $t->data['rememberenabled'] = $this->config->getBoolean('idpdisco.enableremember', false); $t->data['rememberchecked'] = $this->config->getBoolean('idpdisco.rememberchecked', false); - $t->data['defaulttab'] = $this->discoconfig->getValue('defaulttab', 0); - $t->data['score'] = $this->discoconfig->getValue('score', 'quicksilver'); + $t->data['jquery'] = ['core' => true, 'ui' => true]; $t->show(); } + private function processMetadata($t, $metadata, $favourite) + { + $basequerystring = '?'. + 'entityID='.urlencode($t->data['entityID']).'&'. + 'return='.urlencode($t->data['return']).'&'. + 'returnIDParam='.urlencode($t->data['returnIDParam']).'&idpentityid='; + + foreach ($metadata as $tab => $idps) { + foreach ($idps as $entityid => $entity) { + $translation = false; + + // Translate name + if (isset($entity['UIInfo']['DisplayName'])) { + $displayName = $entity['UIInfo']['DisplayName']; + + // Should always be an array of language code -> translation + assert(is_array($displayName)); + + if (!empty($displayName)) { + $translation = $t->getTranslator()->getPreferredTranslation($displayName); + } + } + + if (($translation === false) && array_key_exists('name', $entity)) { + if (is_array($entity['name'])) { + $translation = $t->getTranslator()->getPreferredTranslation($entity['name']); + } else { + $translation = $entity['name']; + } + } + + if ($translation === false) { + $translation = $entity['entityid']; + } + $entity['translated'] = $translation; + + // HTML output + if ($entity['entityid'] === $favourite) { + $html = '<a class="metaentry favourite" href="'. + $basequerystring.urlencode($entity['entityid']).'">'; + } else { + $html = '<a class="metaentry" href="'. + $basequerystring.urlencode($entity['entityid']).'">'; + } + $html .= $entity['translated']; + if (array_key_exists('icon', $entity) && $entity['icon'] !== null) { + $iconUrl = \SimpleSAML\Utils\HTTP::resolveURL($entity['icon']); + $html .= '<img alt="Icon for identity provider" class="entryicon" src="'. + htmlspecialchars($iconUrl).'" />'; + } + $html .= '</a>'; + $entity['html'] = $html; + + // Save processed data + $metadata[$tab][$entityid] = $entity; + } + } + return $metadata; + } /** * Get the IdP entities saved in the common domain cookie. @@ -293,7 +371,7 @@ public function handleRequest() private function getCDC() { if (!isset($_COOKIE['_saml_idp'])) { - return array(); + return []; } $ret = (string) $_COOKIE['_saml_idp']; @@ -302,7 +380,7 @@ private function getCDC() $idp = base64_decode($idp); if ($idp === false) { // not properly base64 encoded - return array(); + return []; } } @@ -319,7 +397,7 @@ private function getCDC() */ protected function setPreviousIdP($idp) { - assert('is_string($idp)'); + assert(is_string($idp)); if ($this->cdcDomain === null) { parent::setPreviousIdP($idp); @@ -349,12 +427,12 @@ protected function setPreviousIdP($idp) $newCookie = $tmp[1]; } - $params = array( + $params = [ 'lifetime' => $this->cdcLifetime, 'domain' => $this->cdcDomain, 'secure' => true, 'httponly' => false, - ); + ]; \SimpleSAML\Utils\HTTP::setCookie('_saml_idp', $newCookie, $params, false); } diff --git a/vendor/simplesamlphp/simplesamlphp/modules/discopower/locales/af/LC_MESSAGES/discopower.po b/vendor/simplesamlphp/simplesamlphp/modules/discopower/locales/af/LC_MESSAGES/discopower.po index b7e93ff917..e8349c6886 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/discopower/locales/af/LC_MESSAGES/discopower.po +++ b/vendor/simplesamlphp/simplesamlphp/modules/discopower/locales/af/LC_MESSAGES/discopower.po @@ -5,15 +5,14 @@ msgstr "" "Project-Id-Version: SimpleSAMLphp 1.15\n" "Report-Msgid-Bugs-To: simplesamlphp-translation@googlegroups.com\n" "POT-Creation-Date: 2016-10-12 09:23+0200\n" -"PO-Revision-Date: 2016-10-14 12:14+0200\n" +"PO-Revision-Date: 2018-11-15 15:02+0200\n" "Last-Translator: \n" -"Language: af\n" "Language-Team: \n" "Plural-Forms: nplurals=2; plural=(n != 1)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" -"Generated-By: Babel 2.3.4\n" +"Generated-By: Babel 1.3\n" msgid "{discopower:tabs:ukacessfederation}" msgstr "UK Toegangs Federasie" @@ -93,3 +92,6 @@ msgstr "Europa (eduGAIN)" msgid "InCommon" msgstr "InCommon" +msgid "{discopower:tabs:incremental_search}" +msgstr "Inkrementele soektog..." + diff --git a/vendor/simplesamlphp/simplesamlphp/modules/discopower/locales/xh/LC_MESSAGES/discopower.po b/vendor/simplesamlphp/simplesamlphp/modules/discopower/locales/xh/LC_MESSAGES/discopower.po new file mode 100644 index 0000000000..6d224162b9 --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/modules/discopower/locales/xh/LC_MESSAGES/discopower.po @@ -0,0 +1,49 @@ + +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: SimpleSAMLphp 1.15\n" +"Report-Msgid-Bugs-To: simplesamlphp-translation@googlegroups.com\n" +"POT-Creation-Date: 2018-11-15 14:48+0200\n" +"PO-Revision-Date: 2018-11-15 15:02+0200\n" +"Last-Translator: \n" +"Language-Team: \n" +"Plural-Forms: nplurals=2; plural=(n != 1)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 1.3\n" + +msgid "{discopower:tabs:misc}" +msgstr "Ezahlukahlukeneyo" + +msgid "{discopower:tabs:finland}" +msgstr "Finlend" + +msgid "{discopower:tabs:sweden}" +msgstr "Swiden" + +msgid "{discopower:tabs:southafrica}" +msgstr "uMzantsi Afrika" + +msgid "{discopower:tabs:switzerland}" +msgstr "Swizalend" + +msgid "{discopower:tabs:iceland}" +msgstr "Ayisilend" + +msgid "{discopower:tabs:denmark}" +msgstr "Dominikha" + +msgid "{discopower:tabs:greece}" +msgstr "Grisi" + +msgid "{discopower:tabs:edugain}" +msgstr "Yurophu (eduGAIN)" + +msgid "{discopower:tabs:norway}" +msgstr "Norowe" + +msgid "{discopower:tabs:incremental_search}" +msgstr "Ukhangelo oluqhubekayo..." + diff --git a/vendor/simplesamlphp/simplesamlphp/modules/discopower/locales/zu/LC_MESSAGES/discopower.po b/vendor/simplesamlphp/simplesamlphp/modules/discopower/locales/zu/LC_MESSAGES/discopower.po new file mode 100644 index 0000000000..800d5dc2a5 --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/modules/discopower/locales/zu/LC_MESSAGES/discopower.po @@ -0,0 +1,40 @@ + +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: SimpleSAMLphp 1.15\n" +"Report-Msgid-Bugs-To: simplesamlphp-translation@googlegroups.com\n" +"POT-Creation-Date: 2018-11-15 14:48+0200\n" +"PO-Revision-Date: 2018-11-15 14:48+0200\n" +"Last-Translator: \n" +"Language-Team: \n" +"Plural-Forms: nplurals=2; plural=(n != 1)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 1.3\n" + +msgid "{discopower:tabs:misc}" +msgstr "Ezihlukahlukene" + +msgid "{discopower:tabs:sweden}" +msgstr "Sweden" + +msgid "{discopower:tabs:incremental_search}" +msgstr "Ukucinga okukhulayo..." + +msgid "{discopower:tabs:southafrica}" +msgstr "iNingizimu Afrika" + +msgid "{discopower:tabs:switzerland}" +msgstr "ESwitzerland" + +msgid "{discopower:tabs:iceland}" +msgstr "I-Iceland" + +msgid "{discopower:tabs:edugain}" +msgstr "IYurophu (eduGAIN)" + +msgid "{discopower:tabs:norway}" +msgstr "ENorway" + diff --git a/vendor/simplesamlphp/simplesamlphp/modules/discopower/templates/disco.tpl.php b/vendor/simplesamlphp/simplesamlphp/modules/discopower/templates/disco.tpl.php index 4e1bf6c422..3472a6e303 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/discopower/templates/disco.tpl.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/discopower/templates/disco.tpl.php @@ -1,175 +1,134 @@ <?php -if(!array_key_exists('header', $this->data)) { - $this->data['header'] = 'selectidp'; -} -$this->data['header'] = $this->t($this->data['header']); -$this->data['jquery'] = array('core' => TRUE, 'ui' => TRUE, 'css' => TRUE); - -$this->data['head'] = '<link rel="stylesheet" media="screen" type="text/css" href="' . SimpleSAML\Module::getModuleUrl('discopower/style.css') . '" />'; - -$this->data['head'] .= '<script type="text/javascript" src="' . SimpleSAML\Module::getModuleUrl('discopower/js/jquery.livesearch.js') . '"></script>'; -$this->data['head'] .= '<script type="text/javascript" src="' . SimpleSAML\Module::getModuleUrl('discopower/js/' . $this->data['score'] . '.js') . '"></script>'; +$this->data['header'] = $this->t('selectidp'); +$this->data['jquery'] = ['core' => true, 'ui' => true, 'css' => true]; -$this->data['head'] .= '<script type="text/javascript"> - -$(document).ready(function() { - $("#discotabs").tabs({ selected: ' . $this->data['defaulttab'] . ' }); '; - -$i = 0; -foreach ($this->data['idplist'] AS $tab => $slist) { - $this->data['head'] .= "\n" . '$("#query_' . $tab . '").liveUpdate("#list_' . $tab . '")' . - (($i++ == 0) && (empty($this->data['faventry'])) ? '.focus()' : '') . - ';'; +$this->data['head'] = '<link rel="stylesheet" media="screen" type="text/css" href="'. + SimpleSAML\Module::getModuleURL('discopower/assets/css/disco.css').'" />'; +$this->data['head'] .= '<script type="text/javascript" src="'. + SimpleSAML\Module::getModuleURL('discopower/assets/js/jquery.livesearch.js').'"></script>'."\n"; +$this->data['head'] .= '<script type="text/javascript" src="'. + SimpleSAML\Module::getModuleURL('discopower/assets/js/'.$this->data['score'].'.js').'"></script>'."\n"; +$this->data['head'] .= $this->data['search']; +if (!empty($this->data['faventry'])) { + $this->data['autofocus'] = 'favouritesubmit'; } -$this->data['head'] .= ' -}); - -</script>'; - - - - - -if (!empty($this->data['faventry'])) $this->data['autofocus'] = 'favouritesubmit'; - $this->includeAtTemplateBase('includes/header.php'); -function showEntry($t, $metadata, $favourite = FALSE) { - - $basequerystring = '?' . - 'entityID=' . urlencode($t->data['entityID']) . '&' . - 'return=' . urlencode($t->data['return']) . '&' . - 'returnIDParam=' . urlencode($t->data['returnIDParam']) . '&idpentityid='; - - $extra = ($favourite ? ' favourite' : ''); - $html = '<a class="metaentry' . $extra . '" href="' . $basequerystring . urlencode($metadata['entityid']) . '">'; - - $html .= '' . htmlspecialchars(getTranslatedName($t, $metadata)) . ''; - - if(array_key_exists('icon', $metadata) && $metadata['icon'] !== NULL) { - $iconUrl = \SimpleSAML\Utils\HTTP::resolveURL($metadata['icon']); - $html .= '<img alt="Icon for identity provider" class="entryicon" src="' . htmlspecialchars($iconUrl) . '" />'; - } - - $html .= '</a>'; - - return $html; -} - -?> - +function showEntry($t, $metadata, $favourite = false) +{ + $basequerystring = '?'. + 'entityID='.urlencode($t->data['entityID']).'&'. + 'return='.urlencode($t->data['return']).'&'. + 'returnIDParam='.urlencode($t->data['returnIDParam']).'&idpentityid='; + $extra = ($favourite ? ' favourite' : ''); + $html = '<a class="metaentry'.$extra.'" href="'.$basequerystring.urlencode($metadata['entityid']).'">'; + $html .= htmlspecialchars(getTranslatedName($t, $metadata)).''; -<?php + if (array_key_exists('icon', $metadata) && $metadata['icon'] !== null) { + $iconUrl = \SimpleSAML\Utils\HTTP::resolveURL($metadata['icon']); + $html .= '<img alt="Icon for identity provider" class="entryicon" src="'.htmlspecialchars($iconUrl).'" />'; + } -function getTranslatedName($t, $metadata) { - if (isset($metadata['UIInfo']['DisplayName'])) { - $displayName = $metadata['UIInfo']['DisplayName']; - assert('is_array($displayName)'); // Should always be an array of language code -> translation - if (!empty($displayName)) { - return $t->getTranslator()->getPreferredTranslation($displayName); - } - } - - if (array_key_exists('name', $metadata)) { - if (is_array($metadata['name'])) { - return $t->getTranslator()->getPreferredTranslation($metadata['name']); - } else { - return $metadata['name']; - } - } - return $metadata['entityid']; + $html .= '</a>'; + return $html; } - - +function getTranslatedName($t, $metadata) +{ + if (isset($metadata['UIInfo']['DisplayName'])) { + $displayName = $metadata['UIInfo']['DisplayName']; + assert(is_array($displayName)); // Should always be an array of language code -> translation + if (!empty($displayName)) { + return $t->getTranslator()->getPreferredTranslation($displayName); + } + } + + if (array_key_exists('name', $metadata)) { + if (is_array($metadata['name'])) { + return $t->getTranslator()->getPreferredTranslation($metadata['name']); + } else { + return $metadata['name']; + } + } + return $metadata['entityid']; +} if (!empty($this->data['faventry'])) { - - - echo('<div class="favourite">'); - echo($this->t('previous_auth')); - echo(' <strong>' . htmlspecialchars(getTranslatedName($this, $this->data['faventry'])) . '</strong>'); - echo(' - <form id="idpselectform" method="get" action="' . $this->data['urlpattern'] . '"> - <input type="hidden" name="entityID" value="' . htmlspecialchars($this->data['entityID']) . '" /> - <input type="hidden" name="return" value="' . htmlspecialchars($this->data['return']) . '" /> - <input type="hidden" name="returnIDParam" value="' . htmlspecialchars($this->data['returnIDParam']) . '" /> - <input type="hidden" name="idpentityid" value="' . htmlspecialchars($this->data['faventry']['entityid']) . '" /> - - <input type="submit" name="formsubmit" id="favouritesubmit" value="' . $this->t('login_at') . ' ' . htmlspecialchars(getTranslatedName($this, $this->data['faventry'])) . '" /> - </form>'); - - echo('</div>'); + echo '<div class="favourite">' ; + echo $this->t('previous_auth'); + echo ' <strong>'.htmlspecialchars(getTranslatedName($this, $this->data['faventry'])).'</strong>'; + echo '<form id="idpselectform" method="get" action="'.$this->data['urlpattern']. + '"><input type="hidden" name="entityID" value="'.htmlspecialchars($this->data['entityID']). + '" /><input type="hidden" name="return" value="'.htmlspecialchars($this->data['return']). + '" /><input type="hidden" name="returnIDParam" value="'.htmlspecialchars($this->data['returnIDParam']). + '" /><input type="hidden" name="idpentityid" value="'.htmlspecialchars($this->data['faventry']['entityid']). + '" /><input type="submit" name="formsubmit" id="favouritesubmit" value="'.$this->t('login_at').' '. + htmlspecialchars(getTranslatedName($this, $this->data['faventry'])).'" /></form>'; + echo '</div>'; } - - ?> - - - - - -<div id="discotabs"> - - <ul class="tabset_tabs"> - <?php - - $tabs = array_keys( $this->data['idplist']); - foreach ($tabs AS $tab) { - if(!empty($this->data['idplist'][$tab])) { - echo '<li><a href="#' . $tab . '"><span>' . $this->t($this->data['tabNames'][$tab]) . '</span></a></li> '; - } - } - - ?> - </ul> - +<div id="tabdiv"> + <ul class="tabset_tabs"> + <?php + $tabs = array_keys($this->data['idplist']); + $i = 1; + foreach ($tabs as $tab) { + if (!empty($this->data['idplist'][$tab])) { + if ($i === 1) { + echo '<li class="tab-link current" data-tab="'.$tab.'"><a href="#'.$tab. + '"><span>'.$this->t($this->data['tabNames'][$tab]).'</span></a></li>'; + } else { + echo '<li class="tab-link" data-tab="'.$tab.'"><a href="#'.$tab. + '"><span>'.$this->t($this->data['tabNames'][$tab]).'</span></a></li> '; + } + $i++; + } + } + ?> + </ul> <?php - - - -foreach( $this->data['idplist'] AS $tab => $slist) { - - echo '<div id="' . $tab . '">'; - - if (!empty($slist)) { - - echo(' <div class="inlinesearch">'); - echo(' <p>Incremental search...</p>'); - echo(' <form id="idpselectform" action="?" method="get"><input class="inlinesearchf" type="text" value="" name="query_' . $tab . '" id="query_' . $tab . '" /></form>'); - echo(' </div>'); - - echo(' <div class="metalist" id="list_' . $tab . '">'); - if (!empty($this->data['preferredidp']) && array_key_exists($this->data['preferredidp'], $slist)) { - $idpentry = $slist[$this->data['preferredidp']]; - echo (showEntry($this, $idpentry, TRUE)); - } - - foreach ($slist AS $idpentry) { - if ($idpentry['entityid'] != $this->data['preferredidp']) { - echo (showEntry($this, $idpentry)); - } - } - echo(' </div>'); - } - echo '</div>'; - +foreach ($this->data['idplist'] as $tab => $slist) { + $first = array_keys($this->data['idplist']); + if ($first[0] === $tab) { + echo '<div id="'.$tab.'" class="tabset_content current">'; + } else { + echo '<div id="'.$tab.'" class="tabset_content">'; + } + if (!empty($slist)) { + echo '<div class="inlinesearch">'; + echo '<p>'.htmlspecialchars($this->t('{discopower:tabs:incremental_search}')).'</p>'; + echo '<form id="idpselectform" action="?" method="get">'; + echo '<input class="inlinesearch" type="text" value="" name="query_'.$tab.'" id="query_'.$tab.'" /></form>'; + echo '</div>'; + + echo '<div class="metalist" id="list_'.$tab .'">'; + if (!empty($this->data['preferredidp']) && array_key_exists($this->data['preferredidp'], $slist)) { + $idpentry = $slist[$this->data['preferredidp']]; + echo showEntry($this, $idpentry, true); + } + + foreach ($slist as $idpentry) { + if ($idpentry['entityid'] != $this->data['preferredidp']) { + echo showEntry($this, $idpentry); + } + } + echo '</div>'; + } + echo '</div>'; } - -?> - +?> </div> - -<?php $this->includeAtTemplateBase('includes/footer.php'); +<?php +$this->includeAtTemplateBase('includes/footer.php'); diff --git a/vendor/simplesamlphp/simplesamlphp/modules/discopower/templates/disco.twig b/vendor/simplesamlphp/simplesamlphp/modules/discopower/templates/disco.twig new file mode 100644 index 0000000000..5fd06df1b6 --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/modules/discopower/templates/disco.twig @@ -0,0 +1,57 @@ +{% set pagetitle = 'selectidp'|trans %} +{% extends "base.twig" %} + +{% block preload %} + <link href="{{ baseurlpath }}style.css" rel="stylesheet" type="text/css" media="screen" /> + <link rel="stylesheet" media="screen" type="text/css" href="/resources/uitheme1.8/jquery-ui.css" /> +{% endblock %} +{% block postload %} + <script type="text/javascript" src="/resources/jquery-1.8.js"></script> + <script type="text/javascript" src="/resources/jquery-ui-1.8.js"></script> + <script type="text/javascript" src="{{ baseurlpath }}js/jquery.livesearch.js"></script> + <script type="text/javascript" src="{{ baseurlpath }}js/{{ score }}.js"></script> + {{ search|raw }} +{% endblock %} + +{% block content %} + {% if faventry is not empty %} + <div class="favourite">{{ '{disco:previous_auth}'|trans }} + <strong>{{ faventry.translated|escape('html') }}</strong> + <form id="idpselectform" method="get" action="{{ urlpattern }}"> + <input type="hidden" name="entityID" value="{{ entityID|escape('html') }}" /> + <input type="hidden" name="return" value="{{ return|escape('html') }}" /> + <input type="hidden" name="returnIDParam" value="{{ returnIDParam|escape('html') }}" /> + <input type="hidden" name="idpentityid" value="{{ faventry.entityid|escape('html') }}" /> + <input type="submit" name="formsubmit" id="favouritesubmit" value="{{ '{disco:login_at}'|trans }} {{ faventry.translated|escape('html') }}" /> + </form> + </div> + {% endif %} + + <div id="tabdiv"> + <ul class="tabset_tabs"> + {% for tab, idps in idplist %} + {% if idps is not empty %} + <li class="tab-link{% if loop.first %}current{% endif %}" data-tab="{{ tab }}"><a href="#{{ tab }}"><span>{{ tabNames[tab]|trans }}</span></a></li> + {% endif %} + {% endfor %} + </ul> + + {% for tab, idps in idplist %} + {% if idps is not empty %} + <div id="{{ tab }}" class="tabset_content{% if loop.first %} current{% endif %}"> + <div class="inlinesearch"> + <p>{{ '{discopower:tabs:incremental_search}'|trans }}</p> + <form id="idpselectform" method="get"> + <input class="inlinesearch" type="text" value="" name="query_{{ tab }}" id="query_{{ tab }}" /> + </form> + </div> + <div class="metalist" id="list_{{ tab }}"> + {% for entityid, entity in idps %} + {{ entity.html|raw }} + {% endfor %} + </div> + </div> + {% endif %} + {% endfor %} + </div> +{% endblock %} diff --git a/vendor/simplesamlphp/simplesamlphp/modules/discopower/www/assets/css/disco.css b/vendor/simplesamlphp/simplesamlphp/modules/discopower/www/assets/css/disco.css new file mode 100644 index 0000000000..7610c52ae6 --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/modules/discopower/www/assets/css/disco.css @@ -0,0 +1,107 @@ +.inlinesearch { + float: right; + margin: 0em 3px .5em 1em; +} +.inlinesearch p { + font-size: 94%; + color: #aaa; +} +.inlinesearch input { + background-image:url('../../../../resources/icons/silk/magnifier.png'); + background-repeat:no-repeat; + background-position:center left; + border: 1px solid #ccc; + padding: 2px 2px 2px 20px; + margin: 0px 2px 0px 0px; +} +.inlinesearch * { + margin: 0px; + padding: 0px; +} +div.metalist { + clear: both; + list-style: none; + margin: 1em 2px .5em 2px; + padding: 0px; +} +a.metaentry { + display: block; + border: 1px solid #ccc; + margin: 0px 0px -1px 0px; + padding: .2em 1em .2em 20px; + cursor: pointer; + cursor: hand; +} +a.metaentry.favourite { + background-image:url('../../../../resources/icons/silk/heart.png'); + background-repeat:no-repeat; + background-position:center left; +} +a.metaentry:hover { + border: 1px solid #ccc; + background: #eee; + background-image:url('../../../../resources/icons/silk/star.png'); + background-repeat:no-repeat; + background-position:center left; +} +a.metaentry img.entryicon { + display: none; +} +a.metaentry:hover img.entryicon { + display: inline; + top: 0px; + bottom: 0px; + clear: both; + float: right; + margin: 1em; + padding: 3px; + border: 1px solid #999; +} + +div.favourite { + margin: 1em 0px; + padding: 1em; + border: 1px solid #ccc; + background-color: #eee; +} + +div#content { + margin: .4em ! important; +} + +form { + display: inline; +} + +table#statmeta { + width: 100%; +} + +ul.tabset_tabs { + margin: 0px; + padding: 0px; + list-style: none; +} + +ul.tabset_tabs li { + background: none; + color: #222; + display: inline-block; + padding: 10px 15px; + cursor: pointer; +} + +ul.tabset_tabs li.current { + background: #ededed; + color: #222; +} + +.tabset_content { + display: none; + background: #ededed; + padding: 15px; +} + +.tabset_content.current { + display: inherit; +} diff --git a/vendor/simplesamlphp/simplesamlphp/modules/discopower/www/assets/js/jquery.livesearch.js b/vendor/simplesamlphp/simplesamlphp/modules/discopower/www/assets/js/jquery.livesearch.js new file mode 100644 index 0000000000..2b125ff951 --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/modules/discopower/www/assets/js/jquery.livesearch.js @@ -0,0 +1,43 @@ +jQuery.fn.liveUpdate = function (list) { + list = jQuery(list); + + if (list.length) { + var rows = list.children('a'), + cache = rows.map(function () { + return jQuery(this).text().toLowerCase(); + }); + + this.keyup(filter).keyup().parents('form').submit(function () { + return false; + }); + } + + return this; + + function filter() + { + var term = jQuery.trim(jQuery(this).val().toLowerCase()), scores = []; + + if (!term) { + rows.show(); + } else { + rows.hide(); + + cache.each(function (i) { + var score = this.score(term); + if (score > 0) { + scores.push([score, i]); + } + }); + + jQuery.each( + scores.sort(function (a, b) { + return b[0] - a[0]; + }), + function () { + jQuery(rows[ this[1] ]).show(); + } + ); + } + } +}; diff --git a/vendor/simplesamlphp/simplesamlphp/modules/discopower/www/assets/js/quicksilver.js b/vendor/simplesamlphp/simplesamlphp/modules/discopower/www/assets/js/quicksilver.js new file mode 100644 index 0000000000..079ea87d5c --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/modules/discopower/www/assets/js/quicksilver.js @@ -0,0 +1,102 @@ +// qs_score - Quicksilver Score +// +// A port of the Quicksilver string ranking algorithm +// +// "hello world".score("axl") //=> 0.0 +// "hello world".score("ow") //=> 0.6 +// "hello world".score("hello world") //=> 1.0 +// +// Tested in Firefox 2 and Safari 3 +// +// The Quicksilver code is available here +// http://code.google.com/p/blacktree-alchemy/ +// http://blacktree-alchemy.googlecode.com/svn/trunk/Crucible/Code/NSString+BLTRRanking.m +// +// The MIT License +// +// Copyright (c) 2008 Lachie Cox +// +// 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. + + +String.prototype.score = function (abbreviation,offset) { + offset = offset || 0 // TODO: I think this is unused... remove + + if (abbreviation.length == 0) { + return 0.9 + } + if (abbreviation.length > this.length) { + return 0.0 + } + + for (var i = abbreviation.length; i > 0; i--) { + var sub_abbreviation = abbreviation.substring(0,i) + var index = this.indexOf(sub_abbreviation) + + + if (index < 0) { + continue; + } + if (index + abbreviation.length > this.length + offset) { + continue; + } + + var next_string = this.substring(index+sub_abbreviation.length) + var next_abbreviation = null + + if (i >= abbreviation.length) { + next_abbreviation = '' + } else { + next_abbreviation = abbreviation.substring(i) + } + + var remaining_score = next_string.score(next_abbreviation,offset + index) + + if (remaining_score > 0) { + var score = this.length - next_string.length; + + if (index != 0) { + var j = 0; + var c = this.charCodeAt(index - 1) + if ( c==32 || c == 9) { + for (var j=(index-2); j >= 0; j--) { + c = this.charCodeAt(j) + score -= ((c == 32 || c == 9) ? 1 : 0.15) + } + // XXX maybe not port this heuristic + // + // } else if ([[NSCharacterSet uppercaseLetterCharacterSet] characterIsMember:[self characterAtIndex:matchedRange.location]]) { + // for (j = matchedRange.location-1; j >= (int) searchRange.location; j--) { + // if ([[NSCharacterSet uppercaseLetterCharacterSet] characterIsMember:[self characterAtIndex:j]]) + // score--; + // else + // score -= 0.15; + // } + } else { + score -= index + } + } + + score += remaining_score * next_string.length + score /= this.length; + return score + } + } + return 0.0 +} diff --git a/vendor/simplesamlphp/simplesamlphp/modules/discopower/www/assets/js/suggest.js b/vendor/simplesamlphp/simplesamlphp/modules/discopower/www/assets/js/suggest.js new file mode 100644 index 0000000000..b404edd0a0 --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/modules/discopower/www/assets/js/suggest.js @@ -0,0 +1,25 @@ +var suggest_cache = new Array; + +String.prototype.score = function (abbreviation,offset) { + if (suggest_cache['abv'] != abbreviation) { + suggest_cache['abv'] = abbreviation; + var words = abbreviation.split(/\s/); + suggest_cache['len'] = words.length; + suggest_cache.re = new Array; + + //words.each(); + for (var i = 0; i < suggest_cache['len']; ++i) { + suggest_cache['re'][i] = new Array(); + // /\b<x>/ doesn't work when <x> i a non-ascii - oddly enough \s does ... + suggest_cache['re'][i]['initialword'] = new RegExp("^"+words[i], "i"); + suggest_cache['re'][i]['word'] = new RegExp("[\\s-()_]"+words[i], "i"); + } + } + + for (var i = 0; i < suggest_cache['len']; ++i) { + if (!(this.match(suggest_cache['re'][i]['initialword']) || this.match(suggest_cache['re'][i]['word']))) { + return 0; + } + } + return 1; +} diff --git a/vendor/simplesamlphp/simplesamlphp/modules/discopower/www/disco.php b/vendor/simplesamlphp/simplesamlphp/modules/discopower/www/disco.php index bfadb7c986..6a07478715 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/discopower/www/disco.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/discopower/www/disco.php @@ -1,15 +1,18 @@ <?php try { - $discoHandler = new sspmod_discopower_PowerIdPDisco(array('saml20-idp-remote', 'shib13-idp-remote'), 'poweridpdisco'); -} catch (Exception $exception) { - // An error here should be caused by invalid query parameters - throw new SimpleSAML_Error_Error('DISCOPARAMS', $exception); + $discoHandler = new \SimpleSAML\Module\discopower\PowerIdPDisco( + ['saml20-idp-remote', 'shib13-idp-remote'], + 'poweridpdisco' + ); +} catch (\Exception $exception) { + // An error here should be caused by invalid query parameters + throw new \SimpleSAML\Error\Error('DISCOPARAMS', $exception); } try { - $discoHandler->handleRequest(); -} catch(Exception $exception) { - // An error here should be caused by metadata - throw new SimpleSAML_Error_Error('METADATA', $exception); + $discoHandler->handleRequest(); +} catch (\Exception $exception) { + // An error here should be caused by metadata + throw new \SimpleSAML\Error\Error('METADATA', $exception); } diff --git a/vendor/simplesamlphp/simplesamlphp/modules/discopower/www/js/jquery.livesearch.js b/vendor/simplesamlphp/simplesamlphp/modules/discopower/www/js/jquery.livesearch.js deleted file mode 100644 index 06c3043737..0000000000 --- a/vendor/simplesamlphp/simplesamlphp/modules/discopower/www/js/jquery.livesearch.js +++ /dev/null @@ -1,37 +0,0 @@ -jQuery.fn.liveUpdate = function(list){ - list = jQuery(list); - - if ( list.length ) { - var rows = list.children('a'), - cache = rows.map(function(){ - return jQuery(this).text().toLowerCase(); - }); - - this - .keyup(filter).keyup() - .parents('form').submit(function(){ - return false; - }); - } - - return this; - - function filter(){ - var term = jQuery.trim( jQuery(this).val().toLowerCase() ), scores = []; - - if ( !term ) { - rows.show(); - } else { - rows.hide(); - - cache.each(function(i){ - var score = this.score(term); - if (score > 0) { scores.push([score, i]); } - }); - - jQuery.each(scores.sort(function(a, b){return b[0] - a[0];}), function(){ - jQuery(rows[ this[1] ]).show(); - }); - } - } -}; diff --git a/vendor/simplesamlphp/simplesamlphp/modules/discopower/www/js/quicksilver.js b/vendor/simplesamlphp/simplesamlphp/modules/discopower/www/js/quicksilver.js deleted file mode 100644 index af29f732b4..0000000000 --- a/vendor/simplesamlphp/simplesamlphp/modules/discopower/www/js/quicksilver.js +++ /dev/null @@ -1,95 +0,0 @@ -// qs_score - Quicksilver Score -// -// A port of the Quicksilver string ranking algorithm -// -// "hello world".score("axl") //=> 0.0 -// "hello world".score("ow") //=> 0.6 -// "hello world".score("hello world") //=> 1.0 -// -// Tested in Firefox 2 and Safari 3 -// -// The Quicksilver code is available here -// http://code.google.com/p/blacktree-alchemy/ -// http://blacktree-alchemy.googlecode.com/svn/trunk/Crucible/Code/NSString+BLTRRanking.m -// -// The MIT License -// -// Copyright (c) 2008 Lachie Cox -// -// 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. - - -String.prototype.score = function(abbreviation,offset) { - offset = offset || 0 // TODO: I think this is unused... remove - - if(abbreviation.length == 0) return 0.9 - if(abbreviation.length > this.length) return 0.0 - - for (var i = abbreviation.length; i > 0; i--) { - var sub_abbreviation = abbreviation.substring(0,i) - var index = this.indexOf(sub_abbreviation) - - - if(index < 0) continue; - if(index + abbreviation.length > this.length + offset) continue; - - var next_string = this.substring(index+sub_abbreviation.length) - var next_abbreviation = null - - if(i >= abbreviation.length) - next_abbreviation = '' - else - next_abbreviation = abbreviation.substring(i) - - var remaining_score = next_string.score(next_abbreviation,offset+index) - - if (remaining_score > 0) { - var score = this.length-next_string.length; - - if(index != 0) { - var j = 0; - - var c = this.charCodeAt(index-1) - if(c==32 || c == 9) { - for(var j=(index-2); j >= 0; j--) { - c = this.charCodeAt(j) - score -= ((c == 32 || c == 9) ? 1 : 0.15) - } - - // XXX maybe not port this heuristic - // - // } else if ([[NSCharacterSet uppercaseLetterCharacterSet] characterIsMember:[self characterAtIndex:matchedRange.location]]) { - // for (j = matchedRange.location-1; j >= (int) searchRange.location; j--) { - // if ([[NSCharacterSet uppercaseLetterCharacterSet] characterIsMember:[self characterAtIndex:j]]) - // score--; - // else - // score -= 0.15; - // } - } else { - score -= index - } - } - - score += remaining_score * next_string.length - score /= this.length; - return score - } - } - return 0.0 -} \ No newline at end of file diff --git a/vendor/simplesamlphp/simplesamlphp/modules/discopower/www/js/suggest.js b/vendor/simplesamlphp/simplesamlphp/modules/discopower/www/js/suggest.js deleted file mode 100644 index 667b35ac94..0000000000 --- a/vendor/simplesamlphp/simplesamlphp/modules/discopower/www/js/suggest.js +++ /dev/null @@ -1,23 +0,0 @@ -var suggest_cache = new Array; - -String.prototype.score = function(abbreviation,offset) { - if (suggest_cache['abv'] != abbreviation) { - suggest_cache['abv'] = abbreviation; - var words = abbreviation.split(/\s/); - suggest_cache['len'] = words.length; - suggest_cache.re = new Array; - - //words.each(); - for ( var i=0; i<suggest_cache['len']; ++i ){ - suggest_cache['re'][i] = new Array(); - // /\b<x>/ doesn't work when <x> i a non-ascii - oddly enough \s does ... - suggest_cache['re'][i]['initialword'] = new RegExp("^"+words[i], "i"); - suggest_cache['re'][i]['word'] = new RegExp("[\\s-()_]"+words[i], "i"); - } - } - - for ( var i=0; i<suggest_cache['len']; ++i ){ - if (!(this.match(suggest_cache['re'][i]['initialword']) || this.match(suggest_cache['re'][i]['word']))) return 0; - } - return 1; -} diff --git a/vendor/simplesamlphp/simplesamlphp/modules/discopower/www/style.css b/vendor/simplesamlphp/simplesamlphp/modules/discopower/www/style.css deleted file mode 100644 index 3af002dff4..0000000000 --- a/vendor/simplesamlphp/simplesamlphp/modules/discopower/www/style.css +++ /dev/null @@ -1,76 +0,0 @@ -.inlinesearch:hover { - -} -.inlinesearch { - float: right; - margin: 0em 3px .5em 1em; - -/* padding: .3em;*/ -} -.inlinesearch p { - font-size: 94%; - color: #aaa; - -} -.inlinesearch input { - background-image:url('../../resources/icons/silk/magnifier.png'); - background-repeat:no-repeat; - background-position:center left; - border: 1px solid #ccc; - padding: 2px 2px 2px 20px; - margin: 0px 2px 0px 0px; -} -.inlinesearch * { - margin: 0px; - padding: 0px; -} -div.metalist { - clear: both; - list-style: none; - margin: 1em 2px .5em 2px; - padding: 0px; -} -a.metaentry { - display: block; - border: 1px solid #ccc; - margin: 0px 0px -1px 0px; - padding: .2em 1em .2em 20px; - cursor: pointer; - cursor: hand; -} -a.metaentry.favourite { - background-image:url('../../resources/icons/silk/heart.png'); - background-repeat:no-repeat; - background-position:center left; - -} -a.metaentry:hover { - border: 1px solid #ccc; - background: #eee; - - background-image:url('../../resources/icons/silk/star.png'); - background-repeat:no-repeat; - background-position:center left; -} -a.metaentry img.entryicon { - display: none; -} -a.metaentry:hover img.entryicon { - display: inline; - top: 0px; - bottom: 0px; - clear: both; - float: right; - margin: 1em; - padding: 3px; - border: 1px solid #999; -} - -div.favourite { - - margin: 1em 0px; - padding: 1em; - border: 1px solid #ccc; - background-color: #eee; - -} diff --git a/vendor/simplesamlphp/simplesamlphp/modules/exampleattributeserver/www/attributeserver.php b/vendor/simplesamlphp/simplesamlphp/modules/exampleattributeserver/www/attributeserver.php index 8f257c2a42..9bdbe415a1 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/exampleattributeserver/www/attributeserver.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/exampleattributeserver/www/attributeserver.php @@ -1,93 +1,89 @@ <?php -$metadata = SimpleSAML_Metadata_MetaDataStorageHandler::getMetadataHandler(); +$metadata = \SimpleSAML\Metadata\MetaDataStorageHandler::getMetadataHandler(); $binding = \SAML2\Binding::getCurrentBinding(); $query = $binding->receive(); if (!($query instanceof \SAML2\AttributeQuery)) { - throw new SimpleSAML_Error_BadRequest('Invalid message received to AttributeQuery endpoint.'); + throw new \SimpleSAML\Error\BadRequest('Invalid message received to AttributeQuery endpoint.'); } $idpEntityId = $metadata->getMetaDataCurrentEntityID('saml20-idp-hosted'); $spEntityId = $query->getIssuer(); -if ($spEntityId === NULL) { - throw new SimpleSAML_Error_BadRequest('Missing <saml:Issuer> in <samlp:AttributeQuery>.'); +if ($spEntityId === null) { + throw new \SimpleSAML\Error\BadRequest('Missing <saml:Issuer> in <samlp:AttributeQuery>.'); } -$idpMetadata = $metadata->getMetadataConfig($idpEntityId, 'saml20-idp-hosted'); +$idpMetadata = $metadata->getMetaDataConfig($idpEntityId, 'saml20-idp-hosted'); $spMetadata = $metadata->getMetaDataConfig($spEntityId, 'saml20-sp-remote'); // The endpoint we should deliver the message to $endpoint = $spMetadata->getString('testAttributeEndpoint'); // The attributes we will return -$attributes = array( - 'name' => array('value1', 'value2', 'value3'), - 'test' => array('test'), -); +$attributes = [ + 'name' => ['value1', 'value2', 'value3'], + 'test' => ['test'], +]; -/* The name format of the attributes. */ +// The name format of the attributes $attributeNameFormat = \SAML2\Constants::NAMEFORMAT_UNSPECIFIED; - -/* Determine which attributes we will return. */ +// Determine which attributes we will return $returnAttributes = array_keys($query->getAttributes()); if (count($returnAttributes) === 0) { - SimpleSAML\Logger::debug('No attributes requested - return all attributes.'); - $returnAttributes = $attributes; - + SimpleSAML\Logger::debug('No attributes requested - return all attributes.'); + $returnAttributes = $attributes; } elseif ($query->getAttributeNameFormat() !== $attributeNameFormat) { - SimpleSAML\Logger::debug('Requested attributes with wrong NameFormat - no attributes returned.'); - $returnAttributes = array(); + SimpleSAML\Logger::debug('Requested attributes with wrong NameFormat - no attributes returned.'); + $returnAttributes = []; } else { - foreach ($returnAttributes as $name => $values) { - if (!array_key_exists($name, $attributes)) { - /* We don't have this attribute. */ - unset($returnAttributes[$name]); - continue; - } - - if (count($values) === 0) { - /* Return all attributes. */ - $returnAttributes[$name] = $attributes[$name]; - continue; - } - - /* Filter which attribute values we should return. */ - $returnAttributes[$name] = array_intersect($values, $attributes[$name]); - } + foreach ($returnAttributes as $name => $values) { + if (!array_key_exists($name, $attributes)) { + // We don't have this attribute + unset($returnAttributes[$name]); + continue; + } + if (count($values) === 0) { + // Return all attributes + $returnAttributes[$name] = $attributes[$name]; + continue; + } + + // Filter which attribute values we should return + $returnAttributes[$name] = array_intersect($values, $attributes[$name]); + } } - -/* $returnAttributes contains the attributes we should return. Send them. */ +// $returnAttributes contains the attributes we should return. Send them $assertion = new \SAML2\Assertion(); $assertion->setIssuer($idpEntityId); $assertion->setNameId($query->getNameId()); $assertion->setNotBefore(time()); -$assertion->setNotOnOrAfter(time() + 5*60); -$assertion->setValidAudiences(array($spEntityId)); +$assertion->setNotOnOrAfter(time() + 300); // 60*5 = 5min +$assertion->setValidAudiences([$spEntityId]); $assertion->setAttributes($returnAttributes); $assertion->setAttributeNameFormat($attributeNameFormat); $sc = new \SAML2\XML\saml\SubjectConfirmation(); $sc->Method = \SAML2\Constants::CM_BEARER; $sc->SubjectConfirmationData = new \SAML2\XML\saml\SubjectConfirmationData(); -$sc->SubjectConfirmationData->NotOnOrAfter = time() + 5*60; -$sc->SubjectConfirmationData->Recipient = $endpoint; -$sc->SubjectConfirmationData->InResponseTo = $query->getId(); -$assertion->setSubjectConfirmation(array($sc)); +$sc->SubjectConfirmationData->setNotOnOrAfter(time() + 300); // 60*5 = 5min +$sc->SubjectConfirmationData->setRecipient($endpoint); +$sc->SubjectConfirmationData->setInResponseTo($query->getId()); +$assertion->setSubjectConfirmation([$sc]); -sspmod_saml_Message::addSign($idpMetadata, $spMetadata, $assertion); +\SimpleSAML\Module\saml\Message::addSign($idpMetadata, $spMetadata, $assertion); $response = new \SAML2\Response(); $response->setRelayState($query->getRelayState()); $response->setDestination($endpoint); $response->setIssuer($idpEntityId); $response->setInResponseTo($query->getId()); -$response->setAssertions(array($assertion)); -sspmod_saml_Message::addSign($idpMetadata, $spMetadata, $response); +$response->setAssertions([$assertion]); +\SimpleSAML\Module\saml\Message::addSign($idpMetadata, $spMetadata, $response); $binding = new \SAML2\HTTPPost(); $binding->send($response); diff --git a/vendor/simplesamlphp/simplesamlphp/modules/exampleauth/lib/Auth/Process/RedirectTest.php b/vendor/simplesamlphp/simplesamlphp/modules/exampleauth/lib/Auth/Process/RedirectTest.php index 8baee32708..13ff82dbd2 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/exampleauth/lib/Auth/Process/RedirectTest.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/exampleauth/lib/Auth/Process/RedirectTest.php @@ -1,28 +1,30 @@ <?php +namespace SimpleSAML\Module\exampleautth\Auth\Process; + /** * A simple processing filter for testing that redirection works as it should. * */ -class sspmod_exampleauth_Auth_Process_RedirectTest extends SimpleSAML_Auth_ProcessingFilter { - - - /** - * Initialize processing of the redirect test. - * - * @param array &$state The state we should update. - */ - public function process(&$state) { - assert('is_array($state)'); - assert('array_key_exists("Attributes", $state)'); - // To check whether the state is saved correctly - $state['Attributes']['RedirectTest1'] = array('OK'); +class RedirectTest extends \SimpleSAML\Auth\ProcessingFilter +{ + /** + * Initialize processing of the redirect test. + * + * @param array &$state The state we should update. + */ + public function process(&$state) + { + assert(is_array($state)); + assert(array_key_exists('Attributes', $state)); - // Save state and redirect - $id = SimpleSAML_Auth_State::saveState($state, 'exampleauth:redirectfilter-test'); - $url = SimpleSAML\Module::getModuleURL('exampleauth/redirecttest.php'); - \SimpleSAML\Utils\HTTP::redirectTrustedURL($url, array('StateId' => $id)); - } + // To check whether the state is saved correctly + $state['Attributes']['RedirectTest1'] = ['OK']; + // Save state and redirect + $id = \SimpleSAML\Auth\State::saveState($state, 'exampleauth:redirectfilter-test'); + $url = \SimpleSAML\Module::getModuleURL('exampleauth/redirecttest.php'); + \SimpleSAML\Utils\HTTP::redirectTrustedURL($url, ['StateId' => $id]); + } } diff --git a/vendor/simplesamlphp/simplesamlphp/modules/exampleauth/lib/Auth/Source/External.php b/vendor/simplesamlphp/simplesamlphp/modules/exampleauth/lib/Auth/Source/External.php index c1826bc4d2..48a032a36b 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/exampleauth/lib/Auth/Source/External.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/exampleauth/lib/Auth/Source/External.php @@ -1,5 +1,7 @@ <?php +namespace SimpleSAML\Module\exampleauth\Auth\Source; + /** * Example external authentication source. * @@ -20,253 +22,255 @@ * * @package SimpleSAMLphp */ -class sspmod_exampleauth_Auth_Source_External extends SimpleSAML_Auth_Source { - - /** - * Constructor for this authentication source. - * - * @param array $info Information about this authentication source. - * @param array $config Configuration. - */ - public function __construct($info, $config) { - assert('is_array($info)'); - assert('is_array($config)'); - - // Call the parent constructor first, as required by the interface - parent::__construct($info, $config); - - // Do any other configuration we need here - } - - - /** - * Retrieve attributes for the user. - * - * @return array|NULL The user's attributes, or NULL if the user isn't authenticated. - */ - private function getUser() { - - /* - * In this example we assume that the attributes are - * stored in the users PHP session, but this could be replaced - * with anything. - */ - - if (!session_id()) { - /* session_start not called before. Do it here. */ - session_start(); - } - - if (!isset($_SESSION['uid'])) { - /* The user isn't authenticated. */ - return NULL; - } - - /* - * Find the attributes for the user. - * Note that all attributes in SimpleSAMLphp are multivalued, so we need - * to store them as arrays. - */ - - $attributes = array( - 'uid' => array($_SESSION['uid']), - 'displayName' => array($_SESSION['name']), - 'mail' => array($_SESSION['mail']), - ); - - /* Here we generate a multivalued attribute based on the account type. */ - $attributes['eduPersonAffiliation'] = array( - $_SESSION['type'], /* In this example, either 'student' or 'employee'. */ - 'member', - ); - - return $attributes; - } - - - /** - * Log in using an external authentication helper. - * - * @param array &$state Information about the current authentication. - */ - public function authenticate(&$state) { - assert('is_array($state)'); - - $attributes = $this->getUser(); - if ($attributes !== NULL) { - /* - * The user is already authenticated. - * - * Add the users attributes to the $state-array, and return control - * to the authentication process. - */ - $state['Attributes'] = $attributes; - return; - } - - /* - * The user isn't authenticated. We therefore need to - * send the user to the login page. - */ - - /* - * First we add the identifier of this authentication source - * to the state array, so that we know where to resume. - */ - $state['exampleauth:AuthID'] = $this->authId; - - - /* - * We need to save the $state-array, so that we can resume the - * login process after authentication. - * - * Note the second parameter to the saveState-function. This is a - * unique identifier for where the state was saved, and must be used - * again when we retrieve the state. - * - * The reason for it is to prevent - * attacks where the user takes a $state-array saved in one location - * and restores it in another location, and thus bypasses steps in - * the authentication process. - */ - $stateId = SimpleSAML_Auth_State::saveState($state, 'exampleauth:External'); - - /* - * Now we generate a URL the user should return to after authentication. - * We assume that whatever authentication page we send the user to has an - * option to return the user to a specific page afterwards. - */ - $returnTo = SimpleSAML\Module::getModuleURL('exampleauth/resume.php', array( - 'State' => $stateId, - )); - - /* - * Get the URL of the authentication page. - * - * Here we use the getModuleURL function again, since the authentication page - * is also part of this module, but in a real example, this would likely be - * the absolute URL of the login page for the site. - */ - $authPage = SimpleSAML\Module::getModuleURL('exampleauth/authpage.php'); - - /* - * The redirect to the authentication page. - * - * Note the 'ReturnTo' parameter. This must most likely be replaced with - * the real name of the parameter for the login page. - */ - \SimpleSAML\Utils\HTTP::redirectTrustedURL($authPage, array( - 'ReturnTo' => $returnTo, - )); - - /* - * The redirect function never returns, so we never get this far. - */ - assert('FALSE'); - } - - - /** - * Resume authentication process. - * - * This function resumes the authentication process after the user has - * entered his or her credentials. - * - * @param array &$state The authentication state. - */ - public static function resume() { - - /* - * First we need to restore the $state-array. We should have the identifier for - * it in the 'State' request parameter. - */ - if (!isset($_REQUEST['State'])) { - throw new SimpleSAML_Error_BadRequest('Missing "State" parameter.'); - } - - /* - * Once again, note the second parameter to the loadState function. This must - * match the string we used in the saveState-call above. - */ - $state = SimpleSAML_Auth_State::loadState($_REQUEST['State'], 'exampleauth:External'); - - /* - * Now we have the $state-array, and can use it to locate the authentication - * source. - */ - $source = SimpleSAML_Auth_Source::getById($state['exampleauth:AuthID']); - if ($source === NULL) { - /* - * The only way this should fail is if we remove or rename the authentication source - * while the user is at the login page. - */ - throw new SimpleSAML_Error_Exception('Could not find authentication source with id ' . $state[self::AUTHID]); - } - - /* - * Make sure that we haven't switched the source type while the - * user was at the authentication page. This can only happen if we - * change config/authsources.php while an user is logging in. - */ - if (! ($source instanceof self)) { - throw new SimpleSAML_Error_Exception('Authentication source type changed.'); - } - - - /* - * OK, now we know that our current state is sane. Time to actually log the user in. - * - * First we check that the user is acutally logged in, and didn't simply skip the login page. - */ - $attributes = $source->getUser(); - if ($attributes === NULL) { - /* - * The user isn't authenticated. - * - * Here we simply throw an exception, but we could also redirect the user back to the - * login page. - */ - throw new SimpleSAML_Error_Exception('User not authenticated after login page.'); - } - - /* - * So, we have a valid user. Time to resume the authentication process where we - * paused it in the authenticate()-function above. - */ - - $state['Attributes'] = $attributes; - SimpleSAML_Auth_Source::completeAuth($state); - - /* - * The completeAuth-function never returns, so we never get this far. - */ - assert('FALSE'); - } - - - /** - * This function is called when the user start a logout operation, for example - * by logging out of a SP that supports single logout. - * - * @param array &$state The logout state array. - */ - public function logout(&$state) { - assert('is_array($state)'); - - if (!session_id()) { - /* session_start not called before. Do it here. */ - session_start(); - } - - /* - * In this example we simply remove the 'uid' from the session. - */ - unset($_SESSION['uid']); - - /* - * If we need to do a redirect to a different page, we could do this - * here, but in this example we don't need to do this. - */ - } +class External extends \SimpleSAML\Auth\Source +{ + /** + * The key of the AuthId field in the state. + */ + const AUTHID = 'SimpleSAML\Module\exampleauth\Auth\Source\External.AuthId'; + + /** + * Constructor for this authentication source. + * + * @param array $info Information about this authentication source. + * @param array $config Configuration. + */ + public function __construct($info, $config) + { + assert(is_array($info)); + assert(is_array($config)); + + // Call the parent constructor first, as required by the interface + parent::__construct($info, $config); + + // Do any other configuration we need here + } + + /** + * Retrieve attributes for the user. + * + * @return array|NULL The user's attributes, or NULL if the user isn't authenticated. + */ + private function getUser() + { + /* + * In this example we assume that the attributes are + * stored in the users PHP session, but this could be replaced + * with anything. + */ + + if (!session_id()) { + // session_start not called before. Do it here + session_start(); + } + + if (!isset($_SESSION['uid'])) { + // The user isn't authenticated + return null; + } + + /* + * Find the attributes for the user. + * Note that all attributes in SimpleSAMLphp are multivalued, so we need + * to store them as arrays. + */ + + $attributes = [ + 'uid' => [$_SESSION['uid']], + 'displayName' => [$_SESSION['name']], + 'mail' => [$_SESSION['mail']], + ]; + + // Here we generate a multivalued attribute based on the account type + $attributes['eduPersonAffiliation'] = [ + $_SESSION['type'], /* In this example, either 'student' or 'employee'. */ + 'member', + ]; + + return $attributes; + } + + /** + * Log in using an external authentication helper. + * + * @param array &$state Information about the current authentication. + */ + public function authenticate(&$state) + { + assert(is_array($state)); + + $attributes = $this->getUser(); + if ($attributes !== null) { + /* + * The user is already authenticated. + * + * Add the users attributes to the $state-array, and return control + * to the authentication process. + */ + $state['Attributes'] = $attributes; + return; + } + + /* + * The user isn't authenticated. We therefore need to + * send the user to the login page. + */ + + /* + * First we add the identifier of this authentication source + * to the state array, so that we know where to resume. + */ + $state['exampleauth:AuthID'] = self::AUTHID; + + /* + * We need to save the $state-array, so that we can resume the + * login process after authentication. + * + * Note the second parameter to the saveState-function. This is a + * unique identifier for where the state was saved, and must be used + * again when we retrieve the state. + * + * The reason for it is to prevent + * attacks where the user takes a $state-array saved in one location + * and restores it in another location, and thus bypasses steps in + * the authentication process. + */ + $stateId = \SimpleSAML\Auth\State::saveState($state, 'exampleauth:External'); + + /* + * Now we generate a URL the user should return to after authentication. + * We assume that whatever authentication page we send the user to has an + * option to return the user to a specific page afterwards. + */ + $returnTo = \SimpleSAML\Module::getModuleURL('exampleauth/resume.php', [ + 'State' => $stateId, + ]); + + /* + * Get the URL of the authentication page. + * + * Here we use the getModuleURL function again, since the authentication page + * is also part of this module, but in a real example, this would likely be + * the absolute URL of the login page for the site. + */ + $authPage = \SimpleSAML\Module::getModuleURL('exampleauth/authpage.php'); + + /* + * The redirect to the authentication page. + * + * Note the 'ReturnTo' parameter. This must most likely be replaced with + * the real name of the parameter for the login page. + */ + \SimpleSAML\Utils\HTTP::redirectTrustedURL($authPage, [ + 'ReturnTo' => $returnTo, + ]); + + /* + * The redirect function never returns, so we never get this far. + */ + assert(false); + } + + /** + * Resume authentication process. + * + * This function resumes the authentication process after the user has + * entered his or her credentials. + * + * @param array &$state The authentication state. + */ + public static function resume() + { + /* + * First we need to restore the $state-array. We should have the identifier for + * it in the 'State' request parameter. + */ + if (!isset($_REQUEST['State'])) { + throw new \SimpleSAML\Error\BadRequest('Missing "State" parameter.'); + } + + /* + * Once again, note the second parameter to the loadState function. This must + * match the string we used in the saveState-call above. + */ + $state = \SimpleSAML\Auth\State::loadState($_REQUEST['State'], 'exampleauth:External'); + + /* + * Now we have the $state-array, and can use it to locate the authentication + * source. + */ + $source = \SimpleSAML\Auth\Source::getById($state['exampleauth:AuthID']); + if ($source === null) { + /* + * The only way this should fail is if we remove or rename the authentication source + * while the user is at the login page. + */ + throw new \SimpleSAML\Error\Exception('Could not find authentication source with id '.$state[self::AUTHID]); + } + + /* + * Make sure that we haven't switched the source type while the + * user was at the authentication page. This can only happen if we + * change config/authsources.php while an user is logging in. + */ + if (!($source instanceof self)) { + throw new \SimpleSAML\Error\Exception('Authentication source type changed.'); + } + + /* + * OK, now we know that our current state is sane. Time to actually log the user in. + * + * First we check that the user is acutally logged in, and didn't simply skip the login page. + */ + $attributes = $source->getUser(); + if ($attributes === null) { + /* + * The user isn't authenticated. + * + * Here we simply throw an exception, but we could also redirect the user back to the + * login page. + */ + throw new \SimpleSAML\Error\Exception('User not authenticated after login page.'); + } + + /* + * So, we have a valid user. Time to resume the authentication process where we + * paused it in the authenticate()-function above. + */ + + $state['Attributes'] = $attributes; + \SimpleSAML\Auth\Source::completeAuth($state); + + /* + * The completeAuth-function never returns, so we never get this far. + */ + assert(false); + } + + /** + * This function is called when the user start a logout operation, for example + * by logging out of a SP that supports single logout. + * + * @param array &$state The logout state array. + */ + public function logout(&$state) + { + assert(is_array($state)); + + if (!session_id()) { + // session_start not called before. Do it here + session_start(); + } + + /* + * In this example we simply remove the 'uid' from the session. + */ + unset($_SESSION['uid']); + + /* + * If we need to do a redirect to a different page, we could do this + * here, but in this example we don't need to do this. + */ + } } diff --git a/vendor/simplesamlphp/simplesamlphp/modules/exampleauth/lib/Auth/Source/Static.php b/vendor/simplesamlphp/simplesamlphp/modules/exampleauth/lib/Auth/Source/Static.php deleted file mode 100644 index 4f7513f738..0000000000 --- a/vendor/simplesamlphp/simplesamlphp/modules/exampleauth/lib/Auth/Source/Static.php +++ /dev/null @@ -1,57 +0,0 @@ -<?php - -/** - * Example authentication source. - * - * This class is an example authentication source which will always return a user with - * a static set of attributes. - * - * @author Olav Morken, UNINETT AS. - * @package SimpleSAMLphp - */ -class sspmod_exampleauth_Auth_Source_Static extends SimpleSAML_Auth_Source { - - - /** - * The attributes we return. - */ - private $attributes; - - - /** - * Constructor for this authentication source. - * - * @param array $info Information about this authentication source. - * @param array $config Configuration. - */ - public function __construct($info, $config) { - assert('is_array($info)'); - assert('is_array($config)'); - - // Call the parent constructor first, as required by the interface - parent::__construct($info, $config); - - - // Parse attributes - try { - $this->attributes = SimpleSAML\Utils\Attributes::normalizeAttributesArray($config); - } catch(Exception $e) { - throw new Exception('Invalid attributes for authentication source ' . - $this->authId . ': ' . $e->getMessage()); - } - - } - - - /** - * Log in using static attributes. - * - * @param array &$state Information about the current authentication. - */ - public function authenticate(&$state) { - assert('is_array($state)'); - - $state['Attributes'] = $this->attributes; - } - -} diff --git a/vendor/simplesamlphp/simplesamlphp/modules/exampleauth/lib/Auth/Source/StaticSource.php b/vendor/simplesamlphp/simplesamlphp/modules/exampleauth/lib/Auth/Source/StaticSource.php new file mode 100644 index 0000000000..d81dd32563 --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/modules/exampleauth/lib/Auth/Source/StaticSource.php @@ -0,0 +1,55 @@ +<?php + +namespace SimpleSAML\Module\exampleauth\Auth\Source; + +/** + * Example authentication source. + * + * This class is an example authentication source which will always return a user with + * a static set of attributes. + * + * @author Olav Morken, UNINETT AS. + * @package SimpleSAMLphp + */ + +class StaticSource extends \SimpleSAML\Auth\Source +{ + /** + * The attributes we return. + */ + private $attributes; + + /** + * Constructor for this authentication source. + * + * @param array $info Information about this authentication source. + * @param array $config Configuration. + */ + public function __construct($info, $config) + { + assert(is_array($info)); + assert(is_array($config)); + + // Call the parent constructor first, as required by the interface + parent::__construct($info, $config); + + // Parse attributes + try { + $this->attributes = \SimpleSAML\Utils\Attributes::normalizeAttributesArray($config); + } catch (\Exception $e) { + throw new \Exception('Invalid attributes for authentication source '. + $this->authId.': '.$e->getMessage()); + } + } + + /** + * Log in using static attributes. + * + * @param array &$state Information about the current authentication. + */ + public function authenticate(&$state) + { + assert(is_array($state)); + $state['Attributes'] = $this->attributes; + } +} diff --git a/vendor/simplesamlphp/simplesamlphp/modules/exampleauth/lib/Auth/Source/UserPass.php b/vendor/simplesamlphp/simplesamlphp/modules/exampleauth/lib/Auth/Source/UserPass.php index 857d8ef2ad..19da260bbd 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/exampleauth/lib/Auth/Source/UserPass.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/exampleauth/lib/Auth/Source/UserPass.php @@ -1,5 +1,7 @@ <?php +namespace SimpleSAML\Module\exampleauth\Auth\Source; + /** * Example authentication source - username & password. * @@ -9,82 +11,81 @@ * @author Olav Morken, UNINETT AS. * @package SimpleSAMLphp */ -class sspmod_exampleauth_Auth_Source_UserPass extends sspmod_core_Auth_UserPassBase { - - - /** - * Our users, stored in an associative array. The key of the array is "<username>:<password>", - * while the value of each element is a new array with the attributes for each user. - */ - private $users; - - - /** - * Constructor for this authentication source. - * - * @param array $info Information about this authentication source. - * @param array $config Configuration. - */ - public function __construct($info, $config) { - assert('is_array($info)'); - assert('is_array($config)'); - - // Call the parent constructor first, as required by the interface - parent::__construct($info, $config); - - $this->users = array(); - - // Validate and parse our configuration - foreach ($config as $userpass => $attributes) { - if (!is_string($userpass)) { - throw new Exception('Invalid <username>:<password> for authentication source ' . - $this->authId . ': ' . $userpass); - } - - $userpass = explode(':', $userpass, 2); - if (count($userpass) !== 2) { - throw new Exception('Invalid <username>:<password> for authentication source ' . - $this->authId . ': ' . $userpass[0]); - } - $username = $userpass[0]; - $password = $userpass[1]; - - try { - $attributes = SimpleSAML\Utils\Attributes::normalizeAttributesArray($attributes); - } catch(Exception $e) { - throw new Exception('Invalid attributes for user ' . $username . - ' in authentication source ' . $this->authId . ': ' . - $e->getMessage()); - } - - $this->users[$username . ':' . $password] = $attributes; - } - } - - - /** - * Attempt to log in using the given username and password. - * - * On a successful login, this function should return the users attributes. On failure, - * it should throw an exception. If the error was caused by the user entering the wrong - * username or password, a SimpleSAML_Error_Error('WRONGUSERPASS') should be thrown. - * - * Note that both the username and the password are UTF-8 encoded. - * - * @param string $username The username the user wrote. - * @param string $password The password the user wrote. - * @return array Associative array with the users attributes. - */ - protected function login($username, $password) { - assert('is_string($username)'); - assert('is_string($password)'); - - $userpass = $username . ':' . $password; - if (!array_key_exists($userpass, $this->users)) { - throw new SimpleSAML_Error_Error('WRONGUSERPASS'); - } - - return $this->users[$userpass]; - } +class UserPass extends \SimpleSAML\Module\core\Auth\UserPassBase +{ + /** + * Our users, stored in an associative array. The key of the array is "<username>:<password>", + * while the value of each element is a new array with the attributes for each user. + */ + private $users; + + /** + * Constructor for this authentication source. + * + * @param array $info Information about this authentication source. + * @param array $config Configuration. + */ + public function __construct($info, $config) + { + assert(is_array($info)); + assert(is_array($config)); + + // Call the parent constructor first, as required by the interface + parent::__construct($info, $config); + + $this->users = []; + + // Validate and parse our configuration + foreach ($config as $userpass => $attributes) { + if (!is_string($userpass)) { + throw new \Exception( + 'Invalid <username>:<password> for authentication source '.$this->authId.': '.$userpass + ); + } + + $userpass = explode(':', $userpass, 2); + if (count($userpass) !== 2) { + throw new \Exception( + 'Invalid <username>:<password> for authentication source '.$this->authId.': '.$userpass[0] + ); + } + $username = $userpass[0]; + $password = $userpass[1]; + + try { + $attributes = \SimpleSAML\Utils\Attributes::normalizeAttributesArray($attributes); + } catch (\Exception $e) { + throw new \Exception('Invalid attributes for user '.$username. + ' in authentication source '.$this->authId.': '.$e->getMessage()); + } + $this->users[$username.':'.$password] = $attributes; + } + } + + /** + * Attempt to log in using the given username and password. + * + * On a successful login, this function should return the users attributes. On failure, + * it should throw an exception. If the error was caused by the user entering the wrong + * username or password, a \SimpleSAML\Error\Error('WRONGUSERPASS') should be thrown. + * + * Note that both the username and the password are UTF-8 encoded. + * + * @param string $username The username the user wrote. + * @param string $password The password the user wrote. + * @return array Associative array with the users attributes. + */ + protected function login($username, $password) + { + assert(is_string($username)); + assert(is_string($password)); + + $userpass = $username.':'.$password; + if (!array_key_exists($userpass, $this->users)) { + throw new \SimpleSAML\Error\Error('WRONGUSERPASS'); + } + + return $this->users[$userpass]; + } } diff --git a/vendor/simplesamlphp/simplesamlphp/modules/exampleauth/www/authpage.php b/vendor/simplesamlphp/simplesamlphp/modules/exampleauth/www/authpage.php index 73fcb131ec..6c34995ec7 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/exampleauth/www/authpage.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/exampleauth/www/authpage.php @@ -10,12 +10,11 @@ */ if (!isset($_REQUEST['ReturnTo'])) { - die('Missing ReturnTo parameter.'); + die('Missing ReturnTo parameter.'); } $returnTo = \SimpleSAML\Utils\HTTP::checkURLAllowed($_REQUEST['ReturnTo']); - /* * The following piece of code would never be found in a real authentication page. Its * purpose in this example is to make this example safer in the case where the @@ -27,9 +26,9 @@ */ if (!preg_match('@State=(.*)@', $returnTo, $matches)) { - die('Invalid ReturnTo URL for this example.'); + die('Invalid ReturnTo URL for this example.'); } -SimpleSAML_Auth_State::loadState(urldecode($matches[1]), 'exampleauth:External'); +\SimpleSAML\Auth\State::loadState(urldecode($matches[1]), 'exampleauth:External'); /* * The loadState-function will not return if the second parameter does not @@ -37,59 +36,55 @@ * through the exampleauth:External authentication page. */ - /* * Our list of users. */ -$users = array( - 'student' => array( - 'password' => 'student', - 'uid' => 'student', - 'name' => 'Student Name', - 'mail' => 'somestudent@example.org', - 'type' => 'student', - ), - 'admin' => array( - 'password' => 'admin', - 'uid' => 'admin', - 'name' => 'Admin Name', - 'mail' => 'someadmin@example.org', - 'type' => 'employee', - ), -); - +$users = [ + 'student' => [ + 'password' => 'student', + 'uid' => 'student', + 'name' => 'Student Name', + 'mail' => 'somestudent@example.org', + 'type' => 'student', + ], + 'admin' => [ + 'password' => 'admin', + 'uid' => 'admin', + 'name' => 'Admin Name', + 'mail' => 'someadmin@example.org', + 'type' => 'employee', + ], +]; /* * Time to handle login responses. * Since this is a dummy example, we accept any data. */ -$badUserPass = FALSE; +$badUserPass = false; if ($_SERVER['REQUEST_METHOD'] === 'POST') { - $username = (string)$_REQUEST['username']; - $password = (string)$_REQUEST['password']; - - if (!isset($users[$username]) || $users[$username]['password'] !== $password) { - $badUserPass = TRUE; - } else { - - $user = $users[$username]; - - if (!session_id()) { - // session_start not called before. Do it here. - session_start(); - } - - $_SESSION['uid'] = $user['uid']; - $_SESSION['name'] = $user['name']; - $_SESSION['mail'] = $user['mail']; - $_SESSION['type'] = $user['type']; - - \SimpleSAML\Utils\HTTP::redirectTrustedURL($returnTo); - } + $username = (string) $_REQUEST['username']; + $password = (string) $_REQUEST['password']; + + if (!isset($users[$username]) || $users[$username]['password'] !== $password) { + $badUserPass = true; + } else { + $user = $users[$username]; + + if (!session_id()) { + // session_start not called before. Do it here. + session_start(); + } + + $_SESSION['uid'] = $user['uid']; + $_SESSION['name'] = $user['name']; + $_SESSION['mail'] = $user['mail']; + $_SESSION['type'] = $user['type']; + + \SimpleSAML\Utils\HTTP::redirectTrustedURL($returnTo); + } } - /* * If we get this far, we need to show the login page to the user. */ @@ -101,7 +96,10 @@ </head> <body> <h1>exampleauth login page</h1> -<p>In this example you can log in with two accounts: <code>student</code> and <code>admin</code>. In both cases, the password is the same as the username.</p> +<p> +In this example you can log in with two accounts: <code>student</code> and <code>admin</code>. +In both cases, the password is the same as the username. +</p> <?php if ($badUserPass) { ?> <p>Bad username or password.</p> <?php } ?> diff --git a/vendor/simplesamlphp/simplesamlphp/modules/exampleauth/www/redirecttest.php b/vendor/simplesamlphp/simplesamlphp/modules/exampleauth/www/redirecttest.php index 96ff9a50f7..9d605277d3 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/exampleauth/www/redirecttest.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/exampleauth/www/redirecttest.php @@ -8,10 +8,10 @@ */ if (!array_key_exists('StateId', $_REQUEST)) { - throw new SimpleSAML_Error_BadRequest('Missing required StateId query parameter.'); + throw new \SimpleSAML\Error\BadRequest('Missing required StateId query parameter.'); } -$state = SimpleSAML_Auth_State::loadState($_REQUEST['StateId'], 'exampleauth:redirectfilter-test'); +$state = \SimpleSAML\Auth\State::loadState($_REQUEST['StateId'], 'exampleauth:redirectfilter-test'); -$state['Attributes']['RedirectTest2'] = array('OK'); +$state['Attributes']['RedirectTest2'] = ['OK']; -SimpleSAML_Auth_ProcessingChain::resumeProcessing($state); +\SimpleSAML\Auth\ProcessingChain::resumeProcessing($state); diff --git a/vendor/simplesamlphp/simplesamlphp/modules/exampleauth/www/resume.php b/vendor/simplesamlphp/simplesamlphp/modules/exampleauth/www/resume.php index 08d66dd3f4..192c13a20d 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/exampleauth/www/resume.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/exampleauth/www/resume.php @@ -8,4 +8,7 @@ * * @package SimpleSAMLphp */ -sspmod_exampleauth_Auth_Source_External::resume(); + +namespace SimpleSAML\Module\exampleauth\Auth\Source; + +External::resume(); diff --git a/vendor/simplesamlphp/simplesamlphp/modules/expirycheck/dictionaries/expwarning.translation.json b/vendor/simplesamlphp/simplesamlphp/modules/expirycheck/dictionaries/expwarning.translation.json index d6ff6bb2e9..18dc57dc10 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/expirycheck/dictionaries/expwarning.translation.json +++ b/vendor/simplesamlphp/simplesamlphp/modules/expirycheck/dictionaries/expwarning.translation.json @@ -11,7 +11,9 @@ "zh-tw": "\u60a8\u6c92\u6709\u6b0a\u9650\u4f7f\u7528\u6b64\u670d\u52d9", "da": "Du har ikke adgang til denne tjeneste", "af": "Jy het nie toegang na die diens nie", - "el": "\u0394\u03b5\u03bd \u03ad\u03c7\u03b5\u03c4\u03b5 \u03c0\u03c1\u03cc\u03c3\u03b2\u03b1\u03c3\u03b7 \u03c3\u03b5 \u03b1\u03c5\u03c4\u03ae \u03c4\u03b7\u03bd \u03c5\u03c0\u03b7\u03c1\u03b5\u03c3\u03af\u03b1" + "el": "\u0394\u03b5\u03bd \u03ad\u03c7\u03b5\u03c4\u03b5 \u03c0\u03c1\u03cc\u03c3\u03b2\u03b1\u03c3\u03b7 \u03c3\u03b5 \u03b1\u03c5\u03c4\u03ae \u03c4\u03b7\u03bd \u03c5\u03c0\u03b7\u03c1\u03b5\u03c3\u03af\u03b1", + "xh": "Awunalo ufikelelo kule nkonzo", + "zu": "Awukwazi ukufinyelela le sevisi" }, "no_access_to": { "sl": "Dostop zavrnjen, ker je va\u0161e uporabni\u0161ko (NetID) %NETID% ime poteklo!", @@ -25,7 +27,9 @@ "zh-tw": "\u60a8\u7684\u5e33\u865f %NETID% \u5df2\u904e\u671f\uff0c\u5b58\u53d6\u62d2\u7d55\uff01", "da": "Din konto %NETID% er udl\u00f8bet, adgang n\u00e6gtet!", "af": "Jou rekening %NETID% het verval, toegang verbode!", - "el": "\u039f \u03bb\u03bf\u03b3\u03b1\u03c1\u03b9\u03b1\u03c3\u03bc\u03cc\u03c2 %NETID% u03ad\u03c7\u03b5\u03b9 \u03bb\u03ae\u03be\u03b5\u03b9 - \u03b4\u03b5\u03bd \u03b5\u03c0\u03b9\u03c4\u03c1\u03ad\u03c0\u03b5\u03c4\u03b1\u03b9 \u03b7 \u03c0\u03c1\u03cc\u03c3\u03b2\u03b1\u03c3\u03b7!" + "el": "\u039f \u03bb\u03bf\u03b3\u03b1\u03c1\u03b9\u03b1\u03c3\u03bc\u03cc\u03c2 %NETID% u03ad\u03c7\u03b5\u03b9 \u03bb\u03ae\u03be\u03b5\u03b9 - \u03b4\u03b5\u03bd \u03b5\u03c0\u03b9\u03c4\u03c1\u03ad\u03c0\u03b5\u03c4\u03b1\u03b9 \u03b7 \u03c0\u03c1\u03cc\u03c3\u03b2\u03b1\u03c3\u03b7!", + "zu": "I-akhawunti yakho ethi %NETID% iphelelwe isikhathi, ukufinyelela kwenqatshiwe!", + "xh": "Iakhawunti yakho %NETID% iphelelwe, ufikelelo lukhatyiwe!" }, "contact_home": { "sl": "Mo\u017enost dostopa do storitve ureja va\u0161a doma\u010da organizacija. Obrnite se na njihov oddelek za pomo\u010d uporabnikom.", @@ -38,7 +42,9 @@ "zh-tw": "\u5b58\u53d6\u60a8\u7684\u7d44\u7e54\u6240\u7ba1\u7406\u4e4b\u670d\u52d9\u3002\u82e5\u6709\u554f\u984c\u8acb\u806f\u7d61\u60a8\u7576\u5730\u7684 IT \u652f\u63f4\u7a97\u53e3\u3002", "da": "Adgang til tjenester styres af din hjemmeinstitution. Kontakt venligst din lokale it-support for hj\u00e6lp.", "af": "Toegang tot dienste word beheer deur jou tuis organisasie. Kontak asseblief jou plaaslike IT ondersteuning vir navrae.", - "el": "\u0397 \u03c0\u03c1\u03cc\u03c3\u03b2\u03b1\u03c3\u03b7 \u03c3\u03c4\u03b9\u03c2 \u03c5\u03c0\u03b7\u03c1\u03b5\u03c3\u03af\u03b5\u03c2 \u03b5\u03bb\u03ad\u03b3\u03c7\u03b5\u03c4\u03b1\u03b9 \u03b1\u03c0\u03cc \u03c4\u03bf\u03bd \u039f\u03b9\u03ba\u03b5\u03af\u03bf \u03a6\u03bf\u03c1\u03ad\u03b1. \u0393\u03b9\u03b1 \u03c0\u03b5\u03c1\u03b1\u03b9\u03c4\u03ad\u03c1\u03c9 \u03b5\u03c1\u03c9\u03c4\u03ae\u03c3\u03b5\u03b9\u03c2, \u03c0\u03b1\u03c1\u03b1\u03ba\u03b1\u03bb\u03bf\u03cd\u03bc\u03b5 \u03b1\u03c0\u03b5\u03c5\u03b8\u03c5\u03bd\u03b8\u03b5\u03af\u03c4\u03b5 \u03c3\u03c4\u03bf \u03c4\u03bf\u03c0\u03b9\u03ba\u03cc \u0393\u03c1\u03b1\u03c6\u03b5\u03af\u03bf \u0391\u03c1\u03c9\u03b3\u03ae\u03c2 \u03a7\u03c1\u03b7\u03c3\u03c4\u03ce\u03bd." + "el": "\u0397 \u03c0\u03c1\u03cc\u03c3\u03b2\u03b1\u03c3\u03b7 \u03c3\u03c4\u03b9\u03c2 \u03c5\u03c0\u03b7\u03c1\u03b5\u03c3\u03af\u03b5\u03c2 \u03b5\u03bb\u03ad\u03b3\u03c7\u03b5\u03c4\u03b1\u03b9 \u03b1\u03c0\u03cc \u03c4\u03bf\u03bd \u039f\u03b9\u03ba\u03b5\u03af\u03bf \u03a6\u03bf\u03c1\u03ad\u03b1. \u0393\u03b9\u03b1 \u03c0\u03b5\u03c1\u03b1\u03b9\u03c4\u03ad\u03c1\u03c9 \u03b5\u03c1\u03c9\u03c4\u03ae\u03c3\u03b5\u03b9\u03c2, \u03c0\u03b1\u03c1\u03b1\u03ba\u03b1\u03bb\u03bf\u03cd\u03bc\u03b5 \u03b1\u03c0\u03b5\u03c5\u03b8\u03c5\u03bd\u03b8\u03b5\u03af\u03c4\u03b5 \u03c3\u03c4\u03bf \u03c4\u03bf\u03c0\u03b9\u03ba\u03cc \u0393\u03c1\u03b1\u03c6\u03b5\u03af\u03bf \u0391\u03c1\u03c9\u03b3\u03ae\u03c2 \u03a7\u03c1\u03b7\u03c3\u03c4\u03ce\u03bd.", + "zu": "Ukufinyelela amasevisi kulawulwa inhlangano yakho yasekhaya. Sicela uthinte ukusekela kwakho kwe-IT kwasendaweni uma unemibuzo.", + "xh": "Ufikelelo kwiinkonzo lulawulwa ngumbutho wakho wekhaya. Nceda uqhagamshelane nenkxaso yakho ye-IT yasekuhlaleni ngemibuzo." }, "expiry_date_text": { "sl": "Datum poteka:", @@ -52,7 +58,9 @@ "zh-tw": "\u5230\u671f\u65e5\uff1a", "da": "Udl\u00f8bsdato:", "af": "Verval datum:", - "el": "\u0397\u03bc\u03b5\u03c1\u03bf\u03bc\u03b7\u03bd\u03af\u03b1 \u03bb\u03ae\u03be\u03b7\u03c2 \u03b9\u03c3\u03c7\u03cd\u03bf\u03c2:" + "el": "\u0397\u03bc\u03b5\u03c1\u03bf\u03bc\u03b7\u03bd\u03af\u03b1 \u03bb\u03ae\u03be\u03b7\u03c2 \u03b9\u03c3\u03c7\u03cd\u03bf\u03c2:", + "xh": "Umhla wpkuphelelwa:", + "zu": "Usuku lokuphelelwa isikhathi:" }, "warning_header": { "sl": "Pozor! Va\u0161e uporabni\u0161ko ime (NetID) %NETID% bo poteklo \u010dez %DAYSLEFT% %DAYS%!", @@ -65,7 +73,9 @@ "zh-tw": "\u8b66\u544a\uff0c\u60a8\u7684\u5e33\u865f %NETID% \u5c07\u65bc %DAYSLEFT% %DAYS% \u5230\u671f\uff01", "da": "Advarsel: din konto %NETID% udl\u00f8ber om %DAYSLEFT% %DAYS%!", "af": "Waarskuwing, jou rekening %NETID% sal verval in %DAYSLEFT% %DAYS%!", - "el": "\u03a0\u03c1\u03bf\u03b5\u03b9\u03b4\u03bf\u03c0\u03bf\u03af\u03b7\u03c3\u03b7: \u039f \u03bb\u03bf\u03b3\u03b1\u03c1\u03b9\u03b1\u03c3\u03bc\u03cc\u03c2 %NETID% \u03b8\u03b1 \u03bb\u03ae\u03be\u03b5\u03b9 \u03c3\u03b5 %DAYSLEFT% %DAYS%!" + "el": "\u03a0\u03c1\u03bf\u03b5\u03b9\u03b4\u03bf\u03c0\u03bf\u03af\u03b7\u03c3\u03b7: \u039f \u03bb\u03bf\u03b3\u03b1\u03c1\u03b9\u03b1\u03c3\u03bc\u03cc\u03c2 %NETID% \u03b8\u03b1 \u03bb\u03ae\u03be\u03b5\u03b9 \u03c3\u03b5 %DAYSLEFT% %DAYS%!", + "zu": "Isixwayiso, i-akhawunti yakho ethi %NETID% izophelelwa isikhathi ezinsukwini ezingu-%DAYSLEFT% %DAYS%!", + "xh": "Isilumkiso, iakhawunti yakho %NETID% iza kuphelelwa %DAYSLEFT% %DAYS%!" }, "warning_header_today": { "sl": "Pozor! Va\u0161e uporabni\u0161ko ime (NetID) %NETID% pote\u010de danes!", @@ -78,7 +88,9 @@ "zh-tw": "\u8b66\u544a\uff0c\u60a8\u7684\u5e33\u865f %NETID% \u4eca\u5929\u5230\u671f\uff01", "da": "Advarsel: din konto %NETID% udl\u00f8ber i dag!", "af": "Waarskuwing, jou rekening %NETID% verval vandag!", - "el": "\u03a0\u03c1\u03bf\u03b5\u03b9\u03b4\u03bf\u03c0\u03bf\u03af\u03b7\u03c3\u03b7: \u039f \u03bb\u03bf\u03b3\u03b1\u03c1\u03b9\u03b1\u03c3\u03bc\u03cc\u03c2 %NETID% \u03bb\u03ae\u03b3\u03b5\u03b9 \u03c3\u03ae\u03bc\u03b5\u03c1\u03b1!" + "el": "\u03a0\u03c1\u03bf\u03b5\u03b9\u03b4\u03bf\u03c0\u03bf\u03af\u03b7\u03c3\u03b7: \u039f \u03bb\u03bf\u03b3\u03b1\u03c1\u03b9\u03b1\u03c3\u03bc\u03cc\u03c2 %NETID% \u03bb\u03ae\u03b3\u03b5\u03b9 \u03c3\u03ae\u03bc\u03b5\u03c1\u03b1!", + "zu": "Isixwayiso, i-akhawunti yakho ethi %NETID% izophelelwa isikhathi namuhla!", + "xh": "Isilumkiso, iakhawunti yakho %NETID% iza kuphelelwa namhlanje!" }, "warning": { "sl": "Pozor! Va\u0161e uporabni\u0161ko ime (NetID) %NETID% bo poteklo \u010dez %DAYSLEFT% %DAYS%!", @@ -91,7 +103,9 @@ "zh-tw": "\u8b66\u544a\uff0c\u60a8\u7684\u5e33\u865f %NETID% \u5c07\u65bc %DAYSLEFT% %DAYS% \u5230\u671f\uff01", "da": "Advarsel: din konto %NETID% udl\u00f8ber om %DAYSLEFT% %DAYS%!", "af": "Waarskuwing, jou rekening %NETID% sal verval in %DAYSLEFT% %DAYS%!", - "el": "\u03a0\u03c1\u03bf\u03b5\u03b9\u03b4\u03bf\u03c0\u03bf\u03af\u03b7\u03c3\u03b7: \u039f \u03bb\u03bf\u03b3\u03b1\u03c1\u03b9\u03b1\u03c3\u03bc\u03cc\u03c2 %NETID% \u03b8\u03b1 \u03bb\u03ae\u03be\u03b5\u03b9 \u03c3\u03b5 %DAYSLEFT% %DAYS%!" + "el": "\u03a0\u03c1\u03bf\u03b5\u03b9\u03b4\u03bf\u03c0\u03bf\u03af\u03b7\u03c3\u03b7: \u039f \u03bb\u03bf\u03b3\u03b1\u03c1\u03b9\u03b1\u03c3\u03bc\u03cc\u03c2 %NETID% \u03b8\u03b1 \u03bb\u03ae\u03be\u03b5\u03b9 \u03c3\u03b5 %DAYSLEFT% %DAYS%!", + "zu": "Isixwayiso, i-akhawunti yakho ethi %NETID% izophelelwa isikhathi ezinsukwini ezingu-%DAYSLEFT% %DAYS%!", + "xh": "Isilumkiso, iakhawunti yakho %NETID% iza kuphelelwa %DAYSLEFT% %DAYS%!" }, "warning_today": { "sl": "Pozor! Va\u0161e uporabni\u0161ko ime (NetID) %NETID% pote\u010de danes!", @@ -104,7 +118,9 @@ "zh-tw": "\u8b66\u544a\uff0c\u60a8\u7684\u5e33\u865f %NETID% \u4eca\u5929\u5230\u671f\uff01", "da": "Advarsel: din konto %NETID% udl\u00f8ber i dag!", "af": "Waarskuwing, jou rekening %NETID% verval vandag!", - "el": "\u03a0\u03c1\u03bf\u03b5\u03b9\u03b4\u03bf\u03c0\u03bf\u03af\u03b7\u03c3\u03b7: \u039f \u03bb\u03bf\u03b3\u03b1\u03c1\u03b9\u03b1\u03c3\u03bc\u03cc\u03c2 %NETID% \u03bb\u03ae\u03b3\u03b5\u03b9 \u03c3\u03ae\u03bc\u03b5\u03c1\u03b1!" + "el": "\u03a0\u03c1\u03bf\u03b5\u03b9\u03b4\u03bf\u03c0\u03bf\u03af\u03b7\u03c3\u03b7: \u039f \u03bb\u03bf\u03b3\u03b1\u03c1\u03b9\u03b1\u03c3\u03bc\u03cc\u03c2 %NETID% \u03bb\u03ae\u03b3\u03b5\u03b9 \u03c3\u03ae\u03bc\u03b5\u03c1\u03b1!", + "xh": "Isilumkiso, iakhawunti yakho %NETID% iza kuphelelwa namhlanje!", + "zu": "Isixwayiso, i-akhawunti yakho ethi %NETID% izophelelwa isikhathi namuhla!" }, "day": { "sl": "dan", @@ -117,7 +133,9 @@ "zh-tw": "\u65e5", "da": "dag", "af": "dag", - "el": "\u03b7\u03bc\u03ad\u03c1\u03b1" + "el": "\u03b7\u03bc\u03ad\u03c1\u03b1", + "xh": "usuku", + "zu": "usuku" }, "days": { "sl": "dni", @@ -130,7 +148,9 @@ "zh-tw": "\u65e5", "da": "dage", "af": "dae", - "el": "\u03b7\u03bc\u03ad\u03c1\u03b5\u03c2" + "el": "\u03b7\u03bc\u03ad\u03c1\u03b5\u03c2", + "zu": "izinsuku", + "xh": "iintsuku" }, "btn_continue": { "sl": "Zavedam se tega, nadaljuj...", @@ -144,6 +164,8 @@ "zh-tw": "\u6211\u77e5\u9053\u4e86\uff0c\u7e7c\u7e8c...", "da": "Jeg er opm\u00e6rksom p\u00e5 dette, forts\u00e6t...", "af": "Ek is bewus hiervan, gaan voort...", - "el": "\u0395\u03af\u03bc\u03b1\u03b9 \u03b5\u03bd\u03ae\u03bc\u03b5\u03c1\u03bf\u03c2 - \u03c3\u03c5\u03bd\u03ad\u03c7\u03b5\u03b9\u03b1" + "el": "\u0395\u03af\u03bc\u03b1\u03b9 \u03b5\u03bd\u03ae\u03bc\u03b5\u03c1\u03bf\u03c2 - \u03c3\u03c5\u03bd\u03ad\u03c7\u03b5\u03b9\u03b1", + "xh": "Ndiyakuqonda oku, qhubeka...", + "zu": "Ngiyakwazi lokhu, qhubeka..." } } diff --git a/vendor/simplesamlphp/simplesamlphp/modules/expirycheck/lib/Auth/Process/ExpiryDate.php b/vendor/simplesamlphp/simplesamlphp/modules/expirycheck/lib/Auth/Process/ExpiryDate.php index 8e98ac4e44..ddd5befc15 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/expirycheck/lib/Auth/Process/ExpiryDate.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/expirycheck/lib/Auth/Process/ExpiryDate.php @@ -1,5 +1,7 @@ <?php +namespace SimpleSAML\Module\expirycheck\Auth\Process; + /** * Filter which show "about to expire" warning or deny access if netid is expired. * @@ -20,137 +22,139 @@ * @package SimpleSAMLphp */ -class sspmod_expirycheck_Auth_Process_ExpiryDate extends SimpleSAML_Auth_ProcessingFilter { - - private $warndaysbefore = 0; - private $netid_attr = NULL; - private $expirydate_attr = NULL; - private $date_format = 'd.m.Y'; - - - /** - * Initialize this filter. - * - * @param array $config Configuration information about this filter. - * @param mixed $reserved For future use. - */ - public function __construct($config, $reserved) { - parent::__construct($config, $reserved); - - assert('is_array($config)'); - - if (array_key_exists('warndaysbefore', $config)) { - $this->warndaysbefore = $config['warndaysbefore']; - if (!is_string($this->warndaysbefore)) { - throw new Exception('Invalid value for number of days given to expirycheck::ExpiryDate filter.'); - } - } - - if (array_key_exists('netid_attr', $config)) { - $this->netid_attr = $config['netid_attr']; - if (!is_string($this->netid_attr)) { - throw new Exception('Invalid attribute name given as eduPersonPrincipalName to expirycheck::ExpiryDate filter.'); - } - } - - if (array_key_exists('expirydate_attr', $config)) { - $this->expirydate_attr = $config['expirydate_attr']; - if (!is_string($this->expirydate_attr)) { - throw new Exception('Invalid attribute name given as schacExpiryDate to expirycheck::ExpiryDate filter.'); - } - } - - if (array_key_exists('date_format', $config)) { - $this->date_format = $config['date_format']; - if (!is_string($this->date_format)) { - throw new Exception('Invalid date format given to expirycheck::ExpiryDate filter.'); - } - } - } - - /** - * Show expirational warning if remaining days is equal or under defined $warndaysbefore - * @param integer $expireOnDate - * @param integer $warndaysbefore - * @return bool - * - */ - public function shWarning(&$state, $expireOnDate, $warndaysbefore) { - $now = time(); - $end = $expireOnDate; - - if ($expireOnDate >= $now) { - $days = (int)(($end - $now) / (24*60*60)); - if ($days <= $warndaysbefore) { - $state['daysleft'] = $days; - return true; - } - } - return false; - } - - /** - * Check if given date is older than today - * @param integer $expireOnDate - * @return bool - * - */ - public function checkDate($expireOnDate) { - $now = time(); - $end = $expireOnDate; - - if ($now <= $end) { - return true; - } else { - return false; - } - - } - - /** - * Apply filter - * - * @param array &$state The current state. - */ - public function process(&$state) { - /* - * UTC format: 20090527080352Z - */ - $netId = $state['Attributes'][$this->netid_attr][0]; - $expireOnDate = strtotime($state['Attributes'][$this->expirydate_attr][0]); - - if (self::shWarning($state, $expireOnDate, $this->warndaysbefore)) { - assert('is_array($state)'); - if (isset($state['isPassive']) && $state['isPassive'] === TRUE) { - // We have a passive request. Skip the warning. - return; - } - - SimpleSAML\Logger::warning('expirycheck: NetID ' . $netId . - ' is about to expire!'); - - // Save state and redirect - $state['expireOnDate'] = date($this->date_format, $expireOnDate); - $state['netId'] = $netId; - $id = SimpleSAML_Auth_State::saveState($state, 'expirywarning:about2expire'); - $url = SimpleSAML\Module::getModuleURL('expirycheck/about2expire.php'); - \SimpleSAML\Utils\HTTP::redirectTrustedURL($url, array('StateId' => $id)); - } - - if (!self::checkDate($expireOnDate)) { - SimpleSAML\Logger::error('expirycheck: NetID ' . $netId . - ' has expired [' . date($this->date_format, $expireOnDate) . ']. Access denied!'); - $globalConfig = SimpleSAML_Configuration::getInstance(); - - /* Save state and redirect. */ - $state['expireOnDate'] = date($this->date_format, $expireOnDate); - $state['netId'] = $netId; - $id = SimpleSAML_Auth_State::saveState($state, 'expirywarning:expired'); - $url = SimpleSAML\Module::getModuleURL('expirycheck/expired.php'); - \SimpleSAML\Utils\HTTP::redirectTrustedURL($url, array('StateId' => $id)); - - } - } - - +class ExpiryDate extends \SimpleSAML\Auth\ProcessingFilter +{ + private $warndaysbefore = 0; + private $netid_attr = null; + private $expirydate_attr = null; + private $date_format = 'd.m.Y'; + + + /** + * Initialize this filter. + * + * @param array $config Configuration information about this filter. + * @param mixed $reserved For future use. + */ + public function __construct($config, $reserved) + { + parent::__construct($config, $reserved); + + assert(is_array($config)); + + if (array_key_exists('warndaysbefore', $config)) { + $this->warndaysbefore = $config['warndaysbefore']; + if (!is_string($this->warndaysbefore)) { + throw new \Exception('Invalid value for number of days given to expirycheck::ExpiryDate filter.'); + } + } + + if (array_key_exists('netid_attr', $config)) { + $this->netid_attr = $config['netid_attr']; + if (!is_string($this->netid_attr)) { + throw new \Exception( + 'Invalid attribute name given as eduPersonPrincipalName to expirycheck::ExpiryDate filter.' + ); + } + } + + if (array_key_exists('expirydate_attr', $config)) { + $this->expirydate_attr = $config['expirydate_attr']; + if (!is_string($this->expirydate_attr)) { + throw new \Exception( + 'Invalid attribute name given as schacExpiryDate to expirycheck::ExpiryDate filter.' + ); + } + } + + if (array_key_exists('date_format', $config)) { + $this->date_format = $config['date_format']; + if (!is_string($this->date_format)) { + throw new \Exception('Invalid date format given to expirycheck::ExpiryDate filter.'); + } + } + } + + /** + * Show expirational warning if remaining days is equal or under defined $warndaysbefore + * @param integer $expireOnDate + * @param integer $warndaysbefore + * @return bool + * + */ + public function shWarning(&$state, $expireOnDate, $warndaysbefore) + { + $now = time(); + $end = $expireOnDate; + + if ($expireOnDate >= $now) { + $days = (int) (($end - $now) / 86400); //24*60*60=86400 + if ($days <= $warndaysbefore) { + $state['daysleft'] = $days; + return true; + } + } + return false; + } + + /** + * Check if given date is older than today + * @param integer $expireOnDate + * @return bool + * + */ + public function checkDate($expireOnDate) + { + $now = time(); + $end = $expireOnDate; + + if ($now <= $end) { + return true; + } else { + return false; + } + } + + /** + * Apply filter + * + * @param array &$state The current state. + */ + public function process(&$state) + { + /* + * UTC format: 20090527080352Z + */ + $netId = $state['Attributes'][$this->netid_attr][0]; + $expireOnDate = strtotime($state['Attributes'][$this->expirydate_attr][0]); + + if ($this->shWarning($state, $expireOnDate, $this->warndaysbefore)) { + assert(is_array($state)); + if (isset($state['isPassive']) && $state['isPassive'] === true) { + // We have a passive request. Skip the warning. + return; + } + + \SimpleSAML\Logger::warning('expirycheck: NetID '.$netId.' is about to expire!'); + + // Save state and redirect + $state['expireOnDate'] = date($this->date_format, $expireOnDate); + $state['netId'] = $netId; + $id = \SimpleSAML\Auth\State::saveState($state, 'expirywarning:about2expire'); + $url = \SimpleSAML\Module::getModuleURL('expirycheck/about2expire.php'); + \SimpleSAML\Utils\HTTP::redirectTrustedURL($url, ['StateId' => $id]); + } + + if (!$this->checkDate($expireOnDate)) { + \SimpleSAML\Logger::error('expirycheck: NetID '.$netId. + ' has expired ['.date($this->date_format, $expireOnDate).']. Access denied!'); + + /* Save state and redirect. */ + $state['expireOnDate'] = date($this->date_format, $expireOnDate); + $state['netId'] = $netId; + $id = \SimpleSAML\Auth\State::saveState($state, 'expirywarning:expired'); + $url = \SimpleSAML\Module::getModuleURL('expirycheck/expired.php'); + \SimpleSAML\Utils\HTTP::redirectTrustedURL($url, ['StateId' => $id]); + } + } } diff --git a/vendor/simplesamlphp/simplesamlphp/modules/expirycheck/locales/xh/LC_MESSAGES/expirycheck.po b/vendor/simplesamlphp/simplesamlphp/modules/expirycheck/locales/xh/LC_MESSAGES/expirycheck.po new file mode 100644 index 0000000000..e8634353ea --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/modules/expirycheck/locales/xh/LC_MESSAGES/expirycheck.po @@ -0,0 +1,51 @@ + +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: SimpleSAMLphp 1.15\n" +"Report-Msgid-Bugs-To: simplesamlphp-translation@googlegroups.com\n" +"POT-Creation-Date: 2018-11-15 14:49+0200\n" +"PO-Revision-Date: 2018-11-15 14:49+0200\n" +"Last-Translator: \n" +"Language-Team: \n" +"Plural-Forms: nplurals=2; plural=(n != 1)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 1.3\n" + +msgid "{expirycheck:expwarning:contact_home}" +msgstr "" +"Ufikelelo kwiinkonzo lulawulwa ngumbutho wakho wekhaya. Nceda " +"uqhagamshelane nenkxaso yakho ye-IT yasekuhlaleni ngemibuzo." + +msgid "{expirycheck:expwarning:day}" +msgstr "usuku" + +msgid "{expirycheck:expwarning:btn_continue}" +msgstr "Ndiyakuqonda oku, qhubeka..." + +msgid "{expirycheck:expwarning:days}" +msgstr "iintsuku" + +msgid "{expirycheck:expwarning:expiry_date_text}" +msgstr "Umhla wpkuphelelwa:" + +msgid "{expirycheck:expwarning:access_denied}" +msgstr "Awunalo ufikelelo kule nkonzo" + +msgid "{expirycheck:expwarning:warning_today}" +msgstr "Isilumkiso, iakhawunti yakho %NETID% iza kuphelelwa namhlanje!" + +msgid "{expirycheck:expwarning:warning_header}" +msgstr "Isilumkiso, iakhawunti yakho %NETID% iza kuphelelwa %DAYSLEFT% %DAYS%!" + +msgid "{expirycheck:expwarning:no_access_to}" +msgstr "Iakhawunti yakho %NETID% iphelelwe, ufikelelo lukhatyiwe!" + +msgid "{expirycheck:expwarning:warning_header_today}" +msgstr "Isilumkiso, iakhawunti yakho %NETID% iza kuphelelwa namhlanje!" + +msgid "{expirycheck:expwarning:warning}" +msgstr "Isilumkiso, iakhawunti yakho %NETID% iza kuphelelwa %DAYSLEFT% %DAYS%!" + diff --git a/vendor/simplesamlphp/simplesamlphp/modules/expirycheck/locales/zu/LC_MESSAGES/expirycheck.po b/vendor/simplesamlphp/simplesamlphp/modules/expirycheck/locales/zu/LC_MESSAGES/expirycheck.po new file mode 100644 index 0000000000..39a24f6166 --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/modules/expirycheck/locales/zu/LC_MESSAGES/expirycheck.po @@ -0,0 +1,57 @@ + +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: SimpleSAMLphp 1.15\n" +"Report-Msgid-Bugs-To: simplesamlphp-translation@googlegroups.com\n" +"POT-Creation-Date: 2018-11-15 14:49+0200\n" +"PO-Revision-Date: 2018-11-15 14:49+0200\n" +"Last-Translator: \n" +"Language-Team: \n" +"Plural-Forms: nplurals=2; plural=(n != 1)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 1.3\n" + +msgid "{expirycheck:expwarning:contact_home}" +msgstr "" +"Ukufinyelela amasevisi kulawulwa inhlangano yakho yasekhaya. Sicela " +"uthinte ukusekela kwakho kwe-IT kwasendaweni uma unemibuzo." + +msgid "{expirycheck:expwarning:day}" +msgstr "usuku" + +msgid "{expirycheck:expwarning:btn_continue}" +msgstr "Ngiyakwazi lokhu, qhubeka..." + +msgid "{expirycheck:expwarning:days}" +msgstr "izinsuku" + +msgid "{expirycheck:expwarning:expiry_date_text}" +msgstr "Usuku lokuphelelwa isikhathi:" + +msgid "{expirycheck:expwarning:access_denied}" +msgstr "Awukwazi ukufinyelela le sevisi" + +msgid "{expirycheck:expwarning:warning_today}" +msgstr "Isixwayiso, i-akhawunti yakho ethi %NETID% izophelelwa isikhathi namuhla!" + +msgid "{expirycheck:expwarning:warning_header}" +msgstr "" +"Isixwayiso, i-akhawunti yakho ethi %NETID% izophelelwa isikhathi " +"ezinsukwini ezingu-%DAYSLEFT% %DAYS%!" + +msgid "{expirycheck:expwarning:no_access_to}" +msgstr "" +"I-akhawunti yakho ethi %NETID% iphelelwe isikhathi, ukufinyelela " +"kwenqatshiwe!" + +msgid "{expirycheck:expwarning:warning_header_today}" +msgstr "Isixwayiso, i-akhawunti yakho ethi %NETID% izophelelwa isikhathi namuhla!" + +msgid "{expirycheck:expwarning:warning}" +msgstr "" +"Isixwayiso, i-akhawunti yakho ethi %NETID% izophelelwa isikhathi " +"ezinsukwini ezingu-%DAYSLEFT% %DAYS%!" + diff --git a/vendor/simplesamlphp/simplesamlphp/modules/expirycheck/templates/about2expire.php b/vendor/simplesamlphp/simplesamlphp/modules/expirycheck/templates/about2expire.php index e2be96973a..6b135f807f 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/expirycheck/templates/about2expire.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/expirycheck/templates/about2expire.php @@ -16,72 +16,24 @@ * @package SimpleSAMLphp */ -# netid will expire today -if ($this->data['daysleft'] == 0) { - $this->data['header'] = $this->t('{expirycheck:expwarning:warning_header_today}', array( - '%NETID%' => htmlspecialchars($this->data['netId']) - )); - - $warning = $this->t('{expirycheck:expwarning:warning_today}', array( - '%NETID%' => htmlspecialchars($this->data['netId']) - )); - -} -# netid will expire in one day -elseif ($this->data['daysleft'] == 1) { - - $this->data['header'] = $this->t('{expirycheck:expwarning:warning_header}', array( - '%NETID%' => htmlspecialchars($this->data['netId']), - '%DAYS%' => $this->t('{expirycheck:expwarning:day}'), - '%DAYSLEFT%' => htmlspecialchars($this->data['daysleft']), - )); - - $warning = $this->t('{expirycheck:expwarning:warning}', array( - '%NETID%' => htmlspecialchars($this->data['netId']), - '%DAYS%' => $this->t('{expirycheck:expwarning:day}'), - '%DAYSLEFT%' => htmlspecialchars($this->data['daysleft']), - )); - -} -# netid will expire in next <daysleft> days -else { - $this->data['header'] = $this->t('{expirycheck:expwarning:warning_header}', array( - '%NETID%' => htmlspecialchars($this->data['netId']), - '%DAYS%' => $this->t('{expirycheck:expwarning:days}'), - '%DAYSLEFT%' => htmlspecialchars($this->data['daysleft']), - )); - - $warning = $this->t('{expirycheck:expwarning:warning}', array( - '%NETID%' => htmlspecialchars($this->data['netId']), - '%DAYS%' => $this->t('{expirycheck:expwarning:days}'), - '%DAYSLEFT%' => htmlspecialchars($this->data['daysleft']), - )); - - -} - $this->data['autofocus'] = 'yesbutton'; - $this->includeAtTemplateBase('includes/header.php'); -?> - -<form style="display: inline; margin: 0px; padding: 0px" action="<?php echo htmlspecialchars($this->data['yesTarget']); ?>"> +$yesTarget = htmlspecialchars($this->data['yesTarget']); +$buttonContinue = htmlspecialchars($this->t('{expirycheck:expwarning:btn_continue}')); - <?php - // Embed hidden fields... - foreach ($this->data['yesData'] as $name => $value) { - echo('<input type="hidden" name="' . htmlspecialchars($name) . '" value="' . htmlspecialchars($value) . '" />'); - } - ?> - <h3><?php echo $warning; ?></h3> - <p><?php echo $this->t('{expirycheck:expwarning:expiry_date_text}') . " " . $this->data['expireOnDate']; ?></p> - - <input type="submit" name="yes" id="yesbutton" value="<?php echo htmlspecialchars($this->t('{expirycheck:expwarning:btn_continue}')) ?>" /> +echo '<form style="display: inline; margin: 0px; padding: 0px" action="'.$yesTarget.'">'; +// Embed hidden fields... +foreach ($this->data['yesData'] as $name => $value) { + echo '<input type="hidden" name="'.htmlspecialchars($name).'" value="'.htmlspecialchars($value).'" />'; +} +?> +<h3><?php echo $warning; ?></h3> +<p><?php echo $this->t('{expirycheck:expwarning:expiry_date_text}')." ".$this->data['expireOnDate']; ?></p> +<input type="submit" name="yes" id="yesbutton" value="<?php echo $buttonContinue; ?>" /> </form> - <?php $this->includeAtTemplateBase('includes/footer.php'); diff --git a/vendor/simplesamlphp/simplesamlphp/modules/expirycheck/templates/about2expire.twig b/vendor/simplesamlphp/simplesamlphp/modules/expirycheck/templates/about2expire.twig new file mode 100644 index 0000000000..1e1d5d4273 --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/modules/expirycheck/templates/about2expire.twig @@ -0,0 +1,13 @@ +{% set pagetitle = 'SimpleSAMLphp'|trans %} +{% extends "base.twig" %} + +{% block content %} + <form style="display: inline; margin: 0px; padding: 0px" action="{{ yesTarget|escape('html') }}"> + {% for name, value in yesData %} + <input type="hidden" name="{{ name|escape('html') }}" value="{{ value|escape('html') }}"> + {% endfor %} + <h3>{{ warning }}</h3> + <p>{{ '{expirycheck:expwarning:expiry_date_text}'|trans }} {{ expireOnDate }}</p> + <input type="submit" name="yes" id="yesbutton" value="{{ '{expirycheck:expwarning:btn_continue}'|trans }}" autofocus> + </form> +{% endblock %} diff --git a/vendor/simplesamlphp/simplesamlphp/modules/expirycheck/templates/expired.php b/vendor/simplesamlphp/simplesamlphp/modules/expirycheck/templates/expired.php index 2095d80992..2e0e660201 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/expirycheck/templates/expired.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/expirycheck/templates/expired.php @@ -2,10 +2,19 @@ $this->data['header'] = $this->t('{expirycheck:expwarning:access_denied}'); $this->includeAtTemplateBase('includes/header.php'); ?> - - <h2><?php echo $this->t('{expirycheck:expwarning:access_denied}');?></h2> - <p><?php echo $this->t('{expirycheck:expwarning:no_access_to}', array('%NETID%' => htmlspecialchars($this->data['netId'])));?></p> - <p><?php echo $this->t('{expirycheck:expwarning:expiry_date_text}');?> <b><?php echo htmlspecialchars($this->data['expireOnDate']);?></b></p> - <p><?php echo $this->t('{expirycheck:expwarning:contact_home}');?></p> + <h2><?php echo $this->t('{expirycheck:expwarning:access_denied}'); ?></h2> + <p> + <?php + echo $this->t( + '{expirycheck:expwarning:no_access_to}', + ['%NETID%' => htmlspecialchars($this->data['netId'])] + ); + ?> + </p> + <p> + <?php echo $this->t('{expirycheck:expwarning:expiry_date_text}'); ?> + <b><?php echo htmlspecialchars($this->data['expireOnDate']); ?></b> + </p> + <p><?php echo $this->t('{expirycheck:expwarning:contact_home}'); ?></p> <?php $this->includeAtTemplateBase('includes/footer.php'); diff --git a/vendor/simplesamlphp/simplesamlphp/modules/expirycheck/templates/expired.twig b/vendor/simplesamlphp/simplesamlphp/modules/expirycheck/templates/expired.twig new file mode 100644 index 0000000000..8c0cecbc11 --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/modules/expirycheck/templates/expired.twig @@ -0,0 +1,9 @@ +{% set pagetitle = 'SimpleSAMLphp'|trans %} +{% extends "base.twig" %} + +{% block content %} + <h2>{{ '{expirycheck:expwarning:access_denied}'|trans }})</h2> + <p>{{ '{expirycheck:expwarning:no_access_to}'|trans({'%NETID%': netId}, "app") }}</p> + <p>{{ '{expirycheck:expwarning:expiry_date_text}'|trans }} <b>{{ expireOnDate }}</b></p> + <p>{{ '{expirycheck:expwarning:contact_home}'|trans }}</p> +{% endblock %} diff --git a/vendor/simplesamlphp/simplesamlphp/modules/expirycheck/www/about2expire.php b/vendor/simplesamlphp/simplesamlphp/modules/expirycheck/www/about2expire.php index 089d829859..1f1766c7e7 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/expirycheck/www/about2expire.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/expirycheck/www/about2expire.php @@ -6,25 +6,64 @@ * @package SimpleSAMLphp */ -SimpleSAML\Logger::info('expirycheck - User has been warned that NetID is near to expirational date.'); +\SimpleSAML\Logger::info('expirycheck - User has been warned that NetID is near to expirational date.'); if (!array_key_exists('StateId', $_REQUEST)) { - throw new SimpleSAML_Error_BadRequest('Missing required StateId query parameter.'); + throw new \SimpleSAML\Error\BadRequest('Missing required StateId query parameter.'); } $id = $_REQUEST['StateId']; -$state = SimpleSAML_Auth_State::loadState($id, 'expirywarning:about2expire'); +$state = \SimpleSAML\Auth\State::loadState($id, 'expirywarning:about2expire'); if (array_key_exists('yes', $_REQUEST)) { - // The user has pressed the yes-button - SimpleSAML_Auth_ProcessingChain::resumeProcessing($state); + // The user has pressed the yes-button + \SimpleSAML\Auth\ProcessingChain::resumeProcessing($state); } -$globalConfig = SimpleSAML_Configuration::getInstance(); +$globalConfig = \SimpleSAML\Configuration::getInstance(); -$t = new SimpleSAML_XHTML_Template($globalConfig, 'expirycheck:about2expire.php'); -$t->data['yesTarget'] = SimpleSAML\Module::getModuleURL('expirycheck/about2expire.php'); -$t->data['yesData'] = array('StateId' => $id); -$t->data['daysleft'] = $state['daysleft']; +$daysleft = $state['daysleft']; + +$t = new \SimpleSAML\XHTML\Template($globalConfig, 'expirycheck:about2expire.php'); +$t->data['autofocus'] = 'yesbutton'; +$t->data['yesTarget'] = \SimpleSAML\Module::getModuleURL('expirycheck/about2expire.php'); +$t->data['yesData'] = ['StateId' => $id]; +$t->data['warning'] = $warning; $t->data['expireOnDate'] = $state['expireOnDate']; $t->data['netId'] = $state['netId']; + +if ($daysleft == 0) { + # netid will expire today + $this->data['header'] = $this->t('{expirycheck:expwarning:warning_header_today}', [ + '%NETID%' => htmlspecialchars($this->data['netId']) + ]); + $this->data['warning'] = $this->t('{expirycheck:expwarning:warning_today}', [ + '%NETID%' => htmlspecialchars($this->data['netId']) + ]); +} elseif ($daysleft == 1) { + # netid will expire in one day + + $this->data['header'] = $this->t('{expirycheck:expwarning:warning_header}', [ + '%NETID%' => htmlspecialchars($this->data['netId']), + '%DAYS%' => $this->t('{expirycheck:expwarning:day}'), + '%DAYSLEFT%' => htmlspecialchars($daysleft), + ]); + $this->data['warning'] = $this->t('{expirycheck:expwarning:warning}', [ + '%NETID%' => htmlspecialchars($this->data['netId']), + '%DAYS%' => $this->t('{expirycheck:expwarning:day}'), + '%DAYSLEFT%' => htmlspecialchars($daysleft), + ]); +} else { + # netid will expire in next <daysleft> days + $this->data['header'] = $this->t('{expirycheck:expwarning:warning_header}', [ + '%NETID%' => htmlspecialchars($this->data['netId']), + '%DAYS%' => $this->t('{expirycheck:expwarning:days}'), + '%DAYSLEFT%' => htmlspecialchars($daysleft), + ]); + $this->data['warning'] = $this->t('{expirycheck:expwarning:warning}', [ + '%NETID%' => htmlspecialchars($this->data['netId']), + '%DAYS%' => $this->t('{expirycheck:expwarning:days}'), + '%DAYSLEFT%' => htmlspecialchars($daysleft), + ]); +} + $t->show(); diff --git a/vendor/simplesamlphp/simplesamlphp/modules/expirycheck/www/expired.php b/vendor/simplesamlphp/simplesamlphp/modules/expirycheck/www/expired.php index 87eef83dad..2d3d3b3e8d 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/expirycheck/www/expired.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/expirycheck/www/expired.php @@ -6,16 +6,16 @@ * @package SimpleSAMLphp */ -SimpleSAML\Logger::info('expirycheck - User has been warned that NetID is near to expirational date.'); +\SimpleSAML\Logger::info('expirycheck - User has been warned that NetID is near to expirational date.'); if (!array_key_exists('StateId', $_REQUEST)) { - throw new SimpleSAML_Error_BadRequest('Missing required StateId query parameter.'); + throw new \SimpleSAML\Error\BadRequest('Missing required StateId query parameter.'); } -$state = SimpleSAML_Auth_State::loadState($_REQUEST['StateId'], 'expirywarning:expired'); +$state = \SimpleSAML\Auth\State::loadState($_REQUEST['StateId'], 'expirywarning:expired'); -$globalConfig = SimpleSAML_Configuration::getInstance(); +$globalConfig = \SimpleSAML\Configuration::getInstance(); -$t = new SimpleSAML_XHTML_Template($globalConfig, 'expirycheck:expired.php'); +$t = new \SimpleSAML\XHTML\Template($globalConfig, 'expirycheck:expired.php'); $t->data['expireOnDate'] = $state['expireOnDate']; $t->data['netId'] = $state['netId']; $t->show(); diff --git a/vendor/simplesamlphp/simplesamlphp/modules/ldap/docs/ldap.md b/vendor/simplesamlphp/simplesamlphp/modules/ldap/docs/ldap.md index fae1ca1c6a..0ca2869067 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/ldap/docs/ldap.md +++ b/vendor/simplesamlphp/simplesamlphp/modules/ldap/docs/ldap.md @@ -63,6 +63,12 @@ authentication source: */ 'search.base' => 'ou=people,dc=example,dc=org', + /* + * The scope of the search. Valid values are 'subtree' and 'onelevel' and 'base', + * first one being the default if no value is set. + */ + 'search.scope' => 'subtree', + /* * The attribute(s) the username should match against. * diff --git a/vendor/simplesamlphp/simplesamlphp/modules/ldap/lib/Auth/Process/AttributeAddFromLDAP.php b/vendor/simplesamlphp/simplesamlphp/modules/ldap/lib/Auth/Process/AttributeAddFromLDAP.php index 79543f30f0..a1062376d9 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/ldap/lib/Auth/Process/AttributeAddFromLDAP.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/ldap/lib/Auth/Process/AttributeAddFromLDAP.php @@ -1,5 +1,7 @@ <?php +namespace SimpleSAML\Module\ldap\Auth\Process; + /** * Filter to add attributes to the identity by executing a query against an LDAP directory * @@ -32,13 +34,13 @@ * @author Remy Blom <remy.blom@hku.nl> * @package SimpleSAMLphp */ -class sspmod_ldap_Auth_Process_AttributeAddFromLDAP extends sspmod_ldap_Auth_Process_BaseFilter -{ +class AttributeAddFromLDAP extends BaseFilter +{ /** - * LDAP attribute to add to the request attributes + * LDAP attributes to add to the request attributes * - * @var string + * @var array */ protected $search_attributes; @@ -118,7 +120,7 @@ public function __construct($config, $reserved) parent::__construct($config, $reserved); // Get filter specific config options - $this->search_attributes = $this->config->getArrayize('attributes', array()); + $this->search_attributes = $this->config->getArrayize('attributes', []); if (empty($this->search_attributes)) { $new_attribute = $this->config->getString('attribute.new', ''); $this->search_attributes[$new_attribute] = $this->config->getString('search.attribute'); @@ -137,19 +139,20 @@ public function __construct($config, $reserved) */ public function process(&$request) { - assert('is_array($request)'); - assert('array_key_exists("Attributes", $request)'); + assert(is_array($request)); + assert(array_key_exists('Attributes', $request)); - $attributes =& $request['Attributes']; + $attributes = &$request['Attributes']; // perform a merge on the ldap_search_filter - // loop over the attributes and build the search and replace arrays + $arrSearch = []; + $arrReplace = []; foreach ($attributes as $attr => $val) { $arrSearch[] = '%'.$attr.'%'; if (strlen($val[0]) > 0) { - $arrReplace[] = SimpleSAML_Auth_LDAP::escape_filter_value($val[0]); + $arrReplace[] = \SimpleSAML\Auth\LDAP::escape_filter_value($val[0]); } else { $arrReplace[] = ''; } @@ -159,23 +162,23 @@ public function process(&$request) $filter = str_replace($arrSearch, $arrReplace, $this->search_filter); if (strpos($filter, '%') !== false) { - SimpleSAML\Logger::info('AttributeAddFromLDAP: There are non-existing attributes in the search filter. ('. - $this->search_filter.')'); + \SimpleSAML\Logger::info('AttributeAddFromLDAP: There are non-existing attributes in the search filter. ('. + $this->search_filter.')'); return; } - if (!in_array($this->attr_policy, array('merge', 'replace', 'add'), true)) { - SimpleSAML\Logger::warning("AttributeAddFromLDAP: 'attribute.policy' must be one of 'merge',". - "'replace' or 'add'."); + if (!in_array($this->attr_policy, ['merge', 'replace', 'add'], true)) { + \SimpleSAML\Logger::warning("AttributeAddFromLDAP: 'attribute.policy' must be one of 'merge',". + "'replace' or 'add'."); return; } // getLdap try { $ldap = $this->getLdap(); - } catch (Exception $e) { + } catch (\Exception $e) { // Added this warning in case $this->getLdap() fails - SimpleSAML\Logger::warning("AttributeAddFromLDAP: exception = " . $e); + \SimpleSAML\Logger::warning("AttributeAddFromLDAP: exception = ".$e); return; } // search for matching entries @@ -187,7 +190,7 @@ public function process(&$request) true, false ); - } catch (Exception $e) { + } catch (\Exception $e) { return; // silent fail, error is still logged by LDAP search } diff --git a/vendor/simplesamlphp/simplesamlphp/modules/ldap/lib/Auth/Process/AttributeAddUsersGroups.php b/vendor/simplesamlphp/simplesamlphp/modules/ldap/lib/Auth/Process/AttributeAddUsersGroups.php index 40c82a4ea0..f1bfe5e0a4 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/ldap/lib/Auth/Process/AttributeAddUsersGroups.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/ldap/lib/Auth/Process/AttributeAddUsersGroups.php @@ -1,5 +1,7 @@ <?php +namespace SimpleSAML\Module\ldap\Auth\Process; + /** * Does a reverse membership lookup on the logged in user, * looking for groups it is a member of and adds them to @@ -8,7 +10,8 @@ * @author Ryan Panning <panman@traileyes.com> * @package SimpleSAMLphp */ -class sspmod_ldap_Auth_Process_AttributeAddUsersGroups extends sspmod_ldap_Auth_Process_BaseFilter + +class AttributeAddUsersGroups extends BaseFilter { /** * This is run when the filter is processed by SimpleSAML. @@ -16,48 +19,48 @@ class sspmod_ldap_Auth_Process_AttributeAddUsersGroups extends sspmod_ldap_Auth_ * the best method possible for the LDAP product. The groups * are then added to the request attributes. * - * @throws SimpleSAML_Error_Exception + * @throws \SimpleSAML\Error\Exception * @param $request */ public function process(&$request) { - assert('is_array($request)'); - assert('array_key_exists("Attributes", $request)'); + assert(is_array($request)); + assert(array_key_exists('Attributes', $request)); // Log the process - SimpleSAML\Logger::debug( - $this->title . 'Attempting to get the users groups...' + \SimpleSAML\Logger::debug( + $this->title.'Attempting to get the users groups...' ); // Reference the attributes, just to make the names shorter - $attributes =& $request['Attributes']; - $map =& $this->attribute_map; + $attributes = &$request['Attributes']; + $map = &$this->attribute_map; // Get the users groups from LDAP $groups = $this->getGroups($attributes); // Make the array if it is not set already if (!isset($attributes[$map['groups']])) { - $attributes[$map['groups']] = array(); + $attributes[$map['groups']] = []; } // Must be an array, else cannot merge groups if (!is_array($attributes[$map['groups']])) { - throw new SimpleSAML_Error_Exception( - $this->title . 'The group attribute [' . $map['groups'] . - '] is not an array of group DNs. ' . $this->var_export($attributes[$map['groups']]) + throw new \SimpleSAML\Error\Exception( + $this->title.'The group attribute ['.$map['groups']. + '] is not an array of group DNs. '.$this->var_export($attributes[$map['groups']]) ); } // Add the users group(s) - $group_attribute =& $attributes[$map['groups']]; + $group_attribute = &$attributes[$map['groups']]; $group_attribute = array_merge($group_attribute, $groups); $group_attribute = array_unique($group_attribute); // All done - SimpleSAML\Logger::debug( - $this->title . 'Added users groups to the group attribute [' . - $map['groups'] . ']: ' . implode('; ', $groups) + \SimpleSAML\Logger::debug( + $this->title.'Added users groups to the group attribute ['. + $map['groups'].']: '.implode('; ', $groups) ); } @@ -69,94 +72,48 @@ public function process(&$request) * using the required attribute values from the user to * get their group membership, recursively. * - * @throws SimpleSAML_Error_Exception + * @throws \SimpleSAML\Error\Exception * @param array $attributes * @return array */ - protected function getGroups(array $attributes) + protected function getGroups($attributes) { - // Reference the map, just to make the name shorter - $map =& $this->attribute_map; - // Log the request - SimpleSAML\Logger::debug( - $this->title . 'Checking for groups based on the best method for the LDAP product.' + \SimpleSAML\Logger::debug( + $this->title.'Checking for groups based on the best method for the LDAP product.' ); // Based on the directory service, search LDAP for groups // If any attributes are needed, prepare them before calling search method switch ($this->product) { - case 'ACTIVEDIRECTORY': - - // Log the AD specific search - SimpleSAML\Logger::debug( - $this->title . 'Searching LDAP using ActiveDirectory specific method.' - ); - - // Make sure the defined dn attribute exists - if (!isset($attributes[$map['dn']])) { - throw new SimpleSAML_Error_Exception( - $this->title . 'The DN attribute [' . $map['dn'] . - '] is not defined in the users Attributes: ' . implode(', ', array_keys($attributes)) - ); - } - - // DN attribute must have a value - if (!isset($attributes[$map['dn']][0]) || !$attributes[$map['dn']][0]) { - throw new SimpleSAML_Error_Exception( - $this->title . 'The DN attribute [' . $map['dn'] . - '] does not have a [0] value defined. ' . $this->var_export($attributes[$map['dn']]) - ); - } - - // Pass to the AD specific search - $groups = $this->searchActiveDirectory($attributes[$map['dn']][0]); + $groups = $this->getGroupsActiveDirectory($attributes); break; - case 'OPENLDAP': - // Log the OpenLDAP specific search - SimpleSAML\Logger::debug( - $this->title . 'Searching LDAP using OpenLDAP specific method.' - ); - // Print group search string and search for all group names - $openldap_base = $this->config->getString('ldap.basedn','ou=groups,dc=example,dc=com'); - SimpleSAML\Logger::debug( - $this->title . "Searching for groups in ldap.basedn ".$openldap_base." with filter (".$map['memberof']."=".$attributes[$map['username']][0].") and attributes ".$map['member'] - ); - $groups = array(); - try { - // Intention is to filter in 'ou=groups,dc=example,dc=com' for '(memberUid = <value of attribute.username>)' and take only the attributes 'cn' (=name of the group) - $all_groups = $this->getLdap()->searchformultiple( $openldap_base, array($map['memberof'] => $attributes[$map['username']][0]) , array($map['member'])); - } catch (SimpleSAML_Error_UserNotFound $e) { - break; // if no groups found return with empty (still just initialized) groups array - } - // run through all groups and add each to our groups array - foreach ($all_groups as $group_entry) { - $groups[] .= $group_entry[$map['member']][0]; - } + $groups = $this->getGroupsOpenLdap($attributes); break; - default: + // Reference the map, just to make the name shorter + $map = &$this->attribute_map; // Log the general search - SimpleSAML\Logger::debug( - $this->title . 'Searching LDAP using the default search method.' + \SimpleSAML\Logger::debug( + $this->title.'Searching LDAP using the default search method.' ); // Make sure the defined memberOf attribute exists if (!isset($attributes[$map['memberof']])) { - throw new SimpleSAML_Error_Exception( - $this->title . 'The memberof attribute [' . $map['memberof'] . - '] is not defined in the users Attributes: ' . implode(', ', array_keys($attributes)) + throw new \SimpleSAML\Error\Exception( + $this->title.'The memberof attribute ['.$map['memberof']. + '] is not defined in the user\'s Attributes: '.implode(', ', array_keys($attributes)) ); } // MemberOf must be an array of group DN's if (!is_array($attributes[$map['memberof']])) { - throw new SimpleSAML_Error_Exception( - $this->title . 'The memberof attribute [' . $map['memberof'] . - '] is not an array of group DNs. ' . $this->var_export($attributes[$map['memberof']]) + throw new \SimpleSAML\Error\Exception( + $this->title.'The memberof attribute ['.$map['memberof']. + '] is not an array of group DNs. '.$this->var_export($attributes[$map['memberof']]) ); } @@ -165,13 +122,101 @@ protected function getGroups(array $attributes) } // All done - SimpleSAML\Logger::debug( - $this->title . 'User found to be a member of the groups:' . implode('; ', $groups) + \SimpleSAML\Logger::debug( + $this->title.'User found to be a member of the groups:'.implode('; ', $groups) + ); + return $groups; + } + + + /** + * OpenLDAP optimized search + * using the required attribute values from the user to + * get their group membership, recursively. + * + * @throws \SimpleSAML\Error\Exception + * @param array $attributes + * @return array + */ + protected function getGroupsOpenLdap($attributes) + { + // Log the OpenLDAP specific search + \SimpleSAML\Logger::debug( + $this->title.'Searching LDAP using OpenLDAP specific method.' + ); + + // Reference the map, just to make the name shorter + $map = &$this->attribute_map; + + // Print group search string and search for all group names + $openldap_base = $this->config->getString('ldap.basedn', 'ou=groups,dc=example,dc=com'); + \SimpleSAML\Logger::debug( + $this->title."Searching for groups in ldap.basedn ".$openldap_base." with filter (".$map['memberof']. + "=".$attributes[$map['username']][0].") and attributes ".$map['member'] ); + + $groups = []; + try { + /* Intention is to filter in 'ou=groups,dc=example,dc=com' for + * '(memberUid = <value of attribute.username>)' and take only the attributes 'cn' (=name of the group) + */ + $all_groups = $this->getLdap()->searchformultiple( + $openldap_base, + [$map['memberof'] => $attributes[$map['username']][0]], + [$map['member']] + ); + } catch (\SimpleSAML\Error\UserNotFound $e) { + return $groups; // if no groups found return with empty (still just initialized) groups array + } + + // run through all groups and add each to our groups array + foreach ($all_groups as $group_entry) { + $groups[] = $group_entry[$map['member']][0]; + } + return $groups; } + /** + * Active Directory optimized search + * using the required attribute values from the user to + * get their group membership, recursively. + * + * @throws \SimpleSAML\Error\Exception + * @param array $attributes + * @return array + */ + protected function getGroupsActiveDirectory($attributes) + { + // Log the AD specific search + \SimpleSAML\Logger::debug( + $this->title.'Searching LDAP using ActiveDirectory specific method.' + ); + + // Reference the map, just to make the name shorter + $map = &$this->attribute_map; + + // Make sure the defined dn attribute exists + if (!isset($attributes[$map['dn']])) { + throw new \SimpleSAML\Error\Exception( + $this->title.'The DN attribute ['.$map['dn']. + '] is not defined in the user\'s Attributes: '.implode(', ', array_keys($attributes)) + ); + } + + // DN attribute must have a value + if (!isset($attributes[$map['dn']][0]) || !$attributes[$map['dn']][0]) { + throw new \SimpleSAML\Error\Exception( + $this->title.'The DN attribute ['.$map['dn']. + '] does not have a [0] value defined. '.$this->var_export($attributes[$map['dn']]) + ); + } + + // Pass to the AD specific search + return $this->searchActiveDirectory($attributes[$map['dn']][0]); + } + /** * Looks for groups from the list of DN's passed. Also * recursively searches groups for further membership. @@ -183,41 +228,48 @@ protected function getGroups(array $attributes) */ protected function search($memberof) { - assert('is_array($memberof)'); + assert(is_array($memberof)); // Used to determine what DN's have already been searched - static $searched = array(); + static $searched = []; // Init the groups variable - $groups = array(); + $groups = []; // Shorten the variable name - $map =& $this->attribute_map; + $map = &$this->attribute_map; // Log the search - SimpleSAML\Logger::debug( - $this->title . 'Checking DNs for groups.' . - ' DNs: '. implode('; ', $memberof) . - ' Attributes: ' . $map['memberof'] . ', ' . $map['type'] . - ' Group Type: ' . $this->type_map['group'] + \SimpleSAML\Logger::debug( + $this->title.'Checking DNs for groups.'. + ' DNs: '.implode('; ', $memberof). + ' Attributes: '.$map['memberof'].', '.$map['type']. + ' Group Type: '.$this->type_map['group'] ); + // Work out what attributes to get for a group + $use_group_name = false; + $get_attributes = [$map['memberof'], $map['type']]; + if (isset($map['name']) && $map['name']) { + $get_attributes[] = $map['name']; + $use_group_name = true; + } + // Check each DN of the passed memberOf foreach ($memberof as $dn) { - // Avoid infinite loops, only need to check a DN once if (isset($searched[$dn])) { continue; } // Track all DN's that are searched - // Use DN for key as well, isset() is faster than in_array() + // Use DN for key as well, isset() is faster than in_[] $searched[$dn] = $dn; // Query LDAP for the attribute values for the DN try { - $attributes = $this->getLdap()->getAttributes($dn, array($map['memberof'], $map['type'])); - } catch (SimpleSAML_Error_AuthSource $e) { + $attributes = $this->getLdap()->getAttributes($dn, $get_attributes); + } catch (\SimpleSAML\Error\AuthSource $e) { continue; // DN must not exist, just continue. Logged by the LDAP object } @@ -227,10 +279,16 @@ protected function search($memberof) } // Add to found groups array - $groups[] = $dn; + if ($use_group_name && isset($attributes[$map['name']]) && is_array($attributes[$map['name']])) { + $groups[] = $attributes[$map['name']][0]; + } else { + $groups[] = $dn; + } // Recursively search "sub" groups - $groups = array_merge($groups, $this->search($attributes[$map['memberof']])); + if (!empty($attributes[$map['memberof']])) { + $groups = array_merge($groups, $this->search($attributes[$map['memberof']])); + } } // Return only the unique group names @@ -248,20 +306,20 @@ protected function search($memberof) */ protected function searchActiveDirectory($dn) { - assert('is_string($dn) && $dn != ""'); + assert(is_string($dn) && $dn != ''); // Shorten the variable name - $map =& $this->attribute_map; + $map = &$this->attribute_map; // Log the search - SimpleSAML\Logger::debug( - $this->title . 'Searching ActiveDirectory group membership.' . - ' DN: ' . $dn . - ' DN Attribute: ' . $map['dn'] . - ' Member Attribute: ' . $map['member'] . - ' Type Attribute: ' . $map['type'] . - ' Type Value: ' . $this->type_map['group'] . - ' Base: ' . implode('; ', $this->base_dn) + \SimpleSAML\Logger::debug( + $this->title.'Searching ActiveDirectory group membership.'. + ' DN: '.$dn. + ' DN Attribute: '.$map['dn']. + ' Member Attribute: '.$map['member']. + ' Type Attribute: '.$map['type']. + ' Type Value: '.$this->type_map['group']. + ' Base: '.implode('; ', $this->base_dn) ); // AD connections should have this set @@ -271,22 +329,21 @@ protected function searchActiveDirectory($dn) try { $entries = $this->getLdap()->searchformultiple( $this->base_dn, - array($map['type'] => $this->type_map['group'], $map['member'] . ':1.2.840.113556.1.4.1941:' => $dn), - array($map['dn']) + [$map['type'] => $this->type_map['group'], $map['member'].':1.2.840.113556.1.4.1941:' => $dn], + [$map['dn']] ); // The search may throw an exception if no entries // are found, unlikely but possible. - } catch (SimpleSAML_Error_UserNotFound $e) { - return array(); + } catch (\SimpleSAML\Error\UserNotFound $e) { + return []; } //Init the groups - $groups = array(); + $groups = []; // Check each entry.. foreach ($entries as $entry) { - // Check for the DN using the original attribute name if (isset($entry[$map['dn']][0])) { $groups[] = $entry[$map['dn']][0]; @@ -306,10 +363,10 @@ protected function searchActiveDirectory($dn) } // Could not find DN, log and continue - SimpleSAML\Logger::notice( - $this->title . 'The DN attribute [' . - implode(', ', array($map['dn'], strtolower($map['dn']), 'dn')) . - '] could not be found in the entry. ' . $this->var_export($entry) + \SimpleSAML\Logger::notice( + $this->title.'The DN attribute ['. + implode(', ', [$map['dn'], strtolower($map['dn']), 'dn']). + '] could not be found in the entry. '.$this->var_export($entry) ); } diff --git a/vendor/simplesamlphp/simplesamlphp/modules/ldap/lib/Auth/Process/BaseFilter.php b/vendor/simplesamlphp/simplesamlphp/modules/ldap/lib/Auth/Process/BaseFilter.php index 19f3f661f3..f7de0656fc 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/ldap/lib/Auth/Process/BaseFilter.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/ldap/lib/Auth/Process/BaseFilter.php @@ -1,5 +1,7 @@ <?php +namespace SimpleSAML\Module\ldap\Auth\Process; + /** * This base LDAP filter class can be extended to enable real * filter classes direct access to the authsource ldap config @@ -12,9 +14,9 @@ * @author Remy Blom <remy.blom@hku.nl> * @package SimpleSAMLphp */ -abstract class sspmod_ldap_Auth_Process_BaseFilter extends SimpleSAML_Auth_ProcessingFilter -{ +abstract class BaseFilter extends \SimpleSAML\Auth\ProcessingFilter +{ /** * List of attribute "alias's" linked to the real attribute * name. Used for abstraction / configuration of the LDAP @@ -36,10 +38,10 @@ abstract class sspmod_ldap_Auth_Process_BaseFilter extends SimpleSAML_Auth_Proce /** * The construct method will change the filter config into - * a SimpleSAML_Configuration object and store it here for + * a \SimpleSAML\Configuration object and store it here for * later use, if needed. * - * @var SimpleSAML_Configuration + * @var \SimpleSAML\Configuration */ protected $config; @@ -48,7 +50,7 @@ abstract class sspmod_ldap_Auth_Process_BaseFilter extends SimpleSAML_Auth_Proce * Instance, object of the ldap connection. Stored here to * be access later during processing. * - * @var sspmod_ldap_LdapConnection + * @var \SimpleSAML\Auth\Ldap */ private $ldap; @@ -87,7 +89,7 @@ abstract class sspmod_ldap_Auth_Process_BaseFilter extends SimpleSAML_Auth_Proce * to the LDAP server. Then sets up the LDAP connection for the * instance/object and stores everything in class members. * - * @throws SimpleSAML_Error_Exception + * @throws \SimpleSAML\Error\Exception * @param array $config * @param $reserved */ @@ -99,29 +101,28 @@ public function __construct(&$config, $reserved) // This way if the class is extended the proper name is used $classname = get_class($this); $classname = explode('_', $classname); - $this->title = 'ldap:' . end($classname) . ' : '; + $this->title = 'ldap:'.end($classname).' : '; // Log the construction - SimpleSAML\Logger::debug( - $this->title . 'Creating and configuring the filter.' + \SimpleSAML\Logger::debug( + $this->title.'Creating and configuring the filter.' ); // If an authsource was defined (an not empty string)... if (isset($config['authsource']) && $config['authsource']) { - // Log the authsource request - SimpleSAML\Logger::debug( - $this->title . 'Attempting to get configuration values from authsource [' . - $config['authsource'] . ']' + \SimpleSAML\Logger::debug( + $this->title.'Attempting to get configuration values from authsource ['. + $config['authsource'].']' ); // Get the authsources file, which should contain the config - $authsource = SimpleSAML_Configuration::getConfig('authsources.php'); + $authsource = \SimpleSAML\Configuration::getConfig('authsources.php'); // Verify that the authsource config exists if (!$authsource->hasValue($config['authsource'])) { - throw new SimpleSAML_Error_Exception( - $this->title . 'Authsource [' . $config['authsource'] . + throw new \SimpleSAML\Error\Exception( + $this->title.'Authsource ['.$config['authsource']. '] defined in filter parameters not found in authsources.php' ); } @@ -133,14 +134,14 @@ public function __construct(&$config, $reserved) // Make sure it is an ldap source // TODO: Support ldap:LDAPMulti, if possible if (@$authsource[0] != 'ldap:LDAP') { - throw new SimpleSAML_Error_Exception( - $this->title . 'Authsource [' . $config['authsource'] . + throw new \SimpleSAML\Error\Exception( + $this->title.'Authsource ['.$config['authsource']. '] specified in filter parameters is not an ldap:LDAP type' ); } // Build the authsource config - $authconfig = array(); + $authconfig = []; if (isset($authsource['hostname'])) { $authconfig['ldap.hostname'] = $authsource['hostname']; } @@ -162,7 +163,10 @@ public function __construct(&$config, $reserved) // only set when search.enabled = true if (isset($authsource['search.enable']) && $authsource['search.enable']) { if (isset($authsource['search.base'])) { - $authconfig['ldap.basedn'] = $authsource['search.base']; + $authconfig['ldap.basedn'] = $authsource['search.base']; + } + if (isset($authsource['search.scope'])) { + $authconfig['ldap.scope'] = $authsource['search.scope']; } if (isset($authsource['search.username'])) { $authconfig['ldap.username'] = $authsource['search.username']; @@ -191,16 +195,16 @@ public function __construct(&$config, $reserved) $config = array_merge($authconfig, $config); // Authsource complete - SimpleSAML\Logger::debug( - $this->title . 'Retrieved authsource [' . $config['authsource'] . - '] configuration values: ' . $this->var_export($authconfig) + \SimpleSAML\Logger::debug( + $this->title.'Retrieved authsource ['.$config['authsource']. + '] configuration values: '.$this->var_export($authconfig) ); } // Convert the config array to a config class, // that way we can verify type and define defaults. // Store in the instance in-case needed later, by a child class. - $this->config = SimpleSAML_Configuration::loadFromArray($config, 'ldap:AuthProcess'); + $this->config = \SimpleSAML\Configuration::loadFromArray($config, 'ldap:AuthProcess'); // Set all the filter values, setting defaults if needed $this->base_dn = $this->config->getArrayizeString('ldap.basedn', ''); @@ -212,14 +216,14 @@ public function __construct(&$config, $reserved) $this->product = strtoupper($this->product); // Log the member values retrieved above - SimpleSAML\Logger::debug( - $this->title . 'Configuration values retrieved;' . - ' BaseDN: ' . $this->var_export($this->base_dn) . - ' Product: ' . $this->var_export($this->product) + \SimpleSAML\Logger::debug( + $this->title.'Configuration values retrieved;'. + ' BaseDN: '.$this->var_export($this->base_dn). + ' Product: '.$this->var_export($this->product) ); // Setup the attribute map which will be used to search LDAP - $this->attribute_map = array( + $this->attribute_map = [ 'dn' => $this->config->getString('attribute.dn', 'distinguishedName'), 'groups' => $this->config->getString('attribute.groups', 'groups'), 'member' => $this->config->getString('attribute.member', 'member'), @@ -227,22 +231,22 @@ public function __construct(&$config, $reserved) 'name' => $this->config->getString('attribute.groupname', 'name'), 'type' => $this->config->getString('attribute.type', 'objectClass'), 'username' => $this->config->getString('attribute.username', 'sAMAccountName') - ); + ]; // Log the attribute map - SimpleSAML\Logger::debug( - $this->title . 'Attribute map created: ' . $this->var_export($this->attribute_map) + \SimpleSAML\Logger::debug( + $this->title.'Attribute map created: '.$this->var_export($this->attribute_map) ); // Setup the object type map which is used to determine a DNs' type - $this->type_map = array( + $this->type_map = [ 'group' => $this->config->getString('type.group', 'group'), 'user' => $this->config->getString('type.user', 'user') - ); + ]; // Log the type map - SimpleSAML\Logger::debug( - $this->title . 'Type map created: ' . $this->var_export($this->type_map) + \SimpleSAML\Logger::debug( + $this->title.'Type map created: '.$this->var_export($this->type_map) ); } @@ -251,7 +255,7 @@ public function __construct(&$config, $reserved) * rather than setting in the constructor to avoid unnecessarily * connecting to LDAP when it might not be needed. * - * @return sspmod_ldap_LdapConnection + * @return \SimpleSAML\Auth\Ldap */ protected function getLdap() { @@ -265,26 +269,26 @@ protected function getLdap() $port = $this->config->getInteger('ldap.port', 389); $enable_tls = $this->config->getBoolean('ldap.enable_tls', false); $debug = $this->config->getBoolean('ldap.debug', false); - $referrals = $this->config->getBoolean('ldap.referrals', true); + $referrals = $this->config->getBoolean('ldap.referrals', true); $timeout = $this->config->getInteger('ldap.timeout', 0); $username = $this->config->getString('ldap.username', null); $password = $this->config->getString('ldap.password', null); // Log the LDAP connection - SimpleSAML\Logger::debug( - $this->title . 'Connecting to LDAP server;' . - ' Hostname: ' . $hostname . - ' Port: ' . $port . - ' Enable TLS: ' . ($enable_tls ? 'Yes' : 'No') . - ' Debug: ' . ($debug ? 'Yes' : 'No') . - ' Referrals: ' . ($referrals ? 'Yes' : 'No') . - ' Timeout: ' . $timeout . - ' Username: ' . $username . - ' Password: ' . (empty($password) ? '' : '********') + \SimpleSAML\Logger::debug( + $this->title.'Connecting to LDAP server;'. + ' Hostname: '.$hostname. + ' Port: '.$port. + ' Enable TLS: '.($enable_tls ? 'Yes' : 'No'). + ' Debug: '.($debug ? 'Yes' : 'No'). + ' Referrals: '.($referrals ? 'Yes' : 'No'). + ' Timeout: '.$timeout. + ' Username: '.$username. + ' Password: '.(empty($password) ? '' : '********') ); // Connect to the LDAP server to be queried during processing - $this->ldap = new SimpleSAML_Auth_LDAP($hostname, $enable_tls, $debug, $timeout, $port, $referrals); + $this->ldap = new \SimpleSAML\Auth\LDAP($hostname, $enable_tls, $debug, $timeout, $port, $referrals); $this->ldap->bind($username, $password); // All done diff --git a/vendor/simplesamlphp/simplesamlphp/modules/ldap/lib/Auth/Source/LDAP.php b/vendor/simplesamlphp/simplesamlphp/modules/ldap/lib/Auth/Source/LDAP.php index 7bf979a123..4757a3bb25 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/ldap/lib/Auth/Source/LDAP.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/ldap/lib/Auth/Source/LDAP.php @@ -1,5 +1,7 @@ <?php +namespace SimpleSAML\Module\ldap\Auth\Source; + /** * LDAP authentication source. * @@ -10,9 +12,9 @@ * * @package SimpleSAMLphp */ -class sspmod_ldap_Auth_Source_LDAP extends sspmod_core_Auth_UserPassBase -{ +class LDAP extends \SimpleSAML\Module\core\Auth\UserPassBase +{ /** * A LDAP configuration object. */ @@ -27,14 +29,16 @@ class sspmod_ldap_Auth_Source_LDAP extends sspmod_core_Auth_UserPassBase */ public function __construct($info, $config) { - assert('is_array($info)'); - assert('is_array($config)'); + assert(is_array($info)); + assert(is_array($config)); // Call the parent constructor first, as required by the interface parent::__construct($info, $config); - $this->ldapConfig = new sspmod_ldap_ConfigHelper($config, - 'Authentication source ' . var_export($this->authId, true)); + $this->ldapConfig = new \SimpleSAML\Module\ldap\ConfigHelper( + $config, + 'Authentication source '.var_export($this->authId, true) + ); } @@ -48,10 +52,9 @@ public function __construct($info, $config) */ protected function login($username, $password, array $sasl_args = null) { - assert('is_string($username)'); - assert('is_string($password)'); + assert(is_string($username)); + assert(is_string($password)); return $this->ldapConfig->login($username, $password, $sasl_args); } - } diff --git a/vendor/simplesamlphp/simplesamlphp/modules/ldap/lib/Auth/Source/LDAPMulti.php b/vendor/simplesamlphp/simplesamlphp/modules/ldap/lib/Auth/Source/LDAPMulti.php index e38118efac..c923e98462 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/ldap/lib/Auth/Source/LDAPMulti.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/ldap/lib/Auth/Source/LDAPMulti.php @@ -1,5 +1,7 @@ <?php +namespace SimpleSAML\Module\ldap\Auth\Source; + /** * LDAP authentication source. * @@ -10,9 +12,9 @@ * * @package SimpleSAMLphp */ -class sspmod_ldap_Auth_Source_LDAPMulti extends sspmod_core_Auth_UserPassOrgBase -{ +class LDAPMulti extends \SimpleSAML\Module\core\Auth\UserPassOrgBase +{ /** * An array with descriptions for organizations. */ @@ -37,31 +39,35 @@ class sspmod_ldap_Auth_Source_LDAPMulti extends sspmod_core_Auth_UserPassOrgBase */ public function __construct($info, $config) { - assert('is_array($info)'); - assert('is_array($config)'); + assert(is_array($info)); + assert(is_array($config)); // Call the parent constructor first, as required by the interface parent::__construct($info, $config); - $cfgHelper = SimpleSAML_Configuration::loadFromArray($config, - 'Authentication source ' . var_export($this->authId, true)); + $cfgHelper = \SimpleSAML\Configuration::loadFromArray( + $config, + 'Authentication source '.var_export($this->authId, true) + ); - $this->orgs = array(); - $this->ldapOrgs = array(); + $this->orgs = []; + $this->ldapOrgs = []; foreach ($config as $name => $value) { - if ($name === 'username_organization_method') { $usernameOrgMethod = $cfgHelper->getValueValidate( 'username_organization_method', - array('none', 'allow', 'force')); + ['none', 'allow', 'force'] + ); $this->setUsernameOrgMethod($usernameOrgMethod); continue; } if ($name === 'include_organization_in_username') { $this->includeOrgInUsername = $cfgHelper->getBoolean( - 'include_organization_in_username', false); + 'include_organization_in_username', + false + ); continue; } @@ -74,9 +80,10 @@ public function __construct($info, $config) $this->orgs[$orgId] = $orgId; } - $orgCfg = new sspmod_ldap_ConfigHelper($orgCfg, - 'Authentication source ' . var_export($this->authId, true) . - ', organization ' . var_export($orgId, true)); + $orgCfg = new \SimpleSAML\Module\ldap\ConfigHelper( + $orgCfg, + 'Authentication source '.var_export($this->authId, true).', organization '.var_export($orgId, true) + ); $this->ldapOrgs[$orgId] = $orgCfg; } } @@ -92,20 +99,20 @@ public function __construct($info, $config) */ protected function login($username, $password, $org, array $sasl_args = null) { - assert('is_string($username)'); - assert('is_string($password)'); - assert('is_string($org)'); + assert(is_string($username)); + assert(is_string($password)); + assert(is_string($org)); if (!array_key_exists($org, $this->ldapOrgs)) { // The user has selected an organization which doesn't exist anymore. - SimpleSAML\Logger::warning('Authentication source ' . var_export($this->authId, true) . - ': Organization seems to have disappeared while the user logged in.' . - ' Organization was ' . var_export($org, true)); - throw new SimpleSAML_Error_Error('WRONGUSERPASS'); + \SimpleSAML\Logger::warning('Authentication source '.var_export($this->authId, true). + ': Organization seems to have disappeared while the user logged in.'. + ' Organization was '.var_export($org, true)); + throw new \SimpleSAML\Error\Error('WRONGUSERPASS'); } if ($this->includeOrgInUsername) { - $username = $username . '@' . $org; + $username = $username.'@'.$org; } return $this->ldapOrgs[$org]->login($username, $password, $sasl_args); diff --git a/vendor/simplesamlphp/simplesamlphp/modules/ldap/lib/ConfigHelper.php b/vendor/simplesamlphp/simplesamlphp/modules/ldap/lib/ConfigHelper.php index 032d5ca5ce..d4dcff33ad 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/ldap/lib/ConfigHelper.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/ldap/lib/ConfigHelper.php @@ -1,5 +1,7 @@ <?php +namespace SimpleSAML\Module\ldap; + /** * LDAP authentication source configuration parser. * @@ -8,7 +10,8 @@ * * @package SimpleSAMLphp */ -class sspmod_ldap_ConfigHelper + +class ConfigHelper { /** * String with the location of this configuration. @@ -16,19 +19,16 @@ class sspmod_ldap_ConfigHelper */ private $location; - /** * The hostname of the LDAP server. */ private $hostname; - /** * Whether we should use TLS/SSL when contacting the LDAP server. */ private $enableTLS; - /** * Whether debug output is enabled. * @@ -36,7 +36,6 @@ class sspmod_ldap_ConfigHelper */ private $debug; - /** * The timeout for accessing the LDAP server. * @@ -56,30 +55,31 @@ class sspmod_ldap_ConfigHelper */ private $referrals; - /** * Whether we need to search for the users DN. */ private $searchEnable; - /** * The username we should bind with before we can search for the user. */ private $searchUsername; - /** * The password we should bind with before we can search for the user. */ private $searchPassword; - /** * Array with the base DN(s) for the search. */ private $searchBase; + /** + * The scope of the search. + */ + private $searchScope; + /** * Additional LDAP filter fields for the search */ @@ -90,31 +90,26 @@ class sspmod_ldap_ConfigHelper */ private $searchAttributes; - /** * The DN pattern we should use to create the DN from the username. */ private $dnPattern; - /** * The attributes we should fetch. Can be NULL in which case we will fetch all attributes. */ private $attributes; - /** * The user cannot get all attributes, privileged reader required */ private $privRead; - /** * The DN we should bind with before we can get the attributes. */ private $privUsername; - /** * The password we should bind with before we can get the attributes. */ @@ -129,13 +124,13 @@ class sspmod_ldap_ConfigHelper */ public function __construct($config, $location) { - assert('is_array($config)'); - assert('is_string($location)'); + assert(is_array($config)); + assert(is_string($location)); $this->location = $location; // Parse configuration - $config = SimpleSAML_Configuration::loadFromArray($config, $location); + $config = \SimpleSAML\Configuration::loadFromArray($config, $location); $this->hostname = $config->getString('hostname'); $this->enableTLS = $config->getBoolean('enable_tls', false); @@ -153,9 +148,9 @@ public function __construct($config, $location) } $this->searchBase = $config->getArrayizeString('search.base'); + $this->searchScope = $config->getString('search.scope', 'subtree'); $this->searchFilter = $config->getString('search.filter', null); $this->searchAttributes = $config->getArray('search.attributes'); - } else { $this->dnPattern = $config->getString('dnpattern'); } @@ -173,25 +168,32 @@ public function __construct($config, $location) /** * Attempt to log in using the given username and password. * - * Will throw a SimpleSAML_Error_Error('WRONGUSERPASS') if the username or password is wrong. + * Will throw a \SimpleSAML\Error\Error('WRONGUSERPASS') if the username or password is wrong. * If there is a configuration problem, an Exception will be thrown. * * @param string $username The username the user wrote. * @param string $password The password the user wrote. - * @param arrray $sasl_args Array of SASL options for LDAP bind. + * @param array $sasl_args Array of SASL options for LDAP bind. * @return array Associative array with the users attributes. */ public function login($username, $password, array $sasl_args = null) { - assert('is_string($username)'); - assert('is_string($password)'); + assert(is_string($username)); + assert(is_string($password)); if (empty($password)) { - SimpleSAML\Logger::info($this->location . ': Login with empty password disallowed.'); - throw new SimpleSAML_Error_Error('WRONGUSERPASS'); + \SimpleSAML\Logger::info($this->location.': Login with empty password disallowed.'); + throw new \SimpleSAML\Error\Error('WRONGUSERPASS'); } - $ldap = new SimpleSAML_Auth_LDAP($this->hostname, $this->enableTLS, $this->debug, $this->timeout, $this->port, $this->referrals); + $ldap = new \SimpleSAML\Auth\LDAP( + $this->hostname, + $this->enableTLS, + $this->debug, + $this->timeout, + $this->port, + $this->referrals + ); if (!$this->searchEnable) { $ldapusername = addcslashes($username, ',+"\\<>;*'); @@ -199,33 +201,40 @@ public function login($username, $password, array $sasl_args = null) } else { if ($this->searchUsername !== null) { if (!$ldap->bind($this->searchUsername, $this->searchPassword)) { - throw new Exception('Error authenticating using search username & password.'); + throw new \Exception('Error authenticating using search username & password.'); } } - $dn = $ldap->searchfordn($this->searchBase, $this->searchAttributes, $username, true, $this->searchFilter); + $dn = $ldap->searchfordn( + $this->searchBase, + $this->searchAttributes, + $username, + true, + $this->searchFilter, + $this->searchScope + ); if ($dn === null) { /* User not found with search. */ - SimpleSAML\Logger::info($this->location . ': Unable to find users DN. username=\'' . $username . '\''); - throw new SimpleSAML_Error_Error('WRONGUSERPASS'); + \SimpleSAML\Logger::info($this->location.': Unable to find users DN. username=\''.$username.'\''); + throw new \SimpleSAML\Error\Error('WRONGUSERPASS'); } } if (!$ldap->bind($dn, $password, $sasl_args)) { - SimpleSAML\Logger::info($this->location . ': '. $username . ' failed to authenticate. DN=' . $dn); - throw new SimpleSAML_Error_Error('WRONGUSERPASS'); + \SimpleSAML\Logger::info($this->location.': '.$username.' failed to authenticate. DN='.$dn); + throw new \SimpleSAML\Error\Error('WRONGUSERPASS'); } - /* In case of SASL bind, authenticated and authorized DN may differ */ + // In case of SASL bind, authenticated and authorized DN may differ if (isset($sasl_args)) { $dn = $ldap->whoami($this->searchBase, $this->searchAttributes); } - /* Are privs needed to get the attributes? */ + // Are privs needed to get the attributes? if ($this->privRead) { - /* Yes, rebind with privs */ + // Yes, rebind with privs if (!$ldap->bind($this->privUsername, $this->privPassword)) { - throw new Exception('Error authenticating using privileged DN & password.'); + throw new \Exception('Error authenticating using privileged DN & password.'); } } @@ -248,21 +257,23 @@ public function login($username, $password, array $sasl_args = null) * The DN of the matching element, if found. If no element was * found and $allowZeroHits is set to FALSE, an exception will * be thrown; otherwise NULL will be returned. - * @throws SimpleSAML_Error_AuthSource if: + * @throws \SimpleSAML\Error\AuthSource if: * - LDAP search encounter some problems when searching cataloge * - Not able to connect to LDAP server - * @throws SimpleSAML_Error_UserNotFound if: + * @throws \SimpleSAML\Error\UserNotFound if: * - $allowZeroHits is FALSE and no result is found * */ public function searchfordn($attribute, $value, $allowZeroHits) { - $ldap = new SimpleSAML_Auth_LDAP($this->hostname, + $ldap = new \SimpleSAML\Auth\LDAP( + $this->hostname, $this->enableTLS, $this->debug, $this->timeout, $this->port, - $this->referrals); + $this->referrals + ); if ($attribute == null) { $attribute = $this->searchAttributes; @@ -270,12 +281,18 @@ public function searchfordn($attribute, $value, $allowZeroHits) if ($this->searchUsername !== null) { if (!$ldap->bind($this->searchUsername, $this->searchPassword)) { - throw new Exception('Error authenticating using search username & password.'); + throw new \Exception('Error authenticating using search username & password.'); } } - return $ldap->searchfordn($this->searchBase, $attribute, - $value, $allowZeroHits, $this->searchFilter); + return $ldap->searchfordn( + $this->searchBase, + $attribute, + $value, + $allowZeroHits, + $this->searchFilter, + $this->searchScope + ); } public function getAttributes($dn, $attributes = null) @@ -284,21 +301,22 @@ public function getAttributes($dn, $attributes = null) $attributes = $this->attributes; } - $ldap = new SimpleSAML_Auth_LDAP($this->hostname, + $ldap = new \SimpleSAML\Auth\LDAP( + $this->hostname, $this->enableTLS, $this->debug, $this->timeout, $this->port, - $this->referrals); + $this->referrals + ); - /* Are privs needed to get the attributes? */ + // Are privs needed to get the attributes? if ($this->privRead) { - /* Yes, rebind with privs */ + // Yes, rebind with privs if (!$ldap->bind($this->privUsername, $this->privPassword)) { - throw new Exception('Error authenticating using privileged DN & password.'); + throw new \Exception('Error authenticating using privileged DN & password.'); } } return $ldap->getAttributes($dn, $attributes); } - } diff --git a/vendor/simplesamlphp/simplesamlphp/modules/memcacheMonitor/dictionaries/memcachestat.definition.json b/vendor/simplesamlphp/simplesamlphp/modules/memcacheMonitor/dictionaries/memcachestat.definition.json index be9187165d..77817ff066 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/memcacheMonitor/dictionaries/memcachestat.definition.json +++ b/vendor/simplesamlphp/simplesamlphp/modules/memcacheMonitor/dictionaries/memcachestat.definition.json @@ -41,9 +41,9 @@ "cmd_set": { "en": "Total SET commands" }, - "cmd_flush": { - "en": "Total FLUSH commands" - }, + "cmd_flush": { + "en": "Total FLUSH commands" + }, "get_hits": { "en": "Total GET commands (success)" }, @@ -60,54 +60,90 @@ "en": "Total storage avail" }, "pointer_size": { - "en": "Pointer size (bits)" + "en": "Pointer size (bits)" }, "delete_misses": { - "en": "Total DELETE commands (failed)" + "en": "Total DELETE commands (failed)" }, "delete_hits": { - "en": "Total DELETE commands (success)" + "en": "Total DELETE commands (success)" }, "incr_misses": { - "en": "Total INCR commands (failed)" + "en": "Total INCR commands (failed)" }, "incr_hits": { - "en": "Total INCR commands (success)" + "en": "Total INCR commands (success)" }, "decr_misses": { - "en": "Total DECR commands (failed)" + "en": "Total DECR commands (failed)" }, "decr_hits": { - "en": "Total DECR commands (success)" - }, + "en": "Total DECR commands (success)" + }, "cas_misses": { - "en": "Total CAS commands (failed)" + "en": "Total CAS commands (failed)" }, "cas_hits": { - "en": "Total CAS commands (success)" + "en": "Total CAS commands (success)" }, "cas_badval": { - "en": "Total bad CAS identifiers" + "en": "Total bad CAS identifiers" }, "auth_cmds": { - "en": "Total authentication commands processed" + "en": "Total authentication commands processed" }, "auth_errors": { - "en": "Total authentication commands failed" + "en": "Total authentication commands failed" }, "accepting_conns": { - "en": "Currently accepting new connections" + "en": "Currently accepting new connections" }, "listen_disabled_num": { - "en": "Total number of denied connections (connection limit)" + "en": "Total number of denied connections (connection limit)" }, "threads": { - "en": "Number of available threads" + "en": "Number of available threads" }, "conn_yields": { - "en": "Number of times the request limit was reached" + "en": "Number of times the request limit was reached" }, "evictions": { - "en": "Number of objects removed from cache (memory limit)" + "en": "Number of objects removed from cache (memory limit)" + }, + "libevent": { + "en": "Libevent version" + }, + "reserved_fds": { + "en": "Number of misc fds used internally" + }, + "cmd_touch": { + "en": "Cumulative number of touch reqs" + }, + "touch_hits": { + "en": "Number of keys that have been touched with a new expiration time" + }, + "touch_misses": { + "en": "Number of items that have been touched and not found" + }, + "hash_power_level": { + "en": "Current size multiplier for hash table" + }, + "hash_bytes": { + "en": "Bytes currently used by hash tables" + }, + "hash_is_expanding": { + "en": "Indicates if the hash table is being grown to a new size" + }, + "expired_unfetched": { + "en": "Items pulled from LRU that were never touched before expiring" + }, + "evicted_unfetched": { + "en": "Items pulled from LRU that were never touched" + }, + "reclaimed": { + "en": "Number of times an entry was stored using memory from an expired entry" + }, + "link_memcacheMonitor": { + "en": "Memcache statistics" } } diff --git a/vendor/simplesamlphp/simplesamlphp/modules/memcacheMonitor/dictionaries/memcachestat.translation.json b/vendor/simplesamlphp/simplesamlphp/modules/memcacheMonitor/dictionaries/memcachestat.translation.json index fbc7157e79..e2361455c8 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/memcacheMonitor/dictionaries/memcachestat.translation.json +++ b/vendor/simplesamlphp/simplesamlphp/modules/memcacheMonitor/dictionaries/memcachestat.translation.json @@ -549,5 +549,10 @@ "cs": "Celkov\u00e9 dostupn\u00e9 \u00falo\u017ei\u0161t\u011b", "eu": "Ustiatutako biltegiraketa guztira", "el": "\u0394\u03b9\u03b1\u03b8\u03ad\u03c3\u03b9\u03bc\u03bf\u03c2 \u03c7\u03ce\u03c1\u03bf\u03c2 \u03b1\u03c0\u03bf\u03b8\u03ae\u03ba\u03b5\u03c5\u03c3\u03b7\u03c2" + }, + "link_memcacheMonitor": { + "es": "Estadísticas de memcache", + "no": "Memcache statistikker", + "nn": "Memcache statistikkar" } } diff --git a/vendor/simplesamlphp/simplesamlphp/modules/memcacheMonitor/hooks/hook_configpage.php b/vendor/simplesamlphp/simplesamlphp/modules/memcacheMonitor/hooks/hook_configpage.php new file mode 100644 index 0000000000..4debe964ee --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/modules/memcacheMonitor/hooks/hook_configpage.php @@ -0,0 +1,15 @@ +<?php +/** + * Hook to add the memcacheMonitor module to the config page. + * + * @param \SimpleSAML\XHTML\Template &$template The template that we should alter in this hook. + */ + +function memcacheMonitor_hook_configpage(\SimpleSAML\XHTML\Template &$template) +{ + $template->data['links']['memcacheMonitor'] = [ + 'href' => SimpleSAML\Module::getModuleURL('memcacheMonitor/memcachestat.php'), + 'text' => \SimpleSAML\Locale\Translate::noop('Memcache statistics'), + ]; + $template->getLocalization()->addModuleDomain('memcacheMonitor'); +} diff --git a/vendor/simplesamlphp/simplesamlphp/modules/memcacheMonitor/hooks/hook_frontpage.php b/vendor/simplesamlphp/simplesamlphp/modules/memcacheMonitor/hooks/hook_frontpage.php index 1924bf9cd8..d25437327a 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/memcacheMonitor/hooks/hook_frontpage.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/memcacheMonitor/hooks/hook_frontpage.php @@ -4,13 +4,15 @@ * * @param array &$links The links on the frontpage, split into sections. */ -function memcacheMonitor_hook_frontpage(&$links) { - assert('is_array($links)'); - assert('array_key_exists("links", $links)'); - $links['config'][] = array( - 'href' => SimpleSAML\Module::getModuleURL('memcacheMonitor/memcachestat.php'), - 'text' => array('en' => 'MemCache Statistics'), - ); - +function memcacheMonitor_hook_frontpage(&$links) +{ + assert(is_array($links)); + assert(array_key_exists('links', $links)); + + $links['config'][] = [ + 'href' => SimpleSAML\Module::getModuleURL('memcacheMonitor/memcachestat.php'), + 'text' => '{memcacheMonitor:memcachestat:link_memcacheMonitor}', + ]; } + diff --git a/vendor/simplesamlphp/simplesamlphp/modules/memcacheMonitor/hooks/hook_sanitycheck.php b/vendor/simplesamlphp/simplesamlphp/modules/memcacheMonitor/hooks/hook_sanitycheck.php index b5b28d2509..a7a36c415d 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/memcacheMonitor/hooks/hook_sanitycheck.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/memcacheMonitor/hooks/hook_sanitycheck.php @@ -7,29 +7,31 @@ * * @param array &$hookinfo hookinfo */ -function memcacheMonitor_hook_sanitycheck(&$hookinfo) { - assert('is_array($hookinfo)'); - assert('array_key_exists("errors", $hookinfo)'); - assert('array_key_exists("info", $hookinfo)'); - try { - $servers = SimpleSAML_Memcache::getRawStats(); - } catch (Exception $e) { - $hookinfo['errors'][] = '[memcacheMonitor] Error parsing memcache configuration: ' . $e->getMessage(); - return; - } +function memcacheMonitor_hook_sanitycheck(&$hookinfo) +{ + assert(is_array($hookinfo)); + assert(array_key_exists('errors', $hookinfo)); + assert(array_key_exists('info', $hookinfo)); - $allOK = TRUE; - foreach ($servers as $group) { - foreach ($group as $server => $status) { - if ($status === FALSE) { - $hookinfo['errors'][] = '[memcacheMonitor] No response from server: ' . $server; - $allOK = FALSE; - } - } - } + try { + $servers = \SimpleSAML\Memcache::getRawStats(); + } catch (\Exception $e) { + $hookinfo['errors'][] = '[memcacheMonitor] Error parsing memcache configuration: '.$e->getMessage(); + return; + } - if ($allOK) { - $hookinfo['info'][] = '[memcacheMonitor] All servers responding.'; - } + $allOK = true; + foreach ($servers as $group) { + foreach ($group as $server => $status) { + if ($status === false) { + $hookinfo['errors'][] = '[memcacheMonitor] No response from server: '.$server; + $allOK = false; + } + } + } + + if ($allOK) { + $hookinfo['info'][] = '[memcacheMonitor] All servers responding.'; + } } diff --git a/vendor/simplesamlphp/simplesamlphp/modules/memcacheMonitor/locales/en/LC_MESSAGES/memcacheMonitor.po b/vendor/simplesamlphp/simplesamlphp/modules/memcacheMonitor/locales/en/LC_MESSAGES/memcacheMonitor.po index a71c198825..0c5bd95e44 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/memcacheMonitor/locales/en/LC_MESSAGES/memcacheMonitor.po +++ b/vendor/simplesamlphp/simplesamlphp/modules/memcacheMonitor/locales/en/LC_MESSAGES/memcacheMonitor.po @@ -15,6 +15,39 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Generated-By: Babel 2.3.4\n" +msgid "{memcacheMonitor:memcachestat:libevent}" +msgstr "Libevent version" + +msgid "{memcacheMonitor:memcachestat:reserved_fds}" +msgstr "Number of misc fds used internally" + +msgid "{memcacheMonitor:memcachestat:cmd_touch}" +msgstr "Cumulative number of touch reqs" + +msgid "{memcacheMonitor:memcachestat:touch_hits}" +msgstr "Number of keys that have been touched with a new expiration time" + +msgid "{memcacheMonitor:memcachestat:touch_misses}" +msgstr "Number of items that have been touched and not found" + +msgid "{memcacheMonitor:memcachestat:hash_power_level}" +msgstr "Current size multiplier for hash table" + +msgid "{memcacheMonitor:memcachestat:hash_bytes}" +msgstr "Bytes currently used by hash tables" + +msgid "{memcacheMonitor:memcachestat:hash_is_expanding}" +msgstr "Indicates if the hash table is being grown to a new size" + +msgid "{memcacheMonitor:memcachestat:expired_unfetched}" +msgstr "Items pulled from LRU that were never touched before expiring" + +msgid "{memcacheMonitor:memcachestat:evicted_unfetched}" +msgstr "Items pulled from LRU that were never touched" + +msgid "{memcacheMonitor:memcachestat:reclaimed}" +msgstr "Number of times an entry was stored using memory from an expired entry" + msgid "{memcacheMonitor:memcachestat:delete_misses}" msgstr "Total DELETE commands (failed)" @@ -231,3 +264,8 @@ msgstr "CPU Seconds (System)" msgid "Total connections" msgstr "Total connections" +msgid "{memcacheMonitor:memcachestat:link_memcacheMonitor}" +msgstr "Memcache statistics" + +msgid "Memcache statistics" +msgstr "Memcache statistics" diff --git a/vendor/simplesamlphp/simplesamlphp/modules/memcacheMonitor/locales/es/LC_MESSAGES/memcacheMonitor.po b/vendor/simplesamlphp/simplesamlphp/modules/memcacheMonitor/locales/es/LC_MESSAGES/memcacheMonitor.po index 0f9197c69c..0912705f30 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/memcacheMonitor/locales/es/LC_MESSAGES/memcacheMonitor.po +++ b/vendor/simplesamlphp/simplesamlphp/modules/memcacheMonitor/locales/es/LC_MESSAGES/memcacheMonitor.po @@ -129,3 +129,8 @@ msgstr "Segundos de CPU (Sistema)" msgid "Total connections" msgstr "Total de conexiones" +msgid "{memcacheMonitor:memcachestat:link_memcacheMonitor}" +msgstr "Estadísticas de memcache" + +msgid "Memcache statistics" +msgstr "Estadísticas de memcache" diff --git a/vendor/simplesamlphp/simplesamlphp/modules/memcacheMonitor/locales/nb/LC_MESSAGES/memcacheMonitor.po b/vendor/simplesamlphp/simplesamlphp/modules/memcacheMonitor/locales/nb/LC_MESSAGES/memcacheMonitor.po index 0fca4b31e0..659cdd1ce2 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/memcacheMonitor/locales/nb/LC_MESSAGES/memcacheMonitor.po +++ b/vendor/simplesamlphp/simplesamlphp/modules/memcacheMonitor/locales/nb/LC_MESSAGES/memcacheMonitor.po @@ -129,3 +129,8 @@ msgstr "CPU Sekunder (system)" msgid "Total connections" msgstr "Totalt antall forbindelser" +msgid "{memcacheMonitor:memcachestat:link_memcacheMonitor}" +msgstr "Memcache statistikker" + +msgid "Memcache statistics" +msgstr "Memcache statistikker" diff --git a/vendor/simplesamlphp/simplesamlphp/modules/memcacheMonitor/locales/nn/LC_MESSAGES/memcacheMonitor.po b/vendor/simplesamlphp/simplesamlphp/modules/memcacheMonitor/locales/nn/LC_MESSAGES/memcacheMonitor.po index d505279337..3b17ef3e62 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/memcacheMonitor/locales/nn/LC_MESSAGES/memcacheMonitor.po +++ b/vendor/simplesamlphp/simplesamlphp/modules/memcacheMonitor/locales/nn/LC_MESSAGES/memcacheMonitor.po @@ -129,3 +129,8 @@ msgstr "CPU-sekund (system)" msgid "Total connections" msgstr "Opne tilkoplingar (totalt)" +msgid "{memcacheMonitor:memcachestat:link_memcacheMonitor}" +msgstr "Memcache statistikkar" + +msgid "Memcache statistics" +msgstr "Memcache statistikkar" diff --git a/vendor/simplesamlphp/simplesamlphp/modules/memcacheMonitor/templates/memcachestat.tpl.php b/vendor/simplesamlphp/simplesamlphp/modules/memcacheMonitor/templates/memcachestat.tpl.php index 9a9a3399d3..9c40799322 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/memcacheMonitor/templates/memcachestat.tpl.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/memcacheMonitor/templates/memcachestat.tpl.php @@ -1,42 +1,19 @@ <?php -$this->data['head'] = '<style type="text/css"> - table.statustable td, table.statustable th { - border: 1px solid #eee; - padding: 2px 6px; - } - table.statustable { - border-collapse: collapse; - } - .bmax { - border: 1px solid #555; - background: #eee; - } - .bused { - border-right: 1px solid #555; - border-bottom: 1px solid #555; - color: white; - background: #833; - } -</style> -'; - - - +$this->data['head'] = '<link href="'.$this->data['baseurlpath'].'assets/css/memcacheMonitor.css" rel="stylesheet" />'; $this->includeAtTemplateBase('includes/header.php'); $title = $this->data['title']; $table = $this->data['table']; - // Identify column headings -$column_titles = array(); -foreach($table as $row_title => $row_data) { - foreach($row_data as $ct => $foo) { - if(!in_array($ct, $column_titles, true)) { - $column_titles[] = $ct; - } - } +$column_titles = []; +foreach ($table as $row_title => $row_data) { + foreach ($row_data as $ct => $foo) { + if (!in_array($ct, $column_titles, true)) { + $column_titles[] = $ct; + } + } } ?> @@ -48,28 +25,28 @@ <tr> <th></th> <?php -foreach($column_titles as $ct) { - echo '<th>' . htmlspecialchars($ct) . '</th>' . "\n"; +foreach ($column_titles as $ct) { + echo '<th>'.htmlspecialchars($ct).'</th>'."\n"; } ?> </tr> <?php -foreach($table as $row_title => $row_data) { - echo '<tr>' . "\n"; - echo '<th class="rowtitle" style="text-align: right">' . $this->t($this->data['rowtitles'][$row_title]) . '</th>' . "\n"; +foreach ($table as $row_title => $row_data) { + echo '<tr>' . "\n"; + echo '<th class="rowtitle" style="text-align: right">'.$this->t($this->data['rowTitles'][$row_title]).'</th>'."\n"; - foreach($column_titles as $ct) { - echo '<td>'; + foreach ($column_titles as $ct) { + echo '<td>'; - if(array_key_exists($ct, $row_data)) { - echo htmlspecialchars($row_data[$ct]); - } + if (array_key_exists($ct, $row_data)) { + echo htmlspecialchars($row_data[$ct]); + } - echo '</td>' . "\n"; - } + echo '</td>' . "\n"; + } - echo '</tr>' . "\n"; + echo '</tr>' . "\n"; } ?> @@ -77,15 +54,14 @@ <?php if (array_key_exists('bytes', $this->data['statsraw']) && array_key_exists('limit_maxbytes', $this->data['statsraw'])) { - foreach($this->data['statsraw']['bytes'] as $key => $row_data) { - echo ('<h3>Storage usage on [' . $key . ']</h3>'); - $maxpix = 400; - $pix = floor($this->data['statsraw']['bytes'][$key]*$maxpix / $this->data['statsraw']['limit_maxbytes'][$key]); - - echo('<div class="bmax" style="width: ' . $maxpix. 'px"><div class="bused" style="width: ' . $pix . 'px"> - Used: ' . $table['bytes'][$key] . ' - </div>Total available: ' . $table['limit_maxbytes'][$key] . '</div>'); - } + foreach ($this->data['statsraw']['bytes'] as $key => $row_data) { + echo ('<h3>Storage usage on ['.$key.']</h3>'); + $maxpix = 400; + $pix = floor($this->data['statsraw']['bytes'][$key]*$maxpix / $this->data['statsraw']['limit_maxbytes'][$key]); + + echo '<div class="bmax" style="width: '.$maxpix.'px"><div class="bused" style="width: '.$pix.'px">Used: '. + $table['bytes'][$key].'</div>Total available: '.$table['limit_maxbytes'][$key].'</div>'; + } } $this->includeAtTemplateBase('includes/footer.php'); diff --git a/vendor/simplesamlphp/simplesamlphp/modules/memcacheMonitor/templates/memcachestat.twig b/vendor/simplesamlphp/simplesamlphp/modules/memcacheMonitor/templates/memcachestat.twig new file mode 100644 index 0000000000..fdc4af4bd0 --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/modules/memcacheMonitor/templates/memcachestat.twig @@ -0,0 +1,38 @@ +{% set pagetitle = 'SimpleSAMLphp Memcache Monitor'|trans %} +{% extends "base.twig" %} + +{% block preload %} + <link href="{{ baseurlpath }}assets/css/memcacheMonitor.css" rel="stylesheet" /> +{% endblock %} + +{% block content %} + <h2>{{ title }}</h2> + <table class="statustable"> + <tr> + <th> </th> + {% for key, title in colTitles %} + <th>{{ title|escape('html') }}</th> + {% endfor %} + </tr> + {% for rowTitle, rowData in table %} + <tr> + <th class="rowtitle" style="text-align: right">{{ rowTitles[rowTitle]|trans }}</th> + {% for key, colTitle in colTitles %} + {% if rowData[colTitle] is defined %} + <td>{{ rowData[colTitle]|escape('html') }}</td> + {% else %} + <td> </td> + {% endif %} + {% endfor %} + </tr> + {% endfor %} + </table> + + {% if usage is defined %} + {% for key, value in usage %} + <h3>Storage usage on [{{ key }}]</h3> + <div class="bmax" style="width: {{ maxpix }}"> + <div class="bused" style="width: {{ usage[key] }}">Used: {{ table.bytes[key] }}</div>Total available: {{ table.limit_maxbytes[key] }}</div> + {% endfor %} + {% endif %} +{% endblock %} diff --git a/vendor/simplesamlphp/simplesamlphp/modules/memcacheMonitor/www/assets/css/memcacheMonitor.css b/vendor/simplesamlphp/simplesamlphp/modules/memcacheMonitor/www/assets/css/memcacheMonitor.css new file mode 100644 index 0000000000..b57c376543 --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/modules/memcacheMonitor/www/assets/css/memcacheMonitor.css @@ -0,0 +1,20 @@ +table.statustable td, table.statustable th { + border: 1px solid #eee; + padding: 2px 6px; +} + +table.statustable { + border-collapse: collapse; +} + +.bmax { + border: 1px solid #555; + background: #eee; +} + +.bused { + border-right: 1px solid #555; + border-bottom: 1px solid #555; + color: white; + background: #833; +} diff --git a/vendor/simplesamlphp/simplesamlphp/modules/memcacheMonitor/www/memcachestat.php b/vendor/simplesamlphp/simplesamlphp/modules/memcacheMonitor/www/memcachestat.php index a5d0511e1d..fde791e558 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/memcacheMonitor/www/memcachestat.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/memcacheMonitor/www/memcachestat.php @@ -1,159 +1,177 @@ <?php -function tdate($input) { - return date(DATE_RFC822, $input); +function tdate($input) +{ + return date(DATE_RFC822, $input); } -function hours($input) { - if ($input < 60) return number_format($input, 2) . ' sec'; - if ($input < 60*60) return number_format(($input/60),2) . ' min'; - if ($input < 24*60*60) return number_format(($input/(60*60)),2) . ' hours'; - return number_format($input/(24*60*60),2) . ' days'; - +function hours($input) +{ + if ($input < 60) { + return number_format($input, 2).' sec'; + } + if ($input < 60 * 60) { + return number_format(($input / 60), 2).' min'; + } + if ($input < 24 * 60 * 60) { + return number_format(($input / (60 * 60)), 2).' hours'; + } + return number_format($input / (24 * 60 * 60), 2).' days'; } - -function humanreadable($input) { - - $output = ""; - $input = abs($input); - - if ($input >= (1024*1024*1024*1024*1024*1024*1024*100)) { - $output = sprintf("%5ldEi", $input / (1024*1024*1024*1024*1024*1024) ); - } else if ($input >= (1024*1024*1024*1024*1024*1024*10)) { - $output = sprintf("%5.1fEi", $input / (1024.0*1024.0*1024.0*1024.0*1024.0*1024.0) ); - } else if ($input >= (1024*1024*1024*1024*1024*1024)) { - $output = sprintf("%5.2fEi", $input / (1024.0*1024.0*1024.0*1024.0*1024.0*1024.0) ); - - - } else if ($input >= (1024*1024*1024*1024*1024*100)) { - $output = sprintf("%5ldPi", $input / (1024*1024*1024*1024*1024) ); - } else if ($input >= (1024*1024*1024*1024*1024*10)) { - $output = sprintf("%5.1fPi", $input / (1024.0*1024.0*1024.0*1024.0*1024.0) ); - } else if ($input >= (1024*1024*1024*1024*1024)) { - $output = sprintf("%5.2fPi", $input / (1024.0*1024.0*1024.0*1024.0*1024.0) ); - - } else if ($input >= (1024*1024*1024*1024*100)) { - $output = sprintf("%5ldTi", $input / (1024*1024*1024*1024) ); - } else if ($input >= (1024*1024*1024*1024*10)) { - $output = sprintf("%5.1fTi", $input / (1024.0*1024.0*1024.0*1024.0) ); - } else if ($input >= (1024*1024*1024*1024)) { - $output = sprintf("%5.2fTi", $input / (1024.0*1024.0*1024.0*1024.0) ); - - - } else if ($input >= (1024*1024*1024*100)) { - $output = sprintf("%5ldGi", $input / (1024*1024*1024) ); - } else if ($input >= (1024*1024*1024*10)) { - $output = sprintf("%5.1fGi", $input / (1024.0*1024.0*1024.0) ); - } else if ($input >= (1024*1024*1024)) { - $output = sprintf("%5.2fGi", $input / (1024.0*1024.0*1024.0) ); - - } else if ($input >= (1024*1024*100)) { - $output = sprintf("%5ldMi", $input / (1024*1024) ); - } else if ($input >= (1024*1024*10)) { - $output = sprintf("%5.1fM", $input / (1024.0*1024.0) ); - } else if ($input >= (1024*1024)) { - $output = sprintf("%5.2fMi", $input / (1024.0*1024.0) ); - - } else if ($input >= (1024 * 100)) { - $output = sprintf("%5ldKi", $input / (1024) ); - } else if ($input >= (1024 * 10)) { - $output = sprintf("%5.1fKi", $input / 1024.0 ); - } else if ($input >= (1024)) { - $output = sprintf("%5.2fKi", $input / 1024.0 ); - - } else { - $output = sprintf("%5ld", $input ); - } - - return $output; +function humanreadable($input) +{ + $output = ""; + $input = abs($input); + + if ($input >= (1024 * 1024 * 1024 * 1024 * 1024 * 1024 * 1024 * 100)) { + $output = sprintf("%5ldEi", $input / (1024 * 1024 * 1024 * 1024 * 1024 * 1024)); + } elseif ($input >= (1024 * 1024 * 1024 * 1024 * 1024 * 1024 * 10)) { + $output = sprintf("%5.1fEi", $input / (1024.0 * 1024.0 * 1024.0 * 1024.0 * 1024.0 * 1024.0)); + } elseif ($input >= (1024 * 1024 * 1024 * 1024 * 1024 * 1024)) { + $output = sprintf("%5.2fEi", $input / (1024.0 * 1024.0 * 1024.0 * 1024.0 * 1024.0 * 1024.0)); + } elseif ($input >= (1024 * 1024 * 1024 * 1024 * 1024 * 100)) { + $output = sprintf("%5ldPi", $input / (1024 * 1024 * 1024 * 1024 * 1024)); + } elseif ($input >= (1024 * 1024 * 1024 * 1024 * 1024 * 10)) { + $output = sprintf("%5.1fPi", $input / (1024.0 * 1024.0 * 1024.0 * 1024.0 * 1024.0)); + } elseif ($input >= (1024 * 1024 * 1024 * 1024 * 1024)) { + $output = sprintf("%5.2fPi", $input / (1024.0 * 1024.0 * 1024.0 * 1024.0 * 1024.0)); + } elseif ($input >= (1024 * 1024 * 1024 * 1024 * 100)) { + $output = sprintf("%5ldTi", $input / (1024 * 1024 * 1024 * 1024)); + } elseif ($input >= (1024 * 1024 * 1024 * 1024 * 10)) { + $output = sprintf("%5.1fTi", $input / (1024.0 * 1024.0 * 1024.0 * 1024.0)); + } elseif ($input >= (1024 * 1024 * 1024 * 1024)) { + $output = sprintf("%5.2fTi", $input / (1024.0 * 1024.0 * 1024.0 * 1024.0)); + } elseif ($input >= (1024 * 1024 * 1024 * 100)) { + $output = sprintf("%5ldGi", $input / (1024 * 1024 * 1024)); + } elseif ($input >= (1024 * 1024 * 1024 * 10)) { + $output = sprintf("%5.1fGi", $input / (1024.0 * 1024.0 * 1024.0)); + } elseif ($input >= (1024 * 1024 * 1024)) { + $output = sprintf("%5.2fGi", $input / (1024.0 * 1024.0 * 1024.0)); + } elseif ($input >= (1024 * 1024 * 100)) { + $output = sprintf("%5ldMi", $input / (1024 * 1024)); + } elseif ($input >= (1024 * 1024 * 10)) { + $output = sprintf("%5.1fM", $input / (1024.0 * 1024.0)); + } elseif ($input >= (1024 * 1024)) { + $output = sprintf("%5.2fMi", $input / (1024.0 * 1024.0)); + } elseif ($input >= (1024 * 100)) { + $output = sprintf("%5ldKi", $input / 1024); + } elseif ($input >= (1024 * 10)) { + $output = sprintf("%5.1fKi", $input / 1024.0); + } elseif ($input >= (1024)) { + $output = sprintf("%5.2fKi", $input / 1024.0); + } else { + $output = sprintf("%5ld", $input); + } + + return $output; } - - - -$config = SimpleSAML_Configuration::getInstance(); +$config = \SimpleSAML\Configuration::getInstance(); // Make sure that the user has admin access rights -SimpleSAML\Utils\Auth::requireAdmin(); - +\SimpleSAML\Utils\Auth::requireAdmin(); -$formats = array( - 'bytes' => 'humanreadable', - 'bytes_read' => 'humanreadable', - 'bytes_written' => 'humanreadable', - 'limit_maxbytes' => 'humanreadable', - 'time' => 'tdate', - 'uptime' => 'hours', -); +$formats = [ + 'bytes' => 'humanreadable', + 'bytes_read' => 'humanreadable', + 'bytes_written' => 'humanreadable', + 'limit_maxbytes' => 'humanreadable', + 'time' => 'tdate', + 'uptime' => 'hours', +]; -$statsraw = SimpleSAML_Memcache::getStats(); +$statsraw = \SimpleSAML\Memcache::getStats(); $stats = $statsraw; -foreach($stats AS $key => &$entry) { - if (array_key_exists($key, $formats)) { - $func = $formats[$key]; - foreach($entry AS $k => $val) { - $entry[$k] = $func($val); - } - } +foreach ($stats as $key => &$entry) { + if (array_key_exists($key, $formats)) { + $func = $formats[$key]; + foreach ($entry as $k => $val) { + $entry[$k] = $func($val); + } + } +} +$t = new \SimpleSAML\XHTML\Template($config, 'memcacheMonitor:memcachestat.tpl.php'); +$rowTitles = [ + 'accepting_conns' => \SimpleSAML\Locale\Translate::noop('{memcacheMonitor:memcachestat:accepting_conns}'), + 'auth_cmds' => \SimpleSAML\Locale\Translate::noop('{memcacheMonitor:memcachestat:auth_cmds}'), + 'auth_errors' => \SimpleSAML\Locale\Translate::noop('{memcacheMonitor:memcachestat:auth_errors}'), + 'bytes' => \SimpleSAML\Locale\Translate::noop('{memcacheMonitor:memcachestat:bytes}'), + 'bytes_read' => \SimpleSAML\Locale\Translate::noop('{memcacheMonitor:memcachestat:bytes_read}'), + 'bytes_written' => \SimpleSAML\Locale\Translate::noop('{memcacheMonitor:memcachestat:bytes_written}'), + 'cas_badval' => \SimpleSAML\Locale\Translate::noop('{memcacheMonitor:memcachestat:cas_badval}'), + 'cas_hits' => \SimpleSAML\Locale\Translate::noop('{memcacheMonitor:memcachestat:cas_hits}'), + 'cas_misses' => \SimpleSAML\Locale\Translate::noop('{memcacheMonitor:memcachestat:cas_misses}'), + 'cmd_flush' => \SimpleSAML\Locale\Translate::noop('{memcacheMonitor:memcachestat:cmd_flush}'), + 'cmd_get' => \SimpleSAML\Locale\Translate::noop('{memcacheMonitor:memcachestat:cmd_get}'), + 'cmd_set' => \SimpleSAML\Locale\Translate::noop('{memcacheMonitor:memcachestat:cmd_set}'), + 'cmd_touch' => \SimpleSAML\Locale\Translate::noop('{memcacheMonitor:memcachestat:cmd_touch}'), + 'connection_structures' => \SimpleSAML\Locale\Translate::noop( + '{memcacheMonitor:memcachestat:connection_structures}' + ), + 'conn_yields' => \SimpleSAML\Locale\Translate::noop('{memcacheMonitor:memcachestat:conn_yields}'), + 'curr_connections' => \SimpleSAML\Locale\Translate::noop('{memcacheMonitor:memcachestat:curr_connections}'), + 'curr_items' => \SimpleSAML\Locale\Translate::noop('{memcacheMonitor:memcachestat:curr_items}'), + 'decr_hits' => \SimpleSAML\Locale\Translate::noop('{memcacheMonitor:memcachestat:decr_hits}'), + 'decr_misses' => \SimpleSAML\Locale\Translate::noop('{memcacheMonitor:memcachestat:decr_misses}'), + 'delete_hits' => \SimpleSAML\Locale\Translate::noop('{memcacheMonitor:memcachestat:delete_hits}'), + 'delete_misses' => \SimpleSAML\Locale\Translate::noop('{memcacheMonitor:memcachestat:delete_misses}'), + 'expired_unfetched' => \SimpleSAML\Locale\Translate::noop('{memcacheMonitor:memcachestat:expired_unfetched}'), + 'evicted_unfetched' => \SimpleSAML\Locale\Translate::noop('{memcacheMonitor:memcachestat:evicted_unfetched}'), + 'evictions' => \SimpleSAML\Locale\Translate::noop('{memcacheMonitor:memcachestat:evictions}'), + 'get_hits' => \SimpleSAML\Locale\Translate::noop('{memcacheMonitor:memcachestat:get_hits}'), + 'get_misses' => \SimpleSAML\Locale\Translate::noop('{memcacheMonitor:memcachestat:get_misses}'), + 'hash_bytes' => \SimpleSAML\Locale\Translate::noop('{memcacheMonitor:memcachestat:hash_bytes}'), + 'hash_is_expanding' => \SimpleSAML\Locale\Translate::noop('{memcacheMonitor:memcachestat:hash_is_expanding}'), + 'hash_power_level' => \SimpleSAML\Locale\Translate::noop('{memcacheMonitor:memcachestat:hash_power_level}'), + 'incr_hits' => \SimpleSAML\Locale\Translate::noop('{memcacheMonitor:memcachestat:incr_hits}'), + 'incr_misses' => \SimpleSAML\Locale\Translate::noop('{memcacheMonitor:memcachestat:incr_misses}'), + 'libevent' => \SimpleSAML\Locale\Translate::noop('{memcacheMonitor:memcachestat:libevent}'), + 'limit_maxbytes' => \SimpleSAML\Locale\Translate::noop('{memcacheMonitor:memcachestat:limit_maxbytes}'), + 'listen_disabled_num' => \SimpleSAML\Locale\Translate::noop('{memcacheMonitor:memcachestat:listen_disabled_num}'), + 'pid' => \SimpleSAML\Locale\Translate::noop('{memcacheMonitor:memcachestat:pid}'), + 'pointer_size' => \SimpleSAML\Locale\Translate::noop('{memcacheMonitor:memcachestat:pointer_size}'), + 'reclaimed' => \SimpleSAML\Locale\Translate::noop('{memcacheMonitor:memcachestat:reclaimed}'), + 'reserved_fds' => \SimpleSAML\Locale\Translate::noop('{memcacheMonitor:memcachestat:reserved_fds}'), + 'rusage_system' => \SimpleSAML\Locale\Translate::noop('{memcacheMonitor:memcachestat:rusage_system}'), + 'rusage_user' => \SimpleSAML\Locale\Translate::noop('{memcacheMonitor:memcachestat:rusage_user}'), + 'threads' => \SimpleSAML\Locale\Translate::noop('{memcacheMonitor:memcachestat:threads}'), + 'time' => \SimpleSAML\Locale\Translate::noop('{memcacheMonitor:memcachestat:time}'), + 'total_connections' => \SimpleSAML\Locale\Translate::noop('{memcacheMonitor:memcachestat:total_connections}'), + 'total_items' => \SimpleSAML\Locale\Translate::noop('{memcacheMonitor:memcachestat:total_items}'), + 'touch_hits' => \SimpleSAML\Locale\Translate::noop('{memcacheMonitor:memcachestat:touch_hits}'), + 'touch_misses' => \SimpleSAML\Locale\Translate::noop('{memcacheMonitor:memcachestat:touch_misses}'), + 'uptime' => \SimpleSAML\Locale\Translate::noop('{memcacheMonitor:memcachestat:uptime}'), + 'version' => \SimpleSAML\Locale\Translate::noop('{memcacheMonitor:memcachestat:version}'), +]; + +// Identify column headings +$colTitles = []; +foreach ($stats as $rowTitle => $rowData) { + foreach ($rowData as $colTitle => $foo) { + if (!in_array($colTitle, $colTitles, true)) { + $colTitles[] = $colTitle; + } + } +} + +if (array_key_exists('bytes', $statsraw) && array_key_exists('limit_maxbytes', $statsraw)) { + $usage = []; + $maxpix = 400; + foreach ($statsraw['bytes'] as $key => $row_data) { + $pix = floor($statsraw['bytes'][$key] * $maxpix / $statsraw['limit_maxbytes'][$key]); + $usage[$key] = $pix.'px'; + } + $t->data['maxpix'] = $maxpix.'px'; + $t->data['usage'] = $usage; } -$t = new SimpleSAML_XHTML_Template($config, 'memcacheMonitor:memcachestat.tpl.php'); -$rowTitles = array( - 'accepting_conns' => $t->noop('{memcacheMonitor:memcachestat:accepting_conns}'), - 'auth_cmds' => $t->noop('{memcacheMonitor:memcachestat:auth_cmds}'), - 'auth_errors' => $t->noop('{memcacheMonitor:memcachestat:auth_errors}'), - 'bytes' => $t->noop('{memcacheMonitor:memcachestat:bytes}'), - 'bytes_read' => $t->noop('{memcacheMonitor:memcachestat:bytes_read}'), - 'bytes_written' => $t->noop('{memcacheMonitor:memcachestat:bytes_written}'), - 'cas_badval' => $t->noop('{memcacheMonitor:memcachestat:cas_badval}'), - 'cas_hits' => $t->noop('{memcacheMonitor:memcachestat:cas_hits}'), - 'cas_misses' => $t->noop('{memcacheMonitor:memcachestat:cas_misses}'), - 'cmd_flush' => $t->noop('{memcacheMonitor:memcachestat:cmd_flush}'), - 'cmd_get' => $t->noop('{memcacheMonitor:memcachestat:cmd_get}'), - 'cmd_set' => $t->noop('{memcacheMonitor:memcachestat:cmd_set}'), - 'cmd_touch' => $t->noop('{memcacheMonitor:memcachestat:cmd_touch}'), - 'connection_structures' => $t->noop('{memcacheMonitor:memcachestat:connection_structures}'), - 'conn_yields' => $t->noop('{memcacheMonitor:memcachestat:conn_yields}'), - 'curr_connections' => $t->noop('{memcacheMonitor:memcachestat:curr_connections}'), - 'curr_items' => $t->noop('{memcacheMonitor:memcachestat:curr_items}'), - 'decr_hits' => $t->noop('{memcacheMonitor:memcachestat:decr_hits}'), - 'decr_misses' => $t->noop('{memcacheMonitor:memcachestat:decr_misses}'), - 'delete_hits' => $t->noop('{memcacheMonitor:memcachestat:delete_hits}'), - 'delete_misses' => $t->noop('{memcacheMonitor:memcachestat:delete_misses}'), - 'expired_unfetched' => $t->noop('{memcacheMonitor:memcachestat:expired_unfetched}'), - 'evicted_unfetched' => $t->noop('{memcacheMonitor:memcachestat:evicted_unfetched}'), - 'evictions' => $t->noop('{memcacheMonitor:memcachestat:evictions}'), - 'get_hits' => $t->noop('{memcacheMonitor:memcachestat:get_hits}'), - 'get_misses' => $t->noop('{memcacheMonitor:memcachestat:get_misses}'), - 'hash_bytes' => $t->noop('{memcacheMonitor:memcachestat:hash_bytes}'), - 'hash_is_expanding' => $t->noop('{memcacheMonitor:memcachestat:hash_is_expanding}'), - 'hash_power_level' => $t->noop('{memcacheMonitor:memcachestat:hash_power_level}'), - 'incr_hits' => $t->noop('{memcacheMonitor:memcachestat:incr_hits}'), - 'incr_misses' => $t->noop('{memcacheMonitor:memcachestat:incr_misses}'), - 'libevent' => $t->noop('{memcacheMonitor:memcachestat:libevent}'), - 'limit_maxbytes' => $t->noop('{memcacheMonitor:memcachestat:limit_maxbytes}'), - 'listen_disabled_num' => $t->noop('{memcacheMonitor:memcachestat:listen_disabled_num}'), - 'pid' => $t->noop('{memcacheMonitor:memcachestat:pid}'), - 'pointer_size' => $t->noop('{memcacheMonitor:memcachestat:pointer_size}'), - 'reclaimed' => $t->noop('{memcacheMonitor:memcachestat:reclaimed}'), - 'reserved_fds' => $t->noop('{memcacheMonitor:memcachestat:reserved_fds}'), - 'rusage_system' => $t->noop('{memcacheMonitor:memcachestat:rusage_system}'), - 'rusage_user' => $t->noop('{memcacheMonitor:memcachestat:rusage_user}'), - 'threads' => $t->noop('{memcacheMonitor:memcachestat:threads}'), - 'time' => $t->noop('{memcacheMonitor:memcachestat:time}'), - 'total_connections' => $t->noop('{memcacheMonitor:memcachestat:total_connections}'), - 'total_items' => $t->noop('{memcacheMonitor:memcachestat:total_items}'), - 'touch_hits' => $t->noop('{memcacheMonitor:memcachestat:touch_hits}'), - 'touch_misses' => $t->noop('{memcacheMonitor:memcachestat:touch_misses}'), - 'uptime' => $t->noop('{memcacheMonitor:memcachestat:uptime}'), - 'version' => $t->noop('{memcacheMonitor:memcachestat:version}'), -); $t->data['title'] = 'Memcache stats'; -$t->data['rowtitles'] = $rowTitles; -$t->data['table'] = $stats; +$t->data['rowTitles'] = $rowTitles; +$t->data['colTitles'] = $colTitles; $t->data['statsraw'] = $statsraw; +$t->data['table'] = $stats; $t->show(); diff --git a/vendor/simplesamlphp/simplesamlphp/modules/metarefresh/bin/metarefresh.php b/vendor/simplesamlphp/simplesamlphp/modules/metarefresh/bin/metarefresh.php index bad5c37a06..b02fb75a6a 100755 --- a/vendor/simplesamlphp/simplesamlphp/modules/metarefresh/bin/metarefresh.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/metarefresh/bin/metarefresh.php @@ -11,167 +11,168 @@ $baseDir = dirname(dirname(dirname(dirname(__FILE__)))); // Add library autoloader. -require_once($baseDir . '/lib/_autoload.php'); +require_once($baseDir.'/lib/_autoload.php'); -if(!SimpleSAML\Module::isModuleEnabled('metarefresh')) { - echo("You need to enable the metarefresh module before this script can be used.\n"); - echo("You can enable it by running the following command:\n"); - echo(' echo >"' . $baseDir . '/modules/metarefresh/enable' . "\"\n"); - exit(1); +if (!\SimpleSAML\Module::isModuleEnabled('metarefresh')) { + echo "You need to enable the metarefresh module before this script can be used.\n"; + echo "You can enable it by running the following command:\n"; + echo ' echo >"'.$baseDir.'/modules/metarefresh/enable'."\"\n"; + exit(1); } -/* Initialize the configuration. */ -$configdir = SimpleSAML\Utils\Config::getConfigDir(); -SimpleSAML_Configuration::setConfigDir($configdir); +// Initialize the configuration +$configdir = \SimpleSAML\Utils\Config::getConfigDir(); +\SimpleSAML\Configuration::setConfigDir($configdir); -/* $outputDir contains the directory we will store the generated metadata in. */ -$outputDir = $baseDir . '/metadata-generated'; +// $outputDir contains the directory we will store the generated metadata in +$outputDir = $baseDir.'/metadata-generated'; /* $toStdOut is a boolean telling us wheter we will print the output to stdout instead * of writing it to files in $outputDir. */ -$toStdOut = FALSE; +$toStdOut = false; /* $certificates contains the certificates which should be used to check the signature of the signed * EntityDescriptor in the metadata, or NULL if signature verification shouldn't be done. */ -$certificates = NULL; +$certificates = null; /* $validateFingerprint contains the fingerprint of the certificate which should have been used * to sign the EntityDescriptor in the metadata, or NULL if fingerprint validation shouldn't be * done. */ -$validateFingerprint = NULL; +$validateFingerprint = null; +// This variable contains the files we will parse +$files = []; -/* This variable contains the files we will parse. */ -$files = array(); - -/* Parse arguments. */ +// Parse arguments $progName = array_shift($argv); -foreach($argv as $a) { - if(strlen($a) === 0) { - continue; - } - - if($a[0] !== '-') { - /* Not an option. Assume that it is a file we should parse. */ - $files[] = $a; - continue; - } - - if(strpos($a, '=') !== FALSE) { - $p = strpos($a, '='); - $v = substr($a, $p + 1); - $a = substr($a, 0, $p); - } else { - $v = NULL; - } - - /* Map short options to long options. */ - $shortOptMap = array( - '-h' => '--help', - '-o' => '--out-dir', - '-s' => '--stdout', - ); - if(array_key_exists($a, $shortOptMap)) { - $a = $shortOptMap[$a]; - } - - switch($a) { - case '--certificate': - if($v === NULL || strlen($v) === 0) { - echo('The --certficate option requires an parameter.' . "\n"); - echo('Please run `' . $progName . ' --help` for usage information.' . "\n"); - exit(1); - } - $certificates[] = $v; - break; - case '--validate-fingerprint': - if($v === NULL || strlen($v) === 0) { - echo('The --validate-fingerprint option requires an parameter.' . "\n"); - echo('Please run `' . $progName . ' --help` for usage information.' . "\n"); - exit(1); - } - $validateFingerprint = $v; - break; - case '--help': - printHelp(); - exit(0); - case '--out-dir': - if($v === NULL || strlen($v) === 0) { - echo('The --out-dir option requires an parameter.' . "\n"); - echo('Please run `' . $progName . ' --help` for usage information.' . "\n"); - exit(1); - } - $outputDir = $baseDir . ($v[0] == '/' ? $v : '/' . $v); - break; - case '--stdout': - $toStdOut = TRUE; - break; - default: - echo('Unknown option: ' . $a . "\n"); - echo('Please run `' . $progName . ' --help` for usage information.' . "\n"); - exit(1); - } +foreach ($argv as $a) { + if (strlen($a) === 0) { + continue; + } + + if ($a[0] !== '-') { + // Not an option. Assume that it is a file we should parse + $files[] = $a; + continue; + } + + if (strpos($a, '=') !== false) { + $p = strpos($a, '='); + $v = substr($a, $p + 1); + $a = substr($a, 0, $p); + } else { + $v = null; + } + + // Map short options to long options + $shortOptMap = [ + '-h' => '--help', + '-o' => '--out-dir', + '-s' => '--stdout', + ]; + if (array_key_exists($a, $shortOptMap)) { + $a = $shortOptMap[$a]; + } + + switch ($a) { + case '--certificate': + if ($v === null || strlen($v) === 0) { + echo 'The --certficate option requires an parameter.'."\n"; + echo 'Please run `'.$progName.' --help` for usage information.'."\n"; + exit(1); + } + $certificates[] = $v; + break; + case '--validate-fingerprint': + if ($v === null || strlen($v) === 0) { + echo 'The --validate-fingerprint option requires an parameter.'."\n"; + echo 'Please run `'.$progName.' --help` for usage information.'."\n"; + exit(1); + } + $validateFingerprint = $v; + break; + case '--help': + printHelp(); + exit(0); + case '--out-dir': + if ($v === null || strlen($v) === 0) { + echo 'The --out-dir option requires an parameter.'."\n"; + echo 'Please run `'.$progName.' --help` for usage information.'."\n"; + exit(1); + } + $outputDir = $baseDir.($v[0] == '/' ? $v : '/'.$v); + break; + case '--stdout': + $toStdOut = true; + break; + default: + echo 'Unknown option: '.$a."\n"; + echo 'Please run `'.$progName.' --help` for usage information.'."\n"; + exit(1); + } } -if(count($files) === 0) { - echo($progName . ': Missing input files. Please run `' . $progName . ' --help` for usage information.' . "\n"); - exit(1); +if (count($files) === 0) { + echo $progName.': Missing input files. Please run `'.$progName.' --help` for usage information.'."\n"; + exit(1); } - - - -/* The metadata global variable will be filled with the metadata we extract. */ -$metaloader = new sspmod_metarefresh_MetaLoader(); - -foreach($files as $f) { - $source = array('src' => $f); - if (isset($certificates)) $source['certificates'] = $certificates; - if (isset($validateFingerprint)) $source['validateFingerprint'] = $validateFingerprint; - $metaloader->loadSource($source); +// The metadata global variable will be filled with the metadata we extract +$metaloader = new \SimpleSAML\Module\metarefresh\MetaLoader(); + +foreach ($files as $f) { + $source = ['src' => $f]; + if (isset($certificates)) { + $source['certificates'] = $certificates; + } + if (isset($validateFingerprint)) { + $source['validateFingerprint'] = $validateFingerprint; + } + $metaloader->loadSource($source); } -if($toStdOut) { - $metaloader->dumpMetadataStdOut(); +if ($toStdOut) { + $metaloader->dumpMetadataStdOut(); } else { - $metaloader->writeMetadataFiles($outputDir); + $metaloader->writeMetadataFiles($outputDir); } /** * This function prints the help output. */ -function printHelp() { - global $progName; - - /* '======================================================================' */ - echo('Usage: ' . $progName . ' [options] [files]' . "\n"); - echo("\n"); - echo('This program parses a SAML metadata files and output pieces that can' . "\n"); - echo('be added to the metadata files in metadata/.' . "\n"); - echo("\n"); - echo('Options:' . "\n"); - echo(' --certificate=<FILE> The certificate which should be used' . "\n"); - echo(' to check the signature of the metadata.' . "\n"); - echo(' The file are stored in the cert dir.' . "\n"); - echo(' It is possibility to add multiple' . "\n"); - echo(' --certificate options to handle' . "\n"); - echo(' key rollover.' . "\n"); - echo(' --validate-fingerprint=<FINGERPRINT>' . "\n"); - echo(' Check the signature of the metadata,' . "\n"); - echo(' and check the fingerprint of the' . "\n"); - echo(' certificate against <FINGERPRINT>.' . "\n"); - echo(' -h, --help Print this help.' . "\n"); - echo(' -o=<DIR>, --out-dir=<DIR> Write the output to this directory. The' . "\n"); - echo(' default directory is metadata-generated/.' . "\n"); - echo(' Path will be relative to the SimpleSAMLphp' . "\n"); - echo(' base directory.' . "\n"); - echo(' -s, --stdout Write the output to stdout instead of' . "\n"); - echo(' seperate files in the output directory.' . "\n"); - echo("\n"); +function printHelp() +{ + global $progName; + + /* '======================================================================' */ + echo 'Usage: '.$progName.' [options] [files]'."\n"; + echo "\n"; + echo 'This program parses a SAML metadata files and output pieces that can'."\n"; + echo 'be added to the metadata files in metadata/.'."\n"; + echo "\n"; + echo 'Options:'."\n"; + echo ' --certificate=<FILE> The certificate which should be used'."\n"; + echo ' to check the signature of the metadata.'."\n"; + echo ' The file are stored in the cert dir.'."\n"; + echo ' It is possibility to add multiple'."\n"; + echo ' --certificate options to handle'."\n"; + echo ' key rollover.'."\n"; + echo ' --validate-fingerprint=<FINGERPRINT>'."\n"; + echo ' Check the signature of the metadata,'."\n"; + echo ' and check the fingerprint of the'."\n"; + echo ' certificate against <FINGERPRINT>.'."\n"; + echo ' -h, --help Print this help.'."\n"; + echo ' -o=<DIR>, --out-dir=<DIR> Write the output to this directory. The'."\n"; + echo ' default directory is metadata-generated/.'."\n"; + echo ' Path will be relative to the SimpleSAMLphp'."\n"; + echo ' base directory.'."\n"; + echo ' -s, --stdout Write the output to stdout instead of'."\n"; + echo ' seperate files in the output directory.'."\n"; + echo "\n"; } diff --git a/vendor/simplesamlphp/simplesamlphp/modules/metarefresh/config-templates/config-metarefresh.php b/vendor/simplesamlphp/simplesamlphp/modules/metarefresh/config-templates/config-metarefresh.php index 0147b18507..c8009d4c27 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/metarefresh/config-templates/config-metarefresh.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/metarefresh/config-templates/config-metarefresh.php @@ -1,96 +1,92 @@ <?php -$config = array( +$config = [ + /* + * Global blacklist: entityIDs that should be excluded from ALL sets. + */ + #'blacklist' = array( + # 'http://my.own.uni/idp' + #), - /* - * Global blacklist: entityIDs that should be excluded from ALL sets. - */ - #'blacklist' = array( - # 'http://my.own.uni/idp' - #), - - /* - * Conditional GET requests - * Efficient downloading so polling can be done more frequently. - * Works for sources that send 'Last-Modified' or 'Etag' headers. - * Note that the 'data' directory needs to be writable for this to work. - */ - #'conditionalGET' => TRUE, + /* + * Conditional GET requests + * Efficient downloading so polling can be done more frequently. + * Works for sources that send 'Last-Modified' or 'Etag' headers. + * Note that the 'data' directory needs to be writable for this to work. + */ + #'conditionalGET' => true, - 'sets' => array( + 'sets' => [ - 'kalmar' => array( - 'cron' => array('hourly'), - 'sources' => array( - array( - /* - * entityIDs that should be excluded from this src. - */ - #'blacklist' => array( - # 'http://some.other.uni/idp', - #), + 'kalmar' => [ + 'cron' => ['hourly'], + 'sources' => [ + [ + /* + * entityIDs that should be excluded from this src. + */ + #'blacklist' => array( + # 'http://some.other.uni/idp', + #), - /* - * Whitelist: only keep these EntityIDs. - */ - #'whitelist' => array( - # 'http://some.uni/idp', - # 'http://some.other.uni/idp', - #), + /* + * Whitelist: only keep these EntityIDs. + */ + #'whitelist' => array( + # 'http://some.uni/idp', + # 'http://some.other.uni/idp', + #), - #'conditionalGET' => TRUE, - 'src' => 'https://kalmar2.org/simplesaml/module.php/aggregator/?id=kalmarcentral&set=saml2&exclude=norway', - 'certificates' => array( - 'current.crt', - 'rollover.crt', - ), - 'validateFingerprint' => '59:1D:4B:46:70:46:3E:ED:A9:1F:CC:81:6D:C0:AF:2A:09:2A:A8:01', - 'template' => array( - 'tags' => array('kalmar'), - 'authproc' => array( - 51 => array('class' => 'core:AttributeMap', 'oid2name'), - ), - ), + #'conditionalGET' => true, + 'src' => 'https://kalmar2.org/simplesaml/module.php/aggregator/?id=kalmarcentral&set=saml2&exclude=norway', + 'certificates' => [ + 'current.crt', + 'rollover.crt', + ], + 'validateFingerprint' => '59:1D:4B:46:70:46:3E:ED:A9:1F:CC:81:6D:C0:AF:2A:09:2A:A8:01', + 'template' => [ + 'tags' => ['kalmar'], + 'authproc' => [ + 51 => ['class' => 'core:AttributeMap', 'oid2name'], + ], + ], - /* - * The sets of entities to load, any combination of: - * - 'saml20-idp-remote' - * - 'saml20-sp-remote' - * - 'shib13-idp-remote' - * - 'shib13-sp-remote' - * - 'attributeauthority-remote' - * - * All of them will be used by default. - * - * This option takes precedence over the same option per metadata set. - */ - //'types' => array(), - ), - ), - 'expireAfter' => 60*60*24*4, // Maximum 4 days cache time - 'outputDir' => 'metadata/metadata-kalmar-consuming/', - - /* - * Which output format the metadata should be saved as. - * Can be 'flatfile' or 'serialize'. 'flatfile' is the default. - */ - 'outputFormat' => 'flatfile', - - - /* - * The sets of entities to load, any combination of: - * - 'saml20-idp-remote' - * - 'saml20-sp-remote' - * - 'shib13-idp-remote' - * - 'shib13-sp-remote' - * - 'attributeauthority-remote' - * - * All of them will be used by default. - */ - //'types' => array(), - ), - ), -); + /* + * The sets of entities to load, any combination of: + * - 'saml20-idp-remote' + * - 'saml20-sp-remote' + * - 'shib13-idp-remote' + * - 'shib13-sp-remote' + * - 'attributeauthority-remote' + * + * All of them will be used by default. + * + * This option takes precedence over the same option per metadata set. + */ + //'types' => [], + ], + ], + 'expireAfter' => 34560060, // Maximum 4 days cache time (3600*24*4) + 'outputDir' => 'metadata/metadata-kalmar-consuming/', + /* + * Which output format the metadata should be saved as. + * Can be 'flatfile' or 'serialize'. 'flatfile' is the default. + */ + 'outputFormat' => 'flatfile', + /* + * The sets of entities to load, any combination of: + * - 'saml20-idp-remote' + * - 'saml20-sp-remote' + * - 'shib13-idp-remote' + * - 'shib13-sp-remote' + * - 'attributeauthority-remote' + * + * All of them will be used by default. + */ + //'types' => [], + ], + ], +]; diff --git a/vendor/simplesamlphp/simplesamlphp/modules/metarefresh/dictionaries/metarefresh.definition.json b/vendor/simplesamlphp/simplesamlphp/modules/metarefresh/dictionaries/metarefresh.definition.json new file mode 100644 index 0000000000..8bfb51c4af --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/modules/metarefresh/dictionaries/metarefresh.definition.json @@ -0,0 +1,12 @@ +{ + "frontpage_link": { + "en": "Metarefresh: fetch metadata" + }, + "metarefresh_header": { + "en": "Metarefresh fetch" + }, + "no_output": { + "en": "No output from metarefresh." + } +} + diff --git a/vendor/simplesamlphp/simplesamlphp/modules/metarefresh/dictionaries/metarefresh.translation.json b/vendor/simplesamlphp/simplesamlphp/modules/metarefresh/dictionaries/metarefresh.translation.json new file mode 100644 index 0000000000..2023ecba4f --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/modules/metarefresh/dictionaries/metarefresh.translation.json @@ -0,0 +1,9 @@ +{ + "frontpage_link": { + }, + "metarefresh_header": { + }, + "no_output": { + } +} + diff --git a/vendor/simplesamlphp/simplesamlphp/modules/metarefresh/hooks/hook_cron.php b/vendor/simplesamlphp/simplesamlphp/modules/metarefresh/hooks/hook_cron.php index 72c88fc238..4ab82e2272 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/metarefresh/hooks/hook_cron.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/metarefresh/hooks/hook_cron.php @@ -1,114 +1,118 @@ <?php + +use \SimpleSAML\Logger; + /** * Hook to run a cron job. * * @param array &$croninfo Output */ -function metarefresh_hook_cron(&$croninfo) { - assert('is_array($croninfo)'); - assert('array_key_exists("summary", $croninfo)'); - assert('array_key_exists("tag", $croninfo)'); - - SimpleSAML\Logger::info('cron [metarefresh]: Running cron in cron tag [' . $croninfo['tag'] . '] '); - - try { - $config = SimpleSAML_Configuration::getInstance(); - $mconfig = SimpleSAML_Configuration::getOptionalConfig('config-metarefresh.php'); - - $sets = $mconfig->getConfigList('sets', array()); - $stateFile = $config->getPathValue('datadir', 'data/') . 'metarefresh-state.php'; - - foreach ($sets AS $setkey => $set) { - // Only process sets where cron matches the current cron tag - $cronTags = $set->getArray('cron'); - if (!in_array($croninfo['tag'], $cronTags, true)) continue; - - SimpleSAML\Logger::info('cron [metarefresh]: Executing set [' . $setkey . ']'); - - $expireAfter = $set->getInteger('expireAfter', NULL); - if ($expireAfter !== NULL) { - $expire = time() + $expireAfter; - } else { - $expire = NULL; - } - - $outputDir = $set->getString('outputDir'); - $outputDir = $config->resolvePath($outputDir); - $outputFormat = $set->getValueValidate('outputFormat', array('flatfile', 'serialize'), 'flatfile'); - - $oldMetadataSrc = SimpleSAML_Metadata_MetaDataStorageSource::getSource(array( - 'type' => $outputFormat, - 'directory' => $outputDir, - )); - - $metaloader = new sspmod_metarefresh_MetaLoader($expire, $stateFile, $oldMetadataSrc); - - # Get global blacklist, whitelist and caching info - $blacklist = $mconfig->getArray('blacklist', array()); - $whitelist = $mconfig->getArray('whitelist', array()); - $conditionalGET = $mconfig->getBoolean('conditionalGET', FALSE); - - // get global type filters - $available_types = array( - 'saml20-idp-remote', - 'saml20-sp-remote', - 'shib13-idp-remote', - 'shib13-sp-remote', - 'attributeauthority-remote' - ); - $set_types = $set->getArrayize('types', $available_types); - - foreach($set->getArray('sources') AS $source) { - - // filter metadata by type of entity - if (isset($source['types'])) { - $metaloader->setTypes($source['types']); - } else { - $metaloader->setTypes($set_types); - } - - # Merge global and src specific blacklists - if(isset($source['blacklist'])) { - $source['blacklist'] = array_unique(array_merge($source['blacklist'], $blacklist)); - } else { - $source['blacklist'] = $blacklist; - } - - # Merge global and src specific whitelists - if(isset($source['whitelist'])) { - $source['whitelist'] = array_unique(array_merge($source['whitelist'], $whitelist)); - } else { - $source['whitelist'] = $whitelist; - } - - # Let src specific conditionalGET override global one - if(!isset($source['conditionalGET'])) { - $source['conditionalGET'] = $conditionalGET; - } - - SimpleSAML\Logger::debug('cron [metarefresh]: In set [' . $setkey . '] loading source [' . $source['src'] . ']'); - $metaloader->loadSource($source); - } - - // Write state information back to disk - $metaloader->writeState(); - - switch ($outputFormat) { - case 'flatfile': - $metaloader->writeMetadataFiles($outputDir); - break; - case 'serialize': - $metaloader->writeMetadataSerialize($outputDir); - break; - } - - if ($set->hasValue('arp')) { - $arpconfig = SimpleSAML_Configuration::loadFromArray($set->getValue('arp')); - $metaloader->writeARPfile($arpconfig); - } - } - - } catch (Exception $e) { - $croninfo['summary'][] = 'Error during metarefresh: ' . $e->getMessage(); - } +function metarefresh_hook_cron(&$croninfo) +{ + assert(is_array($croninfo)); + assert(array_key_exists('summary', $croninfo)); + assert(array_key_exists('tag', $croninfo)); + + Logger::info('cron [metarefresh]: Running cron in cron tag ['.$croninfo['tag'].'] '); + + try { + $config = \SimpleSAML\Configuration::getInstance(); + $mconfig = \SimpleSAML\Configuration::getOptionalConfig('config-metarefresh.php'); + + $sets = $mconfig->getConfigList('sets', []); + $stateFile = $config->getPathValue('datadir', 'data/').'metarefresh-state.php'; + + foreach ($sets as $setkey => $set) { + // Only process sets where cron matches the current cron tag + $cronTags = $set->getArray('cron'); + if (!in_array($croninfo['tag'], $cronTags, true)) { + continue; + } + + Logger::info('cron [metarefresh]: Executing set ['.$setkey.']'); + + $expireAfter = $set->getInteger('expireAfter', null); + if ($expireAfter !== null) { + $expire = time() + $expireAfter; + } else { + $expire = null; + } + + $outputDir = $set->getString('outputDir'); + $outputDir = $config->resolvePath($outputDir); + $outputFormat = $set->getValueValidate('outputFormat', ['flatfile', 'serialize'], 'flatfile'); + + $oldMetadataSrc = \SimpleSAML\Metadata\MetaDataStorageSource::getSource([ + 'type' => $outputFormat, + 'directory' => $outputDir, + ]); + + $metaloader = new \SimpleSAML\Module\metarefresh\MetaLoader($expire, $stateFile, $oldMetadataSrc); + + // Get global blacklist, whitelist and caching info + $blacklist = $mconfig->getArray('blacklist', []); + $whitelist = $mconfig->getArray('whitelist', []); + $conditionalGET = $mconfig->getBoolean('conditionalGET', false); + + // get global type filters + $available_types = [ + 'saml20-idp-remote', + 'saml20-sp-remote', + 'shib13-idp-remote', + 'shib13-sp-remote', + 'attributeauthority-remote' + ]; + $set_types = $set->getArrayize('types', $available_types); + + foreach ($set->getArray('sources') as $source) { + // filter metadata by type of entity + if (isset($source['types'])) { + $metaloader->setTypes($source['types']); + } else { + $metaloader->setTypes($set_types); + } + + // Merge global and src specific blacklists + if (isset($source['blacklist'])) { + $source['blacklist'] = array_unique(array_merge($source['blacklist'], $blacklist)); + } else { + $source['blacklist'] = $blacklist; + } + + // Merge global and src specific whitelists + if (isset($source['whitelist'])) { + $source['whitelist'] = array_unique(array_merge($source['whitelist'], $whitelist)); + } else { + $source['whitelist'] = $whitelist; + } + + // Let src specific conditionalGET override global one + if (!isset($source['conditionalGET'])) { + $source['conditionalGET'] = $conditionalGET; + } + + Logger::debug('cron [metarefresh]: In set ['.$setkey.'] loading source ['.$source['src'].']'); + $metaloader->loadSource($source); + } + + // Write state information back to disk + $metaloader->writeState(); + + switch ($outputFormat) { + case 'flatfile': + $metaloader->writeMetadataFiles($outputDir); + break; + case 'serialize': + $metaloader->writeMetadataSerialize($outputDir); + break; + } + + if ($set->hasValue('arp')) { + $arpconfig = \SimpleSAML\Configuration::loadFromArray($set->getValue('arp')); + $metaloader->writeARPfile($arpconfig); + } + } + } catch (\Exception $e) { + $croninfo['summary'][] = 'Error during metarefresh: '.$e->getMessage(); + } } diff --git a/vendor/simplesamlphp/simplesamlphp/modules/metarefresh/hooks/hook_frontpage.php b/vendor/simplesamlphp/simplesamlphp/modules/metarefresh/hooks/hook_frontpage.php index 662ee32910..e66c583f29 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/metarefresh/hooks/hook_frontpage.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/metarefresh/hooks/hook_frontpage.php @@ -4,13 +4,14 @@ * * @param array &$links The links on the frontpage, split into sections. */ -function metarefresh_hook_frontpage(&$links) { - assert('is_array($links)'); - assert('array_key_exists("links", $links)'); - $links['federation'][] = array( - 'href' => SimpleSAML\Module::getModuleURL('metarefresh/fetch.php'), - 'text' => array('en' => 'Metarefresh: fetch metadata'), - ); +function metarefresh_hook_frontpage(&$links) +{ + assert(is_array($links)); + assert(array_key_exists('links', $links)); + $links['federation'][] = [ + 'href' => SimpleSAML\Module::getModuleURL('metarefresh/fetch.php'), + 'text' => '{metarefresh:metarefresh:frontpage_link}', + ]; } diff --git a/vendor/simplesamlphp/simplesamlphp/modules/metarefresh/lib/ARP.php b/vendor/simplesamlphp/simplesamlphp/modules/metarefresh/lib/ARP.php index 20f5c764d7..c64ff3463f 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/metarefresh/lib/ARP.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/metarefresh/lib/ARP.php @@ -1,99 +1,152 @@ <?php + +namespace SimpleSAML\Module\metarefresh; + /* * @author Andreas Åkre Solberg <andreas.solberg@uninett.no> * @package SimpleSAMLphp */ -class sspmod_metarefresh_ARP { - - - private $metadata; - private $attributes; - private $prefix; - private $suffix; - - /** - * Constructor - * - * @param - */ - public function __construct($metadata, $attributemap, $prefix, $suffix) { - $this->metadata = $metadata; - - $this->prefix = $prefix; - $this->suffix = $suffix; - - if (isset($attributemap)) $this->loadAttributeMap($attributemap); - } - - private function loadAttributeMap($attributemap) { - $config = SimpleSAML_Configuration::getInstance(); - include($config->getPathValue('attributemap', 'attributemap/') . $attributemap . '.php'); - $this->attributes = $attributemap; - } - - private function surround($name) { - $ret = ''; - if (!empty($this->prefix)) $ret .= $this->prefix; - $ret .= $name; - if (!empty($this->suffix)) $ret .= $this->suffix; - return $ret; - } - - private function getAttributeID($name) { - if (empty($this->attributes)) { - return $this->surround($name); - } - if (array_key_exists($name, $this->attributes)) { - return $this->surround($this->attributes[$name]); - } - return $this->surround($name); - } - - public function getXML() { - - $xml = '<?xml version="1.0" encoding="UTF-8"?> -<AttributeFilterPolicyGroup id="urn:mace:funet.fi:haka:kalmar" xmlns="urn:mace:shibboleth:2.0:afp" + +class ARP +{ + /** + * @var array + */ + private $metadata; + + /** + * @var array + */ + private $attributes; + + /** + * @var string + */ + private $prefix; + + /** + * @var + */ + private $suffix; + + /** + * Constructor + * + * @param array $metadata + * @param string $attributemap_filename + * @param string $prefix + * @param string $suffix + */ + public function __construct($metadata, $attributemap_filename, $prefix, $suffix) + { + $this->metadata = $metadata; + $this->prefix = $prefix; + $this->suffix = $suffix; + + if (isset($attributemap_filename)) { + $this->loadAttributeMap($attributemap_filename); + } + } + + /** + * @param string $attributemap_filename + * + * @return void + */ + private function loadAttributeMap($attributemap_filename) + { + $config = \SimpleSAML\Configuration::getInstance(); + include($config->getPathValue('attributemap', 'attributemap/').$attributemap_filename.'.php'); + // Note that $attributemap is defined in the included attributemap-file! + $this->attributes = $attributemap; + } + + /** + * @param string $name + * + * @return string + */ + private function surround($name) + { + $ret = ''; + if (!empty($this->prefix)) { + $ret .= $this->prefix; + } + $ret .= $name; + if (!empty($this->suffix)) { + $ret .= $this->suffix; + } + return $ret; + } + + /** + * @param string $name + * + * @return string + */ + private function getAttributeID($name) + { + if (empty($this->attributes)) { + return $this->surround($name); + } + if (array_key_exists($name, $this->attributes)) { + return $this->surround($this->attributes[$name]); + } + return $this->surround($name); + } + + /** + * @return string + */ + public function getXML() + { + $xml = <<<MSG + <?xml version="1.0" encoding="UTF-8"?> + <AttributeFilterPolicyGroup id="urn:mace:funet.fi:haka:kalmar" xmlns="urn:mace:shibboleth:2.0:afp" xmlns:basic="urn:mace:shibboleth:2.0:afp:mf:basic" xmlns:saml="urn:mace:shibboleth:2.0:afp:mf:saml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:mace:shibboleth:2.0:afp classpath:/schema/shibboleth-2.0-afp.xsd urn:mace:shibboleth:2.0:afp:mf:basic classpath:/schema/shibboleth-2.0-afp-mf-basic.xsd urn:mace:shibboleth:2.0:afp:mf:saml classpath:/schema/shibboleth-2.0-afp-mf-saml.xsd"> -'; - - - foreach($this->metadata AS $metadata) { - $xml .= $this->getEntryXML($metadata['metadata']); - } - - $xml .= '</AttributeFilterPolicyGroup>'; - return $xml; - } - - private function getEntryXML($entry) { - $entityid = $entry['entityid']; - return ' <AttributeFilterPolicy id="' . $entityid . '"> - <PolicyRequirementRule xsi:type="basic:AttributeRequesterString" value="' . $entityid . '" /> -' . $this->getEntryXMLcontent($entry) . ' - </AttributeFilterPolicy> -'; - } - - private function getEntryXMLcontent($entry) { - $ids = array(); - if (!array_key_exists('attributes', $entry)) - return ''; - - $ret = ''; - foreach($entry['attributes'] AS $a) { - - $ret .= ' <AttributeRule attributeID="' . $this->getAttributeID($a) . '"> - <PermitValueRule xsi:type="basic:ANY" /> - </AttributeRule> -'; - - } - return $ret; - } +MSG; -} + foreach ($this->metadata as $metadata) { + $xml .= $this->getEntryXML($metadata['metadata']); + } + $xml .= '</AttributeFilterPolicyGroup>'; + return $xml; + } + + /** + * @param array $entry + * + * @return string + */ + private function getEntryXML($entry) + { + $entityid = $entry['entityid']; + return ' <AttributeFilterPolicy id="'.$entityid. + '"><PolicyRequirementRule xsi:type="basic:AttributeRequesterString" value="'.$entityid. + '" />'.$this->getEntryXMLcontent($entry).'</AttributeFilterPolicy>'; + } + + /** + * @param array $entry + * + * @return string + */ + private function getEntryXMLcontent($entry) + { + if (!array_key_exists('attributes', $entry)) { + return ''; + } + + $ret = ''; + foreach ($entry['attributes'] as $a) { + $ret .= ' <AttributeRule attributeID="'.$this->getAttributeID($a). + '"><PermitValueRule xsi:type="basic:ANY" /></AttributeRule>'; + } + return $ret; + } +} diff --git a/vendor/simplesamlphp/simplesamlphp/modules/metarefresh/lib/MetaLoader.php b/vendor/simplesamlphp/simplesamlphp/modules/metarefresh/lib/MetaLoader.php index 5a04fd5903..e8007803d5 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/metarefresh/lib/MetaLoader.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/metarefresh/lib/MetaLoader.php @@ -1,486 +1,508 @@ <?php -/* - * @author Andreas Åkre Solberg <andreas.solberg@uninett.no> + +namespace SimpleSAML\Module\metarefresh; + +use SimpleSAML\Logger; + +/** * @package SimpleSAMLphp + * @author Andreas Åkre Solberg <andreas.solberg@uninett.no> */ -class sspmod_metarefresh_MetaLoader { - - - private $expire; - private $metadata; - private $oldMetadataSrc; - private $stateFile; - private $changed; - private $types = array( - 'saml20-idp-remote', - 'saml20-sp-remote', - 'shib13-idp-remote', - 'shib13-sp-remote', - 'attributeauthority-remote' - ); - - - /** - * Constructor - * - * @param array $sources Sources... - * @param - */ - public function __construct($expire = NULL, $stateFile = NULL, $oldMetadataSrc = NULL) { - $this->expire = $expire; - $this->metadata = array(); - $this->oldMetadataSrc = $oldMetadataSrc; - $this->stateFile = $stateFile; - $this->changed = FALSE; - - // Read file containing $state from disk - if(is_readable($stateFile)) { - require($stateFile); - } - - $this->state = (isset($state)) ? $state : array(); - - } - - - /** - * Get the types of entities that will be loaded. - * - * @return array The entity types allowed. - */ - public function getTypes() - { - return $this->types; - } - - - /** - * Set the types of entities that will be loaded. - * - * @param string|array $types Either a string with the name of one single type allowed, or an array with a list of - * types. Pass an empty array to reset to all types of entities. - */ - public function setTypes($types) - { - if (!is_array($types)) { - $types = array($types); - } - $this->types = $types; - } - - - /** - * This function processes a SAML metadata file. - * - * @param $source - */ - public function loadSource($source) { - - if (preg_match('@^https?://@i', $source['src'])) { - // Build new HTTP context - $context = $this->createContext($source); - - // GET! - try { - list($data, $responseHeaders) = \SimpleSAML\Utils\HTTP::fetch($source['src'], $context, TRUE); - } catch(Exception $e) { - SimpleSAML\Logger::warning('metarefresh: ' . $e->getMessage()); - } - - // We have response headers, so the request succeeded - if(!isset($responseHeaders)) { - // No response headers, this means the request failed in some way, so re-use old data - SimpleSAML\Logger::debug('No response from ' . $source['src'] . ' - attempting to re-use cached metadata'); - $this->addCachedMetadata($source); - return; - } elseif(preg_match('@^HTTP/1\.[01]\s304\s@', $responseHeaders[0])) { - // 304 response - SimpleSAML\Logger::debug('Received HTTP 304 (Not Modified) - attempting to re-use cached metadata'); - $this->addCachedMetadata($source); - return; - } elseif(!preg_match('@^HTTP/1\.[01]\s200\s@', $responseHeaders[0])) { - // Other error - SimpleSAML\Logger::debug('Error from ' . $source['src'] . ' - attempting to re-use cached metadata'); - $this->addCachedMetadata($source); - return; - } - } else { - // Local file. - $data = file_get_contents($source['src']); - $responseHeaders = NULL; - } - - // Everything OK. Proceed. - if (isset($source['conditionalGET']) && $source['conditionalGET']) { - // Stale or no metadata, so a fresh copy - SimpleSAML\Logger::debug('Downloaded fresh copy'); - } - - try { - $entities = $this->loadXML($data, $source); - } catch(Exception $e) { - SimpleSAML\Logger::debug('XML parser error when parsing ' . $source['src'] . ' - attempting to re-use cached metadata'); - $this->addCachedMetadata($source); - return; - } - - foreach($entities as $entity) { - - if(isset($source['blacklist'])) { - if(!empty($source['blacklist']) && in_array($entity->getEntityID(), $source['blacklist'], true)) { - SimpleSAML\Logger::info('Skipping "' . $entity->getEntityID() . '" - blacklisted.' . "\n"); - continue; - } - } - - if(isset($source['whitelist'])) { - if(!empty($source['whitelist']) && !in_array($entity->getEntityID(), $source['whitelist'], true)) { - SimpleSAML\Logger::info('Skipping "' . $entity->getEntityID() . '" - not in the whitelist.' . "\n"); - continue; - } - } - - if(array_key_exists('certificates', $source) && $source['certificates'] !== NULL) { - if(!$entity->validateSignature($source['certificates'])) { - SimpleSAML\Logger::info('Skipping "' . $entity->getEntityId() . '" - could not verify signature using certificate.' . "\n"); - continue; - } - } - - if(array_key_exists('validateFingerprint', $source) && $source['validateFingerprint'] !== NULL) { - if(!array_key_exists('certificates', $source) || $source['certificates'] == NULL) { - if(!$entity->validateFingerprint($source['validateFingerprint'])) { - SimpleSAML\Logger::info('Skipping "' . $entity->getEntityId() . '" - could not verify signature using fingerprint.' . "\n"); - continue; - } - } else { - SimpleSAML\Logger::info('Skipping validation with fingerprint since option certificate is set.' . "\n"); - } - } - - $template = NULL; - if (array_key_exists('template', $source)) $template = $source['template']; - - $this->addMetadata($source['src'], $entity->getMetadata1xSP(), 'shib13-sp-remote', $template); - $this->addMetadata($source['src'], $entity->getMetadata1xIdP(), 'shib13-idp-remote', $template); - $this->addMetadata($source['src'], $entity->getMetadata20SP(), 'saml20-sp-remote', $template); - $this->addMetadata($source['src'], $entity->getMetadata20IdP(), 'saml20-idp-remote', $template); - $attributeAuthorities = $entity->getAttributeAuthorities(); - if (!empty($attributeAuthorities)) { - $this->addMetadata($source['src'], $attributeAuthorities[0], 'attributeauthority-remote', $template); - } - } - - $this->saveState($source, $responseHeaders); - } - - /** - * Create HTTP context, with any available caches taken into account - */ - private function createContext($source) { - - $context = NULL; - - $config = SimpleSAML_Configuration::getInstance(); - $name = $config->getString('technicalcontact_name', NULL); - $mail = $config->getString('technicalcontact_email', NULL); - - $rawheader = "User-Agent: SimpleSAMLphp metarefresh, run by $name <$mail>\r\n"; - - if (isset($source['conditionalGET']) && $source['conditionalGET']) { - if(array_key_exists($source['src'], $this->state)) { - - $sourceState = $this->state[$source['src']]; - - if(isset($sourceState['last-modified'])) { - $rawheader .= 'If-Modified-Since: ' . $sourceState['last-modified'] . "\r\n"; - } - - if(isset($sourceState['etag'])) { - $rawheader .= 'If-None-Match: ' . $sourceState['etag'] . "\r\n"; - } - } - } - - return array('http' => array('header' => $rawheader)); - } - - - private function addCachedMetadata($source) { - if(isset($this->oldMetadataSrc)) { - foreach($this->types as $type) { - foreach($this->oldMetadataSrc->getMetadataSet($type) as $entity) { - if(array_key_exists('metarefresh:src', $entity)) { - if($entity['metarefresh:src'] == $source['src']) { - $this->addMetadata($source['src'], $entity, $type); - } - } - } - } - } - } - - - /** - * Store caching state data for a source - */ - private function saveState($source, $responseHeaders) { - - if (isset($source['conditionalGET']) && $source['conditionalGET']) { - - // Headers section - $candidates = array('last-modified', 'etag'); - - foreach($candidates as $candidate) { - if(array_key_exists($candidate, $responseHeaders)) { - $this->state[$source['src']][$candidate] = $responseHeaders[$candidate]; - } - } - - if(!empty($this->state[$source['src']])) { - // Timestamp when this src was requested. - $this->state[$source['src']]['requested_at'] = $this->getTime(); - - $this->changed = TRUE; - } - } - } - - - /** - * Parse XML metadata and return entities - */ - private function loadXML($data, $source) { - $entities = array(); - try { - $doc = \SAML2\DOMDocumentFactory::fromString($data); - } catch (Exception $e) { - throw new Exception('Failed to read XML from ' . $source['src']); - } - if ($doc->documentElement === NULL) { - throw new Exception('Opened file is not an XML document: ' . $source['src']); - } - $entities = SimpleSAML_Metadata_SAMLParser::parseDescriptorsElement($doc->documentElement); - return $entities; - } - - - /** - * This function writes the state array back to disk - */ - public function writeState() { - if($this->changed) { - SimpleSAML\Logger::debug('Writing: ' . $this->stateFile); - SimpleSAML\Utils\System::writeFile( - $this->stateFile, - "<?php\n/* This file was generated by the metarefresh module at ".$this->getTime() . ".\n". - " Do not update it manually as it will get overwritten. */\n". - '$state = ' . var_export($this->state, TRUE) . ";\n?>\n", - 0644 - ); - } - } - - - /** - * This function writes the metadata to stdout. - */ - public function dumpMetadataStdOut() { - - foreach($this->metadata as $category => $elements) { - - echo('/* The following data should be added to metadata/' . $category . '.php. */' . "\n"); - - - foreach($elements as $m) { - $filename = $m['filename']; - $entityID = $m['metadata']['entityid']; - - echo("\n"); - echo('/* The following metadata was generated from ' . $filename . ' on ' . $this->getTime() . '. */' . "\n"); - echo('$metadata[\'' . addslashes($entityID) . '\'] = ' . var_export($m['metadata'], TRUE) . ';' . "\n"); - } - - - echo("\n"); - echo('/* End of data which should be added to metadata/' . $category . '.php. */' . "\n"); - echo("\n"); - } - } - - - /** - * This function adds metadata from the specified file to the list of metadata. - * This function will return without making any changes if $metadata is NULL. - * - * @param $filename The filename the metadata comes from. - * @param $metadata The metadata. - * @param $type The metadata type. - */ - private function addMetadata($filename, $metadata, $type, $template = NULL) { - - if($metadata === NULL) { - return; - } - - if (isset($template)) { - $metadata = array_merge($metadata, $template); - } - - $metadata['metarefresh:src'] = $filename; - if(!array_key_exists($type, $this->metadata)) { - $this->metadata[$type] = array(); - } - - // If expire is defined in constructor... - if (!empty($this->expire)) { - - // If expire is already in metadata - if (array_key_exists('expire', $metadata)) { - - // Override metadata expire with more restrictive global config- - if ($this->expire < $metadata['expire']) - $metadata['expire'] = $this->expire; - - // If expire is not already in metadata use global config - } else { - $metadata['expire'] = $this->expire; - } - } - - - - $this->metadata[$type][] = array('filename' => $filename, 'metadata' => $metadata); - } - - - /** - * This function writes the metadata to an ARP file - */ - function writeARPfile($config) { - - assert('is_a($config, \'SimpleSAML_Configuration\')'); - - $arpfile = $config->getValue('arpfile'); - $types = array('saml20-sp-remote'); - - $md = array(); - foreach($this->metadata as $category => $elements) { - if (!in_array($category, $types, true)) continue; - $md = array_merge($md, $elements); - } - - // $metadata, $attributemap, $prefix, $suffix - $arp = new sspmod_metarefresh_ARP($md, - $config->getValue('attributemap', ''), - $config->getValue('prefix', ''), - $config->getValue('suffix', '') - ); - - - $arpxml = $arp->getXML(); - - SimpleSAML\Logger::info('Writing ARP file: ' . $arpfile . "\n"); - file_put_contents($arpfile, $arpxml); - - } - - - /** - * This function writes the metadata to to separate files in the output directory. - */ - function writeMetadataFiles($outputDir) { - - while(strlen($outputDir) > 0 && $outputDir[strlen($outputDir) - 1] === '/') { - $outputDir = substr($outputDir, 0, strlen($outputDir) - 1); - } - - if(!file_exists($outputDir)) { - SimpleSAML\Logger::info('Creating directory: ' . $outputDir . "\n"); - $res = @mkdir($outputDir, 0777, TRUE); - if ($res === FALSE) { - throw new Exception('Error creating directory: ' . $outputDir); - } - } - - foreach($this->types as $type) { - - $filename = $outputDir . '/' . $type . '.php'; - - if(array_key_exists($type, $this->metadata)) { - $elements = $this->metadata[$type]; - SimpleSAML\Logger::debug('Writing: ' . $filename); - - $content = '<?php' . "\n" . '/* This file was generated by the metarefresh module at '. $this->getTime() . "\n"; - $content .= ' Do not update it manually as it will get overwritten' . "\n" . '*/' . "\n"; - - foreach($elements as $m) { - $entityID = $m['metadata']['entityid']; - $content .= "\n"; - $content .= '$metadata[\'' . addslashes($entityID) . '\'] = ' . var_export($m['metadata'], TRUE) . ';' . "\n"; - } - - $content .= "\n" . '?>'; - - SimpleSAML\Utils\System::writeFile($filename, $content, 0644); - } elseif(is_file($filename)) { - if(unlink($filename)) { - SimpleSAML\Logger::debug('Deleting stale metadata file: ' . $filename); - } else { - SimpleSAML\Logger::warning('Could not delete stale metadata file: ' . $filename); - } - } - } - } - - - /** - * Save metadata for loading with the 'serialize' metadata loader. - * - * @param string $outputDir The directory we should save the metadata to. - */ - public function writeMetadataSerialize($outputDir) { - assert('is_string($outputDir)'); - - $metaHandler = new SimpleSAML_Metadata_MetaDataStorageHandlerSerialize(array('directory' => $outputDir)); - - /* First we add all the metadata entries to the metadata handler. */ - foreach ($this->metadata as $set => $elements) { - foreach ($elements as $m) { - $entityId = $m['metadata']['entityid']; - - SimpleSAML\Logger::debug('metarefresh: Add metadata entry ' . - var_export($entityId, TRUE) . ' in set ' . var_export($set, TRUE) . '.'); - $metaHandler->saveMetadata($entityId, $set, $m['metadata']); - } - } - - /* Then we delete old entries which should no longer exist. */ - $ct = time(); - foreach ($metaHandler->getMetadataSets() as $set) { - foreach ($metaHandler->getMetadataSet($set) as $entityId => $metadata) { - if (!array_key_exists('expire', $metadata)) { - SimpleSAML\Logger::warning('metarefresh: Metadata entry without expire timestamp: ' . var_export($entityId, TRUE) . - ' in set ' . var_export($set, TRUE) . '.'); - continue; - } - if ($metadata['expire'] > $ct) { - continue; - } - SimpleSAML\Logger::debug('metarefresh: ' . $entityId . ' expired ' . date('l jS \of F Y h:i:s A', $metadata['expire']) ); - SimpleSAML\Logger::debug('metarefresh: Delete expired metadata entry ' . - var_export($entityId, TRUE) . ' in set ' . var_export($set, TRUE) . '. (' . ($ct - $metadata['expire']) . ' sec)'); - $metaHandler->deleteMetadata($entityId, $set); - } - } - } - - - private function getTime() { - /* The current date, as a string. */ - date_default_timezone_set('UTC'); - $when = date('Y-m-d\\TH:i:s\\Z'); - return $when; - } +class MetaLoader +{ + private $expire; + private $metadata; + private $oldMetadataSrc; + private $stateFile; + private $changed; + private $state; + private $types = [ + 'saml20-idp-remote', + 'saml20-sp-remote', + 'shib13-idp-remote', + 'shib13-sp-remote', + 'attributeauthority-remote' + ]; + + /** + * Constructor + * + * @param integer $expire + * @param string $stateFile + * @param object $oldMetadataSrc + */ + public function __construct($expire = null, $stateFile = null, $oldMetadataSrc = null) + { + $this->expire = $expire; + $this->metadata = []; + $this->oldMetadataSrc = $oldMetadataSrc; + $this->stateFile = $stateFile; + $this->changed = false; + + // Read file containing $state from disk + if (is_readable($stateFile)) { + include $stateFile; + } + + $this->state = []; + } + + /** + * Get the types of entities that will be loaded. + * + * @return array The entity types allowed. + */ + public function getTypes() + { + return $this->types; + } + + /** + * Set the types of entities that will be loaded. + * + * @param string|array $types Either a string with the name of one single type allowed, or an array with a list of + * types. Pass an empty array to reset to all types of entities. + */ + public function setTypes($types) + { + if (!is_array($types)) { + $types = [$types]; + } + $this->types = $types; + } + + /** + * This function processes a SAML metadata file. + * + * @param $source + */ + public function loadSource($source) + { + if (preg_match('@^https?://@i', $source['src'])) { + // Build new HTTP context + $context = $this->createContext($source); + + // GET! + try { + list($data, $responseHeaders) = \SimpleSAML\Utils\HTTP::fetch($source['src'], $context, true); + } catch (\Exception $e) { + Logger::warning('metarefresh: '.$e->getMessage()); + } + + // We have response headers, so the request succeeded + if (!isset($responseHeaders)) { + // No response headers, this means the request failed in some way, so re-use old data + Logger::debug('No response from '.$source['src'].' - attempting to re-use cached metadata'); + $this->addCachedMetadata($source); + return; + } elseif (preg_match('@^HTTP/1\.[01]\s304\s@', $responseHeaders[0])) { + // 304 response + Logger::debug('Received HTTP 304 (Not Modified) - attempting to re-use cached metadata'); + $this->addCachedMetadata($source); + return; + } elseif (!preg_match('@^HTTP/1\.[01]\s200\s@', $responseHeaders[0])) { + // Other error + Logger::debug('Error from '.$source['src'].' - attempting to re-use cached metadata'); + $this->addCachedMetadata($source); + return; + } + } else { + // Local file. + $data = file_get_contents($source['src']); + $responseHeaders = null; + } + + // Everything OK. Proceed. + if (isset($source['conditionalGET']) && $source['conditionalGET']) { + // Stale or no metadata, so a fresh copy + Logger::debug('Downloaded fresh copy'); + } + + try { + $entities = $this->loadXML($data, $source); + } catch (\Exception $e) { + Logger::debug('XML parser error when parsing '.$source['src'].' - attempting to re-use cached metadata'); + Logger::debug('XML parser returned: '.$e->getMessage()); + $this->addCachedMetadata($source); + return; + } + + foreach ($entities as $entity) { + if (isset($source['blacklist'])) { + if (!empty($source['blacklist']) && in_array($entity->getEntityId(), $source['blacklist'], true)) { + Logger::info('Skipping "'.$entity->getEntityId().'" - blacklisted.'."\n"); + continue; + } + } + + if (isset($source['whitelist'])) { + if (!empty($source['whitelist']) && !in_array($entity->getEntityId(), $source['whitelist'], true)) { + Logger::info('Skipping "'.$entity->getEntityId().'" - not in the whitelist.'."\n"); + continue; + } + } + + if (array_key_exists('certificates', $source) && $source['certificates'] !== null) { + if (!$entity->validateSignature($source['certificates'])) { + Logger::info( + 'Skipping "'.$entity->getEntityId().'" - could not verify signature using certificate.'."\n" + ); + continue; + } + } + + if (array_key_exists('validateFingerprint', $source) && $source['validateFingerprint'] !== null) { + if (!array_key_exists('certificates', $source) || $source['certificates'] == null) { + if (!$entity->validateFingerprint($source['validateFingerprint'])) { + Logger::info( + 'Skipping "'.$entity->getEntityId().'" - could not verify signature using fingerprint.'."\n" + ); + continue; + } + } else { + Logger::info('Skipping validation with fingerprint since option certificate is set.'."\n"); + } + } + + $template = null; + if (array_key_exists('template', $source)) { + $template = $source['template']; + } + + if (in_array('shib13-sp-remote', $this->types, true)) { + $this->addMetadata($source['src'], $entity->getMetadata1xSP(), 'shib13-sp-remote', $template); + } + if (in_array('shib13-idp-remote', $this->types, true)) { + $this->addMetadata($source['src'], $entity->getMetadata1xIdP(), 'shib13-idp-remote', $template); + } + if (in_array('saml20-sp-remote', $this->types, true)) { + $this->addMetadata($source['src'], $entity->getMetadata20SP(), 'saml20-sp-remote', $template); + } + if (in_array('saml20-idp-remote', $this->types, true)) { + $this->addMetadata($source['src'], $entity->getMetadata20IdP(), 'saml20-idp-remote', $template); + } + if (in_array('attributeauthority-remote', $this->types, true)) { + $attributeAuthorities = $entity->getAttributeAuthorities(); + if (!empty($attributeAuthorities)) { + $this->addMetadata( + $source['src'], + $attributeAuthorities[0], + 'attributeauthority-remote', + $template + ); + } + } + } + + $this->saveState($source, $responseHeaders); + } + + /** + * Create HTTP context, with any available caches taken into account + */ + private function createContext($source) + { + $config = \SimpleSAML\Configuration::getInstance(); + $name = $config->getString('technicalcontact_name', null); + $mail = $config->getString('technicalcontact_email', null); + + $rawheader = "User-Agent: SimpleSAMLphp metarefresh, run by $name <$mail>\r\n"; + + if (isset($source['conditionalGET']) && $source['conditionalGET']) { + if (array_key_exists($source['src'], $this->state)) { + $sourceState = $this->state[$source['src']]; + + if (isset($sourceState['last-modified'])) { + $rawheader .= 'If-Modified-Since: '.$sourceState['last-modified']."\r\n"; + } + + if (isset($sourceState['etag'])) { + $rawheader .= 'If-None-Match: '.$sourceState['etag']."\r\n"; + } + } + } + + return ['http' => ['header' => $rawheader]]; + } + + + private function addCachedMetadata($source) + { + if (isset($this->oldMetadataSrc)) { + foreach ($this->types as $type) { + foreach ($this->oldMetadataSrc->getMetadataSet($type) as $entity) { + if (array_key_exists('metarefresh:src', $entity)) { + if ($entity['metarefresh:src'] == $source['src']) { + $this->addMetadata($source['src'], $entity, $type); + } + } + } + } + } + } + + + /** + * Store caching state data for a source + */ + private function saveState($source, $responseHeaders) + { + if (isset($source['conditionalGET']) && $source['conditionalGET']) { + // Headers section + if ($responseHeaders !== null) { + $candidates = ['last-modified', 'etag']; + + foreach ($candidates as $candidate) { + if (array_key_exists($candidate, $responseHeaders)) { + $this->state[$source['src']][$candidate] = $responseHeaders[$candidate]; + } + } + } + + if (!empty($this->state[$source['src']])) { + // Timestamp when this src was requested. + $this->state[$source['src']]['requested_at'] = $this->getTime(); + $this->changed = true; + } + } + } + + /** + * Parse XML metadata and return entities + */ + private function loadXML($data, $source) + { + try { + $doc = \SAML2\DOMDocumentFactory::fromString($data); + } catch (\Exception $e) { + throw new \Exception('Failed to read XML from '.$source['src']); + } + if ($doc->documentElement === null) { + throw new \Exception('Opened file is not an XML document: '.$source['src']); + } + return \SimpleSAML\Metadata\SAMLParser::parseDescriptorsElement($doc->documentElement); + } + + + /** + * This function writes the state array back to disk + */ + public function writeState() + { + if ($this->changed) { + Logger::debug('Writing: '.$this->stateFile); + \SimpleSAML\Utils\System::writeFile( + $this->stateFile, + "<?php\n/* This file was generated by the metarefresh module at ".$this->getTime().".\n". + " Do not update it manually as it will get overwritten. */\n". + '$state = '.var_export($this->state, true).";\n?>\n", + 0644 + ); + } + } + + + /** + * This function writes the metadata to stdout. + */ + public function dumpMetadataStdOut() + { + foreach ($this->metadata as $category => $elements) { + echo '/* The following data should be added to metadata/'.$category.'.php. */'."\n"; + + foreach ($elements as $m) { + $filename = $m['filename']; + $entityID = $m['metadata']['entityid']; + + echo "\n"; + echo '/* The following metadata was generated from '.$filename.' on '.$this->getTime().'. */'."\n"; + echo '$metadata[\''.addslashes($entityID).'\'] = '.var_export($m['metadata'], true).';'."\n"; + } + + echo "\n"; + echo '/* End of data which should be added to metadata/'.$category.'.php. */'."\n"; + echo "\n"; + } + } + + + /** + * This function adds metadata from the specified file to the list of metadata. + * This function will return without making any changes if $metadata is NULL. + * + * @param string $filename The filename the metadata comes from. + * @param array $metadata The metadata. + * @param string $type The metadata type. + */ + private function addMetadata($filename, $metadata, $type, $template = null) + { + if ($metadata === null) { + return; + } + + if (isset($template)) { + $metadata = array_merge($metadata, $template); + } + + $metadata['metarefresh:src'] = $filename; + if (!array_key_exists($type, $this->metadata)) { + $this->metadata[$type] = []; + } + + // If expire is defined in constructor... + if (!empty($this->expire)) { + // If expire is already in metadata + if (array_key_exists('expire', $metadata)) { + // Override metadata expire with more restrictive global config + if ($this->expire < $metadata['expire']) { + $metadata['expire'] = $this->expire; + } + + // If expire is not already in metadata use global config + } else { + $metadata['expire'] = $this->expire; + } + } + $this->metadata[$type][] = ['filename' => $filename, 'metadata' => $metadata]; + } + + + /** + * This function writes the metadata to an ARP file + */ + public function writeARPfile($config) + { + assert($config instanceof \SimpleSAML\Configuration); + + $arpfile = $config->getValue('arpfile'); + $types = ['saml20-sp-remote']; + + $md = []; + foreach ($this->metadata as $category => $elements) { + if (!in_array($category, $types, true)) { + continue; + } + $md = array_merge($md, $elements); + } + + // $metadata, $attributemap, $prefix, $suffix + $arp = new \SimpleSAML\Module\metarefresh\ARP( + $md, + $config->getValue('attributemap', ''), + $config->getValue('prefix', ''), + $config->getValue('suffix', '') + ); + + + $arpxml = $arp->getXML(); + + Logger::info('Writing ARP file: '.$arpfile."\n"); + file_put_contents($arpfile, $arpxml); + } + + + /** + * This function writes the metadata to to separate files in the output directory. + */ + public function writeMetadataFiles($outputDir) + { + while (strlen($outputDir) > 0 && $outputDir[strlen($outputDir) - 1] === '/') { + $outputDir = substr($outputDir, 0, strlen($outputDir) - 1); + } + + if (!file_exists($outputDir)) { + Logger::info('Creating directory: '.$outputDir."\n"); + $res = @mkdir($outputDir, 0777, true); + if ($res === false) { + throw new \Exception('Error creating directory: '.$outputDir); + } + } + + foreach ($this->types as $type) { + $filename = $outputDir.'/'.$type.'.php'; + + if (array_key_exists($type, $this->metadata)) { + $elements = $this->metadata[$type]; + Logger::debug('Writing: '.$filename); + + $content = '<?php'."\n".'/* This file was generated by the metarefresh module at '; + $content .= $this->getTime()."\nDo not update it manually as it will get overwritten\n".'*/'."\n"; + + foreach ($elements as $m) { + $entityID = $m['metadata']['entityid']; + $content .= "\n".'$metadata[\''; + $content .= addslashes($entityID).'\'] = '.var_export($m['metadata'], true).';'."\n"; + } + + $content .= "\n".'?>'; + + \SimpleSAML\Utils\System::writeFile($filename, $content, 0644); + } elseif (is_file($filename)) { + if (unlink($filename)) { + Logger::debug('Deleting stale metadata file: '.$filename); + } else { + Logger::warning('Could not delete stale metadata file: '.$filename); + } + } + } + } + + + /** + * Save metadata for loading with the 'serialize' metadata loader. + * + * @param string $outputDir The directory we should save the metadata to. + */ + public function writeMetadataSerialize($outputDir) + { + assert(is_string($outputDir)); + + $metaHandler = new \SimpleSAML\Metadata\MetaDataStorageHandlerSerialize(['directory' => $outputDir]); + + // First we add all the metadata entries to the metadata handler + foreach ($this->metadata as $set => $elements) { + foreach ($elements as $m) { + $entityId = $m['metadata']['entityid']; + + Logger::debug( + 'metarefresh: Add metadata entry '. + var_export($entityId, true).' in set '.var_export($set, true).'.' + ); + $metaHandler->saveMetadata($entityId, $set, $m['metadata']); + } + } + + // Then we delete old entries which should no longer exist + $ct = time(); + foreach ($metaHandler->getMetadataSets() as $set) { + foreach ($metaHandler->getMetadataSet($set) as $entityId => $metadata) { + if (!array_key_exists('expire', $metadata)) { + Logger::warning( + 'metarefresh: Metadata entry without expire timestamp: '.var_export($entityId, true). + ' in set '.var_export($set, true).'.' + ); + continue; + } + if ($metadata['expire'] > $ct) { + continue; + } + Logger::debug('metarefresh: '.$entityId.' expired '.date('l jS \of F Y h:i:s A', $metadata['expire'])); + Logger::debug( + 'metarefresh: Delete expired metadata entry '. + var_export($entityId, true).' in set '.var_export($set, true). + '. ('.($ct - $metadata['expire']).' sec)' + ); + $metaHandler->deleteMetadata($entityId, $set); + } + } + } + + + private function getTime() + { + // The current date, as a string + date_default_timezone_set('UTC'); + return date('Y-m-d\\TH:i:s\\Z'); + } } diff --git a/vendor/simplesamlphp/simplesamlphp/modules/metarefresh/locales/en/LC_MESSAGES/metarefresh.po b/vendor/simplesamlphp/simplesamlphp/modules/metarefresh/locales/en/LC_MESSAGES/metarefresh.po new file mode 100644 index 0000000000..483051bab4 --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/modules/metarefresh/locales/en/LC_MESSAGES/metarefresh.po @@ -0,0 +1,25 @@ + +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: SimpleSAMLphp 1.15\n" +"Report-Msgid-Bugs-To: simplesamlphp-translation@googlegroups.com\n" +"POT-Creation-Date: 2017-12-06 09:23+0200\n" +"PO-Revision-Date: 2017-12-06 12:14+0200\n" +"Last-Translator: \n" +"Language: en\n" +"Language-Team: \n" +"Plural-Forms: nplurals=2; plural=(n != 1)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.3.4\n" + +msgid "metarefresh_header" +msgstr "Metarefresh" + +msgid "metarefresh_no_output" +msgstr "No output from metarefresh." + +msgid "metarefresh_fetched" +msgstr "Fetched metadata" diff --git a/vendor/simplesamlphp/simplesamlphp/modules/metarefresh/templates/fetch.tpl.php b/vendor/simplesamlphp/simplesamlphp/modules/metarefresh/templates/fetch.tpl.php index 512f6f429f..5a988ce74c 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/metarefresh/templates/fetch.tpl.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/metarefresh/templates/fetch.tpl.php @@ -1,22 +1,17 @@ <?php -$this->data['header'] = $this->t('{aggregator:aggregator:aggregator_header}'); +$this->data['header'] = $this->t('{metarefresh:metarefresh:metarefresh_header}'); $this->includeAtTemplateBase('includes/header.php'); -echo('<h1>Metarefresh fetch</h1>'); - +echo '<h1>'.$this->data['header'].'</h1>'; if (!empty($this->data['logentries'])) { - - echo '<pre style="border: 1px solid #aaa; padding: .5em; overflow: scroll">'; - foreach($this->data['logentries'] AS $l) { - echo $l . "\n"; - } - echo '</pre>'; - + echo '<pre style="border: 1px solid #aaa; padding: .5em; overflow: scroll">'; + foreach ($this->data['logentries'] as $l) { + echo $l."\n"; + } + echo '</pre>'; } else { - echo 'No output from metarefresh.'; + echo $this->t('{metarefresh:metarefresh:no_output}'); } - - $this->includeAtTemplateBase('includes/footer.php'); diff --git a/vendor/simplesamlphp/simplesamlphp/modules/metarefresh/templates/fetch.twig b/vendor/simplesamlphp/simplesamlphp/modules/metarefresh/templates/fetch.twig new file mode 100644 index 0000000000..d8765ab3dd --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/modules/metarefresh/templates/fetch.twig @@ -0,0 +1,18 @@ +{% set pagetitle = "metarefresh_header" | trans %} + +{% extends "base.twig" %} + +{% block content %} + +{% if logentries %} + <h1>{{ "metarefresh_fetched" | trans }}</h1> + <ul> + {% for logentry in logentries %} + <li>{{ logentry }}</li> + {% endfor %} + </ul> +{% else %} +{{ "metarefresh_no_output" | trans }} +{% endif %} + +{% endblock content %} diff --git a/vendor/simplesamlphp/simplesamlphp/modules/metarefresh/www/fetch.php b/vendor/simplesamlphp/simplesamlphp/modules/metarefresh/www/fetch.php index 097fb85c06..a715886fa0 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/metarefresh/www/fetch.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/metarefresh/www/fetch.php @@ -1,94 +1,86 @@ <?php -$config = SimpleSAML_Configuration::getInstance(); -$mconfig = SimpleSAML_Configuration::getOptionalConfig('config-metarefresh.php'); - -SimpleSAML\Utils\Auth::requireAdmin(); - -SimpleSAML\Logger::setCaptureLog(TRUE); - - -$sets = $mconfig->getConfigList('sets', array()); - -foreach ($sets AS $setkey => $set) { - - SimpleSAML\Logger::info('[metarefresh]: Executing set [' . $setkey . ']'); - - try { - - - $expireAfter = $set->getInteger('expireAfter', NULL); - if ($expireAfter !== NULL) { - $expire = time() + $expireAfter; - } else { - $expire = NULL; - } - - $metaloader = new sspmod_metarefresh_MetaLoader($expire); - - # Get global black/whitelists - $blacklist = $mconfig->getArray('blacklist', array()); - $whitelist = $mconfig->getArray('whitelist', array()); - - // get global type filters - $available_types = array( - 'saml20-idp-remote', - 'saml20-sp-remote', - 'shib13-idp-remote', - 'shib13-sp-remote', - 'attributeauthority-remote' - ); - $set_types = $set->getArrayize('types', $available_types); - - foreach($set->getArray('sources') AS $source) { - - // filter metadata by type of entity - if (isset($source['types'])) { - $metaloader->setTypes($source['types']); - } else { - $metaloader->setTypes($set_types); - } - - # Merge global and src specific blacklists - if(isset($source['blacklist'])) { - $source['blacklist'] = array_unique(array_merge($source['blacklist'], $blacklist)); - } else { - $source['blacklist'] = $blacklist; - } - - # Merge global and src specific whitelists - if(isset($source['whitelist'])) { - $source['whitelist'] = array_unique(array_merge($source['whitelist'], $whitelist)); - } else { - $source['whitelist'] = $whitelist; - } - - SimpleSAML\Logger::debug('[metarefresh]: In set [' . $setkey . '] loading source [' . $source['src'] . ']'); - $metaloader->loadSource($source); - } - - $outputDir = $set->getString('outputDir'); - $outputDir = $config->resolvePath($outputDir); - - $outputFormat = $set->getValueValidate('outputFormat', array('flatfile', 'serialize'), 'flatfile'); - switch ($outputFormat) { - case 'flatfile': - $metaloader->writeMetadataFiles($outputDir); - break; - case 'serialize': - $metaloader->writeMetadataSerialize($outputDir); - break; - } - } catch (Exception $e) { - $e = SimpleSAML_Error_Exception::fromException($e); - $e->logWarning(); - } - - +$config = \SimpleSAML\Configuration::getInstance(); +$mconfig = \SimpleSAML\Configuration::getOptionalConfig('config-metarefresh.php'); + +\SimpleSAML\Utils\Auth::requireAdmin(); + +\SimpleSAML\Logger::setCaptureLog(true); + +$sets = $mconfig->getConfigList('sets', []); + +foreach ($sets as $setkey => $set) { + \SimpleSAML\Logger::info('[metarefresh]: Executing set ['.$setkey.']'); + + try { + $expireAfter = $set->getInteger('expireAfter', null); + if ($expireAfter !== null) { + $expire = time() + $expireAfter; + } else { + $expire = null; + } + $metaloader = new \SimpleSAML\Module\metarefresh\MetaLoader($expire); + + # Get global black/whitelists + $blacklist = $mconfig->getArray('blacklist', []); + $whitelist = $mconfig->getArray('whitelist', []); + + // get global type filters + $available_types = [ + 'saml20-idp-remote', + 'saml20-sp-remote', + 'shib13-idp-remote', + 'shib13-sp-remote', + 'attributeauthority-remote' + ]; + $set_types = $set->getArrayize('types', $available_types); + + foreach ($set->getArray('sources') as $source) { + // filter metadata by type of entity + if (isset($source['types'])) { + $metaloader->setTypes($source['types']); + } else { + $metaloader->setTypes($set_types); + } + + # Merge global and src specific blacklists + if (isset($source['blacklist'])) { + $source['blacklist'] = array_unique(array_merge($source['blacklist'], $blacklist)); + } else { + $source['blacklist'] = $blacklist; + } + + # Merge global and src specific whitelists + if (isset($source['whitelist'])) { + $source['whitelist'] = array_unique(array_merge($source['whitelist'], $whitelist)); + } else { + $source['whitelist'] = $whitelist; + } + + \SimpleSAML\Logger::debug('[metarefresh]: In set ['.$setkey.'] loading source ['.$source['src'].']'); + $metaloader->loadSource($source); + } + + $outputDir = $set->getString('outputDir'); + $outputDir = $config->resolvePath($outputDir); + + $outputFormat = $set->getValueValidate('outputFormat', ['flatfile', 'serialize'], 'flatfile'); + switch ($outputFormat) { + case 'flatfile': + $metaloader->writeMetadataFiles($outputDir); + break; + case 'serialize': + $metaloader->writeMetadataSerialize($outputDir); + break; + } + } catch (\Exception $e) { + $e = \SimpleSAML\Error\Exception::fromException($e); + $e->logWarning(); + } } -$logentries = SimpleSAML\Logger::getCapturedLog(); +$logentries = \SimpleSAML\Logger::getCapturedLog(); -$t = new SimpleSAML_XHTML_Template($config, 'metarefresh:fetch.tpl.php'); +$t = new \SimpleSAML\XHTML\Template($config, 'metarefresh:fetch.tpl.php'); $t->data['logentries'] = $logentries; -$t->show(); \ No newline at end of file +$t->show(); diff --git a/vendor/simplesamlphp/simplesamlphp/modules/multiauth/dictionaries/multiauth.translation.json b/vendor/simplesamlphp/simplesamlphp/modules/multiauth/dictionaries/multiauth.translation.json index ccf9e3b767..bd235213fe 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/multiauth/dictionaries/multiauth.translation.json +++ b/vendor/simplesamlphp/simplesamlphp/modules/multiauth/dictionaries/multiauth.translation.json @@ -30,7 +30,9 @@ "eu": "Hauta ezazu iturburu bat kautotzeko", "af": "Kies 'n verifikasie bron", "el": "\u0395\u03c0\u03b9\u03bb\u03bf\u03b3\u03ae \u03c0\u03b7\u03b3\u03ae\u03c2 \u03c4\u03b1\u03c5\u03c4\u03bf\u03c0\u03bf\u03af\u03b7\u03c3\u03b7\u03c2", - "pl": "Wybierz \u017aród\u0142o autentykacji" + "pl": "Wybierz \u017aród\u0142o autentykacji", + "xh": "Khetha umthombo wongqinisiso", + "zu": "Khetha umthombo wokuqinisekisa" }, "select_source_text": { "no": "Den valgte autentiseringskilden vil bli brukt til \u00e5 autentisere brukeren og deretter etablere en gyldig sesjon.", @@ -63,6 +65,8 @@ "eu": "Kautotzeko hautatu duzun iturburua, kautotu eta baliozko saio bat sortzeko erabiliko da.", "af": "Die gekose verifikasie bron sal gebruik word om jou te identifiseer en 'n geldige sessie te skep.", "el": "\u0397 \u03b5\u03c0\u03b9\u03bb\u03b5\u03b3\u03bc\u03ad\u03bd\u03b7 \u03c0\u03b7\u03b3\u03ae \u03c4\u03b1\u03c5\u03c4\u03bf\u03c0\u03bf\u03af\u03b7\u03c3\u03b7\u03c2 \u03b8\u03b1 \u03c7\u03c1\u03b7\u03c3\u03b9\u03bc\u03bf\u03c0\u03bf\u03b9\u03b7\u03b8\u03b5\u03af \u03b3\u03b9\u03b1 \u03c4\u03b7\u03bd \u03c0\u03b9\u03c3\u03c4\u03bf\u03c0\u03bf\u03af\u03b7\u03c3\u03b7 \u03c4\u03b7\u03c2 \u03c4\u03b1\u03c5\u03c4\u03cc\u03c4\u03b7\u03c4\u03ac \u03c3\u03b1\u03c2 \u03ba\u03b1\u03b9 \u03c4\u03b7 \u03b4\u03b7\u03bc\u03b9\u03bf\u03c5\u03c1\u03b3\u03af\u03b1 \u03ad\u03b3\u03ba\u03c5\u03c1\u03b7\u03c2 \u03c3\u03c5\u03bd\u03b5\u03b4\u03c1\u03af\u03b1\u03c2 (session).", - "pl": "Wybrane \u017aród\u0142o zostanie u\u017Cyte do autentykacji i stworzenia sesji" + "pl": "Wybrane \u017aród\u0142o zostanie u\u017Cyte do autentykacji i stworzenia sesji", + "zu": "Umthombo wokuqinisekisa okhethiwe uzosetshenziswa ukuze uqinisekiswe futhi kwakhiwe iseshini esebenzayo.", + "xh": "Umthombo wongqinisiso okhethiweyo uza kusetyenziswa ukukungqinisisa nokuyila iseshoni esebenzayo." } } diff --git a/vendor/simplesamlphp/simplesamlphp/modules/multiauth/docs/multiauth.md b/vendor/simplesamlphp/simplesamlphp/modules/multiauth/docs/multiauth.md index 7b3e0f2737..97ae265feb 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/multiauth/docs/multiauth.md +++ b/vendor/simplesamlphp/simplesamlphp/modules/multiauth/docs/multiauth.md @@ -110,3 +110,27 @@ You can also use the multiauth:preselect parameter to the login call: $as->login(array( 'multiauth:preselect' => 'default-sp', )); + +Or add the `preselect` option in the filter: + + 'example-multi' => array( + 'multiauth:MultiAuth', + + /* + * The available authentication sources. + * They must be defined in this authsources.php file. + */ + 'sources' => array( + 'example-saml' => array( + // ... + ), + 'example-admin' => array( + // ... + ), + ), + 'preselect' => 'example-saml', + ), + +The order of priority, in case more than one option was used is: +`source` url parameter, `multiauth:preselect` login state and +`preselect` filter option. diff --git a/vendor/simplesamlphp/simplesamlphp/modules/multiauth/lib/Auth/Source/MultiAuth.php b/vendor/simplesamlphp/simplesamlphp/modules/multiauth/lib/Auth/Source/MultiAuth.php index 9cb75c0b82..c25f85ba5d 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/multiauth/lib/Auth/Source/MultiAuth.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/multiauth/lib/Auth/Source/MultiAuth.php @@ -1,5 +1,7 @@ <?php +namespace SimpleSAML\Module\multiauth\Auth\Source; + /** * Authentication source which let the user chooses among a list of * other authentication sources @@ -8,227 +10,260 @@ * @package SimpleSAMLphp */ -class sspmod_multiauth_Auth_Source_MultiAuth extends SimpleSAML_Auth_Source { - - /** - * The key of the AuthId field in the state. - */ - const AUTHID = 'sspmod_multiauth_Auth_Source_MultiAuth.AuthId'; - - /** - * The string used to identify our states. - */ - const STAGEID = 'sspmod_multiauth_Auth_Source_MultiAuth.StageId'; - - /** - * The key where the sources is saved in the state. - */ - const SOURCESID = 'sspmod_multiauth_Auth_Source_MultiAuth.SourceId'; - - /** - * The key where the selected source is saved in the session. - */ - const SESSION_SOURCE = 'multiauth:selectedSource'; - - /** - * Array of sources we let the user chooses among. - */ - private $sources; - - /** - * Constructor for this authentication source. - * - * @param array $info Information about this authentication source. - * @param array $config Configuration. - */ - public function __construct($info, $config) { - assert('is_array($info)'); - assert('is_array($config)'); - - // Call the parent constructor first, as required by the interface - parent::__construct($info, $config); - - if (!array_key_exists('sources', $config)) { - throw new Exception('The required "sources" config option was not found'); - } - - $globalConfiguration = SimpleSAML_Configuration::getInstance(); - $defaultLanguage = $globalConfiguration->getString('language.default', 'en'); - $authsources = SimpleSAML_Configuration::getConfig('authsources.php'); - $this->sources = array(); - foreach($config['sources'] as $source => $info) { - - if (is_int($source)) { // Backwards compatibility - $source = $info; - $info = array(); - } - - if (array_key_exists('text', $info)) { - $text = $info['text']; - } else { - $text = array($defaultLanguage => $source); - } - - if (array_key_exists('css-class', $info)) { - $css_class = $info['css-class']; - } else { - // Use the authtype as the css class - $authconfig = $authsources->getArray($source, NULL); - if (!array_key_exists(0, $authconfig) || !is_string($authconfig[0])) { - $css_class = ""; - } else { - $css_class = str_replace(":", "-", $authconfig[0]); - } - } - - $this->sources[] = array( - 'source' => $source, - 'text' => $text, - 'css_class' => $css_class, - ); - } - } - - /** - * Prompt the user with a list of authentication sources. - * - * This method saves the information about the configured sources, - * and redirects to a page where the user must select one of these - * authentication sources. - * - * This method never return. The authentication process is finished - * in the delegateAuthentication method. - * - * @param array &$state Information about the current authentication. - */ - public function authenticate(&$state) { - assert('is_array($state)'); - - $state[self::AUTHID] = $this->authId; - $state[self::SOURCESID] = $this->sources; - - /* Save the $state array, so that we can restore if after a redirect */ - $id = SimpleSAML_Auth_State::saveState($state, self::STAGEID); - - /* Redirect to the select source page. We include the identifier of the - saved state array as a parameter to the login form */ - $url = SimpleSAML\Module::getModuleURL('multiauth/selectsource.php'); - $params = array('AuthState' => $id); - - // Allowes the user to specify the auth souce to be used - if(isset($_GET['source'])) { - $params['source'] = $_GET['source']; - } - - \SimpleSAML\Utils\HTTP::redirectTrustedURL($url, $params); - - /* The previous function never returns, so this code is never - executed */ - assert('FALSE'); - } - - /** - * Delegate authentication. - * - * This method is called once the user has choosen one authentication - * source. It saves the selected authentication source in the session - * to be able to logout properly. Then it calls the authenticate method - * on such selected authentication source. - * - * @param string $authId Selected authentication source - * @param array $state Information about the current authentication. - */ - public static function delegateAuthentication($authId, $state) { - assert('is_string($authId)'); - assert('is_array($state)'); - - $as = SimpleSAML_Auth_Source::getById($authId); - $valid_sources = array_map( - function($src) { - return $src['source']; - }, - $state[self::SOURCESID] +class MultiAuth extends \SimpleSAML\Auth\Source +{ + /** + * The key of the AuthId field in the state. + */ + const AUTHID = '\SimpleSAML\Module\multiauth\Auth\Source\MultiAuth.AuthId'; + + /** + * The string used to identify our states. + */ + const STAGEID = '\SimpleSAML\Module\multiauth\Auth\Source\MultiAuth.StageId'; + + /** + * The key where the sources is saved in the state. + */ + const SOURCESID = '\SimpleSAML\Module\multiauth\Auth\Source\MultiAuth.SourceId'; + + /** + * The key where the selected source is saved in the session. + */ + const SESSION_SOURCE = 'multiauth:selectedSource'; + + /** + * Array of sources we let the user chooses among. + */ + private $sources; + + /** + * @var string|null preselect source in filter module configuration + */ + private $preselect; + + /** + * Constructor for this authentication source. + * + * @param array $info Information about this authentication source. + * @param array $config Configuration. + */ + public function __construct($info, $config) + { + assert(is_array($info)); + assert(is_array($config)); + + // Call the parent constructor first, as required by the interface + parent::__construct($info, $config); + + if (!array_key_exists('sources', $config)) { + throw new \Exception('The required "sources" config option was not found'); + } + + if (array_key_exists('preselect', $config) && is_string($config['preselect'])) { + if (!array_key_exists($config['preselect'], $config['sources'])) { + throw new \Exception('The optional "preselect" config option must be present in "sources"'); + } + + $this->preselect = $config['preselect']; + } + + $globalConfiguration = \SimpleSAML\Configuration::getInstance(); + $defaultLanguage = $globalConfiguration->getString('language.default', 'en'); + $authsources = \SimpleSAML\Configuration::getConfig('authsources.php'); + $this->sources = []; + foreach ($config['sources'] as $source => $info) { + if (is_int($source)) { + // Backwards compatibility + $source = $info; + $info = []; + } + + if (array_key_exists('text', $info)) { + $text = $info['text']; + } else { + $text = [$defaultLanguage => $source]; + } + + if (array_key_exists('help', $info)) { + $help = $info['help']; + } else { + $help = null; + } + if (array_key_exists('css-class', $info)) { + $css_class = $info['css-class']; + } else { + // Use the authtype as the css class + $authconfig = $authsources->getArray($source, null); + if (!array_key_exists(0, $authconfig) || !is_string($authconfig[0])) { + $css_class = ""; + } else { + $css_class = str_replace(":", "-", $authconfig[0]); + } + } + + $this->sources[] = [ + 'source' => $source, + 'text' => $text, + 'help' => $help, + 'css_class' => $css_class, + ]; + } + } + + /** + * Prompt the user with a list of authentication sources. + * + * This method saves the information about the configured sources, + * and redirects to a page where the user must select one of these + * authentication sources. + * + * This method never return. The authentication process is finished + * in the delegateAuthentication method. + * + * @param array &$state Information about the current authentication. + */ + public function authenticate(&$state) + { + assert(is_array($state)); + + $state[self::AUTHID] = $this->authId; + $state[self::SOURCESID] = $this->sources; + + if (!\array_key_exists('multiauth:preselect', $state) && is_string($this->preselect)) { + $state['multiauth:preselect'] = $this->preselect; + } + + // Save the $state array, so that we can restore if after a redirect + $id = \SimpleSAML\Auth\State::saveState($state, self::STAGEID); + + /* Redirect to the select source page. We include the identifier of the + * saved state array as a parameter to the login form + */ + $url = \SimpleSAML\Module::getModuleURL('multiauth/selectsource.php'); + $params = ['AuthState' => $id]; + + // Allows the user to specify the auth source to be used + if (isset($_GET['source'])) { + $params['source'] = $_GET['source']; + } + + \SimpleSAML\Utils\HTTP::redirectTrustedURL($url, $params); + + // The previous function never returns, so this code is never executed + assert(false); + } + + /** + * Delegate authentication. + * + * This method is called once the user has choosen one authentication + * source. It saves the selected authentication source in the session + * to be able to logout properly. Then it calls the authenticate method + * on such selected authentication source. + * + * @param string $authId Selected authentication source + * @param array $state Information about the current authentication. + */ + public static function delegateAuthentication($authId, $state) + { + assert(is_string($authId)); + assert(is_array($state)); + + $as = \SimpleSAML\Auth\Source::getById($authId); + $valid_sources = array_map( + function ($src) { + return $src['source']; + }, + $state[self::SOURCESID] + ); + if ($as === null || !in_array($authId, $valid_sources, true)) { + throw new \Exception('Invalid authentication source: '.$authId); + } + + // Save the selected authentication source for the logout process. + $session = \SimpleSAML\Session::getSessionFromRequest(); + $session->setData( + self::SESSION_SOURCE, + $state[self::AUTHID], + $authId, + \SimpleSAML\Session::DATA_TIMEOUT_SESSION_END ); - if ($as === NULL || !in_array($authId, $valid_sources, true)) { - throw new Exception('Invalid authentication source: ' . $authId); - } - - /* Save the selected authentication source for the logout process. */ - $session = SimpleSAML_Session::getSessionFromRequest(); - $session->setData(self::SESSION_SOURCE, $state[self::AUTHID], $authId, SimpleSAML_Session::DATA_TIMEOUT_SESSION_END); - - try { - $as->authenticate($state); - } catch (SimpleSAML_Error_Exception $e) { - SimpleSAML_Auth_State::throwException($state, $e); - } catch (Exception $e) { - $e = new SimpleSAML_Error_UnserializableException($e); - SimpleSAML_Auth_State::throwException($state, $e); - } - SimpleSAML_Auth_Source::completeAuth($state); - } - - /** - * Log out from this authentication source. - * - * This method retrieves the authentication source used for this - * session and then call the logout method on it. - * - * @param array &$state Information about the current logout operation. - */ - public function logout(&$state) { - assert('is_array($state)'); - - /* Get the source that was used to authenticate */ - $session = SimpleSAML_Session::getSessionFromRequest(); - $authId = $session->getData(self::SESSION_SOURCE, $this->authId); - - $source = SimpleSAML_Auth_Source::getById($authId); - if ($source === NULL) { - throw new Exception('Invalid authentication source during logout: ' . $source); - } - /* Then, do the logout on it */ - $source->logout($state); - } - - /** - * Set the previous authentication source. - * - * This method remembers the authentication source that the user selected - * by storing its name in a cookie. - * - * @param string $source Name of the authentication source the user selected. - */ - public function setPreviousSource($source) { - assert('is_string($source)'); - - $cookieName = 'multiauth_source_' . $this->authId; - - $config = SimpleSAML_Configuration::getInstance(); - $params = array( - /* We save the cookies for 90 days. */ - 'lifetime' => (60*60*24*90), - /* The base path for cookies. - This should be the installation directory for SimpleSAMLphp. */ - 'path' => $config->getBasePath(), - 'httponly' => FALSE, - ); - - \SimpleSAML\Utils\HTTP::setCookie($cookieName, $source, $params, FALSE); - } - - /** - * Get the previous authentication source. - * - * This method retrieves the authentication source that the user selected - * last time or NULL if this is the first time or remembering is disabled. - */ - public function getPreviousSource() { - $cookieName = 'multiauth_source_' . $this->authId; - if(array_key_exists($cookieName, $_COOKIE)) { - return $_COOKIE[$cookieName]; - } else { - return NULL; - } - } + + try { + $as->authenticate($state); + } catch (\SimpleSAML\Error\Exception $e) { + \SimpleSAML\Auth\State::throwException($state, $e); + } catch (\Exception $e) { + $e = new \SimpleSAML\Error\UnserializableException($e); + \SimpleSAML\Auth\State::throwException($state, $e); + } + \SimpleSAML\Auth\Source::completeAuth($state); + } + + /** + * Log out from this authentication source. + * + * This method retrieves the authentication source used for this + * session and then call the logout method on it. + * + * @param array &$state Information about the current logout operation. + */ + public function logout(&$state) + { + assert(is_array($state)); + + // Get the source that was used to authenticate + $session = \SimpleSAML\Session::getSessionFromRequest(); + $authId = $session->getData(self::SESSION_SOURCE, $this->authId); + + $source = \SimpleSAML\Auth\Source::getById($authId); + if ($source === null) { + throw new \Exception('Invalid authentication source during logout: '.$source); + } + // Then, do the logout on it + $source->logout($state); + } + + /** + * Set the previous authentication source. + * + * This method remembers the authentication source that the user selected + * by storing its name in a cookie. + * + * @param string $source Name of the authentication source the user selected. + */ + public function setPreviousSource($source) + { + assert(is_string($source)); + + $cookieName = 'multiauth_source_'.$this->authId; + + $config = \SimpleSAML\Configuration::getInstance(); + $params = [ + // We save the cookies for 90 days + 'lifetime' => 7776000, //60*60*24*90 + // The base path for cookies. This should be the installation directory for SimpleSAMLphp. + 'path' => $config->getBasePath(), + 'httponly' => false, + ]; + + \SimpleSAML\Utils\HTTP::setCookie($cookieName, $source, $params, false); + } + + /** + * Get the previous authentication source. + * + * This method retrieves the authentication source that the user selected + * last time or NULL if this is the first time or remembering is disabled. + */ + public function getPreviousSource() + { + $cookieName = 'multiauth_source_'.$this->authId; + if (array_key_exists($cookieName, $_COOKIE)) { + return $_COOKIE[$cookieName]; + } else { + return null; + } + } } diff --git a/vendor/simplesamlphp/simplesamlphp/modules/multiauth/locales/xh/LC_MESSAGES/multiauth.po b/vendor/simplesamlphp/simplesamlphp/modules/multiauth/locales/xh/LC_MESSAGES/multiauth.po new file mode 100644 index 0000000000..49d81485b4 --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/modules/multiauth/locales/xh/LC_MESSAGES/multiauth.po @@ -0,0 +1,24 @@ + +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: SimpleSAMLphp 1.15\n" +"Report-Msgid-Bugs-To: simplesamlphp-translation@googlegroups.com\n" +"POT-Creation-Date: 2018-11-15 14:49+0200\n" +"PO-Revision-Date: 2018-11-15 14:49+0200\n" +"Last-Translator: \n" +"Language-Team: \n" +"Plural-Forms: nplurals=2; plural=(n != 1)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 1.3\n" + +msgid "{multiauth:multiauth:select_source_text}" +msgstr "" +"Umthombo wongqinisiso okhethiweyo uza kusetyenziswa ukukungqinisisa " +"nokuyila iseshoni esebenzayo." + +msgid "{multiauth:multiauth:select_source_header}" +msgstr "Khetha umthombo wongqinisiso" + diff --git a/vendor/simplesamlphp/simplesamlphp/modules/multiauth/locales/zu/LC_MESSAGES/multiauth.po b/vendor/simplesamlphp/simplesamlphp/modules/multiauth/locales/zu/LC_MESSAGES/multiauth.po new file mode 100644 index 0000000000..6f935b4e6b --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/modules/multiauth/locales/zu/LC_MESSAGES/multiauth.po @@ -0,0 +1,24 @@ + +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: SimpleSAMLphp 1.15\n" +"Report-Msgid-Bugs-To: simplesamlphp-translation@googlegroups.com\n" +"POT-Creation-Date: 2018-11-15 14:49+0200\n" +"PO-Revision-Date: 2018-11-15 14:49+0200\n" +"Last-Translator: \n" +"Language-Team: \n" +"Plural-Forms: nplurals=2; plural=(n != 1)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 1.3\n" + +msgid "{multiauth:multiauth:select_source_text}" +msgstr "" +"Umthombo wokuqinisekisa okhethiwe uzosetshenziswa ukuze uqinisekiswe " +"futhi kwakhiwe iseshini esebenzayo." + +msgid "{multiauth:multiauth:select_source_header}" +msgstr "Khetha umthombo wokuqinisekisa" + diff --git a/vendor/simplesamlphp/simplesamlphp/modules/multiauth/templates/selectsource.php b/vendor/simplesamlphp/simplesamlphp/modules/multiauth/templates/selectsource.php index f5eaba07e7..294fcbc0c5 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/multiauth/templates/selectsource.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/multiauth/templates/selectsource.php @@ -1,6 +1,5 @@ <?php $this->data['header'] = $this->t('{multiauth:multiauth:select_source_header}'); - $this->includeAtTemplateBase('includes/header.php'); ?> @@ -9,23 +8,23 @@ <p><?php echo $this->t('{multiauth:multiauth:select_source_text}'); ?></p> <form action="<?php echo htmlentities($_SERVER['PHP_SELF']); ?>" method="get"> -<input type="hidden" name="AuthState" value="<?php echo htmlspecialchars($this->data['authstate']); ?>" /> -<ul> + <input type="hidden" name="AuthState" value="<?php echo htmlspecialchars($this->data['authstate']); ?>" /> + <ul> <?php -foreach($this->data['sources'] as $source) { - echo '<li class="' . htmlspecialchars($source['css_class']) . ' authsource">'; - if ($source['source'] === $this->data['preferred']) { - $autofocus = ' autofocus="autofocus"'; - } else { - $autofocus = ''; - } - $name = 'src-' . base64_encode($source['source']); - echo '<input type="submit" name="' . htmlspecialchars($name) . '"' . $autofocus . ' ' . - 'id="button-' . htmlspecialchars($source['source']) . '" ' . - 'value="' . htmlspecialchars($this->t($source['text'])) . '" />'; - echo '</li>'; +foreach ($this->data['sources'] as $source) { + echo '<li class="'.htmlspecialchars($source['css_class']).' authsource">'; + if ($source['source'] === $this->data['preferred']) { + $autofocus = ' autofocus="autofocus"'; + } else { + $autofocus = ''; + } + $name = 'src-'.base64_encode($source['source']); + echo '<input type="submit" name="'.htmlspecialchars($name).'"'.$autofocus.' '. + 'id="button-'.htmlspecialchars($source['source']).'" '. + 'value="'.htmlspecialchars($this->t($source['text'])).'" />'; + echo '</li>'; } ?> -</ul> + </ul> </form> <?php $this->includeAtTemplateBase('includes/footer.php'); diff --git a/vendor/simplesamlphp/simplesamlphp/modules/multiauth/templates/selectsource.twig b/vendor/simplesamlphp/simplesamlphp/modules/multiauth/templates/selectsource.twig new file mode 100644 index 0000000000..5d1e3793e9 --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/modules/multiauth/templates/selectsource.twig @@ -0,0 +1,23 @@ +{% set pagetitle = '{multiauth:multiauth:select_source_header}'|trans %} +{% extends "base.twig" %} + +{% block content %} + <h2>{{ '{multiauth:multiauth:select_source_header}'| trans }}</h2> + <p>{{ '{multiauth:multiauth:select_source_text}'| trans }}</p> + + <form action="{{ selfUrl|escape('html') }}" method="get"> + <input type="hidden" name="AuthState" value="{{ authstate|escape('html') }} "> + <ul> + {% for key, source in sources %} + {% set name = ('src-' ~ source.source64) %} + {% set button = ('button-' ~ source.source) %} + <li class="{{ source.css_class|escape('html') }} authsource"> + <input type="submit" name="{{ name|escape('html') }}" id="{{ button|escape('html') }}" value="{{ source.text|escape('html') }}"{%- if source.source == preferred %} autofocus{% endif -%}> + {% if source.help %} + <p>{{ source.help|escape('html') }}</p> + {% endif %} + </li> + {% endfor %} + </ul> + </form> +{% endblock %} diff --git a/vendor/simplesamlphp/simplesamlphp/modules/multiauth/www/selectsource.php b/vendor/simplesamlphp/simplesamlphp/modules/multiauth/www/selectsource.php index db09029f89..287f7808ea 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/multiauth/www/selectsource.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/multiauth/www/selectsource.php @@ -3,7 +3,7 @@ /** * This page shows a list of authentication sources. When the user selects * one of them if pass this information to the - * sspmod_multiauth_Auth_Source_MultiAuth class and call the + * \SimpleSAML\Module\multiauth\Auth\Source\MultiAuth class and call the * delegateAuthentication method on it. * * @author Lorenzo Gil, Yaco Sistemas S.L. @@ -12,49 +12,71 @@ // Retrieve the authentication state if (!array_key_exists('AuthState', $_REQUEST)) { - throw new SimpleSAML_Error_BadRequest('Missing AuthState parameter.'); + throw new \SimpleSAML\Error\BadRequest('Missing AuthState parameter.'); } $authStateId = $_REQUEST['AuthState']; -$state = SimpleSAML_Auth_State::loadState($authStateId, sspmod_multiauth_Auth_Source_MultiAuth::STAGEID); +$state = \SimpleSAML\Auth\State::loadState($authStateId, \SimpleSAML\Module\multiauth\Auth\Source\MultiAuth::STAGEID); -if (array_key_exists("SimpleSAML_Auth_Source.id", $state)) { - $authId = $state["SimpleSAML_Auth_Source.id"]; - $as = SimpleSAML_Auth_Source::getById($authId); +if (array_key_exists("\SimpleSAML\Auth\Source.id", $state)) { + $authId = $state["\SimpleSAML\Auth\Source.id"]; + $as = \SimpleSAML\Auth\Source::getById($authId); } else { - $as = NULL; + $as = null; } -$source = NULL; +$source = null; if (array_key_exists('source', $_REQUEST)) { - $source = $_REQUEST['source']; + $source = $_REQUEST['source']; } else { - foreach ($_REQUEST as $k => $v) { - $k = explode('-', $k, 2); - if (count($k) === 2 && $k[0] === 'src') { - $source = base64_decode($k[1]); - } - } + foreach ($_REQUEST as $k => $v) { + $k = explode('-', $k, 2); + if (count($k) === 2 && $k[0] === 'src') { + $source = base64_decode($k[1]); + } + } } -if ($source !== NULL) { - if ($as !== NULL) { - $as->setPreviousSource($source); - } - sspmod_multiauth_Auth_Source_MultiAuth::delegateAuthentication($source, $state); +if ($source !== null) { + if ($as !== null) { + $as->setPreviousSource($source); + } + \SimpleSAML\Module\multiauth\Auth\Source\MultiAuth::delegateAuthentication($source, $state); } if (array_key_exists('multiauth:preselect', $state)) { - $source = $state['multiauth:preselect']; - sspmod_multiauth_Auth_Source_MultiAuth::delegateAuthentication($source, $state); + $source = $state['multiauth:preselect']; + \SimpleSAML\Module\multiauth\Auth\Source\MultiAuth::delegateAuthentication($source, $state); +} + +$globalConfig = \SimpleSAML\Configuration::getInstance(); +$t = new \SimpleSAML\XHTML\Template($globalConfig, 'multiauth:selectsource.php'); + +$defaultLanguage = $globalConfig->getString('language.default', 'en'); +$language = $t->getTranslator()->getLanguage()->getLanguage(); + +$sources = $state[\SimpleSAML\Module\multiauth\Auth\Source\MultiAuth::SOURCESID]; +foreach ($sources as $key => $source) { + $sources[$key]['source64'] = base64_encode($sources[$key]['source']); + if (isset($sources[$key]['text'][$language])) { + $sources[$key]['text'] = $sources[$key]['text'][$language]; + } else { + $sources[$key]['text'] = $sources[$key]['text'][$defaultLanguage]; + } + + if (isset($sources[$key]['help'][$language])) { + $sources[$key]['help'] = $sources[$key]['help'][$language]; + } else { + $sources[$key]['help'] = $sources[$key]['help'][$defaultLanguage]; + } } -$globalConfig = SimpleSAML_Configuration::getInstance(); -$t = new SimpleSAML_XHTML_Template($globalConfig, 'multiauth:selectsource.php'); $t->data['authstate'] = $authStateId; -$t->data['sources'] = $state[sspmod_multiauth_Auth_Source_MultiAuth::SOURCESID]; -if ($as !== NULL) { - $t->data['preferred'] = $as->getPreviousSource(); +$t->data['sources'] = $sources; +$t->data['selfUrl'] = $_SERVER['PHP_SELF']; + +if ($as !== null) { + $t->data['preferred'] = $as->getPreviousSource(); } else { - $t->data['preferred'] = NULL; + $t->data['preferred'] = null; } $t->show(); exit(); diff --git a/vendor/simplesamlphp/simplesamlphp/modules/negotiate/docs/negotiate.md b/vendor/simplesamlphp/simplesamlphp/modules/negotiate/docs/negotiate.md index a57044de9b..8563b338d3 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/negotiate/docs/negotiate.md +++ b/vendor/simplesamlphp/simplesamlphp/modules/negotiate/docs/negotiate.md @@ -51,7 +51,7 @@ client. All configuration is handled in authsources.php: - 'weblogin' => array( + 'weblogin' => [ 'negotiate:Negotiate', 'keytab' => '/path/to/keytab-file', 'fallback' => 'ldap', @@ -59,19 +59,18 @@ All configuration is handled in authsources.php: 'base' => 'cn=people,dc=example,dc=com', 'adminUser' => 'cn=idp-fallback,cn=services,dc=example,dc=com', 'adminPassword' => 'VerySecretPassphraseHush' - ), - 'ldap' => array( + ], + 'ldap' => [ 'ldap:LDAP', 'hostname' => 'ldap.example.com', 'enable_tls' => TRUE, 'dnpattern' => 'uid=%username%,cn=people,dc=example,dc=com', 'search.enable' => FALSE - ), + ], -`php_krb5` -++++++++++ +### `php_krb5` The processing involving the actual Kerberos ticket handling is done by php_krb5. The package is not yet labeled stable but has worked well @@ -80,7 +79,7 @@ during testing. NOTE! php_krb5 hardcodes the service name in the keytab file to 'HTTP' as of php_krb5-1.0rc2. To change this you need to edit the module code. Be wary of how much space is allocated to the string in -negotiate_auth.c:101. +`negotiate_auth.c:101`. Depending on you apache config you may need a rewrite rule to allow php_krb5 to read the HTTP_AUTHORIZATION header: @@ -94,40 +93,38 @@ Test the Kerberos setup with the following script: <?php if(!extension_loaded('krb5')) { - die('KRB5 Extension not installed'); + die('KRB5 Extension not installed'); } if(!empty($_SERVER['HTTP_AUTHORIZATION'])) { - list($mech, $data) = explode(' ', $_SERVER['HTTP_AUTHORIZATION']); - if(strtolower($mech) == 'basic') { - echo "Client sent basic"; - die('Unsupported request'); - } else if(strtolower($mech) != 'negotiate') { - echo "Couldn't find negotiate"; - die('Unsupported request'); - } - $auth = new KRB5NegotiateAuth('/path/to/keytab'); - $reply = ''; - if($reply = $auth->doAuthentication()) { - header('HTTP/1.1 200 Success'); - echo 'Success - authenticated as ' . $auth->getAuthenticatedUser() . '<br>'; - } else { - echo 'Failed to authN.'; - die(); - } + list($mech, $data) = explode(' ', $_SERVER['HTTP_AUTHORIZATION']); + if(strtolower($mech) == 'basic') { + echo "Client sent basic"; + die('Unsupported request'); + } else if(strtolower($mech) != 'negotiate') { + echo "Couldn't find negotiate"; + die('Unsupported request'); + } + $auth = new KRB5NegotiateAuth('/path/to/keytab'); + $reply = ''; + if($reply = $auth->doAuthentication()) { + header('HTTP/1.1 200 Success'); + echo 'Success - authenticated as ' . $auth->getAuthenticatedUser() . '<br>'; + } else { + echo 'Failed to authN.'; + die(); + } } else { - header('HTTP/1.1 401 Unauthorized'); - header('WWW-Authenticate: Negotiate',false); - echo 'Not authenticated. No HTTP_AUTHORIZATION available.'; - echo 'Check headers sent by the browser and verify that '; - echo 'apache passes them to PHP'; + header('HTTP/1.1 401 Unauthorized'); + header('WWW-Authenticate: Negotiate',false); + echo 'Not authenticated. No HTTP_AUTHORIZATION available.'; + echo 'Check headers sent by the browser and verify that '; + echo 'apache passes them to PHP'; } - ?> -`LDAP` -++++++ +### LDAP LDAP is used to verify the user due to the lack of metadata in Kerberos. A domain can contain lots of kiosk users, non-personal @@ -146,15 +143,14 @@ be a DN to an object with access to search for all relevant user objects and to look up attributes needed by the SP. -`Subnet filtering` -++++++++++++++++++ +### Subnet filtering Subnet is meant to filter which clients you subject to the WWW-Authenticate request. Syntax is: - 'subnet' => array('127.0.0.0/16','192.168.0.0/16'), + 'subnet' => [ '127.0.0.0/16','192.168.0.0/16' ], Browsers, especially IE, behave erratically when they encounter a WWW-Authenticate from the webserver. Included in RFC4559 Negotiate is @@ -167,18 +163,16 @@ currently in the domain should be the only ones that are promted with WWW-Authenticate: Negotiate. -`Enabling/disabling Negotiate from a web browser` -+++++++++++++++++++++++++++++++++++++++++++++++++ +### Enabling/disabling Negotiate from a web browser Included in Negotiate are semi-static web pages for enabling and -disabling Negotiate for any given client. The pages simple set/deletes +disabling Negotiate for any given client. The pages simplly set/delete a cookie that Negotiate will look for when a client attempts AuthN. The help text in the JSON files should be locally overwritten to fully explain which clients are accepted by Negotiate. -`Logout/Login loop and reauthenticating` -++++++++++++++++++++++++++++++++++++++++ +### Logout/Login loop and reauthenticating Due to the automatic AuthN of certain clients and how SPs will automatically redirect clients to the IdP when clients try to access @@ -188,50 +182,51 @@ out user. The consequence of this is that the user will be presented with the login mechanism of the fallback module specified in Negotiate config. -SimpleSamlPhp offers no decent way of adding hooks or piggyback this +SimpleSamlPHP offers no decent way of adding hooks or piggyback this information to the fallback module. In future releases one might add a box of information to the user explaining what's happening. One can add this bit of code to the template in the fallback AuthN module: -// This should be placed in your www script -$nego_session = FALSE; -$nego_perm = FALSE; -$nego_retry = NULL; -if (array_key_exists('negotiate:authId', $state)) { - $nego = SimpleSAML_Auth_Source::getById($state['negotiate:authId']); - $mask = $nego->checkMask(); - $disabled = $nego->spDisabledInMetadata($spMetadata); - $session_disabled = $session->getData('negotiate:disable', 'session'); - if ($mask and !$disabled) { - if(array_key_exists('NEGOTIATE_AUTOLOGIN_DISABLE_PERMANENT', $_COOKIE) && - $_COOKIE['NEGOTIATE_AUTOLOGIN_DISABLE_PERMANENT'] == 'True') { - $nego_perm = TRUE; - } elseif ($session_disabled) { - $retryState = SimpleSAML_Auth_State::cloneState($state); - unset($retryState[SimpleSAML_Auth_State::ID]); - $nego_retry = SimpleSAML_Auth_State::saveState($retryState, 'sspmod_negotiate_Auth_Source_Negotiate.StageId'); - $nego_session = TRUE; + // This should be placed in your www script + $nego_session = false; + $nego_perm = false; + $nego_retry = null; + if (array_key_exists('negotiate:authId', $state)) { + $nego = \SimpleSAML\Auth\Source::getById($state['negotiate:authId']); + $mask = $nego->checkMask(); + $disabled = $nego->spDisabledInMetadata($spMetadata); + $session_disabled = $session->getData('negotiate:disable', 'session'); + if ($mask and !$disabled) { + if(array_key_exists('NEGOTIATE_AUTOLOGIN_DISABLE_PERMANENT', $_COOKIE) && + $_COOKIE['NEGOTIATE_AUTOLOGIN_DISABLE_PERMANENT'] == 'True') { + $nego_perm = true; + } elseif ($session_disabled) { + $retryState = \SimpleSAML\Auth\State::cloneState($state); + unset($retryState[\SimpleSAML\Auth\State::ID]); + $nego_retry = \SimpleSAML\Auth\State::saveState($retryState, '\SimpleSAML\Module\negotiate\Auth\Source\Negotiate.StageId'); + $nego_session = true; + } } } -} - -// This should reside in your template -if($this->data['nego']['disable_perm']) { - echo '<span id="login-extra-info-uio.no" class="login-extra-info">' - . '<span class="login-extra-info-divider"></span>' - . $this->t('{feide:login:login_uio_negotiate_disabled_permanent_info}') - . '</span>'; -} elseif($this->data['nego']['disable_session']) { - echo '<span id="login-extra-info-uio.no" class="login-extra-info">' - . '<span class="login-extra-info-divider"></span>' - . $this->t('{feide:login:login_uio_negotiate_disabled_session_info}') - . '<br><a href="'.SimpleSAML\Module::getModuleURL('negotiate/retry.php', array('AuthState' => $this->data['nego']['retry_id'])).'">' - . $this->t('{feide:login:login_uio_negotiate_disabled_session_info_link}') - . '</a>' - . '</span>'; -} + + // This should reside in your template + if($this->data['nego']['disable_perm']) { + echo '<span id="login-extra-info-uio.no" class="login-extra-info">' + . '<span class="login-extra-info-divider"></span>' + . $this->t('{feide:login:login_uio_negotiate_disabled_permanent_info}') + . '</span>'; + } elseif($this->data['nego']['disable_session']) { + echo '<span id="login-extra-info-uio.no" class="login-extra-info">' + . '<span class="login-extra-info-divider"></span>' + . $this->t('{feide:login:login_uio_negotiate_disabled_session_info}') + . '<br><a href="'.SimpleSAML\Module::getModuleURL('negotiate/retry.php', [ 'AuthState' => $this->data['nego']['retry_id'] ]).'">' + . $this->t('{feide:login:login_uio_negotiate_disabled_session_info_link}') + . '</a>' + . '</span>'; + } + The above may or may not work right out of the box for you but it is the gist of it. By looking at the state variable, cookie and checking @@ -247,33 +242,35 @@ security check in SSP's state handling library. If you omit this and pass on the original state you will see a warning in the log like this: - Sep 27 13:47:36 simplesamlphp WARNING [b99e6131ee] Wrong stage in state. Was 'foo', should be 'sspmod_negotiate_Auth_Source_Negotiate.StageId'. + Sep 27 13:47:36 simplesamlphp WARNING [b99e6131ee] Wrong stage in state. Was 'foo', should be '\SimpleSAML\Module\negotiate\Auth\Source\Negotiate.StageId'. It will work as loadState will take controll and call Negotiate->authenticate() but remaining code in retry.php will be discarded. Other side-effects may occur. -`Clients` -+++++++++ +### Clients -* Internet Explorer +#### Internet Explorer YMMV but generally you need to have your IdP defined in "Internet Options" -> "Security" -> "Local intranet" -> "Sites" -> "Advanced". You also need "Internet Options" -> "Advanced" -> "Security" -> Enable Integrated Windows Authentication" enabled. -* Firefox +#### Firefox Open "about:config". Locate "network.auth.use-sspi" and verify that this is true (on a Windows machine). Next locate "network.negotiate-auth.trusted-uris" and insert your IdP. -* Safari +#### Safari TODO -* Chrome +#### Chromium + +To allow Kerberos SPN generation on Linux-based platforms, add the +following line to /etc/chromium.d/default-flags: + export CHROMIUM_FLAGS="$CHROMIUM_FLAGS --auth-server-whitelist=.example.com" -TODO diff --git a/vendor/simplesamlphp/simplesamlphp/modules/negotiate/lib/Auth/Source/Negotiate.php b/vendor/simplesamlphp/simplesamlphp/modules/negotiate/lib/Auth/Source/Negotiate.php index a22630276f..bba08d6bbd 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/negotiate/lib/Auth/Source/Negotiate.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/negotiate/lib/Auth/Source/Negotiate.php @@ -1,5 +1,8 @@ <?php +namespace SimpleSAML\Module\negotiate\Auth\Source; + +use \SimpleSAML\Logger; /** * The Negotiate module. Allows for password-less, secure login by Kerberos and Negotiate. @@ -7,11 +10,11 @@ * @author Mathias Meisfjordskar, University of Oslo <mathias.meisfjordskar@usit.uio.no> * @package SimpleSAMLphp */ -class sspmod_negotiate_Auth_Source_Negotiate extends SimpleSAML_Auth_Source -{ +class Negotiate extends \SimpleSAML\Auth\Source +{ // Constants used in the module - const STAGEID = 'sspmod_negotiate_Auth_Source_Negotiate.StageId'; + const STAGEID = '\SimpleSAML\Module\negotiate\Auth\Source\Negotiate.StageId'; protected $ldap = null; protected $backend = ''; @@ -22,8 +25,8 @@ class sspmod_negotiate_Auth_Source_Negotiate extends SimpleSAML_Auth_Source protected $debugLDAP = false; protected $timeout = 30; protected $keytab = ''; - protected $base = array(); - protected $attr = 'uid'; + protected $base = []; + protected $attr = ['uid']; protected $subnet = null; protected $admin_user = null; protected $admin_pw = null; @@ -40,17 +43,16 @@ class sspmod_negotiate_Auth_Source_Negotiate extends SimpleSAML_Auth_Source */ public function __construct($info, $config) { - assert('is_array($info)'); - assert('is_array($config)'); + assert(is_array($info)); + assert(is_array($config)); if (!extension_loaded('krb5')) { - throw new Exception('KRB5 Extension not installed'); + throw new \Exception('KRB5 Extension not installed'); } - // call the parent constructor first, as required by the interface parent::__construct($info, $config); - $config = SimpleSAML_Configuration::loadFromArray($config); + $config = \SimpleSAML\Configuration::loadFromArray($config); $this->backend = $config->getString('fallback'); $this->hostname = $config->getString('hostname'); @@ -59,9 +61,9 @@ public function __construct($info, $config) $this->enableTLS = $config->getBoolean('enable_tls', false); $this->debugLDAP = $config->getBoolean('debugLDAP', false); $this->timeout = $config->getInteger('timeout', 30); - $this->keytab = $config->getString('keytab'); + $this->keytab = \SimpleSAML\Utils\Config::getCertPath($config->getString('keytab')); $this->base = $config->getArrayizeString('base'); - $this->attr = $config->getString('attr', 'uid'); + $this->attr = $config->getArrayizeString('attr', 'uid'); $this->subnet = $config->getArray('subnet', null); $this->admin_user = $config->getString('adminUser', null); $this->admin_pw = $config->getString('adminPassword', null); @@ -82,12 +84,12 @@ public function __construct($info, $config) */ public function authenticate(&$state) { - assert('is_array($state)'); + assert(is_array($state)); // set the default backend to config - $state['LogoutState'] = array( + $state['LogoutState'] = [ 'negotiate:backend' => $this->backend, - ); + ]; $state['negotiate:authId'] = $this->authId; @@ -97,29 +99,29 @@ public function authenticate(&$state) } /* Go straight to fallback if Negotiate is disabled or if you are sent back to the IdP directly from the SP after having logged out. */ - $session = SimpleSAML_Session::getSessionFromRequest(); + $session = \SimpleSAML\Session::getSessionFromRequest(); $disabled = $session->getData('negotiate:disable', 'session'); if ($disabled || (!empty($_COOKIE['NEGOTIATE_AUTOLOGIN_DISABLE_PERMANENT']) && $_COOKIE['NEGOTIATE_AUTOLOGIN_DISABLE_PERMANENT'] == 'True') ) { - SimpleSAML\Logger::debug('Negotiate - session disabled. falling back'); + Logger::debug('Negotiate - session disabled. falling back'); $this->fallBack($state); // never executed - assert('FALSE'); + assert(false); } $mask = $this->checkMask(); if (!$mask) { $this->fallBack($state); // never executed - assert('FALSE'); + assert(false); } - SimpleSAML\Logger::debug('Negotiate - authenticate(): looking for Negotiate'); + Logger::debug('Negotiate - authenticate(): looking for Negotiate'); if (!empty($_SERVER['HTTP_AUTHORIZATION'])) { - SimpleSAML\Logger::debug('Negotiate - authenticate(): Negotiate found'); - $this->ldap = new SimpleSAML_Auth_LDAP( + Logger::debug('Negotiate - authenticate(): Negotiate found'); + $this->ldap = new \SimpleSAML\Auth\LDAP( $this->hostname, $this->enableTLS, $this->debugLDAP, @@ -128,61 +130,60 @@ public function authenticate(&$state) $this->referrals ); - list($mech, $data) = explode(' ', $_SERVER['HTTP_AUTHORIZATION'], 2); + list($mech,) = explode(' ', $_SERVER['HTTP_AUTHORIZATION'], 2); if (strtolower($mech) == 'basic') { - SimpleSAML\Logger::debug('Negotiate - authenticate(): Basic found. Skipping.'); + Logger::debug('Negotiate - authenticate(): Basic found. Skipping.'); } else { if (strtolower($mech) != 'negotiate') { - SimpleSAML\Logger::debug('Negotiate - authenticate(): No "Negotiate" found. Skipping.'); + Logger::debug('Negotiate - authenticate(): No "Negotiate" found. Skipping.'); } } - $auth = new KRB5NegotiateAuth($this->keytab); + $auth = new \KRB5NegotiateAuth($this->keytab); // attempt Kerberos authentication try { $reply = $auth->doAuthentication(); - } catch (Exception $e) { - SimpleSAML\Logger::error('Negotiate - authenticate(): doAuthentication() exception: '.$e->getMessage()); + } catch (\Exception $e) { + Logger::error('Negotiate - authenticate(): doAuthentication() exception: '.$e->getMessage()); $reply = null; } if ($reply) { // success! krb TGS received $user = $auth->getAuthenticatedUser(); - SimpleSAML\Logger::info('Negotiate - authenticate(): '.$user.' authenticated.'); + Logger::info('Negotiate - authenticate(): '.$user.' authenticated.'); $lookup = $this->lookupUserData($user); if ($lookup !== null) { $state['Attributes'] = $lookup; // Override the backend so logout will know what to look for - $state['LogoutState'] = array( + $state['LogoutState'] = [ 'negotiate:backend' => null, - ); - SimpleSAML\Logger::info('Negotiate - authenticate(): '.$user.' authorized.'); - SimpleSAML_Auth_Source::completeAuth($state); + ]; + Logger::info('Negotiate - authenticate(): '.$user.' authorized.'); + \SimpleSAML\Auth\Source::completeAuth($state); // Never reached. - assert('FALSE'); + assert(false); } } else { - // Some error in the recieved ticket. Expired? - SimpleSAML\Logger::info('Negotiate - authenticate(): Kerberos authN failed. Skipping.'); + // Some error in the received ticket. Expired? + Logger::info('Negotiate - authenticate(): Kerberos authN failed. Skipping.'); } } else { // No auth token. Send it. - SimpleSAML\Logger::debug('Negotiate - authenticate(): Sending Negotiate.'); + Logger::debug('Negotiate - authenticate(): Sending Negotiate.'); // Save the $state array, so that we can restore if after a redirect - SimpleSAML\Logger::debug('Negotiate - fallback: '.$state['LogoutState']['negotiate:backend']); - $id = SimpleSAML_Auth_State::saveState($state, self::STAGEID); - $params = array('AuthState' => $id); + Logger::debug('Negotiate - fallback: '.$state['LogoutState']['negotiate:backend']); + $id = \SimpleSAML\Auth\State::saveState($state, self::STAGEID); + $params = ['AuthState' => $id]; $this->sendNegotiate($params); exit; } - SimpleSAML\Logger::info('Negotiate - authenticate(): Client failed Negotiate. Falling back'); + Logger::info('Negotiate - authenticate(): Client failed Negotiate. Falling back'); $this->fallBack($state); - /* The previous function never returns, so this code is never - executed */ - assert('FALSE'); + // The previous function never returns, so this code is never executed + assert(false); } @@ -190,13 +191,13 @@ public function spDisabledInMetadata($spMetadata) { if (array_key_exists('negotiate:disable', $spMetadata)) { if ($spMetadata['negotiate:disable'] == true) { - SimpleSAML\Logger::debug('Negotiate - SP disabled. falling back'); + Logger::debug('Negotiate - SP disabled. falling back'); return true; } else { - SimpleSAML\Logger::debug('Negotiate - SP disable flag found but set to FALSE'); + Logger::debug('Negotiate - SP disable flag found but set to FALSE'); } } else { - SimpleSAML\Logger::debug('Negotiate - SP disable flag not found'); + Logger::debug('Negotiate - SP disable flag not found'); } return false; } @@ -218,13 +219,13 @@ public function checkMask() } $ip = $_SERVER['REMOTE_ADDR']; foreach ($this->subnet as $cidr) { - $ret = SimpleSAML\Utils\Net::ipCIDRcheck($cidr); + $ret = \SimpleSAML\Utils\Net::ipCIDRcheck($cidr); if ($ret) { - SimpleSAML\Logger::debug('Negotiate: Client "'.$ip.'" matched subnet.'); + Logger::debug('Negotiate: Client "'.$ip.'" matched subnet.'); return true; } } - SimpleSAML\Logger::debug('Negotiate: Client "'.$ip.'" did not match subnet.'); + Logger::debug('Negotiate: Client "'.$ip.'" did not match subnet.'); return false; } @@ -237,53 +238,48 @@ public function checkMask() */ protected function sendNegotiate($params) { - $url = htmlspecialchars(SimpleSAML\Module::getModuleURL('negotiate/backend.php', $params)); - $json_url = json_encode($url); + $config = \SimpleSAML\Configuration::getInstance(); + + $url = htmlspecialchars(\SimpleSAML\Module::getModuleURL('negotiate/backend.php', $params)); header('HTTP/1.1 401 Unauthorized'); header('WWW-Authenticate: Negotiate', false); - echo <<<EOF -<html> - <head> - <script type="text/javascript">window.location = $json_url</script> - <title>Redirect to login</title> - </head> -<body> - <p>Your browser seems to have Javascript disabled. Please click <a href="$url">here</a>.</p> -</body> -</html> -EOF; + + $t = new \SimpleSAML\XHTML\Template($config, 'negotiate:redirect.php'); + $t->data['baseurlpath'] = \SimpleSAML\Module::getModuleURL('negotiate'); + $t->data['url'] = $url; + $t->show(); } /** * Passes control of the login process to a different module. * - * @param string $state Information about the current authentication. + * @param array $state Information about the current authentication. * - * @throws SimpleSAML_Error_Error If couldn't determine the auth source. - * @throws SimpleSAML_Error_Exception - * @throws Exception + * @throws \SimpleSAML\Error\Error If couldn't determine the auth source. + * @throws \SimpleSAML\Error\Exception + * @throws \Exception */ public static function fallBack(&$state) { $authId = $state['LogoutState']['negotiate:backend']; if ($authId === null) { - throw new SimpleSAML_Error_Error(500, "Unable to determine auth source."); + throw new \SimpleSAML\Error\Error([500, "Unable to determine auth source."]); } - $source = SimpleSAML_Auth_Source::getById($authId); + $source = \SimpleSAML\Auth\Source::getById($authId); try { $source->authenticate($state); - } catch (SimpleSAML_Error_Exception $e) { - SimpleSAML_Auth_State::throwException($state, $e); - } catch (Exception $e) { - $e = new SimpleSAML_Error_UnserializableException($e); - SimpleSAML_Auth_State::throwException($state, $e); + } catch (\SimpleSAML\Error\Exception $e) { + \SimpleSAML\Auth\State::throwException($state, $e); + } catch (\Exception $e) { + $e = new \SimpleSAML\Error\UnserializableException($e); + \SimpleSAML\Auth\State::throwException($state, $e); } // fallBack never returns after loginCompleted() - SimpleSAML\Logger::debug('Negotiate: backend returned'); + Logger::debug('Negotiate: backend returned'); self::loginCompleted($state); } @@ -309,8 +305,8 @@ protected function lookupUserData($user) try { $dn = $this->ldap->searchfordn($this->base, $this->attr, $uid); return $this->ldap->getAttributes($dn, $this->attributes); - } catch (SimpleSAML_Error_Exception $e) { - SimpleSAML\Logger::debug('Negotiate - ldap lookup failed: '.$e); + } catch (\SimpleSAML\Error\Exception $e) { + Logger::debug('Negotiate - ldap lookup failed: '.$e); return null; } } @@ -326,14 +322,12 @@ protected function adminBind() // no admin user return; } - SimpleSAML\Logger::debug( - 'Negotiate - authenticate(): Binding as system user '.var_export($this->admin_user, true) - ); + Logger::debug('Negotiate - authenticate(): Binding as system user '.var_export($this->admin_user, true)); if (!$this->ldap->bind($this->admin_user, $this->admin_pw)) { $msg = 'Unable to authenticate system user (LDAP_INVALID_CREDENTIALS) '.var_export($this->admin_user, true); - SimpleSAML\Logger::error('Negotiate - authenticate(): '.$msg); - throw new SimpleSAML_Error_AuthSource('negotiate', $msg); + Logger::error('Negotiate - authenticate(): '.$msg); + throw new \SimpleSAML\Error\AuthSource('negotiate', $msg); } } @@ -348,17 +342,17 @@ protected function adminBind() */ public function logout(&$state) { - assert('is_array($state)'); + assert(is_array($state)); // get the source that was used to authenticate $authId = $state['negotiate:backend']; - SimpleSAML\Logger::debug('Negotiate - logout has the following authId: "'.$authId.'"'); + Logger::debug('Negotiate - logout has the following authId: "'.$authId.'"'); if ($authId === null) { - $session = SimpleSAML_Session::getSessionFromRequest(); + $session = \SimpleSAML\Session::getSessionFromRequest(); $session->setData('negotiate:disable', 'session', true, 24 * 60 * 60); parent::logout($state); } else { - $source = SimpleSAML_Auth_Source::getById($authId); + $source = \SimpleSAML\Auth\Source::getById($authId); $source->logout($state); } } diff --git a/vendor/simplesamlphp/simplesamlphp/modules/negotiate/locales/af/LC_MESSAGES/negotiate.po b/vendor/simplesamlphp/simplesamlphp/modules/negotiate/locales/af/LC_MESSAGES/negotiate.po index 9976b2b2fb..bfbdf2194b 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/negotiate/locales/af/LC_MESSAGES/negotiate.po +++ b/vendor/simplesamlphp/simplesamlphp/modules/negotiate/locales/af/LC_MESSAGES/negotiate.po @@ -34,13 +34,13 @@ msgid "{negotiate:negotiate:disable_info_pre}" msgstr "" "<p> Deur toegang te verkry tot die bladsy het jy outomatiese aanmelding " "vermoë afgeskakel vir die webblaaier.</p> <p> Om dit weer te aktiveer " -"besoek <a href='URL'> hierdie bladsy </a>. </p>" +"besoek <a href='%URL%'> hierdie bladsy </a>. </p>" msgid "{negotiate:negotiate:enable_info_pre}" msgstr "" "<p> Deur toegang te verkry tot die bladsy het jy outomatiese aanmelding " "vermoë aangeskakel vir die webblaaier.</p> <p> Om dit weer te deaktiveer " -"besoek <a href='URL'> hierdie bladsy </a>. </p>" +"besoek <a href='%URL%'> hierdie bladsy </a>. </p>" msgid "" "<h3>What is automatic login</h3><p>Automatic login allows you to log in " diff --git a/vendor/simplesamlphp/simplesamlphp/modules/negotiate/locales/ar/LC_MESSAGES/negotiate.po b/vendor/simplesamlphp/simplesamlphp/modules/negotiate/locales/ar/LC_MESSAGES/negotiate.po index 18ed6f13d1..91af8a473c 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/negotiate/locales/ar/LC_MESSAGES/negotiate.po +++ b/vendor/simplesamlphp/simplesamlphp/modules/negotiate/locales/ar/LC_MESSAGES/negotiate.po @@ -34,13 +34,13 @@ msgstr "لقد تم تفعيل خاصية الدخول التلقائي في ه msgid "{negotiate:negotiate:disable_info_pre}" msgstr "" "<p>بدخولك على هذه الصفحة, فقد قمت بإيقاف خاصية الدخول التلقائي من " -"المتصفح.</p><p>لإعادة تشغيلها مرة أخرى قم بزيارة <a href='URL'>هذه " +"المتصفح.</p><p>لإعادة تشغيلها مرة أخرى قم بزيارة <a href='%URL%'>هذه " "الصفحة</a>.</p>" msgid "{negotiate:negotiate:enable_info_pre}" msgstr "" "<p>بدخولك على هذه الصفحة, فقد قمت بتفعيل خاصية الدخول التلقائي من " -"المتصفح.</p><p>لإعادة إيقافها مرة أخرى قم بزيارة <a href='URL'>هذه " +"المتصفح.</p><p>لإعادة إيقافها مرة أخرى قم بزيارة <a href='%URL%'>هذه " "الصفحة</a>.</p>" msgid "" @@ -75,9 +75,9 @@ msgstr "لقد تم تفعيل خاصية الدخول التلقائي في ه msgid "" "<p>By accessing this page, you have turned off the ability to use " "automatic login for this browser.</p><p>To turn it on again, please visit" -" <a href='URL'>this page</a>.</p>" +" <a href='%URL%'>this page</a>.</p>" msgstr "" "<p>بدخولك على هذه الصفحة, فقد قمت بإيقاف خاصية الدخول التلقائي من " -"المتصفح.</p><p>لإعادة تشغيلها مرة أخرى قم بزيارة <a href='URL'>هذه " +"المتصفح.</p><p>لإعادة تشغيلها مرة أخرى قم بزيارة <a href='%URL%'>هذه " "الصفحة</a>.</p>" diff --git a/vendor/simplesamlphp/simplesamlphp/modules/negotiate/locales/cs/LC_MESSAGES/negotiate.po b/vendor/simplesamlphp/simplesamlphp/modules/negotiate/locales/cs/LC_MESSAGES/negotiate.po index 219ad399b0..08a74a04b9 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/negotiate/locales/cs/LC_MESSAGES/negotiate.po +++ b/vendor/simplesamlphp/simplesamlphp/modules/negotiate/locales/cs/LC_MESSAGES/negotiate.po @@ -34,13 +34,13 @@ msgid "{negotiate:negotiate:disable_info_pre}" msgstr "" "<p>Přístupem na tuto stránku jste vypnuli možnost použít automatické " "přihlášení pro tento prohlížeč.</p><p>Pro její zapnutí, prosím, navštivte" -" <a href='URL'>tuto stránku</a>.</p>" +" <a href='%URL%'>tuto stránku</a>.</p>" msgid "{negotiate:negotiate:enable_info_pre}" msgstr "" "<p>Přístupem na tuto stránku jste zapnuli možnost použít automatické " "přihlášení pro tento prohlížeč.</p><p>Pro její vypnutí, prosím, navštivte" -" <a href='URL'>tuto stránku</a>.</p>" +" <a href='%URL%'>tuto stránku</a>.</p>" msgid "" "<h3>What is automatic login</h3><p>Automatic login allows you to log in " @@ -73,9 +73,9 @@ msgstr "Povolena možnost použití automatického přihlášení pro tento proh msgid "" "<p>By accessing this page, you have turned off the ability to use " "automatic login for this browser.</p><p>To turn it on again, please visit" -" <a href='URL'>this page</a>.</p>" +" <a href='%URL%'>this page</a>.</p>" msgstr "" "<p>Přístupem na tuto stránku jste vypnuli možnost použít automatické " "přihlášení pro tento prohlížeč.</p><p>Pro její zapnutí, prosím, navštivte" -" <a href='URL'>tuto stránku</a>.</p>" +" <a href='%URL%'>tuto stránku</a>.</p>" diff --git a/vendor/simplesamlphp/simplesamlphp/modules/negotiate/locales/da/LC_MESSAGES/negotiate.po b/vendor/simplesamlphp/simplesamlphp/modules/negotiate/locales/da/LC_MESSAGES/negotiate.po index 5d001ccda9..5bcc8fdbd0 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/negotiate/locales/da/LC_MESSAGES/negotiate.po +++ b/vendor/simplesamlphp/simplesamlphp/modules/negotiate/locales/da/LC_MESSAGES/negotiate.po @@ -34,13 +34,13 @@ msgid "{negotiate:negotiate:disable_info_pre}" msgstr "" "<p>Ved at tilgå denne side har du slået mulighed for automatisk login med" " denne browser fra.</p><p>For at slå muligheden til igen, besøg venligst " -"<a href='URL'>denne side</a>.</p>" +"<a href='%URL%'>denne side</a>.</p>" msgid "{negotiate:negotiate:enable_info_pre}" msgstr "" "<p>Ved at tilgå denne side har du slået mulighed for automatisk login med" " denne browser til.</p><p>For at slå muligheden fra igen, besøg venligst " -"<a href='URL'>denne side</a>.</p>" +"<a href='%URL%'>denne side</a>.</p>" msgid "" "<h3>What is automatic login</h3><p>Automatic login allows you to log in " @@ -59,11 +59,11 @@ msgstr "" msgid "" "<p>By accessing this page, you have turned on the ability to use " "automatic login for this browser.</p><p>To turn it off again, please " -"visit <a href='URL'>this page</a>.</p>" +"visit <a href='%URL%'>this page</a>.</p>" msgstr "" "<p>Ved at tilgå denne side har du slået mulighed for automatisk login med" " denne browser til.</p><p>For at slå muligheden fra igen, besøg venligst " -"<a href='URL'>denne side</a>.</p>" +"<a href='%URL%'>denne side</a>.</p>" msgid "Turned off ability to use automatic login for this browser" msgstr "Mulighed for automatisk login med denne browser er slået fra" @@ -74,9 +74,9 @@ msgstr "Mulighed for automatisk login med denne browser er slået til" msgid "" "<p>By accessing this page, you have turned off the ability to use " "automatic login for this browser.</p><p>To turn it on again, please visit" -" <a href='URL'>this page</a>.</p>" +" <a href='%URL%'>this page</a>.</p>" msgstr "" "<p>Ved at tilgå denne side har du slået mulighed for automatisk login med" " denne browser fra.</p><p>For at slå muligheden til igen, besøg venligst " -"<a href='URL'>denne side</a>.</p>" +"<a href='%URL%'>denne side</a>.</p>" diff --git a/vendor/simplesamlphp/simplesamlphp/modules/negotiate/locales/de/LC_MESSAGES/negotiate.po b/vendor/simplesamlphp/simplesamlphp/modules/negotiate/locales/de/LC_MESSAGES/negotiate.po index 1810f2e911..ada16b2038 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/negotiate/locales/de/LC_MESSAGES/negotiate.po +++ b/vendor/simplesamlphp/simplesamlphp/modules/negotiate/locales/de/LC_MESSAGES/negotiate.po @@ -34,13 +34,13 @@ msgid "{negotiate:negotiate:disable_info_pre}" msgstr "" "<p>Durch den Zugriff auf diese Seite haben Sie die automatische Anmeldung" " für diesen Browser ausgeschaltet.</p><p>Um sie wieder einzuschalten, " -"besuchen Sie bitte<a href='URL'>diese Seite</a>.</p>" +"besuchen Sie bitte<a href='%URL%'>diese Seite</a>.</p>" msgid "{negotiate:negotiate:enable_info_pre}" msgstr "" "<p>Durch den Zugriff auf diese Seite haben Sie die automatische Anmeldung" " für diesen Browser eingeschaltet.</p><p>Um sie wieder auszuschalten, " -"besuchen Sie bitte<a href='URL'>diese Seite</a>.</p>" +"besuchen Sie bitte<a href='%URL%'>diese Seite</a>.</p>" msgid "" "<h3>What is automatic login</h3><p>Automatic login allows you to log in " @@ -59,11 +59,11 @@ msgstr "" msgid "" "<p>By accessing this page, you have turned on the ability to use " "automatic login for this browser.</p><p>To turn it off again, please " -"visit <a href='URL'>this page</a>.</p>" +"visit <a href='%URL%'>this page</a>.</p>" msgstr "" "<p>Durch den Zugriff auf diese Seite haben Sie die automatische Anmeldung" " für diesen Browser eingeschaltet.</p><p>Um sie wieder auszuschalten, " -"besuchen Sie bitte<a href='URL'>diese Seite</a>.</p>" +"besuchen Sie bitte<a href='%URL%'>diese Seite</a>.</p>" msgid "Turned off ability to use automatic login for this browser" msgstr "Automatische Anmeldung für diesen Browser ausgeschaltet." @@ -74,9 +74,9 @@ msgstr "Automatische Anmeldung für diesen Browser eingeschaltet." msgid "" "<p>By accessing this page, you have turned off the ability to use " "automatic login for this browser.</p><p>To turn it on again, please visit" -" <a href='URL'>this page</a>.</p>" +" <a href='%URL%'>this page</a>.</p>" msgstr "" "<p>Durch den Zugriff auf diese Seite haben Sie die automatische Anmeldung" " für diesen Browser ausgeschaltet.</p><p>Um sie wieder einzuschalten, " -"besuchen Sie bitte<a href='URL'>diese Seite</a>.</p>" +"besuchen Sie bitte<a href='%URL%'>diese Seite</a>.</p>" diff --git a/vendor/simplesamlphp/simplesamlphp/modules/negotiate/locales/en/LC_MESSAGES/negotiate.po b/vendor/simplesamlphp/simplesamlphp/modules/negotiate/locales/en/LC_MESSAGES/negotiate.po index e15f012ff9..30a55b95e2 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/negotiate/locales/en/LC_MESSAGES/negotiate.po +++ b/vendor/simplesamlphp/simplesamlphp/modules/negotiate/locales/en/LC_MESSAGES/negotiate.po @@ -33,13 +33,13 @@ msgid "{negotiate:negotiate:disable_info_pre}" msgstr "" "<p>By accessing this page, you have turned off the ability to use " "automatic login for this browser.</p><p>To turn it on again, please visit" -" <a href='URL'>this page</a>.</p>" +" <a href='%URL%'>this page</a>.</p>" msgid "{negotiate:negotiate:enable_info_pre}" msgstr "" "<p>By accessing this page, you have turned on the ability to use " "automatic login for this browser.</p><p>To turn it off again, please " -"visit <a href='URL'>this page</a>.</p>" +"visit <a href='%URL%'>this page</a>.</p>" msgid "" "<h3>What is automatic login</h3><p>Automatic login allows you to log in " @@ -57,11 +57,11 @@ msgstr "" msgid "" "<p>By accessing this page, you have turned on the ability to use " "automatic login for this browser.</p><p>To turn it off again, please " -"visit <a href='URL'>this page</a>.</p>" +"visit <a href='%URL%'>this page</a>.</p>" msgstr "" "<p>By accessing this page, you have turned on the ability to use " "automatic login for this browser.</p><p>To turn it off again, please " -"visit <a href='URL'>this page</a>.</p>" +"visit <a href='%URL%'>this page</a>.</p>" msgid "Turned off ability to use automatic login for this browser" msgstr "Turned off ability to use automatic login for this browser" @@ -72,9 +72,9 @@ msgstr "Turned on the ability to use automatic login for this browser" msgid "" "<p>By accessing this page, you have turned off the ability to use " "automatic login for this browser.</p><p>To turn it on again, please visit" -" <a href='URL'>this page</a>.</p>" +" <a href='%URL%'>this page</a>.</p>" msgstr "" "<p>By accessing this page, you have turned off the ability to use " "automatic login for this browser.</p><p>To turn it on again, please visit" -" <a href='URL'>this page</a>.</p>" +" <a href='%URL%'>this page</a>.</p>" diff --git a/vendor/simplesamlphp/simplesamlphp/modules/negotiate/locales/es/LC_MESSAGES/negotiate.po b/vendor/simplesamlphp/simplesamlphp/modules/negotiate/locales/es/LC_MESSAGES/negotiate.po index 4e403dbabc..8224dfb0db 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/negotiate/locales/es/LC_MESSAGES/negotiate.po +++ b/vendor/simplesamlphp/simplesamlphp/modules/negotiate/locales/es/LC_MESSAGES/negotiate.po @@ -34,13 +34,13 @@ msgid "{negotiate:negotiate:disable_info_pre}" msgstr "" "<p>Al acceder a esta página, ha deshabilitado la posibilidad de " "identificarse automáticamente en este navegador.</p><p>Para habilitarla " -"de nuevo, por favor, visite <a href='URL'>esta página</a>.</p>" +"de nuevo, por favor, visite <a href='%URL%'>esta página</a>.</p>" msgid "{negotiate:negotiate:enable_info_pre}" msgstr "" "<p>Al acceder a esta página, ha habilitado la identificación automática " "en este navegador.</p><p>Para deshabilitarlo de nuevo, por favor, visite " -"<a href='URL'>esta página</a>.</p>" +"<a href='%URL%'>esta página</a>.</p>" msgid "" "<h3>What is automatic login</h3><p>Automatic login allows you to log in " @@ -59,11 +59,11 @@ msgstr "" msgid "" "<p>By accessing this page, you have turned on the ability to use " "automatic login for this browser.</p><p>To turn it off again, please " -"visit <a href='URL'>this page</a>.</p>" +"visit <a href='%URL%'>this page</a>.</p>" msgstr "" "<p>Al acceder a esta página, ha habilitado la identificación automática " "en este navegador.</p><p>Para deshabilitarlo de nuevo, por favor, visite " -"<a href='URL'>esta página</a>.</p>" +"<a href='%URL%'>esta página</a>.</p>" msgid "Turned off ability to use automatic login for this browser" msgstr "La identificación automática en este navegador se ha deshabilitado." @@ -74,9 +74,9 @@ msgstr "La identificación automática en este navegador se ha habilitado." msgid "" "<p>By accessing this page, you have turned off the ability to use " "automatic login for this browser.</p><p>To turn it on again, please visit" -" <a href='URL'>this page</a>.</p>" +" <a href='%URL%'>this page</a>.</p>" msgstr "" "<p>Al acceder a esta página, ha deshabilitado la posibilidad de " "identificarse automáticamente en este navegador.</p><p>Para habilitarla " -"de nuevo, por favor, visite <a href='URL'>esta página</a>.</p>" +"de nuevo, por favor, visite <a href='%URL%'>esta página</a>.</p>" diff --git a/vendor/simplesamlphp/simplesamlphp/modules/negotiate/locales/et/LC_MESSAGES/negotiate.po b/vendor/simplesamlphp/simplesamlphp/modules/negotiate/locales/et/LC_MESSAGES/negotiate.po index 79347bd7fe..4623c84f6e 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/negotiate/locales/et/LC_MESSAGES/negotiate.po +++ b/vendor/simplesamlphp/simplesamlphp/modules/negotiate/locales/et/LC_MESSAGES/negotiate.po @@ -34,13 +34,13 @@ msgstr "Lülitasid automaatse sisselogimise selles brauseris sisse" msgid "{negotiate:negotiate:disable_info_pre}" msgstr "" "<p>Seda lehekülge külastades lülitasid automaatse sisselogimise selles " -"brauseris välja.</p><p>Sisse lülitamiseks külasta <a href='URL'>seda " +"brauseris välja.</p><p>Sisse lülitamiseks külasta <a href='%URL%'>seda " "lehekülge</a>.</p>" msgid "{negotiate:negotiate:enable_info_pre}" msgstr "" "<p>Seda lehekülge külastades lülitasid automaatse sisselogimise selles " -"brauseris sisse.</p><p>Välja lülitamiseks külasta <a href='URL'>seda " +"brauseris sisse.</p><p>Välja lülitamiseks külasta <a href='%URL%'>seda " "lehekülge</a>.</p>" msgid "" @@ -59,10 +59,10 @@ msgstr "" msgid "" "<p>By accessing this page, you have turned on the ability to use " "automatic login for this browser.</p><p>To turn it off again, please " -"visit <a href='URL'>this page</a>.</p>" +"visit <a href='%URL%'>this page</a>.</p>" msgstr "" "<p>Seda lehekülge külastades lülitasid automaatse sisselogimise selles " -"brauseris sisse.</p><p>Välja lülitamiseks külasta <a href='URL'>seda " +"brauseris sisse.</p><p>Välja lülitamiseks külasta <a href='%URL%'>seda " "lehekülge</a>.</p>" msgid "Turned off ability to use automatic login for this browser" @@ -76,9 +76,9 @@ msgstr "Lülitasid automaatse sisselogimise selles brauseris sisse" msgid "" "<p>By accessing this page, you have turned off the ability to use " "automatic login for this browser.</p><p>To turn it on again, please visit" -" <a href='URL'>this page</a>.</p>" +" <a href='%URL%'>this page</a>.</p>" msgstr "" "<p>Seda lehekülge külastades lülitasid automaatse sisselogimise selles " -"brauseris välja.</p><p>Sisse lülitamiseks külasta <a href='URL'>seda " +"brauseris välja.</p><p>Sisse lülitamiseks külasta <a href='%URL%'>seda " "lehekülge</a>.</p>" diff --git a/vendor/simplesamlphp/simplesamlphp/modules/negotiate/locales/eu/LC_MESSAGES/negotiate.po b/vendor/simplesamlphp/simplesamlphp/modules/negotiate/locales/eu/LC_MESSAGES/negotiate.po index 8a1f65e7cd..428f3c62b9 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/negotiate/locales/eu/LC_MESSAGES/negotiate.po +++ b/vendor/simplesamlphp/simplesamlphp/modules/negotiate/locales/eu/LC_MESSAGES/negotiate.po @@ -34,13 +34,13 @@ msgid "{negotiate:negotiate:disable_info_pre}" msgstr "" "<p>Orri honetan sartzean, nabigatzaile honetan automatikoki " "identifikatzeko aukera desgaitu da. </p><p>Berriz gaitzeko, mesedez, " -"bisita ezazu <a href='URL'>orri hau</a>.</p>" +"bisita ezazu <a href='%URL%'>orri hau</a>.</p>" msgid "{negotiate:negotiate:enable_info_pre}" msgstr "" "<p>Orri honetan sartzean, nabigatzaile honetan automatikoki " "identifikatzeko aukera gaitu da. </p><p>Berriz desgaitzeko, mesedez, " -"bisita ezazu <a href='URL'>orri hau</a>.</p>" +"bisita ezazu <a href='%URL%'>orri hau</a>.</p>" msgid "" "<h3>What is automatic login</h3><p>Automatic login allows you to log in " @@ -59,11 +59,11 @@ msgstr "" msgid "" "<p>By accessing this page, you have turned on the ability to use " "automatic login for this browser.</p><p>To turn it off again, please " -"visit <a href='URL'>this page</a>.</p>" +"visit <a href='%URL%'>this page</a>.</p>" msgstr "" "<p>Orri honetan sartzean, nabigatzaile honetan automatikoki " "identifikatzeko aukera gaitu da. </p><p>Berriz desgaitzeko, mesedez, " -"bisita ezazu <a href='URL'>orri hau</a>.</p>" +"bisita ezazu <a href='%URL%'>orri hau</a>.</p>" msgid "Turned off ability to use automatic login for this browser" msgstr "Nabigatzaile honetan identifikazio automatikoa desgaitu da." @@ -74,9 +74,9 @@ msgstr "Nabigatzaile honetan identifikazio automatikoa gaitu da." msgid "" "<p>By accessing this page, you have turned off the ability to use " "automatic login for this browser.</p><p>To turn it on again, please visit" -" <a href='URL'>this page</a>.</p>" +" <a href='%URL%'>this page</a>.</p>" msgstr "" "<p>Orri honetan sartzean, nabigatzaile honetan automatikoki " "identifikatzeko aukera desgaitu da. </p><p>Berriz gaitzeko, mesedez, " -"bisita ezazu <a href='URL'>orri hau</a>.</p>" +"bisita ezazu <a href='%URL%'>orri hau</a>.</p>" diff --git a/vendor/simplesamlphp/simplesamlphp/modules/negotiate/locales/fr/LC_MESSAGES/negotiate.po b/vendor/simplesamlphp/simplesamlphp/modules/negotiate/locales/fr/LC_MESSAGES/negotiate.po index aaa68e512f..3441293748 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/negotiate/locales/fr/LC_MESSAGES/negotiate.po +++ b/vendor/simplesamlphp/simplesamlphp/modules/negotiate/locales/fr/LC_MESSAGES/negotiate.po @@ -38,13 +38,13 @@ msgid "{negotiate:negotiate:disable_info_pre}" msgstr "" "<p>En accédant à cette page, vous avez désactivé la possibilité " "d'utiliser la connection automatique pour ce navigateur.</p><p>Pour " -"l'activer à nouveau, merci de visiter <a href='URL'>cette page</a>.</p>" +"l'activer à nouveau, merci de visiter <a href='%URL%'>cette page</a>.</p>" msgid "{negotiate:negotiate:enable_info_pre}" msgstr "" "<p>En accédant à cette page, vous avez activé la possibilité d'utiliser " "la connection automatique pour ce navigateur.</p><p>Pour la désactiver à " -"nouveau, merci de visiter <a href='URL'>cette page</a>.</p>" +"nouveau, merci de visiter <a href='%URL%'>cette page</a>.</p>" msgid "" "<h3>What is automatic login</h3><p>Automatic login allows you to log in " @@ -63,11 +63,11 @@ msgstr "" msgid "" "<p>By accessing this page, you have turned on the ability to use " "automatic login for this browser.</p><p>To turn it off again, please " -"visit <a href='URL'>this page</a>.</p>" +"visit <a href='%URL%'>this page</a>.</p>" msgstr "" "<p>En accédant à cette page, vous avez activé la possibilité d'utiliser " "la connection automatique pour ce navigateur.</p><p>Pour la désactiver à " -"nouveau, merci de visiter <a href='URL'>cette page</a>.</p>" +"nouveau, merci de visiter <a href='%URL%'>cette page</a>.</p>" msgid "Turned off ability to use automatic login for this browser" msgstr "" @@ -82,9 +82,9 @@ msgstr "" msgid "" "<p>By accessing this page, you have turned off the ability to use " "automatic login for this browser.</p><p>To turn it on again, please visit" -" <a href='URL'>this page</a>.</p>" +" <a href='%URL%'>this page</a>.</p>" msgstr "" "<p>En accédant à cette page, vous avez désactivé la possibilité " "d'utiliser la connection automatique pour ce navigateur.</p><p>Pour " -"l'activer à nouveau, merci de visiter <a href='URL'>cette page</a>.</p>" +"l'activer à nouveau, merci de visiter <a href='%URL%'>cette page</a>.</p>" diff --git a/vendor/simplesamlphp/simplesamlphp/modules/negotiate/locales/hr/LC_MESSAGES/negotiate.po b/vendor/simplesamlphp/simplesamlphp/modules/negotiate/locales/hr/LC_MESSAGES/negotiate.po index 66224180fd..e4e8c246d7 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/negotiate/locales/hr/LC_MESSAGES/negotiate.po +++ b/vendor/simplesamlphp/simplesamlphp/modules/negotiate/locales/hr/LC_MESSAGES/negotiate.po @@ -35,13 +35,13 @@ msgid "{negotiate:negotiate:disable_info_pre}" msgstr "" "<p>Pristupanjem ovoj stranici isključili ste opciju automatske prijave za" " ovaj web preglednik.</p><p>Da biste je ponovo uključili, kliknite <a " -"href='URL'>ovdje</a>.</p>" +"href='%URL%'>ovdje</a>.</p>" msgid "{negotiate:negotiate:enable_info_pre}" msgstr "" "<p>Pristupanjem ovoj stranici uključili ste opciju automatske prijave za " "ovaj web preglednik.</p><p>Da biste isključili opciju automatskog " -"prijavljivanja, kliknite <a href='URL'>ovdje</a>.</p>" +"prijavljivanja, kliknite <a href='%URL%'>ovdje</a>.</p>" msgid "" "<h3>What is automatic login</h3><p>Automatic login allows you to log in " @@ -60,11 +60,11 @@ msgstr "" msgid "" "<p>By accessing this page, you have turned on the ability to use " "automatic login for this browser.</p><p>To turn it off again, please " -"visit <a href='URL'>this page</a>.</p>" +"visit <a href='%URL%'>this page</a>.</p>" msgstr "" "<p>Pristupanjem ovoj stranici uključili ste opciju automatske prijave za " "ovaj web preglednik.</p><p>Da biste isključili opciju automatskog " -"prijavljivanja, kliknite <a href='URL'>ovdje</a>.</p>" +"prijavljivanja, kliknite <a href='%URL%'>ovdje</a>.</p>" msgid "Turned off ability to use automatic login for this browser" msgstr "Mogućnost automatske prijave za ovaj web preglednik je isključena" @@ -75,9 +75,9 @@ msgstr "Mogućnost automatske prijave za ovaj web preglednik je uključena" msgid "" "<p>By accessing this page, you have turned off the ability to use " "automatic login for this browser.</p><p>To turn it on again, please visit" -" <a href='URL'>this page</a>.</p>" +" <a href='%URL%'>this page</a>.</p>" msgstr "" "<p>Pristupanjem ovoj stranici isključili ste opciju automatske prijave za" " ovaj web preglednik.</p><p>Da biste je ponovo uključili, kliknite <a " -"href='URL'>ovdje</a>.</p>" +"href='%URL%'>ovdje</a>.</p>" diff --git a/vendor/simplesamlphp/simplesamlphp/modules/negotiate/locales/id/LC_MESSAGES/negotiate.po b/vendor/simplesamlphp/simplesamlphp/modules/negotiate/locales/id/LC_MESSAGES/negotiate.po index 03418cde3c..efa859cf47 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/negotiate/locales/id/LC_MESSAGES/negotiate.po +++ b/vendor/simplesamlphp/simplesamlphp/modules/negotiate/locales/id/LC_MESSAGES/negotiate.po @@ -34,13 +34,13 @@ msgid "{negotiate:negotiate:disable_info_pre}" msgstr "" "<p>Dengan mengakses halaman ini, Anda telah mematikan login otomatis pada" " peramban ini.</p><p>Hendak menghidupkan login otomatis? Mohon kunjungi " -"<a href='URL'>halaman ini</a>.</p>" +"<a href='%URL%'>halaman ini</a>.</p>" msgid "{negotiate:negotiate:enable_info_pre}" msgstr "" "<p>Dengan mengakses halaman ini, Anda telah mengaktifkan login otomatis " "pada peramban ini.</p><p>Hendak mematika login otomatis? Silakan " -"kunjungi <a href='URL'>halaman ini</a>.</p>" +"kunjungi <a href='%URL%'>halaman ini</a>.</p>" msgid "" "<h3>What is automatic login</h3><p>Automatic login allows you to log in " @@ -59,11 +59,11 @@ msgstr "" msgid "" "<p>By accessing this page, you have turned on the ability to use " "automatic login for this browser.</p><p>To turn it off again, please " -"visit <a href='URL'>this page</a>.</p>" +"visit <a href='%URL%'>this page</a>.</p>" msgstr "" "<p>Dengan mengakses halaman ini, Anda telah mengaktifkan login otomatis " "pada peramban ini.</p><p>Hendak mematika login otomatis? Silakan " -"kunjungi <a href='URL'>halaman ini</a>.</p>" +"kunjungi <a href='%URL%'>halaman ini</a>.</p>" msgid "Turned off ability to use automatic login for this browser" msgstr "Login otomatis pada peramban ini telah dimatikan" @@ -74,9 +74,9 @@ msgstr "Login otomatis pada peramban ini telah diaktifkan" msgid "" "<p>By accessing this page, you have turned off the ability to use " "automatic login for this browser.</p><p>To turn it on again, please visit" -" <a href='URL'>this page</a>.</p>" +" <a href='%URL%'>this page</a>.</p>" msgstr "" "<p>Dengan mengakses halaman ini, Anda telah mematikan login otomatis pada" " peramban ini.</p><p>Hendak menghidupkan login otomatis? Mohon kunjungi " -"<a href='URL'>halaman ini</a>.</p>" +"<a href='%URL%'>halaman ini</a>.</p>" diff --git a/vendor/simplesamlphp/simplesamlphp/modules/negotiate/locales/it/LC_MESSAGES/negotiate.po b/vendor/simplesamlphp/simplesamlphp/modules/negotiate/locales/it/LC_MESSAGES/negotiate.po index 4edff1d992..f579734f0f 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/negotiate/locales/it/LC_MESSAGES/negotiate.po +++ b/vendor/simplesamlphp/simplesamlphp/modules/negotiate/locales/it/LC_MESSAGES/negotiate.po @@ -32,13 +32,13 @@ msgstr "Login automatico per questo browser attivato." msgid "{negotiate:negotiate:disable_info_pre}" msgstr "" "<p>Per accedere a questa pagina devi disabilitare il login automatico sul" -" tuo browser</p><p>Per riattivarlo visita <a href='URL'>questa " +" tuo browser</p><p>Per riattivarlo visita <a href='%URL%'>questa " "pagina</a>.</p>" msgid "{negotiate:negotiate:enable_info_pre}" msgstr "" "<p>Per accedere a questa pagina devi abilitare il login automatico sul " -"tuo browser</p><p>Per riattivarlo visita <a href='URL'>questa " +"tuo browser</p><p>Per riattivarlo visita <a href='%URL%'>questa " "pagina</a>.</p>" msgid "" @@ -57,10 +57,10 @@ msgstr "" msgid "" "<p>By accessing this page, you have turned on the ability to use " "automatic login for this browser.</p><p>To turn it off again, please " -"visit <a href='URL'>this page</a>.</p>" +"visit <a href='%URL%'>this page</a>.</p>" msgstr "" "<p>Per accedere a questa pagina devi abilitare il login automatico sul " -"tuo browser</p><p>Per riattivarlo visita <a href='URL'>questa " +"tuo browser</p><p>Per riattivarlo visita <a href='%URL%'>questa " "pagina</a>.</p>" msgid "Turned off ability to use automatic login for this browser" @@ -72,9 +72,9 @@ msgstr "Login automatico per questo browser attivato." msgid "" "<p>By accessing this page, you have turned off the ability to use " "automatic login for this browser.</p><p>To turn it on again, please visit" -" <a href='URL'>this page</a>.</p>" +" <a href='%URL%'>this page</a>.</p>" msgstr "" "<p>Per accedere a questa pagina devi disabilitare il login automatico sul" -" tuo browser</p><p>Per riattivarlo visita <a href='URL'>questa " +" tuo browser</p><p>Per riattivarlo visita <a href='%URL%'>questa " "pagina</a>.</p>" diff --git a/vendor/simplesamlphp/simplesamlphp/modules/negotiate/locales/lt/LC_MESSAGES/negotiate.po b/vendor/simplesamlphp/simplesamlphp/modules/negotiate/locales/lt/LC_MESSAGES/negotiate.po index ab0b640e24..ef7d482034 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/negotiate/locales/lt/LC_MESSAGES/negotiate.po +++ b/vendor/simplesamlphp/simplesamlphp/modules/negotiate/locales/lt/LC_MESSAGES/negotiate.po @@ -35,13 +35,13 @@ msgid "{negotiate:negotiate:disable_info_pre}" msgstr "" "<p>Jungdamiesi į šią setainę, Jūs išjungėte galimybę naudoti automatinį " "prisijungimą šioje naršyklėje.</p><p>Norėdami jį vėl įjungti, " -"apsilankykite <a href='URL'>šioje svetainėje</a>.</p>" +"apsilankykite <a href='%URL%'>šioje svetainėje</a>.</p>" msgid "{negotiate:negotiate:enable_info_pre}" msgstr "" "<p>Jungdamiesi į šią setainę, Jūs įjungėte galimybę naudoti automatinį " "prisijungimą šioje naršyklėje.</p><p>Norėdami jį vėl išjungti, " -"apsilankykite <a href='URL'>šioje svetainėje</a>.</p>" +"apsilankykite <a href='%URL%'>šioje svetainėje</a>.</p>" msgid "" "<h3>What is automatic login</h3><p>Automatic login allows you to log in " @@ -60,11 +60,11 @@ msgstr "" msgid "" "<p>By accessing this page, you have turned on the ability to use " "automatic login for this browser.</p><p>To turn it off again, please " -"visit <a href='URL'>this page</a>.</p>" +"visit <a href='%URL%'>this page</a>.</p>" msgstr "" "<p>Jungdamiesi į šią setainę, Jūs įjungėte galimybę naudoti automatinį " "prisijungimą šioje naršyklėje.</p><p>Norėdami jį vėl išjungti, " -"apsilankykite <a href='URL'>šioje svetainėje</a>.</p>" +"apsilankykite <a href='%URL%'>šioje svetainėje</a>.</p>" msgid "Turned off ability to use automatic login for this browser" msgstr "Išjungta galimybė naudoti automatinį prisijungimą šioje naršyklėje" @@ -75,9 +75,9 @@ msgstr "Įjungta galimybė naudoti automatinį prisijungimą šioje naršyklėje msgid "" "<p>By accessing this page, you have turned off the ability to use " "automatic login for this browser.</p><p>To turn it on again, please visit" -" <a href='URL'>this page</a>.</p>" +" <a href='%URL%'>this page</a>.</p>" msgstr "" "<p>Jungdamiesi į šią setainę, Jūs išjungėte galimybę naudoti automatinį " "prisijungimą šioje naršyklėje.</p><p>Norėdami jį vėl įjungti, " -"apsilankykite <a href='URL'>šioje svetainėje</a>.</p>" +"apsilankykite <a href='%URL%'>šioje svetainėje</a>.</p>" diff --git a/vendor/simplesamlphp/simplesamlphp/modules/negotiate/locales/nb/LC_MESSAGES/negotiate.po b/vendor/simplesamlphp/simplesamlphp/modules/negotiate/locales/nb/LC_MESSAGES/negotiate.po index 64d3071f15..ac282609bf 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/negotiate/locales/nb/LC_MESSAGES/negotiate.po +++ b/vendor/simplesamlphp/simplesamlphp/modules/negotiate/locales/nb/LC_MESSAGES/negotiate.po @@ -34,13 +34,13 @@ msgid "{negotiate:negotiate:disable_info_pre}" msgstr "" "<p>Ved å gå til denne siden har du skrudd av muligheten for automatisk " "innlogging for denne nettleseren.</p><p>For å skru på igjen muligheten, " -"kan du gå til <a href='URL'>denne siden</a>.</p>" +"kan du gå til <a href='%URL%'>denne siden</a>.</p>" msgid "{negotiate:negotiate:enable_info_pre}" msgstr "" "<p>Ved å gå til denne siden har du skrudd på muligheten for automatisk " "innlogging for denne nettleseren.</p><p>For å skru av igjen muligheten, " -"kan du gå til <a href='URL'>denne siden</a>.</p>" +"kan du gå til <a href='%URL%'>denne siden</a>.</p>" msgid "" "<h3>What is automatic login</h3><p>Automatic login allows you to log in " @@ -59,11 +59,11 @@ msgstr "" msgid "" "<p>By accessing this page, you have turned on the ability to use " "automatic login for this browser.</p><p>To turn it off again, please " -"visit <a href='URL'>this page</a>.</p>" +"visit <a href='%URL%'>this page</a>.</p>" msgstr "" "<p>Ved å gå til denne siden har du skrudd på muligheten for automatisk " "innlogging for denne nettleseren.</p><p>For å skru av igjen muligheten, " -"kan du gå til <a href='URL'>denne siden</a>.</p>" +"kan du gå til <a href='%URL%'>denne siden</a>.</p>" msgid "Turned off ability to use automatic login for this browser" msgstr "Skrudd av mulighet for automatisk innlogging for denne nettleseren" @@ -74,9 +74,9 @@ msgstr "Skrudd på mulighet for automatisk innlogging for denne nettleseren" msgid "" "<p>By accessing this page, you have turned off the ability to use " "automatic login for this browser.</p><p>To turn it on again, please visit" -" <a href='URL'>this page</a>.</p>" +" <a href='%URL%'>this page</a>.</p>" msgstr "" "<p>Ved å gå til denne siden har du skrudd av muligheten for automatisk " "innlogging for denne nettleseren.</p><p>For å skru på igjen muligheten, " -"kan du gå til <a href='URL'>denne siden</a>.</p>" +"kan du gå til <a href='%URL%'>denne siden</a>.</p>" diff --git a/vendor/simplesamlphp/simplesamlphp/modules/negotiate/locales/nl/LC_MESSAGES/negotiate.po b/vendor/simplesamlphp/simplesamlphp/modules/negotiate/locales/nl/LC_MESSAGES/negotiate.po index 1a073b86fc..f0553d41f6 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/negotiate/locales/nl/LC_MESSAGES/negotiate.po +++ b/vendor/simplesamlphp/simplesamlphp/modules/negotiate/locales/nl/LC_MESSAGES/negotiate.po @@ -34,13 +34,13 @@ msgid "{negotiate:negotiate:disable_info_pre}" msgstr "" "<p>Middels het laden van deze pagina heeft u de mogelijkheid tot " "automatisch inloggen uitgeschakeld voor deze browser.</p><p>Om dit weer " -"in te schakelen, bezoekt u <a href='URL'>deze pagina</a>.</p>" +"in te schakelen, bezoekt u <a href='%URL%'>deze pagina</a>.</p>" msgid "{negotiate:negotiate:enable_info_pre}" msgstr "" "<p>Middels het laden van deze pagina heeft u de mogelijkheid tot " "automatisch inloggen ingeschakeld voor deze browser.</p><p>Om dit weer " -"uit te schakelen, bezoekt u <a href='URL'>deze pagina</a>.</p>" +"uit te schakelen, bezoekt u <a href='%URL%'>deze pagina</a>.</p>" msgid "" "<h3>What is automatic login</h3><p>Automatic login allows you to log in " @@ -59,11 +59,11 @@ msgstr "" msgid "" "<p>By accessing this page, you have turned on the ability to use " "automatic login for this browser.</p><p>To turn it off again, please " -"visit <a href='URL'>this page</a>.</p>" +"visit <a href='%URL%'>this page</a>.</p>" msgstr "" "<p>Middels het laden van deze pagina heeft u de mogelijkheid tot " "automatisch inloggen ingeschakeld voor deze browser.</p><p>Om dit weer " -"uit te schakelen, bezoekt u <a href='URL'>deze pagina</a>.</p>" +"uit te schakelen, bezoekt u <a href='%URL%'>deze pagina</a>.</p>" msgid "Turned off ability to use automatic login for this browser" msgstr "Mogelijkheid tot automatisch inloggen voor deze browser uitgeschakeld" @@ -74,9 +74,9 @@ msgstr "Mogelijkheid tot automatisch inloggen voor deze browser ingeschakeld" msgid "" "<p>By accessing this page, you have turned off the ability to use " "automatic login for this browser.</p><p>To turn it on again, please visit" -" <a href='URL'>this page</a>.</p>" +" <a href='%URL%'>this page</a>.</p>" msgstr "" "<p>Middels het laden van deze pagina heeft u de mogelijkheid tot " "automatisch inloggen uitgeschakeld voor deze browser.</p><p>Om dit weer " -"in te schakelen, bezoekt u <a href='URL'>deze pagina</a>.</p>" +"in te schakelen, bezoekt u <a href='%URL%'>deze pagina</a>.</p>" diff --git a/vendor/simplesamlphp/simplesamlphp/modules/negotiate/locales/nn/LC_MESSAGES/negotiate.po b/vendor/simplesamlphp/simplesamlphp/modules/negotiate/locales/nn/LC_MESSAGES/negotiate.po index 05e0c597ff..5c79bdfb3d 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/negotiate/locales/nn/LC_MESSAGES/negotiate.po +++ b/vendor/simplesamlphp/simplesamlphp/modules/negotiate/locales/nn/LC_MESSAGES/negotiate.po @@ -34,13 +34,13 @@ msgid "{negotiate:negotiate:disable_info_pre}" msgstr "" "<p>Ved å gå til denne siden har du skrudd av moglegheit for automatisk " "innlogging for denne nettlesaren.</p><p>For å skru på igjen moglegheita, " -"kan du gå til <a href='URL'>denne siden</a>.</p>" +"kan du gå til <a href='%URL%'>denne siden</a>.</p>" msgid "{negotiate:negotiate:enable_info_pre}" msgstr "" "<p>Ved å gå til denne siden har du skrudd på moglegheit for automatisk " "innlogging for denne nettlesaren.</p><p>For å skru av igjen moglegheita, " -"kan du gå til <a href='URL'>denne siden</a>.</p>" +"kan du gå til <a href='%URL%'>denne siden</a>.</p>" msgid "" "<h3>What is automatic login</h3><p>Automatic login allows you to log in " @@ -59,11 +59,11 @@ msgstr "" msgid "" "<p>By accessing this page, you have turned on the ability to use " "automatic login for this browser.</p><p>To turn it off again, please " -"visit <a href='URL'>this page</a>.</p>" +"visit <a href='%URL%'>this page</a>.</p>" msgstr "" "<p>Ved å gå til denne siden har du skrudd på moglegheit for automatisk " "innlogging for denne nettlesaren.</p><p>For å skru av igjen moglegheita, " -"kan du gå til <a href='URL'>denne siden</a>.</p>" +"kan du gå til <a href='%URL%'>denne siden</a>.</p>" msgid "Turned off ability to use automatic login for this browser" msgstr "Skrudd av moglegheit for automatisk innlogging for denne nettlesaren" @@ -74,9 +74,9 @@ msgstr "Skrudd på moglegheit for automatisk innlogging for denne nettlesaren" msgid "" "<p>By accessing this page, you have turned off the ability to use " "automatic login for this browser.</p><p>To turn it on again, please visit" -" <a href='URL'>this page</a>.</p>" +" <a href='%URL%'>this page</a>.</p>" msgstr "" "<p>Ved å gå til denne siden har du skrudd av moglegheit for automatisk " "innlogging for denne nettlesaren.</p><p>For å skru på igjen moglegheita, " -"kan du gå til <a href='URL'>denne siden</a>.</p>" +"kan du gå til <a href='%URL%'>denne siden</a>.</p>" diff --git a/vendor/simplesamlphp/simplesamlphp/modules/negotiate/locales/ro/LC_MESSAGES/negotiate.po b/vendor/simplesamlphp/simplesamlphp/modules/negotiate/locales/ro/LC_MESSAGES/negotiate.po index ff2c088615..259e2fdc28 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/negotiate/locales/ro/LC_MESSAGES/negotiate.po +++ b/vendor/simplesamlphp/simplesamlphp/modules/negotiate/locales/ro/LC_MESSAGES/negotiate.po @@ -39,14 +39,14 @@ msgid "{negotiate:negotiate:disable_info_pre}" msgstr "" "<p>Prin accesarea acestei pagini ați dezactivat posibilitatea utilizării " "autentificării automate pentru acest browser.</p><p>Pentru a activa din " -"nou această posibilitate vă rugăm să accesați <a href=\"URL\">această " +"nou această posibilitate vă rugăm să accesați <a href='%URL%'>această " "pagină</a>.</p>" msgid "{negotiate:negotiate:enable_info_pre}" msgstr "" "<p>Prin accesarea acestei pagini ați activat posibilitatea utilizării " "autentificării automate pentru acest browser.</p><p>Pentru a dezactiva " -"această posibilitate vă rugăm să accesați <a href=\"URL\">această " +"această posibilitate vă rugăm să accesați <a href='%URL%'>această " "pagină</a>.</p>" msgid "" @@ -66,11 +66,11 @@ msgstr "" msgid "" "<p>By accessing this page, you have turned on the ability to use " "automatic login for this browser.</p><p>To turn it off again, please " -"visit <a href='URL'>this page</a>.</p>" +"visit <a href='%URL%'>this page</a>.</p>" msgstr "" "<p>Prin accesarea acestei pagini ați activat posibilitatea utilizării " "autentificării automate pentru acest browser.</p><p>Pentru a dezactiva " -"această posibilitate vă rugăm să accesați <a href=\"URL\">această " +"această posibilitate vă rugăm să accesați <a href='%URL%'>această " "pagină</a>.</p>" msgid "Turned off ability to use automatic login for this browser" @@ -86,10 +86,10 @@ msgstr "" msgid "" "<p>By accessing this page, you have turned off the ability to use " "automatic login for this browser.</p><p>To turn it on again, please visit" -" <a href='URL'>this page</a>.</p>" +" <a href='%URL%'>this page</a>.</p>" msgstr "" "<p>Prin accesarea acestei pagini ați dezactivat posibilitatea utilizării " "autentificării automate pentru acest browser.</p><p>Pentru a activa din " -"nou această posibilitate vă rugăm să accesați <a href=\"URL\">această " +"nou această posibilitate vă rugăm să accesați <a href='%URL%'>această " "pagină</a>.</p>" diff --git a/vendor/simplesamlphp/simplesamlphp/modules/negotiate/locales/ru/LC_MESSAGES/negotiate.po b/vendor/simplesamlphp/simplesamlphp/modules/negotiate/locales/ru/LC_MESSAGES/negotiate.po index cefd89e1ff..0011b484cb 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/negotiate/locales/ru/LC_MESSAGES/negotiate.po +++ b/vendor/simplesamlphp/simplesamlphp/modules/negotiate/locales/ru/LC_MESSAGES/negotiate.po @@ -36,13 +36,13 @@ msgid "{negotiate:negotiate:disable_info_pre}" msgstr "" "<p>Войдя на эту страницу, Вы отключили возможность использовать функцию " "автоматического логина в данном браузере.</p><p>Для повторного включения " -"посетите <a href='URL'>эту страницу</a>.</p>" +"посетите <a href='%URL%'>эту страницу</a>.</p>" msgid "{negotiate:negotiate:enable_info_pre}" msgstr "" "<p>Войдя на эту страницу, Вы включили возможность использовать функцию " "автоматического логина в данном браузере.</p><p>Для ее отключения , " -"пожалуйста, посетите <a href='URL'>эту страницу</a>.</p>" +"пожалуйста, посетите <a href='%URL%'>эту страницу</a>.</p>" msgid "" "<h3>What is automatic login</h3><p>Automatic login allows you to log in " @@ -60,11 +60,11 @@ msgstr "" msgid "" "<p>By accessing this page, you have turned on the ability to use " "automatic login for this browser.</p><p>To turn it off again, please " -"visit <a href='URL'>this page</a>.</p>" +"visit <a href='%URL%'>this page</a>.</p>" msgstr "" "<p>Войдя на эту страницу, Вы включили возможность использовать функцию " "автоматического логина в данном браузере.</p><p>Для ее отключения , " -"пожалуйста, посетите <a href='URL'>эту страницу</a>.</p>" +"пожалуйста, посетите <a href='%URL%'>эту страницу</a>.</p>" msgid "Turned off ability to use automatic login for this browser" msgstr "Отключить функцию автоматического логина для данного браузера" @@ -77,9 +77,9 @@ msgstr "" msgid "" "<p>By accessing this page, you have turned off the ability to use " "automatic login for this browser.</p><p>To turn it on again, please visit" -" <a href='URL'>this page</a>.</p>" +" <a href='%URL%'>this page</a>.</p>" msgstr "" "<p>Войдя на эту страницу, Вы отключили возможность использовать функцию " "автоматического логина в данном браузере.</p><p>Для повторного включения " -"посетите <a href='URL'>эту страницу</a>.</p>" +"посетите <a href='%URL%'>эту страницу</a>.</p>" diff --git a/vendor/simplesamlphp/simplesamlphp/modules/negotiate/locales/sr/LC_MESSAGES/negotiate.po b/vendor/simplesamlphp/simplesamlphp/modules/negotiate/locales/sr/LC_MESSAGES/negotiate.po index 3b6711bd5d..dadd2077f4 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/negotiate/locales/sr/LC_MESSAGES/negotiate.po +++ b/vendor/simplesamlphp/simplesamlphp/modules/negotiate/locales/sr/LC_MESSAGES/negotiate.po @@ -34,13 +34,13 @@ msgid "{negotiate:negotiate:disable_info_pre}" msgstr "" "<p>Pristupanjem na ovu stranicu, ovaj pretraživač ste za isključili " "mogućnost automatske prijave.</p><p>Da bi ste opet uključili ovu " -"mogućnost, molim vas posetite <a href='URL'>ovu stranicu</a>.</p>" +"mogućnost, molim vas posetite <a href='%URL%'>ovu stranicu</a>.</p>" msgid "{negotiate:negotiate:enable_info_pre}" msgstr "" "<p>Pristupanjem na ovu stranicu, ovaj pretraživač ste za uključili " "mogućnost automatske prijave.</p><p>Da bi ste opet isključili ovu " -"mogućnost, molim vas posetite <a href='URL'>ovu stranicu</a>.</p>" +"mogućnost, molim vas posetite <a href='%URL%'>ovu stranicu</a>.</p>" msgid "" "<h3>What is automatic login</h3><p>Automatic login allows you to log in " @@ -58,11 +58,11 @@ msgstr "" msgid "" "<p>By accessing this page, you have turned on the ability to use " "automatic login for this browser.</p><p>To turn it off again, please " -"visit <a href='URL'>this page</a>.</p>" +"visit <a href='%URL%'>this page</a>.</p>" msgstr "" "<p>Pristupanjem na ovu stranicu, ovaj pretraživač ste za uključili " "mogućnost automatske prijave.</p><p>Da bi ste opet isključili ovu " -"mogućnost, molim vas posetite <a href='URL'>ovu stranicu</a>.</p>" +"mogućnost, molim vas posetite <a href='%URL%'>ovu stranicu</a>.</p>" msgid "Turned off ability to use automatic login for this browser" msgstr "Mogućnost automatske prijave je za ovaj pretraživač isključena" @@ -73,9 +73,9 @@ msgstr "Mogućnost automatske prijave je za ovaj pretraživač uključena" msgid "" "<p>By accessing this page, you have turned off the ability to use " "automatic login for this browser.</p><p>To turn it on again, please visit" -" <a href='URL'>this page</a>.</p>" +" <a href='%URL%'>this page</a>.</p>" msgstr "" "<p>Pristupanjem na ovu stranicu, ovaj pretraživač ste za isključili " "mogućnost automatske prijave.</p><p>Da bi ste opet uključili ovu " -"mogućnost, molim vas posetite <a href='URL'>ovu stranicu</a>.</p>" +"mogućnost, molim vas posetite <a href='%URL%'>ovu stranicu</a>.</p>" diff --git a/vendor/simplesamlphp/simplesamlphp/modules/negotiate/locales/sv/LC_MESSAGES/negotiate.po b/vendor/simplesamlphp/simplesamlphp/modules/negotiate/locales/sv/LC_MESSAGES/negotiate.po index b2e6bfefe0..ef4890ee15 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/negotiate/locales/sv/LC_MESSAGES/negotiate.po +++ b/vendor/simplesamlphp/simplesamlphp/modules/negotiate/locales/sv/LC_MESSAGES/negotiate.po @@ -38,13 +38,13 @@ msgid "{negotiate:negotiate:disable_info_pre}" msgstr "" "<p>Genom att besöka denna sida har du stängt av möjligheten att använda " "automatisk inloggning för denna webbläsare.</p><p>För att slå på " -"möjligheten igen besök <a href='URL'>denna sida</a>.</p>" +"möjligheten igen besök <a href='%URL%'>denna sida</a>.</p>" msgid "{negotiate:negotiate:enable_info_pre}" msgstr "" "<p>Genom att besöka denna sida har du aktiverat möjligheten att använda " "automatisk inloggning för denna webbläsare.</p><p>För att slå av " -"möjligheten igen besök <a href='URL'>denna sida</a>.</p>" +"möjligheten igen besök <a href='%URL%'>denna sida</a>.</p>" msgid "" "<h3>What is automatic login</h3><p>Automatic login allows you to log in " @@ -63,11 +63,11 @@ msgstr "" msgid "" "<p>By accessing this page, you have turned on the ability to use " "automatic login for this browser.</p><p>To turn it off again, please " -"visit <a href='URL'>this page</a>.</p>" +"visit <a href='%URL%'>this page</a>.</p>" msgstr "" "<p>Genom att besöka denna sida har du aktiverat möjligheten att använda " "automatisk inloggning för denna webbläsare.</p><p>För att slå av " -"möjligheten igen besök <a href='URL'>denna sida</a>.</p>" +"möjligheten igen besök <a href='%URL%'>denna sida</a>.</p>" msgid "Turned off ability to use automatic login for this browser" msgstr "" @@ -82,9 +82,9 @@ msgstr "" msgid "" "<p>By accessing this page, you have turned off the ability to use " "automatic login for this browser.</p><p>To turn it on again, please visit" -" <a href='URL'>this page</a>.</p>" +" <a href='%URL%'>this page</a>.</p>" msgstr "" "<p>Genom att besöka denna sida har du stängt av möjligheten att använda " "automatisk inloggning för denna webbläsare.</p><p>För att slå på " -"möjligheten igen besök <a href='URL'>denna sida</a>.</p>" +"möjligheten igen besök <a href='%URL%'>denna sida</a>.</p>" diff --git a/vendor/simplesamlphp/simplesamlphp/modules/negotiate/locales/zh-tw/LC_MESSAGES/negotiate.po b/vendor/simplesamlphp/simplesamlphp/modules/negotiate/locales/zh-tw/LC_MESSAGES/negotiate.po index c0c0fbb2a0..4d85c76244 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/negotiate/locales/zh-tw/LC_MESSAGES/negotiate.po +++ b/vendor/simplesamlphp/simplesamlphp/modules/negotiate/locales/zh-tw/LC_MESSAGES/negotiate.po @@ -28,10 +28,10 @@ msgid "{negotiate:negotiate:enable_title}" msgstr "嘗試於瀏覽器開啟自動登入" msgid "{negotiate:negotiate:disable_info_pre}" -msgstr "<p>當存取此頁時,您已經於瀏覽器關閉自動登入。</p><p>如要再度開啟,請造訪<a href='URL'>此頁</a>。</p>" +msgstr "<p>當存取此頁時,您已經於瀏覽器關閉自動登入。</p><p>如要再度開啟,請造訪<a href='%URL%'>此頁</a>。</p>" msgid "{negotiate:negotiate:enable_info_pre}" -msgstr "<p>當存取此頁時,您已經開啟瀏覽器自動登入。</p><p>如要再次關閉,請造訪<a href='URL'>此頁</a>。</p>" +msgstr "<p>當存取此頁時,您已經開啟瀏覽器自動登入。</p><p>如要再次關閉,請造訪<a href='%URL%'>此頁</a>。</p>" msgid "" "<h3>What is automatic login</h3><p>Automatic login allows you to log in " @@ -47,8 +47,8 @@ msgstr "" msgid "" "<p>By accessing this page, you have turned on the ability to use " "automatic login for this browser.</p><p>To turn it off again, please " -"visit <a href='URL'>this page</a>.</p>" -msgstr "<p>當存取此頁時,您已經開啟瀏覽器自動登入。</p><p>如要再次關閉,請造訪<a href='URL'>此頁</a>。</p>" +"visit <a href='%URL%'>this page</a>.</p>" +msgstr "<p>當存取此頁時,您已經開啟瀏覽器自動登入。</p><p>如要再次關閉,請造訪<a href='%URL%'>此頁</a>。</p>" msgid "Turned off ability to use automatic login for this browser" msgstr "嘗試於瀏覽器關閉自動登入功能" @@ -59,6 +59,6 @@ msgstr "嘗試於瀏覽器開啟自動登入" msgid "" "<p>By accessing this page, you have turned off the ability to use " "automatic login for this browser.</p><p>To turn it on again, please visit" -" <a href='URL'>this page</a>.</p>" -msgstr "<p>當存取此頁時,您已經於瀏覽器關閉自動登入。</p><p>如要再度開啟,請造訪<a href='URL'>此頁</a>。</p>" +" <a href='%URL%'>this page</a>.</p>" +msgstr "<p>當存取此頁時,您已經於瀏覽器關閉自動登入。</p><p>如要再度開啟,請造訪<a href='%URL%'>此頁</a>。</p>" diff --git a/vendor/simplesamlphp/simplesamlphp/modules/negotiate/locales/zh/LC_MESSAGES/negotiate.po b/vendor/simplesamlphp/simplesamlphp/modules/negotiate/locales/zh/LC_MESSAGES/negotiate.po index c7f787f2cd..5df463436a 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/negotiate/locales/zh/LC_MESSAGES/negotiate.po +++ b/vendor/simplesamlphp/simplesamlphp/modules/negotiate/locales/zh/LC_MESSAGES/negotiate.po @@ -22,7 +22,7 @@ msgid "{negotiate:negotiate:enable_title}" msgstr "启用本浏览器上的自动登录功能" msgid "{negotiate:negotiate:disable_info_pre}" -msgstr "<p>当您连上本页面时,本浏览器自动登录功能已关闭。</p><p>请访问<a href='URL'>此处</a>以重新启用自动登录功能。</p>" +msgstr "<p>当您连上本页面时,本浏览器自动登录功能已关闭。</p><p>请访问<a href='%URL%'>此处</a>以重新启用自动登录功能。</p>" msgid "Turned off ability to use automatic login for this browser" msgstr "关闭本浏览器上的自动登录功能" @@ -33,6 +33,6 @@ msgstr "启用本浏览器上的自动登录功能" msgid "" "<p>By accessing this page, you have turned off the ability to use " "automatic login for this browser.</p><p>To turn it on again, please visit" -" <a href='URL'>this page</a>.</p>" -msgstr "<p>当您连上本页面时,本浏览器自动登录功能已关闭。</p><p>请访问<a href='URL'>此处</a>以重新启用自动登录功能。</p>" +" <a href='%URL%'>this page</a>.</p>" +msgstr "<p>当您连上本页面时,本浏览器自动登录功能已关闭。</p><p>请访问<a href='%URL%'>此处</a>以重新启用自动登录功能。</p>" diff --git a/vendor/simplesamlphp/simplesamlphp/modules/negotiate/templates/disable.php b/vendor/simplesamlphp/simplesamlphp/modules/negotiate/templates/disable.php index f9e2d55082..fd8338e9f4 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/negotiate/templates/disable.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/negotiate/templates/disable.php @@ -10,7 +10,7 @@ $this->includeAtTemplateBase('includes/header.php'); ?> <h1><?php echo $this->t('{negotiate:negotiate:disable_title}'); ?></h1> -<?php echo $this->t('{negotiate:negotiate:disable_info_pre}', array('URL' => htmlspecialchars($this->data['url']))); ?> +<?php echo $this->t('{negotiate:negotiate:disable_info_pre}', ['URL' => htmlspecialchars($this->data['url'])]); ?> <?php echo $this->t('{negotiate:negotiate:info_post}'); ?> diff --git a/vendor/simplesamlphp/simplesamlphp/modules/negotiate/templates/disable.twig b/vendor/simplesamlphp/simplesamlphp/modules/negotiate/templates/disable.twig new file mode 100644 index 0000000000..07fccdd269 --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/modules/negotiate/templates/disable.twig @@ -0,0 +1,9 @@ +{% extends "base.twig" %} + +{% block content %} + <h1>{{ '{negotiate:negotiate:disable_title}'|trans }}</h1> + <br /> + {{ '{negotiate:negotiate:disable_info_pre}'|trans({'%URL%': url}, "app")|raw }} + <br /> + {{ '{negotiate:negotiate:info_post}'|trans|raw }} +{% endblock %} diff --git a/vendor/simplesamlphp/simplesamlphp/modules/negotiate/templates/enable.php b/vendor/simplesamlphp/simplesamlphp/modules/negotiate/templates/enable.php index 939af6fb6d..a25b6a213b 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/negotiate/templates/enable.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/negotiate/templates/enable.php @@ -11,7 +11,7 @@ ?> <h1><?php echo $this->t('{negotiate:negotiate:enable_title}'); ?></h1> -<?php echo $this->t('{negotiate:negotiate:enable_info_pre}', array('URL' => htmlspecialchars($this->data['url']))); ?> +<?php echo $this->t('{negotiate:negotiate:enable_info_pre}', ['URL' => htmlspecialchars($this->data['url'])]); ?> <?php echo $this->t('{negotiate:negotiate:info_post}'); ?> diff --git a/vendor/simplesamlphp/simplesamlphp/modules/negotiate/templates/enable.twig b/vendor/simplesamlphp/simplesamlphp/modules/negotiate/templates/enable.twig new file mode 100644 index 0000000000..07e5579646 --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/modules/negotiate/templates/enable.twig @@ -0,0 +1,9 @@ +{% extends "base.twig" %} + +{% block content %} + <h1>{{ '{negotiate:negotiate:enable_title}'|trans }}</h1> + <br /> + {{ '{negotiate:negotiate:enable_info_pre}'|trans({'%URL%': url}, "app")|raw }} + <br /> + {{ '{negotiate:negotiate:info_post}'|trans|raw }} +{% endblock %} diff --git a/vendor/simplesamlphp/simplesamlphp/modules/negotiate/templates/redirect.php b/vendor/simplesamlphp/simplesamlphp/modules/negotiate/templates/redirect.php new file mode 100644 index 0000000000..7d7f07c213 --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/modules/negotiate/templates/redirect.php @@ -0,0 +1,11 @@ +<!DOCTYPE HTML> +<html lang="en-US"> + <head> + <script src="<?php echo $this->data['baseurlpath']; ?>/assets/js/redirect.js"></script> + <title>Redirect to login</title> + </head> + <body> + <p>Your browser seems to have Javascript disabled. Please click <a id="redirect" href="<?php echo $this->data['url']; ?>">here</a>.</p> + </body> +</html> + diff --git a/vendor/simplesamlphp/simplesamlphp/modules/negotiate/templates/redirect.twig b/vendor/simplesamlphp/simplesamlphp/modules/negotiate/templates/redirect.twig new file mode 100644 index 0000000000..3a69556eec --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/modules/negotiate/templates/redirect.twig @@ -0,0 +1,11 @@ +<!DOCTYPE HTML> +<html lang="en-US"> + <head> + <script src="{{ baseurlpath }}/assets/js/redirect.js"></script> + <title>Redirect to login</title> + </head> + <body> + <p>Your browser seems to have Javascript disabled. Please click <a id="redirect" href="{{ url }}">here</a>.</p> + </body> +</html> + diff --git a/vendor/simplesamlphp/simplesamlphp/modules/negotiate/www/assets/js/redirect.js b/vendor/simplesamlphp/simplesamlphp/modules/negotiate/www/assets/js/redirect.js new file mode 100644 index 0000000000..3b829d111d --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/modules/negotiate/www/assets/js/redirect.js @@ -0,0 +1,3 @@ +document.addEventListener('DOMContentLoaded', function () { + window.location = document.querySelector('#redirect'); +}); diff --git a/vendor/simplesamlphp/simplesamlphp/modules/negotiate/www/backend.php b/vendor/simplesamlphp/simplesamlphp/modules/negotiate/www/backend.php index 5fa2619a4f..8a5222f26d 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/negotiate/www/backend.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/negotiate/www/backend.php @@ -8,9 +8,12 @@ * @package SimpleSAMLphp */ -$state = SimpleSAML_Auth_State::loadState($_REQUEST['AuthState'], sspmod_negotiate_Auth_Source_Negotiate::STAGEID); -SimpleSAML\Logger::debug('backend - fallback: '.$state['LogoutState']['negotiate:backend']); +$state = \SimpleSAML\Auth\State::loadState( + $_REQUEST['AuthState'], + \SimpleSAML\Module\negotiate\Auth\Source\Negotiate::STAGEID +); +\SimpleSAML\Logger::debug('backend - fallback: '.$state['LogoutState']['negotiate:backend']); -sspmod_negotiate_Auth_Source_Negotiate::fallBack($state); +\SimpleSAML\Module\negotiate\Auth\Source\Negotiate::fallBack($state); exit; diff --git a/vendor/simplesamlphp/simplesamlphp/modules/negotiate/www/disable.php b/vendor/simplesamlphp/simplesamlphp/modules/negotiate/www/disable.php index 9cf8c592bf..2734f05c31 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/negotiate/www/disable.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/negotiate/www/disable.php @@ -1,23 +1,20 @@ <?php - /** - * - * * @author Mathias Meisfjordskar, University of Oslo. * <mathias.meisfjordskar@usit.uio.no> * @package SimpleSAMLphp */ -$params = array( - 'expire' => (mktime(0,0,0,1,1,2038)), - 'secure' => FALSE, - 'httponly' => TRUE, -); -\SimpleSAML\Utils\HTTP::setCookie('NEGOTIATE_AUTOLOGIN_DISABLE_PERMANENT', 'True', $params, FALSE); +$params = [ + 'expire' => (mktime(0, 0, 0, 1, 1, 2038)), + 'secure' => false, + 'httponly' => true, +]; +\SimpleSAML\Utils\HTTP::setCookie('NEGOTIATE_AUTOLOGIN_DISABLE_PERMANENT', 'True', $params, false); -$globalConfig = SimpleSAML_Configuration::getInstance(); -$session = SimpleSAML_Session::getSessionFromRequest(); -$session->setData('negotiate:disable', 'session', FALSE, 24*60*60); -$t = new SimpleSAML_XHTML_Template($globalConfig, 'negotiate:disable.php'); -$t->data['url'] = SimpleSAML\Module::getModuleURL('negotiate/enable.php'); +$globalConfig = \SimpleSAML\Configuration::getInstance(); +$session = \SimpleSAML\Session::getSessionFromRequest(); +$session->setData('negotiate:disable', 'session', false, 86400); //24*60*60=86400 +$t = new \SimpleSAML\XHTML\Template($globalConfig, 'negotiate:disable.php'); +$t->data['url'] = \SimpleSAML\Module::getModuleURL('negotiate/enable.php'); $t->show(); diff --git a/vendor/simplesamlphp/simplesamlphp/modules/negotiate/www/enable.php b/vendor/simplesamlphp/simplesamlphp/modules/negotiate/www/enable.php index 04c5e16ffc..be52928db4 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/negotiate/www/enable.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/negotiate/www/enable.php @@ -1,22 +1,19 @@ <?php - /** - * - * * @author Mathias Meisfjordskar, University of Oslo. * <mathias.meisfjordskar@usit.uio.no> * @package SimpleSAMLphp */ -$params = array( - 'secure' => FALSE, - 'httponly' => TRUE, -); -\SimpleSAML\Utils\HTTP::setCookie('NEGOTIATE_AUTOLOGIN_DISABLE_PERMANENT', NULL, $params, FALSE); +$params = [ + 'secure' => false, + 'httponly' => true, +]; +\SimpleSAML\Utils\HTTP::setCookie('NEGOTIATE_AUTOLOGIN_DISABLE_PERMANENT', null, $params, false); -$globalConfig = SimpleSAML_Configuration::getInstance(); -$session = SimpleSAML_Session::getSessionFromRequest(); -$session->setData('negotiate:disable', 'session', FALSE, 24*60*60); -$t = new SimpleSAML_XHTML_Template($globalConfig, 'negotiate:enable.php'); -$t->data['url'] = SimpleSAML\Module::getModuleURL('negotiate/disable.php'); +$globalConfig = \SimpleSAML\Configuration::getInstance(); +$session = \SimpleSAML\Session::getSessionFromRequest(); +$session->setData('negotiate:disable', 'session', false, 86400); // 24*60*60=86400 +$t = new \SimpleSAML\XHTML\Template($globalConfig, 'negotiate:enable.php'); +$t->data['url'] = \SimpleSAML\Module::getModuleURL('negotiate/disable.php'); $t->show(); diff --git a/vendor/simplesamlphp/simplesamlphp/modules/negotiate/www/retry.php b/vendor/simplesamlphp/simplesamlphp/modules/negotiate/www/retry.php index 7f7c423480..c4ffd87a52 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/negotiate/www/retry.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/negotiate/www/retry.php @@ -1,30 +1,34 @@ <?php /** - * * * @author Mathias Meisfjordskar, University of Oslo. * <mathias.meisfjordskar@usit.uio.no> * @package SimpleSAMLphp + * */ -$state = SimpleSAML_Auth_State::loadState($_REQUEST['AuthState'], sspmod_negotiate_Auth_Source_Negotiate::STAGEID); +$state = \SimpleSAML\Auth\State::loadState( + $_REQUEST['AuthState'], + \SimpleSAML\Module\negotiate\Auth\Source\Negotiate::STAGEID +); -$metadata = SimpleSAML_Metadata_MetaDataStorageHandler::getMetadataHandler(); +$metadata = \SimpleSAML\Metadata\MetaDataStorageHandler::getMetadataHandler(); $idpid = $metadata->getMetaDataCurrentEntityID('saml20-idp-hosted', 'metaindex'); $idpmeta = $metadata->getMetaData($idpid, 'saml20-idp-hosted'); if (isset($idpmeta['auth'])) { - $source = SimpleSAML_Auth_Source::getById($idpmeta['auth']); - if ($source === NULL) - throw new SimpleSAML_Error_BadRequest('Invalid AuthId "' . $idpmeta['auth'] . '" - not found.'); + $source = \SimpleSAML\Auth\Source::getById($idpmeta['auth']); + if ($source === null) { + throw new \SimpleSAML\Error\BadRequest('Invalid AuthId "'.$idpmeta['auth'].'" - not found.'); + } - $session = SimpleSAML_Session::getSessionFromRequest(); - $session->setData('negotiate:disable', 'session', FALSE, 24*60*60); - SimpleSAML\Logger::debug('Negotiate(retry) - session enabled, retrying.'); - $source->authenticate($state); - assert('FALSE'); + $session = \SimpleSAML\Session::getSessionFromRequest(); + $session->setData('negotiate:disable', 'session', false, 86400); //24*60*60=86400 + \SimpleSAML\Logger::debug('Negotiate(retry) - session enabled, retrying.'); + $source->authenticate($state); + assert(false); } else { - SimpleSAML\Logger::error('Negotiate - retry - no "auth" parameter found in IdP metadata.'); - assert('FALSE'); + \SimpleSAML\Logger::error('Negotiate - retry - no "auth" parameter found in IdP metadata.'); + assert(false); } diff --git a/vendor/simplesamlphp/simplesamlphp/modules/oauth/bin/demo.php b/vendor/simplesamlphp/simplesamlphp/modules/oauth/bin/demo.php deleted file mode 100755 index a495219698..0000000000 --- a/vendor/simplesamlphp/simplesamlphp/modules/oauth/bin/demo.php +++ /dev/null @@ -1,63 +0,0 @@ -#!/usr/bin/env php -<?php - - -function _readline($prompt = '') { - echo $prompt; - return rtrim( fgets( STDIN ), "\n" ); -} - -try { - - - // This is the base directory of the SimpleSAMLphp installation - $baseDir = dirname(dirname(dirname(dirname(__FILE__)))); - - // Add library autoloader. - require_once($baseDir . '/lib/_autoload.php'); - - - require_once(dirname(dirname(__FILE__)) . '/libextinc/OAuth.php'); - - // Needed in order to make session_start to be called before output is printed. - $session = SimpleSAML_Session::getSessionFromRequest(); - - $baseurl = (isset($_SERVER['argv'][1]) ? $_SERVER['argv'][1] : 'http://mars.foodle.local/simplesaml'); - $key = (isset($_SERVER['argv'][2]) ? $_SERVER['argv'][2] : 'key'); - $secret = (isset($_SERVER['argv'][3]) ? $_SERVER['argv'][3] : 'secret'); - - echo 'Welcome to the OAuth CLI client' . "\n"; - $consumer = new sspmod_oauth_Consumer($key, $secret); - - // Get the request token - $requestToken = $consumer->getRequestToken($baseurl . '/module.php/oauth/requestToken.php'); - echo "Got a request token from the OAuth service provider [" . $requestToken->key . "] with the secret [" . $requestToken->secret . "]\n"; - - // Authorize the request token - $url = $consumer->getAuthorizeRequest($baseurl . '/module.php/oauth/authorize.php', $requestToken, FALSE); - - echo('Go to this URL to authenticate/authorize the request: ' . $url . "\n"); - system('open ' . $url); - - _readline('Click enter when you have completed the authorization step using your web browser...'); - - // Replace the request token with an access token - $accessToken = $consumer->getAccessToken( $baseurl . '/module.php/oauth/accessToken.php', $requestToken); - echo "Got an access token from the OAuth service provider [" . $accessToken->key . "] with the secret [" . $accessToken->secret . "]\n"; - - $userdata = $consumer->getUserInfo($baseurl . '/module.php/oauth/getUserInfo.php', $accessToken); - - - echo 'You are successfully authenticated to this Command Line CLI. ' . "\n"; - echo 'Got data [' . join(', ', array_keys($userdata)) . ']' . "\n"; - echo 'Your user ID is : ' . $userdata['eduPersonPrincipalName'][0] . "\n"; - -} catch(Exception $e) { - echo 'Error occurred: ' . $e->getMessage() . "\n\n"; -} - - - - - - diff --git a/vendor/simplesamlphp/simplesamlphp/modules/oauth/config-template/module_oauth.php b/vendor/simplesamlphp/simplesamlphp/modules/oauth/config-template/module_oauth.php index 41b46d5bbc..63327d6be9 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/oauth/config-template/module_oauth.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/oauth/config-template/module_oauth.php @@ -1,28 +1,24 @@ <?php -/* +/* * Configuration for the OAuth module. - * + * */ -$config = array ( +$config = [ + /* Enable the getUserInfo endpoint. Do not enable unless you know what you do. + * It may give external parties access to userInfo unless properly secured. + */ + 'getUserInfo.enable' => true, - /* Enable the getUserInfo endpoint. Do not enable unless you know what you do. - * It may give external parties access to userInfo unless properly secured. - */ - 'getUserInfo.enable' => TRUE, - - 'requestTokenDuration' => 60*30, // 30 minutes - 'accessTokenDuration' => 60*60*24, // 24 hours - 'nonceCache' => 60*60*24*14, // 14 days + 'requestTokenDuration' => 60 * 30, // 30 minutes + 'accessTokenDuration' => 60 * 60 * 24, // 24 hours + 'nonceCache' => 60 * 60 * 24 * 14, // 14 days + // Tag to run storage cleanup script using the cron module... + 'cron_tag' => 'hourly', - // Tag to run storage cleanup script using the cron module... - 'cron_tag' => 'hourly', - - // auth is the idp to use for admin authentication, - // useridattr is the attribute-name that contains the userid as returned from idp - 'auth' => 'default-sp', - 'useridattr', 'user', - -); - + // auth is the idp to use for admin authentication, + // useridattr is the attribute-name that contains the userid as returned from idp + 'auth' => 'default-sp', + 'useridattr', 'user', +]; diff --git a/vendor/simplesamlphp/simplesamlphp/modules/oauth/hooks/hook_cron.php b/vendor/simplesamlphp/simplesamlphp/modules/oauth/hooks/hook_cron.php index 0287b6185e..1a37cb41d6 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/oauth/hooks/hook_cron.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/oauth/hooks/hook_cron.php @@ -1,29 +1,33 @@ <?php + /** * Hook to run a cron job. * * @param array &$croninfo Output */ -function oauth_hook_cron(&$croninfo) { - assert('is_array($croninfo)'); - assert('array_key_exists("summary", $croninfo)'); - assert('array_key_exists("tag", $croninfo)'); - $oauthconfig = SimpleSAML_Configuration::getOptionalConfig('module_statistics.php'); - - if (is_null($oauthconfig->getValue('cron_tag', 'hourly'))) return; - if ($oauthconfig->getValue('cron_tag', NULL) !== $croninfo['tag']) return; - - try { - $store = new sspmod_core_Storage_SQLPermanentStorage('oauth'); - $cleaned = $store->removeExpired(); - -# if ($cleaned > 0) - $croninfo['summary'][] = 'OAuth clean up. Removed ' . $cleaned . ' expired entries from OAuth storage.'; - - } catch (Exception $e) { - $message = 'OAuth clean up cron script failed: ' . $e->getMessage(); - SimpleSAML\Logger::warning($message); - $croninfo['summary'][] = $message; - } +function oauth_hook_cron(&$croninfo) +{ + assert(is_array($croninfo)); + assert(array_key_exists('summary', $croninfo)); + assert(array_key_exists('tag', $croninfo)); + + $oauthconfig = \SimpleSAML\Configuration::getOptionalConfig('module_statistics.php'); + + if (is_null($oauthconfig->getValue('cron_tag', 'hourly'))) { + return; + } + if ($oauthconfig->getValue('cron_tag', null) !== $croninfo['tag']) { + return; + } + + try { + $store = new \SimpleSAML\Module\core\Storage\SQLPermanentStorage('oauth'); + $cleaned = $store->removeExpired(); + $croninfo['summary'][] = 'OAuth clean up. Removed '.$cleaned.' expired entries from OAuth storage.'; + } catch (\Exception $e) { + $message = 'OAuth clean up cron script failed: '.$e->getMessage(); + \SimpleSAML\Logger::warning($message); + $croninfo['summary'][] = $message; + } } diff --git a/vendor/simplesamlphp/simplesamlphp/modules/oauth/hooks/hook_frontpage.php b/vendor/simplesamlphp/simplesamlphp/modules/oauth/hooks/hook_frontpage.php index 286c27d736..028e11c85d 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/oauth/hooks/hook_frontpage.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/oauth/hooks/hook_frontpage.php @@ -4,14 +4,13 @@ * * @param array &$links The links on the frontpage, split into sections. */ -function oauth_hook_frontpage(&$links) { - assert('is_array($links)'); - assert('array_key_exists("links", $links)'); - - $links['federation']['oauthregistry'] = array( - 'href' => SimpleSAML\Module::getModuleURL('oauth/registry.php'), - 'text' => array('en' => 'OAuth Consumer Registry'), - 'shorttext' => array('en' => 'OAuth Registry'), - ); +function oauth_hook_frontpage(&$links) +{ + assert(is_array($links)); + assert(array_key_exists('links', $links)); + $links['federation']['oauthregistry'] = [ + 'href' => SimpleSAML\Module::getModuleURL('oauth/registry.php'), + 'text' => '{core:frontpage:link_oauth}', + ]; } diff --git a/vendor/simplesamlphp/simplesamlphp/modules/oauth/lib/Consumer.php b/vendor/simplesamlphp/simplesamlphp/modules/oauth/lib/Consumer.php index 4a8f48b975..b3a4080ae6 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/oauth/lib/Consumer.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/oauth/lib/Consumer.php @@ -1,6 +1,8 @@ <?php -require_once(dirname(dirname(__FILE__)) . '/libextinc/OAuth.php'); +namespace SimpleSAML\Module\oauth; + +require_once(dirname(dirname(__FILE__)).'/libextinc/OAuth.php'); /** * OAuth Consumer @@ -8,158 +10,170 @@ * @author Andreas Åkre Solberg, <andreas.solberg@uninett.no>, UNINETT AS. * @package SimpleSAMLphp */ -class sspmod_oauth_Consumer { - - private $consumer; - private $signer; - - public function __construct($key, $secret) { - $this->consumer = new OAuthConsumer($key, $secret, NULL); - $this->signer = new OAuthSignatureMethod_HMAC_SHA1(); - } - - // Used only to load the libextinc library early - public static function dummy() {} - - - public static function getOAuthError($hrh) { - foreach($hrh AS $h) { - if (preg_match('|OAuth-Error:\s([^;]*)|i', $h, $matches)) { - return $matches[1]; - } - } - return null; - } - - public static function getContentType($hrh) { - foreach($hrh AS $h) { - if (preg_match('|Content-Type:\s([^;]*)|i', $h, $matches)) { - return $matches[1]; - } - } - return null; - } - - /* - * This static helper function wraps file_get_contents - * and throws an exception with diagnostics messages if it appear - * to be failing on an OAuth endpoint. - * - * If the status code is not 200, an exception is thrown. If the content-type - * of the response if text/plain, the content of the response is included in - * the text of the Exception thrown. - */ - public static function getHTTP($url, $context = '') { - $response = @file_get_contents($url); - - if ($response === FALSE) { - $statuscode = 'unknown'; - if (preg_match('/^HTTP.*\s([0-9]{3})/', $http_response_header[0], $matches)) $statuscode = $matches[1]; - - $error = $context . ' [statuscode: ' . $statuscode . ']: '; - $contenttype = self::getContentType($http_response_header); - $oautherror = self::getOAuthError($http_response_header); - - if (!empty($oautherror)) $error .= $oautherror; - - throw new Exception($error . ':' . $url); - } - // Fall back to return response, if could not reckognize HTTP header. Should not happen. - return $response; - } - - public function getRequestToken($url, $parameters = NULL) { - $req_req = OAuthRequest::from_consumer_and_token($this->consumer, NULL, "GET", $url, $parameters); - $req_req->sign_request($this->signer, $this->consumer, NULL); - - $response_req = self::getHTTP($req_req->to_url(), - 'Contacting request_token endpoint on the OAuth Provider'); - - parse_str($response_req, $responseParsed); - - if(array_key_exists('error', $responseParsed)) - throw new Exception('Error getting request token: ' . $responseParsed['error']); - - $requestToken = $responseParsed['oauth_token']; - $requestTokenSecret = $responseParsed['oauth_token_secret']; - - return new OAuthToken($requestToken, $requestTokenSecret); - } - - public function getAuthorizeRequest($url, $requestToken, $redirect = TRUE, $callback = NULL) { - $params = array('oauth_token' => $requestToken->key); - if ($callback) { - $params['oauth_callback'] = $callback; - } - $authorizeURL = \SimpleSAML\Utils\HTTP::addURLParameters($url, $params); - if ($redirect) { - \SimpleSAML\Utils\HTTP::redirectTrustedURL($authorizeURL); - exit; - } - return $authorizeURL; - } - - public function getAccessToken($url, $requestToken, $parameters = NULL) { - - $acc_req = OAuthRequest::from_consumer_and_token($this->consumer, $requestToken, "GET", $url, $parameters); - $acc_req->sign_request($this->signer, $this->consumer, $requestToken); - - $response_acc = file_get_contents($acc_req->to_url()); - if ($response_acc === FALSE) { - throw new Exception('Error contacting request_token endpoint on the OAuth Provider'); - } - - SimpleSAML\Logger::debug('oauth: Reponse to get access token: '. $response_acc); - - parse_str($response_acc, $accessResponseParsed); - - if(array_key_exists('error', $accessResponseParsed)) - throw new Exception('Error getting request token: ' . $accessResponseParsed['error']); - - $accessToken = $accessResponseParsed['oauth_token']; - $accessTokenSecret = $accessResponseParsed['oauth_token_secret']; - - return new OAuthToken($accessToken, $accessTokenSecret); - } - - public function postRequest($url, $accessToken, $parameters) { - $data_req = OAuthRequest::from_consumer_and_token($this->consumer, $accessToken, "POST", $url, $parameters); - $data_req->sign_request($this->signer, $this->consumer, $accessToken); - $postdata = $data_req->to_postdata(); - - $opts = array( - 'ssl' => array( - 'verify_peer' => FALSE, - 'capture_peer_cert' => TRUE, - 'capture_peer_chain' => TRUE, - ), - 'http' => array( - 'method' => 'POST', - 'content' => $postdata, - 'header' => 'Content-Type: application/x-www-form-urlencoded', - ), - ); - $context = stream_context_create($opts); - $response = file_get_contents($url, FALSE, $context); - if ($response === FALSE) { - throw new SimpleSAML_Error_Exception('Failed to push definition file to ' . $url); - } - return $response; - } - - public function getUserInfo($url, $accessToken, $opts = NULL) { - - $data_req = OAuthRequest::from_consumer_and_token($this->consumer, $accessToken, "GET", $url, NULL); - $data_req->sign_request($this->signer, $this->consumer, $accessToken); - - if (is_array($opts)) { - $opts = stream_context_create($opts); - } - $data = file_get_contents($data_req->to_url(), FALSE, $opts); - - $dataDecoded = json_decode($data, TRUE); - return $dataDecoded; - } - -} +class Consumer +{ + private $consumer; + private $signer; + + public function __construct($key, $secret) + { + $this->consumer = new \OAuthConsumer($key, $secret, null); + $this->signer = new \OAuthSignatureMethod_HMAC_SHA1(); + } + + // Used only to load the libextinc library early + public static function dummy() + { + } + + public static function getOAuthError($hrh) + { + foreach ($hrh as $h) { + if (preg_match('|OAuth-Error:\s([^;]*)|i', $h, $matches)) { + return $matches[1]; + } + } + return null; + } + + public static function getContentType($hrh) + { + foreach ($hrh as $h) { + if (preg_match('|Content-Type:\s([^;]*)|i', $h, $matches)) { + return $matches[1]; + } + } + return null; + } + + /* + * This static helper function wraps \SimpleSAML\Utils\HTTP::fetch + * and throws an exception with diagnostics messages if it appear + * to be failing on an OAuth endpoint. + * + * If the status code is not 200, an exception is thrown. If the content-type + * of the response if text/plain, the content of the response is included in + * the text of the Exception thrown. + */ + public static function getHTTP($url, $context = '') + { + try { + $response = \SimpleSAML\Utils\HTTP::fetch($url); + } catch (\SimpleSAML\Error\Exception $e) { + $statuscode = 'unknown'; + if (preg_match('/^HTTP.*\s([0-9]{3})/', $http_response_header[0], $matches)) { + $statuscode = $matches[1]; + } + + $error = $context.' [statuscode: '.$statuscode.']: '; + $oautherror = self::getOAuthError($http_response_header); + + if (!empty($oautherror)) { + $error .= $oautherror; + } + + throw new \Exception($error.':'.$url); + } + // Fall back to return response, if could not reckognize HTTP header. Should not happen. + return $response; + } + + public function getRequestToken($url, $parameters = null) + { + $req_req = \OAuthRequest::from_consumer_and_token($this->consumer, null, "GET", $url, $parameters); + $req_req->sign_request($this->signer, $this->consumer, null); + + $response_req = self::getHTTP( + $req_req->to_url(), + 'Contacting request_token endpoint on the OAuth Provider' + ); + + parse_str($response_req, $responseParsed); + + if (array_key_exists('error', $responseParsed)) { + throw new \Exception('Error getting request token: '.$responseParsed['error']); + } + + $requestToken = $responseParsed['oauth_token']; + $requestTokenSecret = $responseParsed['oauth_token_secret']; + + return new \OAuthToken($requestToken, $requestTokenSecret); + } + + public function getAuthorizeRequest($url, $requestToken, $redirect = true, $callback = null) + { + $params = ['oauth_token' => $requestToken->key]; + if ($callback) { + $params['oauth_callback'] = $callback; + } + $authorizeURL = \SimpleSAML\Utils\HTTP::addURLParameters($url, $params); + if ($redirect) { + \SimpleSAML\Utils\HTTP::redirectTrustedURL($authorizeURL); + exit; + } + return $authorizeURL; + } + + public function getAccessToken($url, $requestToken, $parameters = null) + { + $acc_req = \OAuthRequest::from_consumer_and_token($this->consumer, $requestToken, "GET", $url, $parameters); + $acc_req->sign_request($this->signer, $this->consumer, $requestToken); + + try { + $response_acc = \SimpleSAML\Utils\HTTP::fetch($acc_req->to_url()); + } catch (\SimpleSAML\Error\Exception $e) { + throw new \Exception('Error contacting request_token endpoint on the OAuth Provider'); + } + + \SimpleSAML\Logger::debug('oauth: Reponse to get access token: '.$response_acc); + + parse_str($response_acc, $accessResponseParsed); + + if (array_key_exists('error', $accessResponseParsed)) { + throw new \Exception('Error getting request token: '.$accessResponseParsed['error']); + } + + $accessToken = $accessResponseParsed['oauth_token']; + $accessTokenSecret = $accessResponseParsed['oauth_token_secret']; + + return new \OAuthToken($accessToken, $accessTokenSecret); + } + + public function postRequest($url, $accessToken, $parameters) + { + $data_req = \OAuthRequest::from_consumer_and_token($this->consumer, $accessToken, "POST", $url, $parameters); + $data_req->sign_request($this->signer, $this->consumer, $accessToken); + $postdata = $data_req->to_postdata(); + + $opts = [ + 'ssl' => [ + 'verify_peer' => false, + 'capture_peer_cert' => true, + 'capture_peer_chain' => true + ], + 'http' => [ + 'method' => 'POST', + 'content' => $postdata, + 'header' => 'Content-Type: application/x-www-form-urlencoded', + ], + ]; + + try { + $response = \SimpleSAML\Utils\HTTP::fetch($url, $opts); + } catch (\SimpleSAML\Error\Exception $e) { + throw new \SimpleSAML\Error\Exception('Failed to push definition file to '.$url); + } + return $response; + } + + public function getUserInfo($url, $accessToken, $opts = null) + { + $data_req = \OAuthRequest::from_consumer_and_token($this->consumer, $accessToken, "GET", $url, null); + $data_req->sign_request($this->signer, $this->consumer, $accessToken); + + $data = \SimpleSAML\Utils\HTTP::fetch($data_req->to_url(), $opts); + + return json_decode($data, true); + } +} diff --git a/vendor/simplesamlphp/simplesamlphp/modules/oauth/lib/OAuthServer.php b/vendor/simplesamlphp/simplesamlphp/modules/oauth/lib/OAuthServer.php index 03d04fe30e..41e60383ad 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/oauth/lib/OAuthServer.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/oauth/lib/OAuthServer.php @@ -1,6 +1,8 @@ <?php -require_once(dirname(dirname(__FILE__)) . '/libextinc/OAuth.php'); +namespace SimpleSAML\Module\oauth; + +require_once(dirname(dirname(__FILE__)).'/libextinc/OAuth.php'); /** * OAuth Provider implementation.. @@ -8,9 +10,16 @@ * @author Andreas Åkre Solberg, <andreas.solberg@uninett.no>, UNINETT AS. * @package SimpleSAMLphp */ -class sspmod_oauth_OAuthServer extends OAuthServer { - public function get_signature_methods() { - return $this->signature_methods; - } -} +class OAuthServer extends \OAuthServer +{ + public function __construct($store) + { + parent::__construct($store); + } + + public function get_signature_methods() + { + return $this->signature_methods; + } +} diff --git a/vendor/simplesamlphp/simplesamlphp/modules/oauth/lib/OAuthStore.php b/vendor/simplesamlphp/simplesamlphp/modules/oauth/lib/OAuthStore.php index 9243a341c8..b0c9d222dd 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/oauth/lib/OAuthStore.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/oauth/lib/OAuthStore.php @@ -1,186 +1,213 @@ <?php -require_once(dirname(dirname(__FILE__)) . '/libextinc/OAuth.php'); + +namespace SimpleSAML\Module\oauth; + +require_once(dirname(dirname(__FILE__)).'/libextinc/OAuth.php'); /** * OAuth Store - * - * Updated version, works with consumer-callbacks, certificates and 1.0-RevA protocol + * + * Updated version, works with consumer-callbacks, certificates and 1.0-RevA protocol * behaviour (requestToken-callbacks and verifiers) * * @author Andreas Åkre Solberg, <andreas.solberg@uninett.no>, UNINETT AS. * @author Mark Dobrinic, <mdobrinic@cozmanova.com>, Cozmanova bv * @package SimpleSAMLphp */ -class sspmod_oauth_OAuthStore extends OAuthDataStore { - - private $store; - private $config; - private $defaultversion = '1.0'; - - protected $_store_tables = array( - 'consumers' => 'consumer = array with consumer attributes', - 'nonce' => 'nonce+consumer_key = -boolean-', - 'requesttorequest' => 'requestToken.key = array(version,callback,consumerKey,)', - 'authorized' => 'requestToken.key, verifier = array(authenticated-user-attributes)', - 'access' => 'accessToken.key+consumerKey = accestoken', - 'request' => 'requestToken.key+consumerKey = requesttoken', - ); - - function __construct() { - $this->store = new sspmod_core_Storage_SQLPermanentStorage('oauth'); - $this->config = SimpleSAML_Configuration::getOptionalConfig('module_oauth.php'); + +class OAuthStore extends \OAuthDataStore +{ + private $store; + private $config; + private $defaultversion = '1.0'; + + protected $_store_tables = [ + 'consumers' => 'consumer = array with consumer attributes', + 'nonce' => 'nonce+consumer_key = -boolean-', + 'requesttorequest' => 'requestToken.key = array(version,callback,consumerKey,)', + 'authorized' => 'requestToken.key, verifier = array(authenticated-user-attributes)', + 'access' => 'accessToken.key+consumerKey = accesstoken', + 'request' => 'requestToken.key+consumerKey = requesttoken', + ]; + + + public function __construct() + { + $this->store = new \SimpleSAML\Module\core\Storage\SQLPermanentStorage('oauth'); + $this->config = \SimpleSAML\Configuration::getOptionalConfig('module_oauth.php'); } - - + + /** * Attach the data to the token, and establish the Callback URL and verifier - * @param $requestTokenKey RequestToken that was authorized - * @param $data Data that is authorized and to be attached to the requestToken + * @param string $requestTokenKey RequestToken that was authorized + * @param string $data Data that is authorized and to be attached to the requestToken * @return array(string:url, string:verifier) ; empty verifier for 1.0-response */ - public function authorize($requestTokenKey, $data) { - $url = null; - $verifier = ''; - $version = $this->defaultversion; - - // See whether to remember values from the original requestToken request: - $request_attributes = $this->store->get('requesttorequest', $requestTokenKey, ''); // must be there .. - if ($request_attributes['value']) { - // establish version to work with - $v = $request_attributes['value']['version']; - if ($v) $version = $v; - - // establish callback to use - if ($request_attributes['value']['callback']) { - $url = $request_attributes['value']['callback']; - } - } - - - // Is there a callback registered? This is leading, even over a supplied oauth_callback-parameter - $oConsumer = $this->lookup_consumer($request_attributes['value']['consumerKey']); - - if ($oConsumer && ($oConsumer->callback_url)) $url = $oConsumer->callback_url; - - $verifier = SimpleSAML\Utils\Random::generateID(); - $url = \SimpleSAML\Utils\HTTP::addURLParameters($url, array("oauth_verifier"=>$verifier)); - - $this->store->set('authorized', $requestTokenKey, $verifier, $data, $this->config->getValue('requestTokenDuration', 60*30) ); - - return array($url, $verifier); - } - - /** - * Perform lookup whether a given token exists in the list of authorized tokens; if a verifier is - * passed as well, the verifier *must* match the verifier that was registered with the token<br/> - * Note that an accessToken should never be stored with a verifier - * @param $requestToken - * @param $verifier - * @return unknown_type - */ - public function isAuthorized($requestToken, $verifier='') { - SimpleSAML\Logger::info('OAuth isAuthorized(' . $requestToken . ')'); - return $this->store->exists('authorized', $requestToken, $verifier); - } - - public function getAuthorizedData($token, $verifier = '') { - SimpleSAML\Logger::info('OAuth getAuthorizedData(' . $token . ')'); - $data = $this->store->get('authorized', $token, $verifier); - return $data['value']; - } - - public function moveAuthorizedData($requestToken, $verifier, $accessTokenKey) { - SimpleSAML\Logger::info('OAuth moveAuthorizedData(' . $requestToken . ', ' . $accessTokenKey . ')'); - - // Retrieve authorizedData from authorized.requestToken (with provider verifier) - $authorizedData = $this->getAuthorizedData($requestToken, $verifier); - - // Remove the requesttoken+verifier from authorized store - $this->store->remove('authorized', $requestToken, $verifier); - - // Add accesstoken with authorizedData to authorized store (with empty verifier) - // accessTokenKey+consumer => accessToken is already registered in 'access'-table - $this->store->set('authorized', $accessTokenKey, '', $authorizedData, $this->config->getValue('accessTokenDuration', 60*60*24)); - } - - public function lookup_consumer($consumer_key) { - SimpleSAML\Logger::info('OAuth lookup_consumer(' . $consumer_key . ')'); - if (! $this->store->exists('consumers', $consumer_key, '')) return NULL; - $consumer = $this->store->get('consumers', $consumer_key, ''); - - $callback = NULL; - if ($consumer['value']['callback_url']) $callback = $consumer['value']['callback_url']; - - if ($consumer['value']['RSAcertificate']) { - return new OAuthConsumer($consumer['value']['key'], $consumer['value']['RSAcertificate'], $callback); - } else { - return new OAuthConsumer($consumer['value']['key'], $consumer['value']['secret'], $callback); - } + public function authorize($requestTokenKey, $data) + { + $url = null; + + // See whether to remember values from the original requestToken request: + $request_attributes = $this->store->get('requesttorequest', $requestTokenKey, ''); + // must be there + if ($request_attributes['value']) { + // establish callback to use + if ($request_attributes['value']['callback']) { + $url = $request_attributes['value']['callback']; + } + } + + // Is there a callback registered? This is leading, even over a supplied oauth_callback-parameter + $oConsumer = $this->lookup_consumer($request_attributes['value']['consumerKey']); + + if ($oConsumer && ($oConsumer->callback_url)) { + $url = $oConsumer->callback_url; + } + + $verifier = \SimpleSAML\Utils\Random::generateID(); + $url = \SimpleSAML\Utils\HTTP::addURLParameters($url, ["oauth_verifier"=>$verifier]); + + $this->store->set('authorized', $requestTokenKey, $verifier, $data, $this->config->getValue('requestTokenDuration', 1800)); //60*30=1800 + + return [$url, $verifier]; + } + + /** + * Perform lookup whether a given token exists in the list of authorized tokens; if a verifier is + * passed as well, the verifier *must* match the verifier that was registered with the token<br/> + * Note that an accessToken should never be stored with a verifier + * @param string $requestToken + * @param string $verifier + * @return bool + */ + public function isAuthorized($requestToken, $verifier = '') + { + \SimpleSAML\Logger::info('OAuth isAuthorized('.$requestToken.')'); + return $this->store->exists('authorized', $requestToken, $verifier); } - function lookup_token($consumer, $tokenType = 'default', $token) { - SimpleSAML\Logger::info('OAuth lookup_token(' . $consumer->key . ', ' . $tokenType. ',' . $token . ')'); - $data = $this->store->get($tokenType, $token, $consumer->key); - if ($data == NULL) throw new Exception('Could not find token'); - return $data['value']; + public function getAuthorizedData($token, $verifier = '') + { + \SimpleSAML\Logger::info('OAuth getAuthorizedData('.$token.')'); + $data = $this->store->get('authorized', $token, $verifier); + return $data['value']; } - function lookup_nonce($consumer, $token, $nonce, $timestamp) { - SimpleSAML\Logger::info('OAuth lookup_nonce(' . $consumer . ', ' . $token. ',' . $nonce . ')'); - if ($this->store->exists('nonce', $nonce, $consumer->key)) return TRUE; - $this->store->set('nonce', $nonce, $consumer->key, TRUE, $this->config->getValue('nonceCache', 60*60*24*14)); - return FALSE; + public function moveAuthorizedData($requestToken, $verifier, $accessTokenKey) + { + \SimpleSAML\Logger::info('OAuth moveAuthorizedData('.$requestToken.', '.$accessTokenKey.')'); + + // Retrieve authorizedData from authorized.requestToken (with provider verifier) + $authorizedData = $this->getAuthorizedData($requestToken, $verifier); + + // Remove the requesttoken+verifier from authorized store + $this->store->remove('authorized', $requestToken, $verifier); + + // Add accesstoken with authorizedData to authorized store (with empty verifier) + // accessTokenKey+consumer => accessToken is already registered in 'access'-table + $this->store->set('authorized', $accessTokenKey, '', $authorizedData, $this->config->getValue('accessTokenDuration', 86400)); //60*60*24=86400 + } + + public function lookup_consumer($consumer_key) + { + \SimpleSAML\Logger::info('OAuth lookup_consumer('.$consumer_key.')'); + if (!$this->store->exists('consumers', $consumer_key, '')) { + return null; + } + $consumer = $this->store->get('consumers', $consumer_key, ''); + + $callback = null; + if ($consumer['value']['callback_url']) { + $callback = $consumer['value']['callback_url']; + } + + if ($consumer['value']['RSAcertificate']) { + return new \OAuthConsumer($consumer['value']['key'], $consumer['value']['RSAcertificate'], $callback); + } else { + return new \OAuthConsumer($consumer['value']['key'], $consumer['value']['secret'], $callback); + } } - function new_request_token($consumer, $callback = null, $version = null) { - SimpleSAML\Logger::info('OAuth new_request_token(' . $consumer . ')'); - - $lifetime = $this->config->getValue('requestTokenDuration', 60*30); - - $token = new OAuthToken(SimpleSAML\Utils\Random::generateID(), SimpleSAML\Utils\Random::generateID()); - $token->callback = $callback; // OAuth1.0-RevA - $this->store->set('request', $token->key, $consumer->key, $token, $lifetime); - - // also store in requestToken->key => array('callback'=>CallbackURL, 'version'=>oauth_version - $request_attributes = array( - 'callback' => $callback, - 'version' => ($version?$version:$this->defaultversion), - 'consumerKey' => $consumer->key, - ); - $this->store->set('requesttorequest', $token->key, '', $request_attributes, $lifetime); - - // also store in requestToken->key => Consumer->key (enables consumer-lookup during reqToken-authorization stage) - $this->store->set('requesttoconsumer', $token->key, '', $consumer->key, $lifetime); - + public function lookup_token($consumer, $tokenType = 'default', $token) + { + \SimpleSAML\Logger::info('OAuth lookup_token('.$consumer->key.', '.$tokenType.','.$token.')'); + $data = $this->store->get($tokenType, $token, $consumer->key); + if ($data == null) { + throw new \Exception('Could not find token'); + } + return $data['value']; + } + + public function lookup_nonce($consumer, $token, $nonce, $timestamp) + { + \SimpleSAML\Logger::info('OAuth lookup_nonce('.$consumer.', '.$token.','.$nonce.')'); + if ($this->store->exists('nonce', $nonce, $consumer->key)) { + return true; + } + $this->store->set('nonce', $nonce, $consumer->key, true, $this->config->getValue('nonceCache', 1209600)); //60*60*24*14=1209600 + return false; + } + + public function new_request_token($consumer, $callback = null, $version = null) + { + \SimpleSAML\Logger::info('OAuth new_request_token('.$consumer.')'); + + $lifetime = $this->config->getValue('requestTokenDuration', 1800); //60*30 + + $token = new \OAuthToken(\SimpleSAML\Utils\Random::generateID(), \SimpleSAML\Utils\Random::generateID()); + $token->callback = $callback; // OAuth1.0-RevA + $this->store->set('request', $token->key, $consumer->key, $token, $lifetime); + + // also store in requestToken->key => array('callback'=>CallbackURL, 'version'=>oauth_version + $request_attributes = [ + 'callback' => $callback, + 'version' => ($version ? $version : $this->defaultversion), + 'consumerKey' => $consumer->key, + ]; + $this->store->set('requesttorequest', $token->key, '', $request_attributes, $lifetime); + + /* also store in requestToken->key => + * Consumer->key (enables consumer-lookup during reqToken-authorization stage) + */ + $this->store->set('requesttoconsumer', $token->key, '', $consumer->key, $lifetime); + return $token; } - function new_access_token($requestToken, $consumer, $verifier = null) { - SimpleSAML\Logger::info('OAuth new_access_token(' . $requestToken . ',' . $consumer . ')'); - $accestoken = new OAuthToken(SimpleSAML\Utils\Random::generateID(), SimpleSAML\Utils\Random::generateID()); - $this->store->set('access', $accestoken->key, $consumer->key, $accestoken, $this->config->getValue('accessTokenDuration', 60*60*24) ); - return $accestoken; + public function new_access_token($requestToken, $consumer, $verifier = null) + { + \SimpleSAML\Logger::info('OAuth new_access_token('.$requestToken.','.$consumer.')'); + $accesstoken = new \OAuthToken(\SimpleSAML\Utils\Random::generateID(), \SimpleSAML\Utils\Random::generateID()); + $this->store->set( + 'access', + $accesstoken->key, + $consumer->key, + $accesstoken, + $this->config->getValue('accessTokenDuration', 86400) //60*60*24=86400 + ); + return $accesstoken; } - + /** * Return OAuthConsumer-instance that a given requestToken was issued to - * @param $requestTokenKey - * @return unknown_type + * @param string $requestTokenKey + * @return mixed */ - public function lookup_consumer_by_requestToken($requestTokenKey) { - SimpleSAML\Logger::info('OAuth lookup_consumer_by_requestToken(' . $requestTokenKey . ')'); - if (! $this->store->exists('requesttorequest', $requestTokenKey, '')) return NULL; - - $request = $this->store->get('requesttorequest', $requestTokenKey, ''); - $consumerKey = $request['value']['consumerKey']; - if (! $consumerKey) { - return NULL; - } - - $consumer = $this->store->get('consumers', $consumerKey['value'], ''); - return $consumer['value']; - } - - + public function lookup_consumer_by_requestToken($requestTokenKey) + { + \SimpleSAML\Logger::info('OAuth lookup_consumer_by_requestToken('.$requestTokenKey.')'); + if (!$this->store->exists('requesttorequest', $requestTokenKey, '')) { + return null; + } + $request = $this->store->get('requesttorequest', $requestTokenKey, ''); + $consumerKey = $request['value']['consumerKey']; + if (!$consumerKey) { + return null; + } + + $consumer = $this->store->get('consumers', $consumerKey['value'], ''); + return $consumer['value']; + } } diff --git a/vendor/simplesamlphp/simplesamlphp/modules/oauth/lib/Registry.php b/vendor/simplesamlphp/simplesamlphp/modules/oauth/lib/Registry.php index b2bc33bb9c..0939be6f41 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/oauth/lib/Registry.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/oauth/lib/Registry.php @@ -1,133 +1,151 @@ <?php +namespace SimpleSAML\Module\oauth; + /** * Editor for OAuth Client Registry * * @author Andreas Åkre Solberg <andreas@uninett.no>, UNINETT AS. * @package SimpleSAMLphp */ -class sspmod_oauth_Registry { - - - protected function getStandardField($request, &$entry, $key) { - if (array_key_exists('field_' . $key, $request)) { - $entry[$key] = $request['field_' . $key]; - } else { - if (isset($entry[$key])) unset($entry[$key]); - } - } - - public function formToMeta($request, $entry = array(), $override = NULL) { - $this->getStandardField($request, $entry, 'name'); - $this->getStandardField($request, $entry, 'description'); - $this->getStandardField($request, $entry, 'key'); - $this->getStandardField($request, $entry, 'secret'); - $this->getStandardField($request, $entry, 'RSAcertificate'); - $this->getStandardField($request, $entry, 'callback_url'); - - if ($override) { - foreach($override AS $key => $value) { - $entry[$key] = $value; - } - } - - return $entry; - } - - protected function requireStandardField($request, $key) { - if (!array_key_exists('field_' . $key, $request)) - throw new Exception('Required field [' . $key . '] was missing.'); - if (empty($request['field_' . $key])) - throw new Exception('Required field [' . $key . '] was empty.'); - } - - public function checkForm($request) { - $this->requireStandardField($request, 'name'); - $this->requireStandardField($request, 'description'); - $this->requireStandardField($request, 'key'); - } - - - protected function header($name) { - return '<tr ><td> </td><td class="header">' . $name . '</td></tr>'; - - } - - protected function readonlyDateField($metadata, $key, $name) { - $value = '<span style="color: #aaa">Not set</a>'; - if (array_key_exists($key, $metadata)) - $value = date('j. F Y, G:i', $metadata[$key]); - return '<tr> - <td class="name">' . $name . '</td> - <td class="data">' . $value . '</td></tr>'; - - } - - protected function readonlyField($metadata, $key, $name) { - $value = ''; - if (array_key_exists($key, $metadata)) - $value = $metadata[$key]; - return '<tr> - <td class="name">' . $name . '</td> - <td class="data">' . htmlspecialchars($value) . '</td></tr>'; - - } - - protected function hiddenField($key, $value) { - return '<input type="hidden" name="' . $key . '" value="' . htmlspecialchars($value) . '" />'; - } - - protected function flattenLanguageField(&$metadata, $key) { - if (array_key_exists($key, $metadata)) { - if (is_array($metadata[$key])) { - if (isset($metadata[$key]['en'])) { - $metadata[$key] = $metadata[$key]['en']; - } else { - unset($metadata[$key]); - } - } - } - } - - protected function standardField($metadata, $key, $name, $textarea = FALSE) { - $value = ''; - if (array_key_exists($key, $metadata)) { - $value = htmlspecialchars($metadata[$key]); - } - - if ($textarea) { - return '<tr><td class="name">' . $name . '</td><td class="data"> - <textarea name="field_' . $key . '" rows="5" cols="50">' . $value . '</textarea></td></tr>'; - - } else { - return '<tr><td class="name">' . $name . '</td><td class="data"> - <input type="text" size="60" name="field_' . $key . '" value="' . $value . '" /></td></tr>'; - - } - } - - public function metaToForm($metadata) { - return '<form action="registry.edit.php" method="post">' . - '<div id="tabdiv">' . - '<ul>' . - '<li><a href="#basic">Name and descrition</a></li>' . - '</ul>' . - '<div id="basic"><table class="formtable">' . - $this->standardField($metadata, 'name', 'Name of client') . - $this->standardField($metadata, 'description', 'Description of client', TRUE) . - $this->readonlyField($metadata, 'owner', 'Owner') . - $this->standardField($metadata, 'key', 'Consumer Key') . - $this->readonlyField($metadata, 'secret', 'Consumer Secret<br/>(Used for HMAC_SHA1 signatures)') . - $this->standardField($metadata, 'RSAcertificate', 'RSA certificate (PEM)<br/>(Used for RSA_SHA1 signatures)', TRUE) . - $this->standardField($metadata, 'callback_url', 'Static/enforcing callback-url') . - $this->hiddenField('field_secret', $metadata['secret']) . - - '</table></div>' . - '</div>' . - '<input type="submit" name="submit" value="Save" style="margin-top: 5px" />' . - '</form>'; - } - -} +class Registry +{ + public static function requireOwnership($entry, $userid) + { + if (!isset($entry['owner'])) { + throw new \Exception('OAuth Consumer has no owner. Which means no one is granted access, not even you.'); + } elseif ($entry['owner'] !== $userid) { + throw new \Exception( + 'OAuth Consumer has an owner that is not equal to your userid, hence you are not granted access.' + ); + } + } + + protected function getStandardField($request, &$entry, $key) + { + if (array_key_exists('field_'.$key, $request)) { + $entry[$key] = $request['field_'.$key]; + } elseif (isset($entry[$key])) { + unset($entry[$key]); + } + } + + public function formToMeta($request, $entry = [], $override = null) + { + $this->getStandardField($request, $entry, 'name'); + $this->getStandardField($request, $entry, 'description'); + $this->getStandardField($request, $entry, 'key'); + $this->getStandardField($request, $entry, 'secret'); + $this->getStandardField($request, $entry, 'RSAcertificate'); + $this->getStandardField($request, $entry, 'callback_url'); + + if ($override) { + foreach ($override as $key => $value) { + $entry[$key] = $value; + } + } + return $entry; + } + + protected function requireStandardField($request, $key) + { + if (!array_key_exists('field_'.$key, $request)) { + throw new \Exception('Required field ['.$key.'] was missing.'); + } + if (empty($request['field_'.$key])) { + throw new \Exception('Required field ['.$key.'] was empty.'); + } + } + + public function checkForm($request) + { + $this->requireStandardField($request, 'name'); + $this->requireStandardField($request, 'description'); + $this->requireStandardField($request, 'key'); + } + + protected function header($name) + { + return '<tr><td> </td><td class="header">'.$name.'</td></tr>'; + } + protected function readonlyDateField($metadata, $key, $name) + { + $value = '<span style="color: #aaa">Not set</a>'; + if (array_key_exists($key, $metadata)) { + $value = date('j. F Y, G:i', $metadata[$key]); + } + return '<tr><td class="name">'.$name.'</td><td class="data">'.$value.'</td></tr>'; + } + + protected function readonlyField($metadata, $key, $name) + { + $value = ''; + if (array_key_exists($key, $metadata)) { + $value = $metadata[$key]; + } + return '<tr><td class="name">'.$name.'</td><td class="data">'.htmlspecialchars($value).'</td></tr>'; + } + + protected function hiddenField($key, $value) + { + return '<input type="hidden" name="'.$key.'" value="'.htmlspecialchars($value).'" />'; + } + + protected function flattenLanguageField(&$metadata, $key) + { + if (array_key_exists($key, $metadata)) { + if (is_array($metadata[$key])) { + if (isset($metadata[$key]['en'])) { + $metadata[$key] = $metadata[$key]['en']; + } else { + unset($metadata[$key]); + } + } + } + } + + protected function standardField($metadata, $key, $name, $textarea = false) + { + $value = ''; + if (array_key_exists($key, $metadata)) { + $value = htmlspecialchars($metadata[$key]); + } + + if ($textarea) { + return '<tr><td class="name">'.$name.'</td><td class="data"> + <textarea name="field_'.$key.'" rows="5" cols="50">'.$value.'</textarea></td></tr>'; + } else { + return '<tr><td class="name">'.$name.'</td><td class="data"> + <input type="text" size="60" name="field_'.$key.'" value="'.$value.'" /></td></tr>'; + } + } + + public function metaToForm($metadata) + { + return '<form action="registry.edit.php" method="post">'. + '<div id="tabdiv">'. + '<ul class="tabset_tabs">'. + '<li class="tab-link current" data-tab="basic"><a href="#basic">Name and description</a></li>'. + '</ul>'. + '<div id="basic" class="tabset_content current"><table class="formtable">'. + $this->standardField($metadata, 'name', 'Name of client'). + $this->standardField($metadata, 'description', 'Description of client', true). + $this->readonlyField($metadata, 'owner', 'Owner'). + $this->standardField($metadata, 'key', 'Consumer Key'). + $this->readonlyField($metadata, 'secret', 'Consumer Secret<br />(Used for HMAC_SHA1 signatures)'). + $this->standardField( + $metadata, + 'RSAcertificate', + 'RSA certificate (PEM)<br />(Used for RSA_SHA1 signatures)', + true + ). + $this->standardField($metadata, 'callback_url', 'Static/enforcing callback-url'). + '</table></div>'. + '</div>'. + $this->hiddenField('field_secret', $metadata['secret']). + '<input type="submit" name="submit" value="Save" style="margin-top: 5px" />'. + '</form>'; + } +} diff --git a/vendor/simplesamlphp/simplesamlphp/modules/oauth/libextinc/OAuth.php b/vendor/simplesamlphp/simplesamlphp/modules/oauth/libextinc/OAuth.php index 24e68382a9..c8811d6ce1 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/oauth/libextinc/OAuth.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/oauth/libextinc/OAuth.php @@ -12,29 +12,35 @@ /* * Generic exception class */ - class OAuthException extends Exception { + class OAuthException extends Exception + { // pass } } if (!class_exists('OAuthConsumer')) { - class OAuthConsumer { + class OAuthConsumer + { public $key; public $secret; + public $callback_url; - function __construct($key, $secret, $callback_url=NULL) { + public function __construct($key, $secret, $callback_url = null) + { $this->key = $key; $this->secret = $secret; $this->callback_url = $callback_url; } - function __toString() { + public function __toString() + { return "OAuthConsumer[key=$this->key,secret=$this->secret]"; } } } -class OAuthToken { +class OAuthToken +{ // access tokens and request tokens public $key; public $secret; @@ -43,7 +49,8 @@ class OAuthToken { * key = the token * secret = the token secret */ - function __construct($key, $secret) { + public function __construct($key, $secret) + { $this->key = $key; $this->secret = $secret; } @@ -52,15 +59,17 @@ function __construct($key, $secret) { * generates the basic string serialization of a token that a server * would respond to request_token and access_token calls with */ - function to_string() { - return "oauth_token=" . - OAuthUtil::urlencode_rfc3986($this->key) . - "&oauth_token_secret=" . - OAuthUtil::urlencode_rfc3986($this->secret) . + public function to_string() + { + return "oauth_token=". + OAuthUtil::urlencode_rfc3986($this->key). + "&oauth_token_secret=". + OAuthUtil::urlencode_rfc3986($this->secret). "&oauth_callback_confirmed=true"; } - function __toString() { + public function __toString() + { return $this->to_string(); } } @@ -69,7 +78,8 @@ function __toString() { * A class for implementing a Signature Method * See section 9 ("Signing Requests") in the spec */ -abstract class OAuthSignatureMethod { +abstract class OAuthSignatureMethod +{ /** * Needs to return the name of the Signature Method (ie HMAC-SHA1) * @return string @@ -96,7 +106,8 @@ abstract public function build_signature($request, $consumer, $token); * @param string $signature * @return bool */ - public function check_signature($request, $consumer, $token, $signature) { + public function check_signature($request, $consumer, $token, $signature) + { $built = $this->build_signature($request, $consumer, $token); // Check for zero length, although unlikely here @@ -125,19 +136,22 @@ public function check_signature($request, $consumer, $token, $signature) { * character (ASCII code 38) even if empty. * - Chapter 9.2 ("HMAC-SHA1") */ -class OAuthSignatureMethod_HMAC_SHA1 extends OAuthSignatureMethod { - function get_name() { +class OAuthSignatureMethod_HMAC_SHA1 extends OAuthSignatureMethod +{ + public function get_name() + { return "HMAC-SHA1"; } - public function build_signature($request, $consumer, $token) { + public function build_signature($request, $consumer, $token) + { $base_string = $request->get_signature_base_string(); $request->base_string = $base_string; - $key_parts = array( + $key_parts = [ $consumer->secret, ($token) ? $token->secret : "" - ); + ]; $key_parts = OAuthUtil::urlencode_rfc3986($key_parts); $key = implode('&', $key_parts); @@ -151,8 +165,10 @@ public function build_signature($request, $consumer, $token) { * over a secure channel such as HTTPS. It does not use the Signature Base String. * - Chapter 9.4 ("PLAINTEXT") */ -class OAuthSignatureMethod_PLAINTEXT extends OAuthSignatureMethod { - public function get_name() { +class OAuthSignatureMethod_PLAINTEXT extends OAuthSignatureMethod +{ + public function get_name() + { return "PLAINTEXT"; } @@ -165,11 +181,12 @@ public function get_name() { * Please note that the second encoding MUST NOT happen in the SignatureMethod, as * OAuthRequest handles this! */ - public function build_signature($request, $consumer, $token) { - $key_parts = array( + public function build_signature($request, $consumer, $token) + { + $key_parts = [ $consumer->secret, ($token) ? $token->secret : "" - ); + ]; $key_parts = OAuthUtil::urlencode_rfc3986($key_parts); $key = implode('&', $key_parts); @@ -187,8 +204,10 @@ public function build_signature($request, $consumer, $token) { * specification. * - Chapter 9.3 ("RSA-SHA1") */ -abstract class OAuthSignatureMethod_RSA_SHA1 extends OAuthSignatureMethod { - public function get_name() { +abstract class OAuthSignatureMethod_RSA_SHA1 extends OAuthSignatureMethod +{ + public function get_name() + { return "RSA-SHA1"; } @@ -198,15 +217,16 @@ public function get_name() { // (3) some sort of specific discovery code based on request // // Either way should return a string representation of the certificate - protected abstract function fetch_public_cert(&$request); + abstract protected function fetch_public_cert(&$request); // Up to the SP to implement this lookup of keys. Possible ideas are: // (1) do a lookup in a table of trusted certs keyed off of consumer // // Either way should return a string representation of the certificate - protected abstract function fetch_private_cert(&$request); + abstract protected function fetch_private_cert(&$request); - public function build_signature($request, $consumer, $token) { + public function build_signature($request, $consumer, $token) + { $base_string = $request->get_signature_base_string(); $request->base_string = $base_string; @@ -217,7 +237,7 @@ public function build_signature($request, $consumer, $token) { $privatekeyid = openssl_get_privatekey($cert); // Sign using the key - $ok = openssl_sign($base_string, $signature, $privatekeyid); + openssl_sign($base_string, $signature, $privatekeyid); // Release the key resource openssl_free_key($privatekeyid); @@ -225,7 +245,8 @@ public function build_signature($request, $consumer, $token) { return base64_encode($signature); } - public function check_signature($request, $consumer, $token, $signature) { + public function check_signature($request, $consumer, $token, $signature) + { $decoded_sig = base64_decode($signature); $base_string = $request->get_signature_base_string(); @@ -246,7 +267,8 @@ public function check_signature($request, $consumer, $token, $signature) { } } -class OAuthRequest { +class OAuthRequest +{ protected $parameters; protected $http_method; protected $http_url; @@ -255,9 +277,10 @@ class OAuthRequest { public static $version = '1.0'; public static $POST_INPUT = 'php://input'; - function __construct($http_method, $http_url, $parameters=NULL) { - $parameters = ($parameters) ? $parameters : array(); - $parameters = array_merge( OAuthUtil::parse_parameters(parse_url($http_url, PHP_URL_QUERY)), $parameters); + public function __construct($http_method, $http_url, $parameters = null) + { + $parameters = ($parameters) ? $parameters : []; + $parameters = array_merge(OAuthUtil::parse_parameters(parse_url($http_url, PHP_URL_QUERY)), $parameters); $this->parameters = $parameters; $this->http_method = $http_method; $this->http_url = $http_url; @@ -267,14 +290,15 @@ function __construct($http_method, $http_url, $parameters=NULL) { /** * attempt to build up a request from what was passed to the server */ - public static function from_request($http_method=NULL, $http_url=NULL, $parameters=NULL) { + public static function from_request($http_method = null, $http_url = null, $parameters = null) + { $scheme = (!isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] != "on") ? 'http' : 'https'; - $http_url = ($http_url) ? $http_url : $scheme . - '://' . $_SERVER['SERVER_NAME'] . - ':' . - $_SERVER['SERVER_PORT'] . + $http_url = ($http_url) ? $http_url : $scheme. + '://'.$_SERVER['SERVER_NAME']. + ':'. + $_SERVER['SERVER_PORT']. $_SERVER['REQUEST_URI']; $http_method = ($http_method) ? $http_method : $_SERVER['REQUEST_METHOD']; @@ -292,9 +316,8 @@ public static function from_request($http_method=NULL, $http_url=NULL, $paramete // It's a POST request of the proper content-type, so parse POST // parameters and add those overriding any duplicates from GET if ($http_method == "POST" - && isset($request_headers['Content-Type']) - && strstr($request_headers['Content-Type'], - 'application/x-www-form-urlencoded') + && isset($request_headers['Content-Type']) + && strstr($request_headers['Content-Type'], 'application/x-www-form-urlencoded') ) { $post_data = OAuthUtil::parse_parameters( file_get_contents(self::$POST_INPUT) @@ -304,13 +327,14 @@ public static function from_request($http_method=NULL, $http_url=NULL, $paramete // We have a Authorization-header with OAuth data. Parse the header // and add those overriding any duplicates from GET or POST - if (isset($request_headers['Authorization']) && substr($request_headers['Authorization'], 0, 6) == 'OAuth ') { + if (isset($request_headers['Authorization']) + && substr($request_headers['Authorization'], 0, 6) == 'OAuth ' + ) { $header_parameters = OAuthUtil::split_header( $request_headers['Authorization'] ); $parameters = array_merge($parameters, $header_parameters); } - } return new OAuthRequest($http_method, $http_url, $parameters); @@ -319,27 +343,30 @@ public static function from_request($http_method=NULL, $http_url=NULL, $paramete /** * pretty much a helper function to set up the request */ - public static function from_consumer_and_token($consumer, $token, $http_method, $http_url, $parameters=NULL) { - $parameters = ($parameters) ? $parameters : array(); - $defaults = array("oauth_version" => OAuthRequest::$version, - "oauth_nonce" => OAuthRequest::generate_nonce(), - "oauth_timestamp" => OAuthRequest::generate_timestamp(), - "oauth_consumer_key" => $consumer->key); - if ($token) + public static function from_consumer_and_token($consumer, $token, $http_method, $http_url, $parameters = null) + { + $parameters = ($parameters) ? $parameters : []; + $defaults = ["oauth_version" => OAuthRequest::$version, + "oauth_nonce" => OAuthRequest::generate_nonce(), + "oauth_timestamp" => OAuthRequest::generate_timestamp(), + "oauth_consumer_key" => $consumer->key]; + if ($token) { $defaults['oauth_token'] = $token->key; + } $parameters = array_merge($defaults, $parameters); return new OAuthRequest($http_method, $http_url, $parameters); } - public function set_parameter($name, $value, $allow_duplicates = true) { + public function set_parameter($name, $value, $allow_duplicates = true) + { if ($allow_duplicates && isset($this->parameters[$name])) { // We have already added parameter(s) with this name, so add to the list if (is_scalar($this->parameters[$name])) { // This is the first duplicate, so transform scalar (string) // into an array so we can add the duplicates - $this->parameters[$name] = array($this->parameters[$name]); + $this->parameters[$name] = [$this->parameters[$name]]; } $this->parameters[$name][] = $value; @@ -348,15 +375,18 @@ public function set_parameter($name, $value, $allow_duplicates = true) { } } - public function get_parameter($name) { + public function get_parameter($name) + { return isset($this->parameters[$name]) ? $this->parameters[$name] : null; } - public function get_parameters() { + public function get_parameters() + { return $this->parameters; } - public function unset_parameter($name) { + public function unset_parameter($name) + { unset($this->parameters[$name]); } @@ -364,7 +394,8 @@ public function unset_parameter($name) { * The request parameters, sorted and concatenated into a normalized string. * @return string */ - public function get_signable_parameters() { + public function get_signable_parameters() + { // Grab all parameters $params = $this->parameters; @@ -384,12 +415,13 @@ public function get_signable_parameters() { * and the parameters (normalized), each urlencoded * and the concated with &. */ - public function get_signature_base_string() { - $parts = array( + public function get_signature_base_string() + { + $parts = [ $this->get_normalized_http_method(), $this->get_normalized_http_url(), $this->get_signable_parameters() - ); + ]; $parts = OAuthUtil::urlencode_rfc3986($parts); @@ -399,7 +431,8 @@ public function get_signature_base_string() { /** * just uppercases the http method */ - public function get_normalized_http_method() { + public function get_normalized_http_method() + { return strtoupper($this->http_method); } @@ -407,7 +440,8 @@ public function get_normalized_http_method() { * parses the url and rebuilds it to be * scheme://host/path */ - public function get_normalized_http_url() { + public function get_normalized_http_url() + { $parts = parse_url($this->http_url); $scheme = (isset($parts['scheme'])) ? $parts['scheme'] : 'http'; @@ -425,7 +459,8 @@ public function get_normalized_http_url() { /** * builds a url usable for a GET request */ - public function to_url() { + public function to_url() + { $post_data = $this->to_postdata(); $out = $this->get_normalized_http_url(); if ($post_data) { @@ -437,43 +472,49 @@ public function to_url() { /** * builds the data one would send in a POST request */ - public function to_postdata() { + public function to_postdata() + { return OAuthUtil::build_http_query($this->parameters); } /** * builds the Authorization: header */ - public function to_header($realm=null) { + public function to_header($realm = null) + { $first = true; - if($realm) { - $out = 'Authorization: OAuth realm="' . OAuthUtil::urlencode_rfc3986($realm) . '"'; + if ($realm) { + $out = 'Authorization: OAuth realm="'.OAuthUtil::urlencode_rfc3986($realm).'"'; $first = false; - } else + } else { $out = 'Authorization: OAuth'; + } - $total = array(); foreach ($this->parameters as $k => $v) { - if (substr($k, 0, 5) != "oauth") continue; + if (substr($k, 0, 5) != "oauth") { + continue; + } if (is_array($v)) { throw new OAuthException('Arrays not supported in headers'); } $out .= ($first) ? ' ' : ','; - $out .= OAuthUtil::urlencode_rfc3986($k) . - '="' . - OAuthUtil::urlencode_rfc3986($v) . + $out .= OAuthUtil::urlencode_rfc3986($k). + '="'. + OAuthUtil::urlencode_rfc3986($v). '"'; $first = false; } return $out; } - public function __toString() { + public function __toString() + { return $this->to_url(); } - public function sign_request($signature_method, $consumer, $token) { + public function sign_request($signature_method, $consumer, $token) + { $this->set_parameter( "oauth_signature_method", $signature_method->get_name(), @@ -483,7 +524,8 @@ public function sign_request($signature_method, $consumer, $token) { $this->set_parameter("oauth_signature", $signature, false); } - public function build_signature($signature_method, $consumer, $token) { + public function build_signature($signature_method, $consumer, $token) + { $signature = $signature_method->build_signature($this, $consumer, $token); return $signature; } @@ -491,33 +533,38 @@ public function build_signature($signature_method, $consumer, $token) { /** * util function: current timestamp */ - private static function generate_timestamp() { + private static function generate_timestamp() + { return time(); } /** * util function: current nonce */ - private static function generate_nonce() { + private static function generate_nonce() + { $mt = microtime(); $rand = mt_rand(); - return md5($mt . $rand); // md5s look nicer than numbers + return md5($mt.$rand); // md5s look nicer than numbers } } -class OAuthServer { +class OAuthServer +{ protected $timestamp_threshold = 300; // in seconds, five minutes - protected $version = '1.0'; // hi blaine - protected $signature_methods = array(); + protected $version = '1.0'; // hi blaine + protected $signature_methods = []; protected $data_store; - function __construct($data_store) { + public function __construct($data_store) + { $this->data_store = $data_store; } - public function add_signature_method($signature_method) { + public function add_signature_method($signature_method) + { $this->signature_methods[$signature_method->get_name()] = $signature_method; } @@ -528,15 +575,16 @@ public function add_signature_method($signature_method) { * process a request_token request * returns the request token on success */ - public function fetch_request_token(&$request) { - $this->get_version($request); + public function fetch_request_token(&$request) + { + $this->getVersion($request); - $consumer = $this->get_consumer($request); + $consumer = $this->getConsumer($request); // no token required for the initial token request - $token = NULL; + $token = null; - $this->check_signature($request, $consumer, $token); + $this->checkSignature($request, $consumer, $token); // Rev A change $callback = $request->get_parameter('oauth_callback'); @@ -549,15 +597,16 @@ public function fetch_request_token(&$request) { * process an access_token request * returns the access token on success */ - public function fetch_access_token(&$request) { - $this->get_version($request); + public function fetch_access_token(&$request) + { + $this->getVersion($request); - $consumer = $this->get_consumer($request); + $consumer = $this->getConsumer($request); // requires authorized request token - $token = $this->get_token($request, $consumer, "request"); + $token = $this->getToken($request, $consumer, "request"); - $this->check_signature($request, $consumer, $token); + $this->checkSignature($request, $consumer, $token); // Rev A change $verifier = $request->get_parameter('oauth_verifier'); @@ -569,19 +618,21 @@ public function fetch_access_token(&$request) { /** * verify an api call, checks all the parameters */ - public function verify_request(&$request) { - $this->get_version($request); - $consumer = $this->get_consumer($request); - $token = $this->get_token($request, $consumer, "access"); - $this->check_signature($request, $consumer, $token); - return array($consumer, $token); + public function verify_request(&$request) + { + $this->getVersion($request); + $consumer = $this->getConsumer($request); + $token = $this->getToken($request, $consumer, "access"); + $this->checkSignature($request, $consumer, $token); + return [$consumer, $token]; } // Internals from here /** * version 1 */ - private function get_version(&$request) { + private function getVersion(&$request) + { $version = $request->get_parameter("oauth_version"); if (!$version) { // Service Providers MUST assume the protocol version to be 1.0 if this parameter is not present. @@ -597,10 +648,11 @@ private function get_version(&$request) { /** * figure out the signature with some defaults */ - private function get_signature_method($request) { + private function getSignatureMethod($request) + { $signature_method = $request instanceof OAuthRequest ? $request->get_parameter("oauth_signature_method") - : NULL; + : null; if (!$signature_method) { // According to chapter 7 ("Accessing Protected Ressources") the signature-method @@ -608,11 +660,10 @@ private function get_signature_method($request) { throw new OAuthException('No signature method parameter. This parameter is required'); } - if (!in_array($signature_method, - array_keys($this->signature_methods))) { + if (!in_array($signature_method, array_keys($this->signature_methods))) { throw new OAuthException( - "Signature method '$signature_method' not supported " . - "try one of the following: " . + "Signature method '$signature_method' not supported ". + "try one of the following: ". implode(", ", array_keys($this->signature_methods)) ); } @@ -622,10 +673,11 @@ private function get_signature_method($request) { /** * try to find the consumer for the provided request's consumer key */ - private function get_consumer($request) { + private function getConsumer($request) + { $consumer_key = $request instanceof OAuthRequest ? $request->get_parameter("oauth_consumer_key") - : NULL; + : null; if (!$consumer_key) { throw new OAuthException("Invalid consumer key"); @@ -642,20 +694,18 @@ private function get_consumer($request) { /** * try to find the token for the provided request's token key */ - private function get_token($request, $consumer, $token_type="access") { + private function getToken($request, $consumer, $token_type = "access") + { $token_field = $request instanceof OAuthRequest ? $request->get_parameter('oauth_token') - : NULL; + : null; if (!empty($token_field)) { - $token = $this->data_store->lookup_token( - $consumer, $token_type, $token_field - ); + $token = $this->data_store->lookup_token($consumer, $token_type, $token_field); if (!$token) { - throw new OAuthException("Invalid $token_type token: $token_field"); + throw new OAuthException('Invalid '.$token_type.' token: '.$token_field); } - } - else { + } else { $token = new OAuthToken('', ''); } return $token; @@ -665,22 +715,23 @@ private function get_token($request, $consumer, $token_type="access") { * all-in-one function to check the signature on a request * should guess the signature method appropriately */ - private function check_signature($request, $consumer, $token) { + private function checkSignature($request, $consumer, $token) + { // this should probably be in a different method $timestamp = $request instanceof OAuthRequest ? $request->get_parameter('oauth_timestamp') - : NULL; + : null; $nonce = $request instanceof OAuthRequest ? $request->get_parameter('oauth_nonce') - : NULL; + : null; - $this->check_timestamp($timestamp); - $this->check_nonce($consumer, $token, $nonce, $timestamp); + $this->checkTimestamp($timestamp); + $this->checkNonce($consumer, $token, $nonce, $timestamp); - $signature_method = $this->get_signature_method($request); + $signature_method = $this->getSignatureMethod($request); $signature = $request->get_parameter('oauth_signature'); - $valid_sig = $signature_method->check_signature( + $valid_sig = $signature_method->checkSignature( $request, $consumer, $token, @@ -695,11 +746,13 @@ private function check_signature($request, $consumer, $token) { /** * check that the timestamp is new enough */ - private function check_timestamp($timestamp) { - if( ! $timestamp ) + private function checkTimestamp($timestamp) + { + if (!$timestamp) { throw new OAuthException( 'Missing timestamp parameter. The parameter is required' ); + } // verify that timestamp is recentish $now = time(); @@ -713,11 +766,13 @@ private function check_timestamp($timestamp) { /** * check that the nonce is not repeated */ - private function check_nonce($consumer, $token, $nonce, $timestamp) { - if( ! $nonce ) + private function checkNonce($consumer, $token, $nonce, $timestamp) + { + if (!$nonce) { throw new OAuthException( 'Missing nonce parameter. The parameter is required' ); + } // verify that the nonce is uniqueish $found = $this->data_store->lookup_nonce( @@ -730,40 +785,46 @@ private function check_nonce($consumer, $token, $nonce, $timestamp) { throw new OAuthException("Nonce already used: $nonce"); } } - } -class OAuthDataStore { - function lookup_consumer($consumer_key) { +class OAuthDataStore +{ + public function lookup_consumer($consumer_key) + { // implement me } - function lookup_token($consumer, $token_type, $token) { + public function lookup_token($consumer, $token_type, $token) + { // implement me } - function lookup_nonce($consumer, $token, $nonce, $timestamp) { + public function lookup_nonce($consumer, $token, $nonce, $timestamp) + { // implement me } - function new_request_token($consumer, $callback = null) { + public function new_request_token($consumer, $callback = null) + { // return a new token attached to this consumer } - function new_access_token($token, $consumer, $verifier = null) { + public function new_access_token($token, $consumer, $verifier = null) + { // return a new access token attached to this consumer // for the user associated with this token if the request token // is authorized // should also invalidate the request token } - } -class OAuthUtil { - public static function urlencode_rfc3986($input) { +class OAuthUtil +{ + public static function urlencode_rfc3986($input) + { if (is_array($input)) { - return array_map(array('OAuthUtil', 'urlencode_rfc3986'), $input); - } else if (is_scalar($input)) { + return array_map(['OAuthUtil', 'urlencode_rfc3986'], $input); + } elseif (is_scalar($input)) { return str_replace( '+', ' ', @@ -778,7 +839,8 @@ public static function urlencode_rfc3986($input) { // This decode function isn't taking into consideration the above // modifications to the encoding process. However, this method doesn't // seem to be used anywhere so leaving it as is. - public static function urldecode_rfc3986($string) { + public static function urldecode_rfc3986($string) + { return urldecode($string); } @@ -787,9 +849,14 @@ public static function urldecode_rfc3986($string) { // Can filter out any non-oauth parameters if needed (default behaviour) // May 28th, 2010 - method updated to tjerk.meesters for a speed improvement. // see http://code.google.com/p/oauth/issues/detail?id=163 - public static function split_header($header, $only_allow_oauth_parameters = true) { - $params = array(); - if (preg_match_all('/('.($only_allow_oauth_parameters ? 'oauth_' : '').'[a-z_-]*)=(:?"([^"]*)"|([^,]*))/', $header, $matches)) { + public static function split_header($header, $only_allow_oauth_parameters = true) + { + $params = []; + if (preg_match_all( + '/('.($only_allow_oauth_parameters ? 'oauth_' : '').'[a-z_-]*)=(:?"([^"]*)"|([^,]*))/', + $header, + $matches + )) { foreach ($matches[1] as $i => $h) { $params[$h] = OAuthUtil::urldecode_rfc3986(empty($matches[3][$i]) ? $matches[4][$i] : $matches[3][$i]); } @@ -801,7 +868,8 @@ public static function split_header($header, $only_allow_oauth_parameters = true } // helper to try to sort out headers for people who aren't running apache - public static function get_headers() { + public static function get_headers() + { if (function_exists('apache_request_headers')) { // we need this to get the actual Authorization: header // because apache tends to tell us it doesn't exist @@ -811,8 +879,8 @@ public static function get_headers() { // we always want the keys to be Cased-Like-This and arh() // returns the headers in the same case as they are in the // request - $out = array(); - foreach ($headers AS $key => $value) { + $out = []; + foreach ($headers as $key => $value) { $key = str_replace( " ", "-", @@ -823,11 +891,13 @@ public static function get_headers() { } else { // otherwise we don't have apache and are just going to have to hope // that $_SERVER actually contains what we need - $out = array(); - if( isset($_SERVER['CONTENT_TYPE']) ) + $out = []; + if (isset($_SERVER['CONTENT_TYPE'])) { $out['Content-Type'] = $_SERVER['CONTENT_TYPE']; - if( isset($_ENV['CONTENT_TYPE']) ) + } + if (isset($_ENV['CONTENT_TYPE'])) { $out['Content-Type'] = $_ENV['CONTENT_TYPE']; + } foreach ($_SERVER as $key => $value) { if (substr($key, 0, 5) == "HTTP_") { @@ -853,12 +923,15 @@ public static function get_headers() { // This function takes a input like a=b&a=c&d=e and returns the parsed // parameters like this // array('a' => array('b','c'), 'd' => 'e') - public static function parse_parameters( $input ) { - if (!isset($input) || !$input) return array(); + public static function parse_parameters($input) + { + if (!isset($input) || !$input) { + return []; + } $pairs = explode('&', $input); - $parsed_parameters = array(); + $parsed_parameters = []; foreach ($pairs as $pair) { $split = explode('=', $pair, 2); $parameter = OAuthUtil::urldecode_rfc3986($split[0]); @@ -871,7 +944,7 @@ public static function parse_parameters( $input ) { if (is_scalar($parsed_parameters[$parameter])) { // This is the first duplicate, so transform scalar (string) into an array // so we can add the duplicates - $parsed_parameters[$parameter] = array($parsed_parameters[$parameter]); + $parsed_parameters[$parameter] = [$parsed_parameters[$parameter]]; } $parsed_parameters[$parameter][] = $value; @@ -882,8 +955,11 @@ public static function parse_parameters( $input ) { return $parsed_parameters; } - public static function build_http_query($params) { - if (!$params) return ''; + public static function build_http_query($params) + { + if (!$params) { + return ''; + } // Urlencode both keys and values $keys = OAuthUtil::urlencode_rfc3986(array_keys($params)); @@ -894,7 +970,7 @@ public static function build_http_query($params) { // Ref: Spec: 9.1.1 (1) uksort($params, 'strcmp'); - $pairs = array(); + $pairs = []; foreach ($params as $parameter => $value) { if (is_array($value)) { // If two or more parameters share the same name, they are sorted by their value @@ -902,10 +978,10 @@ public static function build_http_query($params) { // June 12th, 2010 - changed to sort because of issue 164 by hidetaka sort($value, SORT_STRING); foreach ($value as $duplicate_value) { - $pairs[] = $parameter . '=' . $duplicate_value; + $pairs[] = $parameter.'='.$duplicate_value; } } else { - $pairs[] = $parameter . '=' . $value; + $pairs[] = $parameter.'='.$value; } } // For each parameter, the name is separated from the corresponding value by an '=' character (ASCII code 61) diff --git a/vendor/simplesamlphp/simplesamlphp/modules/oauth/templates/authorized.php b/vendor/simplesamlphp/simplesamlphp/modules/oauth/templates/authorized.php deleted file mode 100644 index 7ce806d566..0000000000 --- a/vendor/simplesamlphp/simplesamlphp/modules/oauth/templates/authorized.php +++ /dev/null @@ -1,19 +0,0 @@ -<?php - -$this->data['header'] = 'OAuth Authorization'; -$this->includeAtTemplateBase('includes/header.php'); - -?> - - <p style="margin-top: 2em"> - You are now successfully authenticated, and you may click <em>Continue</em> in the application where you initiated authentication. - </p> -<?php if (!empty($this->data['oauth_verifier'])) {?> - <p> - When asked, the verifier code to finish the procedure, is: <b><?php echo htmlspecialchars($this->data['oauth_verifier']);?></b>. - </p> -<?php } ?> - - -<?php -$this->includeAtTemplateBase('includes/footer.php'); diff --git a/vendor/simplesamlphp/simplesamlphp/modules/oauth/templates/consent.php b/vendor/simplesamlphp/simplesamlphp/modules/oauth/templates/consent.php deleted file mode 100644 index efb883df6c..0000000000 --- a/vendor/simplesamlphp/simplesamlphp/modules/oauth/templates/consent.php +++ /dev/null @@ -1,18 +0,0 @@ -<?php - -$this->data['header'] = 'OAuth Authorization'; -$this->includeAtTemplateBase('includes/header.php'); - -?> - - <p style="margin-top: 2em"> - Do you agree to let the application at <b><?php echo htmlspecialchars($this->data['consumer']['name'])?></b> use Foodle on your behalf? - </p> - <p> - <a href="<?php echo htmlspecialchars($this->data['urlAgree']); ?>">Yes I agree</a> | - <a href="javascript:alert('Please close this browser.');">No, cancel the request.</a> - </p> - - -<?php -$this->includeAtTemplateBase('includes/footer.php'); diff --git a/vendor/simplesamlphp/simplesamlphp/modules/oauth/templates/registry.edit.tpl.php b/vendor/simplesamlphp/simplesamlphp/modules/oauth/templates/registry.edit.tpl.php index e1eb05dd2f..b43c40d39c 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/oauth/templates/registry.edit.tpl.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/oauth/templates/registry.edit.tpl.php @@ -1,21 +1,18 @@ <?php -$this->data['jquery'] = array('core' => TRUE, 'ui' => TRUE, 'css' => TRUE); -$this->data['head'] = '<link rel="stylesheet" type="text/css" href="/' . $this->data['baseurlpath'] . 'module.php/metaedit/resources/style.css" />' . "\n"; -$this->data['head'] .= '<script type="text/javascript"> -$(document).ready(function() { - $("#tabdiv").tabs(); -}); -</script>'; +$this->data['jquery'] = ['core' => true, 'ui' => true, 'css' => true]; +$this->data['head'] = '<link rel="stylesheet" type="text/css" href="/'. + $this->data['baseurlpath'].'module.php/oauth/assets/css/oauth.css" />'."\n"; +$this->data['head'] .= '<script type="text/javascript" src="/'. + $this->data['baseurlpath'].'module.php/oauth/assets/js/oauth.js"></script>'; $this->includeAtTemplateBase('includes/header.php'); +echo '<h1>OAuth Client</h1>'; -echo('<h1>OAuth Client</h1>'); +echo $this->data['form']; -echo($this->data['form']); - -echo('<p style="float: right"><a href="registry.php">Return to entity listing <strong>without saving...</strong></a></p>'); +echo '<p style="float: right"><a href="registry.php">'. + 'Return to entity listing <strong>without saving...</strong></a></p>'; $this->includeAtTemplateBase('includes/footer.php'); - diff --git a/vendor/simplesamlphp/simplesamlphp/modules/oauth/templates/registry.edit.twig b/vendor/simplesamlphp/simplesamlphp/modules/oauth/templates/registry.edit.twig new file mode 100644 index 0000000000..ad9345d731 --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/modules/oauth/templates/registry.edit.twig @@ -0,0 +1,18 @@ +{% set pagetitle = 'SimpleSAMLphp'|trans %} +{% extends "base.twig" %} + +{% block preload %} + <link href="{{ baseurlpath }}assets/css/oauth.css" rel="stylesheet"> +{% endblock %} + +{% block postload %} + <script src="{{ baseurlpath}}assets/js/oauth.js"></script> +{% endblock %} + +{% block content %} + <h1>OAuth Client</h1> + {{ form|raw }} + <p style="float: right"> + <a href="registry.php">Return to entity listing <strong>without saving...</strong></a> + </p> +{% endblock %} diff --git a/vendor/simplesamlphp/simplesamlphp/modules/oauth/templates/registry.list.php b/vendor/simplesamlphp/simplesamlphp/modules/oauth/templates/registry.list.php index 28d64e38ee..1c3b287fb6 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/oauth/templates/registry.list.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/oauth/templates/registry.list.php @@ -1,51 +1,47 @@ <?php - -$this->data['jquery'] = array('core' => TRUE, 'ui' => TRUE, 'css' => TRUE); -$this->data['head'] = '<link rel="stylesheet" type="text/css" href="/' . $this->data['baseurlpath'] . 'module.php/oauth/resources/style.css" />' . "\n"; +$this->data['jquery'] = ['core' => true, 'ui' => true, 'css' => true]; +$this->data['head'] = '<link rel="stylesheet" type="text/css" href="/'. + $this->data['baseurlpath'].'module.php/oauth/assets/oauth.css" />'."\n"; $this->includeAtTemplateBase('includes/header.php'); - -echo('<h1>OAuth Client Registry</h1>'); - -echo('<p>Here you can register new OAuth Clients. You are successfully logged in as ' . htmlspecialchars($this->data['userid']) . '</p>'); - -echo('<h2>Your clients</h2>'); -echo('<table class="metalist" style="width: 100%">'); -$i = 0; $rows = array('odd', 'even'); -foreach($this->data['entries']['mine'] AS $entryc ) { - $entry = $entryc['value']; - $i++; - echo('<tr class="' . $rows[$i % 2] . '"> - <td>' . htmlspecialchars($entry['name']) . '</td> - <td><tt>' . htmlspecialchars($entry['key']) . '</tt></td> - <td> - <a href="registry.edit.php?editkey=' . urlencode($entry['key']) . '">edit</a> - <a href="registry.php?delete=' . urlencode($entry['key']) . '">delete</a> - </td></tr>'); +echo '<h1>OAuth Client Registry</h1>'; +echo '<p>Here you can register new OAuth Clients. You are successfully logged in as '. + htmlspecialchars($this->data['userid']).'</p>'; + +echo '<h2>Your clients</h2>'; +echo '<table class="metalist" style="width: 100%">'; +$i = 0; +$rows = ['odd', 'even']; +foreach ($this->data['entries']['mine'] as $entryc) { + $entry = $entryc['value']; + $i++; + echo '<tr class="'.$rows[$i % 2].'"><td>'. + htmlspecialchars($entry['name']).'</td> <td><code>'.htmlspecialchars($entry['key']). + '</code></td><td><a href="registry.edit.php?editkey='.urlencode($entry['key']). + '">edit</a><a href="registry.php?delete='.urlencode($entry['key']).'">delete</a></td></tr>'; } if ($i == 0) { - echo('<tr><td colspan="3">No entries registered</td></tr>'); + echo'<tr><td colspan="3">No entries registered</td></tr>'; } -echo('</table>'); - -echo('<p><a href="registry.edit.php">Add new client</a></p>'); - -echo('<h2>Other clients</h2>'); -echo('<table class="metalist" style="width: 100%">'); -$i = 0; $rows = array('odd', 'even'); -foreach($this->data['entries']['others'] AS $entryc ) { - $entry = $entryc['value']; - $i++; - echo('<tr class="' . $rows[$i % 2] . '"> - <td>' . htmlspecialchars($entry['name']) . '</td> - <td><tt>' . htmlspecialchars($entry['key']) . '</tt></td> - <td>' . (isset($entry['owner']) ? htmlspecialchars($entry['owner']) : 'No owner') . ' - </td></tr>'); +echo '</table>'; + +echo '<p><a href="registry.edit.php">Add new client</a></p>'; + +echo '<h2>Other clients</h2>'; +echo '<table class="metalist" style="width: 100%">'; +$i = 0; +$rows = ['odd', 'even']; +foreach ($this->data['entries']['others'] as $entryc) { + $entry = $entryc['value']; + $i++; + echo '<tr class="'.$rows[$i % 2].'"><td>'. + htmlspecialchars($entry['name']).'</td><td><code>'.htmlspecialchars($entry['key']). + '</code></td><td>'.(isset($entry['owner']) ? htmlspecialchars($entry['owner']) : 'No owner'). + '</td></tr>'; } if ($i == 0) { - echo('<tr><td colspan="3">No entries registered</td></tr>'); + echo '<tr><td colspan="3">No entries registered</td></tr>'; } -echo('</table>'); +echo '</table>'; $this->includeAtTemplateBase('includes/footer.php'); - diff --git a/vendor/simplesamlphp/simplesamlphp/modules/oauth/templates/registry.list.twig b/vendor/simplesamlphp/simplesamlphp/modules/oauth/templates/registry.list.twig new file mode 100644 index 0000000000..86bc5a6792 --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/modules/oauth/templates/registry.list.twig @@ -0,0 +1,58 @@ +{% set pagetitle = 'SimpleSAMLphp'|trans %} +{% extends "base.twig" %} + +{% block preload %} + <link href="{{ baseurlpath }}assets/css/oauth.css" rel="stylesheet" /> +{% endblock %} + +{% block content %} + <h1>OAuth Client Registry</h1> + <p>Here you can register new OAuth Clients. You are successfully logged in as {{ userid|escape('html') }}</p> + <h2>Your clients</h2> + + <table class="metalist" style="width: 100%;"> + {% for key, entryc in entries.mine %} + {% if loop.index0 is even %} + {% set class = 'even' %} + {% else %} + {% set class = 'odd' %} + {% endif %} + {% set entry = entryc.value %} + <tr class="{{ class }}"> + <td>{{ entry.name|escape('html') }}</td> + <td><kbd>{{ entry.key|escape('html') }}</kbd></td> + <td> + <a href="registry.edit.php?editkey={{ entry.key|escape('url') }}">edit</a> + <a href="registry.php?delete={{ entry.key|escape('url') }}">delete</a> + </td> + </tr> + {% else %} + <tr><td colspan="3">No entries registered</td></tr> + {% endfor %} + </table> + + <p><a href="registry.edit.php">Add new client</a></p> + <h2>Other clients</h2> + + <table class="metalist" style="width: 100%"> + {% for key, entryc in entries.others %} + {% if loop.index0 is even %} + {% set class = 'even' %} + {% else %} + {% set class = 'odd' %} + {% endif %} + {% set entry = entryc.value %} + <tr class="{{ class }}"> + <td>{{ entry.name|escape('html') }}</td> + <td><kbd>{{ entry.key|escape('html') }}</kbd></td> + {% if eentry.owner is defined %}} + <td>{{ entry.owner|escape('html') }}</td> + {% else %} + <td>No owner</td> + {% endif %} + </tr> + {% else %} + <tr><td colspan="3">No entries registered</td></tr> + {% endfor %} + </table> +{% endblock%} diff --git a/vendor/simplesamlphp/simplesamlphp/modules/oauth/templates/registry.saved.php b/vendor/simplesamlphp/simplesamlphp/modules/oauth/templates/registry.saved.php index 0ff62eb50f..2e4bd27a92 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/oauth/templates/registry.saved.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/oauth/templates/registry.saved.php @@ -1,15 +1,8 @@ <?php - - $this->includeAtTemplateBase('includes/header.php'); - -echo('<h1>OAuth Client saved</h1>'); - -echo('<p><a href="registry.php">Go back to OAuth client listing</a></p>'); - - +echo '<h1>OAuth Client saved</h1>'; +echo '<p><a href="registry.php">Go back to OAuth client listing</a></p>'; $this->includeAtTemplateBase('includes/footer.php'); - diff --git a/vendor/simplesamlphp/simplesamlphp/modules/oauth/templates/registry.saved.twig b/vendor/simplesamlphp/simplesamlphp/modules/oauth/templates/registry.saved.twig new file mode 100644 index 0000000000..d17f8ba477 --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/modules/oauth/templates/registry.saved.twig @@ -0,0 +1,9 @@ +{% set pagetitle = 'SimpleSAMLphp'|trans %} +{% extends "base.twig" %} + +{% block content %} + <h1>OAuth Client saved</h1> + <p> + <a href="registry.php">Go back to OAuth client listing</a> + </p> +{% endblock %} diff --git a/vendor/simplesamlphp/simplesamlphp/modules/oauth/www/assets/css/oauth.css b/vendor/simplesamlphp/simplesamlphp/modules/oauth/www/assets/css/oauth.css new file mode 100644 index 0000000000..7b8ad7e92c --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/modules/oauth/www/assets/css/oauth.css @@ -0,0 +1,84 @@ +table.formtable { + width: 100%; +} +table.formtable tr td.name { + text-align: right; + vertical-align: top; + padding-right: .6em; +} +table.formtable tr td.value { + text-align: left; + padding: 0px; +} +table.formtable tr td.header { + padding-left: 5px; + padding-top: 8px; + font-weight: bold; + font-size: 110%; +} + +table.formtable tr td input,table.formtable tr td textarea { + width: 90%; + border: 1px solid #bbb; + margin: 2px 5px; + padding: 2px 4px; +} + +table.metalist { + border: 1px solid #aaa; + border-collapse: collapse; +} +table.metalist tr td { + padding: 2px 5px; +} +table.metalist tr.even td { + background: #e5e5e5; +} + +@media all { + div#content { + margin: .4em ! important; + } + + form { + display: inline; + } + + ul.tabset_tabs { + margin: 0px; + padding: 0px; + list-style: none; + } + + ul.tabset_tabs li { + background: none; + color: #222; + display: inline-block; + padding: 10px 15px; + cursor: pointer; + } + + ul.tabset_tabs li.current { + background: #ededed; + color: #222; + } + + .tabset_content { + display: none; + background: #ededed; + padding: 15px; + } + + .tabset_content.current { + display: inherit; + } + + #graph img { + max-width: 77%; + height: auto; + } + #table img { + max-width: 77%; + height: auto; + } +} diff --git a/vendor/simplesamlphp/simplesamlphp/modules/oauth/www/assets/js/oauth.js b/vendor/simplesamlphp/simplesamlphp/modules/oauth/www/assets/js/oauth.js new file mode 100644 index 0000000000..442c63effc --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/modules/oauth/www/assets/js/oauth.js @@ -0,0 +1,3 @@ +document.addEventListener('DOMContentLoaded', function () { + $("#tabdiv").tabs(); +}); diff --git a/vendor/simplesamlphp/simplesamlphp/modules/oauth/www/getUserInfo.php b/vendor/simplesamlphp/simplesamlphp/modules/oauth/www/getUserInfo.php index 516b065442..ad9f878c8b 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/oauth/www/getUserInfo.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/oauth/www/getUserInfo.php @@ -1,15 +1,17 @@ <?php -require_once(dirname(dirname(__FILE__)) . '/libextinc/OAuth.php'); +require_once(dirname(dirname(__FILE__)).'/libextinc/OAuth.php'); -$oauthconfig = SimpleSAML_Configuration::getConfig('module_oauth.php'); +$oauthconfig = \SimpleSAML\Configuration::getConfig('module_oauth.php'); -if (!$oauthconfig->getBoolean('getUserInfo.enable', FALSE)) { - throw new Exception('Get user info endpoint is disabled. This endpoint can be enabled in the module_oauth.php configuration file.'); +if (!$oauthconfig->getBoolean('getUserInfo.enable', false)) { + throw new \Exception( + 'Get user info endpoint is disabled. This endpoint can be enabled in the module_oauth.php configuration file.' + ); } -$store = new sspmod_oauth_OAuthStore(); -$server = new sspmod_oauth_OAuthServer($store); +$store = new \SimpleSAML\Module\oauth\OAuthStore(); +$server = new \SimpleSAML\Module\oauth\OAuthServer($store); $hmac_method = new OAuthSignatureMethod_HMAC_SHA1(); $plaintext_method = new OAuthSignatureMethod_PLAINTEXT(); @@ -23,4 +25,3 @@ $data = $store->getAuthorizedData($token->key); echo json_encode($data); - diff --git a/vendor/simplesamlphp/simplesamlphp/modules/oauth/www/registry.edit.php b/vendor/simplesamlphp/simplesamlphp/modules/oauth/www/registry.edit.php index ef8e42ff43..a367c48205 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/oauth/www/registry.edit.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/oauth/www/registry.edit.php @@ -1,68 +1,59 @@ <?php // Load SimpleSAMLphp, configuration and metadata -$config = SimpleSAML_Configuration::getInstance(); -$session = SimpleSAML_Session::getSessionFromRequest(); -$oauthconfig = SimpleSAML_Configuration::getOptionalConfig('module_oauth.php'); +$config = \SimpleSAML\Configuration::getInstance(); +$session = \SimpleSAML\Session::getSessionFromRequest(); +$oauthconfig = \SimpleSAML\Configuration::getOptionalConfig('module_oauth.php'); -$store = new sspmod_core_Storage_SQLPermanentStorage('oauth'); +$store = new \SimpleSAML\Module\core\Storage\SQLPermanentStorage('oauth'); -$authsource = "admin"; // force admin to authenticate as registry maintainer +$authsource = "admin"; // force admin to authenticate as registry maintainer $useridattr = $oauthconfig->getValue('useridattr', 'user'); if ($session->isValid($authsource)) { - $attributes = $session->getAuthData($authsource, 'Attributes'); - // Check if userid exists - if (!isset($attributes[$useridattr])) - throw new Exception('User ID is missing'); - $userid = $attributes[$useridattr][0]; + $attributes = $session->getAuthData($authsource, 'Attributes'); + // Check if userid exists + if (!isset($attributes[$useridattr])) { + throw new \Exception('User ID is missing'); + } + $userid = $attributes[$useridattr][0]; } else { - $as = SimpleSAML_Auth_Source::getById($authsource); - $as->initLogin(\SimpleSAML\Utils\HTTP::getSelfURL()); -} - -function requireOwnership($entry, $userid) { - if (!isset($entry['owner'])) - throw new Exception('OAuth Consumer has no owner. Which means no one is granted access, not even you.'); - if ($entry['owner'] !== $userid) - throw new Exception('OAuth Consumer has an owner that is not equal to your userid, hence you are not granted access.'); + $as = \SimpleSAML\Auth\Source::getById($authsource); + $as->initLogin(\SimpleSAML\Utils\HTTP::getSelfURL()); } if (array_key_exists('editkey', $_REQUEST)) { - $entryc = $store->get('consumers', $_REQUEST['editkey'], ''); - $entry = $entryc['value']; - requireOwnership($entry, $userid); - + $entryc = $store->get('consumers', $_REQUEST['editkey'], ''); + $entry = $entryc['value']; + \SimpleSAML\Module\oauth\Registry::requireOwnership($entry, $userid); } else { - $entry = array( - 'owner' => $userid, - 'key' => SimpleSAML\Utils\Random::generateID(), - 'secret' => SimpleSAML\Utils\Random::generateID(), - ); + $entry = [ + 'owner' => $userid, + 'key' => \SimpleSAML\Utils\Random::generateID(), + 'secret' => \SimpleSAML\Utils\Random::generateID(), + ]; } - -$editor = new sspmod_oauth_Registry(); - +$editor = new \SimpleSAML\Module\oauth\Registry(); if (isset($_POST['submit'])) { - $editor->checkForm($_POST); + $editor->checkForm($_POST); + + $entry = $editor->formToMeta($_POST, [], ['owner' => $userid]); - $entry = $editor->formToMeta($_POST, array(), array('owner' => $userid)); + \SimpleSAML\Module\oauth\Registry::requireOwnership($entry, $userid); - requireOwnership($entry, $userid); + $store->set('consumers', $entry['key'], '', $entry); - $store->set('consumers', $entry['key'], '', $entry); - - $template = new SimpleSAML_XHTML_Template($config, 'oauth:registry.saved.php'); - $template->data['entry'] = $entry; - $template->show(); - exit; + $template = new \SimpleSAML\XHTML\Template($config, 'oauth:registry.saved.php'); + $template->data['entry'] = $entry; + $template->show(); + exit; } $form = $editor->metaToForm($entry); -$template = new SimpleSAML_XHTML_Template($config, 'oauth:registry.edit.tpl.php'); +$template = new \SimpleSAML\XHTML\Template($config, 'oauth:registry.edit.tpl.php'); $template->data['form'] = $form; +$template->data['jquery'] = ['core' => false, 'ui' => true, 'css' => true]; $template->show(); - diff --git a/vendor/simplesamlphp/simplesamlphp/modules/oauth/www/registry.php b/vendor/simplesamlphp/simplesamlphp/modules/oauth/www/registry.php index b53a76f9eb..4431835a63 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/oauth/www/registry.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/oauth/www/registry.php @@ -1,57 +1,50 @@ <?php - // Load SimpleSAMLphp, configuration and metadata -$config = SimpleSAML_Configuration::getInstance(); -$session = SimpleSAML_Session::getSessionFromRequest(); -$oauthconfig = SimpleSAML_Configuration::getOptionalConfig('module_oauth.php'); +$config = \SimpleSAML\Configuration::getInstance(); +$session = \SimpleSAML\Session::getSessionFromRequest(); +$oauthconfig = \SimpleSAML\Configuration::getOptionalConfig('module_oauth.php'); -$store = new sspmod_core_Storage_SQLPermanentStorage('oauth'); +$store = new \SimpleSAML\Module\core\Storage\SQLPermanentStorage('oauth'); -$authsource = "admin"; // force admin to authenticate as registry maintainer +$authsource = "admin"; // force admin to authenticate as registry maintainer $useridattr = $oauthconfig->getValue('useridattr', 'user'); if ($session->isValid($authsource)) { - $attributes = $session->getAuthData($authsource, 'Attributes'); - // Check if userid exists - if (!isset($attributes[$useridattr])) - throw new Exception('User ID is missing'); - $userid = $attributes[$useridattr][0]; + $attributes = $session->getAuthData($authsource, 'Attributes'); + // Check if userid exists + if (!isset($attributes[$useridattr])) { + throw new \Exception('User ID is missing'); + } + $userid = $attributes[$useridattr][0]; } else { - $as = SimpleSAML_Auth_Source::getById($authsource); - $as->initLogin(\SimpleSAML\Utils\HTTP::getSelfURL()); -} - -function requireOwnership($entry, $userid) { - if (!isset($entry['owner'])) - throw new Exception('OAuth Consumer has no owner. Which means no one is granted access, not even you.'); - if ($entry['owner'] !== $userid) - throw new Exception('OAuth Consumer has an owner that is not equal to your userid, hence you are not granted access.'); + $as = \SimpleSAML\Auth\Source::getById($authsource); + $as->initLogin(\SimpleSAML\Utils\HTTP::getSelfURL()); } - if (isset($_REQUEST['delete'])) { - $entryc = $store->get('consumers', $_REQUEST['delete'], ''); - $entry = $entryc['value']; + $entryc = $store->get('consumers', $_REQUEST['delete'], ''); + $entry = $entryc['value']; - requireOwnership($entry, $userid); - $store->remove('consumers', $entry['key'], ''); + \SimpleSAML\Module\oauth\Registry::requireOwnership($entry, $userid); + $store->remove('consumers', $entry['key'], ''); } - $list = $store->getList('consumers'); -$slist = array('mine' => array(), 'others' => array()); -if (is_array($list)) -foreach($list AS $listitem) { - if (array_key_exists('owner', $listitem['value'])) { - if ($listitem['value']['owner'] === $userid) { - $slist['mine'][] = $listitem; continue; - } - } - $slist['others'][] = $listitem; +$slist = ['mine' => [], 'others' => []]; +if (is_array($list)) { + foreach ($list as $listitem) { + if (array_key_exists('owner', $listitem['value'])) { + if ($listitem['value']['owner'] === $userid) { + $slist['mine'][] = $listitem; + continue; + } + } + } + $slist['others'][] = $listitem; } -$template = new SimpleSAML_XHTML_Template($config, 'oauth:registry.list.php'); +$template = new \SimpleSAML\XHTML\Template($config, 'oauth:registry.list.php'); $template->data['entries'] = $slist; $template->data['userid'] = $userid; $template->show(); diff --git a/vendor/simplesamlphp/simplesamlphp/modules/oauth/www/resources/style.css b/vendor/simplesamlphp/simplesamlphp/modules/oauth/www/resources/style.css deleted file mode 100644 index 1240db0657..0000000000 --- a/vendor/simplesamlphp/simplesamlphp/modules/oauth/www/resources/style.css +++ /dev/null @@ -1,37 +0,0 @@ -table.formtable { - width: 100%; -} -table.formtable tr td.name { - text-align: right; - vertical-align: top; - padding-right: .6em; -} -table.formtable tr td.value { - text-align: left; - padding: 0px; -} -table.formtable tr td.header { - padding-left: 5px; - padding-top: 8px; - font-weight: bold; - font-size: 110%; -} - -table.formtable tr td input,table.formtable tr td textarea { - width: 90%; - border: 1px solid #bbb; - margin: 2px 5px; - padding: 2px 4px; -} - - -table.metalist { - border: 1px solid #aaa; - border-collapse: collapse; -} -table.metalist tr td { - padding: 2px 5px; -} -table.metalist tr.even td { - background: #e5e5e5; -} \ No newline at end of file diff --git a/vendor/simplesamlphp/simplesamlphp/modules/portal/config-templates/module_portal.php b/vendor/simplesamlphp/simplesamlphp/modules/portal/config-templates/module_portal.php index bff5d9ac66..85df6f99ab 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/portal/config-templates/module_portal.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/portal/config-templates/module_portal.php @@ -1,13 +1,11 @@ <?php -/* +/* * Configuration for the module portal. */ -$config = array ( - - 'pagesets' => array( - array('frontpage_welcome', 'frontpage_config', 'frontpage_auth', 'frontpage_federation'), - array('santitycheck', 'statistics'), - ), - -); +$config = [ + 'pagesets' => [ + ['frontpage_welcome', 'frontpage_config', 'frontpage_auth', 'frontpage_federation'], + ['sanitycheck', 'statistics'], + ], +]; diff --git a/vendor/simplesamlphp/simplesamlphp/modules/portal/hooks/hook_htmlinject.php b/vendor/simplesamlphp/simplesamlphp/modules/portal/hooks/hook_htmlinject.php index 9af4465794..efa1984a32 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/portal/hooks/hook_htmlinject.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/portal/hooks/hook_htmlinject.php @@ -5,39 +5,41 @@ * * @param array &$hookinfo hookinfo */ -function portal_hook_htmlinject(&$hookinfo) { - assert('is_array($hookinfo)'); - assert('array_key_exists("pre", $hookinfo)'); - assert('array_key_exists("post", $hookinfo)'); - assert('array_key_exists("page", $hookinfo)'); - - $links = array('links' => array()); - SimpleSAML\Module::callHooks('frontpage', $links); - - $portalConfig = SimpleSAML_Configuration::getOptionalConfig('module_portal.php'); - - $allLinks = array(); - foreach($links AS $ls) { - $allLinks = array_merge($allLinks, $ls); - } - - $pagesets = $portalConfig->getValue('pagesets', array( - array('frontpage_welcome', 'frontpage_config', 'frontpage_auth', 'frontpage_federation'), - )); - SimpleSAML\Module::callHooks('portalextras', $pagesets); - $portal = new sspmod_portal_Portal($allLinks, $pagesets); - - if (!$portal->isPortalized($hookinfo['page'])) return; - - // Include jquery UI CSS files in header - $hookinfo['jquery']['css'] = TRUE; - - // Header - $hookinfo['pre'][] = '<div id="portalmenu" class="ui-tabs ui-widget ui-widget-content ui-corner-all">' . - $portal->getMenu($hookinfo['page']) . - '<div id="portalcontent" class="ui-tabs-panel ui-widget-content ui-corner-bottom">'; - - // Footer - $hookinfo['post'][] = '</div></div>'; - +function portal_hook_htmlinject(&$hookinfo) +{ + assert(is_array($hookinfo)); + assert(array_key_exists('pre', $hookinfo)); + assert(array_key_exists('post', $hookinfo)); + assert(array_key_exists('page', $hookinfo)); + + $links = ['links' => []]; + \SimpleSAML\Module::callHooks('frontpage', $links); + + $portalConfig = \SimpleSAML\Configuration::getOptionalConfig('module_portal.php'); + + $allLinks = []; + foreach ($links as $ls) { + $allLinks = array_merge($allLinks, $ls); + } + + $pagesets = $portalConfig->getValue('pagesets', [ + ['frontpage_welcome', 'frontpage_config', 'frontpage_auth', 'frontpage_federation'], + ]); + \SimpleSAML\Module::callHooks('portalextras', $pagesets); + $portal = new \SimpleSAML\Module\portal\Portal($allLinks, $pagesets); + + if (!$portal->isPortalized($hookinfo['page'])) { + return; + } + + // Include jquery UI CSS files in header + $hookinfo['jquery']['css'] = true; + + // Header + $hookinfo['pre'][] = '<div id="portalmenu" class="ui-tabs ui-widget ui-widget-content ui-corner-all">'. + $portal->getMenu($hookinfo['page']). + '<div id="portalcontent" class="ui-tabs-panel ui-widget-content ui-corner-bottom">'; + + // Footer + $hookinfo['post'][] = '</div></div>'; } diff --git a/vendor/simplesamlphp/simplesamlphp/modules/portal/lib/Portal.php b/vendor/simplesamlphp/simplesamlphp/modules/portal/lib/Portal.php index 45d5ca5952..517ce2edfa 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/portal/lib/Portal.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/portal/lib/Portal.php @@ -1,71 +1,82 @@ <?php -class sspmod_portal_Portal { - - private $pages; - private $config; - - function __construct($pages, $config = NULL) { - $this->pages = $pages; - $this->config = $config; - } - - function getTabset($thispage) { - if (!isset($this->config)) return NULL; - foreach($this->config AS $set) { - if (in_array($thispage, $set, true)) { - return $set; - } - } - return NULL; - } - - function isPortalized($thispage) { - - foreach($this->config AS $set) { - if (in_array($thispage, $set, true)) { - return TRUE; - } - } - return FALSE; - } - - function getLoginInfo($translator, $thispage) { - $info = array('info' => '', 'translator' => $translator, 'thispage' => $thispage); - SimpleSAML\Module::callHooks('portalLoginInfo', $info); - return $info['info']; - } - - function getMenu($thispage) { - $config = SimpleSAML_Configuration::getInstance(); - $t = new SimpleSAML\Locale\Translate($config); - $tabset = $this->getTabset($thispage); - $logininfo = $this->getLoginInfo($t, $thispage); - $text = ''; - $text .= '<ul class="tabset_tabs ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all">'; - foreach($this->pages AS $pageid => $page) { - - if (isset($tabset) && !in_array($pageid, $tabset, TRUE)) continue; - $name = 'uknown'; - if (isset($page['text'])) $name = $page['text']; - if (isset($page['shorttext'])) $name = $page['shorttext']; - - if (!isset($page['href'])) { - $text .= '<li class="ui-state-default ui-corner-top ui-tabs-selected ui-state-active"><a href="#">' . $t->t($name) . '</a></li>'; - } else if($pageid === $thispage ) { - $text .= '<li class="ui-state-default ui-corner-top ui-tabs-selected ui-state-active"><a href="#">' . $t->t($name) . '</a></li>'; - } else { - $text .= '<li class="ui-state-default ui-corner-top"><a href="' . $page['href'] . '">' . $t->t($name) . '</a></li>'; - } - - } - $text .= '</ul>'; - if (!empty($logininfo)) { - $text .= '<p class="logininfo" style="text-align: right; margin: 0px">' . $logininfo . '</p>'; - } +namespace SimpleSAML\Module\portal; - return $text; - } - - +class Portal +{ + private $pages; + private $config; + + public function __construct($pages, $config = null) + { + $this->pages = $pages; + $this->config = $config; + } + + public function getTabset($thispage) + { + if (!isset($this->config)) { + return null; + } + foreach ($this->config as $set) { + if (in_array($thispage, $set, true)) { + return $set; + } + } + return null; + } + + public function isPortalized($thispage) + { + foreach ($this->config as $set) { + if (in_array($thispage, $set, true)) { + return true; + } + } + return false; + } + + public function getLoginInfo($translator, $thispage) + { + $info = ['info' => '', 'translator' => $translator, 'thispage' => $thispage]; + \SimpleSAML\Module::callHooks('portalLoginInfo', $info); + return $info['info']; + } + + public function getMenu($thispage) + { + $config = \SimpleSAML\Configuration::getInstance(); + $t = new \SimpleSAML\Locale\Translate($config); + $tabset = $this->getTabset($thispage); + $logininfo = $this->getLoginInfo($t, $thispage); + $classes = 'tabset_tabs ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all'; + $text = '<ul class="'.$classes.'">'; + foreach ($this->pages as $pageid => $page) { + if (isset($tabset) && !in_array($pageid, $tabset, true)) { + continue; + } + $name = 'uknown'; + if (isset($page['text'])) { + $name = $page['text']; + } + if (isset($page['shorttext'])) { + $name = $page['shorttext']; + } + if (!isset($page['href'])) { + $text .= '<li class="ui-state-default ui-corner-top ui-tabs-selected ui-state-active"><a href="#">'. + $t->t($name).'</a></li>'; + } elseif ($pageid === $thispage) { + $text .= '<li class="ui-state-default ui-corner-top ui-tabs-selected ui-state-active"><a href="#">'. + $t->t($name).'</a></li>'; + } else { + $text .= '<li class="ui-state-default ui-corner-top"><a href="'.$page['href'].'">'. + $t->t($name).'</a></li>'; + } + } + $text .= '</ul>'; + if (!empty($logininfo)) { + $text .= '<p class="logininfo" style="text-align: right; margin: 0px">'.$logininfo.'</p>'; + } + return $text; + } } diff --git a/vendor/simplesamlphp/simplesamlphp/modules/preprodwarning/dictionaries/warning.translation.json b/vendor/simplesamlphp/simplesamlphp/modules/preprodwarning/dictionaries/warning.translation.json index d74684857e..206f63fd8c 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/preprodwarning/dictionaries/warning.translation.json +++ b/vendor/simplesamlphp/simplesamlphp/modules/preprodwarning/dictionaries/warning.translation.json @@ -4,7 +4,7 @@ "nn": "Du er no inne p\u00e5 eit testsystem. Denne autentiseringsl\u00f8ysinga er for testing og beta-drift, ikkje for vanleg drift. Dersom du har f\u00e5tt peikar hit og du ikkje er <i>utviklar<\/i>, s\u00e5 er du truleg p\u00e5 feil plass og <i>skulle ikkje vore her<\/i>.", "sv": "Du har kommit till en tj\u00e4nst som \u00e4nnu inte \u00e4r i drift. Denna autentisieringskonfiguration \u00e4r f\u00f6r testning och tidig produktionskontroll. Om n\u00e5gon har skickat dig en l\u00e4nk hit och du inte \u00e4r en <i>en testare<\/i> har du troligtvis f\u00e5tt fel l\u00e4nk.", "es": "Est\u00e1 accediendo a un sistema en pre-producci\u00f3n. Esta configuraci\u00f3n es \u00fanicamente para pruebas y para verificaci\u00f3n del sistema de preproducci\u00f3n. Si sigui\u00f3 un enlace que alguien le envi\u00f3 para llegar hasta aqu\u00ed y no es un <i>probador<\/i> probablemente se trata de un error, y usted <b>no deber\u00eda estar aqu\u00ed<\/b>", - "nl": "Je gaat nu een pre-productiesysteem gebruiken. Deze authenticatie is uitsluitend opgezet voor testen en pre-productie-verfificatie. Als iemand je een link hierheen stuurde, en je bent geen <i>tester<\/i>, dan is dit waarschijlijk een vergissing en zou je <b>niet hier moeten zijn<\/b>.", + "nl": "Je gaat nu een pre-productiesysteem gebruiken. Deze authenticatie is uitsluitend opgezet voor testen en pre-productie-verfificatie. Als iemand je een link hierheen stuurde, en je bent geen <i>tester<\/i>, dan is dit waarschijnlijk een vergissing en zou je <b>niet hier moeten zijn<\/b>.", "sl": "Dostopate do predprodukcijskega sistema, ki je namenjen izklju\u010dno preizku\u0161anju. V primeru da ste pristali na tej strani med postopkom prijave v produkcijsko storitev, je storitev verjetno napa\u010dno nastavljena.", "da": "Du tilg\u00e5r nu et pre-produktions-system. Dette autentificeringssetup er kun til test og pre-produktion verifikation. Hvis nogen har sendt et link, som peger her og du ikke er en <i>tester<\/i>, s\u00e5 har du sikekrt f\u00e5et et forkert lin og burde <b>ikke v\u00e6re her.<\/b> ", "hr": "Pristupate sustavu koji se nalazi u pretprodukcijskoj fazi. Ove autentifikacijske postavke slu\u017ee za testiranje i provjeru ispravnosti rada pretprodukcijskog sustava. Ako vam je netko poslao adresu koja pokazuje na ovu stranicu, a vi niste <i>osoba zadu\u017eena za testiranje<\/i>, vjerojatno ste <b>na ovu stranicu do\u0161li gre\u0161kom<\/b>.", diff --git a/vendor/simplesamlphp/simplesamlphp/modules/preprodwarning/lib/Auth/Process/Warning.php b/vendor/simplesamlphp/simplesamlphp/modules/preprodwarning/lib/Auth/Process/Warning.php index 2e9c8bf8a9..bbc6fdadb2 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/preprodwarning/lib/Auth/Process/Warning.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/preprodwarning/lib/Auth/Process/Warning.php @@ -1,36 +1,35 @@ <?php +namespace SimpleSAML\Module\preprodwarning\Auth\Process; + /** * Give a warning that the user is accessing a test system, not a production system. * * @package SimpleSAMLphp */ -class sspmod_preprodwarning_Auth_Process_Warning extends SimpleSAML_Auth_ProcessingFilter { - - - - /** - * Process a authentication response. - * - * This function saves the state, and redirects the user to the page where the user - * can authorize the release of the attributes. - * - * @param array $state The state of the response. - */ - public function process(&$state) { - assert('is_array($state)'); - - if (isset($state['isPassive']) && $state['isPassive'] === TRUE) { - // We have a passive request. Skip the warning - return; - } - - // Save state and redirect. - $id = SimpleSAML_Auth_State::saveState($state, 'warning:request'); - $url = SimpleSAML\Module::getModuleURL('preprodwarning/showwarning.php'); - \SimpleSAML\Utils\HTTP::redirectTrustedURL($url, array('StateId' => $id)); - } - - +class Warning extends \SimpleSAML\Auth\ProcessingFilter +{ + /** + * Process a authentication response. + * + * This function saves the state, and redirects the user to the page where the user + * can authorize the release of the attributes. + * + * @param array $state The state of the response. + */ + public function process(&$state) + { + assert(is_array($state)); + + if (isset($state['isPassive']) && $state['isPassive'] === true) { + // We have a passive request. Skip the warning + return; + } + + // Save state and redirect. + $id = \SimpleSAML\Auth\State::saveState($state, 'warning:request'); + $url = \SimpleSAML\Module::getModuleURL('preprodwarning/showwarning.php'); + \SimpleSAML\Utils\HTTP::redirectTrustedURL($url, ['StateId' => $id]); + } } diff --git a/vendor/simplesamlphp/simplesamlphp/modules/preprodwarning/locales/nl/LC_MESSAGES/preprodwarning.po b/vendor/simplesamlphp/simplesamlphp/modules/preprodwarning/locales/nl/LC_MESSAGES/preprodwarning.po index 1d8811edf2..e282707afd 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/preprodwarning/locales/nl/LC_MESSAGES/preprodwarning.po +++ b/vendor/simplesamlphp/simplesamlphp/modules/preprodwarning/locales/nl/LC_MESSAGES/preprodwarning.po @@ -23,7 +23,7 @@ msgstr "" "Je gaat nu een pre-productiesysteem gebruiken. Deze authenticatie is " "uitsluitend opgezet voor testen en pre-productie-verfificatie. Als iemand" " je een link hierheen stuurde, en je bent geen <i>tester</i>, dan is dit " -"waarschijlijk een vergissing en zou je <b>niet hier moeten zijn</b>." +"waarschijnlijk een vergissing en zou je <b>niet hier moeten zijn</b>." msgid "{preprodwarning:warning:yes}" msgstr "Ja, ik begrijp dat ik een pre-productiesysteem ga gebruiken" @@ -37,7 +37,7 @@ msgstr "" "Je gaat nu een pre-productiesysteem gebruiken. Deze authenticatie is " "uitsluitend opgezet voor testen en pre-productie-verfificatie. Als iemand" " je een link hierheen stuurde, en je bent geen <i>tester</i>, dan is dit " -"waarschijlijk een vergissing en zou je <b>niet hier moeten zijn</b>." +"waarschijnlijk een vergissing en zou je <b>niet hier moeten zijn</b>." msgid "Warning about accessing a pre-production system" msgstr "Waarschuwing: dit is een pre-productiesysteem" diff --git a/vendor/simplesamlphp/simplesamlphp/modules/preprodwarning/templates/warning.php b/vendor/simplesamlphp/simplesamlphp/modules/preprodwarning/templates/warning.php index 981e2ffe32..3d09fa9c33 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/preprodwarning/templates/warning.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/preprodwarning/templates/warning.php @@ -16,29 +16,21 @@ * @package SimpleSAMLphp */ - $this->data['header'] = $this->t('{preprodwarning:warning:warning_header}'); $this->data['autofocus'] = 'yesbutton'; $this->includeAtTemplateBase('includes/header.php'); - -?> - -<form style="display: inline; margin: 0px; padding: 0px" action="<?php echo htmlspecialchars($this->data['yesTarget']); ?>"> - - <?php - // Embed hidden fields... - foreach ($this->data['yesData'] as $name => $value) { - echo('<input type="hidden" name="' . htmlspecialchars($name) . '" value="' . htmlspecialchars($value) . '" />'); - } - ?> - <p><?php echo $this->t('{preprodwarning:warning:warning}'); ?></p> - - <input type="submit" name="yes" id="yesbutton" value="<?php echo htmlspecialchars($this->t('{preprodwarning:warning:yes}')) ?>" /> - -</form> - - -<?php +$yesTarget = htmlspecialchars($this->data['yesTarget']); +$yesWarning = htmlspecialchars($this->t('{preprodwarning:warning:yes}')); +$warning = $this->t('{preprodwarning:warning:warning}'); +echo '<form style="display: inline; margin: 0px; padding: 0px" action="'.$yesTarget.'">'; + +// Embed hidden fields... +foreach ($this->data['yesData'] as $name => $value) { + echo '<input type="hidden" name="'.htmlspecialchars($name).'" value="'.htmlspecialchars($value).'" />'; +} +echo '<p>'.$warning.'</p>'; +echo '<input type="submit" name="yes" id="yesbutton" value="'.$yesWarning.'" />'; +echo '</form>'; $this->includeAtTemplateBase('includes/footer.php'); diff --git a/vendor/simplesamlphp/simplesamlphp/modules/preprodwarning/templates/warning.twig b/vendor/simplesamlphp/simplesamlphp/modules/preprodwarning/templates/warning.twig new file mode 100644 index 0000000000..838dd072b1 --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/modules/preprodwarning/templates/warning.twig @@ -0,0 +1,18 @@ +{% set pagetitle = 'Warning about accessing a pre-production system'|trans %} +{% extends "base.twig" %} + +{% block content %} + +<form action="{{ yesTarget }}"> + + <p>{% trans %}You are now accessing a pre-production system. This authentication setup is for testing and pre-production verification only. If someone sent you a link that pointed you here, and you are not <i>a tester</i> you probably got the wrong link, and should <b>not be here</b>.{% endtrans %}</p><br /> +{% for name,value in yesData %} + <input type="hidden" name="{{ name }}" value="{{ value }}"> +{% endfor %} +<p> + <input type="submit" name="yes" class="pure-button pure-button-red" value="{{'Yes, I know I am accessing a pre-production system'|trans}}" autofocus> +</p> + +</form> + +{% endblock %} diff --git a/vendor/simplesamlphp/simplesamlphp/modules/preprodwarning/www/showwarning.php b/vendor/simplesamlphp/simplesamlphp/modules/preprodwarning/www/showwarning.php index 4749018384..394617d35c 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/preprodwarning/www/showwarning.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/preprodwarning/www/showwarning.php @@ -7,26 +7,22 @@ * @package SimpleSAMLphp */ -SimpleSAML\Logger::info('PreProdWarning - Showing warning to user'); +\SimpleSAML\Logger::info('PreProdWarning - Showing warning to user'); if (!array_key_exists('StateId', $_REQUEST)) { - throw new SimpleSAML_Error_BadRequest('Missing required StateId query parameter.'); + throw new \SimpleSAML\Error\BadRequest('Missing required StateId query parameter.'); } $id = $_REQUEST['StateId']; -$state = SimpleSAML_Auth_State::loadState($id, 'warning:request'); - +$state = \SimpleSAML\Auth\State::loadState($id, 'warning:request'); if (array_key_exists('yes', $_REQUEST)) { - // The user has pressed the yes-button - - SimpleSAML_Auth_ProcessingChain::resumeProcessing($state); + // The user has pressed the yes-button + \SimpleSAML\Auth\ProcessingChain::resumeProcessing($state); } +$globalConfig = \SimpleSAML\Configuration::getInstance(); - -$globalConfig = SimpleSAML_Configuration::getInstance(); - -$t = new SimpleSAML_XHTML_Template($globalConfig, 'preprodwarning:warning.php'); -$t->data['yesTarget'] = SimpleSAML\Module::getModuleURL('preprodwarning/showwarning.php'); -$t->data['yesData'] = array('StateId' => $id); +$t = new \SimpleSAML\XHTML\Template($globalConfig, 'preprodwarning:warning.php'); +$t->data['yesTarget'] = \SimpleSAML\Module::getModuleURL('preprodwarning/showwarning.php'); +$t->data['yesData'] = ['StateId' => $id]; $t->show(); diff --git a/vendor/simplesamlphp/simplesamlphp/modules/radius/docs/radius.md b/vendor/simplesamlphp/simplesamlphp/modules/radius/docs/radius.md index ae5e70d3af..cca9e1ab9c 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/radius/docs/radius.md +++ b/vendor/simplesamlphp/simplesamlphp/modules/radius/docs/radius.md @@ -14,7 +14,7 @@ To use this module, enable the radius module by creating a file named authentication source which uses the `radius:Radius` module to `config/authsources.php`: - 'example-radius' => array( + 'example-radius' => [ 'radius:Radius', /* @@ -24,12 +24,18 @@ authentication source which uses the `radius:Radius` module to * - port: the port of the radius server. Optional, defaults to 1812. * - secret: the radius secret to use with this server. Required. */ - 'servers' => array(array('hostname' => 'radius1.example.org', - 'port' => 1812, - 'secret' => 'topsecret'), - array('hostname' => 'radius2.example.org', - 'port' => 1812, - 'secret' => 'topsecret')), + 'servers' => [ + [ + 'hostname' => 'radius1.example.org', + 'port' => 1812, + 'secret' => 'topsecret' + ], + [ + 'hostname' => 'radius2.example.org', + 'port' => 1812, + 'secret' => 'topsecret' + ] + ], /* * The timeout for contacting the RADIUS server, in seconds. @@ -67,7 +73,7 @@ authentication source which uses the `radius:Radius` module to * Optional, defaults to NULL. */ 'username_attribute' => 'eduPersonPrincipalName', - ), + ], User attributes diff --git a/vendor/simplesamlphp/simplesamlphp/modules/radius/lib/Auth/Source/Radius.php b/vendor/simplesamlphp/simplesamlphp/modules/radius/lib/Auth/Source/Radius.php index 085f168a6e..70a192b413 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/radius/lib/Auth/Source/Radius.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/radius/lib/Auth/Source/Radius.php @@ -1,5 +1,7 @@ <?php +namespace SimpleSAML\Module\radius\Auth\Source; + /** * RADIUS authentication source. * @@ -7,7 +9,8 @@ * * @package SimpleSAMLphp */ -class sspmod_radius_Auth_Source_Radius extends sspmod_core_Auth_UserPassBase + +class Radius extends \SimpleSAML\Module\core\Auth\UserPassBase { /** * The list of radius servers to use. @@ -73,32 +76,38 @@ class sspmod_radius_Auth_Source_Radius extends sspmod_core_Auth_UserPassBase */ public function __construct($info, $config) { - assert('is_array($info)'); - assert('is_array($config)'); + assert(is_array($info)); + assert(is_array($config)); // Call the parent constructor first, as required by the interface parent::__construct($info, $config); // Parse configuration. - $config = SimpleSAML_Configuration::loadFromArray($config, - 'Authentication source ' . var_export($this->authId, true)); + $config = \SimpleSAML\Configuration::loadFromArray( + $config, + 'Authentication source '.var_export($this->authId, true) + ); - $this->servers = $config->getArray('servers', array()); - /* For backwards compatibility. */ + $this->servers = $config->getArray('servers', []); + // For backwards compatibility if (empty($this->servers)) { $this->hostname = $config->getString('hostname'); $this->port = $config->getIntegerRange('port', 1, 65535, 1812); $this->secret = $config->getString('secret'); - $this->servers[] = array('hostname' => $this->hostname, - 'port' => $this->port, - 'secret' => $this->secret); + $this->servers[] = [ + 'hostname' => $this->hostname, + 'port' => $this->port, + 'secret' => $this->secret + ]; } $this->timeout = $config->getInteger('timeout', 5); $this->retries = $config->getInteger('retries', 3); $this->realm = $config->getString('realm', null); $this->usernameAttribute = $config->getString('username_attribute', null); - $this->nasIdentifier = $config->getString('nas_identifier', - \SimpleSAML\Utils\HTTP::getSelfHost()); + $this->nasIdentifier = $config->getString( + 'nas_identifier', + \SimpleSAML\Utils\HTTP::getSelfHost() + ); $this->vendor = $config->getInteger('attribute_vendor', null); if ($this->vendor !== null) { @@ -116,66 +125,74 @@ public function __construct($info, $config) */ protected function login($username, $password) { - assert('is_string($username)'); - assert('is_string($password)'); + assert(is_string($username)); + assert(is_string($password)); $radius = radius_auth_open(); - /* Try to add all radius servers, trigger a failure if no one works. */ + // Try to add all radius servers, trigger a failure if no one works $success = false; foreach ($this->servers as $server) { if (!isset($server['port'])) { $server['port'] = 1812; } - if (!radius_add_server($radius, - $server['hostname'], $server['port'], $server['secret'], - $this->timeout, $this->retries)) { - SimpleSAML\Logger::info("Could not add radius server: " . - radius_strerror($radius)); + if (!radius_add_server( + $radius, + $server['hostname'], + $server['port'], + $server['secret'], + $this->timeout, + $this->retries + )) { + \SimpleSAML\Logger::info( + "Could not add radius server: ".radius_strerror($radius) + ); continue; } $success = true; } if (!$success) { - throw new Exception('Error adding radius servers, no servers available'); + throw new \Exception('Error adding radius servers, no servers available'); } - if (!radius_create_request($radius, RADIUS_ACCESS_REQUEST)) { - throw new Exception('Error creating radius request: ' . - radius_strerror($radius)); + if (!radius_create_request($radius, \RADIUS_ACCESS_REQUEST)) { + throw new \Exception( + 'Error creating radius request: '.radius_strerror($radius) + ); } if ($this->realm === null) { - radius_put_attr($radius, RADIUS_USER_NAME, $username); + radius_put_attr($radius, \RADIUS_USER_NAME, $username); } else { - radius_put_attr($radius, RADIUS_USER_NAME, $username . '@' . $this->realm); + radius_put_attr($radius, \RADIUS_USER_NAME, $username.'@'.$this->realm); } - radius_put_attr($radius, RADIUS_USER_PASSWORD, $password); + radius_put_attr($radius, \RADIUS_USER_PASSWORD, $password); if ($this->nasIdentifier !== null) { - radius_put_attr($radius, RADIUS_NAS_IDENTIFIER, $this->nasIdentifier); + radius_put_attr($radius, \RADIUS_NAS_IDENTIFIER, $this->nasIdentifier); } $res = radius_send_request($radius); - if ($res != RADIUS_ACCESS_ACCEPT) { + if ($res != \RADIUS_ACCESS_ACCEPT) { switch ($res) { - case RADIUS_ACCESS_REJECT: - /* Invalid username or password. */ - throw new SimpleSAML_Error_Error('WRONGUSERPASS'); - case RADIUS_ACCESS_CHALLENGE: - throw new Exception('Radius authentication error: Challenge requested, but not supported.'); - default: - throw new Exception('Error during radius authentication: ' . - radius_strerror($radius)); + case \RADIUS_ACCESS_REJECT: + // Invalid username or password + throw new \SimpleSAML\Error\Error('WRONGUSERPASS'); + case \RADIUS_ACCESS_CHALLENGE: + throw new \Exception('Radius authentication error: Challenge requested, but not supported.'); + default: + throw new \Exception( + 'Error during radius authentication: '.radius_strerror($radius) + ); } } - /* If we get this far, we have a valid login. */ + // If we get this far, we have a valid login - $attributes = array(); + $attributes = []; if ($this->usernameAttribute !== null) { - $attributes[$this->usernameAttribute] = array($username); + $attributes[$this->usernameAttribute] = [$username]; } if ($this->vendor === null) { @@ -186,28 +203,29 @@ protected function login($username, $password) return $attributes; } - /* get AAI attribute sets. Contributed by Stefan Winter, (c) RESTENA */ + // get AAI attribute sets. Contributed by Stefan Winter, (c) RESTENA while ($resa = radius_get_attr($radius)) { - if (!is_array($resa)) { - throw new Exception('Error getting radius attributes: ' . - radius_strerror($radius)); + throw new \Exception( + 'Error getting radius attributes: '.radius_strerror($radius) + ); } - /* Use the received user name */ - if ($resa['attr'] == RADIUS_USER_NAME) { - $attributes[$this->usernameAttribute] = array($resa['data']); + // Use the received user name + if ($resa['attr'] == \RADIUS_USER_NAME) { + $attributes[$this->usernameAttribute] = [$resa['data']]; continue; } - if ($resa['attr'] !== RADIUS_VENDOR_SPECIFIC) { + if ($resa['attr'] !== \RADIUS_VENDOR_SPECIFIC) { continue; } $resv = radius_get_vendor_attr($resa['data']); if (!is_array($resv)) { - throw new Exception('Error getting vendor specific attribute: ' . - radius_strerror($radius)); + throw new \Exception( + 'Error getting vendor specific attribute: '.radius_strerror($radius) + ); } $vendor = $resv['vendor']; @@ -218,18 +236,17 @@ protected function login($username, $password) continue; } - $attrib_name = strtok($datav,'='); + $attrib_name = strtok($datav, '='); $attrib_value = strtok('='); - /* if the attribute name is already in result set, - add another value */ + // if the attribute name is already in result set, add another value if (array_key_exists($attrib_name, $attributes)) { $attributes[$attrib_name][] = $attrib_value; } else { - $attributes[$attrib_name] = array($attrib_value); + $attributes[$attrib_name] = [$attrib_value]; } } - /* end of contribution */ + // end of contribution return $attributes; } diff --git a/vendor/simplesamlphp/simplesamlphp/modules/riak/config-templates/module_riak.php b/vendor/simplesamlphp/simplesamlphp/modules/riak/config-templates/module_riak.php index 33be27efed..99f535fee5 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/riak/config-templates/module_riak.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/riak/config-templates/module_riak.php @@ -4,13 +4,13 @@ * */ -$config = array ( - /* - * This module has the following config options and defaults. - * - * 'path' => 'riak-php-client/riak.php', - * 'host' => 'localhost', - * 'port' => 8098, - * 'bucket' => 'SimpleSAMLphp', - */ -); +$config = [ + /* + * This module has the following config options and defaults. + * + * 'path' => 'riak-php-client/riak.php', + * 'host' => 'localhost', + * 'port' => 8098, + * 'bucket' => 'SimpleSAMLphp', + */ +]; diff --git a/vendor/simplesamlphp/simplesamlphp/modules/riak/hooks/hook_cron.php b/vendor/simplesamlphp/simplesamlphp/modules/riak/hooks/hook_cron.php index 6afe0510be..c42d2c313e 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/riak/hooks/hook_cron.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/riak/hooks/hook_cron.php @@ -1,5 +1,7 @@ <?php +namespace SimpleSAML\Module\riak; + /* * Copyright (c) 2012 The University of Queensland * @@ -22,32 +24,34 @@ * and Information Technology. */ - /** * Hook to run a cron job. * * @param array &$croninfo Output */ -function riak_hook_cron(&$croninfo) { - assert('is_array($croninfo)'); - assert('array_key_exists("summary", $croninfo)'); - assert('array_key_exists("tag", $croninfo)'); +function riak_hook_cron(&$croninfo) +{ + assert(is_array($croninfo)); + assert(array_key_exists('summary', $croninfo)); + assert(array_key_exists('tag', $croninfo)); - if ($croninfo['tag'] !== 'hourly') return; + if ($croninfo['tag'] !== 'hourly') { + return; + } - try { - $store = new sspmod_riak_Store_Store(); - $result = $store->bucket->indexSearch('expires', 'int', - 1, time() - 30); - foreach ($result as $link) { - $link->getBinary()->delete(); - } + try { + $store = new \SimpleSAML\Module\riak\Store\Store(); + $result = $store->bucket->indexSearch('expires', 'int', 1, time() - 30); + foreach ($result as $link) { + $link->getBinary()->delete(); + } - SimpleSAML\Logger::info(sprintf("deleted %s riak key%s", - sizeof($result), sizeof($result) == 1 ? '' : 's')); - } catch (Exception $e) { - $message = 'riak threw exception: ' . $e->getMessage(); - SimpleSAML\Logger::warning($message); - $croninfo['summary'][] = $message; - } + \SimpleSAML\Logger::info( + sprintf("deleted %s riak key%s", sizeof($result), sizeof($result) == 1 ? '' : 's') + ); + } catch (\Exception $e) { + $message = 'riak threw exception: '.$e->getMessage(); + \SimpleSAML\Logger::warning($message); + $croninfo['summary'][] = $message; + } } diff --git a/vendor/simplesamlphp/simplesamlphp/modules/riak/lib/Store/Store.php b/vendor/simplesamlphp/simplesamlphp/modules/riak/lib/Store/Store.php index fae12f46de..c44f599502 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/riak/lib/Store/Store.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/riak/lib/Store/Store.php @@ -1,5 +1,7 @@ <?php +namespace SimpleSAML\Module\riak\Store; + /* * Copyright (c) 2012 The University of Queensland * @@ -22,82 +24,88 @@ * and Information Technology. */ -class sspmod_riak_Store_Store extends SimpleSAML\Store { - protected function __construct() { - $config = SimpleSAML_Configuration::getConfig('module_riak.php'); - - $path = $config->getString('path', 'riak-php-client/riak.php'); - $host = $config->getString('host', 'localhost'); - $port = $config->getString('port', 8098); - $bucket = $config->getString('bucket', 'simpleSAMLphp'); - - require_once($path); - $this->client = new \RiakClient($host, $port); - $this->bucket = $this->client->bucket($bucket); - } - - /** - * Retrieve a value from the datastore. - * - * @param string $type The datatype. - * @param string $key The key. - * @return mixed|NULL The value. - */ - public function get($type, $key) { - assert('is_string($type)'); - assert('is_string($key)'); - - $v = $this->bucket->getBinary("$type.$key"); - if (!$v->exists()) { - return (NULL); - } - - $expires = $v->getIndex('Expires', 'int'); - if (sizeof($expires) && (int)array_shift($expires) <= time()) { - $v->delete(); - return (NULL); - } - - return (unserialize($v->getData())); - } - - - /** - * Save a value to the datastore. - * - * @param string $type The datatype. - * @param string $key The key. - * @param mixed $value The value. - * @param int|NULL $expire The expiration time (unix timestamp), or NULL if it never expires. - */ - public function set($type, $key, $value, $expire = NULL) { - assert('is_string($type)'); - assert('is_string($key)'); - assert('is_null($expire) || (is_int($expire) && $expire > 2592000)'); - - $v = $this->bucket->newBinary("$type.$key", serialize($value), 'application/php'); - if (!is_null($expire)) { - $v->addIndex("Expires", "int", $expire); - } - - $v->store(); - } - - /** - * Delete a value from the datastore. - * - * @param string $type The datatype. - * @param string $key The key. - */ - public function delete($type, $key) { - assert('is_string($type)'); - assert('is_string($key)'); - - $v = $this->bucket->getBinary("$type.$key"); - if (!$v->exists()) { - return; - } - - $v->delete(); - } +class Store extends \SimpleSAML\Store +{ + public $client; + public $bucket; + + protected function __construct() + { + $config = \SimpleSAML\Configuration::getConfig('module_riak.php'); + + $path = $config->getString('path', 'riak-php-client/riak.php'); + $host = $config->getString('host', 'localhost'); + $port = $config->getString('port', 8098); + $bucket = $config->getString('bucket', 'simpleSAMLphp'); + + require_once($path); + $this->client = new \RiakClient($host, $port); + $this->bucket = $this->client->bucket($bucket); + } + + /** + * Retrieve a value from the datastore. + * + * @param string $type The datatype. + * @param string $key The key. + * @return mixed|NULL The value. + */ + public function get($type, $key) + { + assert(is_string($type)); + assert(is_string($key)); + + $v = $this->bucket->getBinary("$type.$key"); + if (!$v->exists()) { + return null; + } + + $expires = $v->getIndex('Expires', 'int'); + if (sizeof($expires) && (int) array_shift($expires) <= time()) { + $v->delete(); + return null; + } + + return (unserialize($v->getData())); + } + + /** + * Save a value to the datastore. + * + * @param string $type The datatype. + * @param string $key The key. + * @param mixed $value The value. + * @param int|NULL $expire The expiration time (unix timestamp), or NULL if it never expires. + */ + public function set($type, $key, $value, $expire = null) + { + assert(is_string($type)); + assert(is_string($key)); + assert($expire === null || (is_int($expire) && $expire > 2592000)); + + $v = $this->bucket->newBinary("$type.$key", serialize($value), 'application/php'); + if (!is_null($expire)) { + $v->addIndex("Expires", "int", $expire); + } + + $v->store(); + } + + /** + * Delete a value from the datastore. + * + * @param string $type The datatype. + * @param string $key The key. + */ + public function delete($type, $key) + { + assert(is_string($type)); + assert(is_string($key)); + + $v = $this->bucket->getBinary("$type.$key"); + if (!$v->exists()) { + return; + } + $v->delete(); + } } diff --git a/vendor/simplesamlphp/simplesamlphp/modules/saml/dictionaries/proxy.translation.json b/vendor/simplesamlphp/simplesamlphp/modules/saml/dictionaries/proxy.translation.json index e06c0e610e..bf80ff4caf 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/saml/dictionaries/proxy.translation.json +++ b/vendor/simplesamlphp/simplesamlphp/modules/saml/dictionaries/proxy.translation.json @@ -1,10 +1,14 @@ { "invalid_idp": { "zh-tw": "\u7121\u6548\u7684\u9a57\u8b49\u63d0\u4f9b\u8005", - "es": "Proveedor de Identidad inválido" + "es": "Proveedor de Identidad inválido", + "zu": "Umhlinzeki Kamazisi Ongalungile", + "xh": "Isiboneleli Sesazisi Esingasebenziyo" }, "invalid_idp_description": { "zh-tw": "\u60a8\u5df2\u7d93\u64c1\u6709\u4e00\u500b\u9a57\u8b49\u63d0\u4f9b\u8005 (<em>%IDP%</em>) \u7684\u6709\u6548\u7684\u9023\u7dda\uff0c\u4f46\u8a72\u9023\u7dda\u7121\u6cd5\u88ab <em>%SP%</em> \u6240\u63a5\u53d7\u3002\u60a8\u662f\u5426\u60f3\u8981\u767b\u51fa\u65e2\u6709\u7684\u9023\u7dda\u4e26\u91cd\u65b0\u7531\u5176\u4ed6\u9a57\u8b49\u63d0\u4f9b\u8005\u9032\u884c\u767b\u5165\uff1f", - "es": "Ya existe una sesión válida con un proveedor de identidad (<em>%IDP%</em>) que <em>%SP%</em> no acepta. ¿Desea cerrar su sesión actual e iniciar una nueva con otro proveedor de identidad?" + "es": "Ya existe una sesión válida con un proveedor de identidad (<em>%IDP%</em>) que <em>%SP%</em> no acepta. ¿Desea cerrar su sesión actual e iniciar una nueva con otro proveedor de identidad?", + "zu": "Kakade uneseshini evumelekile nomhlinzeki kamazisi (<em>%IDP%</em>) engamukelwa okuthi <em>%SP%</em>. Ungathanda ukuphuma kuseshini yakho ekhona kakade futhi uphinde ungene ngomunye umhlinzeki kamazisi?", + "xh": "Sele unayo iseshoni esebenzayo nomboneleli wesazisi (<em>%IDP%</em>) engamkelwanga yi-<em>%SP%</em>. Ingaba ungathanda ukuphuma kwiseshoni yakho esele ikho uze ungene kwakhona ngomnye umboneleli wesazisi?" } } diff --git a/vendor/simplesamlphp/simplesamlphp/modules/saml/docs/authproc_authncontextclassref.md b/vendor/simplesamlphp/simplesamlphp/modules/saml/docs/authproc_authncontextclassref.md new file mode 100644 index 0000000000..5e755a88b5 --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/modules/saml/docs/authproc_authncontextclassref.md @@ -0,0 +1,14 @@ +`saml:AuthnContextClassRef` +=========================== + +IDP-side filter for setting the `AuthnContextClassRef` element in the authentication response. + +Examples +-------- + + 'authproc.idp' => array( + 92 => array( + 'class' => 'saml:AuthnContextClassRef', + 'AuthnContextClassRef' => 'urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport', + ), + ), diff --git a/vendor/simplesamlphp/simplesamlphp/modules/saml/docs/keyrollover.md b/vendor/simplesamlphp/simplesamlphp/modules/saml/docs/keyrollover.md index 46268f2b3e..0fd99fc82d 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/saml/docs/keyrollover.md +++ b/vendor/simplesamlphp/simplesamlphp/modules/saml/docs/keyrollover.md @@ -11,7 +11,7 @@ First you must create the new key that you are going to use. To create a self signed certificate, you may use the following command: cd cert - openssl req -newkey rsa:2048 -new -x509 -days 3652 -nodes -out new.crt -keyout new.pem + openssl req -newkey rsa:3072 -new -x509 -days 3652 -nodes -out new.crt -keyout new.pem Add the new key to SimpleSAMLphp diff --git a/vendor/simplesamlphp/simplesamlphp/modules/saml/docs/sp.md b/vendor/simplesamlphp/simplesamlphp/modules/saml/docs/sp.md index f72df230ec..f03a7478ff 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/saml/docs/sp.md +++ b/vendor/simplesamlphp/simplesamlphp/modules/saml/docs/sp.md @@ -17,7 +17,7 @@ See the documentation for those extensions for more details: Parameters -------- +---------- These are parameters that can be used at runtime to control the authentication. All these parameters override the equivalent option from the configuration. @@ -52,12 +52,6 @@ All these parameters override the equivalent option from the configuration. : *Note*: SAML 2 specific. -`saml:NameIDPolicy` -: The format of the NameID we request from the IdP. - Defaults to the transient format if unspecified. - -: *Note*: SAML 2 specific. - `saml:Extensions` : The samlp:Extensions that will be sent in the login request. @@ -69,6 +63,23 @@ All these parameters override the equivalent option from the configuration. : *Note*: SAML 2 specific. +`saml:NameIDPolicy` +: The format of the NameID we request from the IdP: an array in the form of + `[ 'Format' => the format, 'allowcreate' => true or false ]`. + Set to `false` instead of an array to omit sending any specific NameIDPolicy + in the AuthnRequest. + +: For compatibility purposes, `null` is equivalent to transient and a format + can be defined as a string instead of an array. These variants are deprecated. + +: *Note*: SAML 2 specific. + +`saml:Audience` +: Add a Conditions element to the SAML AuthnRequest containing an + AudienceRestriction with one or more audiences. + +: *Note*: SAML 2 specific. + Authentication data ------------------- @@ -125,6 +136,13 @@ Options `attributes.NameFormat` : The `NameFormat` for the requested attributes. +`attributes.index` +: The `index` attribute that is set in the md:AttributeConsumingService element. Integer value that defaults to `0`. + +`attributes.isDefault` +: If present, sets the `isDefault` attribute in the md:AttributeConsumingService element. Boolean value, when + unset, the attribute will be omitted. + `attributes.required` : If you have attributes added you can here specify which should be marked as required. : The attributes should still be present in `attributes`. @@ -189,6 +207,15 @@ Options : *Note*: For this to be added to the metadata, you must also specify the `attributes` and `name` options. +`disable_scoping` +: Whether sending of samlp:Scoping elements in authentication requests should be suppressed. The default value is `FALSE`. + When set to `TRUE`, no scoping elements will be sent. This does not comply with the SAML2 specification, but allows + interoperability with ADFS which [does not support Scoping elements](https://docs.microsoft.com/en-za/azure/active-directory/develop/active-directory-single-sign-on-protocol-reference#scoping). + +: Note that this option also exists in the IdP remote configuration. An + entry in the the IdP-remote metadata overrides this the option in the + SP configuration. + `discoURL` : Set which IdP discovery service this SP should use. If this is unset, the IdP discovery service specified in the global option `idpdisco.url.{saml20|shib13}` in `config/config.php` will be used. @@ -244,12 +271,15 @@ Options : *Note*: SAML 2 specific. `NameIDPolicy` -: The format of the NameID we request from the IdP. - Defaults to the `transient` format if unspecified. +: The format of the NameID we request from the idp: an array in the form of + `[ 'Format' => the format, 'AllowCreate' => true or false ]`. + Set to `false` instead of an array to omit sending any specific NameIDPolicy + in the AuthnRequest. -: If this option is set, its value will be added to the metadata generated for this SP, in the NameIDFormat element. +: For compatibility purposes, `null` is equivalent to transient and a format + can be defined as a string instead of an array. These variants are deprecated. -: *Note 1*: SAML 2 specific. +: *Note*: SAML 2 specific. `OrganizationName` : The name of the organization responsible for this SP. @@ -362,12 +392,13 @@ Options : *Note*: SAML 2 specific. `signature.algorithm` -: The algorithm to use when signing any message generated by this service provider. Defaults to RSA-SHA1. +: The algorithm to use when signing any message generated by this service provider. Defaults to RSA-SHA256. : Possible values: * `http://www.w3.org/2000/09/xmldsig#rsa-sha1` *Note*: the use of SHA1 is **deprecated** and will be disallowed in the future. * `http://www.w3.org/2001/04/xmldsig-more#rsa-sha256` + The default. * `http://www.w3.org/2001/04/xmldsig-more#rsa-sha384` * `http://www.w3.org/2001/04/xmldsig-more#rsa-sha512` @@ -460,7 +491,7 @@ Here we will list some examples for this authentication source. // Specify friendly names for these attributes: 'sn' => 'urn:oid:2.5.4.4', 'givenName' => 'urn:oid:2.5.4.42', - ) + ), 'attributes.required' => array ( 'eduPersonPrincipalName', ), diff --git a/vendor/simplesamlphp/simplesamlphp/modules/saml/hooks/hook_metadata_hosted.php b/vendor/simplesamlphp/simplesamlphp/modules/saml/hooks/hook_metadata_hosted.php index f42ca72d54..e1dc65c36f 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/saml/hooks/hook_metadata_hosted.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/saml/hooks/hook_metadata_hosted.php @@ -5,32 +5,32 @@ * * @param array &$metadataHosted The metadata links for hosted metadata on the frontpage. */ -function saml_hook_metadata_hosted(&$metadataHosted) { - assert('is_array($metadataHosted)'); - - $sources = SimpleSAML_Auth_Source::getSourcesOfType('saml:SP'); - - foreach ($sources as $source) { - - $metadata = $source->getMetadata(); - - $name = $metadata->getValue('name', NULL); - if ($name === NULL) { - $name = $metadata->getValue('OrganizationDisplayName', NULL); - } - if ($name === NULL) { - $name = $source->getAuthID(); - } - - $md = array( - 'entityid' => $source->getEntityId(), - 'metadata-index' => $source->getEntityId(), - 'metadata-set' => 'saml20-sp-hosted', - 'metadata-url' => $source->getMetadataURL() . '?output=xhtml', - 'name' => $name, - ); - - $metadataHosted[] = $md; - } +function saml_hook_metadata_hosted(&$metadataHosted) +{ + assert(is_array($metadataHosted)); + + $sources = \SimpleSAML\Auth\Source::getSourcesOfType('saml:SP'); + + foreach ($sources as $source) { + $metadata = $source->getMetadata(); + + $name = $metadata->getValue('name', null); + if ($name === null) { + $name = $metadata->getValue('OrganizationDisplayName', null); + } + if ($name === null) { + $name = $source->getAuthId(); + } + + $md = [ + 'entityid' => $source->getEntityId(), + 'metadata-index' => $source->getEntityId(), + 'metadata-set' => 'saml20-sp-hosted', + 'metadata-url' => $source->getMetadataURL().'?output=xhtml', + 'name' => $name, + ]; + + $metadataHosted[] = $md; + } } diff --git a/vendor/simplesamlphp/simplesamlphp/modules/saml/lib/Auth/Process/AttributeNameID.php b/vendor/simplesamlphp/simplesamlphp/modules/saml/lib/Auth/Process/AttributeNameID.php index b59bd7f52e..fbb5669a80 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/saml/lib/Auth/Process/AttributeNameID.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/saml/lib/Auth/Process/AttributeNameID.php @@ -1,14 +1,15 @@ <?php +namespace SimpleSAML\Module\saml\Auth\Process; /** * Authentication processing filter to create a NameID from an attribute. * * @package SimpleSAMLphp */ -class sspmod_saml_Auth_Process_AttributeNameID extends sspmod_saml_BaseNameIDGenerator -{ +class AttributeNameID extends \SimpleSAML\Module\saml\BaseNameIDGenerator +{ /** * The attribute we should use as the NameID. * @@ -23,20 +24,20 @@ class sspmod_saml_Auth_Process_AttributeNameID extends sspmod_saml_BaseNameIDGen * @param array $config Configuration information about this filter. * @param mixed $reserved For future use. * - * @throws SimpleSAML_Error_Exception If the required options 'Format' or 'attribute' are missing. + * @throws \SimpleSAMLError\Exception If the required options 'Format' or 'attribute' are missing. */ public function __construct($config, $reserved) { parent::__construct($config, $reserved); - assert('is_array($config)'); + assert(is_array($config)); if (!isset($config['Format'])) { - throw new SimpleSAML_Error_Exception("AttributeNameID: Missing required option 'Format'."); + throw new \SimpleSAML\Error\Exception("AttributeNameID: Missing required option 'Format'."); } $this->format = (string) $config['Format']; if (!isset($config['attribute'])) { - throw new SimpleSAML_Error_Exception("AttributeNameID: Missing required option 'attribute'."); + throw new \SimpleSAML\Error\Exception("AttributeNameID: Missing required option 'attribute'."); } $this->attribute = (string) $config['attribute']; } @@ -52,14 +53,14 @@ protected function getValue(array &$state) { if (!isset($state['Attributes'][$this->attribute]) || count($state['Attributes'][$this->attribute]) === 0) { - SimpleSAML\Logger::warning( + \SimpleSAML\Logger::warning( 'Missing attribute '.var_export($this->attribute, true). ' on user - not generating attribute NameID.' ); return null; } if (count($state['Attributes'][$this->attribute]) > 1) { - SimpleSAML\Logger::warning( + \SimpleSAML\Logger::warning( 'More than one value in attribute '.var_export($this->attribute, true). ' on user - not generating attribute NameID.' ); @@ -69,7 +70,7 @@ protected function getValue(array &$state) $value = $value[0]; if (empty($value)) { - SimpleSAML\Logger::warning( + \SimpleSAML\Logger::warning( 'Empty value in attribute '.var_export($this->attribute, true). ' on user - not generating persistent NameID.' ); @@ -78,5 +79,4 @@ protected function getValue(array &$state) return $value; } - } diff --git a/vendor/simplesamlphp/simplesamlphp/modules/saml/lib/Auth/Process/AuthnContextClassRef.php b/vendor/simplesamlphp/simplesamlphp/modules/saml/lib/Auth/Process/AuthnContextClassRef.php index f7d9af2dc4..106d7b51f0 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/saml/lib/Auth/Process/AuthnContextClassRef.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/saml/lib/Auth/Process/AuthnContextClassRef.php @@ -1,14 +1,15 @@ <?php +namespace SimpleSAML\Module\saml\Auth\Process; /** * Filter for setting the AuthnContextClassRef in the response. * * @package SimpleSAMLphp */ -class sspmod_saml_Auth_Process_AuthnContextClassRef extends SimpleSAML_Auth_ProcessingFilter -{ +class AuthnContextClassRef extends \SimpleSAML\Auth\ProcessingFilter +{ /** * The URI we should set as the AuthnContextClassRef in the login response. * @@ -23,15 +24,15 @@ class sspmod_saml_Auth_Process_AuthnContextClassRef extends SimpleSAML_Auth_Proc * @param array $config Configuration information about this filter. * @param mixed $reserved For future use. * - * @throws SimpleSAML_Error_Exception if the mandatory 'AuthnContextClassRef' option is missing. + * @throws \SimpleSAML\Error\_Exception if the mandatory 'AuthnContextClassRef' option is missing. */ public function __construct($config, $reserved) { parent::__construct($config, $reserved); - assert('is_array($config)'); + assert(is_array($config)); if (!isset($config['AuthnContextClassRef'])) { - throw new SimpleSAML_Error_Exception('Missing AuthnContextClassRef option in processing filter.'); + throw new \SimpleSAML\Error\Exception('Missing AuthnContextClassRef option in processing filter.'); } $this->authnContextClassRef = (string) $config['AuthnContextClassRef']; @@ -45,7 +46,7 @@ public function __construct($config, $reserved) */ public function process(&$state) { - assert('is_array($state)'); + assert(is_array($state)); $state['saml:AuthnContextClassRef'] = $this->authnContextClassRef; } diff --git a/vendor/simplesamlphp/simplesamlphp/modules/saml/lib/Auth/Process/ExpectedAuthnContextClassRef.php b/vendor/simplesamlphp/simplesamlphp/modules/saml/lib/Auth/Process/ExpectedAuthnContextClassRef.php index 57782d419f..fd62777323 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/saml/lib/Auth/Process/ExpectedAuthnContextClassRef.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/saml/lib/Auth/Process/ExpectedAuthnContextClassRef.php @@ -1,5 +1,6 @@ <?php +namespace SimpleSAML\Module\saml\Auth\Process; /** * Attribute filter to validate AuthnContextClassRef values. @@ -16,9 +17,9 @@ * * @package SimpleSAMLphp */ -class sspmod_saml_Auth_Process_ExpectedAuthnContextClassRef extends SimpleSAML_Auth_ProcessingFilter -{ +class ExpectedAuthnContextClassRef extends \SimpleSAML\Auth\ProcessingFilter +{ /** * Array of accepted AuthnContextClassRef * @var array @@ -39,18 +40,18 @@ class sspmod_saml_Auth_Process_ExpectedAuthnContextClassRef extends SimpleSAML_A * @param array $config Configuration information about this filter. * @param mixed $reserved For future use. * - * @throws SimpleSAML_Error_Exception if the mandatory 'accepted' configuration option is missing. + * @throws \SimpleSAML\Error\Exception if the mandatory 'accepted' configuration option is missing. */ public function __construct($config, $reserved) { parent::__construct($config, $reserved); - assert('is_array($config)'); + assert(is_array($config)); if (empty($config['accepted'])) { - SimpleSAML\Logger::error( + \SimpleSAML\Logger::error( 'ExpectedAuthnContextClassRef: Configuration error. There is no accepted AuthnContextClassRef.' ); - throw new SimpleSAML_Error_Exception( + throw new \SimpleSAML\Error\Exception( 'ExpectedAuthnContextClassRef: Configuration error. There is no accepted AuthnContextClassRef.' ); } @@ -64,8 +65,8 @@ public function __construct($config, $reserved) */ public function process(&$request) { - assert('is_array($request)'); - assert('array_key_exists("Attributes", $request)'); + assert(is_array($request)); + assert(array_key_exists('Attributes', $request)); $this->AuthnContextClassRef = $request['saml:sp:State']['saml:sp:AuthnContext']; @@ -89,15 +90,15 @@ public function process(&$request) */ protected function unauthorized(&$request) { - SimpleSAML\Logger::error( + \SimpleSAML\Logger::error( 'ExpectedAuthnContextClassRef: Invalid authentication context: '.$this->AuthnContextClassRef. '. Accepted values are: '.var_export($this->accepted, true) ); - $id = SimpleSAML_Auth_State::saveState($request, 'saml:ExpectedAuthnContextClassRef:unauthorized'); - $url = SimpleSAML\Module::getModuleURL( + $id = \SimpleSAML\Auth\State::saveState($request, 'saml:ExpectedAuthnContextClassRef:unauthorized'); + $url = \SimpleSAML\Module::getModuleURL( 'saml/sp/wrong_authncontextclassref.php' ); - \SimpleSAML\Utils\HTTP::redirectTrustedURL($url, array('StateId' => $id)); + \SimpleSAML\Utils\HTTP::redirectTrustedURL($url, ['StateId' => $id]); } } diff --git a/vendor/simplesamlphp/simplesamlphp/modules/saml/lib/Auth/Process/FilterScopes.php b/vendor/simplesamlphp/simplesamlphp/modules/saml/lib/Auth/Process/FilterScopes.php index 6fe173b7b8..67ef886df0 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/saml/lib/Auth/Process/FilterScopes.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/saml/lib/Auth/Process/FilterScopes.php @@ -11,16 +11,16 @@ * @author Jaime Pérez Crespo, UNINETT AS <jaime.perez@uninett.no> * @package SimpleSAMLphp */ -class FilterScopes extends \SimpleSAML_Auth_ProcessingFilter -{ +class FilterScopes extends \SimpleSAML\Auth\ProcessingFilter +{ /** * Stores any pre-configured scoped attributes which come from the filter configuration. */ - private $scopedAttributes = array( + private $scopedAttributes = [ 'eduPersonScopedAffiliation', 'eduPersonPrincipalName' - ); + ]; /** @@ -32,7 +32,7 @@ class FilterScopes extends \SimpleSAML_Auth_ProcessingFilter public function __construct(&$config, $reserved) { parent::__construct($config, $reserved); - assert('is_array($config)'); + assert(is_array($config)); if (array_key_exists('attributes', $config) && !empty($config['attributes'])) { $this->scopedAttributes = $config['attributes']; @@ -53,7 +53,7 @@ public function process(&$request) Logger::warning('No scoped attributes configured.'); return; } - $validScopes = array(); + $validScopes = []; if (array_key_exists('scope', $src) && is_array($src['scope']) && !empty($src['scope'])) { $validScopes = $src['scope']; } @@ -64,7 +64,7 @@ public function process(&$request) } $values = $request['Attributes'][$attribute]; - $newValues = array(); + $newValues = []; foreach ($values as $value) { $ep = \SimpleSAML\Utils\Config\Metadata::getDefaultEndpoint($request['Source']['SingleSignOnService']); $loc = $ep['Location']; diff --git a/vendor/simplesamlphp/simplesamlphp/modules/saml/lib/Auth/Process/NameIDAttribute.php b/vendor/simplesamlphp/simplesamlphp/modules/saml/lib/Auth/Process/NameIDAttribute.php index 8b3ac1ec2d..e8c27dba78 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/saml/lib/Auth/Process/NameIDAttribute.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/saml/lib/Auth/Process/NameIDAttribute.php @@ -1,14 +1,15 @@ <?php +namespace SimpleSAML\Module\saml\Auth\Process; /** * Authentication processing filter to create an attribute from a NameID. * * @package SimpleSAMLphp */ -class sspmod_saml_Auth_Process_NameIDAttribute extends SimpleSAML_Auth_ProcessingFilter -{ +class NameIDAttribute extends \SimpleSAML\Auth\ProcessingFilter +{ /** * The attribute we should save the NameID in. * @@ -34,7 +35,7 @@ class sspmod_saml_Auth_Process_NameIDAttribute extends SimpleSAML_Auth_Processin public function __construct($config, $reserved) { parent::__construct($config, $reserved); - assert('is_array($config)'); + assert(is_array($config)); if (isset($config['attribute'])) { $this->attribute = (string) $config['attribute']; @@ -58,13 +59,13 @@ public function __construct($config, $reserved) * @param string $format The format string. * @return array The format string broken into its individual components. * - * @throws SimpleSAML_Error_Exception if the replacement is invalid. + * @throws \SimpleSAML\Error\Exception if the replacement is invalid. */ private static function parseFormat($format) { - assert('is_string($format)'); + assert(is_string($format)); - $ret = array(); + $ret = []; $pos = 0; while (($next = strpos($format, '%', $pos)) !== false) { $ret[] = substr($format, $pos, $next - $pos); @@ -81,13 +82,13 @@ private static function parseFormat($format) $ret[] = 'SPNameQualifier'; break; case 'V': - $ret[] = 'value'; + $ret[] = 'Value'; break; case '%': $ret[] = '%'; break; default: - throw new SimpleSAML_Error_Exception('NameIDAttribute: Invalid replacement: "%'.$replacement.'"'); + throw new \SimpleSAML\Error\Exception('NameIDAttribute: Invalid replacement: "%'.$replacement.'"'); } $pos = $next + 2; @@ -105,26 +106,25 @@ private static function parseFormat($format) */ public function process(&$state) { - assert('is_array($state)'); - assert('isset($state["Source"]["entityid"])'); - assert('isset($state["Destination"]["entityid"])'); + assert(is_array($state)); + assert(isset($state['Source']['entityid'])); + assert(isset($state['Destination']['entityid'])); if (!isset($state['saml:sp:NameID'])) { return; } $rep = $state['saml:sp:NameID']; - assert(isset($rep->value)); - + assert(!is_null($rep->getValue())); $rep->{'%'} = '%'; - if (!isset($rep->Format)) { - $rep->Format = \SAML2\Constants::NAMEID_UNSPECIFIED; + if ($rep->getFormat() !== null) { + $rep->setFormat(\SAML2\Constants::NAMEID_UNSPECIFIED); } - if (!isset($rep->NameQualifier)) { - $rep->NameQualifier = $state['Source']['entityid']; + if ($rep->getNameQualifier() !== null) { + $rep->setNameQualifier($state['Source']['entityid']); } - if (!isset($rep->SPNameQualifier)) { - $rep->SPNameQualifier = $state['Destination']['entityid']; + if ($rep->getSPNameQualifier() !== null) { + $rep->setSPNameQualifier($state['Destination']['entityid']); } $value = ''; @@ -133,11 +133,11 @@ public function process(&$state) if ($isString) { $value .= $element; } else { - $value .= $rep->$element; + $value .= call_user_func([$rep, 'get'.$element]); } $isString = !$isString; } - $state['Attributes'][$this->attribute] = array($value); + $state['Attributes'][$this->attribute] = [$value]; } } diff --git a/vendor/simplesamlphp/simplesamlphp/modules/saml/lib/Auth/Process/PersistentNameID.php b/vendor/simplesamlphp/simplesamlphp/modules/saml/lib/Auth/Process/PersistentNameID.php index 9865bc5b3d..a70c749329 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/saml/lib/Auth/Process/PersistentNameID.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/saml/lib/Auth/Process/PersistentNameID.php @@ -1,14 +1,15 @@ <?php +namespace SimpleSAML\Module\saml\Auth\Process; /** * Authentication processing filter to generate a persistent NameID. * * @package SimpleSAMLphp */ -class sspmod_saml_Auth_Process_PersistentNameID extends sspmod_saml_BaseNameIDGenerator -{ +class PersistentNameID extends \SimpleSAML\Module\saml\BaseNameIDGenerator +{ /** * Which attribute contains the unique identifier of the user. * @@ -23,17 +24,17 @@ class sspmod_saml_Auth_Process_PersistentNameID extends sspmod_saml_BaseNameIDGe * @param array $config Configuration information about this filter. * @param mixed $reserved For future use. * - * @throws SimpleSAML_Error_Exception If the required option 'attribute' is missing. + * @throws \SimpleSAML\Error\Exception If the required option 'attribute' is missing. */ public function __construct($config, $reserved) { parent::__construct($config, $reserved); - assert('is_array($config)'); + assert(is_array($config)); $this->format = \SAML2\Constants::NAMEID_PERSISTENT; if (!isset($config['attribute'])) { - throw new SimpleSAML_Error_Exception("PersistentNameID: Missing required option 'attribute'."); + throw new \SimpleSAML\Error\Exception("PersistentNameID: Missing required option 'attribute'."); } $this->attribute = $config['attribute']; } @@ -47,28 +48,27 @@ public function __construct($config, $reserved) */ protected function getValue(array &$state) { - if (!isset($state['Destination']['entityid'])) { - SimpleSAML\Logger::warning('No SP entity ID - not generating persistent NameID.'); + \SimpleSAML\Logger::warning('No SP entity ID - not generating persistent NameID.'); return null; } $spEntityId = $state['Destination']['entityid']; if (!isset($state['Source']['entityid'])) { - SimpleSAML\Logger::warning('No IdP entity ID - not generating persistent NameID.'); + \SimpleSAML\Logger::warning('No IdP entity ID - not generating persistent NameID.'); return null; } $idpEntityId = $state['Source']['entityid']; if (!isset($state['Attributes'][$this->attribute]) || count($state['Attributes'][$this->attribute]) === 0) { - SimpleSAML\Logger::warning( + \SimpleSAML\Logger::warning( 'Missing attribute '.var_export($this->attribute, true). ' on user - not generating persistent NameID.' ); return null; } if (count($state['Attributes'][$this->attribute]) > 1) { - SimpleSAML\Logger::warning( + \SimpleSAML\Logger::warning( 'More than one value in attribute '.var_export($this->attribute, true). ' on user - not generating persistent NameID.' ); @@ -78,14 +78,14 @@ protected function getValue(array &$state) $uid = $uid[0]; if (empty($uid)) { - SimpleSAML\Logger::warning( + \SimpleSAML\Logger::warning( 'Empty value in attribute '.var_export($this->attribute, true). ' on user - not generating persistent NameID.' ); return null; } - $secretSalt = SimpleSAML\Utils\Config::getSecretSalt(); + $secretSalt = \SimpleSAML\Utils\Config::getSecretSalt(); $uidData = 'uidhashbase'.$secretSalt; $uidData .= strlen($idpEntityId).':'.$idpEntityId; diff --git a/vendor/simplesamlphp/simplesamlphp/modules/saml/lib/Auth/Process/PersistentNameID2TargetedID.php b/vendor/simplesamlphp/simplesamlphp/modules/saml/lib/Auth/Process/PersistentNameID2TargetedID.php index 119a0d4772..f627f164e7 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/saml/lib/Auth/Process/PersistentNameID2TargetedID.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/saml/lib/Auth/Process/PersistentNameID2TargetedID.php @@ -1,14 +1,15 @@ <?php +namespace SimpleSAML\Module\saml\Auth\Process; /** * Authentication processing filter to create the eduPersonTargetedID attribute from the persistent NameID. * * @package SimpleSAMLphp */ -class sspmod_saml_Auth_Process_PersistentNameID2TargetedID extends SimpleSAML_Auth_ProcessingFilter -{ +class PersistentNameID2TargetedID extends \SimpleSAML\Auth\ProcessingFilter +{ /** * The attribute we should save the NameID in. * @@ -34,7 +35,7 @@ class sspmod_saml_Auth_Process_PersistentNameID2TargetedID extends SimpleSAML_Au public function __construct($config, $reserved) { parent::__construct($config, $reserved); - assert('is_array($config)'); + assert(is_array($config)); if (isset($config['attribute'])) { $this->attribute = (string) $config['attribute']; @@ -57,10 +58,10 @@ public function __construct($config, $reserved) */ public function process(&$state) { - assert('is_array($state)'); + assert(is_array($state)); if (!isset($state['saml:NameID'][\SAML2\Constants::NAMEID_PERSISTENT])) { - SimpleSAML\Logger::warning( + \SimpleSAML\Logger::warning( 'Unable to generate eduPersonTargetedID because no persistent NameID was available.' ); return; @@ -69,6 +70,6 @@ public function process(&$state) /** @var \SAML2\XML\saml\NameID $nameID */ $nameID = $state['saml:NameID'][\SAML2\Constants::NAMEID_PERSISTENT]; - $state['Attributes'][$this->attribute] = array((!$this->nameId) ? $nameID->value : $nameID); + $state['Attributes'][$this->attribute] = [(!$this->nameId) ? $nameID->getValue() : $nameID]; } } diff --git a/vendor/simplesamlphp/simplesamlphp/modules/saml/lib/Auth/Process/SQLPersistentNameID.php b/vendor/simplesamlphp/simplesamlphp/modules/saml/lib/Auth/Process/SQLPersistentNameID.php index 71add04153..172aace1c2 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/saml/lib/Auth/Process/SQLPersistentNameID.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/saml/lib/Auth/Process/SQLPersistentNameID.php @@ -1,14 +1,15 @@ <?php +namespace SimpleSAML\Module\saml\Auth\Process; /** * Authentication processing filter to generate a persistent NameID. * * @package SimpleSAMLphp */ -class sspmod_saml_Auth_Process_SQLPersistentNameID extends sspmod_saml_BaseNameIDGenerator -{ +class SQLPersistentNameID extends \SimpleSAML\Module\saml\BaseNameIDGenerator +{ /** * Which attribute contains the unique identifier of the user. * @@ -44,17 +45,17 @@ class sspmod_saml_Auth_Process_SQLPersistentNameID extends sspmod_saml_BaseNameI * @param array $config Configuration information about this filter. * @param mixed $reserved For future use. * - * @throws SimpleSAML_Error_Exception If the 'attribute' option is not specified. + * @throws \SimpleSAML\Error\Exception If the 'attribute' option is not specified. */ public function __construct($config, $reserved) { parent::__construct($config, $reserved); - assert('is_array($config)'); + assert(is_array($config)); $this->format = \SAML2\Constants::NAMEID_PERSISTENT; if (!isset($config['attribute'])) { - throw new SimpleSAML_Error_Exception("PersistentNameID: Missing required option 'attribute'."); + throw new \SimpleSAML\Error\Exception("PersistentNameID: Missing required option 'attribute'."); } $this->attribute = $config['attribute']; @@ -78,28 +79,27 @@ public function __construct($config, $reserved) * @param array $state The state array. * @return string|null The NameID value. * - * @throws sspmod_saml_Error if the NameID creation policy is invalid. + * @throws \SimpleSAML\Module\saml\Error if the NameID creation policy is invalid. */ protected function getValue(array &$state) { if (!isset($state['saml:NameIDFormat']) && !$this->allowUnspecified) { - SimpleSAML\Logger::debug( + \SimpleSAML\Logger::debug( 'SQLPersistentNameID: Request did not specify persistent NameID format, '. 'not generating persistent NameID.' ); return null; } - $validNameIdFormats = @array_filter(array( + $validNameIdFormats = @array_filter([ $state['saml:NameIDFormat'], - $state['SPMetadata']['NameIDPolicy'], $state['SPMetadata']['NameIDFormat'] - )); + ]); if (count($validNameIdFormats) && !in_array($this->format, $validNameIdFormats, true) && !$this->allowDifferent ) { - SimpleSAML\Logger::debug( + \SimpleSAML\Logger::debug( 'SQLPersistentNameID: SP expects different NameID format ('. implode(', ', $validNameIdFormats).'), not generating persistent NameID.' ); @@ -107,26 +107,26 @@ protected function getValue(array &$state) } if (!isset($state['Destination']['entityid'])) { - SimpleSAML\Logger::warning('SQLPersistentNameID: No SP entity ID - not generating persistent NameID.'); + \SimpleSAML\Logger::warning('SQLPersistentNameID: No SP entity ID - not generating persistent NameID.'); return null; } $spEntityId = $state['Destination']['entityid']; if (!isset($state['Source']['entityid'])) { - SimpleSAML\Logger::warning('SQLPersistentNameID: No IdP entity ID - not generating persistent NameID.'); + \SimpleSAML\Logger::warning('SQLPersistentNameID: No IdP entity ID - not generating persistent NameID.'); return null; } $idpEntityId = $state['Source']['entityid']; if (!isset($state['Attributes'][$this->attribute]) || count($state['Attributes'][$this->attribute]) === 0) { - SimpleSAML\Logger::warning( + \SimpleSAML\Logger::warning( 'SQLPersistentNameID: Missing attribute '.var_export($this->attribute, true). ' on user - not generating persistent NameID.' ); return null; } if (count($state['Attributes'][$this->attribute]) > 1) { - SimpleSAML\Logger::warning( + \SimpleSAML\Logger::warning( 'SQLPersistentNameID: More than one value in attribute '.var_export($this->attribute, true). ' on user - not generating persistent NameID.' ); @@ -136,16 +136,16 @@ protected function getValue(array &$state) $uid = $uid[0]; if (empty($uid)) { - SimpleSAML\Logger::warning( + \SimpleSAML\Logger::warning( 'Empty value in attribute '.var_export($this->attribute, true). ' on user - not generating persistent NameID.' ); return null; } - $value = sspmod_saml_IdP_SQLNameID::get($idpEntityId, $spEntityId, $uid); + $value = \SimpleSAML\Module\saml\IdP\SQLNameID::get($idpEntityId, $spEntityId, $uid); if ($value !== null) { - SimpleSAML\Logger::debug( + \SimpleSAML\Logger::debug( 'SQLPersistentNameID: Found persistent NameID '.var_export($value, true).' for user '. var_export($uid, true).'.' ); @@ -153,21 +153,21 @@ protected function getValue(array &$state) } if ((!isset($state['saml:AllowCreate']) || !$state['saml:AllowCreate']) && !$this->alwaysCreate) { - SimpleSAML\Logger::warning( + \SimpleSAML\Logger::warning( 'SQLPersistentNameID: Did not find persistent NameID for user, and not allowed to create new NameID.' ); - throw new sspmod_saml_Error( + throw new \SimpleSAML\Module\saml\Error( \SAML2\Constants::STATUS_RESPONDER, 'urn:oasis:names:tc:SAML:2.0:status:InvalidNameIDPolicy' ); } $value = bin2hex(openssl_random_pseudo_bytes(20)); - SimpleSAML\Logger::debug( + \SimpleSAML\Logger::debug( 'SQLPersistentNameID: Created persistent NameID '.var_export($value, true).' for user '. var_export($uid, true).'.' ); - sspmod_saml_IdP_SQLNameID::add($idpEntityId, $spEntityId, $uid, $value); + \SimpleSAML\Module\saml\IdP\SQLNameID::add($idpEntityId, $spEntityId, $uid, $value); return $value; } diff --git a/vendor/simplesamlphp/simplesamlphp/modules/saml/lib/Auth/Process/TransientNameID.php b/vendor/simplesamlphp/simplesamlphp/modules/saml/lib/Auth/Process/TransientNameID.php index f4026421ea..b4a24de5ec 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/saml/lib/Auth/Process/TransientNameID.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/saml/lib/Auth/Process/TransientNameID.php @@ -1,14 +1,15 @@ <?php +namespace SimpleSAML\Module\saml\Auth\Process; /** * Authentication processing filter to generate a transient NameID. * * @package SimpleSAMLphp */ -class sspmod_saml_Auth_Process_TransientNameID extends sspmod_saml_BaseNameIDGenerator -{ +class TransientNameID extends \SimpleSAML\Module\saml\BaseNameIDGenerator +{ /** * Initialize this filter, parse configuration * @@ -18,7 +19,7 @@ class sspmod_saml_Auth_Process_TransientNameID extends sspmod_saml_BaseNameIDGen public function __construct($config, $reserved) { parent::__construct($config, $reserved); - assert('is_array($config)'); + assert(is_array($config)); $this->format = \SAML2\Constants::NAMEID_TRANSIENT; } @@ -32,6 +33,6 @@ public function __construct($config, $reserved) */ protected function getValue(array &$state) { - return SimpleSAML\Utils\Random::generateID(); + return \SimpleSAML\Utils\Random::generateID(); } } diff --git a/vendor/simplesamlphp/simplesamlphp/modules/saml/lib/Auth/Source/SP.php b/vendor/simplesamlphp/simplesamlphp/modules/saml/lib/Auth/Source/SP.php index c1fc0ad3ad..5caae4f97b 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/saml/lib/Auth/Source/SP.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/saml/lib/Auth/Source/SP.php @@ -1,793 +1,1156 @@ <?php -class sspmod_saml_Auth_Source_SP extends SimpleSAML_Auth_Source { - - /** - * The entity ID of this SP. - * - * @var string - */ - private $entityId; - - - /** - * The metadata of this SP. - * - * @var SimpleSAML_Configuration. - */ - private $metadata; - - - /** - * The IdP the user is allowed to log into. - * - * @var string|NULL The IdP the user can log into, or NULL if the user can log into all IdPs. - */ - private $idp; - - - /** - * URL to discovery service. - * - * @var string|NULL - */ - private $discoURL; - - - /** - * Constructor for SAML SP authentication source. - * - * @param array $info Information about this authentication source. - * @param array $config Configuration. - */ - public function __construct($info, $config) { - assert('is_array($info)'); - assert('is_array($config)'); - - // Call the parent constructor first, as required by the interface - parent::__construct($info, $config); - - if (!isset($config['entityID'])) { - $config['entityID'] = $this->getMetadataURL(); - } - - /* For compatibility with code that assumes that $metadata->getString('entityid') gives the entity id. */ - $config['entityid'] = $config['entityID']; - - $this->metadata = SimpleSAML_Configuration::loadFromArray($config, 'authsources[' . var_export($this->authId, TRUE) . ']'); - $this->entityId = $this->metadata->getString('entityID'); - $this->idp = $this->metadata->getString('idp', NULL); - $this->discoURL = $this->metadata->getString('discoURL', NULL); - - if (empty($this->discoURL) && SimpleSAML\Module::isModuleEnabled('discojuice')) { - $this->discoURL = SimpleSAML\Module::getModuleURL('discojuice/central.php'); - } - } - - - /** - * Retrieve the URL to the metadata of this SP. - * - * @return string The metadata URL. - */ - public function getMetadataURL() { - - return SimpleSAML\Module::getModuleURL('saml/sp/metadata.php/' . urlencode($this->authId)); - } - - - /** - * Retrieve the entity id of this SP. - * - * @return string The entity id of this SP. - */ - public function getEntityId() { - - return $this->entityId; - } - - - /** - * Retrieve the metadata of this SP. - * - * @return SimpleSAML_Configuration The metadata of this SP. - */ - public function getMetadata() { - - return $this->metadata; - - } - - - /** - * Retrieve the metadata of an IdP. - * - * @param string $entityId The entity id of the IdP. - * @return SimpleSAML_Configuration The metadata of the IdP. - */ - public function getIdPMetadata($entityId) { - assert('is_string($entityId)'); - - if ($this->idp !== NULL && $this->idp !== $entityId) { - throw new SimpleSAML_Error_Exception('Cannot retrieve metadata for IdP ' . var_export($entityId, TRUE) . - ' because it isn\'t a valid IdP for this SP.'); - } - - $metadataHandler = SimpleSAML_Metadata_MetaDataStorageHandler::getMetadataHandler(); - - // First, look in saml20-idp-remote. - try { - return $metadataHandler->getMetaDataConfig($entityId, 'saml20-idp-remote'); - } catch (Exception $e) { - /* Metadata wasn't found. */ - SimpleSAML\Logger::debug('getIdpMetadata: ' . $e->getMessage()); - } - - /* Not found in saml20-idp-remote, look in shib13-idp-remote. */ - try { - return $metadataHandler->getMetaDataConfig($entityId, 'shib13-idp-remote'); - } catch (Exception $e) { - /* Metadata wasn't found. */ - SimpleSAML\Logger::debug('getIdpMetadata: ' . $e->getMessage()); - } - - /* Not found. */ - throw new SimpleSAML_Error_Exception('Could not find the metadata of an IdP with entity ID ' . var_export($entityId, TRUE)); - } - - - /** - * Send a SAML1 SSO request to an IdP. - * - * @param SimpleSAML_Configuration $idpMetadata The metadata of the IdP. - * @param array $state The state array for the current authentication. - */ - private function startSSO1(SimpleSAML_Configuration $idpMetadata, array $state) { - - $idpEntityId = $idpMetadata->getString('entityid'); - - $state['saml:idp'] = $idpEntityId; - - $ar = new \SimpleSAML\XML\Shib13\AuthnRequest(); - $ar->setIssuer($this->entityId); - - $id = SimpleSAML_Auth_State::saveState($state, 'saml:sp:sso'); - $ar->setRelayState($id); - - $useArtifact = $idpMetadata->getBoolean('saml1.useartifact', NULL); - if ($useArtifact === NULL) { - $useArtifact = $this->metadata->getBoolean('saml1.useartifact', FALSE); - } - - if ($useArtifact) { - $shire = SimpleSAML\Module::getModuleURL('saml/sp/saml1-acs.php/' . $this->authId . '/artifact'); - } else { - $shire = SimpleSAML\Module::getModuleURL('saml/sp/saml1-acs.php/' . $this->authId); - } - - $url = $ar->createRedirect($idpEntityId, $shire); - - SimpleSAML\Logger::debug('Starting SAML 1 SSO to ' . var_export($idpEntityId, TRUE) . - ' from ' . var_export($this->entityId, TRUE) . '.'); - \SimpleSAML\Utils\HTTP::redirectTrustedURL($url); - } - - - /** - * Send a SAML2 SSO request to an IdP. - * - * @param SimpleSAML_Configuration $idpMetadata The metadata of the IdP. - * @param array $state The state array for the current authentication. - */ - private function startSSO2(SimpleSAML_Configuration $idpMetadata, array $state) { - - if (isset($state['saml:ProxyCount']) && $state['saml:ProxyCount'] < 0) { - SimpleSAML_Auth_State::throwException( - $state, - new \SimpleSAML\Module\saml\Error\ProxyCountExceeded(\SAML2\Constants::STATUS_RESPONDER) - ); - } - - $ar = sspmod_saml_Message::buildAuthnRequest($this->metadata, $idpMetadata); - - $ar->setAssertionConsumerServiceURL(SimpleSAML\Module::getModuleURL('saml/sp/saml2-acs.php/' . $this->authId)); - - if (isset($state['SimpleSAML_Auth_Source.ReturnURL'])) { - $ar->setRelayState($state['SimpleSAML_Auth_Source.ReturnURL']); - } - - if (isset($state['saml:AuthnContextClassRef'])) { - $accr = SimpleSAML\Utils\Arrays::arrayize($state['saml:AuthnContextClassRef']); - $comp = SAML2\Constants::COMPARISON_EXACT; - if (isset($state['saml:AuthnContextComparison']) && in_array($state['AuthnContextComparison'], array( - SAML2\Constants::COMPARISON_EXACT, - SAML2\Constants::COMPARISON_MINIMUM, - SAML2\Constants::COMPARISON_MAXIMUM, - SAML2\Constants::COMPARISON_BETTER, - ), true)) { - $comp = $state['saml:AuthnContextComparison']; - } - $ar->setRequestedAuthnContext(array('AuthnContextClassRef' => $accr, 'Comparison' => $comp)); - } - - if (isset($state['ForceAuthn'])) { - $ar->setForceAuthn((bool)$state['ForceAuthn']); - } - - if (isset($state['isPassive'])) { - $ar->setIsPassive((bool)$state['isPassive']); - } - - if (isset($state['saml:NameID'])) { - if (!is_array($state['saml:NameID']) && !is_a($state['saml:NameID'], '\SAML2\XML\saml\NameID')) { - throw new SimpleSAML_Error_Exception('Invalid value of $state[\'saml:NameID\'].'); - } - $ar->setNameId($state['saml:NameID']); - } - - if (isset($state['saml:NameIDPolicy'])) { - if (is_string($state['saml:NameIDPolicy'])) { - $policy = array( - 'Format' => (string)$state['saml:NameIDPolicy'], - 'AllowCreate' => TRUE, - ); - } elseif (is_array($state['saml:NameIDPolicy'])) { - $policy = $state['saml:NameIDPolicy']; - } else { - throw new SimpleSAML_Error_Exception('Invalid value of $state[\'saml:NameIDPolicy\'].'); - } - $ar->setNameIdPolicy($policy); - } - - if (isset($state['saml:IDPList'])) { - $IDPList = $state['saml:IDPList']; - } else { - $IDPList = array(); - } - - $ar->setIDPList(array_unique(array_merge($this->metadata->getArray('IDPList', array()), - $idpMetadata->getArray('IDPList', array()), - (array) $IDPList))); - - if (isset($state['saml:ProxyCount']) && $state['saml:ProxyCount'] !== null) { - $ar->setProxyCount($state['saml:ProxyCount']); - } elseif ($idpMetadata->getInteger('ProxyCount', null) !== null) { - $ar->setProxyCount($idpMetadata->getInteger('ProxyCount', null)); - } elseif ($this->metadata->getInteger('ProxyCount', null) !== null) { - $ar->setProxyCount($this->metadata->getInteger('ProxyCount', null)); - } - - $requesterID = array(); - if (isset($state['saml:RequesterID'])) { - $requesterID = $state['saml:RequesterID']; - } - - if (isset($state['core:SP'])) { - $requesterID[] = $state['core:SP']; - } - - $ar->setRequesterID($requesterID); - - if (isset($state['saml:Extensions'])) { - $ar->setExtensions($state['saml:Extensions']); - } - - // save IdP entity ID as part of the state - $state['ExpectedIssuer'] = $idpMetadata->getString('entityid'); - - $id = SimpleSAML_Auth_State::saveState($state, 'saml:sp:sso', TRUE); - $ar->setId($id); - - SimpleSAML\Logger::debug('Sending SAML 2 AuthnRequest to ' . var_export($idpMetadata->getString('entityid'), TRUE)); - - /* Select appropriate SSO endpoint */ - if ($ar->getProtocolBinding() === \SAML2\Constants::BINDING_HOK_SSO) { - $dst = $idpMetadata->getDefaultEndpoint('SingleSignOnService', array( - \SAML2\Constants::BINDING_HOK_SSO) - ); - } else { - $dst = $idpMetadata->getDefaultEndpoint('SingleSignOnService', array( - \SAML2\Constants::BINDING_HTTP_REDIRECT, - \SAML2\Constants::BINDING_HTTP_POST) - ); - } - $ar->setDestination($dst['Location']); - - $b = \SAML2\Binding::getBinding($dst['Binding']); - - $this->sendSAML2AuthnRequest($state, $b, $ar); - - assert('FALSE'); - } - - - /** - * Function to actually send the authentication request. - * - * This function does not return. - * - * @param array &$state The state array. - * @param \SAML2\Binding $binding The binding. - * @param \SAML2\AuthnRequest $ar The authentication request. - */ - public function sendSAML2AuthnRequest(array &$state, \SAML2\Binding $binding, \SAML2\AuthnRequest $ar) { - $binding->send($ar); - assert('FALSE'); - } - - - /** - * Send a SSO request to an IdP. - * - * @param string $idp The entity ID of the IdP. - * @param array $state The state array for the current authentication. - */ - public function startSSO($idp, array $state) { - assert('is_string($idp)'); - - $idpMetadata = $this->getIdPMetadata($idp); - - $type = $idpMetadata->getString('metadata-set'); - switch ($type) { - case 'shib13-idp-remote': - $this->startSSO1($idpMetadata, $state); - assert('FALSE'); /* Should not return. */ - case 'saml20-idp-remote': - $this->startSSO2($idpMetadata, $state); - assert('FALSE'); /* Should not return. */ - default: - /* Should only be one of the known types. */ - assert('FALSE'); - } - } - - - /** - * Start an IdP discovery service operation. - * - * @param array $state The state array. - */ - private function startDisco(array $state) { - - $id = SimpleSAML_Auth_State::saveState($state, 'saml:sp:sso'); - - $config = SimpleSAML_Configuration::getInstance(); - - $discoURL = $this->discoURL; - if ($discoURL === NULL) { - /* Fallback to internal discovery service. */ - $discoURL = SimpleSAML\Module::getModuleURL('saml/disco.php'); - } - - $returnTo = SimpleSAML\Module::getModuleURL('saml/sp/discoresp.php', array('AuthID' => $id)); - - $params = array( - 'entityID' => $this->entityId, - 'return' => $returnTo, - 'returnIDParam' => 'idpentityid' - ); - - if(isset($state['saml:IDPList'])) { - $params['IDPList'] = $state['saml:IDPList']; - } - - if (isset($state['isPassive']) && $state['isPassive']) { - $params['isPassive'] = 'true'; - } - - \SimpleSAML\Utils\HTTP::redirectTrustedURL($discoURL, $params); - } - - - /** - * Start login. - * - * This function saves the information about the login, and redirects to the IdP. - * - * @param array &$state Information about the current authentication. - */ - public function authenticate(&$state) { - assert('is_array($state)'); - - /* We are going to need the authId in order to retrieve this authentication source later. */ - $state['saml:sp:AuthId'] = $this->authId; - - $idp = $this->idp; - - if (isset($state['saml:idp'])) { - $idp = (string)$state['saml:idp']; - } - - if (isset($state['saml:IDPList']) && sizeof($state['saml:IDPList']) > 0) { - // we have a SAML IDPList (we are a proxy): filter the list of IdPs available - $mdh = SimpleSAML_Metadata_MetaDataStorageHandler::getMetadataHandler(); - $known_idps = $mdh->getList(); - $intersection = array_intersect($state['saml:IDPList'], array_keys($known_idps)); - - if (empty($intersection)) { // all requested IdPs are unknown - throw new SimpleSAML\Module\saml\Error\NoSupportedIDP( - \SAML2\Constants::STATUS_REQUESTER, - 'None of the IdPs requested are supported by this proxy.' - ); - } - - if (!is_null($idp) && !in_array($idp, $intersection, true)) { // the IdP is enforced but not in the IDPList - throw new SimpleSAML\Module\saml\Error\NoAvailableIDP( - \SAML2\Constants::STATUS_REQUESTER, - 'None of the IdPs requested are available to this proxy.' - ); - } - - if (is_null($idp) && sizeof($intersection) === 1) { // only one IdP requested or valid - $idp = current($state['saml:IDPList']); - } - } - - if ($idp === NULL) { - $this->startDisco($state); - assert('FALSE'); - } - - $this->startSSO($idp, $state); - assert('FALSE'); - } - - - /** - * Re-authenticate an user. - * - * This function is called by the IdP to give the authentication source a chance to - * interact with the user even in the case when the user is already authenticated. - * - * @param array &$state Information about the current authentication. - */ - public function reauthenticate(array &$state) { - assert('is_array($state)'); - - $session = SimpleSAML_Session::getSessionFromRequest(); - $data = $session->getAuthState($this->authId); - foreach ($data as $k => $v) { - $state[$k] = $v; - } - - // check if we have an IDPList specified in the request - if (isset($state['saml:IDPList']) && sizeof($state['saml:IDPList']) > 0 && - !in_array($state['saml:sp:IdP'], $state['saml:IDPList'], true)) - { - /* - * The user has an existing, valid session. However, the SP provided a list of IdPs it accepts for - * authentication, and the IdP the existing session is related to is not in that list. - * - * First, check if we recognize any of the IdPs requested. - */ - - $mdh = SimpleSAML_Metadata_MetaDataStorageHandler::getMetadataHandler(); - $known_idps = $mdh->getList(); - $intersection = array_intersect($state['saml:IDPList'], array_keys($known_idps)); - - if (empty($intersection)) { // all requested IdPs are unknown - throw new SimpleSAML\Module\saml\Error\NoSupportedIDP( - \SAML2\Constants::STATUS_REQUESTER, - 'None of the IdPs requested are supported by this proxy.' - ); - } - - /* - * We have at least one IdP in the IDPList that we recognize, and it's not the one currently in use. Let's - * see if this proxy enforces the use of one single IdP. - */ - if (!is_null($this->idp) && !in_array($this->idp, $intersection, true)) { // an IdP is enforced but not requested - throw new SimpleSAML\Module\saml\Error\NoAvailableIDP( - \SAML2\Constants::STATUS_REQUESTER, - 'None of the IdPs requested are available to this proxy.' - ); - } - - /* - * We need to inform the user, and ask whether we should logout before starting the authentication process - * again with a different IdP, or cancel the current SSO attempt. - */ - SimpleSAML\Logger::warning( - "Reauthentication after logout is needed. The IdP '${state['saml:sp:IdP']}' is not in the IDPList ". - "provided by the Service Provider '${state['core:SP']}'." - ); - - $state['saml:sp:IdPMetadata'] = $this->getIdPMetadata($state['saml:sp:IdP']); - $state['saml:sp:AuthId'] = $this->authId; - self::askForIdPChange($state); - } - } - - - /** - * Ask the user to log out before being able to log in again with a different identity provider. Note that this - * method is intended for instances of SimpleSAMLphp running as a SAML proxy, and therefore acting both as an SP - * and an IdP at the same time. - * - * This method will never return. - * - * @param array $state The state array. The following keys must be defined in the array: - * - 'saml:sp:IdPMetadata': a SimpleSAML_Configuration object containing the metadata of the IdP that authenticated - * the user in the current session. - * - 'saml:sp:AuthId': the identifier of the current authentication source. - * - 'core:IdP': the identifier of the local IdP. - * - 'SPMetadata': an array with the metadata of this local SP. - * - * @throws SimpleSAML_Error_NoPassive In case the authentication request was passive. - */ - public static function askForIdPChange(array &$state) - { - assert('array_key_exists("saml:sp:IdPMetadata", $state)'); - assert('array_key_exists("saml:sp:AuthId", $state)'); - assert('array_key_exists("core:IdP", $state)'); - assert('array_key_exists("SPMetadata", $state)'); - - if (isset($state['isPassive']) && (bool)$state['isPassive']) { - // passive request, we cannot authenticate the user - throw new SimpleSAML_Error_NoPassive('Reauthentication required'); - } - - // save the state WITHOUT a restart URL, so that we don't try an IdP-initiated login if something goes wrong - $id = SimpleSAML_Auth_State::saveState($state, 'saml:proxy:invalid_idp', true); - $url = SimpleSAML\Module::getModuleURL('saml/proxy/invalid_session.php'); - SimpleSAML\Utils\HTTP::redirectTrustedURL($url, array('AuthState' => $id)); - assert('false'); - } - - - /** - * Log the user out before logging in again. - * - * This method will never return. - * - * @param array $state The state array. - */ - public static function reauthLogout(array $state) - { - SimpleSAML\Logger::debug('Proxy: logging the user out before re-authentication.'); - - if (isset($state['Responder'])) { - $state['saml:proxy:reauthLogout:PrevResponder'] = $state['Responder']; - } - $state['Responder'] = array('sspmod_saml_Auth_Source_SP', 'reauthPostLogout'); - - $idp = SimpleSAML_IdP::getByState($state); - $idp->handleLogoutRequest($state, null); - assert('false'); - } - - - /** - * Complete login operation after re-authenticating the user on another IdP. - * - * @param array $state The authentication state. - */ - public static function reauthPostLogin(array $state) { - assert('isset($state["ReturnCallback"])'); - - // Update session state - $session = SimpleSAML_Session::getSessionFromRequest(); - $authId = $state['saml:sp:AuthId']; - $session->doLogin($authId, SimpleSAML_Auth_State::getPersistentAuthData($state)); - - // resume the login process - call_user_func($state['ReturnCallback'], $state); - assert('FALSE'); - } - - - /** - * Post-logout handler for re-authentication. - * - * This method will never return. - * - * @param SimpleSAML_IdP $idp The IdP we are logging out from. - * @param array &$state The state array with the state during logout. - */ - public static function reauthPostLogout(SimpleSAML_IdP $idp, array $state) { - assert('isset($state["saml:sp:AuthId"])'); - - SimpleSAML\Logger::debug('Proxy: logout completed.'); - - if (isset($state['saml:proxy:reauthLogout:PrevResponder'])) { - $state['Responder'] = $state['saml:proxy:reauthLogout:PrevResponder']; - } - - $sp = SimpleSAML_Auth_Source::getById($state['saml:sp:AuthId'], 'sspmod_saml_Auth_Source_SP'); - /** @var sspmod_saml_Auth_Source_SP $authSource */ - SimpleSAML\Logger::debug('Proxy: logging in again.'); - $sp->authenticate($state); - assert('false'); - } - - - /** - * Start a SAML 2 logout operation. - * - * @param array $state The logout state. - */ - public function startSLO2(&$state) { - assert('is_array($state)'); - assert('array_key_exists("saml:logout:IdP", $state)'); - assert('array_key_exists("saml:logout:NameID", $state)'); - assert('array_key_exists("saml:logout:SessionIndex", $state)'); - - $id = SimpleSAML_Auth_State::saveState($state, 'saml:slosent'); - - $idp = $state['saml:logout:IdP']; - $nameId = $state['saml:logout:NameID']; - $sessionIndex = $state['saml:logout:SessionIndex']; - - $idpMetadata = $this->getIdPMetadata($idp); - - $endpoint = $idpMetadata->getEndpointPrioritizedByBinding('SingleLogoutService', array( - \SAML2\Constants::BINDING_HTTP_REDIRECT, - \SAML2\Constants::BINDING_HTTP_POST), FALSE); - if ($endpoint === FALSE) { - SimpleSAML\Logger::info('No logout endpoint for IdP ' . var_export($idp, TRUE) . '.'); - return; - } - - $lr = sspmod_saml_Message::buildLogoutRequest($this->metadata, $idpMetadata); - $lr->setNameId($nameId); - $lr->setSessionIndex($sessionIndex); - $lr->setRelayState($id); - $lr->setDestination($endpoint['Location']); - - $encryptNameId = $idpMetadata->getBoolean('nameid.encryption', NULL); - if ($encryptNameId === NULL) { - $encryptNameId = $this->metadata->getBoolean('nameid.encryption', FALSE); - } - if ($encryptNameId) { - $lr->encryptNameId(sspmod_saml_Message::getEncryptionKey($idpMetadata)); - } - - $b = \SAML2\Binding::getBinding($endpoint['Binding']); - $b->send($lr); - - assert('FALSE'); - } - - - /** - * Start logout operation. - * - * @param array $state The logout state. - */ - public function logout(&$state) { - assert('is_array($state)'); - assert('array_key_exists("saml:logout:Type", $state)'); - - $logoutType = $state['saml:logout:Type']; - switch ($logoutType) { - case 'saml1': - /* Nothing to do. */ - return; - case 'saml2': - $this->startSLO2($state); - return; - default: - /* Should never happen. */ - assert('FALSE'); - } - } - - - /** - * Handle a response from a SSO operation. - * - * @param array $state The authentication state. - * @param string $idp The entity id of the IdP. - * @param array $attributes The attributes. - */ - public function handleResponse(array $state, $idp, array $attributes) { - assert('is_string($idp)'); - assert('array_key_exists("LogoutState", $state)'); - assert('array_key_exists("saml:logout:Type", $state["LogoutState"])'); - - $idpMetadata = $this->getIdpMetadata($idp); - - $spMetadataArray = $this->metadata->toArray(); - $idpMetadataArray = $idpMetadata->toArray(); - - /* Save the IdP in the state array. */ - $state['saml:sp:IdP'] = $idp; - $state['PersistentAuthData'][] = 'saml:sp:IdP'; - - $authProcState = array( - 'saml:sp:IdP' => $idp, - 'saml:sp:State' => $state, - 'ReturnCall' => array('sspmod_saml_Auth_Source_SP', 'onProcessingCompleted'), - - 'Attributes' => $attributes, - 'Destination' => $spMetadataArray, - 'Source' => $idpMetadataArray, - ); - - if (isset($state['saml:sp:NameID'])) { - $authProcState['saml:sp:NameID'] = $state['saml:sp:NameID']; - } - if (isset($state['saml:sp:SessionIndex'])) { - $authProcState['saml:sp:SessionIndex'] = $state['saml:sp:SessionIndex']; - } - - $pc = new SimpleSAML_Auth_ProcessingChain($idpMetadataArray, $spMetadataArray, 'sp'); - $pc->processState($authProcState); - - self::onProcessingCompleted($authProcState); - } - - - /** - * Handle a logout request from an IdP. - * - * @param string $idpEntityId The entity ID of the IdP. - */ - public function handleLogout($idpEntityId) { - assert('is_string($idpEntityId)'); - - /* Call the logout callback we registered in onProcessingCompleted(). */ - $this->callLogoutCallback($idpEntityId); - } - - - /** - * Handle an unsolicited login operations. - * - * This method creates a session from the information received. It will then redirect to the given URL. This is used - * to handle IdP initiated SSO. This method will never return. - * - * @param string $authId The id of the authentication source that received the request. - * @param array $state A state array. - * @param string $redirectTo The URL we should redirect the user to after updating the session. The function will - * check if the URL is allowed, so there is no need to manually check the URL on beforehand. Please refer to the - * 'trusted.url.domains' configuration directive for more information about allowing (or disallowing) URLs. - */ - public static function handleUnsolicitedAuth($authId, array $state, $redirectTo) { - assert('is_string($authId)'); - assert('is_string($redirectTo)'); - - $session = SimpleSAML_Session::getSessionFromRequest(); - $session->doLogin($authId, SimpleSAML_Auth_State::getPersistentAuthData($state)); - - \SimpleSAML\Utils\HTTP::redirectUntrustedURL($redirectTo); - } - - - /** - * Called when we have completed the procssing chain. - * - * @param array $authProcState The processing chain state. - */ - public static function onProcessingCompleted(array $authProcState) { - assert('array_key_exists("saml:sp:IdP", $authProcState)'); - assert('array_key_exists("saml:sp:State", $authProcState)'); - assert('array_key_exists("Attributes", $authProcState)'); - - $idp = $authProcState['saml:sp:IdP']; - $state = $authProcState['saml:sp:State']; - - $sourceId = $state['saml:sp:AuthId']; - $source = SimpleSAML_Auth_Source::getById($sourceId); - if ($source === NULL) { - throw new Exception('Could not find authentication source with id ' . $sourceId); - } - - /* Register a callback that we can call if we receive a logout request from the IdP. */ - $source->addLogoutCallback($idp, $state); - - $state['Attributes'] = $authProcState['Attributes']; - - if (isset($state['saml:sp:isUnsolicited']) && (bool)$state['saml:sp:isUnsolicited']) { - if (!empty($state['saml:sp:RelayState'])) { - $redirectTo = $state['saml:sp:RelayState']; - } else { - $redirectTo = $source->getMetadata()->getString('RelayState', '/'); - } - self::handleUnsolicitedAuth($sourceId, $state, $redirectTo); - } - - SimpleSAML_Auth_Source::completeAuth($state); - } - +namespace SimpleSAML\Module\saml\Auth\Source; + +use SimpleSAML\Auth\Source; +use SimpleSAML\Auth\State; + +class SP extends Source +{ + /** + * The entity ID of this SP. + * + * @var string + */ + private $entityId; + + /** + * The metadata of this SP. + * + * @var \SimpleSAML\Configuration + */ + private $metadata; + + /** + * The IdP the user is allowed to log into. + * + * @var string|null The IdP the user can log into, or null if the user can log into all IdPs. + */ + private $idp; + + /** + * URL to discovery service. + * + * @var string|null + */ + private $discoURL; + + /** + * Flag to indicate whether to disable sending the Scoping element. + * + * @var boolean|FALSE + */ + private $disable_scoping; + + /** + * A list of supported protocols. + * + * @var array + */ + private $protocols = []; + + + /** + * Constructor for SAML SP authentication source. + * + * @param array $info Information about this authentication source. + * @param array $config Configuration. + */ + public function __construct($info, $config) + { + assert(is_array($info)); + assert(is_array($config)); + + // Call the parent constructor first, as required by the interface + parent::__construct($info, $config); + + if (!isset($config['entityID'])) { + $config['entityID'] = $this->getMetadataURL(); + } + + /* For compatibility with code that assumes that $metadata->getString('entityid') + * gives the entity id. */ + $config['entityid'] = $config['entityID']; + + $this->metadata = \SimpleSAML\Configuration::loadFromArray( + $config, + 'authsources['.var_export($this->authId, true).']' + ); + $this->entityId = $this->metadata->getString('entityID'); + $this->idp = $this->metadata->getString('idp', null); + $this->discoURL = $this->metadata->getString('discoURL', null); + $this->disable_scoping = $this->metadata->getBoolean('disable_scoping', false); + + if (empty($this->discoURL) && \SimpleSAML\Module::isModuleEnabled('discojuice')) { + $this->discoURL = \SimpleSAML\Module::getModuleURL('discojuice/central.php'); + } + } + + /** + * Retrieve the URL to the metadata of this SP. + * + * @return string The metadata URL. + */ + public function getMetadataURL() + { + return \SimpleSAML\Module::getModuleURL('saml/sp/metadata.php/'.urlencode($this->authId)); + } + + /** + * Retrieve the entity id of this SP. + * + * @return string The entity id of this SP. + */ + public function getEntityId() + { + return $this->entityId; + } + + + /** + * Retrieve the metadata array of this SP, as a remote IdP would see it. + * + * @return array The metadata array for its use by a remote IdP. + */ + public function getHostedMetadata() + { + $entityid = $this->getEntityId(); + $metadata = [ + 'entityid' => $entityid, + 'metadata-set' => 'smal20-sp-remote', + 'SingleLogoutService' => $this->getSLOEndpoints(), + 'AssertionConsumerService' => $this->getACSEndpoints(), + ]; + + // add NameIDPolicy + if ($this->metadata->hasValue('NameIDValue')) { + $format = $this->metadata->getValue('NameIDPolicy'); + if (is_array($format)) { + $metadata['NameIDFormat'] = \SimpleSAML\Configuration::loadFromArray($format)->getString( + 'Format', + \SAML2\Constants::NAMEID_TRANSIENT + ); + } elseif (is_string($format)) { + $metadata['NameIDFormat'] = $format; + } + } + + // add attributes + $name = $this->metadata->getLocalizedString('name', null); + $attributes = $this->metadata->getArray('attributes', []); + if ($name !== null) { + if (!empty($attributes)) { + $metadata['name'] = $name; + $metadata['attributes'] = $attributes; + if ($this->metadata->hasValue('attributes.required')) { + $metadata['attributes.required'] = $this->metadata->getArray('attributes.required'); + } + if ($this->metadata->hasValue('description')) { + $metadata['description'] = $this->metadata->getArray('description'); + } + if ($this->metadata->hasValue('attributes.NameFormat')) { + $metadata['attributes.NameFormat'] = $this->metadata->getString('attributes.NameFormat'); + } + if ($this->metadata->hasValue('attributes.index')) { + $metadata['attributes.index'] = $this->metadata->getInteger('attributes.index'); + } + if ($this->metadata->hasValue('attributes.isDefault')) { + $metadata['attributes.isDefault'] = $this->metadata->getBoolean('attributes.isDefault'); + } + } + } + + // add organization info + $org = $this->metadata->getLocalizedString('OrganizationName', null); + if ($org !== null) { + $metadata['OrganizationName'] = $org; + $metadata['OrganizationDisplayName'] = $this->metadata->getLocalizedString('OrganizationDisplayName', $org); + $metadata['OrganizationURL'] = $this->metadata->getLocalizedString('OrganizationURL', null); + if ($metadata['OrganizationURL'] === null) { + throw new \SimpleSAML\Error\Exception( + 'If OrganizationName is set, OrganizationURL must also be set.' + ); + } + } + + // add contacts + $contacts = $this->metadata->getArray('contact', []); + foreach ($contacts as $contact) { + $metadata['contacts'][] = \SimpleSAML\Utils\Config\Metadata::getContact($contact); + } + + // add technical contact + $globalConfig = \SimpleSAML\Configuration::getInstance(); + $email = $globalConfig->getString('technicalcontact_email', 'na@example.org'); + if ($email && $email !== 'na@example.org') { + $contact = [ + 'emailAddress' => $email, + 'name' => $globalConfig->getString('technicalcontact_name', null), + 'contactType' => 'technical', + ]; + $metadata['contacts'][] = \SimpleSAML\Utils\Config\Metadata::getContact($contact); + } + + // add certificate(s) + $certInfo = \SimpleSAML\Utils\Crypto::loadPublicKey($this->metadata, false, 'new_'); + $hasNewCert = false; + if ($certInfo !== null && array_key_exists('certData', $certInfo)) { + $hasNewCert = true; + $metadata['keys'][] = [ + 'type' => 'X509Certificate', + 'signing' => true, + 'encryption' => true, + 'X509Certificate' => $certInfo['certData'], + 'prefix' => 'new_', + 'url' => \SimpleSAML\Module::getModuleURL( + 'admin/cert', + [ + 'sp' => $this->getAuthId(), + 'prefix' => 'new_' + ] + ), + 'name' => 'sp', + ]; + } + + $certInfo = \SimpleSAML\Utils\Crypto::loadPublicKey($this->metadata); + if ($certInfo !== null && array_key_exists('certData', $certInfo)) { + $metadata['keys'][] = [ + 'type' => 'X509Certificate', + 'signing' => true, + 'encryption' => $hasNewCert ? false : true, + 'X509Certificate' => $certInfo['certData'], + 'prefix' => '', + 'url' => \SimpleSAML\Module::getModuleURL( + 'admin/cert', + [ + 'sp' => $this->getAuthId(), + 'prefix' => '' + ] + ), + 'name' => 'sp', + ]; + } + + // add EntityAttributes extension + if ($this->metadata->hasValue('EntityAttributes')) { + $metadata['EntityAttributes'] = $this->metadata->getArray('EntityAttributes'); + } + + // add UIInfo extension + if ($this->metadata->hasValue('UIInfo')) { + $metadata['UIInfo'] = $this->metadata->getArray('UIInfo'); + } + + // add RegistrationInfo extension + if ($this->metadata->hasValue('RegistrationInfo')) { + $metadata['RegistrationInfo'] = $this->metadata->getArray('RegistrationInfo'); + } + + // add signature options + if ($this->metadata->hasValue('WantAssertiosnsSigned')) { + $metadata['saml20.sign.assertion'] = $this->metadata->getBoolean('WantAssertionsSigned'); + } + if ($this->metadata->hasValue('redirect.sign')) { + $metadata['redirect.validate'] = $this->metadata->getBoolean('redirect.sign'); + } elseif ($this->metadata->hasValue('sign.authnrequest')) { + $metadata['validate.authnrequest'] = $this->metadata->getBoolean('sign.authnrequest'); + } + + return $metadata; + } + + + /** + * Retrieve the metadata of an IdP. + * + * @param string $entityId The entity id of the IdP. + * @return \SimpleSAML\Configuration The metadata of the IdP. + */ + public function getIdPMetadata($entityId) + { + assert(is_string($entityId)); + + if ($this->idp !== null && $this->idp !== $entityId) { + throw new \SimpleSAML\Error\Exception('Cannot retrieve metadata for IdP '. + var_export($entityId, true).' because it isn\'t a valid IdP for this SP.'); + } + + $metadataHandler = \SimpleSAML\Metadata\MetaDataStorageHandler::getMetadataHandler(); + + // First, look in saml20-idp-remote. + try { + return $metadataHandler->getMetaDataConfig($entityId, 'saml20-idp-remote'); + } catch (\Exception $e) { + // Metadata wasn't found + \SimpleSAML\Logger::debug('getIdpMetadata: '.$e->getMessage()); + } + + // Not found in saml20-idp-remote, look in shib13-idp-remote + try { + return $metadataHandler->getMetaDataConfig($entityId, 'shib13-idp-remote'); + } catch (\Exception $e) { + // Metadata wasn't found + \SimpleSAML\Logger::debug('getIdpMetadata: '.$e->getMessage()); + } + + // Not found + throw new \SimpleSAML\Error\Exception('Could not find the metadata of an IdP with entity ID '. + var_export($entityId, true)); + } + + + /** + * Retrieve the metadata of this SP. + * + * @return \SimpleSAML\Configuration The metadata of this SP. + */ + public function getMetadata() + { + return $this->metadata; + } + + + /** + * Get a list with the protocols supported by this SP. + * + * @return array + */ + public function getSupportedProtocols() + { + return $this->protocols; + } + + + /** + * Get the AssertionConsumerService endpoints for a given local SP. + * + * @return array + * @throws \Exception + */ + private function getACSEndpoints() + { + $endpoints = []; + $default = [ + \SAML2\Constants::BINDING_HTTP_POST, + 'urn:oasis:names:tc:SAML:1.0:profiles:browser-post', + \SAML2\Constants::BINDING_HTTP_ARTIFACT, + 'urn:oasis:names:tc:SAML:1.0:profiles:artifact-01', + ]; + if ($this->metadata->getString('ProtocolBinding', '') === \SAML2\Constants::BINDING_HOK_SSO) { + $default[] = \SAML2\Constants::BINDING_HOK_SSO; + } + + $bindings = $this->metadata->getArray('acs.Bindings', $default); + $index = 0; + foreach ($bindings as $service) { + switch ($service) { + case \SAML2\Constants::BINDING_HTTP_POST: + $acs = [ + 'Binding' => \SAML2\Constants::BINDING_HTTP_POST, + 'Location' => \SimpleSAML\Module::getModuleURL('saml/sp/saml2-acs.php/'.$this->getAuthId()), + ]; + if (!in_array(\SAML2\Constants::NS_SAMLP, $this->protocols, true)) { + $this->protocols[] = \SAML2\Constants::NS_SAMLP; + } + break; + case 'urn:oasis:names:tc:SAML:1.0:profiles:browser-post': + $acs = [ + 'Binding' => 'urn:oasis:names:tc:SAML:1.0:profiles:browser-post', + 'Location' => \SimpleSAML\Module::getModuleURL('saml/sp/saml1-acs.php/'.$this->getAuthId()), + ]; + if (!in_array('urn:oasis:names:tc:SAML:1.0:profiles:browser-post', $this->protocols, true)) { + $this->protocols[] = 'urn:oasis:names:tc:SAML:1.1:protocol'; + } + break; + case \SAML2\Constants::BINDING_HTTP_ARTIFACT: + $acs = [ + 'Binding' => \SAML2\Constants::BINDING_HTTP_ARTIFACT, + 'Location' => \SimpleSAML\Module::getModuleURL('saml/sp/saml2-acs.php/'.$this->getAuthId()), + ]; + if (!in_array(\SAML2\Constants::NS_SAMLP, $this->protocols, true)) { + $this->protocols[] = \SAML2\Constants::NS_SAMLP; + } + break; + case 'urn:oasis:names:tc:SAML:1.0:profiles:artifact-01': + $acs = [ + 'Binding' => 'urn:oasis:names:tc:SAML:1.0:profiles:artifact-01', + 'Location' => \SimpleSAML\Module::getModuleURL( + 'saml/sp/saml1-acs.php/'.$this->getAuthId().'/artifact' + ), + ]; + if (!in_array('urn:oasis:names:tc:SAML:1.1:protocol', $this->protocols, true)) { + $this->protocols[] = 'urn:oasis:names:tc:SAML:1.1:protocol'; + } + break; + case \SAML2\Constants::BINDING_HOK_SSO: + $acs = [ + 'Binding' => \SAML2\Constants::BINDING_HOK_SSO, + 'Location' => \SimpleSAML\Module::getModuleURL('saml/sp/saml2-acs.php/'.$this->getAuthId()), + 'hoksso:ProtocolBinding' => \SAML2\Constants::BINDING_HTTP_REDIRECT, + ]; + if (!in_array(\SAML2\Constants::NS_SAMLP, $this->protocols, true)) { + $this->protocols[] = \SAML2\Constants::NS_SAMLP; + } + break; + } + $acs['index'] = $index; + $endpoints[] = $acs; + $index++; + } + return $endpoints; + } + + + /** + * Get the SingleLogoutService endpoints available for a given local SP. + * + * @return array + * @throws \SimpleSAML\Error\CriticalConfigurationError + */ + private function getSLOEndpoints() + { + $store = \SimpleSAML\Store::getInstance(); + $bindings = $this->metadata->getArray( + 'SingleLogoutServiceBinding', + [ + \SAML2\Constants::BINDING_HTTP_REDIRECT, + \SAML2\Constants::BINDING_SOAP, + ] + ); + $location = \SimpleSAML\Module::getModuleURL('saml/sp/saml2-logout.php/'.$this->getAuthId()); + + $endpoints = []; + foreach ($bindings as $binding) { + if ($binding == \SAML2\Constants::BINDING_SOAP && !($store instanceof \SimpleSAML\Store\SQL)) { + // we cannot properly support SOAP logout + continue; + } + $endpoints[] = [ + 'Binding' => $binding, + 'Location' => $location, + ]; + } + return $endpoints; + } + + + /** + * Send a SAML1 SSO request to an IdP. + * + * @param \SimpleSAML\Configuration $idpMetadata The metadata of the IdP. + * @param array $state The state array for the current authentication. + */ + private function startSSO1(\SimpleSAML\Configuration $idpMetadata, array $state) + { + $idpEntityId = $idpMetadata->getString('entityid'); + + $state['saml:idp'] = $idpEntityId; + + $ar = new \SimpleSAML\XML\Shib13\AuthnRequest(); + $ar->setIssuer($this->entityId); + + $id = State::saveState($state, 'saml:sp:sso'); + $ar->setRelayState($id); + + $useArtifact = $idpMetadata->getBoolean('saml1.useartifact', null); + if ($useArtifact === null) { + $useArtifact = $this->metadata->getBoolean('saml1.useartifact', false); + } + + if ($useArtifact) { + $shire = \SimpleSAML\Module::getModuleURL('saml/sp/saml1-acs.php/'.$this->authId.'/artifact'); + } else { + $shire = \SimpleSAML\Module::getModuleURL('saml/sp/saml1-acs.php/'.$this->authId); + } + + $url = $ar->createRedirect($idpEntityId, $shire); + + \SimpleSAML\Logger::debug('Starting SAML 1 SSO to '.var_export($idpEntityId, true). + ' from '.var_export($this->entityId, true).'.'); + \SimpleSAML\Utils\HTTP::redirectTrustedURL($url); + } + + /** + * Send a SAML2 SSO request to an IdP + * + * @param \SimpleSAML\Configuration $idpMetadata The metadata of the IdP. + * @param array $state The state array for the current authentication. + */ + private function startSSO2(\SimpleSAML\Configuration $idpMetadata, array $state) + { + if (isset($state['saml:ProxyCount']) && $state['saml:ProxyCount'] < 0) { + State::throwException( + $state, + new \SimpleSAML\Module\saml\Error\ProxyCountExceeded(\SAML2\Constants::STATUS_RESPONDER) + ); + } + + $ar = \SimpleSAML\Module\saml\Message::buildAuthnRequest($this->metadata, $idpMetadata); + + $ar->setAssertionConsumerServiceURL(\SimpleSAML\Module::getModuleURL('saml/sp/saml2-acs.php/'.$this->authId)); + + if (isset($state['\SimpleSAML\Auth\Source.ReturnURL'])) { + $ar->setRelayState($state['\SimpleSAML\Auth\Source.ReturnURL']); + } + + if (isset($state['saml:AuthnContextClassRef'])) { + $accr = \SimpleSAML\Utils\Arrays::arrayize($state['saml:AuthnContextClassRef']); + $comp = \SAML2\Constants::COMPARISON_EXACT; + if (isset($state['saml:AuthnContextComparison']) + && in_array($state['AuthnContextComparison'], [ + \SAML2\Constants::COMPARISON_EXACT, + \SAML2\Constants::COMPARISON_MINIMUM, + \SAML2\Constants::COMPARISON_MAXIMUM, + \SAML2\Constants::COMPARISON_BETTER, + ], true)) { + $comp = $state['saml:AuthnContextComparison']; + } + $ar->setRequestedAuthnContext(['AuthnContextClassRef' => $accr, 'Comparison' => $comp]); + } + + if (isset($state['saml:Audience'])) { + $ar->setAudiences($state['saml:Audience']); + } + + if (isset($state['ForceAuthn'])) { + $ar->setForceAuthn((bool) $state['ForceAuthn']); + } + + if (isset($state['isPassive'])) { + $ar->setIsPassive((bool) $state['isPassive']); + } + + if (isset($state['saml:NameID'])) { + if (!is_array($state['saml:NameID']) && !is_a($state['saml:NameID'], '\SAML2\XML\saml\NameID')) { + throw new \SimpleSAML\Error\Exception('Invalid value of $state[\'saml:NameID\'].'); + } + + $nameId = $state['saml:NameID']; + if (is_array($nameId)) { + // Must be an array > convert to object + + $nid = new \SAML2\XML\saml\NameID(); + if (!array_key_exists('Value', $nameId)) { + throw new \InvalidArgumentException('Missing "Value" in array, cannot create NameID from it.'); + } + + $nid->setValue($nameId['Value']); + if (array_key_exists('NameQualifier', $nameId) && $nameId['NameQualifier'] !== null) { + $nid->setNameQualifier($nameId['NameQualifier']); + } + if (array_key_exists('SPNameQualifier', $nameId) && $nameId['SPNameQualifier'] !== null) { + $nid->setSPNameQualifier($nameId['SPNameQualifier']); + } + if (array_key_exists('SPProvidedID', $nameId) && $nameId['SPProvidedId'] !== null) { + $nid->setSPProvidedID($nameId['SPProvidedID']); + } + if (array_key_exists('Format', $nameId) && $nameId['Format'] !== null) { + $nid->setFormat($nameId['Format']); + } + } else { + $nid = $nameId; + } + + $ar->setNameId($nid); + } + + if (isset($state['saml:NameIDPolicy'])) { + $policy = null; + if (is_string($state['saml:NameIDPolicy'])) { + $policy = [ + 'Format' => (string) $state['saml:NameIDPolicy'], + 'AllowCreate' => true, + ]; + } elseif (is_array($state['saml:NameIDPolicy'])) { + $policy = $state['saml:NameIDPolicy']; + } elseif ($state['saml:NameIDPolicy'] === null) { + $policy = ['Format' => \SAML2\Constants::NAMEID_TRANSIENT]; + } + if ($policy !== null) { + $ar->setNameIdPolicy($policy); + } + } + + $IDPList = []; + $requesterID = []; + + /* Only check for real info for Scoping element if we are going to send Scoping element */ + if ($this->disable_scoping !== true && $idpMetadata->getBoolean('disable_scoping', false) !== true) { + if (isset($state['saml:IDPList'])) { + $IDPList = $state['saml:IDPList']; + } + + if (isset($state['saml:ProxyCount']) && $state['saml:ProxyCount'] !== null) { + $ar->setProxyCount($state['saml:ProxyCount']); + } elseif ($idpMetadata->getInteger('ProxyCount', null) !== null) { + $ar->setProxyCount($idpMetadata->getInteger('ProxyCount', null)); + } elseif ($this->metadata->getInteger('ProxyCount', null) !== null) { + $ar->setProxyCount($this->metadata->getInteger('ProxyCount', null)); + } + + $requesterID = []; + if (isset($state['saml:RequesterID'])) { + $requesterID = $state['saml:RequesterID']; + } + + if (isset($state['core:SP'])) { + $requesterID[] = $state['core:SP']; + } + } else { + \SimpleSAML\Logger::debug('Disabling samlp:Scoping for '.var_export($idpMetadata->getString('entityid'), true)); + } + + $ar->setIDPList( + array_unique( + array_merge( + $this->metadata->getArray('IDPList', []), + $idpMetadata->getArray('IDPList', []), + (array) $IDPList + ) + ) + ); + + $ar->setRequesterID($requesterID); + + if (isset($state['saml:Extensions'])) { + $ar->setExtensions($state['saml:Extensions']); + } + + // save IdP entity ID as part of the state + $state['ExpectedIssuer'] = $idpMetadata->getString('entityid'); + + $id = State::saveState($state, 'saml:sp:sso', true); + $ar->setId($id); + + \SimpleSAML\Logger::debug( + 'Sending SAML 2 AuthnRequest to '.var_export($idpMetadata->getString('entityid'), true) + ); + + // Select appropriate SSO endpoint + if ($ar->getProtocolBinding() === \SAML2\Constants::BINDING_HOK_SSO) { + $dst = $idpMetadata->getDefaultEndpoint( + 'SingleSignOnService', + [ + \SAML2\Constants::BINDING_HOK_SSO + ] + ); + } else { + $dst = $idpMetadata->getEndpointPrioritizedByBinding( + 'SingleSignOnService', + [ + \SAML2\Constants::BINDING_HTTP_REDIRECT, + \SAML2\Constants::BINDING_HTTP_POST, + ] + ); + } + $ar->setDestination($dst['Location']); + + $b = \SAML2\Binding::getBinding($dst['Binding']); + + $this->sendSAML2AuthnRequest($state, $b, $ar); + + assert(false); + } + + /** + * Function to actually send the authentication request. + * + * This function does not return. + * + * @param array &$state The state array. + * @param \SAML2\Binding $binding The binding. + * @param \SAML2\AuthnRequest $ar The authentication request. + */ + public function sendSAML2AuthnRequest(array &$state, \SAML2\Binding $binding, \SAML2\AuthnRequest $ar) + { + $binding->send($ar); + assert(false); + } + + /** + * Send a SSO request to an IdP. + * + * @param string $idp The entity ID of the IdP. + * @param array $state The state array for the current authentication. + */ + public function startSSO($idp, array $state) + { + assert(is_string($idp)); + + $idpMetadata = $this->getIdPMetadata($idp); + + $type = $idpMetadata->getString('metadata-set'); + switch ($type) { + case 'shib13-idp-remote': + $this->startSSO1($idpMetadata, $state); + assert(false); // Should not return + case 'saml20-idp-remote': + $this->startSSO2($idpMetadata, $state); + assert(false); // Should not return + default: + // Should only be one of the known types + assert(false); + } + } + + /** + * Start an IdP discovery service operation. + * + * @param array $state The state array. + */ + private function startDisco(array $state) + { + $id = State::saveState($state, 'saml:sp:sso'); + + $discoURL = $this->discoURL; + if ($discoURL === null) { + // Fallback to internal discovery service + $discoURL = \SimpleSAML\Module::getModuleURL('saml/disco.php'); + } + + $returnTo = \SimpleSAML\Module::getModuleURL('saml/sp/discoresp.php', ['AuthID' => $id]); + + $params = [ + 'entityID' => $this->entityId, + 'return' => $returnTo, + 'returnIDParam' => 'idpentityid' + ]; + + if (isset($state['saml:IDPList'])) { + $params['IDPList'] = $state['saml:IDPList']; + } + + if (isset($state['isPassive']) && $state['isPassive']) { + $params['isPassive'] = 'true'; + } + + \SimpleSAML\Utils\HTTP::redirectTrustedURL($discoURL, $params); + } + + /** + * Start login. + * + * This function saves the information about the login, and redirects to the IdP. + * + * @param array &$state Information about the current authentication. + */ + public function authenticate(&$state) + { + assert(is_array($state)); + + // We are going to need the authId in order to retrieve this authentication source later + $state['saml:sp:AuthId'] = $this->authId; + + $idp = $this->idp; + + if (isset($state['saml:idp'])) { + $idp = (string) $state['saml:idp']; + } + + if (isset($state['saml:IDPList']) && sizeof($state['saml:IDPList']) > 0) { + // we have a SAML IDPList (we are a proxy): filter the list of IdPs available + $mdh = \SimpleSAML\Metadata\MetaDataStorageHandler::getMetadataHandler(); + $known_idps = $mdh->getList(); + $intersection = array_intersect($state['saml:IDPList'], array_keys($known_idps)); + + if (empty($intersection)) { + // all requested IdPs are unknown + throw new \SimpleSAML\Module\saml\Error\NoSupportedIDP( + \SAML2\Constants::STATUS_REQUESTER, + 'None of the IdPs requested are supported by this proxy.' + ); + } + + if (!is_null($idp) && !in_array($idp, $intersection, true)) { + // the IdP is enforced but not in the IDPList + throw new \SimpleSAML\Module\saml\Error\NoAvailableIDP( + \SAML2\Constants::STATUS_REQUESTER, + 'None of the IdPs requested are available to this proxy.' + ); + } + + if (is_null($idp) && sizeof($intersection) === 1) { + // only one IdP requested or valid + $idp = current($state['saml:IDPList']); + } + } + + if ($idp === null) { + $this->startDisco($state); + assert(false); + } + + $this->startSSO($idp, $state); + assert(false); + } + + /** + * Re-authenticate an user. + * + * This function is called by the IdP to give the authentication source a chance to + * interact with the user even in the case when the user is already authenticated. + * + * @param array &$state Information about the current authentication. + */ + public function reauthenticate(array &$state) + { + assert(is_array($state)); + + $session = \SimpleSAML\Session::getSessionFromRequest(); + $data = $session->getAuthState($this->authId); + foreach ($data as $k => $v) { + $state[$k] = $v; + } + + // check if we have an IDPList specified in the request + if (isset($state['saml:IDPList']) && sizeof($state['saml:IDPList']) > 0 && + !in_array($state['saml:sp:IdP'], $state['saml:IDPList'], true)) { + /* + * The user has an existing, valid session. However, the SP + * provided a list of IdPs it accepts for authentication, and + * the IdP the existing session is related to is not in that list. + * + * First, check if we recognize any of the IdPs requested. + */ + + $mdh = \SimpleSAML\Metadata\MetaDataStorageHandler::getMetadataHandler(); + $known_idps = $mdh->getList(); + $intersection = array_intersect($state['saml:IDPList'], array_keys($known_idps)); + + if (empty($intersection)) { + // all requested IdPs are unknown + throw new \SimpleSAML\Module\saml\Error\NoSupportedIDP( + \SAML2\Constants::STATUS_REQUESTER, + 'None of the IdPs requested are supported by this proxy.' + ); + } + + /* + * We have at least one IdP in the IDPList that we recognize, and + * it's not the one currently in use. Let's see if this proxy + * enforces the use of one single IdP. + */ + if (!is_null($this->idp) && !in_array($this->idp, $intersection, true)) { + // an IdP is enforced but not requested + throw new \SimpleSAML\Module\saml\Error\NoAvailableIDP( + \SAML2\Constants::STATUS_REQUESTER, + 'None of the IdPs requested are available to this proxy.' + ); + } + + /* + * We need to inform the user, and ask whether we should logout before + * starting the authentication process again with a different IdP, or + * cancel the current SSO attempt. + */ + \SimpleSAML\Logger::warning( + "Reauthentication after logout is needed. The IdP '${state['saml:sp:IdP']}' is not in the IDPList ". + "provided by the Service Provider '${state['core:SP']}'." + ); + + $state['saml:sp:IdPMetadata'] = $this->getIdPMetadata($state['saml:sp:IdP']); + $state['saml:sp:AuthId'] = $this->authId; + self::askForIdPChange($state); + } + } + + + /** + * Ask the user to log out before being able to log in again with a + * different identity provider. Note that this method is intended for + * instances of SimpleSAMLphp running as a SAML proxy, and therefore + * acting both as an SP and an IdP at the same time. + * + * This method will never return. + * + * @param array $state The state array. + * The following keys must be defined in the array: + * - 'saml:sp:IdPMetadata': a \SimpleSAML\Configuration object containing + * the metadata of the IdP that authenticated the user in the current + * session. + * - 'saml:sp:AuthId': the identifier of the current authentication source. + * - 'core:IdP': the identifier of the local IdP. + * - 'SPMetadata': an array with the metadata of this local SP. + * + * @throws \SimpleSAML\Error\NoPassive In case the authentication request was passive. + */ + public static function askForIdPChange(array &$state) + { + assert(array_key_exists('saml:sp:IdPMetadata', $state)); + assert(array_key_exists('saml:sp:AuthId', $state)); + assert(array_key_exists('core:IdP', $state)); + assert(array_key_exists('SPMetadata', $state)); + + if (isset($state['isPassive']) && (bool) $state['isPassive']) { + // passive request, we cannot authenticate the user + throw new \SimpleSAML\Module\saml\Error\NoPassive( + \SAML2\Constants::STATUS_REQUESTER, + 'Reauthentication required' + ); + } + + // save the state WITHOUT a restart URL, so that we don't try an IdP-initiated login if something goes wrong + $id = State::saveState($state, 'saml:proxy:invalid_idp', true); + $url = \SimpleSAML\Module::getModuleURL('saml/proxy/invalid_session.php'); + \SimpleSAML\Utils\HTTP::redirectTrustedURL($url, ['AuthState' => $id]); + assert(false); + } + + /** + * Log the user out before logging in again. + * + * This method will never return. + * + * @param array $state The state array. + */ + public static function reauthLogout(array $state) + { + \SimpleSAML\Logger::debug('Proxy: logging the user out before re-authentication.'); + + if (isset($state['Responder'])) { + $state['saml:proxy:reauthLogout:PrevResponder'] = $state['Responder']; + } + $state['Responder'] = ['\SimpleSAML\Module\saml\Auth\Source\SP', 'reauthPostLogout']; + + $idp = \SimpleSAML\IdP::getByState($state); + $idp->handleLogoutRequest($state, null); + assert(false); + } + + /** + * Complete login operation after re-authenticating the user on another IdP. + * + * @param array $state The authentication state. + */ + public static function reauthPostLogin(array $state) + { + assert(isset($state['ReturnCallback'])); + + // Update session state + $session = \SimpleSAML\Session::getSessionFromRequest(); + $authId = $state['saml:sp:AuthId']; + $session->doLogin($authId, State::getPersistentAuthData($state)); + + // resume the login process + call_user_func($state['ReturnCallback'], $state); + assert(false); + } + + /** + * Post-logout handler for re-authentication. + * + * This method will never return. + * + * @param \SimpleSAML\IdP $idp The IdP we are logging out from. + * @param array &$state The state array with the state during logout. + */ + public static function reauthPostLogout(\SimpleSAML\IdP $idp, array $state) + { + assert(isset($state['saml:sp:AuthId'])); + + \SimpleSAML\Logger::debug('Proxy: logout completed.'); + + if (isset($state['saml:proxy:reauthLogout:PrevResponder'])) { + $state['Responder'] = $state['saml:proxy:reauthLogout:PrevResponder']; + } + + $sp = Source::getById($state['saml:sp:AuthId'], '\SimpleSAML\Module\saml\Auth\Source\SP'); + /** @var \SimpleSAML\Module\saml\Auth\Source\SP $authSource */ + \SimpleSAML\Logger::debug('Proxy: logging in again.'); + $sp->authenticate($state); + assert(false); + } + + /** + * Start a SAML 2 logout operation. + * + * @param array $state The logout state. + */ + public function startSLO2(&$state) + { + assert(is_array($state)); + assert(array_key_exists('saml:logout:IdP', $state)); + assert(array_key_exists('saml:logout:NameID', $state)); + assert(array_key_exists('saml:logout:SessionIndex', $state)); + + $id = State::saveState($state, 'saml:slosent'); + + $idp = $state['saml:logout:IdP']; + $nameId = $state['saml:logout:NameID']; + $sessionIndex = $state['saml:logout:SessionIndex']; + + $idpMetadata = $this->getIdPMetadata($idp); + + $endpoint = $idpMetadata->getEndpointPrioritizedByBinding('SingleLogoutService', [ + \SAML2\Constants::BINDING_HTTP_REDIRECT, + \SAML2\Constants::BINDING_HTTP_POST], false); + if ($endpoint === false) { + \SimpleSAML\Logger::info('No logout endpoint for IdP '.var_export($idp, true).'.'); + return; + } + + $lr = \SimpleSAML\Module\saml\Message::buildLogoutRequest($this->metadata, $idpMetadata); + $lr->setNameId($nameId); + $lr->setSessionIndex($sessionIndex); + $lr->setRelayState($id); + $lr->setDestination($endpoint['Location']); + + $encryptNameId = $idpMetadata->getBoolean('nameid.encryption', null); + if ($encryptNameId === null) { + $encryptNameId = $this->metadata->getBoolean('nameid.encryption', false); + } + if ($encryptNameId) { + $lr->encryptNameId(\SimpleSAML\Module\saml\Message::getEncryptionKey($idpMetadata)); + } + + $b = \SAML2\Binding::getBinding($endpoint['Binding']); + $b->send($lr); + + assert(false); + } + + /** + * Start logout operation. + * + * @param array $state The logout state. + */ + public function logout(&$state) + { + assert(is_array($state)); + assert(array_key_exists('saml:logout:Type', $state)); + + $logoutType = $state['saml:logout:Type']; + switch ($logoutType) { + case 'saml1': + // Nothing to do + return; + case 'saml2': + $this->startSLO2($state); + return; + default: + // Should never happen + assert(false); + } + } + + /** + * Handle a response from a SSO operation. + * + * @param array $state The authentication state. + * @param string $idp The entity id of the IdP. + * @param array $attributes The attributes. + */ + public function handleResponse(array $state, $idp, array $attributes) + { + assert(is_string($idp)); + assert(array_key_exists('LogoutState', $state)); + assert(array_key_exists('saml:logout:Type', $state['LogoutState'])); + + $idpMetadata = $this->getIdPMetadata($idp); + + $spMetadataArray = $this->metadata->toArray(); + $idpMetadataArray = $idpMetadata->toArray(); + + /* Save the IdP in the state array. */ + $state['saml:sp:IdP'] = $idp; + $state['PersistentAuthData'][] = 'saml:sp:IdP'; + + $authProcState = [ + 'saml:sp:IdP' => $idp, + 'saml:sp:State' => $state, + 'ReturnCall' => ['\SimpleSAML\Module\saml\Auth\Source\SP', 'onProcessingCompleted'], + + 'Attributes' => $attributes, + 'Destination' => $spMetadataArray, + 'Source' => $idpMetadataArray, + ]; + + if (isset($state['saml:sp:NameID'])) { + $authProcState['saml:sp:NameID'] = $state['saml:sp:NameID']; + } + if (isset($state['saml:sp:SessionIndex'])) { + $authProcState['saml:sp:SessionIndex'] = $state['saml:sp:SessionIndex']; + } + + $pc = new \SimpleSAML\Auth\ProcessingChain($idpMetadataArray, $spMetadataArray, 'sp'); + $pc->processState($authProcState); + + self::onProcessingCompleted($authProcState); + } + + /** + * Handle a logout request from an IdP. + * + * @param string $idpEntityId The entity ID of the IdP. + */ + public function handleLogout($idpEntityId) + { + assert(is_string($idpEntityId)); + + /* Call the logout callback we registered in onProcessingCompleted(). */ + $this->callLogoutCallback($idpEntityId); + } + + /** + * Handle an unsolicited login operations. + * + * This method creates a session from the information received. It will + * then redirect to the given URL. This is used to handle IdP initiated + * SSO. This method will never return. + * + * @param string $authId The id of the authentication source that received the request. + * @param array $state A state array. + * @param string $redirectTo The URL we should redirect the user to after updating + * the session. The function will check if the URL is allowed, so there is no need to + * manually check the URL on beforehand. Please refer to the 'trusted.url.domains' + * configuration directive for more information about allowing (or disallowing) URLs. + */ + public static function handleUnsolicitedAuth($authId, array $state, $redirectTo) + { + assert(is_string($authId)); + assert(is_string($redirectTo)); + + $session = \SimpleSAML\Session::getSessionFromRequest(); + $session->doLogin($authId, State::getPersistentAuthData($state)); + + \SimpleSAML\Utils\HTTP::redirectUntrustedURL($redirectTo); + } + + /** + * Called when we have completed the procssing chain. + * + * @param array $authProcState The processing chain state. + */ + public static function onProcessingCompleted(array $authProcState) + { + assert(array_key_exists('saml:sp:IdP', $authProcState)); + assert(array_key_exists('saml:sp:State', $authProcState)); + assert(array_key_exists('Attributes', $authProcState)); + + $idp = $authProcState['saml:sp:IdP']; + $state = $authProcState['saml:sp:State']; + + $sourceId = $state['saml:sp:AuthId']; + $source = Source::getById($sourceId); + if ($source === null) { + throw new \Exception('Could not find authentication source with id '.$sourceId); + } + + // Register a callback that we can call if we receive a logout request from the IdP + $source->addLogoutCallback($idp, $state); + + $state['Attributes'] = $authProcState['Attributes']; + + if (isset($state['saml:sp:isUnsolicited']) && (bool) $state['saml:sp:isUnsolicited']) { + if (!empty($state['saml:sp:RelayState'])) { + $redirectTo = $state['saml:sp:RelayState']; + } else { + $redirectTo = $source->getMetadata()->getString('RelayState', '/'); + } + self::handleUnsolicitedAuth($sourceId, $state, $redirectTo); + } + + Source::completeAuth($state); + } } diff --git a/vendor/simplesamlphp/simplesamlphp/modules/saml/lib/BaseNameIDGenerator.php b/vendor/simplesamlphp/simplesamlphp/modules/saml/lib/BaseNameIDGenerator.php index d14a8c250a..5ff64f3e3d 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/saml/lib/BaseNameIDGenerator.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/saml/lib/BaseNameIDGenerator.php @@ -1,116 +1,121 @@ <?php +namespace SimpleSAML\Module\saml; + /** * Base filter for generating NameID values. * * @package SimpleSAMLphp */ -abstract class sspmod_saml_BaseNameIDGenerator extends SimpleSAML_Auth_ProcessingFilter { - - /** - * What NameQualifier should be used. - * Can be one of: - * - a string: The qualifier to use. - * - FALSE: Do not include a NameQualifier. This is the default. - * - TRUE: Use the IdP entity ID. - * - * @var string|bool - */ - private $nameQualifier; - - - /** - * What SPNameQualifier should be used. - * Can be one of: - * - a string: The qualifier to use. - * - FALSE: Do not include a SPNameQualifier. - * - TRUE: Use the SP entity ID. This is the default. - * - * @var string|bool - */ - private $spNameQualifier; - - - /** - * The format of this NameID. - * - * This property must be initialized the subclass. - * - * @var string - */ - protected $format; - - - /** - * Initialize this filter, parse configuration. - * - * @param array $config Configuration information about this filter. - * @param mixed $reserved For future use. - */ - public function __construct($config, $reserved) { - parent::__construct($config, $reserved); - assert('is_array($config)'); - - if (isset($config['NameQualifier'])) { - $this->nameQualifier = $config['NameQualifier']; - } else { - $this->nameQualifier = FALSE; - } - - if (isset($config['SPNameQualifier'])) { - $this->spNameQualifier = $config['SPNameQualifier']; - } else { - $this->spNameQualifier = TRUE; - } - } - - - /** - * Get the NameID value. - * - * @return string|NULL The NameID value. - */ - abstract protected function getValue(array &$state); - - - /** - * Generate transient NameID. - * - * @param array &$state The request state. - */ - public function process(&$state) { - assert('is_array($state)'); - assert('is_string($this->format)'); - - $value = $this->getValue($state); - if ($value === NULL) { - return; - } - - $nameId = new \SAML2\XML\saml\NameID(); - $nameId->value = $value; - - if ($this->nameQualifier === TRUE) { - if (isset($state['IdPMetadata']['entityid'])) { - $nameId->NameQualifier = $state['IdPMetadata']['entityid']; - } else { - SimpleSAML\Logger::warning('No IdP entity ID, unable to set NameQualifier.'); - } - } elseif (is_string($this->nameQualifier)) { - $nameId->NameQualifier = $this->nameQualifier; - } - - if ($this->spNameQualifier === TRUE) { - if (isset($state['SPMetadata']['entityid'])) { - $nameId->SPNameQualifier = $state['SPMetadata']['entityid']; - } else { - SimpleSAML\Logger::warning('No SP entity ID, unable to set SPNameQualifier.'); - } - } elseif (is_string($this->spNameQualifier)) { - $nameId->SPNameQualifier = $this->spNameQualifier; - } - - $state['saml:NameID'][$this->format] = $nameId; - } +abstract class BaseNameIDGenerator extends \SimpleSAML\Auth\ProcessingFilter +{ + /** + * What NameQualifier should be used. + * Can be one of: + * - a string: The qualifier to use. + * - FALSE: Do not include a NameQualifier. This is the default. + * - TRUE: Use the IdP entity ID. + * + * @var string|bool + */ + private $nameQualifier; + + + /** + * What SPNameQualifier should be used. + * Can be one of: + * - a string: The qualifier to use. + * - FALSE: Do not include a SPNameQualifier. + * - TRUE: Use the SP entity ID. This is the default. + * + * @var string|bool + */ + private $spNameQualifier; + + + /** + * The format of this NameID. + * + * This property must be initialized the subclass. + * + * @var string + */ + protected $format; + + + /** + * Initialize this filter, parse configuration. + * + * @param array $config Configuration information about this filter. + * @param mixed $reserved For future use. + */ + public function __construct($config, $reserved) + { + parent::__construct($config, $reserved); + assert(is_array($config)); + + if (isset($config['NameQualifier'])) { + $this->nameQualifier = $config['NameQualifier']; + } else { + $this->nameQualifier = false; + } + + if (isset($config['SPNameQualifier'])) { + $this->spNameQualifier = $config['SPNameQualifier']; + } else { + $this->spNameQualifier = true; + } + } + + + /** + * Get the NameID value. + * + * @return string|null The NameID value. + */ + abstract protected function getValue(array &$state); + + + /** + * Generate transient NameID. + * + * @param array &$state The request state. + */ + public function process(&$state) + { + assert(is_array($state)); + assert(is_string($this->format)); + + $value = $this->getValue($state); + if ($value === null) { + return; + } + + $nameId = new \SAML2\XML\saml\NameID(); + $nameId->setValue($value); + $nameId->setFormat($this->format); + + if ($this->nameQualifier === true) { + if (isset($state['IdPMetadata']['entityid'])) { + $nameId->setNameQualifier($state['IdPMetadata']['entityid']); + } else { + \SimpleSAML\Logger::warning('No IdP entity ID, unable to set NameQualifier.'); + } + } elseif (is_string($this->nameQualifier)) { + $nameId->setNameQualifier($this->nameQualifier); + } + + if ($this->spNameQualifier === true) { + if (isset($state['SPMetadata']['entityid'])) { + $nameId->setSPNameQualifier($state['SPMetadata']['entityid']); + } else { + \SimpleSAML\Logger::warning('No SP entity ID, unable to set SPNameQualifier.'); + } + } elseif (is_string($this->spNameQualifier)) { + $nameId->setSPNameQualifier($this->spNameQualifier); + } + + $state['saml:NameID'][$this->format] = $nameId; + } } diff --git a/vendor/simplesamlphp/simplesamlphp/modules/saml/lib/Error.php b/vendor/simplesamlphp/simplesamlphp/modules/saml/lib/Error.php index e5654eab9c..e45b846ff8 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/saml/lib/Error.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/saml/lib/Error.php @@ -1,194 +1,199 @@ <?php +namespace SimpleSAML\Module\saml; + /** * Class for representing a SAML 2 error. * * @package SimpleSAMLphp */ -class sspmod_saml_Error extends SimpleSAML_Error_Exception { - - /** - * The top-level status code. - * - * @var string - */ - private $status; - - - /** - * The second-level status code, or NULL if no second-level status code is defined. - * - * @var string|NULL - */ - private $subStatus; - - - /** - * The status message, or NULL if no status message is defined. - * - * @var string|NULL - */ - private $statusMessage; - - - /** - * Create a SAML 2 error. - * - * @param string $status The top-level status code. - * @param string|NULL $subStatus The second-level status code. Can be NULL, in which case there is no second-level status code. - * @param string|NULL $statusMessage The status message. Can be NULL, in which case there is no status message. - * @param Exception|NULL $cause The cause of this exception. Can be NULL. - */ - public function __construct($status, $subStatus = NULL, $statusMessage = NULL, Exception $cause = NULL) { - assert('is_string($status)'); - assert('is_null($subStatus) || is_string($subStatus)'); - assert('is_null($statusMessage) || is_string($statusMessage)'); - - $st = self::shortStatus($status); - if ($subStatus !== NULL) { - $st .= '/' . self::shortStatus($subStatus); - } - if ($statusMessage !== NULL) { - $st .= ': ' . $statusMessage; - } - parent::__construct($st, 0, $cause); - - $this->status = $status; - $this->subStatus = $subStatus; - $this->statusMessage = $statusMessage; - } - - - /** - * Get the top-level status code. - * - * @return string The top-level status code. - */ - public function getStatus() { - return $this->status; - } - - - /** - * Get the second-level status code. - * - * @return string|NULL The second-level status code or NULL if no second-level status code is present. - */ - public function getSubStatus() { - return $this->subStatus; - } - - - /** - * Get the status message. - * - * @return string|NULL The status message or NULL if no status message is present. - */ - public function getStatusMessage() { - return $this->statusMessage; - } - - - /** - * Create a SAML2 error from an exception. - * - * This function attempts to create a SAML2 error with the appropriate - * status codes from an arbitrary exception. - * - * @param Exception $exception The original exception. - * @return sspmod_saml_Error The new exception. - */ - public static function fromException(Exception $exception) { - - if ($exception instanceof sspmod_saml_Error) { - // Return the original exception unchanged - return $exception; - - // TODO: remove this branch in 2.0 - } elseif ($exception instanceof SimpleSAML_Error_NoPassive) { - $e = new self( - \SAML2\Constants::STATUS_RESPONDER, - \SAML2\Constants::STATUS_NO_PASSIVE, - $exception->getMessage(), - $exception - ); - // TODO: remove this branch in 2.0 - } elseif ($exception instanceof SimpleSAML_Error_ProxyCountExceeded) { - $e = new self( - \SAML2\Constants::STATUS_RESPONDER, - \SAML2\Constants::STATUS_PROXY_COUNT_EXCEEDED, - $exception->getMessage(), - $exception - ); - } else { - $e = new self( - \SAML2\Constants::STATUS_RESPONDER, - NULL, - get_class($exception) . ': ' . $exception->getMessage(), - $exception - ); - } - - return $e; - } - - - /** - * Create a normal exception from a SAML2 error. - * - * This function attempts to reverse the operation of the fromException() function. - * If it is unable to create a more specific exception, it will return the current - * object. - * - * @see sspmod_saml_Error::fromException() - * - * @return SimpleSAML_Error_Exception An exception representing this error. - */ - public function toException() { - - if ($this->statusMessage !== NULL) { - $msg = $this->statusMessage; - } else { - $msg = ''; - } - - $e = NULL; - - switch ($this->status) { - case \SAML2\Constants::STATUS_RESPONDER: - switch ($this->subStatus) { - case \SAML2\Constants::STATUS_NO_PASSIVE: - $e = new SimpleSAML_Error_NoPassive($this->statusMessage, 0, $this); - break; - } - break; - } - - if ($e === NULL) { - return $this; - } - - return $e; - } - - - /** - * Create a short version of the status code. - * - * Remove the 'urn:oasis:names:tc:SAML:2.0:status:'-prefix of status codes - * if it is present. - * - * @param string $status The status code. - * @return string A shorter version of the status code. - */ - private static function shortStatus($status) { - assert('is_string($status)'); - - $t = 'urn:oasis:names:tc:SAML:2.0:status:'; - if (substr($status, 0, strlen($t)) === $t) { - return substr($status, strlen($t)); - } - - return $status; - } + +class Error extends \SimpleSAML\Error\Exception +{ + /** + * The top-level status code. + * + * @var string + */ + private $status; + + /** + * The second-level status code, or NULL if no second-level status code is defined. + * + * @var string|null + */ + private $subStatus; + + /** + * The status message, or NULL if no status message is defined. + * + * @var string|null + */ + private $statusMessage; + + + /** + * Create a SAML 2 error. + * + * @param string $status The top-level status code. + * @param string|null $subStatus The second-level status code. + * Can be NULL, in which case there is no second-level status code. + * @param string|null $statusMessage The status message. + * Can be NULL, in which case there is no status message. + * @param \Exception|null $cause The cause of this exception. Can be NULL. + */ + public function __construct($status, $subStatus = null, $statusMessage = null, \Exception $cause = null) + { + assert(is_string($status)); + assert($subStatus === null || is_string($subStatus)); + assert($statusMessage === null || is_string($statusMessage)); + + $st = self::shortStatus($status); + if ($subStatus !== null) { + $st .= '/'.self::shortStatus($subStatus); + } + if ($statusMessage !== null) { + $st .= ': '.$statusMessage; + } + parent::__construct($st, 0, $cause); + + $this->status = $status; + $this->subStatus = $subStatus; + $this->statusMessage = $statusMessage; + } + + + /** + * Get the top-level status code. + * + * @return string The top-level status code. + */ + public function getStatus() + { + return $this->status; + } + + + /** + * Get the second-level status code. + * + * @return string|null The second-level status code or NULL if no second-level status code is present. + */ + public function getSubStatus() + { + return $this->subStatus; + } + + + /** + * Get the status message. + * + * @return string|null The status message or NULL if no status message is present. + */ + public function getStatusMessage() + { + return $this->statusMessage; + } + + + /** + * Create a SAML2 error from an exception. + * + * This function attempts to create a SAML2 error with the appropriate + * status codes from an arbitrary exception. + * + * @param \Exception $exception The original exception. + * @return \SimpleSAML\Module\saml\Error The new exception. + */ + public static function fromException(\Exception $exception) + { + if ($exception instanceof \SimpleSAML\Module\saml\Error) { + // Return the original exception unchanged + return $exception; + + // TODO: remove this branch in 2.0 + } elseif ($exception instanceof \SimpleSAML\Error\NoPassive) { + $e = new self( + \SAML2\Constants::STATUS_RESPONDER, + \SAML2\Constants::STATUS_NO_PASSIVE, + $exception->getMessage(), + $exception + ); + // TODO: remove this branch in 2.0 + } elseif ($exception instanceof \SimpleSAML\Error\ProxyCountExceeded) { + $e = new self( + \SAML2\Constants::STATUS_RESPONDER, + \SAML2\Constants::STATUS_PROXY_COUNT_EXCEEDED, + $exception->getMessage(), + $exception + ); + } else { + $e = new self( + \SAML2\Constants::STATUS_RESPONDER, + null, + get_class($exception).': '.$exception->getMessage(), + $exception + ); + } + + return $e; + } + + + /** + * Create a normal exception from a SAML2 error. + * + * This function attempts to reverse the operation of the fromException() function. + * If it is unable to create a more specific exception, it will return the current + * object. + * + * @see \SimpleSAML\Module\saml\Error::fromException() + * + * @return \SimpleSAML\Error\Exception An exception representing this error. + */ + public function toException() + { + $e = null; + + switch ($this->status) { + case \SAML2\Constants::STATUS_RESPONDER: + switch ($this->subStatus) { + case \SAML2\Constants::STATUS_NO_PASSIVE: + $e = new \SimpleSAML\Module\saml\Error\NoPassive( + \SAML2\Constants::STATUS_RESPONDER, + $this->statusMessage + ); + break; + } + break; + } + + if ($e === null) { + return $this; + } + + return $e; + } + + + /** + * Create a short version of the status code. + * + * Remove the 'urn:oasis:names:tc:SAML:2.0:status:'-prefix of status codes + * if it is present. + * + * @param string $status The status code. + * @return string A shorter version of the status code. + */ + private static function shortStatus($status) + { + assert(is_string($status)); + + $t = 'urn:oasis:names:tc:SAML:2.0:status:'; + if (substr($status, 0, strlen($t)) === $t) { + return substr($status, strlen($t)); + } + + return $status; + } } diff --git a/vendor/simplesamlphp/simplesamlphp/modules/saml/lib/Error/NoAuthnContext.php b/vendor/simplesamlphp/simplesamlphp/modules/saml/lib/Error/NoAuthnContext.php index 27f5ecf559..54a147463b 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/saml/lib/Error/NoAuthnContext.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/saml/lib/Error/NoAuthnContext.php @@ -1,4 +1,7 @@ <?php + +namespace SimpleSAML\Module\saml\Error; + /** * A SAML error indicating that none of the requested Authentication Contexts can be used. * @@ -6,11 +9,9 @@ * @package SimpleSAMLphp */ -namespace SimpleSAML\Module\saml\Error; - use SAML2\Constants; -class NoAuthnContext extends \sspmod_saml_Error +class NoAuthnContext extends \SimpleSAML\Module\saml\Error { /** * NoAuthnContext error constructor. diff --git a/vendor/simplesamlphp/simplesamlphp/modules/saml/lib/Error/NoAvailableIDP.php b/vendor/simplesamlphp/simplesamlphp/modules/saml/lib/Error/NoAvailableIDP.php index 9245ef9934..92f78d00b5 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/saml/lib/Error/NoAvailableIDP.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/saml/lib/Error/NoAvailableIDP.php @@ -1,4 +1,7 @@ <?php + +namespace SimpleSAML\Module\saml\Error; + /** * A SAML error indicating that none of the requested IdPs can be used. * @@ -6,11 +9,9 @@ * @package SimpleSAMLphp */ -namespace SimpleSAML\Module\saml\Error; - use SAML2\Constants; -class NoAvailableIDP extends \sspmod_saml_Error +class NoAvailableIDP extends \SimpleSAML\Module\saml\Error { /** * NoAvailableIDP error constructor. diff --git a/vendor/simplesamlphp/simplesamlphp/modules/saml/lib/Error/NoPassive.php b/vendor/simplesamlphp/simplesamlphp/modules/saml/lib/Error/NoPassive.php index 2fa30be6bd..8602bce1fc 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/saml/lib/Error/NoPassive.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/saml/lib/Error/NoPassive.php @@ -1,4 +1,7 @@ <?php + +namespace SimpleSAML\Module\saml\Error; + /** * A SAML error indicating that passive authentication cannot be used. * @@ -6,11 +9,9 @@ * @package SimpleSAMLphp */ -namespace SimpleSAML\Module\saml\Error; - use SAML2\Constants; -class NoPassive extends \sspmod_saml_Error +class NoPassive extends \SimpleSAML\Module\saml\Error { /** * NoPassive error constructor. diff --git a/vendor/simplesamlphp/simplesamlphp/modules/saml/lib/Error/NoSupportedIDP.php b/vendor/simplesamlphp/simplesamlphp/modules/saml/lib/Error/NoSupportedIDP.php index 0e1e6d7f78..5eedd1d27a 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/saml/lib/Error/NoSupportedIDP.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/saml/lib/Error/NoSupportedIDP.php @@ -1,4 +1,7 @@ <?php + +namespace SimpleSAML\Module\saml\Error; + /** * A SAML error indicating that none of the IdPs requested are supported. * @@ -6,11 +9,9 @@ * @package SimpleSAMLphp */ -namespace SimpleSAML\Module\saml\Error; - use SAML2\Constants; -class NoSupportedIDP extends \sspmod_saml_Error +class NoSupportedIDP extends \SimpleSAML\Module\saml\Error { /** * NoSupportedIDP error constructor. diff --git a/vendor/simplesamlphp/simplesamlphp/modules/saml/lib/Error/ProxyCountExceeded.php b/vendor/simplesamlphp/simplesamlphp/modules/saml/lib/Error/ProxyCountExceeded.php index 7ded7b61b7..f85216d822 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/saml/lib/Error/ProxyCountExceeded.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/saml/lib/Error/ProxyCountExceeded.php @@ -1,4 +1,7 @@ <?php + +namespace SimpleSAML\Module\saml\Error; + /** * A SAML error indicating that the maximum amount of proxies traversed has been reached. * @@ -6,11 +9,9 @@ * @package SimpleSAMLphp */ -namespace SimpleSAML\Module\saml\Error; - use SAML2\Constants; -class ProxyCountExceeded extends \sspmod_saml_Error +class ProxyCountExceeded extends \SimpleSAML\Module\saml\Error { /** * ProxyCountExceeded error constructor. diff --git a/vendor/simplesamlphp/simplesamlphp/modules/saml/lib/IdP/SAML1.php b/vendor/simplesamlphp/simplesamlphp/modules/saml/lib/IdP/SAML1.php index f0e40dc9dd..e158a666b5 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/saml/lib/IdP/SAML1.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/saml/lib/IdP/SAML1.php @@ -1,135 +1,257 @@ <?php + +namespace SimpleSAML\Module\saml\IdP; + use SimpleSAML\Bindings\Shib13\HTTPPost; +use SimpleSAML\Utils\Config\Metadata; +use SimpleSAML\Utils\Crypto; +use SimpleSAML\Utils\HTTP; /** * IdP implementation for SAML 1.1 protocol. * * @package SimpleSAMLphp */ -class sspmod_saml_IdP_SAML1 { - - /** - * Send a response to the SP. - * - * @param array $state The authentication state. - */ - public static function sendResponse(array $state) { - assert('isset($state["Attributes"])'); - assert('isset($state["SPMetadata"])'); - assert('isset($state["saml:shire"])'); - assert('array_key_exists("saml:target", $state)'); // Can be NULL - - $spMetadata = $state["SPMetadata"]; - $spEntityId = $spMetadata['entityid']; - $spMetadata = SimpleSAML_Configuration::loadFromArray($spMetadata, - '$metadata[' . var_export($spEntityId, TRUE) . ']'); - - SimpleSAML\Logger::info('Sending SAML 1.1 Response to ' . var_export($spEntityId, TRUE)); - - $attributes = $state['Attributes']; - $shire = $state['saml:shire']; - $target = $state['saml:target']; - - $idp = SimpleSAML_IdP::getByState($state); - - $idpMetadata = $idp->getConfig(); - - $config = SimpleSAML_Configuration::getInstance(); - $metadata = SimpleSAML_Metadata_MetaDataStorageHandler::getMetadataHandler(); - - $statsData = array( - 'spEntityID' => $spEntityId, - 'idpEntityID' => $idpMetadata->getString('entityid'), - 'protocol' => 'saml1', - ); - if (isset($state['saml:AuthnRequestReceivedAt'])) { - $statsData['logintime'] = microtime(TRUE) - $state['saml:AuthnRequestReceivedAt']; - } - SimpleSAML_Stats::log('saml:idp:Response', $statsData); - - // Generate and send response. - $ar = new \SimpleSAML\XML\Shib13\AuthnResponse(); - $authnResponseXML = $ar->generate($idpMetadata, $spMetadata, $shire, $attributes); - - $httppost = new HTTPPost($config, $metadata); - $httppost->sendResponse($authnResponseXML, $idpMetadata, $spMetadata, $target, $shire); - } - - - /** - * Receive an authentication request. - * - * @param SimpleSAML_IdP $idp The IdP we are receiving it for. - */ - public static function receiveAuthnRequest(SimpleSAML_IdP $idp) { - - if (isset($_REQUEST['cookieTime'])) { - $cookieTime = (int)$_REQUEST['cookieTime']; - if ($cookieTime + 5 > time()) { - /* - * Less than five seconds has passed since we were - * here the last time. Cookies are probably disabled. - */ - \SimpleSAML\Utils\HTTP::checkSessionCookie(\SimpleSAML\Utils\HTTP::getSelfURL()); - } - } - - if (!isset($_REQUEST['providerId'])) { - throw new SimpleSAML_Error_BadRequest('Missing providerId parameter.'); - } - $spEntityId = (string)$_REQUEST['providerId']; - - if (!isset($_REQUEST['shire'])) { - throw new SimpleSAML_Error_BadRequest('Missing shire parameter.'); - } - $shire = (string)$_REQUEST['shire']; - - if (isset($_REQUEST['target'])) { - $target = $_REQUEST['target']; - } else { - $target = NULL; - } - - SimpleSAML\Logger::info('Shib1.3 - IdP.SSOService: Got incoming Shib authnRequest from ' . var_export($spEntityId, TRUE) . '.'); - - $metadata = SimpleSAML_Metadata_MetaDataStorageHandler::getMetadataHandler(); - $spMetadata = $metadata->getMetaDataConfig($spEntityId, 'shib13-sp-remote'); - - $found = FALSE; - foreach ($spMetadata->getEndpoints('AssertionConsumerService') as $ep) { - if ($ep['Binding'] !== 'urn:oasis:names:tc:SAML:1.0:profiles:browser-post') { - continue; - } - if ($ep['Location'] !== $shire) { - continue; - } - $found = TRUE; - break; - } - if (!$found) { - throw new Exception('Invalid AssertionConsumerService for SP ' . - var_export($spEntityId, TRUE) . ': ' . var_export($shire, TRUE)); - } - - SimpleSAML_Stats::log('saml:idp:AuthnRequest', array( - 'spEntityID' => $spEntityId, - 'protocol' => 'saml1', - )); - - $sessionLostURL = \SimpleSAML\Utils\HTTP::addURLParameters( - \SimpleSAML\Utils\HTTP::getSelfURL(), - array('cookieTime' => time())); - - $state = array( - 'Responder' => array('sspmod_saml_IdP_SAML1', 'sendResponse'), - 'SPMetadata' => $spMetadata->toArray(), - SimpleSAML_Auth_State::RESTART => $sessionLostURL, - 'saml:shire' => $shire, - 'saml:target' => $target, - 'saml:AuthnRequestReceivedAt' => microtime(TRUE), - ); - - $idp->handleAuthenticationRequest($state); - } +class SAML1 +{ + + /** + * Retrieve the metadata of a hosted SAML 1.1 IdP. + * + * @param string $entityid The entity ID of the hosted SAML 1.1 IdP whose metadata we want. + * + * @return array + * @throws \SimpleSAML\Error\Exception + * @throws \SimpleSAML\Error\MetadataNotFound + * @throws \SimpleSAML_Error_Exception + */ + public static function getHostedMetadata($entityid) + { + $handler = \SimpleSAML\Metadata\MetaDataStorageHandler::getMetadataHandler(); + $config = $handler->getMetaDataConfig($entityid, 'shib13-idp-hosted'); + + $metadata = [ + 'metadata-set' => 'shib13-idp-hosted', + 'entityid' => $entityid, + 'SignleSignOnService' => $handler->getGenerated('SingleSignOnService', 'shib13-idp-hosted'), + 'NameIDFormat' => $config->getArrayizeString('NameIDFormat', 'urn:mace:shibboleth:1.0:nameIdentifier'), + 'contacts' => [], + ]; + + // add certificates + $keys = []; + $certInfo = Crypto::loadPublicKey($config, false, 'new_'); + $hasNewCert = false; + if ($certInfo !== null) { + $keys[] = [ + 'type' => 'X509Certificate', + 'signing' => true, + 'encryption' => true, + 'X509Certificate' => $certInfo['certData'], + 'prefix' => 'new_', + ]; + $hasNewCert = true; + } + + $certInfo = Crypto::loadPublicKey($config, true); + $keys[] = [ + 'type' => 'X509Certificate', + 'signing' => true, + 'encryption' => $hasNewCert === false, + 'X509Certificate' => $certInfo['certData'], + 'prefix' => '', + ]; + $metadata['keys'] = $keys; + + // add organization information + if ($config->hasValue('OrganizationName')) { + $metadata['OrganizationName'] = $config->getLocalizedString('OrganizationName'); + $metadata['OrganizationDisplayName'] = $config->getLocalizedString( + 'OrganizationDisplayName', + $metadata['OrganizationName'] + ); + + if (!$config->hasValue('OrganizationURL')) { + throw new \SimpleSAMl\Error\Exception('If OrganizationName is set, OrganizationURL must also be set.'); + } + $metadata['OrganizationURL'] = $config->getLocalizedString('OrganizationURL'); + } + + // add scope + if ($config->hasValue('scope')) { + $metadata['scope'] = $config->getArray('scope'); + } + + // add extensions + if ($config->hasValue('EntityAttributes')) { + $metadata['EntityAttributes'] = $config->getArray('EntityAttributes'); + + // check for entity categories + if (Metadata::isHiddenFromDiscovery($metadata)) { + $metadata['hide.from.discovery'] = true; + } + } + + if ($config->hasValue('UIInfo')) { + $metadata['UIInfo'] = $config->getArray('UIInfo'); + } + + if ($config->hasValue('DiscoHints')) { + $metadata['DiscoHints'] = $config->getArray('DiscoHints'); + } + + if ($config->hasValue('RegistrationInfo')) { + $metadata['RegistrationInfo'] = $config->getArray('RegistrationInfo'); + } + + // add contact information + $globalConfig = \SimpleSAML\Configuration::getInstance(); + $email = $globalConfig->getString('technicalcontact_email', false); + if ($email && $email !== 'na@example.org') { + $contact = [ + 'emailAddress' => $email, + 'name' => $globalConfig->getString('technicalcontact_name', null), + 'contactType' => 'technical', + ]; + $metadata['contacts'][] = Metadata::getContact($contact); + } + + return $metadata; + } + + + /** + * Send a response to the SP. + * + * @param array $state The authentication state. + */ + public static function sendResponse(array $state) + { + assert(isset($state['Attributes'])); + assert(isset($state['SPMetadata'])); + assert(isset($state['saml:shire'])); + assert(array_key_exists('saml:target', $state)); // Can be NULL + + $spMetadata = $state["SPMetadata"]; + $spEntityId = $spMetadata['entityid']; + $spMetadata = \SimpleSAML\Configuration::loadFromArray( + $spMetadata, + '$metadata['.var_export($spEntityId, true).']' + ); + + \SimpleSAML\Logger::info('Sending SAML 1.1 Response to '.var_export($spEntityId, true)); + + $attributes = $state['Attributes']; + $shire = $state['saml:shire']; + $target = $state['saml:target']; + + $idp = \SimpleSAML\IdP::getByState($state); + + $idpMetadata = $idp->getConfig(); + + $config = \SimpleSAML\Configuration::getInstance(); + $metadata = \SimpleSAML\Metadata\MetaDataStorageHandler::getMetadataHandler(); + + $statsData = [ + 'spEntityID' => $spEntityId, + 'idpEntityID' => $idpMetadata->getString('entityid'), + 'protocol' => 'saml1', + ]; + if (isset($state['saml:AuthnRequestReceivedAt'])) { + $statsData['logintime'] = microtime(true) - $state['saml:AuthnRequestReceivedAt']; + } + \SimpleSAML\Stats::log('saml:idp:Response', $statsData); + + // Generate and send response. + $ar = new \SimpleSAML\XML\Shib13\AuthnResponse(); + $authnResponseXML = $ar->generate($idpMetadata, $spMetadata, $shire, $attributes); + + $httppost = new HTTPPost($config, $metadata); + $httppost->sendResponse($authnResponseXML, $idpMetadata, $spMetadata, $target, $shire); + } + + + /** + * Receive an authentication request. + * + * @param \SimpleSAML\IdP $idp The IdP we are receiving it for. + */ + public static function receiveAuthnRequest(\SimpleSAML\IdP $idp) + { + if (isset($_REQUEST['cookieTime'])) { + $cookieTime = (int) $_REQUEST['cookieTime']; + if ($cookieTime + 5 > time()) { + /* + * Less than five seconds has passed since we were + * here the last time. Cookies are probably disabled. + */ + HTTP::checkSessionCookie(HTTP::getSelfURL()); + } + } + + if (!isset($_REQUEST['providerId'])) { + throw new \SimpleSAML\Error\BadRequest('Missing providerId parameter.'); + } + $spEntityId = (string) $_REQUEST['providerId']; + + if (!isset($_REQUEST['shire'])) { + throw new \SimpleSAML\Error\BadRequest('Missing shire parameter.'); + } + $shire = (string) $_REQUEST['shire']; + + if (isset($_REQUEST['target'])) { + $target = $_REQUEST['target']; + } else { + $target = null; + } + + \SimpleSAML\Logger::info( + 'Shib1.3 - IdP.SSOService: Got incoming Shib authnRequest from '.var_export($spEntityId, true).'.' + ); + + $metadata = \SimpleSAML\Metadata\MetaDataStorageHandler::getMetadataHandler(); + $spMetadata = $metadata->getMetaDataConfig($spEntityId, 'shib13-sp-remote'); + + $found = false; + foreach ($spMetadata->getEndpoints('AssertionConsumerService') as $ep) { + if ($ep['Binding'] !== 'urn:oasis:names:tc:SAML:1.0:profiles:browser-post') { + continue; + } + if ($ep['Location'] !== $shire) { + continue; + } + $found = true; + break; + } + if (!$found) { + throw new \Exception( + 'Invalid AssertionConsumerService for SP '.var_export($spEntityId, true).': '.var_export($shire, true) + ); + } + + \SimpleSAML\Stats::log( + 'saml:idp:AuthnRequest', + [ + 'spEntityID' => $spEntityId, + 'protocol' => 'saml1', + ] + ); + + $sessionLostURL = HTTP::addURLParameters( + HTTP::getSelfURL(), + ['cookieTime' => time()] + ); + + $state = [ + 'Responder' => ['\SimpleSAML\Module\saml\IdP\SAML1', 'sendResponse'], + 'SPMetadata' => $spMetadata->toArray(), + \SimpleSAML\Auth\State::RESTART => $sessionLostURL, + 'saml:shire' => $shire, + 'saml:target' => $target, + 'saml:AuthnRequestReceivedAt' => microtime(true), + ]; + + $idp->handleAuthenticationRequest($state); + } } diff --git a/vendor/simplesamlphp/simplesamlphp/modules/saml/lib/IdP/SAML2.php b/vendor/simplesamlphp/simplesamlphp/modules/saml/lib/IdP/SAML2.php index 158cdd21b1..3d4d255b4d 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/saml/lib/IdP/SAML2.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/saml/lib/IdP/SAML2.php @@ -1,16 +1,25 @@ <?php +namespace SimpleSAML\Module\saml\IdP; use RobRichards\XMLSecLibs\XMLSecurityKey; +use SAML2\Constants; +use SAML2\XML\saml\Issuer; +use SimpleSAML\Configuration; +use SimpleSAML\Logger; +use SAML2\SOAP; +use SimpleSAML\Utils\Config\Metadata; +use SimpleSAML\Utils\Crypto; +use SimpleSAML\Utils\HTTP; /** * IdP implementation for SAML 2.0 protocol. * * @package SimpleSAMLphp */ -class sspmod_saml_IdP_SAML2 -{ +class SAML2 +{ /** * Send a response to the SP. * @@ -18,27 +27,27 @@ class sspmod_saml_IdP_SAML2 */ public static function sendResponse(array $state) { - assert('isset($state["Attributes"])'); - assert('isset($state["SPMetadata"])'); - assert('isset($state["saml:ConsumerURL"])'); - assert('array_key_exists("saml:RequestId", $state)'); // Can be NULL - assert('array_key_exists("saml:RelayState", $state)'); // Can be NULL. + assert(isset($state['Attributes'])); + assert(isset($state['SPMetadata'])); + assert(isset($state['saml:ConsumerURL'])); + assert(array_key_exists('saml:RequestId', $state)); // Can be NULL + assert(array_key_exists('saml:RelayState', $state)); // Can be NULL. $spMetadata = $state["SPMetadata"]; $spEntityId = $spMetadata['entityid']; - $spMetadata = SimpleSAML_Configuration::loadFromArray( + $spMetadata = Configuration::loadFromArray( $spMetadata, '$metadata['.var_export($spEntityId, true).']' ); - SimpleSAML\Logger::info('Sending SAML 2.0 Response to '.var_export($spEntityId, true)); + Logger::info('Sending SAML 2.0 Response to '.var_export($spEntityId, true)); $requestId = $state['saml:RequestId']; $relayState = $state['saml:RelayState']; $consumerURL = $state['saml:ConsumerURL']; $protocolBinding = $state['saml:Binding']; - $idp = SimpleSAML_IdP::getByState($state); + $idp = \SimpleSAML\IdP::getByState($state); $idpMetadata = $idp->getConfig(); @@ -49,14 +58,14 @@ public static function sendResponse(array $state) } // create the session association (for logout) - $association = array( + $association = [ 'id' => 'saml:'.$spEntityId, - 'Handler' => 'sspmod_saml_IdP_SAML2', + 'Handler' => '\SimpleSAML\Module\saml\IdP\SAML2', 'Expires' => $assertion->getSessionNotOnOrAfter(), 'saml:entityID' => $spEntityId, 'saml:NameID' => $state['saml:idp:NameID'], 'saml:SessionIndex' => $assertion->getSessionIndex(), - ); + ]; // maybe encrypt the assertion $assertion = self::encryptAssertion($idpMetadata, $spMetadata, $assertion); @@ -65,20 +74,20 @@ public static function sendResponse(array $state) $ar = self::buildResponse($idpMetadata, $spMetadata, $consumerURL); $ar->setInResponseTo($requestId); $ar->setRelayState($relayState); - $ar->setAssertions(array($assertion)); + $ar->setAssertions([$assertion]); // register the session association with the IdP $idp->addAssociation($association); - $statsData = array( + $statsData = [ 'spEntityID' => $spEntityId, 'idpEntityID' => $idpMetadata->getString('entityid'), 'protocol' => 'saml2', - ); + ]; if (isset($state['saml:AuthnRequestReceivedAt'])) { $statsData['logintime'] = microtime(true) - $state['saml:AuthnRequestReceivedAt']; } - SimpleSAML_Stats::log('saml:idp:Response', $statsData); + \SimpleSAML\Stats::log('saml:idp:Response', $statsData); // send the response $binding = \SAML2\Binding::getBinding($protocolBinding); @@ -89,20 +98,20 @@ public static function sendResponse(array $state) /** * Handle authentication error. * - * SimpleSAML_Error_Exception $exception The exception. + * \SimpleSAML\Error\Exception $exception The exception. * * @param array $state The error state. */ - public static function handleAuthError(SimpleSAML_Error_Exception $exception, array $state) + public static function handleAuthError(\SimpleSAML\Error\Exception $exception, array $state) { - assert('isset($state["SPMetadata"])'); - assert('isset($state["saml:ConsumerURL"])'); - assert('array_key_exists("saml:RequestId", $state)'); // Can be NULL. - assert('array_key_exists("saml:RelayState", $state)'); // Can be NULL. + assert(isset($state['SPMetadata'])); + assert(isset($state['saml:ConsumerURL'])); + assert(array_key_exists('saml:RequestId', $state)); // Can be NULL. + assert(array_key_exists('saml:RelayState', $state)); // Can be NULL. $spMetadata = $state["SPMetadata"]; $spEntityId = $spMetadata['entityid']; - $spMetadata = SimpleSAML_Configuration::loadFromArray( + $spMetadata = Configuration::loadFromArray( $spMetadata, '$metadata['.var_export($spEntityId, true).']' ); @@ -112,36 +121,36 @@ public static function handleAuthError(SimpleSAML_Error_Exception $exception, ar $consumerURL = $state['saml:ConsumerURL']; $protocolBinding = $state['saml:Binding']; - $idp = SimpleSAML_IdP::getByState($state); + $idp = \SimpleSAML\IdP::getByState($state); $idpMetadata = $idp->getConfig(); - $error = sspmod_saml_Error::fromException($exception); + $error = \SimpleSAML\Module\saml\Error::fromException($exception); - SimpleSAML\Logger::warning("Returning error to SP with entity ID '".var_export($spEntityId, true)."'."); - $exception->log(SimpleSAML\Logger::WARNING); + Logger::warning("Returning error to SP with entity ID '".var_export($spEntityId, true)."'."); + $exception->log(Logger::WARNING); $ar = self::buildResponse($idpMetadata, $spMetadata, $consumerURL); $ar->setInResponseTo($requestId); $ar->setRelayState($relayState); - $status = array( + $status = [ 'Code' => $error->getStatus(), 'SubCode' => $error->getSubStatus(), 'Message' => $error->getStatusMessage(), - ); + ]; $ar->setStatus($status); - $statsData = array( + $statsData = [ 'spEntityID' => $spEntityId, 'idpEntityID' => $idpMetadata->getString('entityid'), 'protocol' => 'saml2', 'error' => $status, - ); + ]; if (isset($state['saml:AuthnRequestReceivedAt'])) { $statsData['logintime'] = microtime(true) - $state['saml:AuthnRequestReceivedAt']; } - SimpleSAML_Stats::log('saml:idp:Response:error', $statsData); + \SimpleSAML\Stats::log('saml:idp:Response:error', $statsData); $binding = \SAML2\Binding::getBinding($protocolBinding); $binding->send($ar); @@ -151,24 +160,24 @@ public static function handleAuthError(SimpleSAML_Error_Exception $exception, ar /** * Find SP AssertionConsumerService based on parameter in AuthnRequest. * - * @param array $supportedBindings The bindings we allow for the response. - * @param SimpleSAML_Configuration $spMetadata The metadata for the SP. - * @param string|NULL $AssertionConsumerServiceURL AssertionConsumerServiceURL from request. - * @param string|NULL $ProtocolBinding ProtocolBinding from request. - * @param int|NULL $AssertionConsumerServiceIndex AssertionConsumerServiceIndex from request. + * @param array $supportedBindings The bindings we allow for the response. + * @param \SimpleSAML\Configuration $spMetadata The metadata for the SP. + * @param string|NULL $AssertionConsumerServiceURL AssertionConsumerServiceURL from request. + * @param string|NULL $ProtocolBinding ProtocolBinding from request. + * @param int|NULL $AssertionConsumerServiceIndex AssertionConsumerServiceIndex from request. * * @return array Array with the Location and Binding we should use for the response. */ private static function getAssertionConsumerService( array $supportedBindings, - SimpleSAML_Configuration $spMetadata, + \SimpleSAML\Configuration $spMetadata, $AssertionConsumerServiceURL, $ProtocolBinding, $AssertionConsumerServiceIndex ) { - assert('is_string($AssertionConsumerServiceURL) || is_null($AssertionConsumerServiceURL)'); - assert('is_string($ProtocolBinding) || is_null($ProtocolBinding)'); - assert('is_int($AssertionConsumerServiceIndex) || is_null($AssertionConsumerServiceIndex)'); + assert(is_string($AssertionConsumerServiceURL) || $AssertionConsumerServiceURL === null); + assert(is_string($ProtocolBinding) || $ProtocolBinding === null); + assert(is_int($AssertionConsumerServiceIndex) || $AssertionConsumerServiceIndex === null); /* We want to pick the best matching endpoint in the case where for example * only the ProtocolBinding is given. We therefore pick endpoints with the @@ -221,15 +230,15 @@ private static function getAssertionConsumerService( return $firstFalse; } - SimpleSAML\Logger::warning('Authentication request specifies invalid AssertionConsumerService:'); + Logger::warning('Authentication request specifies invalid AssertionConsumerService:'); if ($AssertionConsumerServiceURL !== null) { - SimpleSAML\Logger::warning('AssertionConsumerServiceURL: '.var_export($AssertionConsumerServiceURL, true)); + Logger::warning('AssertionConsumerServiceURL: '.var_export($AssertionConsumerServiceURL, true)); } if ($ProtocolBinding !== null) { - SimpleSAML\Logger::warning('ProtocolBinding: '.var_export($ProtocolBinding, true)); + Logger::warning('ProtocolBinding: '.var_export($ProtocolBinding, true)); } if ($AssertionConsumerServiceIndex !== null) { - SimpleSAML\Logger::warning( + Logger::warning( 'AssertionConsumerServiceIndex: '.var_export($AssertionConsumerServiceIndex, true) ); } @@ -242,24 +251,26 @@ private static function getAssertionConsumerService( /** * Receive an authentication request. * - * @param SimpleSAML_IdP $idp The IdP we are receiving it for. - * @throws SimpleSAML_Error_BadRequest In case an error occurs when trying to receive the request. + * @param \SimpleSAML\IdP $idp The IdP we are receiving it for. + * @throws \SimpleSAML\Error\BadRequest In case an error occurs when trying to receive the request. */ - public static function receiveAuthnRequest(SimpleSAML_IdP $idp) + public static function receiveAuthnRequest(\SimpleSAML\IdP $idp) { - - $metadata = SimpleSAML_Metadata_MetaDataStorageHandler::getMetadataHandler(); + $metadata = \SimpleSAML\Metadata\MetaDataStorageHandler::getMetadataHandler(); $idpMetadata = $idp->getConfig(); - $supportedBindings = array(\SAML2\Constants::BINDING_HTTP_POST); + $supportedBindings = [\SAML2\Constants::BINDING_HTTP_POST]; if ($idpMetadata->getBoolean('saml20.sendartifact', false)) { $supportedBindings[] = \SAML2\Constants::BINDING_HTTP_ARTIFACT; } if ($idpMetadata->getBoolean('saml20.hok.assertion', false)) { $supportedBindings[] = \SAML2\Constants::BINDING_HOK_SSO; } + if ($idpMetadata->getBoolean('saml20.ecp', false)) { + $supportedBindings[] = \SAML2\Constants::BINDING_PAOS; + } - if (isset($_REQUEST['spentityid'])) { + if (isset($_REQUEST['spentityid']) || isset($_REQUEST['providerId'])) { /* IdP initiated authentication. */ if (isset($_REQUEST['cookieTime'])) { @@ -273,11 +284,13 @@ public static function receiveAuthnRequest(SimpleSAML_IdP $idp) } } - $spEntityId = (string) $_REQUEST['spentityid']; + $spEntityId = (string) isset($_REQUEST['spentityid']) ? $_REQUEST['spentityid'] : $_REQUEST['providerId']; $spMetadata = $metadata->getMetaDataConfig($spEntityId, 'saml20-sp-remote'); if (isset($_REQUEST['RelayState'])) { $relayState = (string) $_REQUEST['RelayState']; + } elseif (isset($_REQUEST['target'])) { + $relayState = (string) $_REQUEST['target']; } else { $relayState = null; } @@ -294,21 +307,29 @@ public static function receiveAuthnRequest(SimpleSAML_IdP $idp) $nameIDFormat = null; } + if (isset($_REQUEST['ConsumerURL'])) { + $consumerURL = (string)$_REQUEST['ConsumerURL']; + } elseif (isset($_REQUEST['shire'])) { + $consumerURL = (string)$_REQUEST['shire']; + } else { + $consumerURL = null; + } + $requestId = null; - $IDPList = array(); + $IDPList = []; $ProxyCount = null; $RequesterID = null; $forceAuthn = false; $isPassive = false; - $consumerURL = null; $consumerIndex = null; $extensions = null; $allowCreate = true; $authnContext = null; + $binding = null; $idpInit = true; - SimpleSAML\Logger::info( + Logger::info( 'SAML2.0 - IdP.SSOService: IdP initiated authentication: '.var_export($spEntityId, true) ); } else { @@ -316,20 +337,24 @@ public static function receiveAuthnRequest(SimpleSAML_IdP $idp) $request = $binding->receive(); if (!($request instanceof \SAML2\AuthnRequest)) { - throw new SimpleSAML_Error_BadRequest( + throw new \SimpleSAML\Error\BadRequest( 'Message received on authentication request endpoint wasn\'t an authentication request.' ); } - $spEntityId = $request->getIssuer(); - if ($spEntityId === null) { - throw new SimpleSAML_Error_BadRequest( + $issuer = $request->getIssuer(); + if ($issuer === null) { + throw new \SimpleSAML\Error\BadRequest( 'Received message on authentication request endpoint without issuer.' ); + } elseif ($issuer instanceof Issuer) { + $spEntityId = $issuer->getValue(); + } else { // we got a string, old case + $spEntityId = $issuer; } $spMetadata = $metadata->getMetaDataConfig($spEntityId, 'saml20-sp-remote'); - sspmod_saml_Message::validateMessage($spMetadata, $idpMetadata, $request); + \SimpleSAML\Module\saml\Message::validateMessage($spMetadata, $idpMetadata, $request); $relayState = $request->getRelayState(); @@ -362,19 +387,19 @@ public static function receiveAuthnRequest(SimpleSAML_IdP $idp) $idpInit = false; - SimpleSAML\Logger::info( + Logger::info( 'SAML2.0 - IdP.SSOService: incoming authentication request: '.var_export($spEntityId, true) ); } - SimpleSAML_Stats::log('saml:idp:AuthnRequest', array( + \SimpleSAML\Stats::log('saml:idp:AuthnRequest', [ 'spEntityID' => $spEntityId, 'idpEntityID' => $idpMetadata->getString('entityid'), 'forceAuthn' => $forceAuthn, 'isPassive' => $isPassive, 'protocol' => 'saml2', 'idpInit' => $idpInit, - )); + ]); $acsEndpoint = self::getAssertionConsumerService( $supportedBindings, @@ -384,7 +409,7 @@ public static function receiveAuthnRequest(SimpleSAML_IdP $idp) $consumerIndex ); - $IDPList = array_unique(array_merge($IDPList, $spMetadata->getArrayizeString('IDPList', array()))); + $IDPList = array_unique(array_merge($IDPList, $spMetadata->getArrayizeString('IDPList', []))); if ($ProxyCount === null) { $ProxyCount = $spMetadata->getInteger('ProxyCount', null); } @@ -393,23 +418,30 @@ public static function receiveAuthnRequest(SimpleSAML_IdP $idp) $forceAuthn = $spMetadata->getBoolean('ForceAuthn', false); } - $sessionLostParams = array( + $sessionLostParams = [ 'spentityid' => $spEntityId, - 'cookieTime' => time(), - ); + ]; if ($relayState !== null) { $sessionLostParams['RelayState'] = $relayState; } + /* + Putting cookieTime as the last parameter makes unit testing easier since we don't need to handle a + changing time component in the middle of the url + */ + $sessionLostParams['cookieTime'] = time(); $sessionLostURL = \SimpleSAML\Utils\HTTP::addURLParameters( \SimpleSAML\Utils\HTTP::getSelfURLNoQuery(), $sessionLostParams ); - $state = array( - 'Responder' => array('sspmod_saml_IdP_SAML2', 'sendResponse'), - SimpleSAML_Auth_State::EXCEPTION_HANDLER_FUNC => array('sspmod_saml_IdP_SAML2', 'handleAuthError'), - SimpleSAML_Auth_State::RESTART => $sessionLostURL, + $state = [ + 'Responder' => ['\SimpleSAML\Module\saml\IdP\SAML2', 'sendResponse'], + \SimpleSAML\Auth\State::EXCEPTION_HANDLER_FUNC => [ + '\SimpleSAML\Module\saml\IdP\SAML2', + 'handleAuthError' + ], + \SimpleSAML\Auth\State::RESTART => $sessionLostURL, 'SPMetadata' => $spMetadata->toArray(), 'saml:RelayState' => $relayState, @@ -426,40 +458,39 @@ public static function receiveAuthnRequest(SimpleSAML_IdP $idp) 'saml:Extensions' => $extensions, 'saml:AuthnRequestReceivedAt' => microtime(true), 'saml:RequestedAuthnContext' => $authnContext, - ); + ]; $idp->handleAuthenticationRequest($state); } - /** * Send a logout request to a given association. * - * @param SimpleSAML_IdP $idp The IdP we are sending a logout request from. - * @param array $association The association that should be terminated. - * @param string|NULL $relayState An id that should be carried across the logout. + * @param \SimpleSAML\IdP $idp The IdP we are sending a logout request from. + * @param array $association The association that should be terminated. + * @param string|NULL $relayState An id that should be carried across the logout. */ - public static function sendLogoutRequest(SimpleSAML_IdP $idp, array $association, $relayState) + public static function sendLogoutRequest(\SimpleSAML\IdP $idp, array $association, $relayState) { - assert('is_string($relayState) || is_null($relayState)'); + assert(is_string($relayState) || $relayState === null); - SimpleSAML\Logger::info('Sending SAML 2.0 LogoutRequest to: '.var_export($association['saml:entityID'], true)); + Logger::info('Sending SAML 2.0 LogoutRequest to: '.var_export($association['saml:entityID'], true)); - $metadata = SimpleSAML_Metadata_MetaDataStorageHandler::getMetadataHandler(); + $metadata = \SimpleSAML\Metadata\MetaDataStorageHandler::getMetadataHandler(); $idpMetadata = $idp->getConfig(); $spMetadata = $metadata->getMetaDataConfig($association['saml:entityID'], 'saml20-sp-remote'); - SimpleSAML_Stats::log('saml:idp:LogoutRequest:sent', array( + \SimpleSAML\Stats::log('saml:idp:LogoutRequest:sent', [ 'spEntityID' => $association['saml:entityID'], 'idpEntityID' => $idpMetadata->getString('entityid'), - )); + ]); $dst = $spMetadata->getEndpointPrioritizedByBinding( 'SingleLogoutService', - array( + [ \SAML2\Constants::BINDING_HTTP_REDIRECT, \SAML2\Constants::BINDING_HTTP_POST - ) + ] ); $binding = \SAML2\Binding::getBinding($dst['Binding']); $lr = self::buildLogoutRequest($idpMetadata, $spMetadata, $association, $relayState); @@ -472,48 +503,48 @@ public static function sendLogoutRequest(SimpleSAML_IdP $idp, array $association /** * Send a logout response. * - * @param SimpleSAML_IdP $idp The IdP we are sending a logout request from. - * @param array &$state The logout state array. + * @param \SimpleSAML\IdP $idp The IdP we are sending a logout request from. + * @param array &$state The logout state array. */ - public static function sendLogoutResponse(SimpleSAML_IdP $idp, array $state) + public static function sendLogoutResponse(\SimpleSAML\IdP $idp, array $state) { - assert('isset($state["saml:SPEntityId"])'); - assert('isset($state["saml:RequestId"])'); - assert('array_key_exists("saml:RelayState", $state)'); // Can be NULL. + assert(isset($state['saml:SPEntityId'])); + assert(isset($state['saml:RequestId'])); + assert(array_key_exists('saml:RelayState', $state)); // Can be NULL. $spEntityId = $state['saml:SPEntityId']; - $metadata = SimpleSAML_Metadata_MetaDataStorageHandler::getMetadataHandler(); + $metadata = \SimpleSAML\Metadata\MetaDataStorageHandler::getMetadataHandler(); $idpMetadata = $idp->getConfig(); $spMetadata = $metadata->getMetaDataConfig($spEntityId, 'saml20-sp-remote'); - $lr = sspmod_saml_Message::buildLogoutResponse($idpMetadata, $spMetadata); + $lr = \SimpleSAML\Module\saml\Message::buildLogoutResponse($idpMetadata, $spMetadata); $lr->setInResponseTo($state['saml:RequestId']); $lr->setRelayState($state['saml:RelayState']); if (isset($state['core:Failed']) && $state['core:Failed']) { $partial = true; - $lr->setStatus(array( + $lr->setStatus([ 'Code' => \SAML2\Constants::STATUS_SUCCESS, 'SubCode' => \SAML2\Constants::STATUS_PARTIAL_LOGOUT, - )); - SimpleSAML\Logger::info('Sending logout response for partial logout to SP '.var_export($spEntityId, true)); + ]); + Logger::info('Sending logout response for partial logout to SP '.var_export($spEntityId, true)); } else { $partial = false; - SimpleSAML\Logger::debug('Sending logout response to SP '.var_export($spEntityId, true)); + Logger::debug('Sending logout response to SP '.var_export($spEntityId, true)); } - SimpleSAML_Stats::log('saml:idp:LogoutResponse:sent', array( + \SimpleSAML\Stats::log('saml:idp:LogoutResponse:sent', [ 'spEntityID' => $spEntityId, 'idpEntityID' => $idpMetadata->getString('entityid'), 'partial' => $partial - )); + ]); $dst = $spMetadata->getEndpointPrioritizedByBinding( 'SingleLogoutService', - array( + [ \SAML2\Constants::BINDING_HTTP_REDIRECT, \SAML2\Constants::BINDING_HTTP_POST - ) + ] ); $binding = \SAML2\Binding::getBinding($dst['Binding']); if (isset($dst['ResponseLocation'])) { @@ -530,43 +561,46 @@ public static function sendLogoutResponse(SimpleSAML_IdP $idp, array $state) /** * Receive a logout message. * - * @param SimpleSAML_IdP $idp The IdP we are receiving it for. - * @throws SimpleSAML_Error_BadRequest In case an error occurs while trying to receive the logout message. + * @param \SimpleSAML\IdP $idp The IdP we are receiving it for. + * @throws \SimpleSAML\Error\BadRequest In case an error occurs while trying to receive the logout message. */ - public static function receiveLogoutMessage(SimpleSAML_IdP $idp) + public static function receiveLogoutMessage(\SimpleSAML\IdP $idp) { - $binding = \SAML2\Binding::getCurrentBinding(); $message = $binding->receive(); - $spEntityId = $message->getIssuer(); - if ($spEntityId === null) { + $issuer = $message->getIssuer(); + if ($issuer === null) { /* Without an issuer we have no way to respond to the message. */ - throw new SimpleSAML_Error_BadRequest('Received message on logout endpoint without issuer.'); + throw new \SimpleSAML\Error\BadRequest('Received message on logout endpoint without issuer.'); + } elseif ($issuer instanceof Issuer) { + $spEntityId = $issuer->getValue(); + } else { + $spEntityId = $issuer; } - $metadata = SimpleSAML_Metadata_MetaDataStorageHandler::getMetadataHandler(); + $metadata = \SimpleSAML\Metadata\MetaDataStorageHandler::getMetadataHandler(); $idpMetadata = $idp->getConfig(); $spMetadata = $metadata->getMetaDataConfig($spEntityId, 'saml20-sp-remote'); - sspmod_saml_Message::validateMessage($spMetadata, $idpMetadata, $message); + \SimpleSAML\Module\saml\Message::validateMessage($spMetadata, $idpMetadata, $message); if ($message instanceof \SAML2\LogoutResponse) { - SimpleSAML\Logger::info('Received SAML 2.0 LogoutResponse from: '.var_export($spEntityId, true)); - $statsData = array( + Logger::info('Received SAML 2.0 LogoutResponse from: '.var_export($spEntityId, true)); + $statsData = [ 'spEntityID' => $spEntityId, 'idpEntityID' => $idpMetadata->getString('entityid'), - ); + ]; if (!$message->isSuccess()) { $statsData['error'] = $message->getStatus(); } - SimpleSAML_Stats::log('saml:idp:LogoutResponse:recv', $statsData); + \SimpleSAML\Stats::log('saml:idp:LogoutResponse:recv', $statsData); $relayState = $message->getRelayState(); if (!$message->isSuccess()) { - $logoutError = sspmod_saml_Message::getResponseError($message); - SimpleSAML\Logger::warning('Unsuccessful logout. Status was: '.$logoutError); + $logoutError = \SimpleSAML\Module\saml\Message::getResponseError($message); + Logger::warning('Unsuccessful logout. Status was: '.$logoutError); } else { $logoutError = null; } @@ -575,26 +609,26 @@ public static function receiveLogoutMessage(SimpleSAML_IdP $idp) $idp->handleLogoutResponse($assocId, $relayState, $logoutError); } elseif ($message instanceof \SAML2\LogoutRequest) { - SimpleSAML\Logger::info('Received SAML 2.0 LogoutRequest from: '.var_export($spEntityId, true)); - SimpleSAML_Stats::log('saml:idp:LogoutRequest:recv', array( + Logger::info('Received SAML 2.0 LogoutRequest from: '.var_export($spEntityId, true)); + \SimpleSAML\Stats::log('saml:idp:LogoutRequest:recv', [ 'spEntityID' => $spEntityId, 'idpEntityID' => $idpMetadata->getString('entityid'), - )); + ]); $spStatsId = $spMetadata->getString('core:statistics-id', $spEntityId); - SimpleSAML\Logger::stats('saml20-idp-SLO spinit '.$spStatsId.' '.$idpMetadata->getString('entityid')); + Logger::stats('saml20-idp-SLO spinit '.$spStatsId.' '.$idpMetadata->getString('entityid')); - $state = array( - 'Responder' => array('sspmod_saml_IdP_SAML2', 'sendLogoutResponse'), + $state = [ + 'Responder' => ['\SimpleSAML\Module\saml\IdP\SAML2', 'sendLogoutResponse'], 'saml:SPEntityId' => $spEntityId, 'saml:RelayState' => $message->getRelayState(), 'saml:RequestId' => $message->getId(), - ); + ]; $assocId = 'saml:'.$spEntityId; $idp->handleLogoutRequest($state, $assocId); } else { - throw new SimpleSAML_Error_BadRequest('Unknown message received on logout endpoint: '.get_class($message)); + throw new \SimpleSAML\Error\BadRequest('Unknown message received on logout endpoint: '.get_class($message)); } } @@ -602,34 +636,34 @@ public static function receiveLogoutMessage(SimpleSAML_IdP $idp) /** * Retrieve a logout URL for a given logout association. * - * @param SimpleSAML_IdP $idp The IdP we are sending a logout request from. - * @param array $association The association that should be terminated. - * @param string|NULL $relayState An id that should be carried across the logout. + * @param \SimpleSAML\IdP $idp The IdP we are sending a logout request from. + * @param array $association The association that should be terminated. + * @param string|NULL $relayState An id that should be carried across the logout. * * @return string The logout URL. */ - public static function getLogoutURL(SimpleSAML_IdP $idp, array $association, $relayState) + public static function getLogoutURL(\SimpleSAML\IdP $idp, array $association, $relayState) { - assert('is_string($relayState) || is_null($relayState)'); + assert(is_string($relayState) || $relayState === null); - SimpleSAML\Logger::info('Sending SAML 2.0 LogoutRequest to: '.var_export($association['saml:entityID'], true)); + Logger::info('Sending SAML 2.0 LogoutRequest to: '.var_export($association['saml:entityID'], true)); - $metadata = SimpleSAML_Metadata_MetaDataStorageHandler::getMetadataHandler(); + $metadata = \SimpleSAML\Metadata\MetaDataStorageHandler::getMetadataHandler(); $idpMetadata = $idp->getConfig(); $spMetadata = $metadata->getMetaDataConfig($association['saml:entityID'], 'saml20-sp-remote'); - $bindings = array( + $bindings = [ \SAML2\Constants::BINDING_HTTP_REDIRECT, \SAML2\Constants::BINDING_HTTP_POST - ); + ]; $dst = $spMetadata->getEndpointPrioritizedByBinding('SingleLogoutService', $bindings); if ($dst['Binding'] === \SAML2\Constants::BINDING_HTTP_POST) { - $params = array('association' => $association['id'], 'idp' => $idp->getId()); + $params = ['association' => $association['id'], 'idp' => $idp->getId()]; if ($relayState !== null) { $params['RelayState'] = $relayState; } - return SimpleSAML\Module::getModuleURL('core/idp/logout-iframe-post.php', $params); + return \SimpleSAML\Module::getModuleURL('core/idp/logout-iframe-post.php', $params); } $lr = self::buildLogoutRequest($idpMetadata, $spMetadata, $association, $relayState); @@ -643,34 +677,232 @@ public static function getLogoutURL(SimpleSAML_IdP $idp, array $association, $re /** * Retrieve the metadata for the given SP association. * - * @param SimpleSAML_IdP $idp The IdP the association belongs to. - * @param array $association The SP association. + * @param \SimpleSAML\IdP $idp The IdP the association belongs to. + * @param array $association The SP association. * - * @return SimpleSAML_Configuration Configuration object for the SP metadata. + * @return \SimpleSAML\Configuration Configuration object for the SP metadata. */ - public static function getAssociationConfig(SimpleSAML_IdP $idp, array $association) + public static function getAssociationConfig(\SimpleSAML\IdP $idp, array $association) { - $metadata = SimpleSAML_Metadata_MetaDataStorageHandler::getMetadataHandler(); + $metadata = \SimpleSAML\Metadata\MetaDataStorageHandler::getMetadataHandler(); try { return $metadata->getMetaDataConfig($association['saml:entityID'], 'saml20-sp-remote'); - } catch (Exception $e) { - return SimpleSAML_Configuration::loadFromArray(array(), 'Unknown SAML 2 entity.'); + } catch (\Exception $e) { + return Configuration::loadFromArray([], 'Unknown SAML 2 entity.'); } } + /** + * Retrieve the metadata of a hosted SAML 2 IdP. + * + * @param string $entityid The entity ID of the hosted SAML 2 IdP whose metadata we want. + * + * @return array + * @throws \SimpleSAML\Error\CriticalConfigurationError + * @throws \SimpleSAML\Error\Exception + * @throws \SimpleSAML\Error\MetadataNotFound + */ + public static function getHostedMetadata($entityid) + { + $handler = \SimpleSAML\Metadata\MetaDataStorageHandler::getMetadataHandler(); + $config = $handler->getMetaDataConfig($entityid, 'saml20-idp-hosted'); + + // configure endpoints + $ssob = $handler->getGenerated('SingleSignOnServiceBinding', 'saml20-idp-hosted'); + $slob = $handler->getGenerated('SingleLogoutServiceBinding', 'saml20-idp-hosted'); + $ssol = $handler->getGenerated('SingleSignOnService', 'saml20-idp-hosted'); + $slol = $handler->getGenerated('SingleLogoutService', 'saml20-idp-hosted'); + + $sso = []; + if (is_array($ssob)) { + foreach ($ssob as $binding) { + $sso[] = [ + 'Binding' => $binding, + 'Location' => $ssol, + ]; + } + } else { + $sso[] = [ + 'Binding' => $ssob, + 'Location' => $ssol, + ]; + } + + $slo = []; + if (is_array($slob)) { + foreach ($slob as $binding) { + $slo[] = [ + 'Binding' => $binding, + 'Location' => $slol, + ]; + } + } else { + $slo[] = [ + 'Binding' => $slob, + 'Location' => $slol, + ]; + } + + $metadata = [ + 'metadata-set' => 'saml20-idp-hosted', + 'entityid' => $entityid, + 'SingleSignOnService' => $sso, + 'SingleLogoutService' => $slo, + 'NameIDFormat' => $config->getArrayizeString('NameIDFormat', Constants::NAMEID_TRANSIENT), + ]; + + // add certificates + $keys = []; + $certInfo = Crypto::loadPublicKey($config, false, 'new_'); + $hasNewCert = false; + if ($certInfo !== null) { + $keys[] = [ + 'type' => 'X509Certificate', + 'signing' => true, + 'encryption' => true, + 'X509Certificate' => $certInfo['certData'], + 'prefix' => 'new_', + ]; + $hasNewCert = true; + } + + $certInfo = Crypto::loadPublicKey($config, true); + $keys[] = [ + 'type' => 'X509Certificate', + 'signing' => true, + 'encryption' => $hasNewCert === false, + 'X509Certificate' => $certInfo['certData'], + 'prefix' => '', + ]; + + if ($config->hasValue('https.certificate')) { + $httpsCert = Crypto::loadPublicKey($config, true, 'https.'); + $keys[] = [ + 'type' => 'X509Certificate', + 'signing' => true, + 'encryption' => false, + 'X509Certificate' => $httpsCert['certData'], + 'prefix' => 'https.' + ]; + } + $metadata['keys'] = $keys; + + // add ArtifactResolutionService endpoint, if enabled + if ($config->getBoolean('saml20.sendartifact', false)) { + $metadata['ArtifactResolutionService'][] = [ + 'index' => 0, + 'Binding' => Constants::BINDING_SOAP, + 'Location' => HTTP::getBaseURL().'saml2/idp/ArtifactResolutionService.php' + ]; + } + + // add Holder of Key, if enabled + if ($config->getBoolean('saml20.hok.assertion', false)) { + array_unshift( + $metadata['SingleSignOnService'], + [ + 'hoksso:ProtocolBinding' => Constants::BINDING_HTTP_REDIRECT, + 'Binding' => Constants::BINDING_HOK_SSO, + 'Location' => HTTP::getBaseURL().'saml2/idp/SSOService.php', + ] + ); + } + + // add ECP profile, if enabled + if ($config->getBoolean('saml20.ecp', false)) { + $metadata['SingleSignOnService'][] = [ + 'index' => 0, + 'Binding' => Constants::BINDING_SOAP, + 'Location' => HTTP::getBaseURL().'saml2/idp/SSOService.php', + ]; + } + + // add organization information + if ($config->hasValue('OrganizationName')) { + $metadata['OrganizationName'] = $config->getLocalizedString('OrganizationName'); + $metadata['OrganizationDisplayName'] = $config->getLocalizedString( + 'OrganizationDisplayName', + $metadata['OrganizationName'] + ); + + if (!$config->hasValue('OrganizationURL')) { + throw new \SimpleSAML\Error\Exception('If OrganizationName is set, OrganizationURL must also be set.'); + } + $metadata['OrganizationURL'] = $config->getLocalizedString('OrganizationURL'); + } + + // add scope + if ($config->hasValue('scope')) { + $metadata['scope'] = $config->getArray('scope'); + } + + // add extensions + if ($config->hasValue('EntityAttributes')) { + $metadata['EntityAttributes'] = $config->getArray('EntityAttributes'); + + // check for entity categories + if (Metadata::isHiddenFromDiscovery($metadata)) { + $metadata['hide.from.discovery'] = true; + } + } + + if ($config->hasValue('UIInfo')) { + $metadata['UIInfo'] = $config->getArray('UIInfo'); + } + + if ($config->hasValue('DiscoHints')) { + $metadata['DiscoHints'] = $config->getArray('DiscoHints'); + } + + if ($config->hasValue('RegistrationInfo')) { + $metadata['RegistrationInfo'] = $config->getArray('RegistrationInfo'); + } + + // configure signature options + if ($config->hasValue('validate.authnrequest')) { + $metadata['sign.authnrequest'] = $config->getBoolean('validate.authnrequest'); + } + + if ($config->hasValue('redirect.validate')) { + $metadata['redirect.sign'] = $config->getBoolean('redirect.validate'); + } + + // add contact information + if ($config->hasValue('contacts')) { + $contacts = $config->getArray('contacts'); + foreach ($contacts as $contact) { + $metadata['contacts'][] = Metadata::getContact($contact); + } + } + + $globalConfig = \SimpleSAML\Configuration::getInstance(); + $email = $globalConfig->getString('technicalcontact_email', false); + if ($email && $email !== 'na@example.org') { + $contact = [ + 'emailAddress' => $email, + 'name' => $globalConfig->getString('technicalcontact_name', null), + 'contactType' => 'technical', + ]; + $metadata['contacts'][] = Metadata::getContact($contact); + } + + return $metadata; + } + + /** * Calculate the NameID value that should be used. * - * @param SimpleSAML_Configuration $idpMetadata The metadata of the IdP. - * @param SimpleSAML_Configuration $dstMetadata The metadata of the SP. - * @param array &$state The authentication state of the user. + * @param \SimpleSAML\Configuration $idpMetadata The metadata of the IdP. + * @param \SimpleSAML\Configuration $spMetadata The metadata of the SP. + * @param array &$state The authentication state of the user. * - * @return string The NameID value. + * @return string|null The NameID value. */ private static function generateNameIdValue( - SimpleSAML_Configuration $idpMetadata, - SimpleSAML_Configuration $spMetadata, + Configuration $idpMetadata, + Configuration $spMetadata, array &$state ) { @@ -679,14 +911,14 @@ private static function generateNameIdValue( $attribute = $idpMetadata->getString('simplesaml.nameidattribute', null); if ($attribute === null) { if (!isset($state['UserID'])) { - SimpleSAML\Logger::error('Unable to generate NameID. Check the userid.attribute option.'); + Logger::error('Unable to generate NameID. Check the userid.attribute option.'); return null; } $attributeValue = $state['UserID']; $idpEntityId = $idpMetadata->getString('entityid'); $spEntityId = $spMetadata->getString('entityid'); - $secretSalt = SimpleSAML\Utils\Config::getSecretSalt(); + $secretSalt = \SimpleSAML\Utils\Config::getSecretSalt(); $uidData = 'uidhashbase'.$secretSalt; $uidData .= strlen($idpEntityId).':'.$idpEntityId; @@ -700,7 +932,7 @@ private static function generateNameIdValue( $attributes = $state['Attributes']; if (!array_key_exists($attribute, $attributes)) { - SimpleSAML\Logger::error('Unable to add NameID: Missing '.var_export($attribute, true). + Logger::error('Unable to add NameID: Missing '.var_export($attribute, true). ' in the attributes of the user.'); return null; } @@ -712,20 +944,19 @@ private static function generateNameIdValue( /** * Helper function for encoding attributes. * - * @param SimpleSAML_Configuration $idpMetadata The metadata of the IdP. - * @param SimpleSAML_Configuration $spMetadata The metadata of the SP. + * @param \SimpleSAML\Configuration $idpMetadata The metadata of the IdP. + * @param \SimpleSAML\Configuration $spMetadata The metadata of the SP. * @param array $attributes The attributes of the user. * * @return array The encoded attributes. * - * @throws SimpleSAML_Error_Exception In case an unsupported encoding is specified by configuration. + * @throws \SimpleSAML\Error\Exception In case an unsupported encoding is specified by configuration. */ private static function encodeAttributes( - SimpleSAML_Configuration $idpMetadata, - SimpleSAML_Configuration $spMetadata, + Configuration $idpMetadata, + Configuration $spMetadata, array $attributes ) { - $base64Attributes = $spMetadata->getBoolean('base64attributes', null); if ($base64Attributes === null) { $base64Attributes = $idpMetadata->getBoolean('base64attributes', false); @@ -737,8 +968,8 @@ private static function encodeAttributes( $defaultEncoding = 'string'; } - $srcEncodings = $idpMetadata->getArray('attributeencodings', array()); - $dstEncodings = $spMetadata->getArray('attributeencodings', array()); + $srcEncodings = $idpMetadata->getArray('attributeencodings', []); + $dstEncodings = $spMetadata->getArray('attributeencodings', []); /* * Merge the two encoding arrays. Encodings specified in the target metadata @@ -746,9 +977,9 @@ private static function encodeAttributes( */ $encodings = array_merge($srcEncodings, $dstEncodings); - $ret = array(); + $ret = []; foreach ($attributes as $name => $values) { - $ret[$name] = array(); + $ret[$name] = []; if (array_key_exists($name, $encodings)) { $encoding = $encodings[$name]; } else { @@ -763,7 +994,7 @@ private static function encodeAttributes( } $attrval = $value; - if ($value instanceof DOMNodeList) { + if ($value instanceof \DOMNodeList) { $attrval = new \SAML2\XML\saml\AttributeValue($value->item(0)->parentNode); } @@ -779,10 +1010,10 @@ private static function encodeAttributes( $doc = \SAML2\DOMDocumentFactory::fromString('<root>'.$value.'</root>'); $value = $doc->firstChild->childNodes; } - assert('$value instanceof DOMNodeList || $value instanceof \SAML2\XML\saml\NameID'); + assert($value instanceof \DOMNodeList || $value instanceof \SAML2\XML\saml\NameID); break; default: - throw new SimpleSAML_Error_Exception('Invalid encoding for attribute '. + throw new \SimpleSAML\Error\Exception('Invalid encoding for attribute '. var_export($name, true).': '.var_export($encoding, true)); } $ret[$name][] = $value; @@ -796,16 +1027,15 @@ private static function encodeAttributes( /** * Determine which NameFormat we should use for attributes. * - * @param SimpleSAML_Configuration $idpMetadata The metadata of the IdP. - * @param SimpleSAML_Configuration $spMetadata The metadata of the SP. + * @param \SimpleSAML\Configuration $idpMetadata The metadata of the IdP. + * @param \SimpleSAML\Configuration $spMetadata The metadata of the SP. * * @return string The NameFormat. */ private static function getAttributeNameFormat( - SimpleSAML_Configuration $idpMetadata, - SimpleSAML_Configuration $spMetadata + Configuration $idpMetadata, + Configuration $spMetadata ) { - // try SP metadata first $attributeNameFormat = $spMetadata->getString('attributes.NameFormat', null); if ($attributeNameFormat !== null) { @@ -834,21 +1064,21 @@ private static function getAttributeNameFormat( /** * Build an assertion based on information in the metadata. * - * @param SimpleSAML_Configuration $idpMetadata The metadata of the IdP. - * @param SimpleSAML_Configuration $spMetadata The metadata of the SP. + * @param \SimpleSAML\Configuration $idpMetadata The metadata of the IdP. + * @param \SimpleSAML\Configuration $spMetadata The metadata of the SP. * @param array &$state The state array with information about the request. * * @return \SAML2\Assertion The assertion. * - * @throws SimpleSAML_Error_Exception In case an error occurs when creating a holder-of-key assertion. + * @throws \SimpleSAML\Error\Exception In case an error occurs when creating a holder-of-key assertion. */ private static function buildAssertion( - SimpleSAML_Configuration $idpMetadata, - SimpleSAML_Configuration $spMetadata, + Configuration $idpMetadata, + Configuration $spMetadata, array &$state ) { - assert('isset($state["Attributes"])'); - assert('isset($state["saml:ConsumerURL"])'); + assert(isset($state['Attributes'])); + assert(isset($state['saml:ConsumerURL'])); $now = time(); @@ -857,15 +1087,18 @@ private static function buildAssertion( $signAssertion = $idpMetadata->getBoolean('saml20.sign.assertion', true); } - $config = SimpleSAML_Configuration::getInstance(); + $config = Configuration::getInstance(); $a = new \SAML2\Assertion(); if ($signAssertion) { - sspmod_saml_Message::addSign($idpMetadata, $spMetadata, $a); + \SimpleSAML\Module\saml\Message::addSign($idpMetadata, $spMetadata, $a); } - $a->setIssuer($idpMetadata->getString('entityid')); - $a->setValidAudiences(array($spMetadata->getString('entityid'))); + $issuer = new Issuer(); + $issuer->setValue($idpMetadata->getString('entityid')); + $issuer->setFormat(Constants::NAMEID_ENTITY); + $a->setIssuer($issuer); + $a->setValidAudiences([$spMetadata->getString('entityid')]); $a->setNotBefore($now - 30); @@ -876,9 +1109,11 @@ private static function buildAssertion( $a->setNotOnOrAfter($now + $assertionLifetime); if (isset($state['saml:AuthnContextClassRef'])) { - $a->setAuthnContext($state['saml:AuthnContextClassRef']); + $a->setAuthnContextClassRef($state['saml:AuthnContextClassRef']); + } elseif (\SimpleSAML\Utils\HTTP::isHTTPS()) { + $a->setAuthnContextClassRef(\SAML2\Constants::AC_PASSWORD_PROTECTED_TRANSPORT); } else { - $a->setAuthnContext(\SAML2\Constants::AC_PASSWORD); + $a->setAuthnContextClassRef(\SAML2\Constants::AC_PASSWORD); } $sessionStart = $now; @@ -890,13 +1125,14 @@ private static function buildAssertion( $sessionLifetime = $config->getInteger('session.duration', 8 * 60 * 60); $a->setSessionNotOnOrAfter($sessionStart + $sessionLifetime); - $a->setSessionIndex(SimpleSAML\Utils\Random::generateID()); + $a->setSessionIndex(\SimpleSAML\Utils\Random::generateID()); $sc = new \SAML2\XML\saml\SubjectConfirmation(); - $sc->SubjectConfirmationData = new \SAML2\XML\saml\SubjectConfirmationData(); - $sc->SubjectConfirmationData->NotOnOrAfter = $now + $assertionLifetime; - $sc->SubjectConfirmationData->Recipient = $state['saml:ConsumerURL']; - $sc->SubjectConfirmationData->InResponseTo = $state['saml:RequestId']; + $scd = new \SAML2\XML\saml\SubjectConfirmationData(); + $scd->setNotOnOrAfter($now + $assertionLifetime); + $scd->setRecipient($state['saml:ConsumerURL']); + $scd->setInResponseTo($state['saml:RequestId']); + $sc->setSubjectConfirmationData($scd); // ProtcolBinding of SP's <AuthnRequest> overwrites IdP hosted metadata configuration $hokAssertion = null; @@ -909,7 +1145,7 @@ private static function buildAssertion( if ($hokAssertion) { // Holder-of-Key - $sc->Method = \SAML2\Constants::CM_HOK; + $sc->setMethod(\SAML2\Constants::CM_HOK); if (\SimpleSAML\Utils\HTTP::isHTTPS()) { if (isset($_SERVER['SSL_CLIENT_CERT']) && !empty($_SERVER['SSL_CLIENT_CERT'])) { // extract certificate data (if this is a certificate) @@ -918,36 +1154,37 @@ private static function buildAssertion( if (preg_match($pattern, $clientCert, $matches)) { // we have a client certificate from the browser which we add to the HoK assertion $x509Certificate = new \SAML2\XML\ds\X509Certificate(); - $x509Certificate->certificate = str_replace(array("\r", "\n", " "), '', $matches[1]); + $x509Certificate->setCertificate(str_replace(["\r", "\n", " "], '', $matches[1])); $x509Data = new \SAML2\XML\ds\X509Data(); - $x509Data->data[] = $x509Certificate; + $x509Data->addData($x509Certificate); $keyInfo = new \SAML2\XML\ds\KeyInfo(); - $keyInfo->info[] = $x509Data; + $keyInfo->addInfo($x509Data); - $sc->SubjectConfirmationData->info[] = $keyInfo; + $scd->addInfo($keyInfo); } else { - throw new SimpleSAML_Error_Exception( + throw new \SimpleSAML\Error\Exception( 'Error creating HoK assertion: No valid client certificate provided during TLS handshake '. 'with IdP' ); } } else { - throw new SimpleSAML_Error_Exception( + throw new \SimpleSAML\Error\Exception( 'Error creating HoK assertion: No client certificate provided during TLS handshake with IdP' ); } } else { - throw new SimpleSAML_Error_Exception( + throw new \SimpleSAML\Error\Exception( 'Error creating HoK assertion: No HTTPS connection to IdP, but required for Holder-of-Key SSO' ); } } else { // Bearer - $sc->Method = \SAML2\Constants::CM_BEARER; + $sc->setMethod(\SAML2\Constants::CM_BEARER); } - $a->setSubjectConfirmation(array($sc)); + $sc->setSubjectConfirmationData($scd); + $a->setSubjectConfirmation([$sc]); // add attributes if ($spMetadata->getBoolean('simplesaml.attributes', true)) { @@ -957,24 +1194,24 @@ private static function buildAssertion( $a->setAttributes($attributes); } + $nameIdFormat = null; + // generate the NameID for the assertion if (isset($state['saml:NameIDFormat'])) { $nameIdFormat = $state['saml:NameIDFormat']; - } else { - $nameIdFormat = null; } if ($nameIdFormat === null || !isset($state['saml:NameID'][$nameIdFormat])) { // either not set in request, or not set to a format we supply. Fall back to old generation method - $nameIdFormat = $spMetadata->getString('NameIDFormat', null); - if ($nameIdFormat === null) { - $nameIdFormat = $idpMetadata->getString('NameIDFormat', \SAML2\Constants::NAMEID_TRANSIENT); + $nameIdFormat = current($spMetadata->getArrayizeString('NameIDFormat', [])); + if ($nameIdFormat === false) { + $nameIdFormat = current($idpMetadata->getArrayizeString('NameIDFormat', [\SAML2\Constants::NAMEID_TRANSIENT])); } } if (isset($state['saml:NameID'][$nameIdFormat])) { $nameId = $state['saml:NameID'][$nameIdFormat]; - $nameId->Format = $nameIdFormat; + $nameId->setFormat($nameIdFormat); } else { $spNameQualifier = $spMetadata->getString('SPNameQualifier', null); if ($spNameQualifier === null) { @@ -983,22 +1220,22 @@ private static function buildAssertion( if ($nameIdFormat === \SAML2\Constants::NAMEID_TRANSIENT) { // generate a random id - $nameIdValue = SimpleSAML\Utils\Random::generateID(); + $nameIdValue = \SimpleSAML\Utils\Random::generateID(); } else { /* this code will end up generating either a fixed assigned id (via nameid.attribute) or random id if not assigned/configured */ $nameIdValue = self::generateNameIdValue($idpMetadata, $spMetadata, $state); if ($nameIdValue === null) { - SimpleSAML\Logger::warning('Falling back to transient NameID.'); + Logger::warning('Falling back to transient NameID.'); $nameIdFormat = \SAML2\Constants::NAMEID_TRANSIENT; - $nameIdValue = SimpleSAML\Utils\Random::generateID(); + $nameIdValue = \SimpleSAML\Utils\Random::generateID(); } } $nameId = new \SAML2\XML\saml\NameID(); - $nameId->Format = $nameIdFormat; - $nameId->value = $nameIdValue; - $nameId->SPNameQualifier = $spNameQualifier; + $nameId->setFormat($nameIdFormat); + $nameId->setValue($nameIdValue); + $nameId->setSPNameQualifier($spNameQualifier); } $state['saml:idp:NameID'] = $nameId; @@ -1010,7 +1247,7 @@ private static function buildAssertion( $encryptNameId = $idpMetadata->getBoolean('nameid.encryption', false); } if ($encryptNameId) { - $a->encryptNameId(sspmod_saml_Message::getEncryptionKey($spMetadata)); + $a->encryptNameId(\SimpleSAML\Module\saml\Message::getEncryptionKey($spMetadata)); } return $a; @@ -1023,20 +1260,19 @@ private static function buildAssertion( * This function takes in a \SAML2\Assertion and encrypts it if encryption of * assertions are enabled in the metadata. * - * @param SimpleSAML_Configuration $idpMetadata The metadata of the IdP. - * @param SimpleSAML_Configuration $spMetadata The metadata of the SP. + * @param \SimpleSAML\Configuration $idpMetadata The metadata of the IdP. + * @param \SimpleSAML\Configuration $spMetadata The metadata of the SP. * @param \SAML2\Assertion $assertion The assertion we are encrypting. * * @return \SAML2\Assertion|\SAML2\EncryptedAssertion The assertion. * - * @throws SimpleSAML_Error_Exception In case the encryption key type is not supported. + * @throws \SimpleSAML\Error\Exception In case the encryption key type is not supported. */ private static function encryptAssertion( - SimpleSAML_Configuration $idpMetadata, - SimpleSAML_Configuration $spMetadata, + Configuration $idpMetadata, + Configuration $spMetadata, \SAML2\Assertion $assertion ) { - $encryptAssertion = $spMetadata->getBoolean('assertion.encryption', null); if ($encryptAssertion === null) { $encryptAssertion = $idpMetadata->getBoolean('assertion.encryption', false); @@ -1053,20 +1289,28 @@ private static function encryptAssertion( $key->loadKey($sharedKey); } else { $keys = $spMetadata->getPublicKeys('encryption', true); - $key = $keys[0]; - switch ($key['type']) { - case 'X509Certificate': - $pemKey = "-----BEGIN CERTIFICATE-----\n". - chunk_split($key['X509Certificate'], 64). - "-----END CERTIFICATE-----\n"; - break; - default: - throw new SimpleSAML_Error_Exception('Unsupported encryption key type: '.$key['type']); - } + if (!empty($keys)) { + $key = $keys[0]; + switch ($key['type']) { + case 'X509Certificate': + $pemKey = "-----BEGIN CERTIFICATE-----\n". + chunk_split($key['X509Certificate'], 64). + "-----END CERTIFICATE-----\n"; + break; + default: + throw new \SimpleSAML\Error\Exception('Unsupported encryption key type: '.$key['type']); + } - // extract the public key from the certificate for encryption - $key = new XMLSecurityKey(XMLSecurityKey::RSA_OAEP_MGF1P, array('type' => 'public')); - $key->loadKey($pemKey); + // extract the public key from the certificate for encryption + $key = new XMLSecurityKey(XMLSecurityKey::RSA_OAEP_MGF1P, ['type' => 'public']); + $key->loadKey($pemKey); + } else { + throw new \SimpleSAML\Error\ConfigurationError( + 'Missing encryption key for entity `'.$spMetadata->getString('entityid').'`', + $spMetadata->getString('metadata-set').'.php', + null + ); + } } $ea = new \SAML2\EncryptedAssertion(); @@ -1078,21 +1322,20 @@ private static function encryptAssertion( /** * Build a logout request based on information in the metadata. * - * @param SimpleSAML_Configuration $idpMetadata The metadata of the IdP. - * @param SimpleSAML_Configuration $spMetadata The metadata of the SP. + * @param \SimpleSAML\Configuration $idpMetadata The metadata of the IdP. + * @param \SimpleSAML\Configuration $spMetadata The metadata of the SP. * @param array $association The SP association. * @param string|null $relayState An id that should be carried across the logout. * - * @return \SAML2\LogoutResponse The corresponding SAML2 logout response. + * @return \SAML2\LogoutRequest The corresponding SAML2 logout request. */ private static function buildLogoutRequest( - SimpleSAML_Configuration $idpMetadata, - SimpleSAML_Configuration $spMetadata, + Configuration $idpMetadata, + Configuration $spMetadata, array $association, $relayState ) { - - $lr = sspmod_saml_Message::buildLogoutRequest($idpMetadata, $spMetadata); + $lr = \SimpleSAML\Module\saml\Message::buildLogoutRequest($idpMetadata, $spMetadata); $lr->setRelayState($relayState); $lr->setSessionIndex($association['saml:SessionIndex']); $lr->setNameId($association['saml:NameID']); @@ -1108,7 +1351,7 @@ private static function buildLogoutRequest( $encryptNameId = $idpMetadata->getBoolean('nameid.encryption', false); } if ($encryptNameId) { - $lr->encryptNameId(sspmod_saml_Message::getEncryptionKey($spMetadata)); + $lr->encryptNameId(\SimpleSAML\Module\saml\Message::getEncryptionKey($spMetadata)); } return $lr; @@ -1118,30 +1361,31 @@ private static function buildLogoutRequest( /** * Build a authentication response based on information in the metadata. * - * @param SimpleSAML_Configuration $idpMetadata The metadata of the IdP. - * @param SimpleSAML_Configuration $spMetadata The metadata of the SP. - * @param string $consumerURL The Destination URL of the response. + * @param \SimpleSAML\Configuration $idpMetadata The metadata of the IdP. + * @param \SimpleSAML\Configuration $spMetadata The metadata of the SP. + * @param string $consumerURL The Destination URL of the response. * - * @return \SAML2\Response The SAML2 response corresponding to the given data. + * @return \SAML2\Response The SAML2 Response corresponding to the given data. */ private static function buildResponse( - SimpleSAML_Configuration $idpMetadata, - SimpleSAML_Configuration $spMetadata, + Configuration $idpMetadata, + Configuration $spMetadata, $consumerURL ) { - $signResponse = $spMetadata->getBoolean('saml20.sign.response', null); if ($signResponse === null) { $signResponse = $idpMetadata->getBoolean('saml20.sign.response', true); } $r = new \SAML2\Response(); - - $r->setIssuer($idpMetadata->getString('entityid')); + $issuer = new Issuer(); + $issuer->setValue($idpMetadata->getString('entityid')); + $issuer->setFormat(Constants::NAMEID_ENTITY); + $r->setIssuer($issuer); $r->setDestination($consumerURL); if ($signResponse) { - sspmod_saml_Message::addSign($idpMetadata, $spMetadata, $r); + \SimpleSAML\Module\saml\Message::addSign($idpMetadata, $spMetadata, $r); } return $r; diff --git a/vendor/simplesamlphp/simplesamlphp/modules/saml/lib/IdP/SQLNameID.php b/vendor/simplesamlphp/simplesamlphp/modules/saml/lib/IdP/SQLNameID.php index 7b8a06a4e3..95d5712df2 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/saml/lib/IdP/SQLNameID.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/saml/lib/IdP/SQLNameID.php @@ -1,178 +1,191 @@ <?php +namespace SimpleSAML\Module\saml\IdP; + /** * Helper class for working with persistent NameIDs stored in SQL datastore. * * @package SimpleSAMLphp */ -class sspmod_saml_IdP_SQLNameID { - - /** - * Create NameID table in SQL, if it is missing. - * - * @param \SimpleSAML\Store\SQL $store The datastore. - */ - private static function createTable(\SimpleSAML\Store\SQL $store) { - - if ($store->getTableVersion('saml_PersistentNameID') === 1) { - return; - } - - $query = 'CREATE TABLE ' . $store->prefix . '_saml_PersistentNameID ( - _idp VARCHAR(256) NOT NULL, - _sp VARCHAR(256) NOT NULL, - _user VARCHAR(256) NOT NULL, - _value VARCHAR(40) NOT NULL, - UNIQUE (_idp, _sp, _user) - )'; - $store->pdo->exec($query); - - $query = 'CREATE INDEX ' . $store->prefix . '_saml_PersistentNameID_idp_sp ON ' . $store->prefix . '_saml_PersistentNameID (_idp, _sp)'; - $store->pdo->exec($query); - - $store->setTableVersion('saml_PersistentNameID', 1); - } - - - /** - * Retrieve the SQL datastore. - * - * Will also ensure that the NameID table is present. - * - * @return \SimpleSAML\Store\SQL SQL datastore. - */ - private static function getStore() { - - $store = \SimpleSAML\Store::getInstance(); - if (!($store instanceof \SimpleSAML\Store\SQL)) { - throw new SimpleSAML_Error_Exception('SQL NameID store requires SimpleSAMLphp to be configured with a SQL datastore.'); - } - - self::createTable($store); - - return $store; - } - - - /** - * Add a NameID into the database. - * - * @param \SimpleSAML\Store\SQL $store The data store. - * @param string $idpEntityId The IdP entityID. - * @param string $spEntityId The SP entityID. - * @param string $user The user's unique identificator (e.g. username). - * @param string $value The NameID value. - */ - public static function add($idpEntityId, $spEntityId, $user, $value) { - assert('is_string($idpEntityId)'); - assert('is_string($spEntityId)'); - assert('is_string($user)'); - assert('is_string($value)'); - - $store = self::getStore(); - - $params = array( - '_idp' => $idpEntityId, - '_sp' => $spEntityId, - '_user' => $user, - '_value' => $value, - ); - - $query = 'INSERT INTO ' . $store->prefix . '_saml_PersistentNameID (_idp, _sp, _user, _value) VALUES(:_idp, :_sp, :_user, :_value)'; - $query = $store->pdo->prepare($query); - $query->execute($params); - } - - - /** - * Retrieve a NameID into from database. - * - * @param string $idpEntityId The IdP entityID. - * @param string $spEntityId The SP entityID. - * @param string $user The user's unique identificator (e.g. username). - * @return string|NULL $value The NameID value, or NULL of no NameID value was found. - */ - public static function get($idpEntityId, $spEntityId, $user) { - assert('is_string($idpEntityId)'); - assert('is_string($spEntityId)'); - assert('is_string($user)'); - - $store = self::getStore(); - - $params = array( - '_idp' => $idpEntityId, - '_sp' => $spEntityId, - '_user' => $user, - ); - - $query = 'SELECT _value FROM ' . $store->prefix . '_saml_PersistentNameID WHERE _idp = :_idp AND _sp = :_sp AND _user = :_user'; - $query = $store->pdo->prepare($query); - $query->execute($params); - - $row = $query->fetch(PDO::FETCH_ASSOC); - if ($row === FALSE) { - // No NameID found - return NULL; - } - - return $row['_value']; - } - - - /** - * Delete a NameID from the database. - * - * @param string $idpEntityId The IdP entityID. - * @param string $spEntityId The SP entityID. - * @param string $user The user's unique identificator (e.g. username). - */ - public static function delete($idpEntityId, $spEntityId, $user) { - assert('is_string($idpEntityId)'); - assert('is_string($spEntityId)'); - assert('is_string($user)'); - - $store = self::getStore(); - - $params = array( - '_idp' => $idpEntityId, - '_sp' => $spEntityId, - '_user' => $user, - ); - - $query = 'DELETE FROM ' . $store->prefix . '_saml_PersistentNameID WHERE _idp = :_idp AND _sp = :_sp AND _user = :_user'; - $query = $store->pdo->prepare($query); - $query->execute($params); - } - - - /** - * Retrieve all federated identities for an IdP-SP pair. - * - * @param string $idpEntityId The IdP entityID. - * @param string $spEntityId The SP entityID. - * @return array Array of userid => NameID. - */ - public static function getIdentities($idpEntityId, $spEntityId) { - assert('is_string($idpEntityId)'); - assert('is_string($spEntityId)'); - - $store = self::getStore(); - - $params = array( - '_idp' => $idpEntityId, - '_sp' => $spEntityId, - ); - - $query = 'SELECT _user, _value FROM ' . $store->prefix . '_saml_PersistentNameID WHERE _idp = :_idp AND _sp = :_sp'; - $query = $store->pdo->prepare($query); - $query->execute($params); - - $res = array(); - while ( ($row = $query->fetch(PDO::FETCH_ASSOC)) !== FALSE) { - $res[$row['_user']] = $row['_value']; - } - - return $res; - } +class SQLNameID +{ + /** + * Create NameID table in SQL, if it is missing. + * + * @param \SimpleSAML\Store\SQL $store The datastore. + */ + private static function createTable(\SimpleSAML\Store\SQL $store) + { + if ($store->getTableVersion('saml_PersistentNameID') === 1) { + return; + } + + $query = 'CREATE TABLE '.$store->prefix.'_saml_PersistentNameID ( + _idp VARCHAR(256) NOT NULL, + _sp VARCHAR(256) NOT NULL, + _user VARCHAR(256) NOT NULL, + _value VARCHAR(40) NOT NULL, + UNIQUE (_idp, _sp, _user) + )'; + $store->pdo->exec($query); + + $query = 'CREATE INDEX '.$store->prefix.'_saml_PersistentNameID_idp_sp ON '; + $query .= $store->prefix.'_saml_PersistentNameID (_idp, _sp)'; + $store->pdo->exec($query); + + $store->setTableVersion('saml_PersistentNameID', 1); + } + + + /** + * Retrieve the SQL datastore. + * + * Will also ensure that the NameID table is present. + * + * @return \SimpleSAML\Store\SQL SQL datastore. + */ + private static function getStore() + { + $store = \SimpleSAML\Store::getInstance(); + if (!($store instanceof \SimpleSAML\Store\SQL)) { + throw new \SimpleSAML\Error\Exception( + 'SQL NameID store requires SimpleSAMLphp to be configured with a SQL datastore.' + ); + } + + self::createTable($store); + + return $store; + } + + + /** + * Add a NameID into the database. + * + * @param \SimpleSAML\Store\SQL $store The data store. + * @param string $idpEntityId The IdP entityID. + * @param string $spEntityId The SP entityID. + * @param string $user The user's unique identificator (e.g. username). + * @param string $value The NameID value. + */ + public static function add($idpEntityId, $spEntityId, $user, $value) + { + assert(is_string($idpEntityId)); + assert(is_string($spEntityId)); + assert(is_string($user)); + assert(is_string($value)); + + $store = self::getStore(); + + $params = [ + '_idp' => $idpEntityId, + '_sp' => $spEntityId, + '_user' => $user, + '_value' => $value, + ]; + + $query = 'INSERT INTO '.$store->prefix; + $query .= '_saml_PersistentNameID (_idp, _sp, _user, _value) VALUES(:_idp, :_sp, :_user, :_value)'; + $query = $store->pdo->prepare($query); + $query->execute($params); + } + + + /** + * Retrieve a NameID into from database. + * + * @param string $idpEntityId The IdP entityID. + * @param string $spEntityId The SP entityID. + * @param string $user The user's unique identificator (e.g. username). + * @return string|NULL $value The NameID value, or NULL of no NameID value was found. + */ + public static function get($idpEntityId, $spEntityId, $user) + { + assert(is_string($idpEntityId)); + assert(is_string($spEntityId)); + assert(is_string($user)); + + $store = self::getStore(); + + $params = [ + '_idp' => $idpEntityId, + '_sp' => $spEntityId, + '_user' => $user, + ]; + + $query = 'SELECT _value FROM '.$store->prefix; + $query .= '_saml_PersistentNameID WHERE _idp = :_idp AND _sp = :_sp AND _user = :_user'; + $query = $store->pdo->prepare($query); + $query->execute($params); + + $row = $query->fetch(\PDO::FETCH_ASSOC); + if ($row === false) { + // No NameID found + return null; + } + + return $row['_value']; + } + + + /** + * Delete a NameID from the database. + * + * @param string $idpEntityId The IdP entityID. + * @param string $spEntityId The SP entityID. + * @param string $user The user's unique identificator (e.g. username). + */ + public static function delete($idpEntityId, $spEntityId, $user) + { + assert(is_string($idpEntityId)); + assert(is_string($spEntityId)); + assert(is_string($user)); + + $store = self::getStore(); + + $params = [ + '_idp' => $idpEntityId, + '_sp' => $spEntityId, + '_user' => $user, + ]; + + $query = 'DELETE FROM '.$store->prefix; + $query .= '_saml_PersistentNameID WHERE _idp = :_idp AND _sp = :_sp AND _user = :_user'; + $query = $store->pdo->prepare($query); + $query->execute($params); + } + + + /** + * Retrieve all federated identities for an IdP-SP pair. + * + * @param string $idpEntityId The IdP entityID. + * @param string $spEntityId The SP entityID. + * @return array Array of userid => NameID. + */ + public static function getIdentities($idpEntityId, $spEntityId) + { + assert(is_string($idpEntityId)); + assert(is_string($spEntityId)); + + $store = self::getStore(); + + $params = [ + '_idp' => $idpEntityId, + '_sp' => $spEntityId, + ]; + + $query = 'SELECT _user, _value FROM '.$store->prefix; + $query .= '_saml_PersistentNameID WHERE _idp = :_idp AND _sp = :_sp'; + $query = $store->pdo->prepare($query); + $query->execute($params); + + $res = []; + while (($row = $query->fetch(\PDO::FETCH_ASSOC)) !== false) { + $res[$row['_user']] = $row['_value']; + } + + return $res; + } } diff --git a/vendor/simplesamlphp/simplesamlphp/modules/saml/lib/Message.php b/vendor/simplesamlphp/simplesamlphp/modules/saml/lib/Message.php index 27ef6ae088..a0f7193104 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/saml/lib/Message.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/saml/lib/Message.php @@ -1,53 +1,46 @@ <?php +namespace SimpleSAML\Module\saml; + use RobRichards\XMLSecLibs\XMLSecurityKey; +use SAML2\Constants; +use SAML2\XML\saml\Issuer; /** * Common code for building SAML 2 messages based on the available metadata. * * @package SimpleSAMLphp */ -class sspmod_saml_Message +class Message { - /** * Add signature key and sender certificate to an element (Message or Assertion). * - * @param SimpleSAML_Configuration $srcMetadata The metadata of the sender. - * @param SimpleSAML_Configuration $dstMetadata The metadata of the recipient. + * @param \SimpleSAML\Configuration $srcMetadata The metadata of the sender. + * @param \SimpleSAML\Configuration $dstMetadata The metadata of the recipient. * @param \SAML2\SignedElement $element The element we should add the data to. */ public static function addSign( - SimpleSAML_Configuration $srcMetadata, - SimpleSAML_Configuration $dstMetadata, + \SimpleSAML\Configuration $srcMetadata, + \SimpleSAML\Configuration $dstMetadata, \SAML2\SignedElement $element ) { $dstPrivateKey = $dstMetadata->getString('signature.privatekey', null); if ($dstPrivateKey !== null) { - $keyArray = SimpleSAML\Utils\Crypto::loadPrivateKey($dstMetadata, true, 'signature.'); - $certArray = SimpleSAML\Utils\Crypto::loadPublicKey($dstMetadata, false, 'signature.'); + $keyArray = \SimpleSAML\Utils\Crypto::loadPrivateKey($dstMetadata, true, 'signature.'); + $certArray = \SimpleSAML\Utils\Crypto::loadPublicKey($dstMetadata, false, 'signature.'); } else { - $keyArray = SimpleSAML\Utils\Crypto::loadPrivateKey($srcMetadata, true); - $certArray = SimpleSAML\Utils\Crypto::loadPublicKey($srcMetadata, false); + $keyArray = \SimpleSAML\Utils\Crypto::loadPrivateKey($srcMetadata, true); + $certArray = \SimpleSAML\Utils\Crypto::loadPublicKey($srcMetadata, false); } $algo = $dstMetadata->getString('signature.algorithm', null); if ($algo === null) { - /* - * In the NIST Special Publication 800-131A, SHA-1 became deprecated for generating - * new digital signatures in 2011, and will be explicitly disallowed starting the 1st - * of January, 2014. We'll keep this as a default for the next release and mark it - * as deprecated, as part of the transition to SHA-256. - * - * See http://csrc.nist.gov/publications/nistpubs/800-131A/sp800-131A.pdf for more info. - * - * TODO: change default to XMLSecurityKey::RSA_SHA256. - */ - $algo = $srcMetadata->getString('signature.algorithm', XMLSecurityKey::RSA_SHA1); - } - - $privateKey = new XMLSecurityKey($algo, array('type' => 'private')); + $algo = $srcMetadata->getString('signature.algorithm', XMLSecurityKey::RSA_SHA256); + } + + $privateKey = new XMLSecurityKey($algo, ['type' => 'private']); if (array_key_exists('password', $keyArray)) { $privateKey->passphrase = $keyArray['password']; } @@ -65,20 +58,20 @@ public static function addSign( return; } - $element->setCertificates(array($certArray['PEM'])); + $element->setCertificates([$certArray['PEM']]); } /** * Add signature key and and senders certificate to message. * - * @param SimpleSAML_Configuration $srcMetadata The metadata of the sender. - * @param SimpleSAML_Configuration $dstMetadata The metadata of the recipient. + * @param \SimpleSAML\Configuration $srcMetadata The metadata of the sender. + * @param \SimpleSAML\Configuration $dstMetadata The metadata of the recipient. * @param \SAML2\Message $message The message we should add the data to. */ private static function addRedirectSign( - SimpleSAML_Configuration $srcMetadata, - SimpleSAML_Configuration $dstMetadata, + \SimpleSAML\Configuration $srcMetadata, + \SimpleSAML\Configuration $dstMetadata, \SAML2\Message $message ) { @@ -119,11 +112,11 @@ private static function addRedirectSign( * * @return string Certificate, in PEM-format. * - * @throws SimpleSAML_Error_Exception if we cannot find the certificate matching the fingerprint. + * @throws \SimpleSAML\Error\Exception if we cannot find the certificate matching the fingerprint. */ private static function findCertificate(array $certFingerprints, array $certificates) { - $candidates = array(); + $candidates = []; foreach ($certificates as $cert) { $fp = strtolower(sha1(base64_decode($cert))); @@ -141,7 +134,7 @@ private static function findCertificate(array $certFingerprints, array $certific $candidates = "'".implode("', '", $candidates)."'"; $fps = "'".implode("', '", $certFingerprints)."'"; - throw new SimpleSAML_Error_Exception('Unable to find a certificate matching the configured '. + throw new \SimpleSAML\Error\Exception('Unable to find a certificate matching the configured '. 'fingerprint. Candidates: '.$candidates.'; certFingerprint: '.$fps.'.'); } @@ -149,19 +142,19 @@ private static function findCertificate(array $certFingerprints, array $certific /** * Check the signature on a SAML2 message or assertion. * - * @param SimpleSAML_Configuration $srcMetadata The metadata of the sender. + * @param \SimpleSAML\Configuration $srcMetadata The metadata of the sender. * @param \SAML2\SignedElement $element Either a \SAML2\Response or a \SAML2\Assertion. * @return boolean True if the signature is correct, false otherwise. * - * @throws \SimpleSAML_Error_Exception if there is not certificate in the metadata for the entity. + * @throws \SimpleSAML\Error\Exception if there is not certificate in the metadata for the entity. * @throws \Exception if the signature validation fails with an exception. */ - public static function checkSign(SimpleSAML_Configuration $srcMetadata, \SAML2\SignedElement $element) + public static function checkSign(\SimpleSAML\Configuration $srcMetadata, \SAML2\SignedElement $element) { // find the public key that should verify signatures by this entity $keys = $srcMetadata->getPublicKeys('signing'); - if ($keys !== null) { - $pemKeys = array(); + if (!empty($keys)) { + $pemKeys = []; foreach ($keys as $key) { switch ($key['type']) { case 'X509Certificate': @@ -170,11 +163,11 @@ public static function checkSign(SimpleSAML_Configuration $srcMetadata, \SAML2\S "-----END CERTIFICATE-----\n"; break; default: - SimpleSAML\Logger::debug('Skipping unknown key type: '.$key['type']); + \SimpleSAML\Logger::debug('Skipping unknown key type: '.$key['type']); } } } elseif ($srcMetadata->hasValue('certFingerprint')) { - SimpleSAML\Logger::notice( + \SimpleSAML\Logger::notice( "Validating certificates by fingerprint is deprecated. Please use ". "certData or certificate options in your remote metadata configuration." ); @@ -189,38 +182,38 @@ public static function checkSign(SimpleSAML_Configuration $srcMetadata, \SAML2\S // we don't have the full certificate stored. Try to find it in the message or the assertion instead if (count($certificates) === 0) { /* We need the full certificate in order to match it against the fingerprint. */ - SimpleSAML\Logger::debug('No certificate in message when validating against fingerprint.'); + \SimpleSAML\Logger::debug('No certificate in message when validating against fingerprint.'); return false; } else { - SimpleSAML\Logger::debug('Found '.count($certificates).' certificates in '.get_class($element)); + \SimpleSAML\Logger::debug('Found '.count($certificates).' certificates in '.get_class($element)); } $pemCert = self::findCertificate($certFingerprint, $certificates); - $pemKeys = array($pemCert); + $pemKeys = [$pemCert]; } else { - throw new SimpleSAML_Error_Exception( + throw new \SimpleSAML\Error\Exception( 'Missing certificate in metadata for '. var_export($srcMetadata->getString('entityid'), true) ); } - SimpleSAML\Logger::debug('Has '.count($pemKeys).' candidate keys for validation.'); + \SimpleSAML\Logger::debug('Has '.count($pemKeys).' candidate keys for validation.'); $lastException = null; foreach ($pemKeys as $i => $pem) { - $key = new XMLSecurityKey(XMLSecurityKey::RSA_SHA1, array('type' => 'public')); + $key = new XMLSecurityKey(XMLSecurityKey::RSA_SHA256, ['type' => 'public']); $key->loadKey($pem); try { // make sure that we have a valid signature on either the response or the assertion $res = $element->validate($key); if ($res) { - SimpleSAML\Logger::debug('Validation with key #'.$i.' succeeded.'); + \SimpleSAML\Logger::debug('Validation with key #'.$i.' succeeded.'); return true; } - SimpleSAML\Logger::debug('Validation with key #'.$i.' failed without exception.'); - } catch (Exception $e) { - SimpleSAML\Logger::debug('Validation with key #'.$i.' failed with exception: '.$e->getMessage()); + \SimpleSAML\Logger::debug('Validation with key #'.$i.' failed without exception.'); + } catch (\Exception $e) { + \SimpleSAML\Logger::debug('Validation with key #'.$i.' failed with exception: '.$e->getMessage()); $lastException = $e; } } @@ -237,15 +230,15 @@ public static function checkSign(SimpleSAML_Configuration $srcMetadata, \SAML2\S /** * Check signature on a SAML2 message if enabled. * - * @param SimpleSAML_Configuration $srcMetadata The metadata of the sender. - * @param SimpleSAML_Configuration $dstMetadata The metadata of the recipient. + * @param \SimpleSAML\Configuration $srcMetadata The metadata of the sender. + * @param \SimpleSAML\Configuration $dstMetadata The metadata of the recipient. * @param \SAML2\Message $message The message we should check the signature on. * - * @throws \SimpleSAML_Error_Exception if message validation is enabled, but there is no signature in the message. + * @throws \SimpleSAML\Error\Exception if message validation is enabled, but there is no signature in the message. */ public static function validateMessage( - SimpleSAML_Configuration $srcMetadata, - SimpleSAML_Configuration $dstMetadata, + \SimpleSAML\Configuration $srcMetadata, + \SimpleSAML\Configuration $dstMetadata, \SAML2\Message $message ) { $enabled = null; @@ -273,7 +266,7 @@ public static function validateMessage( } if (!self::checkSign($srcMetadata, $message)) { - throw new SimpleSAML_Error_Exception( + throw new \SimpleSAML\Error\Exception( 'Validation of received messages enabled, but no signature found on message.' ); } @@ -283,30 +276,30 @@ public static function validateMessage( /** * Retrieve the decryption keys from metadata. * - * @param SimpleSAML_Configuration $srcMetadata The metadata of the sender (IdP). - * @param SimpleSAML_Configuration $dstMetadata The metadata of the recipient (SP). + * @param \SimpleSAML\Configuration $srcMetadata The metadata of the sender (IdP). + * @param \SimpleSAML\Configuration $dstMetadata The metadata of the recipient (SP). * * @return array Array of decryption keys. */ public static function getDecryptionKeys( - SimpleSAML_Configuration $srcMetadata, - SimpleSAML_Configuration $dstMetadata + \SimpleSAML\Configuration $srcMetadata, + \SimpleSAML\Configuration $dstMetadata ) { $sharedKey = $srcMetadata->getString('sharedkey', null); if ($sharedKey !== null) { $key = new XMLSecurityKey(XMLSecurityKey::AES128_CBC); $key->loadKey($sharedKey); - return array($key); + return [$key]; } - $keys = array(); + $keys = []; // load the new private key if it exists - $keyArray = SimpleSAML\Utils\Crypto::loadPrivateKey($dstMetadata, false, 'new_'); + $keyArray = \SimpleSAML\Utils\Crypto::loadPrivateKey($dstMetadata, false, 'new_'); if ($keyArray !== null) { - assert('isset($keyArray["PEM"])'); + assert(isset($keyArray['PEM'])); - $key = new XMLSecurityKey(XMLSecurityKey::RSA_1_5, array('type' => 'private')); + $key = new XMLSecurityKey(XMLSecurityKey::RSA_1_5, ['type' => 'private']); if (array_key_exists('password', $keyArray)) { $key->passphrase = $keyArray['password']; } @@ -315,10 +308,10 @@ public static function getDecryptionKeys( } // find the existing private key - $keyArray = SimpleSAML\Utils\Crypto::loadPrivateKey($dstMetadata, true); - assert('isset($keyArray["PEM"])'); + $keyArray = \SimpleSAML\Utils\Crypto::loadPrivateKey($dstMetadata, true); + assert(isset($keyArray['PEM'])); - $key = new XMLSecurityKey(XMLSecurityKey::RSA_1_5, array('type' => 'private')); + $key = new XMLSecurityKey(XMLSecurityKey::RSA_1_5, ['type' => 'private']); if (array_key_exists('password', $keyArray)) { $key->passphrase = $keyArray['password']; } @@ -334,18 +327,18 @@ public static function getDecryptionKeys( * * Remote configuration overrides local configuration. * - * @param SimpleSAML_Configuration $srcMetadata The metadata of the sender. - * @param SimpleSAML_Configuration $dstMetadata The metadata of the recipient. + * @param \SimpleSAML\Configuration $srcMetadata The metadata of the sender. + * @param \SimpleSAML\Configuration $dstMetadata The metadata of the recipient. * * @return array Array of blacklisted algorithms. */ public static function getBlacklistedAlgorithms( - SimpleSAML_Configuration $srcMetadata, - SimpleSAML_Configuration $dstMetadata + \SimpleSAML\Configuration $srcMetadata, + \SimpleSAML\Configuration $dstMetadata ) { $blacklist = $srcMetadata->getArray('encryption.blacklisted-algorithms', null); if ($blacklist === null) { - $blacklist = $dstMetadata->getArray('encryption.blacklisted-algorithms', array(XMLSecurityKey::RSA_1_5)); + $blacklist = $dstMetadata->getArray('encryption.blacklisted-algorithms', [XMLSecurityKey::RSA_1_5]); } return $blacklist; } @@ -354,22 +347,22 @@ public static function getBlacklistedAlgorithms( /** * Decrypt an assertion. * - * @param SimpleSAML_Configuration $srcMetadata The metadata of the sender (IdP). - * @param SimpleSAML_Configuration $dstMetadata The metadata of the recipient (SP). + * @param \SimpleSAML\Configuration $srcMetadata The metadata of the sender (IdP). + * @param \SimpleSAML\Configuration $dstMetadata The metadata of the recipient (SP). * @param \SAML2\Assertion|\SAML2\EncryptedAssertion $assertion The assertion we are decrypting. * * @return \SAML2\Assertion The assertion. * - * @throws \SimpleSAML_Error_Exception if encryption is enabled but the assertion is not encrypted, or if we cannot + * @throws \SimpleSAML\Error\Exception if encryption is enabled but the assertion is not encrypted, or if we cannot * get the decryption keys. * @throws \Exception if decryption fails for whatever reason. */ private static function decryptAssertion( - SimpleSAML_Configuration $srcMetadata, - SimpleSAML_Configuration $dstMetadata, + \SimpleSAML\Configuration $srcMetadata, + \SimpleSAML\Configuration $dstMetadata, $assertion ) { - assert('$assertion instanceof \SAML2\Assertion || $assertion instanceof \SAML2\EncryptedAssertion'); + assert($assertion instanceof \SAML2\Assertion || $assertion instanceof \SAML2\EncryptedAssertion); if ($assertion instanceof \SAML2\Assertion) { $encryptAssertion = $srcMetadata->getBoolean('assertion.encryption', null); @@ -378,7 +371,7 @@ private static function decryptAssertion( } if ($encryptAssertion) { /* The assertion was unencrypted, but we have encryption enabled. */ - throw new Exception('Received unencrypted assertion, but encryption was enabled.'); + throw new \Exception('Received unencrypted assertion, but encryption was enabled.'); } return $assertion; @@ -386,8 +379,8 @@ private static function decryptAssertion( try { $keys = self::getDecryptionKeys($srcMetadata, $dstMetadata); - } catch (Exception $e) { - throw new SimpleSAML_Error_Exception('Error decrypting assertion: '.$e->getMessage()); + } catch (\Exception $e) { + throw new \SimpleSAML\Error\Exception('Error decrypting assertion: '.$e->getMessage()); } $blacklist = self::getBlacklistedAlgorithms($srcMetadata, $dstMetadata); @@ -396,10 +389,10 @@ private static function decryptAssertion( foreach ($keys as $i => $key) { try { $ret = $assertion->getAssertion($key, $blacklist); - SimpleSAML\Logger::debug('Decryption with key #'.$i.' succeeded.'); + \SimpleSAML\Logger::debug('Decryption with key #'.$i.' succeeded.'); return $ret; - } catch (Exception $e) { - SimpleSAML\Logger::debug('Decryption with key #'.$i.' failed with exception: '.$e->getMessage()); + } catch (\Exception $e) { + \SimpleSAML\Logger::debug('Decryption with key #'.$i.' failed with exception: '.$e->getMessage()); $lastException = $e; } } @@ -408,81 +401,118 @@ private static function decryptAssertion( /** - * Retrieve the status code of a response as a sspmod_saml_Error. + * Decrypt any encrypted attributes in an assertion. + * + * @param \SimpleSAML\Configuration $srcMetadata The metadata of the sender (IdP). + * @param \SimpleSAML\Configuration $dstMetadata The metadata of the recipient (SP). + * @param \SAML2\Assertion|\SAML2\Assertion $assertion The assertion containing any possibly encrypted attributes. + * + * @return void + * + * @throws \SimpleSAML\Error\Exception if we cannot get the decryption keys or decryption fails. + */ + private static function decryptAttributes( + \SimpleSAML\Configuration $srcMetadata, + \SimpleSAML\Configuration $dstMetadata, + \SAML2\Assertion &$assertion + ) { + if (!$assertion->hasEncryptedAttributes()) { + return; + } + + try { + $keys = self::getDecryptionKeys($srcMetadata, $dstMetadata); + } catch (\Exception $e) { + throw new \SimpleSAML\Error\Exception('Error decrypting attributes: '.$e->getMessage()); + } + + $blacklist = self::getBlacklistedAlgorithms($srcMetadata, $dstMetadata); + + $error = true; + foreach ($keys as $i => $key) { + try { + $assertion->decryptAttributes($key, $blacklist); + \SimpleSAML\Logger::debug('Attribute decryption with key #'.$i.' succeeded.'); + $error = false; + break; + } catch (\Exception $e) { + \SimpleSAML\Logger::debug('Attribute decryption failed with exception: '.$e->getMessage()); + } + } + if ($error) { + throw new \SimpleSAML\Error\Exception('Could not decrypt the attributes'); + } + } + + + /** + * Retrieve the status code of a response as a \SimpleSAML\Module\saml\Error. * * @param \SAML2\StatusResponse $response The response. * - * @return sspmod_saml_Error The error. + * @return \SimpleSAML\Module\saml\Error The error. */ public static function getResponseError(\SAML2\StatusResponse $response) { $status = $response->getStatus(); - return new sspmod_saml_Error($status['Code'], $status['SubCode'], $status['Message']); + return new \SimpleSAML\Module\saml\Error($status['Code'], $status['SubCode'], $status['Message']); } /** * Build an authentication request based on information in the metadata. * - * @param SimpleSAML_Configuration $spMetadata The metadata of the service provider. - * @param SimpleSAML_Configuration $idpMetadata The metadata of the identity provider. + * @param \SimpleSAML\Configuration $spMetadata The metadata of the service provider. + * @param \SimpleSAML\Configuration $idpMetadata The metadata of the identity provider. * @return \SAML2\AuthnRequest An authentication request object. */ public static function buildAuthnRequest( - SimpleSAML_Configuration $spMetadata, - SimpleSAML_Configuration $idpMetadata + \SimpleSAML\Configuration $spMetadata, + \SimpleSAML\Configuration $idpMetadata ) { $ar = new \SAML2\AuthnRequest(); // get the NameIDPolicy to apply. IdP metadata has precedence. - $nameIdPolicy = array(); + $nameIdPolicy = null; if ($idpMetadata->hasValue('NameIDPolicy')) { $nameIdPolicy = $idpMetadata->getValue('NameIDPolicy'); } elseif ($spMetadata->hasValue('NameIDPolicy')) { $nameIdPolicy = $spMetadata->getValue('NameIDPolicy'); } - if (!is_array($nameIdPolicy)) { - // handle old configurations where 'NameIDPolicy' was used to specify just the format - $nameIdPolicy = array('Format' => $nameIdPolicy); - } - - $nameIdPolicy_cf = SimpleSAML_Configuration::loadFromArray($nameIdPolicy); - $policy = array( - 'Format' => $nameIdPolicy_cf->getString('Format', \SAML2\Constants::NAMEID_TRANSIENT), - 'AllowCreate' => $nameIdPolicy_cf->getBoolean('AllowCreate', true), - ); - $spNameQualifier = $nameIdPolicy_cf->getString('SPNameQualifier', false); - if ($spNameQualifier !== false) { - $policy['SPNameQualifier'] = $spNameQualifier; + $policy = \SimpleSAML\Utils\Config\Metadata::parseNameIdPolicy($nameIdPolicy); + if ($policy !== null) { + // either we have a policy set, or we used the transient default + $ar->setNameIdPolicy($policy); } - $ar->setNameIdPolicy($policy); $ar->setForceAuthn($spMetadata->getBoolean('ForceAuthn', false)); $ar->setIsPassive($spMetadata->getBoolean('IsPassive', false)); - $protbind = $spMetadata->getValueValidate('ProtocolBinding', array( + $protbind = $spMetadata->getValueValidate('ProtocolBinding', [ \SAML2\Constants::BINDING_HTTP_POST, \SAML2\Constants::BINDING_HOK_SSO, \SAML2\Constants::BINDING_HTTP_ARTIFACT, \SAML2\Constants::BINDING_HTTP_REDIRECT, - ), \SAML2\Constants::BINDING_HTTP_POST); + ], \SAML2\Constants::BINDING_HTTP_POST); // Shoaib: setting the appropriate binding based on parameter in sp-metadata defaults to HTTP_POST $ar->setProtocolBinding($protbind); - $ar->setIssuer($spMetadata->getString('entityid')); + $issuer = new \SAML2\XML\saml\Issuer(); + $issuer->setValue($spMetadata->getString('entityid')); + $ar->setIssuer($issuer); $ar->setAssertionConsumerServiceIndex($spMetadata->getInteger('AssertionConsumerServiceIndex', null)); $ar->setAttributeConsumingServiceIndex($spMetadata->getInteger('AttributeConsumingServiceIndex', null)); if ($spMetadata->hasValue('AuthnContextClassRef')) { $accr = $spMetadata->getArrayizeString('AuthnContextClassRef'); - $comp = $spMetadata->getValueValidate('AuthnContextComparison', array( + $comp = $spMetadata->getValueValidate('AuthnContextComparison', [ \SAML2\Constants::COMPARISON_EXACT, \SAML2\Constants::COMPARISON_MINIMUM, \SAML2\Constants::COMPARISON_MAXIMUM, \SAML2\Constants::COMPARISON_BETTER, - ), \SAML2\Constants::COMPARISON_EXACT); - $ar->setRequestedAuthnContext(array('AuthnContextClassRef' => $accr, 'Comparison' => $comp)); + ], \SAML2\Constants::COMPARISON_EXACT); + $ar->setRequestedAuthnContext(['AuthnContextClassRef' => $accr, 'Comparison' => $comp]); } self::addRedirectSign($spMetadata, $idpMetadata, $ar); @@ -494,16 +524,19 @@ public static function buildAuthnRequest( /** * Build a logout request based on information in the metadata. * - * @param SimpleSAML_Configuration $srcMetadata The metadata of the sender. - * @param SimpleSAML_Configuration $dstMetadata The metadata of the recipient. + * @param \SimpleSAML\Configuration $srcMetadata The metadata of the sender. + * @param \SimpleSAML\Configuration $dstMetadata The metadata of the recipient. * @return \SAML2\LogoutRequest A logout request object. */ public static function buildLogoutRequest( - SimpleSAML_Configuration $srcMetadata, - SimpleSAML_Configuration $dstMetadata + \SimpleSAML\Configuration $srcMetadata, + \SimpleSAML\Configuration $dstMetadata ) { $lr = new \SAML2\LogoutRequest(); - $lr->setIssuer($srcMetadata->getString('entityid')); + $issuer = new Issuer(); + $issuer->setValue($srcMetadata->getString('entityid')); + $issuer->setFormat(Constants::NAMEID_ENTITY); + $lr->setIssuer($issuer); self::addRedirectSign($srcMetadata, $dstMetadata, $lr); @@ -514,16 +547,19 @@ public static function buildLogoutRequest( /** * Build a logout response based on information in the metadata. * - * @param SimpleSAML_Configuration $srcMetadata The metadata of the sender. - * @param SimpleSAML_Configuration $dstMetadata The metadata of the recipient. + * @param \SimpleSAML\Configuration $srcMetadata The metadata of the sender. + * @param \SimpleSAML\Configuration $dstMetadata The metadata of the recipient. * @return \SAML2\LogoutResponse A logout response object. */ public static function buildLogoutResponse( - SimpleSAML_Configuration $srcMetadata, - SimpleSAML_Configuration $dstMetadata + \SimpleSAML\Configuration $srcMetadata, + \SimpleSAML\Configuration $dstMetadata ) { $lr = new \SAML2\LogoutResponse(); - $lr->setIssuer($srcMetadata->getString('entityid')); + $issuer = new Issuer(); + $issuer->setValue($srcMetadata->getString('entityid')); + $issuer->setFormat(Constants::NAMEID_ENTITY); + $lr->setIssuer($issuer); self::addRedirectSign($srcMetadata, $dstMetadata, $lr); @@ -534,20 +570,20 @@ public static function buildLogoutResponse( /** * Process a response message. * - * If the response is an error response, we will throw a sspmod_saml_Error exception with the error. + * If the response is an error response, we will throw a \SimpleSAML\Module\saml\Error exception with the error. * - * @param SimpleSAML_Configuration $spMetadata The metadata of the service provider. - * @param SimpleSAML_Configuration $idpMetadata The metadata of the identity provider. + * @param \SimpleSAML\Configuration $spMetadata The metadata of the service provider. + * @param \SimpleSAML\Configuration $idpMetadata The metadata of the identity provider. * @param \SAML2\Response $response The response. * * @return array Array with \SAML2\Assertion objects, containing valid assertions from the response. * - * @throws \SimpleSAML_Error_Exception if there are no assertions in the response. + * @throws \SimpleSAML\Error\Exception if there are no assertions in the response. * @throws \Exception if the destination of the response does not match the current URL. */ public static function processResponse( - SimpleSAML_Configuration $spMetadata, - SimpleSAML_Configuration $idpMetadata, + \SimpleSAML\Configuration $spMetadata, + \SimpleSAML\Configuration $idpMetadata, \SAML2\Response $response ) { if (!$response->isSuccess()) { @@ -558,7 +594,7 @@ public static function processResponse( $currentURL = \SimpleSAML\Utils\HTTP::getSelfURLNoQuery(); $msgDestination = $response->getDestination(); if ($msgDestination !== null && $msgDestination !== $currentURL) { - throw new Exception('Destination in response doesn\'t match the current URL. Destination is "'. + throw new \Exception('Destination in response doesn\'t match the current URL. Destination is "'. $msgDestination.'", current URL is "'.$currentURL.'".'); } @@ -570,10 +606,10 @@ public static function processResponse( */ $assertion = $response->getAssertions(); if (empty($assertion)) { - throw new SimpleSAML_Error_Exception('No assertions found in response from IdP.'); + throw new \SimpleSAML\Error\Exception('No assertions found in response from IdP.'); } - $ret = array(); + $ret = []; foreach ($assertion as $a) { $ret[] = self::processAssertion($spMetadata, $idpMetadata, $response, $a, $responseSigned); } @@ -585,55 +621,66 @@ public static function processResponse( /** * Process an assertion in a response. * - * @param SimpleSAML_Configuration $spMetadata The metadata of the service provider. - * @param SimpleSAML_Configuration $idpMetadata The metadata of the identity provider. + * @param \SimpleSAML\Configuration $spMetadata The metadata of the service provider. + * @param \SimpleSAML\Configuration $idpMetadata The metadata of the identity provider. * @param \SAML2\Response $response The response containing the assertion. * @param \SAML2\Assertion|\SAML2\EncryptedAssertion $assertion The assertion. * @param bool $responseSigned Whether the response is signed. * * @return \SAML2\Assertion The assertion, if it is valid. * - * @throws \SimpleSAML_Error_Exception if an error occurs while trying to validate the assertion, or if a assertion + * @throws \SimpleSAML\Error\Exception if an error occurs while trying to validate the assertion, or if a assertion * is not signed and it should be, or if we are unable to decrypt the NameID due to a local failure (missing or * invalid decryption key). * @throws \Exception if we couldn't decrypt the NameID for unexpected reasons. */ private static function processAssertion( - SimpleSAML_Configuration $spMetadata, - SimpleSAML_Configuration $idpMetadata, + \SimpleSAML\Configuration $spMetadata, + \SimpleSAML\Configuration $idpMetadata, \SAML2\Response $response, $assertion, $responseSigned ) { - assert('$assertion instanceof \SAML2\Assertion || $assertion instanceof \SAML2\EncryptedAssertion'); - assert('is_bool($responseSigned)'); + assert($assertion instanceof \SAML2\Assertion || $assertion instanceof \SAML2\EncryptedAssertion); + assert(is_bool($responseSigned)); $assertion = self::decryptAssertion($idpMetadata, $spMetadata, $assertion); + self::decryptAttributes($idpMetadata, $spMetadata, $assertion); if (!self::checkSign($idpMetadata, $assertion)) { if (!$responseSigned) { - throw new SimpleSAML_Error_Exception('Neither the assertion nor the response was signed.'); + throw new \SimpleSAML\Error\Exception('Neither the assertion nor the response was signed.'); } } // at least one valid signature found $currentURL = \SimpleSAML\Utils\HTTP::getSelfURLNoQuery(); // check various properties of the assertion + $config = \SimpleSAML\Configuration::getInstance(); + $allowed_clock_skew = $config->getInteger('assertion.allowed_clock_skew', 180); + $options = [ + 'options' => [ + 'default' => 180, + 'min_range' => 180, + 'max_range' => 300, + ], + ]; + $allowed_clock_skew = filter_var($allowed_clock_skew, FILTER_VALIDATE_INT, $options); $notBefore = $assertion->getNotBefore(); - if ($notBefore !== null && $notBefore > time() + 60) { - throw new SimpleSAML_Error_Exception( + if ($notBefore !== null && $notBefore > time() + $allowed_clock_skew) { + throw new \SimpleSAML\Error\Exception( 'Received an assertion that is valid in the future. Check clock synchronization on IdP and SP.' ); } $notOnOrAfter = $assertion->getNotOnOrAfter(); - if ($notOnOrAfter !== null && $notOnOrAfter <= time() - 60) { - throw new SimpleSAML_Error_Exception( + if ($notOnOrAfter !== null && $notOnOrAfter <= time() - $allowed_clock_skew) { + throw new \SimpleSAML\Error\Exception( 'Received an assertion that has expired. Check clock synchronization on IdP and SP.' ); } $sessionNotOnOrAfter = $assertion->getSessionNotOnOrAfter(); - if ($sessionNotOnOrAfter !== null && $sessionNotOnOrAfter <= time() - 60) { - throw new SimpleSAML_Error_Exception( + if ($sessionNotOnOrAfter !== null && $sessionNotOnOrAfter <= time() - $allowed_clock_skew) { + throw new \SimpleSAML\Error\Exception( 'Received an assertion with a session that has expired. Check clock synchronization on IdP and SP.' ); } @@ -642,17 +689,18 @@ private static function processAssertion( $spEntityId = $spMetadata->getString('entityid'); if (!in_array($spEntityId, $validAudiences, true)) { $candidates = '['.implode('], [', $validAudiences).']'; - throw new SimpleSAML_Error_Exception('This SP ['.$spEntityId. + throw new \SimpleSAML\Error\Exception('This SP ['.$spEntityId. '] is not a valid audience for the assertion. Candidates were: '.$candidates); } } $found = false; $lastError = 'No SubjectConfirmation element in Subject.'; - $validSCMethods = array(\SAML2\Constants::CM_BEARER, \SAML2\Constants::CM_HOK, \SAML2\Constants::CM_VOUCHES); + $validSCMethods = [\SAML2\Constants::CM_BEARER, \SAML2\Constants::CM_HOK, \SAML2\Constants::CM_VOUCHES]; foreach ($assertion->getSubjectConfirmation() as $sc) { - if (!in_array($sc->Method, $validSCMethods, true)) { - $lastError = 'Invalid Method on SubjectConfirmation: '.var_export($sc->Method, true); + $method = $sc->getMethod(); + if (!in_array($method, $validSCMethods, true)) { + $lastError = 'Invalid Method on SubjectConfirmation: '.var_export($method, true); continue; } @@ -661,18 +709,18 @@ private static function processAssertion( if ($hok === null) { $hok = $spMetadata->getBoolean('saml20.hok.assertion', false); } - if ($sc->Method === \SAML2\Constants::CM_BEARER && $hok) { + if ($method === \SAML2\Constants::CM_BEARER && $hok) { $lastError = 'Bearer SubjectConfirmation received, but Holder-of-Key SubjectConfirmation needed'; continue; } - if ($sc->Method === \SAML2\Constants::CM_HOK && !$hok) { + if ($method === \SAML2\Constants::CM_HOK && !$hok) { $lastError = 'Holder-of-Key SubjectConfirmation received, '. 'but the Holder-of-Key profile is not enabled.'; continue; } - $scd = $sc->SubjectConfirmationData; - if ($sc->Method === \SAML2\Constants::CM_HOK) { + $scd = $sc->getSubjectConfirmationData(); + if ($method === \SAML2\Constants::CM_HOK) { // check HoK Assertion if (\SimpleSAML\Utils\HTTP::isHTTPS() === false) { $lastError = 'No HTTPS connection, but required for Holder-of-Key SSO'; @@ -691,9 +739,9 @@ private static function processAssertion( continue; } // we have a valid client certificate from the browser - $clientCert = str_replace(array("\r", "\n", " "), '', $matches[1]); + $clientCert = str_replace(["\r", "\n", " "], '', $matches[1]); - $keyInfo = array(); + $keyInfo = []; foreach ($scd->info as $thing) { if ($thing instanceof \SAML2\XML\ds\KeyInfo) { $keyInfo[] = $thing; @@ -705,7 +753,7 @@ private static function processAssertion( continue; } - $x509data = array(); + $x509data = []; foreach ($keyInfo[0]->info as $thing) { if ($thing instanceof \SAML2\XML\ds\X509Data) { $x509data[] = $thing; @@ -717,7 +765,7 @@ private static function processAssertion( continue; } - $x509cert = array(); + $x509cert = []; foreach ($x509data[0]->data as $thing) { if ($thing instanceof \SAML2\XML\ds\X509Certificate) { $x509cert[] = $thing; @@ -743,40 +791,44 @@ private static function processAssertion( continue; } - if ($scd->NotBefore && $scd->NotBefore > time() + 60) { - $lastError = 'NotBefore in SubjectConfirmationData is in the future: '.$scd->NotBefore; + $notBefore = $scd->getNotBefore(); + if ($notBefore && $notBefore > time() + 60) { + $lastError = 'NotBefore in SubjectConfirmationData is in the future: '.$notBefore; continue; } - if ($scd->NotOnOrAfter && $scd->NotOnOrAfter <= time() - 60) { - $lastError = 'NotOnOrAfter in SubjectConfirmationData is in the past: '.$scd->NotOnOrAfter; + $notOnOrAfter = $scd->getNotOnOrAfter(); + if ($notOnOrAfter && $notOnOrAfter <= time() - 60) { + $lastError = 'NotOnOrAfter in SubjectConfirmationData is in the past: '.$notOnOrAfter; continue; } - if ($scd->Recipient !== null && $scd->Recipient !== $currentURL) { + $recipient = $scd->getRecipient(); + if ($recipient !== null && $recipient !== $currentURL) { $lastError = 'Recipient in SubjectConfirmationData does not match the current URL. Recipient is '. - var_export($scd->Recipient, true).', current URL is '.var_export($currentURL, true).'.'; + var_export($recipient, true).', current URL is '.var_export($currentURL, true).'.'; continue; } - if ($scd->InResponseTo !== null && $response->getInResponseTo() !== null && - $scd->InResponseTo !== $response->getInResponseTo() + $inResponseTo = $scd->getInResponseTo(); + if ($inResponseTo !== null && $response->getInResponseTo() !== null && + $inResponseTo !== $response->getInResponseTo() ) { $lastError = 'InResponseTo in SubjectConfirmationData does not match the Response. Response has '. var_export($response->getInResponseTo(), true). - ', SubjectConfirmationData has '.var_export($scd->InResponseTo, true).'.'; + ', SubjectConfirmationData has '.var_export($inResponseTo, true).'.'; continue; } $found = true; break; } if (!$found) { - throw new SimpleSAML_Error_Exception('Error validating SubjectConfirmation in Assertion: '.$lastError); + throw new \SimpleSAML\Error\Exception('Error validating SubjectConfirmation in Assertion: '.$lastError); } // as far as we can tell, the assertion is valid // maybe we need to base64 decode the attributes in the assertion? if ($idpMetadata->getBoolean('base64attributes', false)) { $attributes = $assertion->getAttributes(); - $newAttributes = array(); + $newAttributes = []; foreach ($attributes as $name => $values) { - $newAttributes[$name] = array(); + $newAttributes[$name] = []; foreach ($values as $value) { foreach (explode('_', $value) as $v) { $newAttributes[$name][] = base64_decode($v); @@ -790,8 +842,8 @@ private static function processAssertion( if ($assertion->isNameIdEncrypted()) { try { $keys = self::getDecryptionKeys($idpMetadata, $spMetadata); - } catch (Exception $e) { - throw new SimpleSAML_Error_Exception('Error decrypting NameID: '.$e->getMessage()); + } catch (\Exception $e) { + throw new \SimpleSAML\Error\Exception('Error decrypting NameID: '.$e->getMessage()); } $blacklist = self::getBlacklistedAlgorithms($idpMetadata, $spMetadata); @@ -800,11 +852,11 @@ private static function processAssertion( foreach ($keys as $i => $key) { try { $assertion->decryptNameId($key, $blacklist); - SimpleSAML\Logger::debug('Decryption with key #'.$i.' succeeded.'); + \SimpleSAML\Logger::debug('Decryption with key #'.$i.' succeeded.'); $lastException = null; break; - } catch (Exception $e) { - SimpleSAML\Logger::debug('Decryption with key #'.$i.' failed with exception: '.$e->getMessage()); + } catch (\Exception $e) { + \SimpleSAML\Logger::debug('Decryption with key #'.$i.' failed with exception: '.$e->getMessage()); $lastException = $e; } } @@ -820,13 +872,13 @@ private static function processAssertion( /** * Retrieve the encryption key for the given entity. * - * @param SimpleSAML_Configuration $metadata The metadata of the entity. + * @param \SimpleSAML\Configuration $metadata The metadata of the entity. * * @return \RobRichards\XMLSecLibs\XMLSecurityKey The encryption key. * - * @throws \SimpleSAML_Error_Exception if there is no supported encryption key in the metadata of this entity. + * @throws \SimpleSAML\Error\Exception if there is no supported encryption key in the metadata of this entity. */ - public static function getEncryptionKey(SimpleSAML_Configuration $metadata) + public static function getEncryptionKey(\SimpleSAML\Configuration $metadata) { $sharedKey = $metadata->getString('sharedkey', null); @@ -843,13 +895,13 @@ public static function getEncryptionKey(SimpleSAML_Configuration $metadata) $pemKey = "-----BEGIN CERTIFICATE-----\n". chunk_split($key['X509Certificate'], 64). "-----END CERTIFICATE-----\n"; - $key = new XMLSecurityKey(XMLSecurityKey::RSA_OAEP_MGF1P, array('type' => 'public')); + $key = new XMLSecurityKey(XMLSecurityKey::RSA_OAEP_MGF1P, ['type' => 'public']); $key->loadKey($pemKey); return $key; } } - throw new SimpleSAML_Error_Exception('No supported encryption key in '. + throw new \SimpleSAML\Error\Exception('No supported encryption key in '. var_export($metadata->getString('entityid'), true)); } } diff --git a/vendor/simplesamlphp/simplesamlphp/modules/saml/lib/SP/LogoutStore.php b/vendor/simplesamlphp/simplesamlphp/modules/saml/lib/SP/LogoutStore.php index f04447b313..6142654ac0 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/saml/lib/SP/LogoutStore.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/saml/lib/SP/LogoutStore.php @@ -1,300 +1,442 @@ <?php +namespace SimpleSAML\Module\saml\SP; + +use PDO; +use SAML2\XML\saml\NameID; +use SimpleSAML\Logger; +use SimpleSAML\Session; +use SimpleSAML\Store; +use SimpleSAML\Utils; + /** * A directory over logout information. * * @package SimpleSAMLphp */ -class sspmod_saml_SP_LogoutStore { - - /** - * Create logout table in SQL, if it is missing. - * - * @param \SimpleSAML\Store\SQL $store The datastore. - */ - private static function createLogoutTable(\SimpleSAML\Store\SQL $store) { - - $tableVer = $store->getTableVersion('saml_LogoutStore'); - if ($tableVer === 2) { - return; - } elseif ($tableVer === 1) { - /* TableVersion 2 increased the column size to 255 which is the maximum length of a FQDN. */ - $query = 'ALTER TABLE ' . $store->prefix . '_saml_LogoutStore MODIFY _authSource VARCHAR(255) NOT NULL'; - try { - $ret = $store->pdo->exec($query); - } catch (Exception $e) { - SimpleSAML\Logger::warning($store->pdo->errorInfo()); - return; - } - $store->setTableVersion('saml_LogoutStore', 2); - return; - } - - $query = 'CREATE TABLE ' . $store->prefix . '_saml_LogoutStore ( - _authSource VARCHAR(255) NOT NULL, - _nameId VARCHAR(40) NOT NULL, - _sessionIndex VARCHAR(50) NOT NULL, - _expire TIMESTAMP NOT NULL, - _sessionId VARCHAR(50) NOT NULL, - UNIQUE (_authSource, _nameID, _sessionIndex) - )'; - $store->pdo->exec($query); - - $query = 'CREATE INDEX ' . $store->prefix . '_saml_LogoutStore_expire ON ' . $store->prefix . '_saml_LogoutStore (_expire)'; - $store->pdo->exec($query); - - $query = 'CREATE INDEX ' . $store->prefix . '_saml_LogoutStore_nameId ON ' . $store->prefix . '_saml_LogoutStore (_authSource, _nameId)'; - $store->pdo->exec($query); - - $store->setTableVersion('saml_LogoutStore', 2); - } - - - /** - * Clean the logout table of expired entries. - * - * @param \SimpleSAML\Store\SQL $store The datastore. - */ - private static function cleanLogoutStore(\SimpleSAML\Store\SQL $store) { - - SimpleSAML\Logger::debug('saml.LogoutStore: Cleaning logout store.'); - - $query = 'DELETE FROM ' . $store->prefix . '_saml_LogoutStore WHERE _expire < :now'; - $params = array('now' => gmdate('Y-m-d H:i:s')); - - $query = $store->pdo->prepare($query); - $query->execute($params); - } - - - /** - * Register a session in the SQL datastore. - * - * @param \SimpleSAML\Store\SQL $store The datastore. - * @param string $authId The authsource ID. - * @param string $nameId The hash of the users NameID. - * @param string $sessionIndex The SessionIndex of the user. - */ - private static function addSessionSQL(\SimpleSAML\Store\SQL $store, $authId, $nameId, $sessionIndex, $expire, $sessionId) { - assert('is_string($authId)'); - assert('is_string($nameId)'); - assert('is_string($sessionIndex)'); - assert('is_string($sessionId)'); - assert('is_int($expire)'); - - self::createLogoutTable($store); - - if (rand(0, 1000) < 10) { - self::cleanLogoutStore($store); - } - - $data = array( - '_authSource' => $authId, - '_nameId' => $nameId, - '_sessionIndex' => $sessionIndex, - '_expire' => gmdate('Y-m-d H:i:s', $expire), - '_sessionId' => $sessionId, - ); - $store->insertOrUpdate($store->prefix . '_saml_LogoutStore', array('_authSource', '_nameId', '_sessionIndex'), $data); - } - - - /** - * Retrieve sessions from the SQL datastore. - * - * @param \SimpleSAML\Store\SQL $store The datastore. - * @param string $authId The authsource ID. - * @param string $nameId The hash of the users NameID. - * @return array Associative array of SessionIndex => SessionId. - */ - private static function getSessionsSQL(\SimpleSAML\Store\SQL $store, $authId, $nameId) { - assert('is_string($authId)'); - assert('is_string($nameId)'); - - self::createLogoutTable($store); - - $params = array( - '_authSource' => $authId, - '_nameId' => $nameId, - 'now' => gmdate('Y-m-d H:i:s'), - ); - - // We request the columns in lowercase in order to be compatible with PostgreSQL - $query = 'SELECT _sessionIndex AS _sessionindex, _sessionId AS _sessionid FROM ' . $store->prefix . '_saml_LogoutStore' . - ' WHERE _authSource = :_authSource AND _nameId = :_nameId AND _expire >= :now'; - $query = $store->pdo->prepare($query); - $query->execute($params); - - $res = array(); - while ( ($row = $query->fetch(PDO::FETCH_ASSOC)) !== FALSE) { - $res[$row['_sessionindex']] = $row['_sessionid']; - } - - return $res; - } - - - /** - * Retrieve all session IDs from a key-value store. - * - * @param \SimpleSAML\Store $store The datastore. - * @param string $authId The authsource ID. - * @param string $nameId The hash of the users NameID. - * @param array $sessionIndexes The session indexes. - * @return array Associative array of SessionIndex => SessionId. - */ - private static function getSessionsStore(\SimpleSAML\Store $store, $authId, $nameId, array $sessionIndexes) { - assert('is_string($authId)'); - assert('is_string($nameId)'); - - $res = array(); - foreach ($sessionIndexes as $sessionIndex) { - $sessionId = $store->get('saml.LogoutStore', $nameId . ':' . $sessionIndex); - if ($sessionId === NULL) { - continue; - } - assert('is_string($sessionId)'); - $res[$sessionIndex] = $sessionId; - } - - return $res; - } - - - /** - * Register a new session in the datastore. - * - * Please observe the change of the signature in this method. Previously, the second parameter ($nameId) was forced - * to be an array. However, it has no type restriction now, and the documentation states it must be a - * \SAML2\XML\saml\NameID object. Currently, this function still accepts an array passed as $nameId, and will - * silently convert it to a \SAML2\XML\saml\NameID object. This is done to keep backwards-compatibility, though will - * no longer be possible in the future as the $nameId parameter will be required to be an object. - * - * @param string $authId The authsource ID. - * @param \SAML2\XML\saml\NameID $nameId The NameID of the user. - * @param string|NULL $sessionIndex The SessionIndex of the user. - */ - public static function addSession($authId, $nameId, $sessionIndex, $expire) { - assert('is_string($authId)'); - assert('is_string($sessionIndex) || is_null($sessionIndex)'); - assert('is_int($expire)'); - - if ($sessionIndex === NULL) { - /* This IdP apparently did not include a SessionIndex, and thus probably does not - * support SLO. We still want to add the session to the data store just in case - * it supports SLO, but we don't want an LogoutRequest with a specific - * SessionIndex to match this session. We therefore generate our own session index. - */ - $sessionIndex = SimpleSAML\Utils\Random::generateID(); - } - - $store = \SimpleSAML\Store::getInstance(); - if ($store === FALSE) { - // We don't have a datastore. - return; - } - - // serialize and anonymize the NameID - // TODO: remove this conditional statement - if (is_array($nameId)) { - $nameId = \SAML2\XML\saml\NameID::fromArray($nameId); - } - $strNameId = serialize($nameId); - $strNameId = sha1($strNameId); - - /* Normalize SessionIndex. */ - if (strlen($sessionIndex) > 50) { - $sessionIndex = sha1($sessionIndex); - } - - $session = SimpleSAML_Session::getSessionFromRequest(); - $sessionId = $session->getSessionId(); - - if ($store instanceof \SimpleSAML\Store\SQL) { - self::addSessionSQL($store, $authId, $strNameId, $sessionIndex, $expire, $sessionId); - } else { - $store->set('saml.LogoutStore', $strNameId . ':' . $sessionIndex, $sessionId, $expire); - } - } - - - /** - * Log out of the given sessions. - * - * @param string $authId The authsource ID. - * @param \SAML2\XML\saml\NameID $nameId The NameID of the user. - * @param array $sessionIndexes The SessionIndexes we should log out of. Logs out of all if this is empty. - * @returns int|FALSE Number of sessions logged out, or FALSE if not supported. - */ - public static function logoutSessions($authId, $nameId, array $sessionIndexes) { - assert('is_string($authId)'); - - $store = \SimpleSAML\Store::getInstance(); - if ($store === FALSE) { - /* We don't have a datastore. */ - return FALSE; - } - - // serialize and anonymize the NameID - // TODO: remove this conditional statement - if (is_array($nameId)) { - $nameId = \SAML2\XML\saml\NameID::fromArray($nameId); - } - $strNameId = serialize($nameId); - $strNameId = sha1($strNameId); - - /* Normalize SessionIndexes. */ - foreach ($sessionIndexes as &$sessionIndex) { - assert('is_string($sessionIndex)'); - if (strlen($sessionIndex) > 50) { - $sessionIndex = sha1($sessionIndex); - } - } - unset($sessionIndex); // Remove reference - - if ($store instanceof \SimpleSAML\Store\SQL) { - $sessions = self::getSessionsSQL($store, $authId, $strNameId); - } elseif (empty($sessionIndexes)) { - /* We cannot fetch all sessions without a SQL store. */ - return FALSE; - } else { - /** @var \SimpleSAML\Store $sessions At this point the store cannot be false */ - $sessions = self::getSessionsStore($store, $authId, $strNameId, $sessionIndexes); - - } - - if (empty($sessionIndexes)) { - $sessionIndexes = array_keys($sessions); - } - - $sessionHandler = \SimpleSAML\SessionHandler::getSessionHandler(); - - $numLoggedOut = 0; - foreach ($sessionIndexes as $sessionIndex) { - if (!isset($sessions[$sessionIndex])) { - SimpleSAML\Logger::info('saml.LogoutStore: Logout requested for unknown SessionIndex.'); - continue; - } - - $sessionId = $sessions[$sessionIndex]; - - $session = SimpleSAML_Session::getSession($sessionId); - if ($session === NULL) { - SimpleSAML\Logger::info('saml.LogoutStore: Skipping logout of missing session.'); - continue; - } - - if (!$session->isValid($authId)) { - SimpleSAML\Logger::info('saml.LogoutStore: Skipping logout of session because it isn\'t authenticated.'); - continue; - } - - SimpleSAML\Logger::info('saml.LogoutStore: Logging out of session with trackId [' . $session->getTrackID() . '].'); - $session->doLogout($authId); - $numLoggedOut += 1; - } - - return $numLoggedOut; - } +class LogoutStore +{ + /** + * Create logout table in SQL, if it is missing. + * + * @param \SimpleSAML\Store\SQL $store The datastore. + * @return void + */ + private static function createLogoutTable(Store\SQL $store) + { + $tableVer = $store->getTableVersion('saml_LogoutStore'); + if ($tableVer === 4) { + return; + } elseif ($tableVer === 3) { + /** + * Table version 4 fixes the column type for the _expire column. + * We now use DATETIME instead of TIMESTAMP to support MSSQL. + */ + switch ($store->driver) { + case 'pgsql': + // This does not affect the NOT NULL constraint + $update = ['ALTER TABLE '.$store->prefix. + '_saml_LogoutStore ALTER COLUMN _expire DATETIME']; + break; + case 'sqlite': + /** + * Because SQLite does not support field alterations, the approach is to: + * Create a new table without the proper column size + * Copy the current data to the new table + * Drop the old table + * Rename the new table correctly + * Read the index + */ + $update = [ + 'CREATE TABLE '.$store->prefix.'_saml_LogoutStore_new (_authSource VARCHAR(255) NOT NULL,'. + '_nameId VARCHAR(40) NOT NULL, _sessionIndex VARCHAR(50) NOT NULL, _expire DATETIME NOT NULL,'. + '_sessionId VARCHAR(50) NOT NULL, UNIQUE (_authSource, _nameID, _sessionIndex))', + 'INSERT INTO '.$store->prefix.'_saml_LogoutStore_new SELECT * FROM '.$store->prefix.'_saml_LogoutStore', + 'DROP TABLE '.$store->prefix.'_saml_LogoutStore', + 'ALTER TABLE '.$store->prefix.'_saml_LogoutStore_new RENAME TO '.$store->prefix.'_saml_LogoutStore', + 'CREATE INDEX '.$store->prefix.'_saml_LogoutStore_expire ON '.$store->prefix.'_saml_LogoutStore (_expire)', + 'CREATE INDEX '.$store->prefix.'_saml_LogoutStore_nameId ON '.$store->prefix.'_saml_LogoutStore (_authSource, _nameId)' + ]; + break; + default: + $update = ['ALTER TABLE '.$store->prefix. + '_saml_LogoutStore MODIFY _expire DATETIME NOT NULL']; + break; + } + + try { + foreach ($update as $query) { + $store->pdo->exec($query); + } + } catch (\Exception $e) { + Logger::warning('Database error: '.var_export($store->pdo->errorInfo(), true)); + return; + } + $store->setTableVersion('saml_LogoutStore', 4); + return; + + } elseif ($tableVer === 2) { + // TableVersion 3 fixes the indexes that were set to 255 in version 2; they cannot be larger than 191 on MySQL + + if ($store->driver === 'mysql') { + // Drop old indexes + $query = 'ALTER TABLE '.$store->prefix.'_saml_LogoutStore DROP INDEX '.$store->prefix.'_saml_LogoutStore_nameId'; + $store->pdo->exec($query); + $query = 'ALTER TABLE '.$store->prefix.'_saml_LogoutStore DROP INDEX _authSource'; + $store->pdo->exec($query); + + // Create new indexes + $query = 'CREATE INDEX '.$store->prefix.'_saml_LogoutStore_nameId ON '; + $query .= $store->prefix.'_saml_LogoutStore (_authSource(191), _nameId)'; + $store->pdo->exec($query); + + $query = 'ALTER TABLE '.$store->prefix.'_saml_LogoutStore ADD UNIQUE KEY (_authSource(191), _nameID, _sessionIndex)'; + $store->pdo->exec($query); + } + + $store->setTableVersion('saml_LogoutStore', 3); + return; + } elseif ($tableVer === 1) { + // TableVersion 2 increased the column size to 255 (191 for mysql) which is the maximum length of a FQDN + switch ($store->driver) { + case 'pgsql': + // This does not affect the NOT NULL constraint + $update = ['ALTER TABLE '.$store->prefix. + '_saml_LogoutStore ALTER COLUMN _authSource TYPE VARCHAR(255)']; + break; + case 'sqlite': + /** + * Because SQLite does not support field alterations, the approach is to: + * Create a new table without the proper column size + * Copy the current data to the new table + * Drop the old table + * Rename the new table correctly + * Read the index + */ + $update = [ + 'CREATE TABLE '.$store->prefix.'_saml_LogoutStore_new (_authSource VARCHAR(255) NOT NULL,'. + '_nameId VARCHAR(40) NOT NULL, _sessionIndex VARCHAR(50) NOT NULL, _expire TIMESTAMP NOT NULL,'. + '_sessionId VARCHAR(50) NOT NULL, UNIQUE (_authSource, _nameID, _sessionIndex))', + 'INSERT INTO '.$store->prefix.'_saml_LogoutStore_new SELECT * FROM '.$store->prefix.'_saml_LogoutStore', + 'DROP TABLE '.$store->prefix.'_saml_LogoutStore', + 'ALTER TABLE '.$store->prefix.'_saml_LogoutStore_new RENAME TO '.$store->prefix.'_saml_LogoutStore', + 'CREATE INDEX '.$store->prefix.'_saml_LogoutStore_expire ON '.$store->prefix.'_saml_LogoutStore (_expire)', + 'CREATE INDEX '.$store->prefix.'_saml_LogoutStore_nameId ON '.$store->prefix.'_saml_LogoutStore (_authSource, _nameId)' + ]; + break; + case 'mysql': + $update = ['ALTER TABLE '.$store->prefix. + '_saml_LogoutStore MODIFY _authSource VARCHAR(191) NOT NULL']; + break; + default: + $update = ['ALTER TABLE '.$store->prefix. + '_saml_LogoutStore MODIFY _authSource VARCHAR(255) NOT NULL']; + break; + } + + try { + foreach ($update as $query) { + $store->pdo->exec($query); + } + } catch (\Exception $e) { + Logger::warning('Database error: '.var_export($store->pdo->errorInfo(), true)); + return; + } + $store->setTableVersion('saml_LogoutStore', 2); + return; + } + + $query = 'CREATE TABLE '.$store->prefix.'_saml_LogoutStore ( + _authSource VARCHAR('.($store->driver === 'mysql' ? '191' : '255').') NOT NULL, + _nameId VARCHAR(40) NOT NULL, + _sessionIndex VARCHAR(50) NOT NULL, + _expire DATETIME NOT NULL, + _sessionId VARCHAR(50) NOT NULL, + UNIQUE (_authSource'.($store->driver === 'mysql' ? '(191)' : '').', _nameID, _sessionIndex) + )'; + $store->pdo->exec($query); + + $query = 'CREATE INDEX '.$store->prefix.'_saml_LogoutStore_expire ON '; + $query .= $store->prefix.'_saml_LogoutStore (_expire)'; + $store->pdo->exec($query); + + $query = 'CREATE INDEX '.$store->prefix.'_saml_LogoutStore_nameId ON '; + $query .= $store->prefix.'_saml_LogoutStore (_authSource'.($store->driver === 'mysql' ? '(191)' : '').', _nameId)'; + $store->pdo->exec($query); + + $store->setTableVersion('saml_LogoutStore', 4); + } + + + /** + * Clean the logout table of expired entries. + * + * @param \SimpleSAML\Store\SQL $store The datastore. + * @return void + */ + private static function cleanLogoutStore(Store\SQL $store) + { + Logger::debug('saml.LogoutStore: Cleaning logout store.'); + + $query = 'DELETE FROM '.$store->prefix.'_saml_LogoutStore WHERE _expire < :now'; + $params = ['now' => gmdate('Y-m-d H:i:s')]; + + $query = $store->pdo->prepare($query); + $query->execute($params); + } + + + /** + * Register a session in the SQL datastore. + * + * @param \SimpleSAML\Store\SQL $store The datastore. + * @param string $authId The authsource ID. + * @param string $nameId The hash of the users NameID. + * @param string $sessionIndex The SessionIndex of the user. + * @param int $expire + * @param string $sessionId + * @return void + */ + private static function addSessionSQL( + Store\SQL $store, + $authId, + $nameId, + $sessionIndex, + $expire, + $sessionId + ) { + assert(is_string($authId)); + assert(is_string($nameId)); + assert(is_string($sessionIndex)); + assert(is_int($expire)); + assert(is_string($sessionId)); + + self::createLogoutTable($store); + + if (rand(0, 1000) < 10) { + self::cleanLogoutStore($store); + } + + $data = [ + '_authSource' => $authId, + '_nameId' => $nameId, + '_sessionIndex' => $sessionIndex, + '_expire' => gmdate('Y-m-d H:i:s', $expire), + '_sessionId' => $sessionId, + ]; + $store->insertOrUpdate( + $store->prefix.'_saml_LogoutStore', + ['_authSource', '_nameId', '_sessionIndex'], + $data + ); + } + + + /** + * Retrieve sessions from the SQL datastore. + * + * @param \SimpleSAML\Store\SQL $store The datastore. + * @param string $authId The authsource ID. + * @param string $nameId The hash of the users NameID. + * @return array Associative array of SessionIndex => SessionId. + */ + private static function getSessionsSQL(Store\SQL $store, $authId, $nameId) + { + assert(is_string($authId)); + assert(is_string($nameId)); + + self::createLogoutTable($store); + + $params = [ + '_authSource' => $authId, + '_nameId' => $nameId, + 'now' => gmdate('Y-m-d H:i:s'), + ]; + + // We request the columns in lowercase in order to be compatible with PostgreSQL + $query = 'SELECT _sessionIndex AS _sessionindex, _sessionId AS _sessionid FROM '.$store->prefix; + $query .= '_saml_LogoutStore'.' WHERE _authSource = :_authSource AND _nameId = :_nameId AND _expire >= :now'; + $query = $store->pdo->prepare($query); + $query->execute($params); + + $res = []; + while (($row = $query->fetch(PDO::FETCH_ASSOC)) !== false) { + $res[$row['_sessionindex']] = $row['_sessionid']; + } + + return $res; + } + + + /** + * Retrieve all session IDs from a key-value store. + * + * @param \SimpleSAML\Store $store The datastore. + * @param string $authId The authsource ID. + * @param string $nameId The hash of the users NameID. + * @param array $sessionIndexes The session indexes. + * @return array Associative array of SessionIndex => SessionId. + */ + private static function getSessionsStore(Store $store, $authId, $nameId, array $sessionIndexes) + { + assert(is_string($authId)); + assert(is_string($nameId)); + + $res = []; + foreach ($sessionIndexes as $sessionIndex) { + $sessionId = $store->get('saml.LogoutStore', $nameId.':'.$sessionIndex); + if ($sessionId === null) { + continue; + } + assert(is_string($sessionId)); + $res[$sessionIndex] = $sessionId; + } + + return $res; + } + + + /** + * Register a new session in the datastore. + * + * Please observe the change of the signature in this method. Previously, the second parameter ($nameId) was forced + * to be an array. However, it has no type restriction now, and the documentation states it must be a + * \SAML2\XML\saml\NameID object. Currently, this function still accepts an array passed as $nameId, and will + * silently convert it to a \SAML2\XML\saml\NameID object. This is done to keep backwards-compatibility, though will + * no longer be possible in the future as the $nameId parameter will be required to be an object. + * + * @param string $authId The authsource ID. + * @param \SAML2\XML\saml\NameID $nameId The NameID of the user. + * @param string|null $sessionIndex The SessionIndex of the user. + * @param int $expire + * @return void + */ + public static function addSession($authId, $nameId, $sessionIndex, $expire) + { + assert(is_string($authId)); + assert(is_string($sessionIndex) || $sessionIndex === null); + assert(is_int($expire)); + + if ($sessionIndex === null) { + /* This IdP apparently did not include a SessionIndex, and thus probably does not + * support SLO. We still want to add the session to the data store just in case + * it supports SLO, but we don't want an LogoutRequest with a specific + * SessionIndex to match this session. We therefore generate our own session index. + */ + $sessionIndex = Utils\Random::generateID(); + } + + $store = Store::getInstance(); + if ($store === false) { + // We don't have a datastore. + return; + } + + // serialize and anonymize the NameID + // TODO: remove this conditional statement + if (is_array($nameId)) { + $nameId = NameID::fromArray($nameId); + } + $strNameId = serialize($nameId); + $strNameId = sha1($strNameId); + + // Normalize SessionIndex + if (strlen($sessionIndex) > 50) { + $sessionIndex = sha1($sessionIndex); + } + + $session = Session::getSessionFromRequest(); + $sessionId = $session->getSessionId(); + + if ($store instanceof Store\SQL) { + self::addSessionSQL($store, $authId, $strNameId, $sessionIndex, $expire, $sessionId); + } else { + $store->set('saml.LogoutStore', $strNameId.':'.$sessionIndex, $sessionId, $expire); + } + } + + + /** + * Log out of the given sessions. + * + * @param string $authId The authsource ID. + * @param \SAML2\XML\saml\NameID $nameId The NameID of the user. + * @param array $sessionIndexes The SessionIndexes we should log out of. Logs out of all if this is empty. + * @return int|false Number of sessions logged out, or FALSE if not supported. + */ + public static function logoutSessions($authId, $nameId, array $sessionIndexes) + { + assert(is_string($authId)); + + $store = Store::getInstance(); + if ($store === false) { + // We don't have a datastore + return false; + } + + // serialize and anonymize the NameID + // TODO: remove this conditional statement + if (is_array($nameId)) { + $nameId = NameID::fromArray($nameId); + } + $strNameId = serialize($nameId); + $strNameId = sha1($strNameId); + + // Normalize SessionIndexes + foreach ($sessionIndexes as &$sessionIndex) { + assert(is_string($sessionIndex)); + if (strlen($sessionIndex) > 50) { + $sessionIndex = sha1($sessionIndex); + } + } + + // Remove reference + unset($sessionIndex); + + if ($store instanceof Store\SQL) { + $sessions = self::getSessionsSQL($store, $authId, $strNameId); + } elseif (empty($sessionIndexes)) { + // We cannot fetch all sessions without a SQL store + return false; + } else { + /** @var array $sessions At this point the store cannot be false */ + $sessions = self::getSessionsStore($store, $authId, $strNameId, $sessionIndexes); + } + + if (empty($sessionIndexes)) { + $sessionIndexes = array_keys($sessions); + } + + $numLoggedOut = 0; + foreach ($sessionIndexes as $sessionIndex) { + if (!isset($sessions[$sessionIndex])) { + Logger::info('saml.LogoutStore: Logout requested for unknown SessionIndex.'); + continue; + } + + $sessionId = $sessions[$sessionIndex]; + + $session = Session::getSession($sessionId); + if ($session === null) { + Logger::info('saml.LogoutStore: Skipping logout of missing session.'); + continue; + } + + if (!$session->isValid($authId)) { + Logger::info( + 'saml.LogoutStore: Skipping logout of session because it isn\'t authenticated.' + ); + continue; + } + + Logger::info( + 'saml.LogoutStore: Logging out of session with trackId ['.$session->getTrackID().'].' + ); + $session->doLogout($authId); + $numLoggedOut += 1; + } + + return $numLoggedOut; + } } diff --git a/vendor/simplesamlphp/simplesamlphp/modules/saml/locales/xh/LC_MESSAGES/saml.po b/vendor/simplesamlphp/simplesamlphp/modules/saml/locales/xh/LC_MESSAGES/saml.po new file mode 100644 index 0000000000..9d730336da --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/modules/saml/locales/xh/LC_MESSAGES/saml.po @@ -0,0 +1,25 @@ + +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: SimpleSAMLphp 1.15\n" +"Report-Msgid-Bugs-To: simplesamlphp-translation@googlegroups.com\n" +"POT-Creation-Date: 2018-11-15 14:48+0200\n" +"PO-Revision-Date: 2018-11-15 14:48+0200\n" +"Last-Translator: \n" +"Language-Team: \n" +"Plural-Forms: nplurals=2; plural=(n != 1)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 1.3\n" + +msgid "{saml:proxy:invalid_idp}" +msgstr "Isiboneleli Sesazisi Esingasebenziyo" + +msgid "{saml:proxy:invalid_idp_description}" +msgstr "" +"Sele unayo iseshoni esebenzayo nomboneleli wesazisi (<em>%IDP%</em>) " +"engamkelwanga yi-<em>%SP%</em>. Ingaba ungathanda ukuphuma kwiseshoni " +"yakho esele ikho uze ungene kwakhona ngomnye umboneleli wesazisi?" + diff --git a/vendor/simplesamlphp/simplesamlphp/modules/saml/locales/zu/LC_MESSAGES/saml.po b/vendor/simplesamlphp/simplesamlphp/modules/saml/locales/zu/LC_MESSAGES/saml.po new file mode 100644 index 0000000000..9265c08238 --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/modules/saml/locales/zu/LC_MESSAGES/saml.po @@ -0,0 +1,25 @@ + +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: SimpleSAMLphp 1.15\n" +"Report-Msgid-Bugs-To: simplesamlphp-translation@googlegroups.com\n" +"POT-Creation-Date: 2018-11-15 14:48+0200\n" +"PO-Revision-Date: 2018-11-15 14:48+0200\n" +"Last-Translator: \n" +"Language-Team: \n" +"Plural-Forms: nplurals=2; plural=(n != 1)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 1.3\n" + +msgid "{saml:proxy:invalid_idp}" +msgstr "Umhlinzeki Kamazisi Ongalungile" + +msgid "{saml:proxy:invalid_idp_description}" +msgstr "" +"Kakade uneseshini evumelekile nomhlinzeki kamazisi (<em>%IDP%</em>) " +"engamukelwa okuthi <em>%SP%</em>. Ungathanda ukuphuma kuseshini yakho " +"ekhona kakade futhi uphinde ungene ngomunye umhlinzeki kamazisi?" + diff --git a/vendor/simplesamlphp/simplesamlphp/modules/saml/templates/proxy/invalid_session.php b/vendor/simplesamlphp/simplesamlphp/modules/saml/templates/proxy/invalid_session.php index 1131379988..ede358580d 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/saml/templates/proxy/invalid_session.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/saml/templates/proxy/invalid_session.php @@ -2,7 +2,7 @@ /** * Template to ask a user whether to logout because of a reauthentication or not. * - * @var SimpleSAML_XHTML_Template $this + * @var \SimpleSAML\XHTML\Template $this * * @author Jaime Pérez Crespo, UNINETT AS <jaime.perez@uninett.no> * @@ -16,10 +16,10 @@ $translator = $this->getTranslator(); -$params = array( +$params = [ '%IDP%' => $this->data['idp_name'], '%SP%' => $this->data['sp_name'], -); +]; ?> <h2><?php echo $translator->t('{saml:proxy:invalid_idp}'); ?></h2> <p><?php echo $translator->t('{saml:proxy:invalid_idp_description}', $params); ?></p> diff --git a/vendor/simplesamlphp/simplesamlphp/modules/saml/templates/proxy/invalid_session.twig b/vendor/simplesamlphp/simplesamlphp/modules/saml/templates/proxy/invalid_session.twig new file mode 100644 index 0000000000..c970efabfa --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/modules/saml/templates/proxy/invalid_session.twig @@ -0,0 +1,12 @@ +{% set pagetitle = 'SimpleSAMLphp'|trans %} +{% extends "base.twig" %} + +{% block content %} + <h2>{{ '{saml:proxy:invalid_idp}'|trans }}</h2> + <p>{{ '{saml:proxy:invalid_idp_description}'|trans({"%IDP%": idp_name, "%SP%": sp_name}, "app")|raw</p> + <form method="post" action="?"> + <input type="hidden" name="AuthState" value="{{ AuthState|escape('html') }}" /> + <input type="submit" name="continue" value="{{ '{general:yes_continue}'|trans }}" /> + <input type="submit" name="cancel" value="{{ '{general:no_cancel}'|trans }}" /> + </form> +{% endblock %} diff --git a/vendor/simplesamlphp/simplesamlphp/modules/saml/templates/sp/wrong_authncontextclassref.twig b/vendor/simplesamlphp/simplesamlphp/modules/saml/templates/sp/wrong_authncontextclassref.twig new file mode 100644 index 0000000000..5a5012c874 --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/modules/saml/templates/sp/wrong_authncontextclassref.twig @@ -0,0 +1,7 @@ +{% set pagetitle = 'SimpleSAMLphp'|trans %} +{% extends "base.twig" %} + +{% block content %} + <h2>{{ '{saml:wrong_authncontextclassref:header}'|trans|escape('html') }}</h2> + <p>{{ '{saml:wrong_authncontextclassref:description}'|trans|escape('html') }}</p> +{% endblock %} diff --git a/vendor/simplesamlphp/simplesamlphp/modules/saml/www/disco.php b/vendor/simplesamlphp/simplesamlphp/modules/saml/www/disco.php index 1f3bac0857..b7d06c4545 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/saml/www/disco.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/saml/www/disco.php @@ -4,5 +4,5 @@ * Built-in IdP discovery service. */ -$discoHandler = new SimpleSAML_XHTML_IdPDisco(array('saml20-idp-remote', 'shib13-idp-remote'), 'saml'); +$discoHandler = new \SimpleSAML\XHTML\IdPDisco(['saml20-idp-remote', 'shib13-idp-remote'], 'saml'); $discoHandler->handleRequest(); diff --git a/vendor/simplesamlphp/simplesamlphp/modules/saml/www/idp/certs.php b/vendor/simplesamlphp/simplesamlphp/modules/saml/www/idp/certs.php index a289d96a2c..7a2597519a 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/saml/www/idp/certs.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/saml/www/idp/certs.php @@ -1,32 +1,33 @@ <?php // Load SimpleSAMLphp, configuration and metadata -$config = SimpleSAML_Configuration::getInstance(); -$metadata = SimpleSAML_Metadata_MetaDataStorageHandler::getMetadataHandler(); +$config = \SimpleSAML\Configuration::getInstance(); +$metadata = \SimpleSAML\Metadata\MetaDataStorageHandler::getMetadataHandler(); -if (!$config->getBoolean('enable.saml20-idp', false)) - throw new SimpleSAML_Error_Error('NOACCESS'); +if (!$config->getBoolean('enable.saml20-idp', false)) { + throw new \SimpleSAML\Error\Error('NOACCESS'); +} // Check if valid local session exists.. if ($config->getBoolean('admin.protectmetadata', false)) { - SimpleSAML\Utils\Auth::requireAdmin(); + \SimpleSAML\Utils\Auth::requireAdmin(); } $idpentityid = $metadata->getMetaDataCurrentEntityID('saml20-idp-hosted'); $idpmeta = $metadata->getMetaDataConfig($idpentityid, 'saml20-idp-hosted'); -switch($_SERVER['PATH_INFO']) { - case '/new_idp.crt': - $certInfo = SimpleSAML\Utils\Crypto::loadPublicKey($idpmeta, FALSE, 'new_'); - break; - case '/idp.crt': - $certInfo = SimpleSAML\Utils\Crypto::loadPublicKey($idpmeta, TRUE); - break; - case '/https.crt': - $certInfo = SimpleSAML\Utils\Crypto::loadPublicKey($idpmeta, TRUE, 'https.'); - break; - default: - throw new SimpleSAML_Error_NotFound('Unknown certificate.'); +switch ($_SERVER['PATH_INFO']) { + case '/new_idp.crt': + $certInfo = SimpleSAML\Utils\Crypto::loadPublicKey($idpmeta, false, 'new_'); + break; + case '/idp.crt': + $certInfo = SimpleSAML\Utils\Crypto::loadPublicKey($idpmeta, true); + break; + case '/https.crt': + $certInfo = SimpleSAML\Utils\Crypto::loadPublicKey($idpmeta, true, 'https.'); + break; + default: + throw new \SimpleSAML\Error\NotFound('Unknown certificate.'); } header('Content-Disposition: attachment; filename='.substr($_SERVER['PATH_INFO'], 1)); diff --git a/vendor/simplesamlphp/simplesamlphp/modules/saml/www/proxy/invalid_session.php b/vendor/simplesamlphp/simplesamlphp/modules/saml/www/proxy/invalid_session.php index f110f8beb6..1afc151ae1 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/saml/www/proxy/invalid_session.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/saml/www/proxy/invalid_session.php @@ -11,24 +11,24 @@ // retrieve the authentication state if (!array_key_exists('AuthState', $_REQUEST)) { - throw new SimpleSAML_Error_BadRequest('Missing mandatory parameter: AuthState'); + throw new \SimpleSAML\Error\BadRequest('Missing mandatory parameter: AuthState'); } try { // try to get the state - $state = SimpleSAML_Auth_State::loadState($_REQUEST['AuthState'], 'saml:proxy:invalid_idp'); -} catch (Exception $e) { + $state = \SimpleSAML\Auth\State::loadState($_REQUEST['AuthState'], 'saml:proxy:invalid_idp'); +} catch (\Exception $e) { // the user probably hit the back button after starting the logout, try to recover the state with another stage - $state = SimpleSAML_Auth_State::loadState($_REQUEST['AuthState'], 'core:Logout:afterbridge'); + $state = \SimpleSAML\Auth\State::loadState($_REQUEST['AuthState'], 'core:Logout:afterbridge'); // success! Try to continue with reauthentication, since we no longer have a valid session here - $idp = SimpleSAML_IdP::getById($state['core:IdP']); - sspmod_saml_Auth_Source_SP::reauthPostLogout($idp, $state); + $idp = \SimpleSAML\IdP::getById($state['core:IdP']); + \SimpleSAML\Module\saml\Auth\Source\SP::reauthPostLogout($idp, $state); } if (isset($_POST['cancel'])) { // the user does not want to logout, cancel login - SimpleSAML_Auth_State::throwException( + \SimpleSAML\Auth\State::throwException( $state, new \SimpleSAML\Module\saml\Error\NoAvailableIDP( \SAML2\Constants::STATUS_RESPONDER, @@ -39,19 +39,19 @@ if (isset($_POST['continue'])) { // log the user out before being able to login again - $as = SimpleSAML_Auth_Source::getById($state['saml:sp:AuthId'], 'sspmod_saml_Auth_Source_SP'); - /** @var sspmod_saml_Auth_Source_SP $as */ + $as = \SimpleSAML\Auth\Source::getById($state['saml:sp:AuthId'], '\SimpleSAML\Module\saml\Auth\Source\SP'); + /** @var \SimpleSAML\Module\saml\Auth\Source\SP $as */ $as->reauthLogout($state); } -$cfg = SimpleSAML_Configuration::getInstance(); -$template = new SimpleSAML_XHTML_Template($cfg, 'saml:proxy/invalid_session.php'); +$cfg = \SimpleSAML\Configuration::getInstance(); +$template = new \SimpleSAML\XHTML\Template($cfg, 'saml:proxy/invalid_session.php'); $translator = $template->getTranslator(); -$template->data['AuthState'] = (string)$_REQUEST['AuthState']; +$template->data['AuthState'] = (string) $_REQUEST['AuthState']; // get the name of the IdP $idpmdcfg = $state['saml:sp:IdPMetadata']; -/** @var SimpleSAML_Configuration $idpmdcfg */ +/** @var \SimpleSAML\Configuration $idpmdcfg */ $idpmd = $idpmdcfg->toArray(); if (array_key_exists('name', $idpmd)) { $template->data['idp_name'] = $translator->getPreferredTranslation($idpmd['name']); diff --git a/vendor/simplesamlphp/simplesamlphp/modules/saml/www/sp/discoresp.php b/vendor/simplesamlphp/simplesamlphp/modules/saml/www/sp/discoresp.php index 078e8add5d..94ac7c1d77 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/saml/www/sp/discoresp.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/saml/www/sp/discoresp.php @@ -5,24 +5,24 @@ */ if (!array_key_exists('AuthID', $_REQUEST)) { - throw new SimpleSAML_Error_BadRequest('Missing AuthID to discovery service response handler'); + throw new \SimpleSAML\Error\BadRequest('Missing AuthID to discovery service response handler'); } if (!array_key_exists('idpentityid', $_REQUEST)) { - throw new SimpleSAML_Error_BadRequest('Missing idpentityid to discovery service response handler'); + throw new \SimpleSAML\Error\BadRequest('Missing idpentityid to discovery service response handler'); } -$state = SimpleSAML_Auth_State::loadState($_REQUEST['AuthID'], 'saml:sp:sso'); +$state = \SimpleSAML\Auth\State::loadState($_REQUEST['AuthID'], 'saml:sp:sso'); // Find authentication source -assert('array_key_exists("saml:sp:AuthId", $state)'); +assert(array_key_exists('saml:sp:AuthId', $state)); $sourceId = $state['saml:sp:AuthId']; -$source = SimpleSAML_Auth_Source::getById($sourceId); -if ($source === NULL) { - throw new Exception('Could not find authentication source with id ' . $sourceId); +$source = \SimpleSAML\Auth\Source::getById($sourceId); +if ($source === null) { + throw new Exception('Could not find authentication source with id '.$sourceId); } -if (!($source instanceof sspmod_saml_Auth_Source_SP)) { - throw new SimpleSAML_Error_Exception('Source type changed?'); +if (!($source instanceof \SimpleSAML\Module\saml\Auth\Source\SP)) { + throw new \SimpleSAML\Error\Exception('Source type changed?'); } $source->startSSO($_REQUEST['idpentityid'], $state); diff --git a/vendor/simplesamlphp/simplesamlphp/modules/saml/www/sp/metadata.php b/vendor/simplesamlphp/simplesamlphp/modules/saml/www/sp/metadata.php index 9c48e4bd2e..1289d31e98 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/saml/www/sp/metadata.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/saml/www/sp/metadata.php @@ -1,55 +1,57 @@ <?php if (!array_key_exists('PATH_INFO', $_SERVER)) { - throw new SimpleSAML_Error_BadRequest('Missing authentication source id in metadata URL'); + throw new \SimpleSAML\Error\BadRequest('Missing authentication source id in metadata URL'); } -$config = SimpleSAML_Configuration::getInstance(); +$config = \SimpleSAML\Configuration::getInstance(); if ($config->getBoolean('admin.protectmetadata', false)) { - SimpleSAML\Utils\Auth::requireAdmin(); + \SimpleSAML\Utils\Auth::requireAdmin(); } $sourceId = substr($_SERVER['PATH_INFO'], 1); -$source = SimpleSAML_Auth_Source::getById($sourceId); +$source = \SimpleSAML\Auth\Source::getById($sourceId); if ($source === null) { - throw new SimpleSAML_Error_AuthSource($sourceId, 'Could not find authentication source.'); + throw new \SimpleSAML\Error\AuthSource($sourceId, 'Could not find authentication source.'); } -if (!($source instanceof sspmod_saml_Auth_Source_SP)) { - throw new SimpleSAML_Error_AuthSource($sourceId, - 'The authentication source is not a SAML Service Provider.'); +if (!($source instanceof \SimpleSAML\Module\saml\Auth\Source\SP)) { + throw new \SimpleSAML\Error\AuthSource( + $sourceId, + 'The authentication source is not a SAML Service Provider.' + ); } $entityId = $source->getEntityId(); $spconfig = $source->getMetadata(); $store = \SimpleSAML\Store::getInstance(); -$metaArray20 = array(); +$metaArray20 = []; -$slosvcdefault = array( +$slosvcdefault = [ \SAML2\Constants::BINDING_HTTP_REDIRECT, \SAML2\Constants::BINDING_SOAP, -); +]; $slob = $spconfig->getArray('SingleLogoutServiceBinding', $slosvcdefault); -$slol = SimpleSAML\Module::getModuleURL('saml/sp/saml2-logout.php/'.$sourceId); +$slol = \SimpleSAML\Module::getModuleURL('saml/sp/saml2-logout.php/'.$sourceId); foreach ($slob as $binding) { if ($binding == \SAML2\Constants::BINDING_SOAP && !($store instanceof \SimpleSAML\Store\SQL)) { // we cannot properly support SOAP logout continue; } - $metaArray20['SingleLogoutService'][] = array( + $metaArray20['SingleLogoutService'][] = [ 'Binding' => $binding, 'Location' => $slol, - ); + ]; } -$assertionsconsumerservicesdefault = array( +$assertionsconsumerservicesdefault = [ 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST', 'urn:oasis:names:tc:SAML:1.0:profiles:browser-post', 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Artifact', 'urn:oasis:names:tc:SAML:1.0:profiles:artifact-01', -); +]; if ($spconfig->getString('ProtocolBinding', '') == 'urn:oasis:names:tc:SAML:2.0:profiles:holder-of-key:SSO:browser') { $assertionsconsumerservicesdefault[] = 'urn:oasis:names:tc:SAML:2.0:profiles:holder-of-key:SSO:browser'; @@ -58,43 +60,42 @@ $assertionsconsumerservices = $spconfig->getArray('acs.Bindings', $assertionsconsumerservicesdefault); $index = 0; -$eps = array(); -$supported_protocols = array(); +$eps = []; +$supported_protocols = []; foreach ($assertionsconsumerservices as $services) { - - $acsArray = array('index' => $index); + $acsArray = ['index' => $index]; switch ($services) { case 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST': $acsArray['Binding'] = \SAML2\Constants::BINDING_HTTP_POST; - $acsArray['Location'] = SimpleSAML\Module::getModuleURL('saml/sp/saml2-acs.php/'.$sourceId); + $acsArray['Location'] = \SimpleSAML\Module::getModuleURL('saml/sp/saml2-acs.php/'.$sourceId); if (!in_array(\SAML2\Constants::NS_SAMLP, $supported_protocols, true)) { $supported_protocols[] = \SAML2\Constants::NS_SAMLP; } break; case 'urn:oasis:names:tc:SAML:1.0:profiles:browser-post': $acsArray['Binding'] = 'urn:oasis:names:tc:SAML:1.0:profiles:browser-post'; - $acsArray['Location'] = SimpleSAML\Module::getModuleURL('saml/sp/saml1-acs.php/'.$sourceId); + $acsArray['Location'] = \SimpleSAML\Module::getModuleURL('saml/sp/saml1-acs.php/'.$sourceId); if (!in_array('urn:oasis:names:tc:SAML:1.1:protocol', $supported_protocols, true)) { $supported_protocols[] = 'urn:oasis:names:tc:SAML:1.1:protocol'; } break; case 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Artifact': $acsArray['Binding'] = 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Artifact'; - $acsArray['Location'] = SimpleSAML\Module::getModuleURL('saml/sp/saml2-acs.php/'.$sourceId); + $acsArray['Location'] = \SimpleSAML\Module::getModuleURL('saml/sp/saml2-acs.php/'.$sourceId); if (!in_array(\SAML2\Constants::NS_SAMLP, $supported_protocols, true)) { $supported_protocols[] = \SAML2\Constants::NS_SAMLP; } break; case 'urn:oasis:names:tc:SAML:1.0:profiles:artifact-01': $acsArray['Binding'] = 'urn:oasis:names:tc:SAML:1.0:profiles:artifact-01'; - $acsArray['Location'] = SimpleSAML\Module::getModuleURL('saml/sp/saml1-acs.php/'.$sourceId.'/artifact'); + $acsArray['Location'] = \SimpleSAML\Module::getModuleURL('saml/sp/saml1-acs.php/'.$sourceId.'/artifact'); if (!in_array('urn:oasis:names:tc:SAML:1.1:protocol', $supported_protocols, true)) { $supported_protocols[] = 'urn:oasis:names:tc:SAML:1.1:protocol'; } break; case 'urn:oasis:names:tc:SAML:2.0:profiles:holder-of-key:SSO:browser': $acsArray['Binding'] = 'urn:oasis:names:tc:SAML:2.0:profiles:holder-of-key:SSO:browser'; - $acsArray['Location'] = SimpleSAML\Module::getModuleURL('saml/sp/saml2-acs.php/'.$sourceId); + $acsArray['Location'] = \SimpleSAML\Module::getModuleURL('saml/sp/saml2-acs.php/'.$sourceId); $acsArray['hoksso:ProtocolBinding'] = \SAML2\Constants::BINDING_HTTP_REDIRECT; if (!in_array(\SAML2\Constants::NS_SAMLP, $supported_protocols, true)) { $supported_protocols[] = \SAML2\Constants::NS_SAMLP; @@ -107,49 +108,56 @@ $metaArray20['AssertionConsumerService'] = $eps; -$keys = array(); -$certInfo = SimpleSAML\Utils\Crypto::loadPublicKey($spconfig, false, 'new_'); +$keys = []; +$certInfo = \SimpleSAML\Utils\Crypto::loadPublicKey($spconfig, false, 'new_'); if ($certInfo !== null && array_key_exists('certData', $certInfo)) { $hasNewCert = true; $certData = $certInfo['certData']; - $keys[] = array( + $keys[] = [ 'type' => 'X509Certificate', 'signing' => true, 'encryption' => true, 'X509Certificate' => $certInfo['certData'], - ); + ]; } else { $hasNewCert = false; } -$certInfo = SimpleSAML\Utils\Crypto::loadPublicKey($spconfig); +$certInfo = \SimpleSAML\Utils\Crypto::loadPublicKey($spconfig); if ($certInfo !== null && array_key_exists('certData', $certInfo)) { $certData = $certInfo['certData']; - $keys[] = array( + $keys[] = [ 'type' => 'X509Certificate', 'signing' => true, 'encryption' => ($hasNewCert ? false : true), 'X509Certificate' => $certInfo['certData'], - ); + ]; } else { $certData = null; } -$format = $spconfig->getString('NameIDPolicy', null); +$format = $spconfig->getValue('NameIDPolicy', null); if ($format !== null) { - $metaArray20['NameIDFormat'] = $format; + if (is_array($format)) { + $metaArray20['NameIDFormat'] = \SimpleSAML\Configuration::loadFromArray($format)->getString( + 'Format', + \SAML2\Constants::NAMEID_TRANSIENT + ); + } elseif (is_string($format)) { + $metaArray20['NameIDFormat'] = $format; + } } $name = $spconfig->getLocalizedString('name', null); -$attributes = $spconfig->getArray('attributes', array()); +$attributes = $spconfig->getArray('attributes', []); if ($name !== null && !empty($attributes)) { $metaArray20['name'] = $name; $metaArray20['attributes'] = $attributes; - $metaArray20['attributes.required'] = $spconfig->getArray('attributes.required', array()); + $metaArray20['attributes.required'] = $spconfig->getArray('attributes.required', []); if (empty($metaArray20['attributes.required'])) { unset($metaArray20['attributes.required']); @@ -164,6 +172,14 @@ if ($nameFormat !== null) { $metaArray20['attributes.NameFormat'] = $nameFormat; } + + if ($spconfig->hasValue('attributes.index')) { + $metaArray20['attributes.index'] = $spconfig->getInteger('attributes.index', 0); + } + + if ($spconfig->hasValue('attributes.isDefault')) { + $metaArray20['attributes.isDefault'] = $spconfig->getBoolean('attributes.isDefault', false); + } } // add organization info @@ -178,7 +194,7 @@ $metaArray20['OrganizationURL'] = $spconfig->getLocalizedString('OrganizationURL', null); if ($metaArray20['OrganizationURL'] === null) { - throw new SimpleSAML_Error_Exception('If OrganizationName is set, OrganizationURL must also be set.'); + throw new \SimpleSAML\Error\Exception('If OrganizationName is set, OrganizationURL must also be set.'); } } @@ -190,7 +206,7 @@ } // add technical contact -$email = $config->getString('technicalcontact_email', 'na@example.org', false); +$email = $config->getString('technicalcontact_email', 'na@example.org'); if ($email && $email !== 'na@example.org') { $techcontact['emailAddress'] = $email; $techcontact['name'] = $config->getString('technicalcontact_name', null); @@ -233,7 +249,7 @@ $metaArray20['metadata-set'] = 'saml20-sp-remote'; $metaArray20['entityid'] = $entityId; -$metaBuilder = new SimpleSAML_Metadata_SAMLBuilder($entityId); +$metaBuilder = new \SimpleSAML\Metadata\SAMLBuilder($entityId); $metaBuilder->addMetadataSP20($metaArray20, $supported_protocols); $metaBuilder->addOrganizationInfo($metaArray20); @@ -249,15 +265,14 @@ } // sign the metadata if enabled -$xml = SimpleSAML_Metadata_Signer::sign($xml, $spconfig->toArray(), 'SAML 2 SP'); +$xml = \SimpleSAML\Metadata\Signer::sign($xml, $spconfig->toArray(), 'SAML 2 SP'); if (array_key_exists('output', $_REQUEST) && $_REQUEST['output'] == 'xhtml') { - - $t = new SimpleSAML_XHTML_Template($config, 'metadata.php', 'admin'); + $t = new \SimpleSAML\XHTML\Template($config, 'metadata.php', 'admin'); $t->data['clipboard.js'] = true; $t->data['header'] = 'saml20-sp'; // TODO: Replace with headerString in 2.0 - $t->data['headerString'] = $t->noop('metadata_saml20-sp'); + $t->data['headerString'] = \SimpleSAML\Locale\Translate::noop('metadata_saml20-sp'); $t->data['metadata'] = htmlspecialchars($xml); $t->data['metadataflat'] = '$metadata['.var_export($entityId, true).'] = '.var_export($metaArray20, true).';'; $t->data['metaurl'] = $source->getMetadataURL(); diff --git a/vendor/simplesamlphp/simplesamlphp/modules/saml/www/sp/saml1-acs.php b/vendor/simplesamlphp/simplesamlphp/modules/saml/www/sp/saml1-acs.php index de340e8d96..db18627fd9 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/saml/www/sp/saml1-acs.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/saml/www/sp/saml1-acs.php @@ -3,66 +3,70 @@ use SimpleSAML\Bindings\Shib13\Artifact; if (!array_key_exists('SAMLResponse', $_REQUEST) && !array_key_exists('SAMLart', $_REQUEST)) { - throw new SimpleSAML_Error_BadRequest('Missing SAMLResponse or SAMLart parameter.'); + throw new \SimpleSAML\Error\BadRequest('Missing SAMLResponse or SAMLart parameter.'); } if (!array_key_exists('TARGET', $_REQUEST)) { - throw new SimpleSAML_Error_BadRequest('Missing TARGET parameter.'); + throw new \SimpleSAML\Error\BadRequest('Missing TARGET parameter.'); } if (!array_key_exists('PATH_INFO', $_SERVER)) { - throw new SimpleSAML_Error_BadRequest('Missing authentication source ID in assertion consumer service URL'); + throw new \SimpleSAML\Error\BadRequest('Missing authentication source ID in assertion consumer service URL'); } $sourceId = $_SERVER['PATH_INFO']; $end = strpos($sourceId, '/', 1); -if ($end === FALSE) { - $end = strlen($sourceId); +if ($end === false) { + $end = strlen($sourceId); } $sourceId = substr($sourceId, 1, $end - 1); -$source = SimpleSAML_Auth_Source::getById($sourceId, 'sspmod_saml_Auth_Source_SP'); +$source = \SimpleSAML\Auth\Source::getById($sourceId, '\SimpleSAML\Module\saml\Auth\Source\SP'); SimpleSAML\Logger::debug('Received SAML1 response'); -$target = (string)$_REQUEST['TARGET']; +$target = (string) $_REQUEST['TARGET']; if (preg_match('@^https?://@i', $target)) { - // Unsolicited response - $state = array( - 'saml:sp:isUnsolicited' => TRUE, - 'saml:sp:AuthId' => $sourceId, - 'saml:sp:RelayState' => \SimpleSAML\Utils\HTTP::checkURLAllowed($target), - ); + // Unsolicited response + $state = [ + 'saml:sp:isUnsolicited' => true, + 'saml:sp:AuthId' => $sourceId, + 'saml:sp:RelayState' => \SimpleSAML\Utils\HTTP::checkURLAllowed($target), + ]; } else { - $state = SimpleSAML_Auth_State::loadState($_REQUEST['TARGET'], 'saml:sp:sso'); + $state = \SimpleSAML\Auth\State::loadState($_REQUEST['TARGET'], 'saml:sp:sso'); - // Check that the authentication source is correct. - assert('array_key_exists("saml:sp:AuthId", $state)'); - if ($state['saml:sp:AuthId'] !== $sourceId) { - throw new SimpleSAML_Error_Exception('The authentication source id in the URL does not match the authentication source which sent the request.'); - } + // Check that the authentication source is correct + assert(array_key_exists('saml:sp:AuthId', $state)); + if ($state['saml:sp:AuthId'] !== $sourceId) { + throw new \SimpleSAML\Error\Exception( + 'The authentication source id in the URL does not match the authentication source which sent the request.' + ); + } - assert('isset($state["saml:idp"])'); + assert(isset($state['saml:idp'])); } $spMetadata = $source->getMetadata(); if (array_key_exists('SAMLart', $_REQUEST)) { - if (!isset($state['saml:idp'])) { - /* Unsolicited response. */ - throw new SimpleSAML_Error_Exception('IdP initiated authentication not supported with the SAML 1.1 SAMLart protocol.'); - } - $idpMetadata = $source->getIdPMetadata($state['saml:idp']); - - $responseXML = Artifact::receive($spMetadata, $idpMetadata); - $isValidated = TRUE; /* Artifact binding validated with ssl certificate. */ + if (!isset($state['saml:idp'])) { + // Unsolicited response + throw new \SimpleSAML\Error\Exception( + 'IdP initiated authentication not supported with the SAML 1.1 SAMLart protocol.' + ); + } + $idpMetadata = $source->getIdPMetadata($state['saml:idp']); + + $responseXML = Artifact::receive($spMetadata, $idpMetadata); + $isValidated = true; /* Artifact binding validated with ssl certificate. */ } elseif (array_key_exists('SAMLResponse', $_REQUEST)) { - $responseXML = $_REQUEST['SAMLResponse']; - $responseXML = base64_decode($responseXML); - $isValidated = FALSE; /* Must check signature on response. */ + $responseXML = $_REQUEST['SAMLResponse']; + $responseXML = base64_decode($responseXML); + $isValidated = false; /* Must check signature on response. */ } else { - assert('FALSE'); + assert(false); } $response = new \SimpleSAML\XML\Shib13\AuthnResponse(); @@ -75,15 +79,15 @@ $attributes = $response->getAttributes(); if (isset($state['saml:idp']) && $responseIssuer !== $state['saml:idp']) { - throw new SimpleSAML_Error_Exception('The issuer of the response wasn\'t the destination of the request.'); + throw new \SimpleSAML\Error\Exception('The issuer of the response wasn\'t the destination of the request.'); } -$logoutState = array( - 'saml:logout:Type' => 'saml1' - ); +$logoutState = [ + 'saml:logout:Type' => 'saml1' +]; $state['LogoutState'] = $logoutState; $state['saml:sp:NameID'] = $response->getNameID(); $source->handleResponse($state, $responseIssuer, $attributes); -assert('FALSE'); +assert(false); diff --git a/vendor/simplesamlphp/simplesamlphp/modules/saml/www/sp/saml2-acs.php b/vendor/simplesamlphp/simplesamlphp/modules/saml/www/sp/saml2-acs.php index 5018079bf5..34c80bc766 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/saml/www/sp/saml2-acs.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/saml/www/sp/saml2-acs.php @@ -5,22 +5,24 @@ */ if (!array_key_exists('PATH_INFO', $_SERVER)) { - throw new SimpleSAML_Error_BadRequest('Missing authentication source ID in assertion consumer service URL'); + throw new \SimpleSAML\Error\BadRequest('Missing authentication source ID in assertion consumer service URL'); } $sourceId = substr($_SERVER['PATH_INFO'], 1); -$source = SimpleSAML_Auth_Source::getById($sourceId, 'sspmod_saml_Auth_Source_SP'); +$source = \SimpleSAML\Auth\Source::getById($sourceId, '\SimpleSAML\Module\saml\Auth\Source\SP'); $spMetadata = $source->getMetadata(); try { $b = \SAML2\Binding::getCurrentBinding(); -} catch (Exception $e) { // TODO: look for a specific exception +} catch (Exception $e) { + // TODO: look for a specific exception // This is dirty. Instead of checking the message of the exception, \SAML2\Binding::getCurrentBinding() should throw - // an specific exception when the binding is unknown, and we should capture that here + // a specific exception when the binding is unknown, and we should capture that here if ($e->getMessage() === 'Unable to find the current binding.') { - throw new SimpleSAML_Error_Error('ACSPARAMS', $e, 400); + throw new \SimpleSAML\Error\Error('ACSPARAMS', $e, 400); } else { - throw $e; // do not ignore other exceptions! + // do not ignore other exceptions! + throw $e; } } @@ -30,26 +32,31 @@ $response = $b->receive(); if (!($response instanceof \SAML2\Response)) { - throw new SimpleSAML_Error_BadRequest('Invalid message received to AssertionConsumerService endpoint.'); + throw new \SimpleSAML\Error\BadRequest('Invalid message received to AssertionConsumerService endpoint.'); } -$idp = $response->getIssuer(); -if ($idp === null) { +$issuer = $response->getIssuer(); +if ($issuer === null) { // no Issuer in the response. Look for an unencrypted assertion with an issuer foreach ($response->getAssertions() as $a) { if ($a instanceof \SAML2\Assertion) { // we found an unencrypted assertion, there should be an issuer here - $idp = $a->getIssuer(); + $issuer = $a->getIssuer(); break; } } - if ($idp === null) { + if ($issuer === null) { // no issuer found in the assertions throw new Exception('Missing <saml:Issuer> in message delivered to AssertionConsumerService.'); } } -$session = SimpleSAML_Session::getSessionFromRequest(); +$idp = $issuer; +if ($issuer instanceof \SAML2\XML\saml\Issuer) { + $idp = $idp->getValue(); +} + +$session = \SimpleSAML\Session::getSessionFromRequest(); $prevAuth = $session->getAuthData($sourceId, 'saml:sp:prevAuth'); if ($prevAuth !== null && $prevAuth['id'] === $response->getId() && $prevAuth['issuer'] === $idp) { /* OK, it looks like this message has the same issuer @@ -67,17 +74,17 @@ } SimpleSAML\Logger::info('No RelayState or ReturnURL available, cannot redirect.'); - throw new SimpleSAML_Error_Exception('Duplicate assertion received.'); + throw new \SimpleSAML\Error\Exception('Duplicate assertion received.'); } -$idpMetadata = array(); +$idpMetadata = []; $state = null; $stateId = $response->getInResponseTo(); if (!empty($stateId)) { // this should be a response to a request we sent earlier try { - $state = SimpleSAML_Auth_State::loadState($stateId, 'saml:sp:sso'); + $state = \SimpleSAML\Auth\State::loadState($stateId, 'saml:sp:sso'); } catch (Exception $e) { // something went wrong, SimpleSAML\Logger::warning('Could not load state specified by InResponseTo: '.$e->getMessage(). @@ -87,27 +94,25 @@ if ($state) { // check that the authentication source is correct - assert('array_key_exists("saml:sp:AuthId", $state)'); + assert(array_key_exists('saml:sp:AuthId', $state)); if ($state['saml:sp:AuthId'] !== $sourceId) { - throw new SimpleSAML_Error_Exception( + throw new \SimpleSAML\Error\Exception( 'The authentication source id in the URL does not match the authentication source which sent the request.' ); } // check that the issuer is the one we are expecting - assert('array_key_exists("ExpectedIssuer", $state)'); + assert(array_key_exists('ExpectedIssuer', $state)); if ($state['ExpectedIssuer'] !== $idp) { $idpMetadata = $source->getIdPMetadata($idp); - $idplist = $idpMetadata->getArrayize('IDPList', array()); + $idplist = $idpMetadata->getArrayize('IDPList', []); if (!in_array($state['ExpectedIssuer'], $idplist, true)) { - throw new SimpleSAML_Error_Exception( - 'The issuer of the response does not match to the identity provider we sent the request to.' - ); + SimpleSAML\Logger::warning('The issuer of the response not match to the identity provider we sent the request to.'); } } } else { // this is an unsolicited response - $state = array( + $state = [ 'saml:sp:isUnsolicited' => true, 'saml:sp:AuthId' => $sourceId, 'saml:sp:RelayState' => \SimpleSAML\Utils\HTTP::checkURLAllowed( @@ -116,7 +121,7 @@ $response->getRelayState() ) ), - ); + ]; } SimpleSAML\Logger::debug('Received SAML2 Response from '.var_export($idp, true).'.'); @@ -126,11 +131,11 @@ } try { - $assertions = sspmod_saml_Message::processResponse($spMetadata, $idpMetadata, $response); -} catch (sspmod_saml_Error $e) { + $assertions = \SimpleSAML\Module\saml\Message::processResponse($spMetadata, $idpMetadata, $response); +} catch (\SimpleSAML\Module\saml\Error $e) { // the status of the response wasn't "success" $e = $e->toException(); - SimpleSAML_Auth_State::throwException($state, $e); + \SimpleSAML\Auth\State::throwException($state, $e); } @@ -138,17 +143,16 @@ $nameId = null; $sessionIndex = null; $expire = null; -$attributes = array(); +$attributes = []; $foundAuthnStatement = false; foreach ($assertions as $assertion) { - // check for duplicate assertion (replay attack) $store = \SimpleSAML\Store::getInstance(); if ($store !== false) { $aID = $assertion->getId(); if ($store->get('saml.AssertionReceived', $aID) !== null) { - $e = new SimpleSAML_Error_Exception('Received duplicate assertion.'); - SimpleSAML_Auth_State::throwException($state, $e); + $e = new \SimpleSAML\Error\Exception('Received duplicate assertion.'); + \SimpleSAML\Auth\State::throwException($state, $e); } $notOnOrAfter = $assertion->getNotOnOrAfter(); @@ -184,8 +188,8 @@ } if (!$foundAuthnStatement) { - $e = new SimpleSAML_Error_Exception('No AuthnStatement found in assertion(s).'); - SimpleSAML_Auth_State::throwException($state, $e); + $e = new \SimpleSAML\Error\Exception('No AuthnStatement found in assertion(s).'); + \SimpleSAML\Auth\State::throwException($state, $e); } if ($expire !== null) { @@ -197,15 +201,15 @@ if (!empty($nameId)) { // register this session in the logout store - sspmod_saml_SP_LogoutStore::addSession($sourceId, $nameId, $sessionIndex, $logoutExpire); + \SimpleSAML\Module\saml\SP\LogoutStore::addSession($sourceId, $nameId, $sessionIndex, $logoutExpire); // we need to save the NameID and SessionIndex for logout - $logoutState = array( + $logoutState = [ 'saml:logout:Type' => 'saml2', 'saml:logout:IdP' => $idp, 'saml:logout:NameID' => $nameId, 'saml:logout:SessionIndex' => $sessionIndex, - ); + ]; $state['saml:sp:NameID'] = $nameId; // no need to mark it as persistent, it already is } else { @@ -222,9 +226,9 @@ * it to the store), marking the IdP as SAML 1.0, which does not implement logout. Then we can safely log the user * out from the local session, skipping Single Logout upstream to the IdP. */ - $logoutState = array( + $logoutState = [ 'saml:logout:Type' => 'saml1', - ); + ]; } $state['LogoutState'] = $logoutState; @@ -235,7 +239,7 @@ $state['PersistentAuthData'][] = 'saml:AuthnInstant'; $state['saml:sp:SessionIndex'] = $sessionIndex; $state['PersistentAuthData'][] = 'saml:sp:SessionIndex'; -$state['saml:sp:AuthnContext'] = $assertion->getAuthnContext(); +$state['saml:sp:AuthnContext'] = $assertion->getAuthnContextClassRef(); $state['PersistentAuthData'][] = 'saml:sp:AuthnContext'; if ($expire !== null) { @@ -243,16 +247,16 @@ } // note some information about the authentication, in case we receive the same response again -$state['saml:sp:prevAuth'] = array( +$state['saml:sp:prevAuth'] = [ 'id' => $response->getId(), 'issuer' => $idp, -); -if (isset($state['SimpleSAML_Auth_Source.ReturnURL'])) { - $state['saml:sp:prevAuth']['redirect'] = $state['SimpleSAML_Auth_Source.ReturnURL']; +]; +if (isset($state['\SimpleSAML\Auth\Source.ReturnURL'])) { + $state['saml:sp:prevAuth']['redirect'] = $state['\SimpleSAML\Auth\Source.ReturnURL']; } elseif (isset($state['saml:sp:RelayState'])) { $state['saml:sp:prevAuth']['redirect'] = $state['saml:sp:RelayState']; } $state['PersistentAuthData'][] = 'saml:sp:prevAuth'; $source->handleResponse($state, $idp, $attributes); -assert('FALSE'); +assert(false); diff --git a/vendor/simplesamlphp/simplesamlphp/modules/saml/www/sp/saml2-logout.php b/vendor/simplesamlphp/simplesamlphp/modules/saml/www/sp/saml2-logout.php index 6fa5a00817..e181484123 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/saml/www/sp/saml2-logout.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/saml/www/sp/saml2-logout.php @@ -7,134 +7,141 @@ */ if (!array_key_exists('PATH_INFO', $_SERVER)) { - throw new SimpleSAML_Error_BadRequest('Missing authentication source ID in logout URL'); + throw new \SimpleSAML\Error\BadRequest('Missing authentication source ID in logout URL'); } $sourceId = substr($_SERVER['PATH_INFO'], 1); -$source = SimpleSAML_Auth_Source::getById($sourceId); -if ($source === NULL) { - throw new Exception('Could not find authentication source with id ' . $sourceId); +$source = \SimpleSAML\Auth\Source::getById($sourceId); +if ($source === null) { + throw new \Exception('Could not find authentication source with id '.$sourceId); } -if (!($source instanceof sspmod_saml_Auth_Source_SP)) { - throw new SimpleSAML_Error_Exception('Source type changed?'); +if (!($source instanceof \SimpleSAML\Module\saml\Auth\Source\SP)) { + throw new \SimpleSAML\Error\Exception('Source type changed?'); } try { $binding = \SAML2\Binding::getCurrentBinding(); -} catch (Exception $e) { // TODO: look for a specific exception +} catch (\Exception $e) { + // TODO: look for a specific exception // This is dirty. Instead of checking the message of the exception, \SAML2\Binding::getCurrentBinding() should throw // an specific exception when the binding is unknown, and we should capture that here if ($e->getMessage() === 'Unable to find the current binding.') { - throw new SimpleSAML_Error_Error('SLOSERVICEPARAMS', $e, 400); + throw new \SimpleSAML\Error\Error('SLOSERVICEPARAMS', $e, 400); } else { throw $e; // do not ignore other exceptions! } } $message = $binding->receive(); -$idpEntityId = $message->getIssuer(); -if ($idpEntityId === NULL) { - // Without an issuer we have no way to respond to the message. - throw new SimpleSAML_Error_BadRequest('Received message on logout endpoint without issuer.'); +$issuer = $message->getIssuer(); +if ($issuer === null) { + // Without an issuer we have no way to respond to the message. + throw new \SimpleSAML\Error\BadRequest('Received message on logout endpoint without issuer.'); +} elseif ($issuer instanceof \SAML2\XML\saml\Issuer) { + $idpEntityId = $issuer->getValue(); +} else { + $idpEntityId = $issuer; } $spEntityId = $source->getEntityId(); -$metadata = SimpleSAML_Metadata_MetaDataStorageHandler::getMetadataHandler(); +$metadata = \SimpleSAML\Metadata\MetaDataStorageHandler::getMetadataHandler(); $idpMetadata = $source->getIdPMetadata($idpEntityId); $spMetadata = $source->getMetadata(); -sspmod_saml_Message::validateMessage($idpMetadata, $spMetadata, $message); +\SimpleSAML\Module\saml\Message::validateMessage($idpMetadata, $spMetadata, $message); $destination = $message->getDestination(); -if ($destination !== NULL && $destination !== \SimpleSAML\Utils\HTTP::getSelfURLNoQuery()) { - throw new SimpleSAML_Error_Exception('Destination in logout message is wrong.'); +if ($destination !== null && $destination !== \SimpleSAML\Utils\HTTP::getSelfURLNoQuery()) { + throw new \SimpleSAML\Error\Exception('Destination in logout message is wrong.'); } if ($message instanceof \SAML2\LogoutResponse) { + $relayState = $message->getRelayState(); + if ($relayState === null) { + // Somehow, our RelayState has been lost. + throw new \SimpleSAML\Error\BadRequest('Missing RelayState in logout response.'); + } - $relayState = $message->getRelayState(); - if ($relayState === NULL) { - // Somehow, our RelayState has been lost. - throw new SimpleSAML_Error_BadRequest('Missing RelayState in logout response.'); - } + if (!$message->isSuccess()) { + \SimpleSAML\Logger::warning( + 'Unsuccessful logout. Status was: '.\SimpleSAML\Module\saml\Message::getResponseError($message) + ); + } - if (!$message->isSuccess()) { - SimpleSAML\Logger::warning('Unsuccessful logout. Status was: ' . sspmod_saml_Message::getResponseError($message)); - } + $state = \SimpleSAML\Auth\State::loadState($relayState, 'saml:slosent'); + $state['saml:sp:LogoutStatus'] = $message->getStatus(); + \SimpleSAML\Auth\Source::completeLogout($state); +} elseif ($message instanceof \SAML2\LogoutRequest) { + \SimpleSAML\Logger::debug('module/saml2/sp/logout: Request from '.$idpEntityId); + \SimpleSAML\Logger::stats('saml20-idp-SLO idpinit '.$spEntityId.' '.$idpEntityId); + + if ($message->isNameIdEncrypted()) { + try { + $keys = \SimpleSAML\Module\saml\Message::getDecryptionKeys($idpMetadata, $spMetadata); + } catch (\Exception $e) { + throw new \SimpleSAML\Error\Exception('Error decrypting NameID: '.$e->getMessage()); + } + + $blacklist = \SimpleSAML\Module\saml\Message::getBlacklistedAlgorithms($idpMetadata, $spMetadata); + + $lastException = null; + foreach ($keys as $i => $key) { + try { + $message->decryptNameId($key, $blacklist); + \SimpleSAML\Logger::debug('Decryption with key #'.$i.' succeeded.'); + $lastException = null; + break; + } catch (\Exception $e) { + \SimpleSAML\Logger::debug('Decryption with key #'.$i.' failed with exception: '.$e->getMessage()); + $lastException = $e; + } + } + if ($lastException !== null) { + throw $lastException; + } + } - $state = SimpleSAML_Auth_State::loadState($relayState, 'saml:slosent'); - $state['saml:sp:LogoutStatus'] = $message->getStatus(); - SimpleSAML_Auth_Source::completeLogout($state); + $nameId = $message->getNameId(); + $sessionIndexes = $message->getSessionIndexes(); -} elseif ($message instanceof \SAML2\LogoutRequest) { + $numLoggedOut = \SimpleSAML\Module\saml\SP\LogoutStore::logoutSessions($sourceId, $nameId, $sessionIndexes); + if ($numLoggedOut === false) { + // This type of logout was unsupported. Use the old method + $source->handleLogout($idpEntityId); + $numLoggedOut = count($sessionIndexes); + } + + // Create and send response + $lr = \SimpleSAML\Module\saml\Message::buildLogoutResponse($spMetadata, $idpMetadata); + $lr->setRelayState($message->getRelayState()); + $lr->setInResponseTo($message->getId()); + + if ($numLoggedOut < count($sessionIndexes)) { + \SimpleSAML\Logger::warning('Logged out of '.$numLoggedOut.' of '.count($sessionIndexes).' sessions.'); + } + + $dst = $idpMetadata->getEndpointPrioritizedByBinding( + 'SingleLogoutService', + [ + \SAML2\Constants::BINDING_HTTP_REDIRECT, + \SAML2\Constants::BINDING_HTTP_POST + ] + ); + + if (!($binding instanceof \SAML2\SOAP)) { + $binding = \SAML2\Binding::getBinding($dst['Binding']); + if (isset($dst['ResponseLocation'])) { + $dst = $dst['ResponseLocation']; + } else { + $dst = $dst['Location']; + } + $binding->setDestination($dst); + } + $lr->setDestination($dst); - SimpleSAML\Logger::debug('module/saml2/sp/logout: Request from ' . $idpEntityId); - SimpleSAML\Logger::stats('saml20-idp-SLO idpinit ' . $spEntityId . ' ' . $idpEntityId); - - if ($message->isNameIdEncrypted()) { - try { - $keys = sspmod_saml_Message::getDecryptionKeys($idpMetadata, $spMetadata); - } catch (Exception $e) { - throw new SimpleSAML_Error_Exception('Error decrypting NameID: ' . $e->getMessage()); - } - - $blacklist = sspmod_saml_Message::getBlacklistedAlgorithms($idpMetadata, $spMetadata); - - $lastException = NULL; - foreach ($keys as $i => $key) { - try { - $message->decryptNameId($key, $blacklist); - SimpleSAML\Logger::debug('Decryption with key #' . $i . ' succeeded.'); - $lastException = NULL; - break; - } catch (Exception $e) { - SimpleSAML\Logger::debug('Decryption with key #' . $i . ' failed with exception: ' . $e->getMessage()); - $lastException = $e; - } - } - if ($lastException !== NULL) { - throw $lastException; - } - } - - $nameId = $message->getNameId(); - $sessionIndexes = $message->getSessionIndexes(); - - $numLoggedOut = sspmod_saml_SP_LogoutStore::logoutSessions($sourceId, $nameId, $sessionIndexes); - if ($numLoggedOut === FALSE) { - /* This type of logout was unsupported. Use the old method. */ - $source->handleLogout($idpEntityId); - $numLoggedOut = count($sessionIndexes); - } - - /* Create an send response. */ - $lr = sspmod_saml_Message::buildLogoutResponse($spMetadata, $idpMetadata); - $lr->setRelayState($message->getRelayState()); - $lr->setInResponseTo($message->getId()); - - if ($numLoggedOut < count($sessionIndexes)) { - SimpleSAML\Logger::warning('Logged out of ' . $numLoggedOut . ' of ' . count($sessionIndexes) . ' sessions.'); - } - - $dst = $idpMetadata->getEndpointPrioritizedByBinding('SingleLogoutService', array( - \SAML2\Constants::BINDING_HTTP_REDIRECT, - \SAML2\Constants::BINDING_HTTP_POST) - ); - - if (!$binding instanceof \SAML2\SOAP) { - $binding = \SAML2\Binding::getBinding($dst['Binding']); - if (isset($dst['ResponseLocation'])) { - $dst = $dst['ResponseLocation']; - } else { - $dst = $dst['Location']; - } - $binding->setDestination($dst); - } - $lr->setDestination($dst); - - $binding->send($lr); + $binding->send($lr); } else { - throw new SimpleSAML_Error_BadRequest('Unknown message received on logout endpoint: ' . get_class($message)); + throw new \SimpleSAML\Error\BadRequest('Unknown message received on logout endpoint: '.get_class($message)); } diff --git a/vendor/simplesamlphp/simplesamlphp/modules/saml/www/sp/wrong_authncontextclassref.php b/vendor/simplesamlphp/simplesamlphp/modules/saml/www/sp/wrong_authncontextclassref.php index 18e17617d5..9cb93bf70d 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/saml/www/sp/wrong_authncontextclassref.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/saml/www/sp/wrong_authncontextclassref.php @@ -1,5 +1,5 @@ <?php -$globalConfig = SimpleSAML_Configuration::getInstance(); -$t = new SimpleSAML_XHTML_Template($globalConfig, 'saml:sp/wrong_authncontextclassref.tpl.php'); +$globalConfig = \SimpleSAML\Configuration::getInstance(); +$t = new \SimpleSAML\XHTML\Template($globalConfig, 'saml:sp/wrong_authncontextclassref.tpl.php'); $t->show(); diff --git a/vendor/simplesamlphp/simplesamlphp/modules/sanitycheck/config-templates/config-sanitycheck.php b/vendor/simplesamlphp/simplesamlphp/modules/sanitycheck/config-templates/config-sanitycheck.php index ac40a0f48e..d9b45bb8af 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/sanitycheck/config-templates/config-sanitycheck.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/sanitycheck/config-templates/config-sanitycheck.php @@ -1,10 +1,9 @@ <?php -/* +/* * The configuration of SimpleSAMLphp sanitycheck package */ -$config = array ( - +$config = [ /* * Do you want to generate statistics using the cron module? If so, specify which cron tag to use. * Examples: daily, weekly @@ -12,5 +11,4 @@ * 'cron_tag' => null, */ 'cron_tag' => 'hourly', - -); +]; diff --git a/vendor/simplesamlphp/simplesamlphp/modules/sanitycheck/dictionaries/strings.definition.json b/vendor/simplesamlphp/simplesamlphp/modules/sanitycheck/dictionaries/strings.definition.json new file mode 100644 index 0000000000..38aa732b32 --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/modules/sanitycheck/dictionaries/strings.definition.json @@ -0,0 +1,5 @@ +{ + "link_sanitycheck": { + "en": "Sanity check of your SimpleSAMLphp setup" + } +} \ No newline at end of file diff --git a/vendor/simplesamlphp/simplesamlphp/modules/sanitycheck/dictionaries/strings.translation.json b/vendor/simplesamlphp/simplesamlphp/modules/sanitycheck/dictionaries/strings.translation.json new file mode 100644 index 0000000000..a3940e0481 --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/modules/sanitycheck/dictionaries/strings.translation.json @@ -0,0 +1,7 @@ +{ + "link_sanitycheck": { + "es": "Comprobaciones básicas de la instalación", + "no": "Sjekk din installasjon", + "nn": "Sjekk din installasjon" + } +} \ No newline at end of file diff --git a/vendor/simplesamlphp/simplesamlphp/modules/sanitycheck/hooks/hook_configpage.php b/vendor/simplesamlphp/simplesamlphp/modules/sanitycheck/hooks/hook_configpage.php new file mode 100644 index 0000000000..a4db0492e7 --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/modules/sanitycheck/hooks/hook_configpage.php @@ -0,0 +1,14 @@ +<?php +/** + * Hook to add the sanitycheck link to the config page. + * + * @param \SimpleSAML\XHTML\Template $template The template that we should alter in this hook. + */ +function sanitycheck_hook_configpage(\SimpleSAML\XHTML\Template &$template) +{ + $template->data['links']['sanitycheck'] = [ + 'href' => SimpleSAML\Module::getModuleURL('sanitycheck/index.php'), + 'text' => \SimpleSAML\Locale\Translate::noop('Sanity check of your SimpleSAMLphp setup'), + ]; + $template->getLocalization()->addModuleDomain('sanitycheck'); +} diff --git a/vendor/simplesamlphp/simplesamlphp/modules/sanitycheck/hooks/hook_cron.php b/vendor/simplesamlphp/simplesamlphp/modules/sanitycheck/hooks/hook_cron.php index 44abd49360..15e0736ddb 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/sanitycheck/hooks/hook_cron.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/sanitycheck/hooks/hook_cron.php @@ -4,38 +4,38 @@ * * @param array &$croninfo Output */ + function sanitycheck_hook_cron(&$croninfo) { - assert('is_array($croninfo)'); - assert('array_key_exists("summary", $croninfo)'); - assert('array_key_exists("tag", $croninfo)'); + assert(is_array($croninfo)); + assert(array_key_exists('summary', $croninfo)); + assert(array_key_exists('tag', $croninfo)); - SimpleSAML\Logger::info('cron [sanitycheck]: Running cron in cron tag [' . $croninfo['tag'] . '] '); + \SimpleSAML\Logger::info('cron [sanitycheck]: Running cron in cron tag ['.$croninfo['tag'].'] '); try { - $sconfig = SimpleSAML_Configuration::getOptionalConfig('config-sanitycheck.php'); + $sconfig = \SimpleSAML\Configuration::getOptionalConfig('config-sanitycheck.php'); $cronTag = $sconfig->getString('cron_tag', null); if ($cronTag === null || $cronTag !== $croninfo['tag']) { return; } - $info = array(); - $errors = array(); - $hookinfo = array( + $info = []; + $errors = []; + $hookinfo = [ 'info' => &$info, 'errors' => &$errors, - ); + ]; SimpleSAML\Module::callHooks('sanitycheck', $hookinfo); if (count($errors) > 0) { - foreach ($errors AS $err) { - $croninfo['summary'][] = 'Sanitycheck error: ' . $err; + foreach ($errors as $err) { + $croninfo['summary'][] = 'Sanitycheck error: '.$err; } } - } catch (Exception $e) { - $croninfo['summary'][] = 'Error executing sanity check: ' . $e->getMessage(); + $croninfo['summary'][] = 'Error executing sanity check: '.$e->getMessage(); } } diff --git a/vendor/simplesamlphp/simplesamlphp/modules/sanitycheck/hooks/hook_frontpage.php b/vendor/simplesamlphp/simplesamlphp/modules/sanitycheck/hooks/hook_frontpage.php index b40e657fa1..1e860e6e68 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/sanitycheck/hooks/hook_frontpage.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/sanitycheck/hooks/hook_frontpage.php @@ -6,12 +6,12 @@ */ function sanitycheck_hook_frontpage(&$links) { - assert('is_array($links)'); - assert('array_key_exists("links", $links)'); + assert(is_array($links)); + assert(array_key_exists('links', $links)); - $links['config']['santitycheck'] = array( + $links['config']['sanitycheck'] = [ 'href' => SimpleSAML\Module::getModuleURL('sanitycheck/index.php'), - 'text' => array('en' => 'Sanity check of your SimpleSAMLphp setup'), - 'shorttext' => array('en' => 'SanityCheck'), - ); + 'text' => '{sanitycheck:strings:link_sanitycheck}', + ]; } + diff --git a/vendor/simplesamlphp/simplesamlphp/modules/sanitycheck/hooks/hook_moduleinfo.php b/vendor/simplesamlphp/simplesamlphp/modules/sanitycheck/hooks/hook_moduleinfo.php index 679ac17e37..87d014e2ec 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/sanitycheck/hooks/hook_moduleinfo.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/sanitycheck/hooks/hook_moduleinfo.php @@ -6,14 +6,14 @@ */ function sanitycheck_hook_moduleinfo(&$moduleinfo) { - assert('is_array($moduleinfo)'); - assert('array_key_exists("info", $moduleinfo)'); + assert(is_array($moduleinfo)); + assert(array_key_exists('info', $moduleinfo)); - $moduleinfo['info']['sanitycheck'] = array( - 'name' => array('en' => 'Sanity check'), - 'description' => array('en' => 'This module adds functionality for other modules to provide santity checks.'), + $moduleinfo['info']['sanitycheck'] = [ + 'name' => ['en' => 'Sanity check'], + 'description' => ['en' => 'This module adds functionality for other modules to provide sanity checks.'], - 'dependencies' => array('core'), - 'uses' => array('cron'), - ); + 'dependencies' => ['core'], + 'uses' => ['cron'], + ]; } diff --git a/vendor/simplesamlphp/simplesamlphp/modules/sanitycheck/hooks/hook_sanitycheck.php b/vendor/simplesamlphp/simplesamlphp/modules/sanitycheck/hooks/hook_sanitycheck.php index 867eab503a..8aec6582bf 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/sanitycheck/hooks/hook_sanitycheck.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/sanitycheck/hooks/hook_sanitycheck.php @@ -6,9 +6,9 @@ */ function sanitycheck_hook_sanitycheck(&$hookinfo) { - assert('is_array($hookinfo)'); - assert('array_key_exists("errors", $hookinfo)'); - assert('array_key_exists("info", $hookinfo)'); + assert(is_array($hookinfo)); + assert(array_key_exists('errors', $hookinfo)); + assert(array_key_exists('info', $hookinfo)); $hookinfo['info'][] = '[sanitycheck] At least the sanity check itself is working :)'; } diff --git a/vendor/simplesamlphp/simplesamlphp/modules/sanitycheck/locales/en/LC_MESSAGES/sanitycheck.po b/vendor/simplesamlphp/simplesamlphp/modules/sanitycheck/locales/en/LC_MESSAGES/sanitycheck.po new file mode 100644 index 0000000000..140725668d --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/modules/sanitycheck/locales/en/LC_MESSAGES/sanitycheck.po @@ -0,0 +1,11 @@ +msgid "These checks failed:" +msgstr "These checks failed:" + +msgid "These checks succeeded:" +msgstr "These checks succeeded:" + +msgid "{sanitycheck:strings:link_sanitycheck}" +msgstr "Sanity check of your SimpleSAMLphp setup" + +msgid "Sanity check of your SimpleSAMLphp setup" +msgstr "Sanity check of your SimpleSAMLphp setup" \ No newline at end of file diff --git a/vendor/simplesamlphp/simplesamlphp/modules/sanitycheck/locales/es/LC_MESSAGES/sanitycheck.po b/vendor/simplesamlphp/simplesamlphp/modules/sanitycheck/locales/es/LC_MESSAGES/sanitycheck.po new file mode 100644 index 0000000000..8ccf3453db --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/modules/sanitycheck/locales/es/LC_MESSAGES/sanitycheck.po @@ -0,0 +1,11 @@ +msgid "These checks failed:" +msgstr "Las siguientes comprobaciones han fallado:" + +msgid "These checks succeeded:" +msgstr "Las siguientes comprobaciones fueron satisfactorias:" + +msgid "{sanitycheck:strings:link_sanitycheck}" +msgstr "Comprobaciones básicas de la instalación" + +msgid "Sanity check of your SimpleSAMLphp setup" +msgstr "Comprobaciones básicas de la instalación" diff --git a/vendor/simplesamlphp/simplesamlphp/modules/sanitycheck/locales/it/LC_MESSAGES/sanitycheck.po b/vendor/simplesamlphp/simplesamlphp/modules/sanitycheck/locales/it/LC_MESSAGES/sanitycheck.po new file mode 100644 index 0000000000..558b243e06 --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/modules/sanitycheck/locales/it/LC_MESSAGES/sanitycheck.po @@ -0,0 +1,6 @@ +msgid "These checks failed:" +msgstr "I seguenti controlli hanno riscontrato dei problemi:" + +msgid "These checks succeeded:" +msgstr "I seguenti controlli sono stati eseguiti con successo:" + diff --git a/vendor/simplesamlphp/simplesamlphp/modules/sanitycheck/locales/nb/LC_MESSAGES/sanitycheck.po b/vendor/simplesamlphp/simplesamlphp/modules/sanitycheck/locales/nb/LC_MESSAGES/sanitycheck.po new file mode 100644 index 0000000000..eed8799443 --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/modules/sanitycheck/locales/nb/LC_MESSAGES/sanitycheck.po @@ -0,0 +1,11 @@ +msgid "These checks failed:" +msgstr "Disse sjekkene har feila:" + +msgid "These checks succeeded:" +msgstr "Disse sjekkene var suksessfulle:" + +msgid "{sanitycheck:strings:link_sanitycheck}" +msgstr "Sjekk din installasjon" + +msgid "Sanity check of your SimpleSAMLphp setup" +msgstr "Sjekk din installasjon" diff --git a/vendor/simplesamlphp/simplesamlphp/modules/sanitycheck/locales/nl/LC_MESSAGES/sanitycheck.po b/vendor/simplesamlphp/simplesamlphp/modules/sanitycheck/locales/nl/LC_MESSAGES/sanitycheck.po new file mode 100644 index 0000000000..e6c41cc574 --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/modules/sanitycheck/locales/nl/LC_MESSAGES/sanitycheck.po @@ -0,0 +1,11 @@ +msgid "These checks failed:" +msgstr "De volgende controles zijn mislukt:" + +msgid "These checks succeeded:" +msgstr "De volgende controles zijn geslaagd:" + +msgid "{sanitycheck:strings:link_sanitycheck}" +msgstr "Sanity check van je SimpleSAMLphp setup" + +msgid "Sanity check of your SimpleSAMLphp setup" +msgstr "Sanity check van je SimpleSAMLphp setup" diff --git a/vendor/simplesamlphp/simplesamlphp/modules/sanitycheck/locales/nn/LC_MESSAGES/sanitycheck.po b/vendor/simplesamlphp/simplesamlphp/modules/sanitycheck/locales/nn/LC_MESSAGES/sanitycheck.po new file mode 100644 index 0000000000..e3e4c989f9 --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/modules/sanitycheck/locales/nn/LC_MESSAGES/sanitycheck.po @@ -0,0 +1,11 @@ +msgid "These checks failed:" +msgstr "These checks failed:" + +msgid "These checks succeeded:" +msgstr "Desse sjekkane var suksessfulle:" + +msgid "{sanitycheck:strings:link_sanitycheck}" +msgstr "Sjekk din installasjon" + +msgid "Sanity check of your SimpleSAMLphp setup" +msgstr "Sjekk din installasjon" diff --git a/vendor/simplesamlphp/simplesamlphp/modules/sanitycheck/templates/check.tpl.php b/vendor/simplesamlphp/simplesamlphp/modules/sanitycheck/templates/check.tpl.php index cf34bff612..ba9f69ada6 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/sanitycheck/templates/check.tpl.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/sanitycheck/templates/check.tpl.php @@ -2,44 +2,28 @@ $this->data['header'] = 'Sanity check'; $this->includeAtTemplateBase('includes/header.php'); -?> - -<h2><?php echo($this->data['header']); ?></h2> - -<?php +echo '<h2>'.$this->data['header'].'</h2>'; if (count($this->data['errors']) > 0) { -?> -<div style="border: 1px solid #800; background: #caa; margin: 1em; padding: .5em"> -<p><?php echo '<img class="float-r" src="/' . $this->data['baseurlpath'] . 'resources/icons/silk/delete.png" alt="Failed" />'; ?> -These checks failed:</p> -<?php - - echo '<ul>'; - foreach ($this->data['errors'] AS $err) { - echo '<li>' . $err . '</li>'; - } - echo '</ul>'; - -echo '</div>'; + echo '<div style="border: 1px solid #800; background: #caa; margin: 1em; padding: .5em">'; + echo '<p><img class="float-r" src="/'.$this->data['baseurlpath']. + 'resources/icons/silk/delete.png" alt="Failed" />These checks failed:</p>'; + echo '<ul>'; + foreach ($this->data['errors'] as $err) { + echo '<li>'.$err.'</li>'; + } } ?> - + </ul> +</div> <?php if (count($this->data['info']) > 0) { -?> -<div style="border: 1px solid #ccc; background: #eee; margin: 1em; padding: .5em"> -<p><?php echo '<img class="float-r" src="/' . $this->data['baseurlpath'] . 'resources/icons/silk/accept.png" alt="OK" />'; ?> -These checks succeeded:</p> -<?php - echo '<ul>'; - foreach ($this->data['info'] AS $i) { - echo '<li>' . $i . '</li>'; - } - echo '</ul>'; - - -echo '</div>'; + echo '<div style="border: 1px solid #ccc; background: #eee; margin: 1em; padding: .5em">'; + echo '<p><img class="float-r" src="/'.$this->data['baseurlpath']. + 'resources/icons/silk/accept.png" alt="OK" />These checks succeeded:</p>'; + echo '<ul>'; + foreach ($this->data['info'] as $i) { + echo '<li>'.$i.'</li>'; + } } -?> - -<?php $this->includeAtTemplateBase('includes/footer.php'); ?> \ No newline at end of file +echo '</ul></div>'; +$this->includeAtTemplateBase('includes/footer.php'); diff --git a/vendor/simplesamlphp/simplesamlphp/modules/sanitycheck/templates/check.twig b/vendor/simplesamlphp/simplesamlphp/modules/sanitycheck/templates/check.twig index ab53e5c5fd..fe51f41809 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/sanitycheck/templates/check.twig +++ b/vendor/simplesamlphp/simplesamlphp/modules/sanitycheck/templates/check.twig @@ -5,30 +5,41 @@ <h2>{{ pagetitle }}</h2> {% if errors %} -<div style="border: 1px solid #800; background: #caa; margin: 1em; padding: .5em"> -<p><img class="float-r" src="/{{ baseurlpath }}resources/icons/silk/delete.png" alt="Failed" /> -These checks failed:</p> - -<ul> -{% for err in errors %} - <li>{{ err }}</li> -{% endfor %} -</ul> +<div class="message-box error"> + <div class="pure-g"> + <div class="pure-u-1-12"> + <span class="fa fa-times-circle fa-2x"></span> + </div> + <div class="pure-u-11-12"> + <p>{{ 'These checks failed:'|trans }}</p> + + <ul class="error-list"> + {% for err in errors %} + <li>{{ err }}</li> + {% endfor %} + </ul> + </div> + </div> </div> {% endif %} {% if info %} -<div style="border: 1px solid #ccc; background: #eee; margin: 1em; padding: .5em"> -<p><img class="float-r" src="/{{ baseurlpath }}resources/icons/silk/accept.png" alt="OK" /> -These checks succeeded:</p> - -<ul> -{% for i in info %} - <li>{{ i }}</li> -{% endfor %} -</ul> - +<div class="message-box success"> + <div class="pure-g"> + <div class="pure-u-1-12"> + <span class="fa fa-check fa-2x"> </span> + </div> + <div class="pure-u-11-12"> + <p>{{ 'These checks succeeded:'|trans }}</p> + + <ul> + {% for i in info %} + <li>{{ i }}</li> + {% endfor %} + </ul> + </div> + </div> </div> {% endif %} diff --git a/vendor/simplesamlphp/simplesamlphp/modules/sanitycheck/www/index.php b/vendor/simplesamlphp/simplesamlphp/modules/sanitycheck/www/index.php index e365db28d5..8946bad073 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/sanitycheck/www/index.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/sanitycheck/www/index.php @@ -1,17 +1,16 @@ <?php -$config = SimpleSAML_Configuration::getInstance(); +$config = \SimpleSAML\Configuration::getInstance(); -$info = array(); -$errors = array(); -$hookinfo = array( +$info = []; +$errors = []; +$hookinfo = [ 'info' => &$info, 'errors' => &$errors, -); -SimpleSAML\Module::callHooks('sanitycheck', $hookinfo); +]; +\SimpleSAML\Module::callHooks('sanitycheck', $hookinfo); if (isset($_REQUEST['output']) && $_REQUEST['output'] == 'text') { - if (count($errors) === 0) { echo 'OK'; } else { @@ -20,7 +19,7 @@ exit; } -$t = new SimpleSAML_XHTML_Template($config, 'sanitycheck:check.tpl.php'); +$t = new \SimpleSAML\XHTML\Template($config, 'sanitycheck:check.tpl.php'); $t->data['pageid'] = 'sanitycheck'; $t->data['errors'] = $errors; $t->data['info'] = $info; diff --git a/vendor/simplesamlphp/simplesamlphp/modules/smartattributes/docs/smartattributes.md b/vendor/simplesamlphp/simplesamlphp/modules/smartattributes/docs/smartattributes.md index 0c2c8c1369..06fd241410 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/smartattributes/docs/smartattributes.md +++ b/vendor/simplesamlphp/simplesamlphp/modules/smartattributes/docs/smartattributes.md @@ -17,11 +17,12 @@ The filter has the following configuration options: * `candidates`. An array of attributes names to consider as the identifier attribute. Defaults to: * eduPersonTargetedID * eduPersonPrincipalName + * pairwise-id + * subject-id * openid * facebook_targetedID * twitter_targetedID * windowslive_targetedID - * myspace_targetedID * linkedin_targetedID * `id_attribute`. A string to use as the name of the newly added attribute. Defaults to `smart_id`. * `add_authority`. A boolean to indicate whether or not to append the SAML AuthenticatingAuthority to the resulting identifier. This can be useful to indicate what SAML IdP was used, in case the original identifier is not scoped. Defaults to `TRUE`. diff --git a/vendor/simplesamlphp/simplesamlphp/modules/smartattributes/lib/Auth/Process/SmartID.php b/vendor/simplesamlphp/simplesamlphp/modules/smartattributes/lib/Auth/Process/SmartID.php index 7e7e921e72..00ca468eae 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/smartattributes/lib/Auth/Process/SmartID.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/smartattributes/lib/Auth/Process/SmartID.php @@ -1,117 +1,125 @@ <?php -class sspmod_smartattributes_Auth_Process_SmartID extends SimpleSAML_Auth_ProcessingFilter { - - /** - * Which attributes to use as identifiers? - * - * IMPORTANT: If you use the (default) attributemaps (twitter2name, facebook2name, - * etc., be sure to comment out the entries that map xxx_targetedID to - * eduPersonTargetedID, or there will be no way to see its origin any more. - */ - private $_candidates = array( - 'eduPersonTargetedID', - 'eduPersonPrincipalName', - 'openid', - 'facebook_targetedID', - 'twitter_targetedID', - 'windowslive_targetedID', - 'myspace_targetedID', - 'linkedin_targetedID', - ); - - /** - * The name of the generated ID attribute. - */ - private $_id_attribute = 'smart_id'; - - /** - * Whether to append the AuthenticatingAuthority, separated by '!' - * This only works when SSP is used as a gateway. - */ - private $_add_authority = true; - - /** - * Whether to prepend the CandidateID, separated by ':' - */ - private $_add_candidate = true; - - /** - * Attributes which should be added/appended. - * - * Associative array of arrays. - */ - private $attributes = array(); - - - public function __construct($config, $reserved) { - parent::__construct($config, $reserved); - - assert('is_array($config)'); - - if (array_key_exists('candidates', $config)) { - $this->_candidates = $config['candidates']; - if (!is_array($this->_candidates)) { - throw new Exception('SmartID authproc configuration error: \'candidates\' should be an array.'); - } - } - - if (array_key_exists('id_attribute', $config)) { - $this->_id_attribute = $config['id_attribute']; - if (!is_string($this->_id_attribute)) { - throw new Exception('SmartID authproc configuration error: \'id_attribute\' should be a string.'); - } - } - - if (array_key_exists('add_authority', $config)) { - $this->_add_authority = $config['add_authority']; - if (!is_bool($this->_add_authority)) { - throw new Exception('SmartID authproc configuration error: \'add_authority\' should be a boolean.'); - } - } - - if (array_key_exists('add_candidate', $config)) { - $this->_add_candidate = $config['add_candidate']; - if (!is_bool($this->_add_candidate)) { - throw new Exception('SmartID authproc configuration error: \'add_candidate\' should be a boolean.'); - } - } - - } - - private function addID($attributes, $request) { - foreach ($this->_candidates as $idCandidate) { - if (isset($attributes[$idCandidate][0])) { - if(($this->_add_authority) && (isset($request['saml:AuthenticatingAuthority'][0]))) { - return ($this->_add_candidate ? $idCandidate.':' : '').$attributes[$idCandidate][0] . '!' . $request['saml:AuthenticatingAuthority'][0]; - } else { - return ($this->_add_candidate ? $idCandidate.':' : '').$attributes[$idCandidate][0]; - } - } - } - /* - * At this stage no usable id_candidate has been detected. - */ - throw new SimpleSAML_Error_Exception('This service needs at least one of the following - attributes to identity users: '.implode(', ', $this->_candidates).'. Unfortunately not - one of them was detected. Please ask your institution administrator to release one of - them, or try using another identity provider.'); - } - - - /** - * Apply filter to add or replace attributes. - * - * Add or replace existing attributes with the configured values. - * - * @param array &$request The current request - */ - public function process(&$request) { - assert('is_array($request)'); - assert('array_key_exists("Attributes", $request)'); - - $ID = $this->addID($request['Attributes'], $request); - - if(isset($ID)) $request['Attributes'][$this->_id_attribute] = array($ID); - } +namespace SimpleSAML\Module\smartattributes\Auth\Process; + +class SmartID extends \SimpleSAML\Auth\ProcessingFilter +{ + /** + * Which attributes to use as identifiers? + * + * IMPORTANT: If you use the (default) attributemaps (twitter2name, facebook2name, + * etc., be sure to comment out the entries that map xxx_targetedID to + * eduPersonTargetedID, or there will be no way to see its origin any more. + */ + private $candidates = [ + 'eduPersonTargetedID', + 'eduPersonPrincipalName', + 'pairwise-id', + 'subject-id', + 'openid', + 'facebook_targetedID', + 'twitter_targetedID', + 'windowslive_targetedID', + 'linkedin_targetedID', + ]; + + /** + * The name of the generated ID attribute. + */ + private $id_attribute = 'smart_id'; + + /** + * Whether to append the AuthenticatingAuthority, separated by '!' + * This only works when SSP is used as a gateway. + */ + private $add_authority = true; + + /** + * Whether to prepend the CandidateID, separated by ':' + */ + private $add_candidate = true; + + /** + * Attributes which should be added/appended. + * + * Associative array of arrays. + */ + private $attributes = []; + + + public function __construct($config, $reserved) + { + parent::__construct($config, $reserved); + + assert(is_array($config)); + + if (array_key_exists('candidates', $config)) { + $this->candidates = $config['candidates']; + if (!is_array($this->candidates)) { + throw new \Exception('SmartID authproc configuration error: \'candidates\' should be an array.'); + } + } + + if (array_key_exists('id_attribute', $config)) { + $this->id_attribute = $config['id_attribute']; + if (!is_string($this->id_attribute)) { + throw new \Exception('SmartID authproc configuration error: \'id_attribute\' should be a string.'); + } + } + + if (array_key_exists('add_authority', $config)) { + $this->add_authority = $config['add_authority']; + if (!is_bool($this->add_authority)) { + throw new \Exception('SmartID authproc configuration error: \'add_authority\' should be a boolean.'); + } + } + + if (array_key_exists('add_candidate', $config)) { + $this->add_candidate = $config['add_candidate']; + if (!is_bool($this->add_candidate)) { + throw new \Exception('SmartID authproc configuration error: \'add_candidate\' should be a boolean.'); + } + } + } + + private function addID($attributes, $request) + { + $state = $request['saml:sp:State']; + foreach ($this->candidates as $idCandidate) { + if (isset($attributes[$idCandidate][0])) { + if (($this->add_authority) && (isset($state['saml:AuthenticatingAuthority'][0]))) { + return ($this->add_candidate ? $idCandidate.':' : '').$attributes[$idCandidate][0].'!'. + $state['saml:AuthenticatingAuthority'][0]; + } else { + return ($this->add_candidate ? $idCandidate.':' : '').$attributes[$idCandidate][0]; + } + } + } + /* + * At this stage no usable id_candidate has been detected. + */ + throw new \SimpleSAML\Error\Exception('This service needs at least one of the following + attributes to identity users: '.implode(', ', $this->candidates).'. Unfortunately not + one of them was detected. Please ask your institution administrator to release one of + them, or try using another identity provider.'); + } + + /** + * Apply filter to add or replace attributes. + * + * Add or replace existing attributes with the configured values. + * + * @param array &$request The current request + */ + public function process(&$request) + { + assert(is_array($request)); + assert(array_key_exists('Attributes', $request)); + + $id = $this->addID($request['Attributes'], $request); + + if (isset($id)) { + $request['Attributes'][$this->id_attribute] = [$id]; + } + } } diff --git a/vendor/simplesamlphp/simplesamlphp/modules/smartattributes/lib/Auth/Process/SmartName.php b/vendor/simplesamlphp/simplesamlphp/modules/smartattributes/lib/Auth/Process/SmartName.php index c77ef7379f..19a69baa6f 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/smartattributes/lib/Auth/Process/SmartName.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/smartattributes/lib/Auth/Process/SmartName.php @@ -1,76 +1,92 @@ <?php +namespace SimpleSAML\Module\smartattributes\Auth\Process; + /** * Filter to set name in a smart way, based on available name attributes. * * @author Andreas Åkre Solberg, UNINETT AS. * @package SimpleSAMLphp */ -class sspmod_smartattributes_Auth_Process_SmartName extends SimpleSAML_Auth_ProcessingFilter { - - /** - * Attributes which should be added/appended. - * - * Assiciative array of arrays. - */ - private $attributes = array(); - - - private function getFullName($attributes) { - if (isset($attributes['displayName'])) - return $attributes['displayName'][0]; - - if (isset($attributes['cn'])) { - if (count(explode(' ', $attributes['cn'][0])) > 1) - return $attributes['cn'][0]; - } - - if (isset($attributes['sn']) && isset($attributes['givenName'])) - return $attributes['givenName'][0] . ' ' . $attributes['sn'][0]; - - if (isset($attributes['cn'])) - return $attributes['cn'][0]; - - if (isset($attributes['sn'])) - return $attributes['sn'][0]; - - if (isset($attributes['givenName'])) - return $attributes['givenName'][0]; - - if (isset($attributes['eduPersonPrincipalName'])) { - $localname = $this->getLocalUser($attributes['eduPersonPrincipalName'][0]); - if (isset($localname)) return $localname; - } - - return NULL; - } - - private function getLocalUser($userid) { - if (strpos($userid, '@') === FALSE) return NULL; - $decomposed = explode('@', $userid); - if(count($decomposed) === 2) { - return $decomposed[0]; - } - return NULL; - } - - /** - * Apply filter to add or replace attributes. - * - * Add or replace existing attributes with the configured values. - * - * @param array &$request The current request - */ - public function process(&$request) { - assert('is_array($request)'); - assert('array_key_exists("Attributes", $request)'); - - $attributes =& $request['Attributes']; - - $fullname = $this->getFullName($attributes); - - if(isset($fullname)) $request['Attributes']['smartname-fullname'] = array($fullname); - - } +class SmartName extends \SimpleSAML\Auth\ProcessingFilter +{ + /** + * Attributes which should be added/appended. + * + * Assiciative array of arrays. + */ + private $attributes = []; + + + private function getFullName($attributes) + { + if (isset($attributes['displayName'])) { + return $attributes['displayName'][0]; + } + + if (isset($attributes['cn'])) { + if (count(explode(' ', $attributes['cn'][0])) > 1) { + return $attributes['cn'][0]; + } + } + + if (isset($attributes['sn']) && isset($attributes['givenName'])) { + return $attributes['givenName'][0].' '.$attributes['sn'][0]; + } + + if (isset($attributes['cn'])) { + return $attributes['cn'][0]; + } + + if (isset($attributes['sn'])) { + return $attributes['sn'][0]; + } + + if (isset($attributes['givenName'])) { + return $attributes['givenName'][0]; + } + + if (isset($attributes['eduPersonPrincipalName'])) { + $localname = $this->getLocalUser($attributes['eduPersonPrincipalName'][0]); + if (isset($localname)) { + return $localname; + } + } + + return null; + } + + private function getLocalUser($userid) + { + if (strpos($userid, '@') === false) { + return null; + } + $decomposed = explode('@', $userid); + if (count($decomposed) === 2) { + return $decomposed[0]; + } + return null; + } + + /** + * Apply filter to add or replace attributes. + * + * Add or replace existing attributes with the configured values. + * + * @param array &$request The current request + */ + public function process(&$request) + { + assert(is_array($request)); + assert(array_key_exists('Attributes', $request)); + + $attributes = &$request['Attributes']; + + $fullname = $this->getFullName($attributes); + + if (isset($fullname)) { + $request['Attributes']['smartname-fullname'] = [$fullname]; + } + } } diff --git a/vendor/simplesamlphp/simplesamlphp/modules/authmyspace/default-disable b/vendor/simplesamlphp/simplesamlphp/modules/sqlauth/default-disable similarity index 100% rename from vendor/simplesamlphp/simplesamlphp/modules/authmyspace/default-disable rename to vendor/simplesamlphp/simplesamlphp/modules/sqlauth/default-disable diff --git a/vendor/simplesamlphp/simplesamlphp/modules/sqlauth/default-enable b/vendor/simplesamlphp/simplesamlphp/modules/sqlauth/default-enable deleted file mode 100644 index 25615cb47c..0000000000 --- a/vendor/simplesamlphp/simplesamlphp/modules/sqlauth/default-enable +++ /dev/null @@ -1,3 +0,0 @@ -This file indicates that the default state of this module -is enabled. To disable, create a file named disable in the -same directory as this file. diff --git a/vendor/simplesamlphp/simplesamlphp/modules/sqlauth/lib/Auth/Source/SQL.php b/vendor/simplesamlphp/simplesamlphp/modules/sqlauth/lib/Auth/Source/SQL.php index 793a863281..b820a6a3e4 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/sqlauth/lib/Auth/Source/SQL.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/sqlauth/lib/Auth/Source/SQL.php @@ -1,5 +1,7 @@ <?php +namespace SimpleSAML\Module\sqlauth\Auth\Source; + /** * Simple SQL authentication source * @@ -8,186 +10,190 @@ * * @package SimpleSAMLphp */ -class sspmod_sqlauth_Auth_Source_SQL extends sspmod_core_Auth_UserPassBase { - - - /** - * The DSN we should connect to. - */ - private $dsn; - - - /** - * The username we should connect to the database with. - */ - private $username; - - - /** - * The password we should connect to the database with. - */ - private $password; - - - /** - * The query we should use to retrieve the attributes for the user. - * - * The username and password will be available as :username and :password. - */ - private $query; - - - /** - * Constructor for this authentication source. - * - * @param array $info Information about this authentication source. - * @param array $config Configuration. - */ - public function __construct($info, $config) { - assert('is_array($info)'); - assert('is_array($config)'); - - // Call the parent constructor first, as required by the interface - parent::__construct($info, $config); - - // Make sure that all required parameters are present. - foreach (array('dsn', 'username', 'password', 'query') as $param) { - if (!array_key_exists($param, $config)) { - throw new Exception('Missing required attribute \'' . $param . - '\' for authentication source ' . $this->authId); - } - - if (!is_string($config[$param])) { - throw new Exception('Expected parameter \'' . $param . - '\' for authentication source ' . $this->authId . - ' to be a string. Instead it was: ' . - var_export($config[$param], TRUE)); - } - } - - $this->dsn = $config['dsn']; - $this->username = $config['username']; - $this->password = $config['password']; - $this->query = $config['query']; - } - - - /** - * Create a database connection. - * - * @return PDO The database connection. - */ - private function connect() { - try { - $db = new PDO($this->dsn, $this->username, $this->password); - } catch (PDOException $e) { - throw new Exception('sqlauth:' . $this->authId . ': - Failed to connect to \'' . - $this->dsn . '\': '. $e->getMessage()); - } - - $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); - - - $driver = explode(':', $this->dsn, 2); - $driver = strtolower($driver[0]); - - /* Driver specific initialization. */ - switch ($driver) { - case 'mysql': - /* Use UTF-8. */ - $db->exec("SET NAMES 'utf8mb4'"); - break; - case 'pgsql': - /* Use UTF-8. */ - $db->exec("SET NAMES 'UTF8'"); - break; - } - - return $db; - } - - - /** - * Attempt to log in using the given username and password. - * - * On a successful login, this function should return the users attributes. On failure, - * it should throw an exception. If the error was caused by the user entering the wrong - * username or password, a SimpleSAML_Error_Error('WRONGUSERPASS') should be thrown. - * - * Note that both the username and the password are UTF-8 encoded. - * - * @param string $username The username the user wrote. - * @param string $password The password the user wrote. - * @return array Associative array with the users attributes. - */ - protected function login($username, $password) { - assert('is_string($username)'); - assert('is_string($password)'); - - $db = $this->connect(); - - try { - $sth = $db->prepare($this->query); - } catch (PDOException $e) { - throw new Exception('sqlauth:' . $this->authId . - ': - Failed to prepare query: ' . $e->getMessage()); - } - - try { - $res = $sth->execute(array('username' => $username, 'password' => $password)); - } catch (PDOException $e) { - throw new Exception('sqlauth:' . $this->authId . - ': - Failed to execute query: ' . $e->getMessage()); - } - - try { - $data = $sth->fetchAll(PDO::FETCH_ASSOC); - } catch (PDOException $e) { - throw new Exception('sqlauth:' . $this->authId . - ': - Failed to fetch result set: ' . $e->getMessage()); - } - - SimpleSAML\Logger::info('sqlauth:' . $this->authId . ': Got ' . count($data) . - ' rows from database'); - - if (count($data) === 0) { - /* No rows returned - invalid username/password. */ - SimpleSAML\Logger::error('sqlauth:' . $this->authId . - ': No rows in result set. Probably wrong username/password.'); - throw new SimpleSAML_Error_Error('WRONGUSERPASS'); - } - - /* Extract attributes. We allow the resultset to consist of multiple rows. Attributes - * which are present in more than one row will become multivalued. NULL values and - * duplicate values will be skipped. All values will be converted to strings. - */ - $attributes = array(); - foreach ($data as $row) { - foreach ($row as $name => $value) { - - if ($value === NULL) { - continue; - } - - $value = (string)$value; - - if (!array_key_exists($name, $attributes)) { - $attributes[$name] = array(); - } - - if (in_array($value, $attributes[$name], TRUE)) { - /* Value already exists in attribute. */ - continue; - } - - $attributes[$name][] = $value; - } - } - - SimpleSAML\Logger::info('sqlauth:' . $this->authId . ': Attributes: ' . - implode(',', array_keys($attributes))); - - return $attributes; - } +class SQL extends \SimpleSAML\Module\core\Auth\UserPassBase +{ + /** + * The DSN we should connect to. + */ + private $dsn; + + /** + * The username we should connect to the database with. + */ + private $username; + + /** + * The password we should connect to the database with. + */ + private $password; + + /** + * The options that we should connect to the database with. + */ + private $options; + + /** + * The query we should use to retrieve the attributes for the user. + * + * The username and password will be available as :username and :password. + */ + private $query; + + /** + * Constructor for this authentication source. + * + * @param array $info Information about this authentication source. + * @param array $config Configuration. + */ + public function __construct($info, $config) + { + assert(is_array($info)); + assert(is_array($config)); + + // Call the parent constructor first, as required by the interface + parent::__construct($info, $config); + + // Make sure that all required parameters are present. + foreach (['dsn', 'username', 'password', 'query'] as $param) { + if (!array_key_exists($param, $config)) { + throw new \Exception('Missing required attribute \''.$param. + '\' for authentication source '.$this->authId); + } + + if (!is_string($config[$param])) { + throw new \Exception('Expected parameter \''.$param. + '\' for authentication source '.$this->authId. + ' to be a string. Instead it was: '. + var_export($config[$param], true)); + } + } + + $this->dsn = $config['dsn']; + $this->username = $config['username']; + $this->password = $config['password']; + $this->query = $config['query']; + if (isset($config['options'])) { + $this->options = $config['options']; + } + } + + + /** + * Create a database connection. + * + * @return \PDO The database connection. + */ + private function connect() + { + try { + $db = new \PDO($this->dsn, $this->username, $this->password, $this->options); + } catch (\PDOException $e) { + throw new \Exception('sqlauth:'.$this->authId.': - Failed to connect to \''. + $this->dsn.'\': '.$e->getMessage()); + } + + $db->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION); + + $driver = explode(':', $this->dsn, 2); + $driver = strtolower($driver[0]); + + // Driver specific initialization + switch ($driver) { + case 'mysql': + // Use UTF-8 + $db->exec("SET NAMES 'utf8mb4'"); + break; + case 'pgsql': + // Use UTF-8 + $db->exec("SET NAMES 'UTF8'"); + break; + } + + return $db; + } + + + /** + * Attempt to log in using the given username and password. + * + * On a successful login, this function should return the users attributes. On failure, + * it should throw an exception. If the error was caused by the user entering the wrong + * username or password, a \SimpleSAML\Error\Error('WRONGUSERPASS') should be thrown. + * + * Note that both the username and the password are UTF-8 encoded. + * + * @param string $username The username the user wrote. + * @param string $password The password the user wrote. + * @return array Associative array with the users attributes. + */ + protected function login($username, $password) + { + assert(is_string($username)); + assert(is_string($password)); + + $db = $this->connect(); + + try { + $sth = $db->prepare($this->query); + } catch (\PDOException $e) { + throw new \Exception('sqlauth:'.$this->authId. + ': - Failed to prepare query: '.$e->getMessage()); + } + + try { + $sth->execute(['username' => $username, 'password' => $password]); + } catch (\PDOException $e) { + throw new \Exception('sqlauth:'.$this->authId. + ': - Failed to execute query: '.$e->getMessage()); + } + + try { + $data = $sth->fetchAll(\PDO::FETCH_ASSOC); + } catch (\PDOException $e) { + throw new \Exception('sqlauth:'.$this->authId. + ': - Failed to fetch result set: '.$e->getMessage()); + } + + \SimpleSAML\Logger::info('sqlauth:'.$this->authId.': Got '.count($data). + ' rows from database'); + + if (count($data) === 0) { + // No rows returned - invalid username/password + \SimpleSAML\Logger::error('sqlauth:'.$this->authId. + ': No rows in result set. Probably wrong username/password.'); + throw new \SimpleSAML\Error\Error('WRONGUSERPASS'); + } + + /* Extract attributes. We allow the resultset to consist of multiple rows. Attributes + * which are present in more than one row will become multivalued. null values and + * duplicate values will be skipped. All values will be converted to strings. + */ + $attributes = []; + foreach ($data as $row) { + foreach ($row as $name => $value) { + if ($value === null) { + continue; + } + + $value = (string) $value; + + if (!array_key_exists($name, $attributes)) { + $attributes[$name] = []; + } + + if (in_array($value, $attributes[$name], true)) { + // Value already exists in attribute + continue; + } + + $attributes[$name][] = $value; + } + } + + \SimpleSAML\Logger::info('sqlauth:'.$this->authId.': Attributes: '. + implode(',', array_keys($attributes))); + + return $attributes; + } } diff --git a/vendor/simplesamlphp/simplesamlphp/modules/statistics/bin/loganalyzer.php b/vendor/simplesamlphp/simplesamlphp/modules/statistics/bin/loganalyzer.php index bf9a164189..85ae093f3e 100755 --- a/vendor/simplesamlphp/simplesamlphp/modules/statistics/bin/loganalyzer.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/statistics/bin/loganalyzer.php @@ -5,18 +5,18 @@ $baseDir = dirname(dirname(dirname(dirname(__FILE__)))); // Add library autoloader. -require_once($baseDir . '/lib/_autoload.php'); +require_once($baseDir.'/lib/_autoload.php'); // Initialize the configuration. -$configdir = SimpleSAML\Utils\Config::getConfigDir(); -SimpleSAML_Configuration::setConfigDir($configdir); -SimpleSAML\Utils\Time::initTimezone(); +$configdir = \SimpleSAML\Utils\Config::getConfigDir(); +\SimpleSAML\Configuration::setConfigDir($configdir); +\SimpleSAML\Utils\Time::initTimezone(); $progName = array_shift($argv); $debug = false; $dryrun = false; -foreach($argv as $a) { +foreach ($argv as $a) { if (strlen($a) === 0) { continue; } @@ -29,7 +29,7 @@ } // Map short options to long options. - $shortOptMap = array('-d' => '--debug'); + $shortOptMap = ['-d' => '--debug']; if (array_key_exists($a, $shortOptMap)) { $a = $shortOptMap[$a]; } @@ -44,13 +44,13 @@ $dryrun = true; break; default: - echo('Unknown option: ' . $a . "\n"); - echo('Please run `' . $progName . ' --help` for usage information.' . "\n"); + echo 'Unknown option: '.$a."\n"; + echo 'Please run `'.$progName.' --help` for usage information.'."\n"; exit(1); } } -$aggregator = new sspmod_statistics_Aggregator(true); +$aggregator = new \SimpleSAML\Module\statistics\Aggregator(true); $aggregator->dumpConfig(); $aggregator->debugInfo(); $results = $aggregator->aggregate($debug); @@ -60,9 +60,9 @@ $aggregator->store($results); } -foreach ($results AS $slot => $val) { - foreach ($val AS $sp => $no) { - echo $sp . " " . count($no) . " - "; +foreach ($results as $slot => $val) { + foreach ($val as $sp => $no) { + echo $sp." ".count($no)." - "; } echo "\n"; } @@ -72,7 +72,8 @@ * This function prints the help output. */ -function printHelp() { +function printHelp() +{ global $progName; echo <<<END @@ -84,6 +85,4 @@ function printHelp() { -d, --debug Used when configuring the log file syntax. See doc. --dry-run Aggregate but do not store the results. END; - } - diff --git a/vendor/simplesamlphp/simplesamlphp/modules/statistics/bin/logcleaner.php b/vendor/simplesamlphp/simplesamlphp/modules/statistics/bin/logcleaner.php index b845a13960..b160cdab27 100755 --- a/vendor/simplesamlphp/simplesamlphp/modules/statistics/bin/logcleaner.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/statistics/bin/logcleaner.php @@ -5,11 +5,11 @@ $baseDir = dirname(dirname(dirname(dirname(__FILE__)))); // Add library autoloader. -require_once($baseDir . '/lib/_autoload.php'); +require_once($baseDir.'/lib/_autoload.php'); // Initialize the configuration. -$configdir = SimpleSAML\Utils\Config::getConfigDir(); -SimpleSAML_Configuration::setConfigDir($configdir); +$configdir = \SimpleSAML\Utils\Config::getConfigDir(); +\SimpleSAML\Configuration::setConfigDir($configdir); $progName = array_shift($argv); $debug = false; @@ -30,7 +30,7 @@ } // Map short options to long options. - $shortOptMap = array('-d' => '--debug'); + $shortOptMap = ['-d' => '--debug']; if (array_key_exists($a, $shortOptMap)) { $a = $shortOptMap[$a]; } @@ -52,17 +52,17 @@ $output = $v; break; default: - echo('Unknown option: ' . $a . "\n"); - echo('Please run `' . $progName . ' --help` for usage information.' . "\n"); + echo 'Unknown option: '.$a."\n"; + echo 'Please run `'.$progName.' --help` for usage information.'."\n"; exit(1); } } -$cleaner = new sspmod_statistics_LogCleaner($infile); +$cleaner = new \SimpleSAML\Module\statistics\LogCleaner($infile); $cleaner->dumpConfig(); $todelete = $cleaner->clean($debug); -echo "Cleaning these trackIDs: " . join(', ', $todelete) . "\n"; +echo "Cleaning these trackIDs: ".join(', ', $todelete)."\n"; if (!$dryrun) { $cleaner->store($todelete, $output); @@ -72,7 +72,8 @@ * This function prints the help output. */ -function printHelp() { +function printHelp() +{ global $progName; echo <<<END @@ -89,4 +90,3 @@ function printHelp() { END; } - diff --git a/vendor/simplesamlphp/simplesamlphp/modules/statistics/config-templates/module_statistics.php b/vendor/simplesamlphp/simplesamlphp/modules/statistics/config-templates/module_statistics.php index 89c97c4250..9e186dc290 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/statistics/config-templates/module_statistics.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/statistics/config-templates/module_statistics.php @@ -1,10 +1,9 @@ <?php -/* +/* * The configuration of SimpleSAMLphp statistics package */ -$config = array ( - +$config = [ // Authentication & authorization for statistics // Whether the statistics require authentication before use. @@ -24,165 +23,168 @@ 'statdir' => '/tmp/stats/', 'inputfile' => '/var/log/simplesamlphp.stat', - 'offset' => 60*60*2 + 60*60*24*3, // Two hours offset to match epoch and norwegian winter time. - + 'offset' => 60 * 60 * 2 + 60 * 60 * 24 * 3, // Two hours offset to match epoch and norwegian winter time. + 'datestart' => 1, 'datelength' => 15, 'offsetspan' => 21, - + // Dimensions on graph from Google Charts in pixels... 'dimension.x' => 800, 'dimension.y' => 350, - + /* * Do you want to generate statistics using the cron module? If so, specify which cron tag to use. * Examples: daily, weekly - * To not run statistics in cron, set value to + * To not run statistics in cron, set value to * 'cron_tag' => null, */ 'cron_tag' => 'daily', /* - * Set max running time for this script. This is also controlle by max_execution_time in php.ini - * and is defalut set to 30 sec. Your web server can have other timeout configurations that may + * Set max running time for this script. This is also controlled by max_execution_time in php.ini + * and is set to 30 sec by default. Your web server can have other timeout configurations that may * also interrupt PHP execution. Apache has a Timeout directive and IIS has a * CGI timeout function. Both default to 300 seconds. */ 'time_limit' => 300, - - 'timeres' => array( - 'day' => array( + + 'timeres' => [ + 'day' => [ 'name' => 'Day', - 'slot' => 60*15, // Slots of 15 minutes - 'fileslot' => 60*60*24, // One day (24 hours) file slots - 'axislabelint' => 6*4, // Number of slots per label. 4 per hour *6 = 6 hours - 'dateformat-period' => 'j. M', // 4. Mars - 'dateformat-intra' => 'j. M H:i', // 4. Mars 12:30 - ), - 'week' => array( + 'slot' => 60 * 15, // Slots of 15 minutes + 'fileslot' => 60 * 60 * 24, // One day (24 hours) file slots + 'axislabelint' => 6 * 4, // Number of slots per label. 4 per hour *6 = 6 hours + 'dateformat-period' => 'j. M', // 4. Mars + 'dateformat-intra' => 'j. M H:i', // 4. Mars 12:30 + ], + 'week' => [ 'name' => 'Week', - 'slot' => 60*60, // Slots of one hour - 'fileslot' => 60*60*24*7, // 7 days of data in each file - 'axislabelint' => 24, // Number of slots per label. 24 is one each day - 'dateformat-period' => 'j. M', // 4. Mars - 'dateformat-intra' => 'j. M H:i', // 4. Mars 12:30 - ), - 'month' => array( + 'slot' => 60 * 60, // Slots of one hour + 'fileslot' => 60 * 60 * 24 * 7, // 7 days of data in each file + 'axislabelint' => 24, // Number of slots per label. 24 is one each day + 'dateformat-period' => 'j. M', // 4. Mars + 'dateformat-intra' => 'j. M H:i', // 4. Mars 12:30 + ], + 'month' => [ 'name' => 'Month', - 'slot' => 60*60*24, // Slots of one day - 'fileslot' => 60*60*24*30, // 30 days of data in each file - 'axislabelint' => 7, // Number of slots per label. 7 days => 1 week - 'dateformat-period' => 'j. M Y H:i', // 4. Mars 12:30 - 'dateformat-intra' => 'j. M', // 4. Mars - ), - 'monthaligned' => array( + 'slot' => 60 * 60 * 24, // Slots of one day + 'fileslot' => 60 * 60 * 24 * 30, // 30 days of data in each file + 'axislabelint' => 7, // Number of slots per label. 7 days => 1 week + 'dateformat-period' => 'j. M Y H:i', // 4. Mars 12:30 + 'dateformat-intra' => 'j. M', // 4. Mars + ], + 'monthaligned' => [ 'name' => 'AlignedMonth', - 'slot' => 60*60*24, // Slots of one day - 'fileslot' => null, // 30 days of data in each file + 'slot' => 60 * 60 * 24, // Slots of one day + 'fileslot' => null, // 30 days of data in each file 'customDateHandler' => 'month', - 'axislabelint' => 7, // Number of slots per label. 7 days => 1 week - 'dateformat-period' => 'j. M Y H:i', // 4. Mars 12:30 - 'dateformat-intra' => 'j. M', // 4. Mars - ), - 'days180' => array( + 'axislabelint' => 7, // Number of slots per label. 7 days => 1 week + 'dateformat-period' => 'j. M Y H:i', // 4. Mars 12:30 + 'dateformat-intra' => 'j. M', // 4. Mars + ], + 'days180' => [ 'name' => '180 days', - 'slot' => 60*60*24, // Slots of 1 day (24 hours) - 'fileslot' => 60*60*24*180, // 80 days of data in each file - 'axislabelint' => 30, // Number of slots per label. 7 days => 1 week - 'dateformat-period' => 'j. M', // 4. Mars - 'dateformat-intra' => 'j. M', // 4. Mars - ), - ), + 'slot' => 60 * 60 * 24, // Slots of 1 day (24 hours) + 'fileslot' => 60 * 60 * 24 * 180, // 80 days of data in each file + 'axislabelint' => 30, // Number of slots per label. 7 days => 1 week + 'dateformat-period' => 'j. M', // 4. Mars + 'dateformat-intra' => 'j. M', // 4. Mars + ], + ], - 'statrules' => array( - 'sloratio' => array( + 'statrules' => [ + 'sloratio' => [ 'name' => 'SLO to SSO ratio', - 'descr' => 'Comparison of the number of Single Log-Out compared to Single Sign-On. Graph shows how many logouts where initiated for each Single Sign-On.', + 'descr' => 'Comparison of the number of Single Log-Out compared to Single Sign-On.'. + ' Graph shows how many logouts where initiated for each Single Sign-On.', 'type' => 'calculated', 'presenter' => 'statistics:Ratio', - 'ref' => array('slo', 'sso'), - 'fieldPresentation' => array( + 'ref' => ['slo', 'sso'], + 'fieldPresentation' => [ 'class' => 'statistics:Entity', 'config' => 'saml20-sp-remote', - ), - ), - 'ssomulti' => array( + ], + ], + 'ssomulti' => [ 'name' => 'Requests per session', - 'descr' => 'Number of SSO request pairs exchanged between IdP and SP within the same IdP session. A high number indicates that the session at the SP is timing out faster than at the IdP.', + 'descr' => 'Number of SSO request pairs exchanged between IdP and SP within the same IdP session.'. + ' A high number indicates that the session at the SP is timing out faster than at the IdP.', 'type' => 'calculated', 'presenter' => 'statistics:Ratio', - 'ref' => array('sso', 'ssofirst'), - 'fieldPresentation' => array( + 'ref' => ['sso', 'ssofirst'], + 'fieldPresentation' => [ 'class' => 'statistics:Entity', 'config' => 'saml20-sp-remote', - ), - ), - 'sso' => array( + ], + ], + 'sso' => [ 'name' => 'SSO to service', 'descr' => 'The number of logins at a Service Provider.', 'action' => 'saml20-idp-SSO', - 'col' => 6, // Service Provider EntityID - 'fieldPresentation' => array( + 'col' => 6, // Service Provider EntityID + 'fieldPresentation' => [ 'class' => 'statistics:Entity', 'config' => 'saml20-sp-remote', - ), - ), - 'ssofirst' => array( + ], + ], + 'ssofirst' => [ 'name' => 'SSO-first to service', 'descr' => 'The number of logins at a Service Provider.', 'action' => 'saml20-idp-SSO-first', - 'col' => 6, // Service Provider EntityID - 'fieldPresentation' => array( + 'col' => 6, // Service Provider EntityID + 'fieldPresentation' => [ 'class' => 'statistics:Entity', 'config' => 'saml20-sp-remote', - ), - ), - 'slo' => array( + ], + ], + 'slo' => [ 'name' => 'SLO initiated from service', 'descr' => 'The number of initated Sinlge Logout from each of the service providers.', 'action' => 'saml20-idp-SLO', - 'col' => 7, // Service Provider EntityID that initiated the logout. - 'fieldPresentation' => array( + 'col' => 7, // Service Provider EntityID that initiated the logout. + 'fieldPresentation' => [ 'class' => 'statistics:Entity', 'config' => 'saml20-sp-remote', - ), - ), - 'consent' => array( + ], + ], + 'consent' => [ 'name' => 'Consent', - 'descr' => 'Consent statistics. Everytime a user logs in to a service an entry is logged for one of three states: consent was found, consent was not found or consent storage was not available.', + 'descr' => 'Consent statistics. Everytime a user logs in to a service an entry is logged for'. + ' one of three states: consent was found, consent was not found or consent storage was not available.', 'action' => 'consent', 'col' => 6, - 'fieldPresentation' => array( + 'fieldPresentation' => [ 'class' => 'statistics:Entity', 'config' => 'saml20-sp-remote', - ), - ), - 'consentresponse' => array( + ], + ], + 'consentresponse' => [ 'name' => 'Consent response', - 'descr' => 'Consent response statistics. Everytime a user accepts consent, it is logged whether the user selected to remember the consent to next time.', + 'descr' => 'Consent response statistics. Everytime a user accepts consent,'. + ' it is logged whether the user selected to remember the consent to next time.', 'action' => 'consentResponse', 'col' => 6, - 'fieldPresentation' => array( + 'fieldPresentation' => [ 'class' => 'statistics:Entity', 'config' => 'saml20-sp-remote', - ), - ), - 'slopages' => array( + ], + ], + 'slopages' => [ 'name' => 'SLO iframe pages', 'descr' => 'The varioust IFrame SLO pages a user visits', 'action' => 'slo-iframe', - 'col' => 6, // Page the user visits. - ), - 'slofail' => array( + 'col' => 6, // Page the user visits. + ], + 'slofail' => [ 'name' => 'Failed iframe IdP-init SLOs', 'descr' => 'The number of logout failures from various SPs', 'action' => 'slo-iframe-fail', - 'col' => 6, // Service Provider EntityID that wasn't logged out. - 'fieldPresentation' => array( + 'col' => 6, // Service Provider EntityID that wasn't logged out. + 'fieldPresentation' => [ 'class' => 'statistics:Entity', 'config' => 'saml20-sp-remote', - ), - ), - ), - -); + ], + ], + ], +]; diff --git a/vendor/simplesamlphp/simplesamlphp/modules/statistics/dictionaries/statistics.definition.json b/vendor/simplesamlphp/simplesamlphp/modules/statistics/dictionaries/statistics.definition.json new file mode 100644 index 0000000000..065b7b4d38 --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/modules/statistics/dictionaries/statistics.definition.json @@ -0,0 +1,8 @@ +{ + "link_statistics": { + "en": "Show statistics" + }, + "link_statistics_metadata": { + "en": "Show statistics metadata" + } +} \ No newline at end of file diff --git a/vendor/simplesamlphp/simplesamlphp/modules/statistics/dictionaries/statistics.translation.json b/vendor/simplesamlphp/simplesamlphp/modules/statistics/dictionaries/statistics.translation.json new file mode 100644 index 0000000000..1f51b38387 --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/modules/statistics/dictionaries/statistics.translation.json @@ -0,0 +1,12 @@ +{ + "link_statistics": { + "es": "Mostrar estadísticas", + "no": "Vis statistikker", + "nn": "Vis statistikkar" + }, + "link_statistics_metadata": { + "es": "Mostrar metadatos de las estadísticas", + "no": "Vis metadata om statistikker", + "nn": "Vis metadata om statistikkar" + } +} diff --git a/vendor/simplesamlphp/simplesamlphp/modules/statistics/hooks/hook_configpage.php b/vendor/simplesamlphp/simplesamlphp/modules/statistics/hooks/hook_configpage.php new file mode 100644 index 0000000000..d9c1f1df78 --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/modules/statistics/hooks/hook_configpage.php @@ -0,0 +1,18 @@ +<?php +/** + * Hook to add the statistics module to the config page. + * + * @param \SimpleSAML\XHTML\Template &$template The template that we should alter in this hook. + */ +function statistics_hook_configpage(\SimpleSAML\XHTML\Template &$template) +{ + $template->data['links']['statistics'] = [ + 'href' => SimpleSAML\Module::getModuleURL('statistics/showstats.php'), + 'text' => \SimpleSAML\Locale\Translate::noop('Show statistics'), + ]; + $template->data['links']['statisticsmeta'] = [ + 'href' => SimpleSAML\Module::getModuleURL('statistics/statmeta.php'), + 'text' => \SimpleSAML\Locale\Translate::noop('Show statistics metadata'), + ]; + $template->getLocalization()->addModuleDomain('statistics'); +} diff --git a/vendor/simplesamlphp/simplesamlphp/modules/statistics/hooks/hook_cron.php b/vendor/simplesamlphp/simplesamlphp/modules/statistics/hooks/hook_cron.php index 8b15efb8a5..a3ee4952cc 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/statistics/hooks/hook_cron.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/statistics/hooks/hook_cron.php @@ -1,40 +1,42 @@ <?php + /** * Hook to run a cron job. * * @param array &$croninfo Output */ + function statistics_hook_cron(&$croninfo) { - assert('is_array($croninfo)'); - assert('array_key_exists("summary", $croninfo)'); - assert('array_key_exists("tag", $croninfo)'); + assert(is_array($croninfo)); + assert(array_key_exists('summary', $croninfo)); + assert(array_key_exists('tag', $croninfo)); + + $statconfig = \SimpleSAML\Configuration::getConfig('module_statistics.php'); - $statconfig = SimpleSAML_Configuration::getConfig('module_statistics.php'); - if (is_null($statconfig->getValue('cron_tag', null))) { return; } if ($statconfig->getValue('cron_tag', null) !== $croninfo['tag']) { return; } - + $maxtime = $statconfig->getInteger('time_limit', null); if ($maxtime) { set_time_limit($maxtime); } - + try { - $aggregator = new sspmod_statistics_Aggregator(); + $aggregator = new \SimpleSAML\Module\statistics\Aggregator(); $results = $aggregator->aggregate(); if (empty($results)) { - SimpleSAML\Logger::notice('Output from statistics aggregator was empty.'); + \SimpleSAML\Logger::notice('Output from statistics aggregator was empty.'); } else { $aggregator->store($results); } - } catch (Exception $e) { - $message = 'Loganalyzer threw exception: ' . $e->getMessage(); - SimpleSAML\Logger::warning($message); + } catch (\Exception $e) { + $message = 'Loganalyzer threw exception: '.$e->getMessage(); + \SimpleSAML\Logger::warning($message); $croninfo['summary'][] = $message; } } diff --git a/vendor/simplesamlphp/simplesamlphp/modules/statistics/hooks/hook_frontpage.php b/vendor/simplesamlphp/simplesamlphp/modules/statistics/hooks/hook_frontpage.php index 69a054b35f..2dade3b2af 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/statistics/hooks/hook_frontpage.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/statistics/hooks/hook_frontpage.php @@ -6,17 +6,17 @@ */ function statistics_hook_frontpage(&$links) { - assert('is_array($links)'); - assert('array_key_exists("links", $links)'); + assert(is_array($links)); + assert(array_key_exists('links', $links)); - $links['config']['statistics'] = array( + $links['config']['statistics'] = [ 'href' => SimpleSAML\Module::getModuleURL('statistics/showstats.php'), - 'text' => array('en' => 'Show statistics', 'no' => 'Vis statistikk'), - 'shorttext' => array('en' => 'Statistics', 'no' => 'Statistikk'), - ); - $links['config']['statisticsmeta'] = array( + 'text' => '{statistics:statistics:link_statistics}', + ]; + $links['config']['statisticsmeta'] = [ 'href' => SimpleSAML\Module::getModuleURL('statistics/statmeta.php'), - 'text' => array('en' => 'Show statistics metadata', 'no' => 'Vis statistikk metadata'), - 'shorttext' => array('en' => 'Statistics metadata', 'no' => 'Statistikk metadata'), - ); + 'text' => '{statistics:statistics:link_statistics_metadata}', + 'shorttext' => ['en' => 'Statistics metadata', 'no' => 'Statistikk metadata'], + ]; } + diff --git a/vendor/simplesamlphp/simplesamlphp/modules/statistics/hooks/hook_sanitycheck.php b/vendor/simplesamlphp/simplesamlphp/modules/statistics/hooks/hook_sanitycheck.php index ff84c27c80..879ee3ee78 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/statistics/hooks/hook_sanitycheck.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/statistics/hooks/hook_sanitycheck.php @@ -1,38 +1,39 @@ <?php /** - * Hook to do santity checks + * Hook to do sanity checks * * @param array &$hookinfo hookinfo */ function statistics_hook_sanitycheck(&$hookinfo) { - assert('is_array($hookinfo)'); - assert('array_key_exists("errors", $hookinfo)'); - assert('array_key_exists("info", $hookinfo)'); + assert(is_array($hookinfo)); + assert(array_key_exists('errors', $hookinfo)); + assert(array_key_exists('info', $hookinfo)); try { - $statconfig = SimpleSAML_Configuration::getConfig('module_statistics.php'); - } catch(Exception $e) { - $hookinfo['errors'][] = '[statistics] Could not get configuration: ' . $e->getMessage(); return; + $statconfig = \SimpleSAML\Configuration::getConfig('module_statistics.php'); + } catch (Exception $e) { + $hookinfo['errors'][] = '[statistics] Could not get configuration: '.$e->getMessage(); + return; } $statdir = $statconfig->getValue('statdir'); $inputfile = $statconfig->getValue('inputfile'); if (file_exists($statdir)) { - $hookinfo['info'][] = '[statistics] Statistics dir [' . $statdir . '] exists'; + $hookinfo['info'][] = '[statistics] Statistics dir ['.$statdir.'] exists'; if (is_writable($statdir)) { - $hookinfo['info'][] = '[statistics] Statistics dir [' . $statdir . '] is writable'; + $hookinfo['info'][] = '[statistics] Statistics dir ['.$statdir.'] is writable'; } else { - $hookinfo['errors'][] = '[statistics] Statistics dir [' . $statdir . '] is not writable'; + $hookinfo['errors'][] = '[statistics] Statistics dir ['.$statdir.'] is not writable'; } } else { - $hookinfo['errors'][] = '[statistics] Statistics dir [' . $statdir . '] does not exists'; + $hookinfo['errors'][] = '[statistics] Statistics dir ['.$statdir.'] does not exists'; } if (file_exists($inputfile)) { - $hookinfo['info'][] = '[statistics] Input file [' . $inputfile . '] exists'; + $hookinfo['info'][] = '[statistics] Input file ['.$inputfile.'] exists'; } else { - $hookinfo['errors'][] = '[statistics] Input file [' . $inputfile . '] does not exists'; + $hookinfo['errors'][] = '[statistics] Input file ['.$inputfile.'] does not exists'; } } diff --git a/vendor/simplesamlphp/simplesamlphp/modules/statistics/lib/AccessCheck.php b/vendor/simplesamlphp/simplesamlphp/modules/statistics/lib/AccessCheck.php index f742b51d1f..750a5d0526 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/statistics/lib/AccessCheck.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/statistics/lib/AccessCheck.php @@ -1,18 +1,21 @@ <?php +namespace SimpleSAML\Module\statistics; + /** * Class implementing the access checker function for the statistics module. * * @package SimpleSAMLphp */ -class sspmod_statistics_AccessCheck + +class AccessCheck { /** * Check that the user has access to the statistics. * * If the user doesn't have access, send the user to the login page. */ - public static function checkAccess(SimpleSAML_Configuration $statconfig) + public static function checkAccess(\SimpleSAML\Configuration $statconfig) { $protected = $statconfig->getBoolean('protected', false); $authsource = $statconfig->getString('auth', null); @@ -21,22 +24,22 @@ public static function checkAccess(SimpleSAML_Configuration $statconfig) $acl = $statconfig->getValue('acl', null); if ($acl !== null && !is_string($acl) && !is_array($acl)) { - throw new SimpleSAML_Error_Exception('Invalid value for \'acl\'-option. Should be an array or a string.'); + throw new \SimpleSAML\Error\Exception('Invalid value for \'acl\'-option. Should be an array or a string.'); } if (!$protected) { return; } - if (SimpleSAML\Utils\Auth::isAdmin()) { + if (\SimpleSAML\Utils\Auth::isAdmin()) { // User logged in as admin. OK. - SimpleSAML\Logger::debug('Statistics auth - logged in as admin, access granted'); + \SimpleSAML\Logger::debug('Statistics auth - logged in as admin, access granted'); return; } if (!isset($authsource)) { // If authsource is not defined, init admin login. - SimpleSAML\Utils\Auth::requireAdmin(); + \SimpleSAML\Utils\Auth::requireAdmin(); } // We are using an authsource for login. @@ -45,7 +48,7 @@ public static function checkAccess(SimpleSAML_Configuration $statconfig) $as->requireAuth(); // User logged in with auth source. - SimpleSAML\Logger::debug('Statistics auth - valid login with auth source [' . $authsource . ']'); + \SimpleSAML\Logger::debug('Statistics auth - valid login with auth source ['.$authsource.']'); // Retrieving attributes $attributes = $as->getAttributes(); @@ -53,29 +56,33 @@ public static function checkAccess(SimpleSAML_Configuration $statconfig) if (!empty($allowedusers)) { // Check if userid exists if (!isset($attributes[$useridattr][0])) { - throw new Exception('User ID is missing'); + throw new \Exception('User ID is missing'); } // Check if userid is allowed access.. if (in_array($attributes[$useridattr][0], $allowedusers, true)) { - SimpleSAML\Logger::debug('Statistics auth - User granted access by user ID [' . $attributes[$useridattr][0] . ']'); + \SimpleSAML\Logger::debug( + 'Statistics auth - User granted access by user ID ['.$attributes[$useridattr][0].']' + ); return; } - SimpleSAML\Logger::debug('Statistics auth - User denied access by user ID [' . $attributes[$useridattr][0] . ']'); + \SimpleSAML\Logger::debug( + 'Statistics auth - User denied access by user ID ['.$attributes[$useridattr][0].']' + ); } else { - SimpleSAML\Logger::debug('Statistics auth - no allowedUsers list.'); + \SimpleSAML\Logger::debug('Statistics auth - no allowedUsers list.'); } if (!is_null($acl)) { - $acl = new sspmod_core_ACL($acl); + $acl = new \SimpleSAML\Module\core\ACL($acl); if ($acl->allows($attributes)) { - SimpleSAML\Logger::debug('Statistics auth - allowed access by ACL.'); + \SimpleSAML\Logger::debug('Statistics auth - allowed access by ACL.'); return; } - SimpleSAML\Logger::debug('Statistics auth - denied access by ACL.'); + \SimpleSAML\Logger::debug('Statistics auth - denied access by ACL.'); } else { - SimpleSAML\Logger::debug('Statistics auth - no ACL configured.'); + \SimpleSAML\Logger::debug('Statistics auth - no ACL configured.'); } - throw new SimpleSAML_Error_Exception('Access denied to the current user.'); + throw new \SimpleSAML\Error\Exception('Access denied to the current user.'); } } diff --git a/vendor/simplesamlphp/simplesamlphp/modules/statistics/lib/Aggregator.php b/vendor/simplesamlphp/simplesamlphp/modules/statistics/lib/Aggregator.php index 4ec74019c9..966012d639 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/statistics/lib/Aggregator.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/statistics/lib/Aggregator.php @@ -1,9 +1,13 @@ <?php + +namespace SimpleSAML\Module\statistics; + /* * @author Andreas Åkre Solberg <andreas.solberg@uninett.no> * @package SimpleSAMLphp */ -class sspmod_statistics_Aggregator + +class Aggregator { private $statconfig; private $statdir; @@ -13,6 +17,7 @@ class sspmod_statistics_Aggregator private $metadata; private $fromcmdline; private $starttime; + private $timeres; /** * Constructor @@ -20,7 +25,7 @@ class sspmod_statistics_Aggregator public function __construct($fromcmdline = false) { $this->fromcmdline = $fromcmdline; - $this->statconfig = SimpleSAML_Configuration::getConfig('module_statistics.php'); + $this->statconfig = \SimpleSAML\Configuration::getConfig('module_statistics.php'); $this->statdir = $this->statconfig->getValue('statdir'); $this->inputfile = $this->statconfig->getValue('inputfile'); @@ -34,19 +39,19 @@ public function __construct($fromcmdline = false) public function dumpConfig() { - echo 'Statistics directory : ' . $this->statdir . "\n"; - echo 'Input file : ' . $this->inputfile . "\n"; - echo 'Offset : ' . $this->offset . "\n"; + echo 'Statistics directory : '.$this->statdir."\n"; + echo 'Input file : '.$this->inputfile."\n"; + echo 'Offset : '.$this->offset."\n"; } public function debugInfo() { - echo 'Memory usage : ' . number_format(memory_get_usage() / (1024*1024), 2) . " MB\n"; + echo 'Memory usage : '.number_format(memory_get_usage() / 1048576, 2)." MB\n"; // 1024*1024=1048576 } public function loadMetadata() { - $filename = $this->statdir . '/.stat.metadata'; + $filename = $this->statdir.'/.stat.metadata'; $metadata = null; if (file_exists($filename)) { $metadata = unserialize(file_get_contents($filename)); @@ -65,34 +70,37 @@ public function saveMetadata() $this->metadata['memory'] = memory_get_usage(); $this->metadata['lastrun'] = time(); - $filename = $this->statdir . '/.stat.metadata'; + $filename = $this->statdir.'/.stat.metadata'; file_put_contents($filename, serialize($this->metadata), LOCK_EX); } - public function aggregate($debug = false) { + public function aggregate($debug = false) + { $this->loadMetadata(); if (!is_dir($this->statdir)) { - throw new Exception('Statistics module: output dir do not exists [' . $this->statdir . ']'); + throw new \Exception('Statistics module: output dir do not exists ['.$this->statdir.']'); } if (!file_exists($this->inputfile)) { - throw new Exception('Statistics module: input file do not exists [' . $this->inputfile . ']'); + throw new \Exception('Statistics module: input file do not exists ['.$this->inputfile.']'); } $file = fopen($this->inputfile, 'r'); if ($file === false) { - throw new Exception('Statistics module: unable to open file [' . $this->inputfile . ']'); + throw new \Exception('Statistics module: unable to open file ['.$this->inputfile.']'); } - $logparser = new sspmod_statistics_LogParser( - $this->statconfig->getValue('datestart', 0), $this->statconfig->getValue('datelength', 15), $this->statconfig->getValue('offsetspan', 44) - ); - $datehandler = array( - 'default' => new sspmod_statistics_DateHandler($this->offset), - 'month' => new sspmod_statistics_DateHandlerMonth($this->offset), + $logparser = new LogParser( + $this->statconfig->getValue('datestart', 0), + $this->statconfig->getValue('datelength', 15), + $this->statconfig->getValue('offsetspan', 44) ); + $datehandler = [ + 'default' => new DateHandler($this->offset), + 'month' => new DateHandlerMonth($this->offset), + ]; $notBefore = 0; $lastRead = 0; @@ -103,9 +111,9 @@ public function aggregate($debug = false) { $lastlinehash = $this->metadata['lastlinehash']; } - $lastlogline = 'sdfsdf'; + $lastlogline = 'sdfsdf'; $lastlineflip = false; - $results = array(); + $results = []; $i = 0; // Parse through log file, line by line @@ -126,13 +134,14 @@ public function aggregate($debug = false) { $action = trim($content[5]); if ($this->fromcmdline && ($i % 10000) == 0) { - echo("Read line " . $i . "\n"); + echo "Read line ".$i."\n"; } if ($debug) { - echo("----------------------------------------\n"); - echo('Log line: ' . $logline . "\n"); - echo('Date parse [' . substr($logline, 0, $this->statconfig->getValue('datelength', 15)) . '] to [' . date(DATE_RFC822, $epoch) . ']' . "\n"); + echo "----------------------------------------\n"; + echo 'Log line: '.$logline."\n"; + echo 'Date parse ['.substr($logline, 0, $this->statconfig->getValue('datelength', 15)). + '] to ['.date(DATE_RFC822, $epoch).']'."\n"; echo htmlentities(print_r($content, true)); if ($i >= 13) { exit; @@ -145,7 +154,7 @@ public function aggregate($debug = false) { if ($epoch === $notBefore) { if (!$lastlineflip) { - if (sha1($logline) === $lastlinehash) { + if (sha1($logline) === $lastlinehash) { $lastlineflip = true; } continue; @@ -168,7 +177,7 @@ public function aggregate($debug = false) { continue; } - foreach ($this->timeres AS $tres => $tresconfig ) { + foreach ($this->timeres as $tres => $tresconfig) { $dh = 'default'; if (isset($tresconfig['customDateHandler'])) { $dh = $tresconfig['customDateHandler']; @@ -206,7 +215,7 @@ private static function getDifCol($content, $colrule) if (is_int($colrule)) { return trim($content[$colrule]); } elseif (is_array($colrule)) { - $difcols = array(); + $difcols = []; foreach ($colrule as $cr) { $difcols[] = trim($content[$cr]); } @@ -218,27 +227,18 @@ private static function getDifCol($content, $colrule) private function cummulateData($previous, $newdata) { - $dataset = array(); - foreach ($previous as $slot => $dataarray) { - if (!array_key_exists($slot, $dataset)) { - $dataset[$slot] = array(); - } - foreach ($dataarray as $key => $data) { - if (!array_key_exists($key, $dataset[$slot])) { - $dataset[$slot][$key] = 0; + $dataset = []; + foreach (func_get_args() as $item) { + foreach ($item as $slot => $dataarray) { + if (!array_key_exists($slot, $dataset)) { + $dataset[$slot] = []; } - $dataset[$slot][$key] += $data; - } - } - foreach ($newdata as $slot => $dataarray) { - if (!array_key_exists($slot, $dataset)) { - $dataset[$slot] = array(); - } - foreach ($dataarray as $key => $data) { - if (!array_key_exists($key, $dataset[$slot])) { - $dataset[$slot][$key] = 0; + foreach ($dataarray as $key => $data) { + if (!array_key_exists($key, $dataset[$slot])) { + $dataset[$slot][$key] = 0; + } + $dataset[$slot][$key] += $data; } - $dataset[$slot][$key] += $data; } } return $dataset; @@ -246,10 +246,10 @@ private function cummulateData($previous, $newdata) public function store($results) { - $datehandler = array( - 'default' => new sspmod_statistics_DateHandler($this->offset), - 'month' => new sspmod_statistics_DateHandlerMonth($this->offset), - ); + $datehandler = [ + 'default' => new DateHandler($this->offset), + 'month' => new DateHandlerMonth($this->offset), + ]; // Iterate the first level of results, which is per rule, as defined in the config. foreach ($results as $rulename => $timeresdata) { @@ -272,33 +272,33 @@ public function store($results) $maxslot = $slotlist[count($slotlist) - 1]; // Get start and end slot number within the file, based on the fileslot. - $start = (int)$datehandler['default']->toSlot( - $datehandler[$dh]->fromSlot($fileno, $this->timeres[$tres]['fileslot']), + $start = (int) $datehandler['default']->toSlot( + $datehandler[$dh]->fromSlot($fileno, $this->timeres[$tres]['fileslot']), $this->timeres[$tres]['slot'] ); - $end = (int)$datehandler['default']->toSlot( - $datehandler[$dh]->fromSlot($fileno+1, $this->timeres[$tres]['fileslot']), + $end = (int) $datehandler['default']->toSlot( + $datehandler[$dh]->fromSlot($fileno + 1, $this->timeres[$tres]['fileslot']), $this->timeres[$tres]['slot'] ); // Fill in missing entries and sort file results - $filledresult = array(); + $filledresult = []; for ($slot = $start; $slot < $end; $slot++) { - if (array_key_exists($slot, $fileres)) { + if (array_key_exists($slot, $fileres)) { $filledresult[$slot] = $fileres[$slot]; } else { if ($lastfile == $fileno && $slot > $maxslot) { - $filledresult[$slot] = array('_' => null); + $filledresult[$slot] = ['_' => null]; } else { - $filledresult[$slot] = array('_' => 0); + $filledresult[$slot] = ['_' => 0]; } } } - $filename = $this->statdir . '/' . $rulename . '-' . $tres . '-' . $fileno . '.stat'; + $filename = $this->statdir.'/'.$rulename.'-'.$tres.'-'.$fileno.'.stat'; if (file_exists($filename)) { $previousData = unserialize(file_get_contents($filename)); - $filledresult = $this->cummulateData($previousData, $filledresult); + $filledresult = $this->cummulateData($previousData, $filledresult); } // store file diff --git a/vendor/simplesamlphp/simplesamlphp/modules/statistics/lib/DateHandler.php b/vendor/simplesamlphp/simplesamlphp/modules/statistics/lib/DateHandler.php index 13ed07c7f5..ae9807df9e 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/statistics/lib/DateHandler.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/statistics/lib/DateHandler.php @@ -1,16 +1,20 @@ <?php + +namespace SimpleSAML\Module\statistics; + /* * @author Andreas Åkre Solberg <andreas.solberg@uninett.no> * @package SimpleSAMLphp */ -class sspmod_statistics_DateHandler + +class DateHandler { protected $offset; /** * Constructor * - * @param array $offset Date offset + * @param array $offset Date offset */ public function __construct($offset) { @@ -28,14 +32,14 @@ protected function getDST($timestamp) public function toSlot($epoch, $slotsize) { $dst = $this->getDST($epoch); - return floor( ($epoch + $this->offset + $dst) / $slotsize); + return floor(($epoch + $this->offset + $dst) / $slotsize); } public function fromSlot($slot, $slotsize) { - $temp = $slot*$slotsize - $this->offset; + $temp = $slot * $slotsize - $this->offset; $dst = $this->getDST($temp); - return $slot*$slotsize - $this->offset - $dst; + return $slot * $slotsize - $this->offset - $dst; } public function prettyDateEpoch($epoch, $dateformat) diff --git a/vendor/simplesamlphp/simplesamlphp/modules/statistics/lib/DateHandlerMonth.php b/vendor/simplesamlphp/simplesamlphp/modules/statistics/lib/DateHandlerMonth.php index 33f9762d91..058795f57b 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/statistics/lib/DateHandlerMonth.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/statistics/lib/DateHandlerMonth.php @@ -1,14 +1,18 @@ <?php + +namespace SimpleSAML\Module\statistics; + /* * @author Andreas Åkre Solberg <andreas.solberg@uninett.no> * @package SimpleSAMLphp */ -class sspmod_statistics_DateHandlerMonth extends sspmod_statistics_DateHandler + +class DateHandlerMonth extends DateHandler { /** * Constructor * - * @param array $offset Date offset + * @param integer $offset Date offset */ public function __construct($offset) { @@ -26,14 +30,14 @@ public function toSlot($epoch, $slotsize) public function fromSlot($slot, $slotsize) { $month = ($slot % 12); - $year = 2000 + floor($slot / 12); + $year = 2000 + intval(floor($slot / 12)); return mktime(0, 0, 0, $month + 1, 1, $year); } public function prettyHeader($from, $to, $slotsize, $dateformat) { $month = ($from % 12) + 1; - $year = 2000 + floor($from / 12); - return $year . '-' . $month; + $year = 2000 + intval(floor($from / 12)); + return $year.'-'.$month; } } diff --git a/vendor/simplesamlphp/simplesamlphp/modules/statistics/lib/Graph/GoogleCharts.php b/vendor/simplesamlphp/simplesamlphp/modules/statistics/lib/Graph/GoogleCharts.php index 9a11261883..129639de50 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/statistics/lib/Graph/GoogleCharts.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/statistics/lib/Graph/GoogleCharts.php @@ -1,22 +1,34 @@ <?php + +namespace SimpleSAML\Module\statistics\Graph; + /* - * sspmod_statistics_Graph_GoogleCharts will help you to create a Google Chart - * using the Google Charts API. + * \SimpleSAML\Module\statistics\Graph\GoogleCharts will help you to create a Google Chart + * using the Google Charts API. * * @author Andreas Åkre Solberg <andreas.solberg@uninett.no> * @package SimpleSAMLphp */ -class sspmod_statistics_Graph_GoogleCharts + +class GoogleCharts { - private $x, $y; + /** + * @var integer + */ + private $x; + + /** + * @var integer + */ + private $y; /** * Constructor. * * Takes dimension of graph as parameters. X and Y. * - * @param $x X dimension. Default 800. - * @param $y Y dimension. Default 350. + * @param integer $x X dimension. Default 800. + * @param integer $y Y dimension. Default 350. */ public function __construct($x = 800, $y = 350) { @@ -32,11 +44,11 @@ private function encodeaxis($axis) // t:10.0,58.0,95.0 private function encodedata($datasets) { - $setstr = array(); + $setstr = []; foreach ($datasets as $dataset) { $setstr[] = self::extEncode($dataset); } - return 'e:' . join(',', $setstr); + return 'e:'.join(',', $setstr); } public static function extEncode($values) // $max = 4095, $min = 0 @@ -51,86 +63,68 @@ public static function extEncode($values) // $max = 4095, $min = 0 $first = substr($extended_table, intval(($delta * $v / 100) / $size), 1); $second = substr($extended_table, intval(($delta * $v / 100) % $size), 1); $chardata .= "$first$second"; - } else { - $chardata .= '__'; // Value out of max range; - } - } - return($chardata); - } - - /** - * Return colors between multiple graphs... - */ - private function getFillArea($datasets) - { - if (count($datasets) < 2) { - return ''; - } - - $colors = array('eeeeee', 'cccccc', 'aaaaaa', '99eecc'); - $num = count($datasets) ; - $colstr = array(); - for ($i = 0; $i < $num; $i++) { - $colstr[] = 'b' . ',' . $colors[$i] . ',' . ($i) . ',' . ($i+1) . ',0'; + } else { + $chardata .= '__'; // Value out of max range; + } } - return '&chm=' . join('|', $colstr); + return $chardata; } /** * Generate a Google Charts URL which points to a generated image. - * More documentation on Google Charts here: + * More documentation on Google Charts here: * http://code.google.com/apis/chart/ * - * @param $axis Axis - * @param $axpis Axis positions - * @param $datasets Datasets values - * @param $max Max value. Will be the topmost value on the Y-axis. + * @param string $axis Axis + * @param string $axpis Axis positions + * @param array $datasets Datasets values + * @param integer $max Max value. Will be the topmost value on the Y-axis. */ public function show($axis, $axispos, $datasets, $maxes) { - $labeld = '&chxt=x,y' . '&chxr=0,0,1|1,0,' . $maxes[0]; + $labeld = '&chxt=x,y'.'&chxr=0,0,1|1,0,'.$maxes[0]; if (count($datasets) > 1) { if (count($datasets) !== count($maxes)) { - throw new Exception('Incorrect number of max calculations for graph plotting.'); + throw new \Exception('Incorrect number of max calculations for graph plotting.'); } - $labeld = '&chxt=x,y,r' . '&chxr=0,0,1|1,0,' . $maxes[0] . '|2,0,' . $maxes[1]; + $labeld = '&chxt=x,y,r'.'&chxr=0,0,1|1,0,'.$maxes[0].'|2,0,'.$maxes[1]; } - $url = 'https://chart.apis.google.com/chart?' . + $url = 'https://chart.apis.google.com/chart?'. // Dimension of graph. Default is 800x350 - 'chs=' . $this->x . 'x' . $this->y . + 'chs='.$this->x.'x'.$this->y. // Dateset values - '&chd=' . $this->encodedata($datasets) . + '&chd='.$this->encodedata($datasets). // Fill area... - '&chco=ff5c00,cca600' . - '&chls=1,1,0|1,6,3' . + '&chco=ff5c00,cca600'. + '&chls=1,1,0|1,6,3'. // chart type is linechart - '&cht=lc' . - $labeld . - '&chxl=0:|' . $this->encodeaxis($axis) . # . $'|1:||top' . - '&chxp=0,' . join(',', $axispos) . - '&chg=' . (2400/(count($datasets[0])-1)) . ',-1,3,3'; // lines + '&cht=lc'. + $labeld. + '&chxl=0:|'.$this->encodeaxis($axis).#.$'|1:||top'. + '&chxp=0,'.join(',', $axispos). + '&chg='.(2400 / (count($datasets[0]) - 1)).',-1,3,3'; // lines return $url; } public function showPie($axis, $datasets) { - $url = 'https://chart.apis.google.com/chart?' . + $url = 'https://chart.apis.google.com/chart?'. // Dimension of graph. Default is 800x350 - 'chs=' . $this->x . 'x' . $this->y . + 'chs='.$this->x.'x'.$this->y. // Dateset values. - '&chd=' . $this->encodedata(array($datasets)) . + '&chd='.$this->encodedata([$datasets]). // chart type is linechart - '&cht=p' . + '&cht=p'. - '&chl=' . $this->encodeaxis($axis); + '&chl='.$this->encodeaxis($axis); return $url; } @@ -143,13 +137,15 @@ public function showPie($axis, $datasets) * * Here is some test code: * <code> - * $foo = array(0, 2, 2.3, 2.6, 6, 10, 15, 98, 198, 256, 487, 563, 763, 801, 899, 999, 987, 198234.485, 283746); - * foreach ($foo AS $f) { - * echo '<p>' . $f . ' => ' . sspmod_statistics_Graph_GoogleCharts::roof($f); - * } + * $foo = array( + * 0, 2, 2.3, 2.6, 6, 10, 15, 98, 198, 256, 487, 563, 763, 801, 899, 999, 987, 198234.485, 283746 + * ); + * foreach ($foo as $f) { + * echo '<p>'.$f.' => '.\SimpleSAML\Module\statistics\Graph\GoogleCharts::roof($f); + * } * </code> - * - * @param $max Input value. + * + * @param integer $max Input value. */ public static function roof($max) { @@ -166,7 +162,7 @@ public static function roof($max) } $maxGridLines = 10; - $candidates = array(1, 2, 5, 10, 20, 25, 50, 100); + $candidates = [1, 2, 5, 10, 20, 25, 50, 100]; foreach ($candidates as $c) { if ($t / $c < $maxGridLines) { @@ -175,5 +171,6 @@ public static function roof($max) return $target_top; } } + return 1; } } diff --git a/vendor/simplesamlphp/simplesamlphp/modules/statistics/lib/LogCleaner.php b/vendor/simplesamlphp/simplesamlphp/modules/statistics/lib/LogCleaner.php index 40915f2554..eafb501904 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/statistics/lib/LogCleaner.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/statistics/lib/LogCleaner.php @@ -1,9 +1,13 @@ <?php + +namespace SimpleSAML\Module\statistics; + /* * @author Andreas Åkre Solberg <andreas.solberg@uninett.no> * @package SimpleSAMLphp */ -class sspmod_statistics_LogCleaner + +class LogCleaner { private $statconfig; private $statdir; @@ -16,7 +20,7 @@ class sspmod_statistics_LogCleaner */ public function __construct($inputfile = null) { - $this->statconfig = SimpleSAML_Configuration::getConfig('module_statistics.php'); + $this->statconfig = \SimpleSAML\Configuration::getConfig('module_statistics.php'); $this->statdir = $this->statconfig->getValue('statdir'); $this->inputfile = $this->statconfig->getValue('inputfile'); @@ -28,31 +32,40 @@ public function __construct($inputfile = null) } } + /* + * @return void + */ public function dumpConfig() { - echo 'Statistics directory : ' . $this->statdir . "\n"; - echo 'Input file : ' . $this->inputfile . "\n"; - echo 'Offset : ' . $this->offset . "\n"; + echo 'Statistics directory : '.$this->statdir."\n"; + echo 'Input file : '.$this->inputfile."\n"; + echo 'Offset : '.$this->offset."\n"; } - public function clean($debug = false) { + + /* + * @param bool $debug + * @return array + */ + public function clean($debug = false) + { if (!is_dir($this->statdir)) { - throw new Exception('Statistics module: output dir do not exists [' . $this->statdir . ']'); + throw new \Exception('Statistics module: output dir do not exists ['.$this->statdir.']'); } if (!file_exists($this->inputfile)) { - throw new Exception('Statistics module: input file do not exists [' . $this->inputfile . ']'); + throw new \Exception('Statistics module: input file do not exists ['.$this->inputfile.']'); } $file = fopen($this->inputfile, 'r'); - $logparser = new sspmod_statistics_LogParser( - $this->statconfig->getValue('datestart', 0), $this->statconfig->getValue('datelength', 15), $this->statconfig->getValue('offsetspan', 44) + $logparser = new LogParser( + $this->statconfig->getValue('datestart', 0), + $this->statconfig->getValue('datelength', 15), + $this->statconfig->getValue('offsetspan', 44) ); - $datehandler = new sspmod_statistics_DateHandler($this->offset); - $results = array(); - $sessioncounter = array(); + $sessioncounter = []; $i = 0; // Parse through log file, line by line @@ -68,10 +81,9 @@ public function clean($debug = false) { // Parse log, and extract epoch time and rest of content. $epoch = $logparser->parseEpoch($logline); $content = $logparser->parseContent($logline); - $action = trim($content[5]); if (($i % 10000) == 0) { - echo("Read line " . $i . "\n"); + echo "Read line ".$i."\n"; } $trackid = $content[4]; @@ -82,9 +94,10 @@ public function clean($debug = false) { $sessioncounter[$trackid]++; if ($debug) { - echo("----------------------------------------\n"); - echo('Log line: ' . $logline . "\n"); - echo('Date parse [' . substr($logline, 0, $this->statconfig->getValue('datelength', 15)) . '] to [' . date(DATE_RFC822, $epoch) . ']' . "\n"); + echo "----------------------------------------\n"; + echo 'Log line: '.$logline."\n"; + echo 'Date parse ['.substr($logline, 0, $this->statconfig->getValue('datelength', 15)). + '] to ['.date(DATE_RFC822, $epoch).']'."\n"; echo htmlentities(print_r($content, true)); if ($i >= 13) { exit; @@ -92,7 +105,7 @@ public function clean($debug = false) { } } - $histogram = array(); + $histogram = []; foreach ($sessioncounter as $trackid => $sc) { if (!isset($histogram[$sc])) { $histogram[$sc] = 0; @@ -101,7 +114,7 @@ public function clean($debug = false) { } ksort($histogram); - $todelete = array(); + $todelete = []; foreach ($sessioncounter as $trackid => $sc) { if ($sc > 200) { $todelete[] = $trackid; @@ -111,16 +124,22 @@ public function clean($debug = false) { return $todelete; } + + /* + * @param array $todelete + * @param string $outputfile + * @return void + */ public function store($todelete, $outputfile) { - echo "Preparing to delete [" .count($todelete) . "] trackids\n"; + echo "Preparing to delete [".count($todelete)."] trackids\n"; if (!is_dir($this->statdir)) { - throw new Exception('Statistics module: output dir do not exists [' . $this->statdir . ']'); + throw new \Exception('Statistics module: output dir do not exists ['.$this->statdir.']'); } if (!file_exists($this->inputfile)) { - throw new Exception('Statistics module: input file do not exists [' . $this->inputfile . ']'); + throw new \Exception('Statistics module: input file do not exists ['.$this->inputfile.']'); } $file = fopen($this->inputfile, 'r'); @@ -130,10 +149,12 @@ public function store($todelete, $outputfile) // Delete existing output file. unlink($outputfile); } - $outfile = fopen($outputfile, 'x'); /* Create the output file. */ + $outfile = fopen($outputfile, 'x'); // Create the output file - $logparser = new sspmod_statistics_LogParser( - $this->statconfig->getValue('datestart', 0), $this->statconfig->getValue('datelength', 15), $this->statconfig->getValue('offsetspan', 44) + $logparser = new LogParser( + $this->statconfig->getValue('datestart', 0), + $this->statconfig->getValue('datelength', 15), + $this->statconfig->getValue('offsetspan', 44) ); $i = 0; @@ -148,10 +169,9 @@ public function store($todelete, $outputfile) $i++; $content = $logparser->parseContent($logline); - $action = trim($content[5]); if (($i % 10000) == 0) { - echo("Read line " . $i . "\n"); + echo "Read line ".$i."\n"; } $trackid = $content[4]; diff --git a/vendor/simplesamlphp/simplesamlphp/modules/statistics/lib/LogParser.php b/vendor/simplesamlphp/simplesamlphp/modules/statistics/lib/LogParser.php index 6ca677a38c..0516b7f249 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/statistics/lib/LogParser.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/statistics/lib/LogParser.php @@ -1,20 +1,35 @@ <?php + +namespace SimpleSAML\Module\statistics; + /* * @author Andreas Åkre Solberg <andreas.solberg@uninett.no> * @package SimpleSAMLphp */ -class sspmod_statistics_LogParser + +class LogParser { + /** + * @var integer + */ private $datestart; + + /** + * @var integer + */ private $datelength; + + /** + * @var integer + */ private $offset; /** * Constructor * - * @param $datestart At which char is the date starting - * @param $datelength How many characters is the date (on the b - * @param $offset At which char is the rest of the entries starting + * @param integer $datestart At which char is the date starting + * @param integer $datelength How many characters is the date (on the b + * @param integer $offset At which char is the rest of the entries starting */ public function __construct($datestart, $datelength, $offset) { @@ -23,44 +38,43 @@ public function __construct($datestart, $datelength, $offset) $this->offset = $offset; } + + /** + * @param string $line + * + * @return integer + */ public function parseEpoch($line) { $epoch = strtotime(substr($line, 0, $this->datelength)); - if ($epoch > time() + 2678400) { // 60 * 60 *24 * 31 = 2678400 + if ($epoch > time() + 2678400) { + // 60 * 60 * 24 * 31 = 2678400 /* * More than a month in the future - probably caused by * the log files missing the year. * We will therefore subtrackt one year. */ - $hour = gmdate('H', $epoch); - $minute = gmdate('i', $epoch); - $second = gmdate('s', $epoch); - $month = gmdate('n', $epoch); - $day = gmdate('j', $epoch); - $year = gmdate('Y', $epoch) - 1; + $hour = intval(gmdate('H', $epoch)); + $minute = intval(gmdate('i', $epoch)); + $second = intval(gmdate('s', $epoch)); + $month = intval(gmdate('n', $epoch)); + $day = intval(gmdate('j', $epoch)); + $year = intval(gmdate('Y', $epoch)) - 1; $epoch = gmmktime($hour, $minute, $second, $month, $day, $year); } return $epoch; } - public function parseContent($line) { + + /** + * @param string $line + * + * @return array + */ + public function parseContent($line) + { $contentstr = substr($line, $this->offset); $content = explode(' ', $contentstr); return $content; } - - // Aug 27 12:54:25 ssp 5 STAT [5416262207] saml20-sp-SSO urn:mace:feide.no:services:no.uninett.wiki-feide sam.feide.no NA - // - // Oct 30 11:07:14 www1 simplesamlphp-foodle[12677]: 5 STAT [200b4679af] saml20-sp-SLO spinit urn:mace:feide.no:services:no.feide.foodle sam.feide.no - - function parse15($str) { - $di = date_parse($str); - $datestamp = mktime($di['hour'], $di['minute'], $di['second'], $di['month'], $di['day']); - return $datestamp; - } - - function parse23($str) { - $timestamp = strtotime($str); - return $timestamp; - } } diff --git a/vendor/simplesamlphp/simplesamlphp/modules/statistics/lib/RatioDataset.php b/vendor/simplesamlphp/simplesamlphp/modules/statistics/lib/RatioDataset.php index a88573c656..5449a3fd17 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/statistics/lib/RatioDataset.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/statistics/lib/RatioDataset.php @@ -1,19 +1,23 @@ <?php + +namespace SimpleSAML\Module\statistics; + /* * @author Andreas Åkre Solberg <andreas.solberg@uninett.no> * @package SimpleSAMLphp */ -class sspmod_statistics_RatioDataset extends sspmod_statistics_StatDataset + +class RatioDataset extends StatDataset { public function aggregateSummary() { /** * Aggregate summary table from dataset. To be used in the table view. */ - $this->summary = array(); - $noofvalues = array(); + $this->summary = []; + $noofvalues = []; foreach ($this->results as $slot => $res) { - foreach ($res AS $key => $value) { + foreach ($res as $key => $value) { if (array_key_exists($key, $this->summary)) { $this->summary[$key] += $value; if ($value > 0) { @@ -56,12 +60,12 @@ private function divide($v1, $v2) public function combine($result1, $result2) { - $combined = array(); + $combined = []; foreach ($result2 as $tick => $val) { - $combined[$tick] = array(); + $combined[$tick] = []; foreach ($val as $index => $num) { - $combined[$tick][$index] = $this->divide( + $combined[$tick][$index] = $this->divide( $this->ag($index, $result1[$tick]), $this->ag($index, $result2[$tick]) ); @@ -75,4 +79,3 @@ public function getPieData() return null; } } - diff --git a/vendor/simplesamlphp/simplesamlphp/modules/statistics/lib/Ruleset.php b/vendor/simplesamlphp/simplesamlphp/modules/statistics/lib/Ruleset.php index 45f6ecdfdd..935bad407d 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/statistics/lib/Ruleset.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/statistics/lib/Ruleset.php @@ -1,9 +1,13 @@ <?php + +namespace SimpleSAML\Module\statistics; + /* * @author Andreas Åkre Solberg <andreas.solberg@uninett.no> * @package SimpleSAMLphp */ -class sspmod_statistics_Ruleset + +class Ruleset { private $statconfig; private $availrulenames; @@ -22,7 +26,6 @@ public function __construct($statconfig) private function init() { $statdir = $this->statconfig->getValue('statdir'); - $inputfile = $this->statconfig->getValue('inputfile'); $statrules = $this->statconfig->getValue('statrules'); $timeres = $this->statconfig->getValue('timeres'); @@ -30,29 +33,30 @@ private function init() * Walk through file lists, and get available [rule][fileslot]... */ if (!is_dir($statdir)) { - throw new Exception('Statisics output directory [' . $statdir . '] does not exists.'); + throw new \Exception('Statisics output directory ['.$statdir.'] does not exists.'); } $filelist = scandir($statdir); - $this->available = array(); + $this->available = []; foreach ($filelist as $file) { - if (preg_match('/([a-z0-9_]+)-([a-z0-9_]+)-([0-9]+)\.stat/', $file, $matches)) { - if (array_key_exists($matches[1], $statrules)) { - if (array_key_exists($matches[2], $timeres)) - $this->available[$matches[1]][$matches[2]][] = $matches[3]; + if (preg_match('/([a-z0-9_]+)-([a-z0-9_]+)-([0-9]+)\.stat/', $file, $matches)) { + if (array_key_exists($matches[1], $statrules)) { + if (array_key_exists($matches[2], $timeres)) { + $this->available[$matches[1]][$matches[2]][] = $matches[3]; + } } } } if (empty($this->available)) { - throw new Exception('No aggregated statistics files found in [' . $statdir . ']'); + throw new \Exception('No aggregated statistics files found in ['.$statdir.']'); } /* * Create array with information about available rules.. */ $this->availrules = array_keys($statrules); - $available_rules = array(); + $available_rules = []; foreach ($this->availrules as $key) { - $available_rules[$key] = array('name' => $statrules[$key]['name'], 'descr' => $statrules[$key]['descr']); + $available_rules[$key] = ['name' => $statrules[$key]['name'], 'descr' => $statrules[$key]['descr']]; } $this->availrulenames = $available_rules; } @@ -87,9 +91,11 @@ public function getRule($preferRule) $statrulesConfig = $this->statconfig->getConfigItem('statrules'); $statruleConfig = $statrulesConfig->getConfigItem($rule); - $presenterClass = SimpleSAML\Module::resolveClass($statruleConfig->getValue('presenter', 'statistics:BaseRule'), 'Statistics_Rulesets'); + $presenterClass = \SimpleSAML\Module::resolveClass( + $statruleConfig->getValue('presenter', 'statistics:BaseRule'), + 'Statistics\Rulesets' + ); $statrule = new $presenterClass($this->statconfig, $statruleConfig, $rule, $this->available); return $statrule; } } - diff --git a/vendor/simplesamlphp/simplesamlphp/modules/statistics/lib/StatDataset.php b/vendor/simplesamlphp/simplesamlphp/modules/statistics/lib/StatDataset.php index 79eceeecaf..6868d02377 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/statistics/lib/StatDataset.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/statistics/lib/StatDataset.php @@ -1,11 +1,13 @@ <?php +namespace SimpleSAML\Module\statistics; /** * @author Andreas Åkre Solberg <andreas.solberg@uninett.no> * @package SimpleSAMLphp */ -class sspmod_statistics_StatDataset + +class StatDataset { protected $statconfig; protected $ruleconfig; @@ -29,8 +31,8 @@ class sspmod_statistics_StatDataset */ public function __construct($statconfig, $ruleconfig, $ruleid, $timeres, $fileslot) { - assert('$statconfig instanceof SimpleSAML_Configuration'); - assert('$ruleconfig instanceof SimpleSAML_Configuration'); + assert($statconfig instanceof \SimpleSAML\Configuration); + assert($ruleconfig instanceof \SimpleSAML\Configuration); $this->statconfig = $statconfig; $this->ruleconfig = $ruleconfig; @@ -44,9 +46,9 @@ public function __construct($statconfig, $ruleconfig, $ruleid, $timeres, $filesl $this->delimiter = '_'; $this->max = 0; - $this->datehandlerTick = new sspmod_statistics_DateHandler($this->statconfig->getValue('offset', 0)); + $this->datehandlerTick = new DateHandler($this->statconfig->getValue('offset', 0)); if ($this->timeresconfig->getValue('customDateHandler', 'default') === 'month') { - $this->datehandlerFile = new sspmod_statistics_DateHandlerMonth(0); + $this->datehandlerFile = new DateHandlerMonth(0); } else { $this->datehandlerFile = $this->datehandlerTick; } @@ -89,21 +91,21 @@ public function calculateMax() } $maxvalue = max($res[$this->delimiter], $maxvalue); } - $this->max = sspmod_statistics_Graph_GoogleCharts::roof($maxvalue); + $this->max = Graph\GoogleCharts::roof($maxvalue); } public function getDebugData() { - $debugdata = array(); + $debugdata = []; $slotsize = $this->timeresconfig->getValue('slot'); $dateformat_intra = $this->timeresconfig->getValue('dateformat-intra'); foreach ($this->results as $slot => &$res) { - $debugdata[$slot] = array( + $debugdata[$slot] = [ $this->datehandlerTick->prettyDateSlot($slot, $slotsize, $dateformat_intra), $res[$this->delimiter] - ); + ]; } return $debugdata; } @@ -111,7 +113,7 @@ public function getDebugData() public function aggregateSummary() { // aggregate summary table from dataset. To be used in the table view - $this->summary = array(); + $this->summary = []; foreach ($this->results as $slot => $res) { foreach ($res as $key => $value) { if (array_key_exists($key, $this->summary)) { @@ -128,7 +130,7 @@ public function aggregateSummary() public function getTopDelimiters() { // create a list of delimiter keys that has the highest total summary in this period - $topdelimiters = array(); + $topdelimiters = []; $maxdelimiters = 4; $i = 0; foreach ($this->summary as $key => $value) { @@ -144,7 +146,7 @@ public function getTopDelimiters() public function availDelimiters() { - $availDelimiters = array(); + $availDelimiters = []; foreach ($this->summary as $key => $value) { $availDelimiters[$key] = 1; } @@ -153,7 +155,7 @@ public function availDelimiters() public function getPieData() { - $piedata = array(); + $piedata = []; $sum = 0; $topdelimiters = $this->getTopDelimiters(); @@ -183,12 +185,11 @@ public function getResults() public function getAxis() { $slotsize = $this->timeresconfig->getValue('slot'); - $dateformat_period = $this->timeresconfig->getValue('dateformat-period'); $dateformat_intra = $this->timeresconfig->getValue('dateformat-intra'); $axislabelint = $this->timeresconfig->getValue('axislabelint'); - $axis = array(); - $axispos = array(); + $axis = []; + $axispos = []; $xentries = count($this->results); $lastslot = 0; $i = 0; @@ -205,7 +206,7 @@ public function getAxis() $axis[] = $this->datehandlerTick->prettyDateSlot($lastslot + 1, $slotsize, $dateformat_intra); - return array('axis' => $axis, 'axispos' => $axispos); + return ['axis' => $axis, 'axispos' => $axispos]; } /* @@ -214,7 +215,7 @@ public function getAxis() public function getPercentValues() { $i = 0; - $dataset = array(); + $dataset = []; foreach ($this->results as $slot => $res) { if (array_key_exists($this->delimiter, $res)) { if ($res[$this->delimiter] === null) { @@ -233,27 +234,27 @@ public function getPercentValues() public function getDelimiterPresentation() { - $config = SimpleSAML_Configuration::getInstance(); - $t = new SimpleSAML_XHTML_Template($config, 'statistics:statistics.tpl.php'); + $config = \SimpleSAML\Configuration::getInstance(); + $t = new \SimpleSAML\XHTML\Template($config, 'statistics:statistics.tpl.php'); $availdelimiters = $this->availDelimiters(); // create a delimiter presentation filter for this rule... if ($this->ruleconfig->hasValue('fieldPresentation')) { $fieldpresConfig = $this->ruleconfig->getConfigItem('fieldPresentation'); - $classname = SimpleSAML\Module::resolveClass( + $classname = \SimpleSAML\Module::resolveClass( $fieldpresConfig->getValue('class'), - 'Statistics_FieldPresentation' + 'Statistics\FieldPresentation' ); if (!class_exists($classname)) { - throw new Exception('Could not find field presentation plugin ['.$classname.']: No class found'); + throw new \Exception('Could not find field presentation plugin ['.$classname.']: No class found'); } $presentationHandler = new $classname($availdelimiters, $fieldpresConfig->getValue('config'), $t); return $presentationHandler->getPresentation(); } - return array(); + return []; } public function getDelimiterPresentationPie() @@ -261,7 +262,7 @@ public function getDelimiterPresentationPie() $topdelimiters = $this->getTopDelimiters(); $delimiterPresentation = $this->getDelimiterPresentation(); - $pieaxis = array(); + $pieaxis = []; foreach ($topdelimiters as $key) { $keyName = $key; if (array_key_exists($key, $delimiterPresentation)) { @@ -276,21 +277,21 @@ public function getDelimiterPresentationPie() public function loadData() { $statdir = $this->statconfig->getValue('statdir'); - $resarray = array(); - $rules = SimpleSAML\Utils\Arrays::arrayize($this->ruleid); + $resarray = []; + $rules = \SimpleSAML\Utils\Arrays::arrayize($this->ruleid); foreach ($rules as $rule) { // Get file and extract results. $resultFileName = $statdir.'/'.$rule.'-'.$this->timeres.'-'.$this->fileslot.'.stat'; if (!file_exists($resultFileName)) { - throw new Exception('Aggregated statitics file ['.$resultFileName.'] not found.'); + throw new \Exception('Aggregated statitics file ['.$resultFileName.'] not found.'); } if (!is_readable($resultFileName)) { - throw new Exception('Could not read statitics file ['.$resultFileName.']. Bad file permissions?'); + throw new \Exception('Could not read statitics file ['.$resultFileName.']. Bad file permissions?'); } $resultfile = file_get_contents($resultFileName); $newres = unserialize($resultfile); if (empty($newres)) { - throw new Exception('Aggregated statistics in file ['.$resultFileName.'] was empty.'); + throw new \Exception('Aggregated statistics in file ['.$resultFileName.'] was empty.'); } $resarray[] = $newres; } @@ -304,6 +305,4 @@ public function loadData() } $this->results = $combined; } - } - diff --git a/vendor/simplesamlphp/simplesamlphp/modules/statistics/lib/Statistics/FieldPresentation/Base.php b/vendor/simplesamlphp/simplesamlphp/modules/statistics/lib/Statistics/FieldPresentation/Base.php index e02300094b..bb2568f1d6 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/statistics/lib/Statistics/FieldPresentation/Base.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/statistics/lib/Statistics/FieldPresentation/Base.php @@ -1,12 +1,14 @@ <?php -class sspmod_statistics_Statistics_FieldPresentation_Base +namespace SimpleSAML\Module\statistics\Statistics\FieldPresentation; + +class Base { protected $fields; protected $template; protected $config; - function __construct($fields, $config, $template) + public function __construct($fields, $config, $template) { $this->fields = $fields; $this->template = $template; @@ -15,6 +17,6 @@ function __construct($fields, $config, $template) public function getPresentation() { - return array('_' => 'Total'); + return ['_' => 'Total']; } } diff --git a/vendor/simplesamlphp/simplesamlphp/modules/statistics/lib/Statistics/FieldPresentation/Entity.php b/vendor/simplesamlphp/simplesamlphp/modules/statistics/lib/Statistics/FieldPresentation/Entity.php index 5556d08f81..624d215b79 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/statistics/lib/Statistics/FieldPresentation/Entity.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/statistics/lib/Statistics/FieldPresentation/Entity.php @@ -1,17 +1,19 @@ <?php -class sspmod_statistics_Statistics_FieldPresentation_Entity extends sspmod_statistics_Statistics_FieldPresentation_Base +namespace SimpleSAML\Module\statistics\Statistics\FieldPresentation; + +class Entity extends Base { public function getPresentation() { - $mh = SimpleSAML_Metadata_MetaDataStorageHandler::getMetadataHandler(); + $mh = \SimpleSAML\Metadata\MetaDataStorageHandler::getMetadataHandler(); $metadata = $mh->getList($this->config); - $translation = array('_' => 'All services'); + $translation = ['_' => 'All services']; foreach ($this->fields as $field) { if (array_key_exists($field, $metadata)) { if (array_key_exists('name', $metadata[$field])) { - $translation[$field] = $this->template->t($metadata[$field]['name'], array(), false); + $translation[$field] = $this->template->t($metadata[$field]['name']); } } } diff --git a/vendor/simplesamlphp/simplesamlphp/modules/statistics/lib/Statistics/Rulesets/BaseRule.php b/vendor/simplesamlphp/simplesamlphp/modules/statistics/lib/Statistics/Rulesets/BaseRule.php index 3bb6e482da..875557bc8d 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/statistics/lib/Statistics/Rulesets/BaseRule.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/statistics/lib/Statistics/Rulesets/BaseRule.php @@ -1,9 +1,13 @@ <?php + +namespace SimpleSAML\Module\statistics\Statistics\Rulesets; + /* * @author Andreas Åkre Solberg <andreas.solberg@uninett.no> * @package SimpleSAMLphp */ -class sspmod_statistics_Statistics_Rulesets_BaseRule + +class BaseRule { protected $statconfig; protected $ruleconfig; @@ -15,15 +19,15 @@ class sspmod_statistics_Statistics_Rulesets_BaseRule */ public function __construct($statconfig, $ruleconfig, $ruleid, $available) { - assert('$statconfig instanceof SimpleSAML_Configuration'); - assert('$ruleconfig instanceof SimpleSAML_Configuration'); + assert($statconfig instanceof \SimpleSAML\Configuration); + assert($ruleconfig instanceof \SimpleSAML\Configuration); $this->statconfig = $statconfig; $this->ruleconfig = $ruleconfig; $this->ruleid = $ruleid; $this->available = null; if (array_key_exists($ruleid, $available)) { - $this->available = $available[$ruleid]; + $this->available = $available[$ruleid]; } } @@ -32,9 +36,10 @@ public function getRuleID() return $this->ruleid; } - public function availableTimeRes() { + public function availableTimeRes() + { $timeresConfigs = $this->statconfig->getValue('timeres'); - $available_times = array(); + $available_times = []; foreach ($timeresConfigs as $tres => $tresconfig) { if (array_key_exists($tres, $this->available)) { $available_times[$tres] = $tresconfig['name']; @@ -49,17 +54,22 @@ public function availableFileSlots($timeres) $timeresConfig = $timeresConfigs[$timeres]; if (isset($timeresConfig['customDateHandler']) && $timeresConfig['customDateHandler'] == 'month') { - $datehandler = new sspmod_statistics_DateHandlerMonth(0); + $datehandler = new \SimpleSAML\Module\statistics\DateHandlerMonth(0); } else { - $datehandler = new sspmod_statistics_DateHandler($this->statconfig->getValue('offset', 0)); + $datehandler = new \SimpleSAML\Module\statistics\DateHandler($this->statconfig->getValue('offset', 0)); } /* * Get list of avaiable times in current file (rule) */ - $available_times = array(); + $available_times = []; foreach ($this->available[$timeres] as $slot) { - $available_times[$slot] = $datehandler->prettyHeader($slot, $slot + 1, $timeresConfig['fileslot'], $timeresConfig['dateformat-period']); + $available_times[$slot] = $datehandler->prettyHeader( + $slot, + $slot + 1, + $timeresConfig['fileslot'], + $timeresConfig['dateformat-period'] + ); } return $available_times; } @@ -105,15 +115,20 @@ public function getTimeNavigation($timeres, $preferTime) if ($timeslotindex[$fileslot] < (count($timeslotindex) - 1)) { $available_times_next = $timeslots[$timeslotindex[$fileslot] + 1]; } - return array('prev' => $available_times_prev, 'next' => $available_times_next); + return ['prev' => $available_times_prev, 'next' => $available_times_next]; } public function getDataSet($preferTimeRes, $preferTime) { $timeres = $this->resolveTimeRes($preferTimeRes); $fileslot = $this->resolveFileSlot($timeres, $preferTime); - $dataset = new sspmod_statistics_StatDataset($this->statconfig, $this->ruleconfig, $this->ruleid, $timeres, $fileslot); + $dataset = new \SimpleSAML\Module\statistics\StatDataset( + $this->statconfig, + $this->ruleconfig, + $this->ruleid, + $timeres, + $fileslot + ); return $dataset; } } - diff --git a/vendor/simplesamlphp/simplesamlphp/modules/statistics/lib/Statistics/Rulesets/Ratio.php b/vendor/simplesamlphp/simplesamlphp/modules/statistics/lib/Statistics/Rulesets/Ratio.php index 39512d3c5b..1f76f6b470 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/statistics/lib/Statistics/Rulesets/Ratio.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/statistics/lib/Statistics/Rulesets/Ratio.php @@ -1,9 +1,13 @@ <?php + +namespace SimpleSAML\Module\statistics\Statistics\Rulesets; + /* * @author Andreas Åkre Solberg <andreas.solberg@uninett.no> * @package SimpleSAMLphp */ -class sspmod_statistics_Statistics_Rulesets_Ratio extends sspmod_statistics_Statistics_Rulesets_BaseRule + +class Ratio extends BaseRule { protected $refrule1; protected $refrule2; @@ -13,8 +17,8 @@ class sspmod_statistics_Statistics_Rulesets_Ratio extends sspmod_statistics_Stat */ public function __construct($statconfig, $ruleconfig, $ruleid, $available) { - assert('$statconfig instanceof SimpleSAML_Configuration'); - assert('$ruleconfig instanceof SimpleSAML_Configuration'); + assert($statconfig instanceof \SimpleSAML\Configuration); + assert($ruleconfig instanceof \SimpleSAML\Configuration); parent::__construct($statconfig, $ruleconfig, $ruleid, $available); @@ -25,8 +29,8 @@ public function __construct($statconfig, $ruleconfig, $ruleid, $available) $statruleConfig1 = $statrulesConfig->getConfigItem($refNames[0]); $statruleConfig2 = $statrulesConfig->getConfigItem($refNames[1]); - $this->refrule1 = new sspmod_statistics_Statistics_Rulesets_BaseRule($this->statconfig, $statruleConfig1, $refNames[0], $available); - $this->refrule2 = new sspmod_statistics_Statistics_Rulesets_BaseRule($this->statconfig, $statruleConfig2, $refNames[1], $available); + $this->refrule1 = new BaseRule($this->statconfig, $statruleConfig1, $refNames[0], $available); + $this->refrule2 = new BaseRule($this->statconfig, $statruleConfig2, $refNames[1], $available); } public function availableTimeRes() @@ -61,8 +65,13 @@ public function getDataSet($preferTimeRes, $preferTime) $refNames = $this->ruleconfig->getArray('ref'); - $dataset = new sspmod_statistics_RatioDataset($this->statconfig, $this->ruleconfig, $refNames, $timeres, $fileslot); + $dataset = new \SimpleSAML\Module\statistics\RatioDataset( + $this->statconfig, + $this->ruleconfig, + $refNames, + $timeres, + $fileslot + ); return $dataset; } } - diff --git a/vendor/simplesamlphp/simplesamlphp/modules/statistics/locales/en/LC_MESSAGES/statistics.po b/vendor/simplesamlphp/simplesamlphp/modules/statistics/locales/en/LC_MESSAGES/statistics.po new file mode 100644 index 0000000000..8dee6fd552 --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/modules/statistics/locales/en/LC_MESSAGES/statistics.po @@ -0,0 +1,11 @@ +msgid "{statistics:statistics:link_statistics" +msgstr "Show statistics" + +msgid "{statistics:statistics:link_statistics_metadata" +msgstr "Show statistics metadata" + +msgid "Show statistics" +msgstr "Show statistics" + +msgid "Show statistics metadata" +msgstr "Show statistics metadata" \ No newline at end of file diff --git a/vendor/simplesamlphp/simplesamlphp/modules/statistics/locales/es/LC_MESSAGES/statistics.po b/vendor/simplesamlphp/simplesamlphp/modules/statistics/locales/es/LC_MESSAGES/statistics.po new file mode 100644 index 0000000000..871d825185 --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/modules/statistics/locales/es/LC_MESSAGES/statistics.po @@ -0,0 +1,11 @@ +msgid "{statistics:statistics:link_statistics" +msgstr "Mostrar estadísticas" + +msgid "{statistics:statistics:link_statistics_metadata" +msgstr "Mostrar metadatos de las estadísticas" + +msgid "Show statistics" +msgstr "Mostrar estadísticas" + +msgid "Show statistics metadata" +msgstr "Mostrar metadatos de las estadísticas" \ No newline at end of file diff --git a/vendor/simplesamlphp/simplesamlphp/modules/statistics/locales/nb/LC_MESSAGES/statistics.po b/vendor/simplesamlphp/simplesamlphp/modules/statistics/locales/nb/LC_MESSAGES/statistics.po new file mode 100644 index 0000000000..f670477855 --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/modules/statistics/locales/nb/LC_MESSAGES/statistics.po @@ -0,0 +1,11 @@ +msgid "{statistics:statistics:link_statistics" +msgstr "Vis statistikker" + +msgid "{statistics:statistics:link_statistics_metadata" +msgstr "Vis metadata om statistikker" + +msgid "Show statistics" +msgstr "Vis statistikker" + +msgid "Show statistics metadata" +msgstr "Vis metadata om statistikker" diff --git a/vendor/simplesamlphp/simplesamlphp/modules/statistics/locales/nn/LC_MESSAGES/statistics.po b/vendor/simplesamlphp/simplesamlphp/modules/statistics/locales/nn/LC_MESSAGES/statistics.po new file mode 100644 index 0000000000..6fb2e3bf4f --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/modules/statistics/locales/nn/LC_MESSAGES/statistics.po @@ -0,0 +1,11 @@ +msgid "{statistics:statistics:link_statistics" +msgstr "Vis statistikkar" + +msgid "{statistics:statistics:link_statistics_metadata" +msgstr "Vis metadata om statistikkar" + +msgid "Show statistics" +msgstr "Vis statistikkar" + +msgid "Show statistics metadata" +msgstr "Vis metadata om statistikkar" diff --git a/vendor/simplesamlphp/simplesamlphp/modules/statistics/templates/statistics.tpl.php b/vendor/simplesamlphp/simplesamlphp/modules/statistics/templates/statistics.tpl.php index fa7e1f4e93..7abe9bb7e1 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/statistics/templates/statistics.tpl.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/statistics/templates/statistics.tpl.php @@ -1,56 +1,72 @@ <?php $this->data['header'] = 'SimpleSAMLphp Statistics'; -$this->data['jquery'] = array('core' => true, 'ui' => true, 'css' => true); +$this->data['jquery'] = ['core' => true, 'ui' => true, 'css' => true]; -$this->data['head'] = '<link rel="stylesheet" type="text/css" href="' . SimpleSAML\Module::getModuleURL("statistics/style.css") . '" />' . "\n"; -$this->data['head'] .= '<script type="text/javascript" src="' . SimpleSAML\Module::getModuleURL("statistics/javascript.js") . '"></script>' . "\n"; +$this->data['head'] = '<link rel="stylesheet" type="text/css" href="'. + SimpleSAML\Module::getModuleURL("statistics/assets/css/statistics.css").'" />'."\n"; +$this->data['head'] .= '<script type="text/javascript" src="'. + SimpleSAML\Module::getModuleURL("statistics/assets/js/statistics.js").'"></script>'."\n"; $this->includeAtTemplateBase('includes/header.php'); -echo '<h1>'. $this->data['available.rules'][$this->data['selected.rule']]['name'] . '</h1>'; -echo '<p>' . $this->data['available.rules'][$this->data['selected.rule']]['descr'] . '</p>'; +echo '<h1>'.$this->data['available.rules'][$this->data['selected.rule']]['name'].'</h1>'; +echo '<p>'.$this->data['available.rules'][$this->data['selected.rule']]['descr'].'</p>'; // Report settings echo '<table class="selecttime">'; -echo '<tr><td class="selecttime_icon"><img src="' . SimpleSAML\Utils\HTTP::getBaseUrl() . 'resources/icons/crystal_project/kchart.32x32.png" alt="Report settings" /></td>'; +echo '<tr><td class="selecttime_icon"><img src="'.SimpleSAML\Utils\HTTP::getBaseURL(). + 'resources/icons/crystal_project/kchart.32x32.png" alt="Report settings" /></td>'; // Select report echo '<td>'; echo '<form action="#">'; -echo $this->data['post_rule']; -echo '<select onchange="submit();" name="rule">'; -foreach ($this->data['available.rules'] as $key => $rule) { - if ($key === $this->data['selected.rule']) { - echo '<option selected="selected" value="' . $key . '">' . $rule['name'] . '</option>'; - } else { - echo '<option value="' . $key . '">' . $rule['name'] . '</option>'; + +foreach ($this->data['post_rule'] as $k => $v) { + echo '<input type="hidden" name="'.$k.'" value="'.htmlspecialchars($v).'" />'."\n"; +} + +if (!empty($this->data['available_rules'])) { + echo '<select onchange="submit();" name="rule">'; + foreach ($this->data['available_rules'] as $key => $rule) { + if ($key === $this->data['selected_rule']) { + echo '<option selected="selected" value="'.$key.'">'.$rule['name'].'</option>'; + } else { + echo '<option value="'.$key.'">'.$rule['name'].'</option>'; + } } + echo '</select>'; } -echo '</select></form>'; -echo '</td>'; +echo '</form></td>'; // Select delimiter echo '<td class="td_right">'; echo '<form action="#">'; -echo $this->data['post_d']; -echo '<select onchange="submit();" name="d">'; -foreach ($this->data['availdelimiters'] as $key => $delim) { - $delimName = $delim; - if (array_key_exists($delim, $this->data['delimiterPresentation'])) { - $delimName = $this->data['delimiterPresentation'][$delim]; - } - if ($key == '_') { - echo '<option value="_">Total</option>'; - } elseif (isset($_REQUEST['d']) && $delim == $_REQUEST['d']) { - echo '<option selected="selected" value="' . htmlspecialchars($delim) . '">' . htmlspecialchars($delimName) . '</option>'; - } else { - echo '<option value="' . htmlspecialchars($delim) . '">' . htmlspecialchars($delimName) . '</option>'; +foreach ($this->data['post_d'] as $k => $v) { + echo '<input type="hidden" name="'.$k.'" value="'.htmlspecialchars($v).'" />'."\n"; +} + +if (!empty($this->data['availdelimiters'])) { + echo '<select onchange="submit();" name="d">'; + foreach ($this->data['availdelimiters'] as $key => $delim) { + $delimName = $delim; + if (array_key_exists($delim, $this->data['delimiterPresentation'])) { + $delimName = $this->data['delimiterPresentation'][$delim]; + } + + if ($key == '_') { + echo '<option value="_">Total</option>'; + } elseif (isset($_REQUEST['d']) && $delim == $_REQUEST['d']) { + echo '<option selected="selected" value="'.htmlspecialchars($delim).'">'. + htmlspecialchars($delimName).'</option>'; + } else { + echo '<option value="'.htmlspecialchars($delim).'">'.htmlspecialchars($delimName).'</option>'; + } } + echo '</select>'; } -echo '</select></form>'; -echo '</td></tr>'; +echo '</form></td></tr>'; echo '</table>'; @@ -59,137 +75,159 @@ // Select time and date echo '<table class="selecttime">'; -echo '<tr><td class="selecttime_icon"><img src="' . SimpleSAML\Utils\HTTP::getBaseUrl() . 'resources/icons/crystal_project/date.32x32.png" alt="Select date and time" /></td>'; +echo '<tr><td class="selecttime_icon"><img src="'.SimpleSAML\Utils\HTTP::getBaseURL(). + 'resources/icons/crystal_project/date.32x32.png" alt="Select date and time" /></td>'; -if (isset($this->data['available.times.prev'])) { - echo '<td><a href="' . $this->data['get_times_prev'] . '">« Previous</a></td>'; +if (isset($this->data['available_times_prev'])) { + echo '<td><a href="'.$this->data['get_times_prev'].'">« Previous</a></td>'; } else { echo '<td class="selecttime_link_grey">« Previous</td>'; } echo '<td class="td_right">'; echo '<form action="#">'; -echo $this->data['post_res']; -echo '<select onchange="submit();" name="res">'; -foreach ($this->data['available.timeres'] as $key => $timeresname) { - if ($key == $this->data['selected.timeres']) { - echo '<option selected="selected" value="' . $key . '">' . $timeresname . '</option>'; - } else { - echo '<option value="' . $key . '">' . $timeresname . '</option>'; + +foreach ($this->data['post_res'] as $k => $v) { + echo '<input type="hidden" name="'.$k.'" value="'.htmlspecialchars($v).'" />'."\n"; +} + +if (!empty($this->data['available_timeres'])) { + echo '<select onchange="submit();" name="res">'; + foreach ($this->data['available_timeres'] as $key => $timeresname) { + if ($key == $this->data['selected_timeres']) { + echo '<option selected="selected" value="'.$key.'">'.$timeresname.'</option>'; + } else { + echo '<option value="'.$key.'">'.$timeresname.'</option>'; + } } + echo '</select>'; } -echo '</select></form>'; -echo '</td>'; +echo '</form></td>'; echo '<td class="td_left">'; echo '<form action="#">'; -echo $this->data['post_time']; -echo '<select onchange="submit();" name="time">'; -foreach ($this->data['available.times'] as $key => $timedescr) { - if ($key == $this->data['selected.time']) { - echo '<option selected="selected" value="' . $key . '">' . $timedescr . '</option>'; - } else { - echo '<option value="' . $key . '">' . $timedescr . '</option>'; + +foreach ($this->data['post_time'] as $k => $v) { + echo '<input type="hidden" name="'.$k.'" value="'.htmlspecialchars($v).'" />'."\n"; +} + +if (!empty($this->data['available_times'])) { + echo '<select onchange="submit();" name="time">'; + foreach ($this->data['available_times'] as $key => $timedescr) { + if ($key == $this->data['selected_time']) { + echo '<option selected="selected" value="'.$key.'">'.$timedescr.'</option>'; + } else { + echo '<option value="'.$key.'">'.$timedescr.'</option>'; + } } + echo '</select>'; } -echo '</select></form>'; -echo '</td>'; +echo '</form></td>'; -if (isset($this->data['available.times.next'])) { - echo '<td class="td_right td_next_right"><a href="' . $this->data['get_times_next'] . '">Next »</a></td>'; +if (isset($this->data['available_times_next'])) { + echo '<td class="td_right td_next_right"><a href="'.$this->data['get_times_next'].'">Next »</a></td>'; } else { echo '<td class="td_right selecttime_link_grey td_next_right">Next »</td>'; } echo '</tr></table>'; +echo '<div id="tabdiv">'; +if (!empty($this->data['results'])) { + echo '<ul class="tabset_tabs"> + <li><a href="#graph">Graph</a></li> + <li><a href="#table">Summary table</a></li> + <li><a href="#debug">Time serie</a></li> + </ul>'; + echo ' + <div id="graph" class="tabset_content">'; -echo '<div id="tabdiv"><ul class="tabset_tabs"> - <li><a href="#graph">Graph</a></li> - <li><a href="#table">Summary table</a></li> - <li><a href="#debug">Time serie</a></li> -</ul>'; -echo ' + echo '<img src="'.htmlspecialchars($this->data['imgurl']).'" alt="Graph" />'; -<div id="graph" class="tabset_content">'; + echo '<form action="#">'; + echo '<p class="p_right">Compare with total from this dataset '; -echo '<img src="' . htmlspecialchars($this->data['imgurl']) . '" alt="Graph" />'; - -echo '<form action="#">'; -echo '<p class="p_right">Compare with total from this dataset '; -echo $this->data['post_rule2']; -echo '<select onchange="submit();" name="rule2">'; -echo ' <option value="_">None</option>'; -foreach ($this->data['available.rules'] as $key => $rule) { - if ($key === $this->data['selected.rule2']) { - echo '<option selected="selected" value="' . $key . '">' . $rule['name'] . '</option>'; - } else { - echo '<option value="' . $key . '">' . $rule['name'] . '</option>'; + foreach ($this->data['post_rule2'] as $k => $v) { + echo '<input type="hidden" name="'.$k.'" value="'.htmlspecialchars($v).'" />'."\n"; } -} -echo '</select></p></form>'; - -echo '</div>'; // end graph content. - -/** - * Handle table view - - - - - - - */ -$classint = array('odd', 'even'); $i = 0; -echo '<div id="table" class="tabset_content">'; - -if (isset($this->data['pieimgurl'])) { - echo '<img src="' . $this->data['pieimgurl'] . '" alt="Pie chart" />'; -} -echo '<table class="tableview"><tr><th class="value">Value</th><th class="category">Data range</th></tr>'; - -foreach ($this->data['summaryDataset'] as $key => $value) { - $clint = $classint[$i++ % 2]; - - $keyName = $key; - if (array_key_exists($key, $this->data['delimiterPresentation'])) { - $keyName = $this->data['delimiterPresentation'][$key]; + echo '<select onchange="submit();" name="rule2">'; + echo ' <option value="_">None</option>'; + foreach ($this->data['available_rules'] as $key => $rule) { + if ($key === $this->data['selected_rule2']) { + echo '<option selected="selected" value="'.$key.'">'.$rule['name'].'</option>'; + } else { + echo '<option value="'.$key.'">'.$rule['name'].'</option>'; + } } + echo '</select></p></form>'; - if ($key === '_') { - echo '<tr class="total ' . $clint . '"><td class="value">' . $value . '</td><td class="category">' . $keyName . '</td></tr>'; - } else { - echo '<tr class="' . $clint . '"><td class="value">' . $value . '</td><td class="category">' . $keyName . '</td></tr>'; - } -} + echo '</div>'; // end graph content. -echo '</table></div>'; -// - - - - - - - End table view - - - - - - - + /** + * Handle table view - - - - - - + */ + $classint = ['odd', 'even']; + $i = 0; + echo '<div id="table" class="tabset_content">'; -echo '<div id="debug" >'; -echo '<table class="timeseries">'; -echo '<tr><th>Time</th><th>Total</th>'; -foreach ($this->data['topdelimiters'] as $key) { - $keyName = $key; - if (array_key_exists($key, $this->data['delimiterPresentation'])) { - $keyName = $this->data['delimiterPresentation'][$key]; + if (isset($this->data['pieimgurl'])) { + echo '<img src="'.$this->data['pieimgurl'].'" alt="Pie chart" />'; + } + echo '<table class="tableview"><tr><th class="value">Value</th><th class="category">Data range</th></tr>'; + + foreach ($this->data['summaryDataset'] as $key => $value) { + $clint = $classint[$i++ % 2]; + + $keyName = $key; + if (array_key_exists($key, $this->data['delimiterPresentation'])) { + $keyName = $this->data['delimiterPresentation'][$key]; + } + + if ($key === '_') { + echo '<tr class="total '.$clint.'"><td class="value">'. + $value.'</td><td class="category">'.$keyName.'</td></tr>'; + } else { + echo '<tr class="'.$clint.'"><td class="value">'.$value. + '</td><td class="category">'.$keyName.'</td></tr>'; + } } - echo'<th>' . $keyName . '</th>'; -} -echo '</tr>'; - -$i = 0; -foreach ($this->data['debugdata'] as $slot => $dd) { - echo '<tr class="' . ((++$i % 2) == 0 ? 'odd' : 'even') . '">'; - echo '<td>' . $dd[0] . '</td>'; - echo '<td class="datacontent">' . $dd[1] . '</td>'; + echo '</table></div>'; + // - - - - - - - End table view - - - - - - - + echo '<div id="debug" >'; + echo '<table class="timeseries">'; + echo '<tr><th>Time</th><th>Total</th>'; foreach ($this->data['topdelimiters'] as $key) { - echo '<td class="datacontent">' . (array_key_exists($key, $this->data['results'][$slot]) ? - $this->data['results'][$slot][$key] : ' ') . '</td>'; + $keyName = $key; + if (array_key_exists($key, $this->data['delimiterPresentation'])) { + $keyName = $this->data['delimiterPresentation'][$key]; + } + echo'<th>'.$keyName.'</th>'; } echo '</tr>'; -} -echo '</table>'; + + $i = 0; + foreach ($this->data['debugdata'] as $slot => $dd) { + echo '<tr class="'.((++$i % 2) == 0 ? 'odd' : 'even').'">'; + echo '<td>'.$dd[0].'</td>'; + echo '<td class="datacontent">'.$dd[1].'</td>'; + + foreach ($this->data['topdelimiters'] as $key) { + echo '<td class="datacontent">'.(array_key_exists($key, $this->data['results'][$slot]) ? + $this->data['results'][$slot][$key] : ' ').'</td>'; + } + echo '</tr>'; + } + echo '</table>'; -echo '</div>'; // End debug tab content + echo '</div>'; // End debug tab content +} else { + echo '<h4 align="center">'.$this->data['error'].'</h4>'; + echo '<p align="center"><a href="showstats.php">Clear selection</a></p>'; +} echo '</div>'; // End tab div $this->includeAtTemplateBase('includes/footer.php'); diff --git a/vendor/simplesamlphp/simplesamlphp/modules/statistics/templates/statistics.twig b/vendor/simplesamlphp/simplesamlphp/modules/statistics/templates/statistics.twig new file mode 100644 index 0000000000..bcd02a049d --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/modules/statistics/templates/statistics.twig @@ -0,0 +1,226 @@ +{% set pagetitle = 'SimpleSAMLphp Statistics'|trans %} +{% extends "base.twig" %} + +{% block preload %} + <link href="{{ baseurlpath }}assets/css/statistics.css" rel="stylesheet" /> + <link rel="stylesheet" media="screen" type="text/css" href="/resources/uitheme1.8/jquery-ui.css" /> +{% endblock %} + +{% block postload %} +<script type="text/javascript" src="/resources/jquery-1.8.js"></script> +<script type="text/javascript" src="/resources/jquery-ui-1.8.js"></script> +<script type="text/javascript" src="{{ baseurlpath }}assets/js/statistics.js"></script> +{% endblock %} + +{% block content %} + <h1>{{ current_rule.name }}</h1> + <p>{{ current_rule.descr }}</p> + + <table class="selecttime"> + <tr> + <td class="selecttime_icon"> + <i class="fa fa-pie-chart"></i> + </td> + <td> + <form action="#"> + {% for key, value in post_rule %} + <input type="hidden" name="{{ key|escape('html') }}" value="{{ value|escape('html') }}"> + {% endfor %} + <select onchange="submit();" name="rule"> + {% for key, rule in available_rules %} + {% if key == selected_rule %} + <option selected="selected" value="{{ key }}">{{ rule.name }}</option> + {% else %} + <option value="{{ key }}">{{ rule.name }}</option> + {% endif %} + {% endfor %} + </select> + </form> + </td> + <td class="td_right"> + <form action="#"> + {% for key, value in post_d %} + <input type="hidden" name="{{ key|escape('html') }}" value="{{ value|escape('html') }}"> + {% endfor %} + {% if availdelimiters %} + <select onchange="submit();" name="d"> + {% for key, delim in availdelimiters %} + {% set delimName = delim %} + + {% if delimiterPresentation[delim] is defined %} + {% set delimName = delimiterPresentation[delim] %} + {% endif %} + + {% if key == "_" %} + <option value="_">Total</option> + {% elseif request_d is defined and delim == request_d %} + <option selected="selected" value="{{ delim|escape('html') }}">{{ delimName|escape('html') }}</option> + {% else %} + <option value="{{ delim|escape('html') }}">{{ delimName|escape('html') }}</option> + {% endif %} + {% endfor %} + </select> + {% endif %} + </form> + </td> + </tr> + </table> + + <table class="selecttime"> + <tr> + <td class="selecttime_icon"> + <i class="fa fa-calendar"></i> + </td> + {% if available_times_prev %} + <td><a href="{{ get_times_prev }}">« Previous</a></td> + {% else %} + <td class="selecttime_link_grey">« Previous</td> + {% endif %} + <td class="td_right"> + <form action="#"> + {% for key, value in post_res %} + <input type="hidden" name="{{ key|escape('html') }}" value="{{ value|escape('html') }}"> + {% endfor %} + {% if available_timeres %} + <select onchange="submit();" name="res"> + {% for key, timeresname in available_timeres %} + {% if key == selected_timeres %} + <option selected="selected" value="{{ key }}">{{ timeresname }}</option> + {% else %} + <option value="{{ key }}">{{ timeresname }}</option> + {% endif %} + {% endfor %} + </select> + {% endif %} + </form> + </td> + <td class="td_left"> + <form action="#"> + {% for key, value in post_time %} + <input type="hidden" name="{{ key|escape('html') }}" value="{{ value|escape('html') }}"> + {% endfor %} + {% if available_times %} + <select onchange="submit();" name=time> + {% for key, timedescr in available_times %} + {% if key == selected_time %} + <option selected="selected" value="{{ key }}">{{ timedescr }}</option> + {% else %} + <option value="{{ key }}">{{ timedescr }}</option> + {% endif%} + {% endfor %} + </select> + {% endif %} + </form> + </td> + {% if available_times_next %} + <td class="td_right td_next_right"><a href="{{ get_times_next }}">Next »</a></td> + {% else %} + <td class="td_right selecttime_link_grey">Next »</td> + {% endif %} + </tr> + </table> + + <div id="tabdiv"> + {% if results %} + <ul class="tabset_tabs"> + <li class="tab-link current" data-tab="graph"><a href="#graph">Graph</a></li> + <li class="tab-link" data-tab="table"><a href="#table">Summary table</a></li> + <li class="tab-link" data-tab="debug"><a href="#debug">Time serie</a></li> + </ul> + + <div id="graph" class="tabset_content current"> + <img src="{{ imgurl }}" alt="Graph" /> + <form action="#"> + <p class="p_right">Compare with total from this dataset + <select onchange="submit();" name="rule2"> + <option value="_">None</option> + {% for key, rule in available_rules %} + {% if key == selected_rule2 %} + <option selected="selected" value="{{ key }}">{{ rule.name }}</option> + {% else %} + <option value="{{ key }}">{{ rule.name }}</option> + {% endif %} + {% endfor %} + </select> + </p> + </form> + </div> + + <div id="table" class="tabset_content"> + {% if pieimgurl is defined %} + <img src="{{ pieimgurl }}" alt="Pie chart" /> + {% endif %} + + <table class="tableview"> + <tr> + <th class="value">Value</th> + <th class="category">Data range</th> + </tr> + {% for key, value in summaryDataset %} + {% if loop.index0 is even %} + {% set class = 'even' %} + {% else %} + {% set class = 'odd' %} + {% endif %} + + {% set keyName = key %} + {% if delimiterPresentation[key] is defined %} + {% set keyName = delimiterPresentation[key] %} + {% endif %} + + {% if key == "_" %} + <tr class="total {{ class }}"> + <td class="value">{{ value }}</td> + <td class="category">{{ keyName }}</td> + </tr> + {% else %} + <tr class="{{ class }}"> + <td class="value">{{ value }}</td> + <td class="category">{{ keyName }}</td> + </tr> + {% endif %} + {% endfor %} + </table> + </div> + + <div id="debug" class="tabset_content"> + <table class="timeseries"> + <tr> + <th>Time</th> + <th>Total</th> + {% for key, value in topdelimiters %} + {% set keyName = value %} + {% if delimiterPresentation[value] is defined %} + {% set keyName = delimiterPresentation[value] %} + {% endif %} + <th>{{ keyName }}</th> + {% endfor %} + </tr> + {% for slot, dd in debugdata %} + + {% if loop.index0 is even %} + {% set class = 'even' %} + {% else %} + {% set class = 'odd' %} + {% endif %} + + <tr class="{{ class }}"> + <td>{{ dd[0] }}</td> + <td class="datacontent">{{ dd[1] }}</td> + {% for key, value in topdelimiters %} + {% if results[slot] is defined %} + <td class="datacontent">{{ results[slot][value] }}</td> + {% else %} + <td class="datacontent"> </td> + {% endif %} + {% endfor %} + </tr> + {% endfor %} + </table> + </div> + {% else %} + <h4 align="center">{{ error }}</h4> + <p align="center"><a href="showstats.php">Clear selection</a></p> + {% endif %} + </div> +{% endblock %} diff --git a/vendor/simplesamlphp/simplesamlphp/modules/statistics/templates/statmeta.tpl.php b/vendor/simplesamlphp/simplesamlphp/modules/statistics/templates/statmeta.tpl.php index 9af5a032ef..324b4e0c5c 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/statistics/templates/statmeta.tpl.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/statistics/templates/statmeta.tpl.php @@ -1,6 +1,7 @@ <?php $this->data['header'] = 'SimpleSAMLphp Statistics Metadata'; -$this->data['head'] = '<link rel="stylesheet" type="text/css" href="' . SimpleSAML\Module::getModuleURL("statistics/style.css") . '" />'; +$this->data['head'] = '<link rel="stylesheet" type="text/css" href="'. + SimpleSAML\Module::getModuleURL("statistics/assets/css/statistics.css").'" />'; $this->includeAtTemplateBase('includes/header.php'); echo '<table id="statmeta">' ; @@ -9,34 +10,33 @@ $metadata = $this->data['metadata']; if (isset($metadata['lastrun'])) { - echo '<tr><td>Aggregator last run at</td><td>' . $metadata['lastrun'] . '</td></tr>'; + echo '<tr><td>Aggregator last run at</td><td>'.$metadata['lastrun'].'</td></tr>'; } if (isset($metadata['notBefore'])) { - echo '<tr><td>Aggregated data until</td><td>' . $metadata['notBefore'] . '</td></tr>'; + echo '<tr><td>Aggregated data until</td><td>'.$metadata['notBefore'].'</td></tr>'; } if (isset($metadata['memory'])) { - echo '<tr><td>Memory usage</td><td>' . $metadata['memory'] . ' MB' . '</td></tr>'; + echo '<tr><td>Memory usage</td><td>'.$metadata['memory'].' MB'.'</td></tr>'; } if (isset($metadata['time'])) { - echo '<tr><td>Execution time</td><td>' . $metadata['time'] . ' seconds' . '</td></tr>'; + echo '<tr><td>Execution time</td><td>'.$metadata['time'].' seconds'.'</td></tr>'; } - if (isset($metadata['lastlinehash'] )) { - echo '<tr><td>SHA1 of last processed logline</td><td>' . $metadata['lastlinehash'] . '</td></tr>'; + if (isset($metadata['lastlinehash'])) { + echo '<tr><td>SHA1 of last processed logline</td><td>'.$metadata['lastlinehash'].'</td></tr>'; } - if (isset($metadata['lastline'] )) { - echo '<tr><td>Last processed logline</td><td>' . $metadata['lastline'] . '</td></tr>'; + if (isset($metadata['lastline'])) { + echo '<tr><td>Last processed logline</td><td>'.$metadata['lastline'].'</td></tr>'; } } else { echo '<tr><td>No metadata found</td></tr>'; } echo '</table>'; -echo '<p>[ <a href="' . SimpleSAML\Module::getModuleURL("statistics/showstats.php") . '">Show statistics</a> ] </p>'; +echo '<p>[ <a href="'.SimpleSAML\Module::getModuleURL("statistics/showstats.php").'">Show statistics</a> ] </p>'; $this->includeAtTemplateBase('includes/footer.php'); - diff --git a/vendor/simplesamlphp/simplesamlphp/modules/statistics/templates/statmeta.twig b/vendor/simplesamlphp/simplesamlphp/modules/statistics/templates/statmeta.twig new file mode 100644 index 0000000000..09808e837a --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/modules/statistics/templates/statmeta.twig @@ -0,0 +1,39 @@ +{% set pagetitle = 'SimpleSAMLphp Statistics Metadata'|trans %} +{% extends "base.twig" %} + +{% block preload %} + <link href="{{ baseurlpath }}assets/css/statistics.css" rel="stylesheet" /> +{% endblock %} + +{% block content %} + <table id="statmeta"> + {% if metadata is defined %} + {% if metadata.lastrun is defined %} + <tr><td>Aggregator last run at</td><td>{{ metadata.lastrun }}</td></tr> + {% endif %} + + {% if metadata.notBefore is defined %} + <tr><td>Aggregated data until</td><td>{{ metadata.notBefore }}</td></tr> + {% endif %} + + {% if metadata.memory is defined %} + <tr><td>Memory usage</td><td>{{ metadata.memory }} MB</td></tr> + {% endif %} + + {% if metadata.memory is defined %} + <tr><td>Execution time</td><td>{{ metadata.time }} seconds</td></tr> + {% endif %} + + {% if metadata.memory is defined %} + <tr><td>SHA1 of last processed logline</td><td>{{ metadata.lastlinehash }}</td></tr> + {% endif %} + + {% if metadata.memory is defined %} + <tr><td>Last processed logline</td><td>{{ metadata.lastline }}</td></tr> + {% endif %} + {% else %} + <tr><td>No metadata found</td></tr> + {% endif %} + </table> + <p>[ <a href="{{ baseurlpath }}showstats.php">Show statistics</a> ]</p> +{% endblock %} diff --git a/vendor/simplesamlphp/simplesamlphp/modules/statistics/www/style.css b/vendor/simplesamlphp/simplesamlphp/modules/statistics/www/assets/css/statistics.css similarity index 70% rename from vendor/simplesamlphp/simplesamlphp/modules/statistics/www/style.css rename to vendor/simplesamlphp/simplesamlphp/modules/statistics/www/assets/css/statistics.css index 1485d07910..4d0d163d60 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/statistics/www/style.css +++ b/vendor/simplesamlphp/simplesamlphp/modules/statistics/www/assets/css/statistics.css @@ -1,6 +1,4 @@ @media all { - .ui-tabs-panel { padding: .5em } - div#content { margin: .4em ! important; } @@ -35,10 +33,6 @@ text-align: right; } - div.corner_t { - max-width: none ! important; - } - table.timeseries tr.odd td { background-color: #f4f4f4; } @@ -92,4 +86,42 @@ table#statmeta { width: 100%; } + + ul.tabset_tabs { + margin: 0px; + padding: 0px; + list-style: none; + } + + ul.tabset_tabs li { + background: none; + color: #222; + display: inline-block; + padding: 10px 15px; + cursor: pointer; + } + + ul.tabset_tabs li.current { + background: #ededed; + color: #222; + } + + .tabset_content { + display: none; + background: #ededed; + padding: 15px; + } + + .tabset_content.current { + display: inherit; + } + + #graph img { + max-width: 77%; + height: auto; + } + #table img { + max-width: 77%; + height: auto; + } } diff --git a/vendor/simplesamlphp/simplesamlphp/modules/statistics/www/assets/js/statistics.js b/vendor/simplesamlphp/simplesamlphp/modules/statistics/www/assets/js/statistics.js new file mode 100644 index 0000000000..54a72551d9 --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/modules/statistics/www/assets/js/statistics.js @@ -0,0 +1,8 @@ +$(document).ready(function () { + $("#tabdiv").tabs(); + $('ul.tabset_tabs li').click( + function () { + $("html, body").animate({ scrollTop: 0 }, "slow"); + } + ) +}); diff --git a/vendor/simplesamlphp/simplesamlphp/modules/statistics/www/javascript.js b/vendor/simplesamlphp/simplesamlphp/modules/statistics/www/javascript.js deleted file mode 100644 index a5aa421a67..0000000000 --- a/vendor/simplesamlphp/simplesamlphp/modules/statistics/www/javascript.js +++ /dev/null @@ -1,4 +0,0 @@ -$(document).ready(function() { - $("#tabdiv").tabs(); -}); - diff --git a/vendor/simplesamlphp/simplesamlphp/modules/statistics/www/showstats.php b/vendor/simplesamlphp/simplesamlphp/modules/statistics/www/showstats.php index 051dc9aa55..7011126ea5 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/statistics/www/showstats.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/statistics/www/showstats.php @@ -1,10 +1,11 @@ <?php -$config = SimpleSAML_Configuration::getInstance(); -$statconfig = SimpleSAML_Configuration::getConfig('module_statistics.php'); -$session = SimpleSAML_Session::getSessionFromRequest(); +$config = \SimpleSAML\Configuration::getInstance(); +$statconfig = \SimpleSAML\Configuration::getConfig('module_statistics.php'); +$session = \SimpleSAML\Session::getSessionFromRequest(); +$t = new \SimpleSAML\XHTML\Template($config, 'statistics:statistics.tpl.php'); -sspmod_statistics_AccessCheck::checkAccess($statconfig); +\SimpleSAML\Module\statistics\AccessCheck::checkAccess($statconfig); /* * Check input parameters @@ -29,6 +30,7 @@ } if (array_key_exists('d', $_REQUEST)) { $delimiter = $_REQUEST['d']; + $t->data['request_d'] = $delimiter; } if ($preferRule2 === '_') { @@ -38,110 +40,129 @@ /* * Create statistics data. */ -$ruleset = new sspmod_statistics_Ruleset($statconfig); +$ruleset = new \SimpleSAML\Module\statistics\Ruleset($statconfig); $statrule = $ruleset->getRule($preferRule); $rule = $statrule->getRuleID(); -$dataset = $statrule->getDataset($preferTimeRes, $preferTime); -$dataset->setDelimiter($delimiter); +$t->data['pageid'] = 'statistics'; +$t->data['header'] = 'stat'; +$t->data['available_rules'] = $ruleset->availableRulesNames(); +$t->data['selected_rule'] = $rule; +$t->data['selected_rule2'] = $preferRule2; + +try { + $dataset = $statrule->getDataset($preferTimeRes, $preferTime); + $dataset->setDelimiter($delimiter); + $dataset->aggregateSummary(); + $dataset->calculateMax(); + + if (array_key_exists('output', $_REQUEST) && $_REQUEST['output'] === 'csv') { + header('Content-type: text/csv'); + header('Content-Disposition: attachment; filename="simplesamlphp-data.csv"'); + $data = $dataset->getDebugData(); + foreach ($data as $de) { + if (isset($de[1])) { + echo '"'.$de[0].'",'.$de[1]."\n"; + } + } + exit; + } +} catch (\Exception $e) { + $t->data['error'] = "No data available"; + $t->show(); + exit; +} $delimiter = $dataset->getDelimiter(); $timeres = $dataset->getTimeRes(); $fileslot = $dataset->getFileslot(); -$availableFileSlots = $statrule->availableFileSlots($timeres); $timeNavigation = $statrule->getTimeNavigation($timeres, $preferTime); -$dataset->aggregateSummary(); -$dataset->calculateMax(); - $piedata = $dataset->getPieData(); -$datasets = array(); +$datasets = []; $datasets[] = $dataset->getPercentValues(); $axis = $dataset->getAxis(); -$maxes = array(); +$maxes = []; $maxes[] = $dataset->getMax(); +$t->data['selected_time'] = $fileslot; +$t->data['selected_timeres'] = $timeres; +$t->data['post_d'] = getBaseURL($t, 'post', 'd'); + if (isset($preferRule2)) { $statrule = $ruleset->getRule($preferRule2); - $dataset2 = $statrule->getDataset($preferTimeRes, $preferTime); - $dataset2->aggregateSummary(); - $dataset2->calculateMax(); - - $datasets[] = $dataset2->getPercentValues(); - $maxes[] = $dataset2->getMax(); + try { + $dataset2 = $statrule->getDataset($preferTimeRes, $preferTime); + $dataset2->aggregateSummary(); + $dataset2->calculateMax(); + + $datasets[] = $dataset2->getPercentValues(); + $maxes[] = $dataset2->getMax(); + } catch (\Exception $e) { + $t->data['error'] = "No data available to compare"; + $t->show(); + exit; + } } $dimx = $statconfig->getValue('dimension.x', 800); $dimy = $statconfig->getValue('dimension.y', 350); -$grapher = new sspmod_statistics_Graph_GoogleCharts($dimx, $dimy); - -if (array_key_exists('output', $_REQUEST) && $_REQUEST['output'] === 'csv') { - header('Content-type: text/csv'); - header('Content-Disposition: attachment; filename="simplesamlphp-data.csv"'); - $data = $dataset->getDebugData(); - foreach ($data as $de) { - if (isset($de[1])) { - echo '"' . $de[0] . '",' . $de[1] . "\n"; - } - } - exit; -} +$grapher = new \SimpleSAML\Module\statistics\Graph\GoogleCharts($dimx, $dimy); -$t = new SimpleSAML_XHTML_Template($config, 'statistics:statistics.tpl.php'); -$t->data['pageid'] = 'statistics'; -$t->data['header'] = 'stat'; $t->data['imgurl'] = $grapher->show($axis['axis'], $axis['axispos'], $datasets, $maxes); if (isset($piedata)) { - $t->data['pieimgurl'] = $grapher->showPie( $dataset->getDelimiterPresentationPie(), $piedata); + $t->data['pieimgurl'] = $grapher->showPie($dataset->getDelimiterPresentationPie(), $piedata); } -$t->data['available.rules'] = $ruleset->availableRulesNames(); -$t->data['available.times'] = $statrule->availableFileSlots($timeres); -$t->data['available.timeres'] = $statrule->availableTimeRes(); -$t->data['available.times.prev'] = $timeNavigation['prev']; -$t->data['available.times.next'] = $timeNavigation['next']; - -$t->data['selected.rule']= $rule; -$t->data['selected.rule2']= $preferRule2; -$t->data['selected.time'] = $fileslot; -$t->data['selected.timeres'] = $timeres; -$t->data['selected.delimiter'] = $delimiter; + +$t->data['available_rules'] = $ruleset->availableRulesNames(); +$t->data['available_times'] = $statrule->availableFileSlots($timeres); +$t->data['available_timeres'] = $statrule->availableTimeRes(); +$t->data['available_times_prev'] = $timeNavigation['prev']; +$t->data['available_times_next'] = $timeNavigation['next']; + +$t->data['current_rule'] = $t->data['available_rules'][$rule]; + +$t->data['selected_rule'] = $rule; +$t->data['selected_rule2'] = $preferRule2; +$t->data['selected_delimiter'] = $delimiter; $t->data['debugdata'] = $dataset->getDebugData(); $t->data['results'] = $dataset->getResults(); $t->data['summaryDataset'] = $dataset->getSummary(); $t->data['topdelimiters'] = $dataset->getTopDelimiters(); -$t->data['availdelimiters'] = $dataset->availDelimiters(); - -$t->data['delimiterPresentation'] = $dataset->getDelimiterPresentation(); $t->data['post_rule'] = getBaseURL($t, 'post', 'rule'); $t->data['post_rule2'] = getBaseURL($t, 'post', 'rule2'); -$t->data['post_d'] = getBaseURL($t, 'post', 'd'); $t->data['post_res'] = getBaseURL($t, 'post', 'res'); $t->data['post_time'] = getBaseURL($t, 'post', 'time'); -$t->data['get_times_prev'] = getBaseURL($t, 'get', 'time', $t->data['available.times.prev']); -$t->data['get_times_next'] = getBaseURL($t, 'get', 'time', $t->data['available.times.next']); +$t->data['get_times_prev'] = getBaseURL($t, 'get', 'time', $t->data['available_times_prev']); +$t->data['get_times_next'] = getBaseURL($t, 'get', 'time', $t->data['available_times_next']); + +$t->data['availdelimiters'] = $dataset->availDelimiters(); +$t->data['delimiterPresentation'] = $dataset->getDelimiterPresentation(); + +$t->data['jquery'] = ['core' => false, 'ui' => true, 'css' => true]; $t->show(); function getBaseURL($t, $type = 'get', $key = null, $value = null) { - $vars = array( - 'rule' => $t->data['selected.rule'], - 'time' => $t->data['selected.time'], - 'res' => $t->data['selected.timeres'], - ); - if (isset($t->data['selected.delimiter'])) { - $vars['d'] = $t->data['selected.delimiter']; + $vars = [ + 'rule' => $t->data['selected_rule'], + 'time' => $t->data['selected_time'], + 'res' => $t->data['selected_timeres'], + ]; + if (isset($t->data['selected_delimiter'])) { + $vars['d'] = $t->data['selected_delimiter']; } - if (!empty($t->data['selected.rule2']) && $t->data['selected.rule2'] !== '_') { - $vars['rule2'] = $t->data['selected.rule2']; + if (!empty($t->data['selected_rule2']) && $t->data['selected_rule2'] !== '_') { + $vars['rule2'] = $t->data['selected_rule2']; } if (isset($key)) { @@ -154,12 +175,8 @@ function getBaseURL($t, $type = 'get', $key = null, $value = null) } if ($type === 'get') { - return SimpleSAML\Module::getModuleURL("statistics/showstats.php") . '?' . http_build_query($vars, '', '&'); - } else { - $text = ''; - foreach($vars as $k => $v) { - $text .= '<input type="hidden" name="' . $k . '" value="'. htmlspecialchars($v) . '" />' . "\n"; - } - return $text; + return \SimpleSAML\Module::getModuleURL("statistics/showstats.php").'?'.http_build_query($vars, '', '&'); } + + return $vars; } diff --git a/vendor/simplesamlphp/simplesamlphp/modules/statistics/www/statmeta.php b/vendor/simplesamlphp/simplesamlphp/modules/statistics/www/statmeta.php index 91a5fe4aa4..dd252bb26e 100644 --- a/vendor/simplesamlphp/simplesamlphp/modules/statistics/www/statmeta.php +++ b/vendor/simplesamlphp/simplesamlphp/modules/statistics/www/statmeta.php @@ -1,15 +1,15 @@ <?php -$config = SimpleSAML_Configuration::getInstance(); -$statconfig = SimpleSAML_Configuration::getConfig('module_statistics.php'); +$config = \SimpleSAML\Configuration::getInstance(); +$statconfig = \SimpleSAML\Configuration::getConfig('module_statistics.php'); -sspmod_statistics_AccessCheck::checkAccess($statconfig); +\SimpleSAML\Module\statistics\AccessCheck::checkAccess($statconfig); -$aggr = new sspmod_statistics_Aggregator(); +$aggr = new \SimpleSAML\Module\statistics\Aggregator(); $aggr->loadMetadata(); $metadata = $aggr->getMetadata(); -$t = new SimpleSAML_XHTML_Template($config, 'statistics:statmeta.tpl.php'); +$t = new \SimpleSAML\XHTML\Template($config, 'statistics:statmeta.tpl.php'); if ($metadata !== null) { if (in_array('lastrun', $metadata, true)) { @@ -25,4 +25,3 @@ } $t->show(); - diff --git a/vendor/simplesamlphp/simplesamlphp/package-lock.json b/vendor/simplesamlphp/simplesamlphp/package-lock.json new file mode 100644 index 0000000000..019235f246 --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/package-lock.json @@ -0,0 +1,9083 @@ +{ + "name": "simplesamlphp", + "requires": true, + "lockfileVersion": 1, + "dependencies": { + "anymatch": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-2.0.0.tgz", + "integrity": "sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw==", + "dev": true, + "requires": { + "micromatch": "^3.1.4", + "normalize-path": "^2.1.1" + }, + "dependencies": { + "normalize-path": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", + "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", + "dev": true, + "requires": { + "remove-trailing-separator": "^1.0.1" + } + } + } + }, + "arr-diff": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", + "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", + "dev": true + }, + "arr-flatten": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", + "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==", + "dev": true + }, + "arr-union": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", + "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=", + "dev": true + }, + "array-unique": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", + "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", + "dev": true + }, + "assign-symbols": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", + "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=", + "dev": true + }, + "async-each": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.3.tgz", + "integrity": "sha512-z/WhQ5FPySLdvREByI2vZiTWwCnF0moMJ1hK9YQwDTHKh6I7/uSckMetoRGb5UBZPC1z0jlw+n/XCgjeH7y1AQ==", + "dev": true + }, + "atob": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz", + "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==", + "dev": true + }, + "babel-core": { + "version": "6.26.3", + "resolved": "https://registry.npmjs.org/babel-core/-/babel-core-6.26.3.tgz", + "integrity": "sha512-6jyFLuDmeidKmUEb3NM+/yawG0M2bDZ9Z1qbZP59cyHLz8kYGKYwpJP0UwUKKUiTRNvxfLesJnTedqczP7cTDA==", + "dev": true, + "requires": { + "babel-code-frame": "^6.26.0", + "babel-generator": "^6.26.0", + "babel-helpers": "^6.24.1", + "babel-messages": "^6.23.0", + "babel-register": "^6.26.0", + "babel-runtime": "^6.26.0", + "babel-template": "^6.26.0", + "babel-traverse": "^6.26.0", + "babel-types": "^6.26.0", + "babylon": "^6.18.0", + "convert-source-map": "^1.5.1", + "debug": "^2.6.9", + "json5": "^0.5.1", + "lodash": "^4.17.4", + "minimatch": "^3.0.4", + "path-is-absolute": "^1.0.1", + "private": "^0.1.8", + "slash": "^1.0.0", + "source-map": "^0.5.7" + }, + "dependencies": { + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true + }, + "ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", + "dev": true + }, + "babel-code-frame": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz", + "integrity": "sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=", + "dev": true, + "requires": { + "chalk": "^1.1.3", + "esutils": "^2.0.2", + "js-tokens": "^3.0.2" + } + }, + "babel-generator": { + "version": "6.26.1", + "resolved": "https://registry.npmjs.org/babel-generator/-/babel-generator-6.26.1.tgz", + "integrity": "sha512-HyfwY6ApZj7BYTcJURpM5tznulaBvyio7/0d4zFOeMPUmfxkCjHocCuoLa2SAGzBI8AREcH3eP3758F672DppA==", + "dev": true, + "requires": { + "babel-messages": "^6.23.0", + "babel-runtime": "^6.26.0", + "babel-types": "^6.26.0", + "detect-indent": "^4.0.0", + "jsesc": "^1.3.0", + "lodash": "^4.17.4", + "source-map": "^0.5.7", + "trim-right": "^1.0.1" + } + }, + "babel-helpers": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helpers/-/babel-helpers-6.24.1.tgz", + "integrity": "sha1-NHHenK7DiOXIUOWX5Yom3fN2ArI=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1" + } + }, + "babel-messages": { + "version": "6.23.0", + "resolved": "https://registry.npmjs.org/babel-messages/-/babel-messages-6.23.0.tgz", + "integrity": "sha1-8830cDhYA1sqKVHG7F7fbGLyYw4=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0" + } + }, + "babel-register": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-register/-/babel-register-6.26.0.tgz", + "integrity": "sha1-btAhFz4vy0htestFxgCahW9kcHE=", + "dev": true, + "requires": { + "babel-core": "^6.26.0", + "babel-runtime": "^6.26.0", + "core-js": "^2.5.0", + "home-or-tmp": "^2.0.0", + "lodash": "^4.17.4", + "mkdirp": "^0.5.1", + "source-map-support": "^0.4.15" + } + }, + "babel-runtime": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz", + "integrity": "sha1-llxwWGaOgrVde/4E/yM3vItWR/4=", + "dev": true, + "requires": { + "core-js": "^2.4.0", + "regenerator-runtime": "^0.11.0" + } + }, + "babel-template": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-template/-/babel-template-6.26.0.tgz", + "integrity": "sha1-3gPi0WOWsGn0bdn/+FIfsaDjXgI=", + "dev": true, + "requires": { + "babel-runtime": "^6.26.0", + "babel-traverse": "^6.26.0", + "babel-types": "^6.26.0", + "babylon": "^6.18.0", + "lodash": "^4.17.4" + } + }, + "babel-traverse": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-traverse/-/babel-traverse-6.26.0.tgz", + "integrity": "sha1-RqnL1+3MYsjlwGTi0tjQ9ANXZu4=", + "dev": true, + "requires": { + "babel-code-frame": "^6.26.0", + "babel-messages": "^6.23.0", + "babel-runtime": "^6.26.0", + "babel-types": "^6.26.0", + "babylon": "^6.18.0", + "debug": "^2.6.8", + "globals": "^9.18.0", + "invariant": "^2.2.2", + "lodash": "^4.17.4" + } + }, + "babel-types": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-types/-/babel-types-6.26.0.tgz", + "integrity": "sha1-o7Bz+Uq0nrb6Vc1lInozQ4BjJJc=", + "dev": true, + "requires": { + "babel-runtime": "^6.26.0", + "esutils": "^2.0.2", + "lodash": "^4.17.4", + "to-fast-properties": "^1.0.3" + } + }, + "babylon": { + "version": "6.18.0", + "resolved": "https://registry.npmjs.org/babylon/-/babylon-6.18.0.tgz", + "integrity": "sha512-q/UEjfGJ2Cm3oKV71DJz9d25TPnq5rhBVL2Q4fA5wcC3jcrdn7+SssEybFIxwAvvP+YCsCYNKughoF33GxgycQ==", + "dev": true + }, + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "chalk": { + "version": "1.1.3", + "resolved": "http://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "dev": true, + "requires": { + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" + } + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true + }, + "convert-source-map": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.6.0.tgz", + "integrity": "sha512-eFu7XigvxdZ1ETfbgPBohgyQ/Z++C0eEhTor0qRwBw9unw+L0/6V8wkSuGgzdThkiS5lSpdptOQPD8Ak40a+7A==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.1" + } + }, + "core-js": { + "version": "2.5.7", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.5.7.tgz", + "integrity": "sha512-RszJCAxg/PP6uzXVXL6BsxSXx/B05oJAQ2vkJRjyjrEcNVycaqOmNb5OTxZPE3xa5gwZduqza6L9JOCenh/Ecw==", + "dev": true + }, + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "detect-indent": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-4.0.0.tgz", + "integrity": "sha1-920GQ1LN9Docts5hnE7jqUdd4gg=", + "dev": true, + "requires": { + "repeating": "^2.0.0" + } + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true + }, + "esutils": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", + "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", + "dev": true + }, + "globals": { + "version": "9.18.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-9.18.0.tgz", + "integrity": "sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ==", + "dev": true + }, + "has-ansi": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", + "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "home-or-tmp": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/home-or-tmp/-/home-or-tmp-2.0.0.tgz", + "integrity": "sha1-42w/LSyufXRqhX440Y1fMqeILbg=", + "dev": true, + "requires": { + "os-homedir": "^1.0.0", + "os-tmpdir": "^1.0.1" + } + }, + "invariant": { + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz", + "integrity": "sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==", + "dev": true, + "requires": { + "loose-envify": "^1.0.0" + } + }, + "is-finite": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.0.2.tgz", + "integrity": "sha1-zGZ3aVYCvlUO8R6LSqYwU0K20Ko=", + "dev": true, + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "js-tokens": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", + "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=", + "dev": true + }, + "jsesc": { + "version": "1.3.0", + "resolved": "http://registry.npmjs.org/jsesc/-/jsesc-1.3.0.tgz", + "integrity": "sha1-RsP+yMGJKxKwgz25vHYiF226s0s=", + "dev": true + }, + "json5": { + "version": "0.5.1", + "resolved": "http://registry.npmjs.org/json5/-/json5-0.5.1.tgz", + "integrity": "sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE=", + "dev": true + }, + "loose-envify": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", + "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", + "dev": true, + "requires": { + "js-tokens": "^3.0.0 || ^4.0.0" + } + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", + "dev": true + }, + "mkdirp": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "dev": true, + "requires": { + "minimist": "0.0.8" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, + "number-is-nan": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", + "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", + "dev": true + }, + "os-homedir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", + "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", + "dev": true + }, + "os-tmpdir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", + "dev": true + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "http://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true + }, + "private": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/private/-/private-0.1.8.tgz", + "integrity": "sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg==", + "dev": true + }, + "regenerator-runtime": { + "version": "0.11.1", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz", + "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==", + "dev": true + }, + "repeating": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/repeating/-/repeating-2.0.1.tgz", + "integrity": "sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo=", + "dev": true, + "requires": { + "is-finite": "^1.0.0" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "slash": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-1.0.0.tgz", + "integrity": "sha1-xB8vbDn8FtHNF61LXYlhFK5HDVU=", + "dev": true + }, + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true + }, + "source-map-support": { + "version": "0.4.18", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.4.18.tgz", + "integrity": "sha512-try0/JqxPLF9nOjvSta7tVondkP5dwgyLDjVoyMDlmjugT2lRZ1OfsrYTkCd2hkDnJTKRbO/Rl3orm8vlsUzbA==", + "dev": true, + "requires": { + "source-map": "^0.5.6" + } + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", + "dev": true + }, + "to-fast-properties": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-1.0.3.tgz", + "integrity": "sha1-uDVx+k2MJbguIxsG46MFXeTKGkc=", + "dev": true + }, + "trim-right": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/trim-right/-/trim-right-1.0.1.tgz", + "integrity": "sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM=", + "dev": true + } + } + }, + "babel-loader": { + "version": "7.1.5", + "resolved": "https://registry.npmjs.org/babel-loader/-/babel-loader-7.1.5.tgz", + "integrity": "sha512-iCHfbieL5d1LfOQeeVJEUyD9rTwBcP/fcEbRCfempxTDuqrKpu0AZjLAQHEQa3Yqyj9ORKe2iHfoj4rHLf7xpw==", + "dev": true, + "requires": { + "find-cache-dir": "^1.0.0", + "loader-utils": "^1.0.2", + "mkdirp": "^0.5.1" + }, + "dependencies": { + "big.js": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/big.js/-/big.js-3.2.0.tgz", + "integrity": "sha512-+hN/Zh2D08Mx65pZ/4g5bsmNiZUuChDiQfTUQ7qJr4/kuopCr88xZsAXv6mBoZEsUI4OuGHlX59qE94K2mMW8Q==", + "dev": true + }, + "commondir": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", + "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=", + "dev": true + }, + "emojis-list": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-2.1.0.tgz", + "integrity": "sha1-TapNnbAPmBmIDHn6RXrlsJof04k=", + "dev": true + }, + "find-cache-dir": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-1.0.0.tgz", + "integrity": "sha1-kojj6ePMN0hxfTnq3hfPcfww7m8=", + "dev": true, + "requires": { + "commondir": "^1.0.1", + "make-dir": "^1.0.0", + "pkg-dir": "^2.0.0" + } + }, + "find-up": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "dev": true, + "requires": { + "locate-path": "^2.0.0" + } + }, + "json5": { + "version": "0.5.1", + "resolved": "http://registry.npmjs.org/json5/-/json5-0.5.1.tgz", + "integrity": "sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE=", + "dev": true + }, + "loader-utils": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.1.0.tgz", + "integrity": "sha1-yYrvSIvM7aL/teLeZG1qdUQp9c0=", + "dev": true, + "requires": { + "big.js": "^3.1.3", + "emojis-list": "^2.0.0", + "json5": "^0.5.0" + } + }, + "locate-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", + "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", + "dev": true, + "requires": { + "p-locate": "^2.0.0", + "path-exists": "^3.0.0" + } + }, + "make-dir": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.3.0.tgz", + "integrity": "sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ==", + "dev": true, + "requires": { + "pify": "^3.0.0" + } + }, + "minimist": { + "version": "0.0.8", + "resolved": "http://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", + "dev": true + }, + "mkdirp": { + "version": "0.5.1", + "resolved": "http://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "dev": true, + "requires": { + "minimist": "0.0.8" + } + }, + "p-limit": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", + "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", + "dev": true, + "requires": { + "p-try": "^1.0.0" + } + }, + "p-locate": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", + "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", + "dev": true, + "requires": { + "p-limit": "^1.1.0" + } + }, + "p-try": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", + "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", + "dev": true + }, + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "dev": true + }, + "pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", + "dev": true + }, + "pkg-dir": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-2.0.0.tgz", + "integrity": "sha1-9tXREJ4Z1j7fQo4L1X4Sd3YVM0s=", + "dev": true, + "requires": { + "find-up": "^2.1.0" + } + } + } + }, + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true + }, + "base": { + "version": "0.11.2", + "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", + "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", + "dev": true, + "requires": { + "cache-base": "^1.0.1", + "class-utils": "^0.3.5", + "component-emitter": "^1.2.1", + "define-property": "^1.0.0", + "isobject": "^3.0.1", + "mixin-deep": "^1.2.0", + "pascalcase": "^0.1.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "requires": { + "is-descriptor": "^1.0.0" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + } + } + }, + "binary-extensions": { + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.13.1.tgz", + "integrity": "sha512-Un7MIEDdUC5gNpcGDV97op1Ywk748MpHcFTHoYs6qnj1Z3j7I53VG3nwZhKzoBZmbdRNnb6WRdFlwl7tSDuZGw==", + "dev": true + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "braces": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", + "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", + "dev": true, + "requires": { + "arr-flatten": "^1.1.0", + "array-unique": "^0.3.2", + "extend-shallow": "^2.0.1", + "fill-range": "^4.0.0", + "isobject": "^3.0.1", + "repeat-element": "^1.1.2", + "snapdragon": "^0.8.1", + "snapdragon-node": "^2.0.1", + "split-string": "^3.0.2", + "to-regex": "^3.0.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "cache-base": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", + "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", + "dev": true, + "requires": { + "collection-visit": "^1.0.0", + "component-emitter": "^1.2.1", + "get-value": "^2.0.6", + "has-value": "^1.0.0", + "isobject": "^3.0.1", + "set-value": "^2.0.0", + "to-object-path": "^0.3.0", + "union-value": "^1.0.0", + "unset-value": "^1.0.0" + } + }, + "chokidar": { + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.1.8.tgz", + "integrity": "sha512-ZmZUazfOzf0Nve7duiCKD23PFSCs4JPoYyccjUFF3aQkQadqBhfzhjkwBH2mNOG9cTBwhamM37EIsIkZw3nRgg==", + "dev": true, + "requires": { + "anymatch": "^2.0.0", + "async-each": "^1.0.1", + "braces": "^2.3.2", + "fsevents": "^1.2.7", + "glob-parent": "^3.1.0", + "inherits": "^2.0.3", + "is-binary-path": "^1.0.0", + "is-glob": "^4.0.0", + "normalize-path": "^3.0.0", + "path-is-absolute": "^1.0.0", + "readdirp": "^2.2.1", + "upath": "^1.1.1" + } + }, + "class-utils": { + "version": "0.3.6", + "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", + "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==", + "dev": true, + "requires": { + "arr-union": "^3.1.0", + "define-property": "^0.2.5", + "isobject": "^3.0.0", + "static-extend": "^0.1.1" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + } + } + }, + "clipboard": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/clipboard/-/clipboard-2.0.4.tgz", + "integrity": "sha512-Vw26VSLRpJfBofiVaFb/I8PVfdI1OxKcYShe6fm0sP/DtmiWQNCjhM/okTvdCo0G+lMMm1rMYbk4IK4x1X+kgQ==", + "requires": { + "good-listener": "^1.2.2", + "select": "^1.1.2", + "tiny-emitter": "^2.0.0" + }, + "dependencies": { + "delegate": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/delegate/-/delegate-3.2.0.tgz", + "integrity": "sha512-IofjkYBZaZivn0V8nnsMJGBr4jVLxHDheKSW88PyxS5QC4Vo9ZbZVvhzlSxY87fVq3STR6r+4cGepyHkcWOQSw==" + }, + "good-listener": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/good-listener/-/good-listener-1.2.2.tgz", + "integrity": "sha1-1TswzfkxPf+33JoNR3CWqm0UXFA=", + "requires": { + "delegate": "^3.1.2" + } + }, + "select": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/select/-/select-1.1.2.tgz", + "integrity": "sha1-DnNQrN7ICxEIUoeG7B1EGNEbOW0=" + }, + "tiny-emitter": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/tiny-emitter/-/tiny-emitter-2.0.2.tgz", + "integrity": "sha512-2NM0auVBGft5tee/OxP4PI3d8WItkDM+fPnaRAVo6xTDI2knbz9eC5ArWGqtGlYqiH3RU5yMpdyTTO7MguC4ow==" + } + } + }, + "collection-visit": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", + "integrity": "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=", + "dev": true, + "requires": { + "map-visit": "^1.0.0", + "object-visit": "^1.0.0" + } + }, + "component-emitter": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", + "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==", + "dev": true + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true + }, + "copy-descriptor": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", + "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=", + "dev": true + }, + "copy-webpack-plugin": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/copy-webpack-plugin/-/copy-webpack-plugin-4.6.0.tgz", + "integrity": "sha512-Y+SQCF+0NoWQryez2zXn5J5knmr9z/9qSQt7fbL78u83rxmigOy8X5+BFn8CFSuX+nKT8gpYwJX68ekqtQt6ZA==", + "dev": true, + "requires": { + "cacache": "^10.0.4", + "find-cache-dir": "^1.0.0", + "globby": "^7.1.1", + "is-glob": "^4.0.0", + "loader-utils": "^1.1.0", + "minimatch": "^3.0.4", + "p-limit": "^1.0.0", + "serialize-javascript": "^1.4.0" + }, + "dependencies": { + "aproba": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", + "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", + "dev": true + }, + "array-union": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", + "integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=", + "dev": true, + "requires": { + "array-uniq": "^1.0.1" + } + }, + "array-uniq": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz", + "integrity": "sha1-r2rId6Jcx/dOBYiUdThY39sk/bY=", + "dev": true + }, + "arrify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", + "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", + "dev": true + }, + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true + }, + "big.js": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/big.js/-/big.js-3.2.0.tgz", + "integrity": "sha512-+hN/Zh2D08Mx65pZ/4g5bsmNiZUuChDiQfTUQ7qJr4/kuopCr88xZsAXv6mBoZEsUI4OuGHlX59qE94K2mMW8Q==", + "dev": true + }, + "bluebird": { + "version": "3.5.3", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.3.tgz", + "integrity": "sha512-/qKPUQlaW1OyR51WeCPBvRnAlnZFUJkCSG5HzGnuIqhgyJtF+T94lFnn33eiazjRm2LAHVy2guNnaq48X9SJuw==", + "dev": true + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "buffer-from": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", + "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", + "dev": true + }, + "cacache": { + "version": "10.0.4", + "resolved": "http://registry.npmjs.org/cacache/-/cacache-10.0.4.tgz", + "integrity": "sha512-Dph0MzuH+rTQzGPNT9fAnrPmMmjKfST6trxJeK7NQuHRaVw24VzPRWTmg9MpcwOVQZO0E1FBICUlFeNaKPIfHA==", + "dev": true, + "requires": { + "bluebird": "^3.5.1", + "chownr": "^1.0.1", + "glob": "^7.1.2", + "graceful-fs": "^4.1.11", + "lru-cache": "^4.1.1", + "mississippi": "^2.0.0", + "mkdirp": "^0.5.1", + "move-concurrently": "^1.0.1", + "promise-inflight": "^1.0.1", + "rimraf": "^2.6.2", + "ssri": "^5.2.4", + "unique-filename": "^1.1.0", + "y18n": "^4.0.0" + } + }, + "chownr": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.1.tgz", + "integrity": "sha512-j38EvO5+LHX84jlo6h4UzmOwi0UgW61WRyPtJz4qaadK5eY3BTS5TY/S1Stc3Uk2lIM6TPevAlULiEJwie860g==", + "dev": true + }, + "commondir": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", + "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=", + "dev": true + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true + }, + "concat-stream": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", + "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", + "dev": true, + "requires": { + "buffer-from": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^2.2.2", + "typedarray": "^0.0.6" + } + }, + "copy-concurrently": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/copy-concurrently/-/copy-concurrently-1.0.5.tgz", + "integrity": "sha512-f2domd9fsVDFtaFcbaRZuYXwtdmnzqbADSwhSWYxYB/Q8zsdUUFMXVRwXGDMWmbEzAn1kdRrtI1T/KTFOL4X2A==", + "dev": true, + "requires": { + "aproba": "^1.1.1", + "fs-write-stream-atomic": "^1.0.8", + "iferr": "^0.1.5", + "mkdirp": "^0.5.1", + "rimraf": "^2.5.4", + "run-queue": "^1.0.0" + } + }, + "core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", + "dev": true + }, + "cyclist": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/cyclist/-/cyclist-0.2.2.tgz", + "integrity": "sha1-GzN5LhHpFKL9bW7WRHRkRE5fpkA=", + "dev": true + }, + "dir-glob": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-2.0.0.tgz", + "integrity": "sha512-37qirFDz8cA5fimp9feo43fSuRo2gHwaIn6dXL8Ber1dGwUosDrGZeCCXq57WnIqE4aQ+u3eQZzsk1yOzhdwag==", + "dev": true, + "requires": { + "arrify": "^1.0.1", + "path-type": "^3.0.0" + } + }, + "duplexify": { + "version": "3.6.1", + "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.6.1.tgz", + "integrity": "sha512-vM58DwdnKmty+FSPzT14K9JXb90H+j5emaR4KYbr2KTIz00WHGbWOe5ghQTx233ZCLZtrGDALzKwcjEtSt35mA==", + "dev": true, + "requires": { + "end-of-stream": "^1.0.0", + "inherits": "^2.0.1", + "readable-stream": "^2.0.0", + "stream-shift": "^1.0.0" + } + }, + "emojis-list": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-2.1.0.tgz", + "integrity": "sha1-TapNnbAPmBmIDHn6RXrlsJof04k=", + "dev": true + }, + "end-of-stream": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz", + "integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==", + "dev": true, + "requires": { + "once": "^1.4.0" + } + }, + "find-cache-dir": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-1.0.0.tgz", + "integrity": "sha1-kojj6ePMN0hxfTnq3hfPcfww7m8=", + "dev": true, + "requires": { + "commondir": "^1.0.1", + "make-dir": "^1.0.0", + "pkg-dir": "^2.0.0" + } + }, + "find-up": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "dev": true, + "requires": { + "locate-path": "^2.0.0" + } + }, + "flush-write-stream": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/flush-write-stream/-/flush-write-stream-1.0.3.tgz", + "integrity": "sha512-calZMC10u0FMUqoiunI2AiGIIUtUIvifNwkHhNupZH4cbNnW1Itkoh/Nf5HFYmDrwWPjrUxpkZT0KhuCq0jmGw==", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "readable-stream": "^2.0.4" + } + }, + "from2": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/from2/-/from2-2.3.0.tgz", + "integrity": "sha1-i/tVAr3kpNNs/e6gB/zKIdfjgq8=", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "readable-stream": "^2.0.0" + } + }, + "fs-write-stream-atomic": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/fs-write-stream-atomic/-/fs-write-stream-atomic-1.0.10.tgz", + "integrity": "sha1-tH31NJPvkR33VzHnCp3tAYnbQMk=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "iferr": "^0.1.5", + "imurmurhash": "^0.1.4", + "readable-stream": "1 || 2" + } + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "glob": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", + "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "globby": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/globby/-/globby-7.1.1.tgz", + "integrity": "sha1-+yzP+UAfhgCUXfral0QMypcrhoA=", + "dev": true, + "requires": { + "array-union": "^1.0.1", + "dir-glob": "^2.0.0", + "glob": "^7.1.2", + "ignore": "^3.3.5", + "pify": "^3.0.0", + "slash": "^1.0.0" + } + }, + "graceful-fs": { + "version": "4.1.15", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.15.tgz", + "integrity": "sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA==", + "dev": true + }, + "iferr": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/iferr/-/iferr-0.1.5.tgz", + "integrity": "sha1-xg7taebY/bazEEofy8ocGS3FtQE=", + "dev": true + }, + "ignore": { + "version": "3.3.10", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-3.3.10.tgz", + "integrity": "sha512-Pgs951kaMm5GXP7MOvxERINe3gsaVjUWFm+UZPSq9xYriQAksyhg0csnS0KXSNRD5NmNdapXEpjxG49+AKh/ug==", + "dev": true + }, + "imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "dev": true + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", + "dev": true + }, + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "dev": true + }, + "is-glob": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.0.tgz", + "integrity": "sha1-lSHHaEXMJhCoUgPd8ICpWML/q8A=", + "dev": true, + "requires": { + "is-extglob": "^2.1.1" + } + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, + "json5": { + "version": "0.5.1", + "resolved": "http://registry.npmjs.org/json5/-/json5-0.5.1.tgz", + "integrity": "sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE=", + "dev": true + }, + "loader-utils": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.1.0.tgz", + "integrity": "sha1-yYrvSIvM7aL/teLeZG1qdUQp9c0=", + "dev": true, + "requires": { + "big.js": "^3.1.3", + "emojis-list": "^2.0.0", + "json5": "^0.5.0" + } + }, + "locate-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", + "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", + "dev": true, + "requires": { + "p-locate": "^2.0.0", + "path-exists": "^3.0.0" + } + }, + "lru-cache": { + "version": "4.1.4", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.4.tgz", + "integrity": "sha512-EPstzZ23znHUVLKj+lcXO1KvZkrlw+ZirdwvOmnAnA/1PB4ggyXJ77LRkCqkff+ShQ+cqoxCxLQOh4cKITO5iA==", + "dev": true, + "requires": { + "pseudomap": "^1.0.2", + "yallist": "^3.0.2" + } + }, + "make-dir": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.3.0.tgz", + "integrity": "sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ==", + "dev": true, + "requires": { + "pify": "^3.0.0" + } + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "0.0.8", + "resolved": "http://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", + "dev": true + }, + "mississippi": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/mississippi/-/mississippi-2.0.0.tgz", + "integrity": "sha512-zHo8v+otD1J10j/tC+VNoGK9keCuByhKovAvdn74dmxJl9+mWHnx6EMsDN4lgRoMI/eYo2nchAxniIbUPb5onw==", + "dev": true, + "requires": { + "concat-stream": "^1.5.0", + "duplexify": "^3.4.2", + "end-of-stream": "^1.1.0", + "flush-write-stream": "^1.0.0", + "from2": "^2.1.0", + "parallel-transform": "^1.1.0", + "pump": "^2.0.1", + "pumpify": "^1.3.3", + "stream-each": "^1.1.0", + "through2": "^2.0.0" + } + }, + "mkdirp": { + "version": "0.5.1", + "resolved": "http://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "dev": true, + "requires": { + "minimist": "0.0.8" + } + }, + "move-concurrently": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/move-concurrently/-/move-concurrently-1.0.1.tgz", + "integrity": "sha1-viwAX9oy4LKa8fBdfEszIUxwH5I=", + "dev": true, + "requires": { + "aproba": "^1.1.1", + "copy-concurrently": "^1.0.0", + "fs-write-stream-atomic": "^1.0.8", + "mkdirp": "^0.5.1", + "rimraf": "^2.5.4", + "run-queue": "^1.0.3" + } + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "requires": { + "wrappy": "1" + } + }, + "p-limit": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", + "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", + "dev": true, + "requires": { + "p-try": "^1.0.0" + } + }, + "p-locate": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", + "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", + "dev": true, + "requires": { + "p-limit": "^1.1.0" + } + }, + "p-try": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", + "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", + "dev": true + }, + "parallel-transform": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/parallel-transform/-/parallel-transform-1.1.0.tgz", + "integrity": "sha1-1BDwZbBdojCB/NEPKIVMKb2jOwY=", + "dev": true, + "requires": { + "cyclist": "~0.2.2", + "inherits": "^2.0.3", + "readable-stream": "^2.1.5" + } + }, + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "dev": true + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true + }, + "path-type": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", + "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", + "dev": true, + "requires": { + "pify": "^3.0.0" + } + }, + "pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", + "dev": true + }, + "pkg-dir": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-2.0.0.tgz", + "integrity": "sha1-9tXREJ4Z1j7fQo4L1X4Sd3YVM0s=", + "dev": true, + "requires": { + "find-up": "^2.1.0" + } + }, + "process-nextick-args": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", + "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==", + "dev": true + }, + "promise-inflight": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/promise-inflight/-/promise-inflight-1.0.1.tgz", + "integrity": "sha1-mEcocL8igTL8vdhoEputEsPAKeM=", + "dev": true + }, + "pseudomap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", + "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=", + "dev": true + }, + "pump": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pump/-/pump-2.0.1.tgz", + "integrity": "sha512-ruPMNRkN3MHP1cWJc9OWr+T/xDP0jhXYCLfJcBuX54hhfIBnaQmAUMfDcG4DM5UMWByBbJY69QSphm3jtDKIkA==", + "dev": true, + "requires": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "pumpify": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/pumpify/-/pumpify-1.5.1.tgz", + "integrity": "sha512-oClZI37HvuUJJxSKKrC17bZ9Cu0ZYhEAGPsPUy9KlMUmv9dKX2o77RUmq7f3XjIxbwyGwYzbzQ1L2Ks8sIradQ==", + "dev": true, + "requires": { + "duplexify": "^3.6.0", + "inherits": "^2.0.3", + "pump": "^2.0.0" + } + }, + "readable-stream": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "rimraf": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz", + "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==", + "dev": true, + "requires": { + "glob": "^7.0.5" + } + }, + "run-queue": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/run-queue/-/run-queue-1.0.3.tgz", + "integrity": "sha1-6Eg5bwV9Ij8kOGkkYY4laUFh7Ec=", + "dev": true, + "requires": { + "aproba": "^1.1.1" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "serialize-javascript": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-1.5.0.tgz", + "integrity": "sha512-Ga8c8NjAAp46Br4+0oZ2WxJCwIzwP60Gq1YPgU+39PiTVxyed/iKE/zyZI6+UlVYH5Q4PaQdHhcegIFPZTUfoQ==", + "dev": true + }, + "slash": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-1.0.0.tgz", + "integrity": "sha1-xB8vbDn8FtHNF61LXYlhFK5HDVU=", + "dev": true + }, + "ssri": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/ssri/-/ssri-5.3.0.tgz", + "integrity": "sha512-XRSIPqLij52MtgoQavH/x/dU1qVKtWUAAZeOHsR9c2Ddi4XerFy3mc1alf+dLJKl9EUIm/Ht+EowFkTUOA6GAQ==", + "dev": true, + "requires": { + "safe-buffer": "^5.1.1" + } + }, + "stream-each": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/stream-each/-/stream-each-1.2.3.tgz", + "integrity": "sha512-vlMC2f8I2u/bZGqkdfLQW/13Zihpej/7PmSiMQsbYddxuTsJp8vRe2x2FvVExZg7FaOds43ROAuFJwPR4MTZLw==", + "dev": true, + "requires": { + "end-of-stream": "^1.1.0", + "stream-shift": "^1.0.0" + } + }, + "stream-shift": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.0.tgz", + "integrity": "sha1-1cdSgl5TZ+eG944Y5EXqIjoVWVI=", + "dev": true + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.0" + } + }, + "through2": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", + "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", + "dev": true, + "requires": { + "readable-stream": "~2.3.6", + "xtend": "~4.0.1" + } + }, + "typedarray": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", + "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", + "dev": true + }, + "unique-filename": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-1.1.1.tgz", + "integrity": "sha512-Vmp0jIp2ln35UTXuryvjzkjGdRyf9b2lTXuSYUiPmzRcl3FDtYqAwOnTJkAngD9SWhnoJzDbTKwaOrZ+STtxNQ==", + "dev": true, + "requires": { + "unique-slug": "^2.0.0" + } + }, + "unique-slug": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/unique-slug/-/unique-slug-2.0.1.tgz", + "integrity": "sha512-n9cU6+gITaVu7VGj1Z8feKMmfAjEAQGhwD9fE3zvpRRa0wEIx8ODYkVGfSc94M2OX00tUFV8wH3zYbm1I8mxFg==", + "dev": true, + "requires": { + "imurmurhash": "^0.1.4" + } + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", + "dev": true + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true + }, + "xtend": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", + "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=", + "dev": true + }, + "y18n": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz", + "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==", + "dev": true + }, + "yallist": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.0.3.tgz", + "integrity": "sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A==", + "dev": true + } + } + }, + "core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", + "dev": true + }, + "css-loader": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/css-loader/-/css-loader-1.0.1.tgz", + "integrity": "sha512-+ZHAZm/yqvJ2kDtPne3uX0C+Vr3Zn5jFn2N4HywtS5ujwvsVkyg0VArEXpl3BgczDA8anieki1FIzhchX4yrDw==", + "dev": true, + "requires": { + "babel-code-frame": "^6.26.0", + "css-selector-tokenizer": "^0.7.0", + "icss-utils": "^2.1.0", + "loader-utils": "^1.0.2", + "lodash": "^4.17.11", + "postcss": "^6.0.23", + "postcss-modules-extract-imports": "^1.2.0", + "postcss-modules-local-by-default": "^1.2.0", + "postcss-modules-scope": "^1.1.0", + "postcss-modules-values": "^1.3.0", + "postcss-value-parser": "^3.3.0", + "source-list-map": "^2.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true + }, + "ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", + "dev": true + }, + "babel-code-frame": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz", + "integrity": "sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=", + "dev": true, + "requires": { + "chalk": "^1.1.3", + "esutils": "^2.0.2", + "js-tokens": "^3.0.2" + } + }, + "big.js": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/big.js/-/big.js-3.2.0.tgz", + "integrity": "sha512-+hN/Zh2D08Mx65pZ/4g5bsmNiZUuChDiQfTUQ7qJr4/kuopCr88xZsAXv6mBoZEsUI4OuGHlX59qE94K2mMW8Q==", + "dev": true + }, + "chalk": { + "version": "1.1.3", + "resolved": "http://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "dev": true, + "requires": { + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, + "css-selector-tokenizer": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/css-selector-tokenizer/-/css-selector-tokenizer-0.7.1.tgz", + "integrity": "sha512-xYL0AMZJ4gFzJQsHUKa5jiWWi2vH77WVNg7JYRyewwj6oPh4yb/y6Y9ZCw9dsj/9UauMhtuxR+ogQd//EdEVNA==", + "dev": true, + "requires": { + "cssesc": "^0.1.0", + "fastparse": "^1.1.1", + "regexpu-core": "^1.0.0" + } + }, + "cssesc": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/cssesc/-/cssesc-0.1.0.tgz", + "integrity": "sha1-yBSQPkViM3GgR3tAEJqq++6t27Q=", + "dev": true + }, + "emojis-list": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-2.1.0.tgz", + "integrity": "sha1-TapNnbAPmBmIDHn6RXrlsJof04k=", + "dev": true + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true + }, + "esutils": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", + "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", + "dev": true + }, + "fastparse": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/fastparse/-/fastparse-1.1.2.tgz", + "integrity": "sha512-483XLLxTVIwWK3QTrMGRqUfUpoOs/0hbQrl2oz4J0pAcm3A3bu84wxTFqGqkJzewCLdME38xJLJAxBABfQT8sQ==", + "dev": true + }, + "has-ansi": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", + "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "icss-replace-symbols": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/icss-replace-symbols/-/icss-replace-symbols-1.1.0.tgz", + "integrity": "sha1-Bupvg2ead0njhs/h/oEq5dsiPe0=", + "dev": true + }, + "icss-utils": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/icss-utils/-/icss-utils-2.1.0.tgz", + "integrity": "sha1-g/Cg7DeL8yRheLbCrZE28TWxyWI=", + "dev": true, + "requires": { + "postcss": "^6.0.1" + } + }, + "js-tokens": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", + "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=", + "dev": true + }, + "jsesc": { + "version": "0.5.0", + "resolved": "http://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", + "integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=", + "dev": true + }, + "json5": { + "version": "0.5.1", + "resolved": "http://registry.npmjs.org/json5/-/json5-0.5.1.tgz", + "integrity": "sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE=", + "dev": true + }, + "loader-utils": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.1.0.tgz", + "integrity": "sha1-yYrvSIvM7aL/teLeZG1qdUQp9c0=", + "dev": true, + "requires": { + "big.js": "^3.1.3", + "emojis-list": "^2.0.0", + "json5": "^0.5.0" + } + }, + "lodash": { + "version": "4.17.15", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", + "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", + "dev": true + }, + "postcss": { + "version": "6.0.23", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.23.tgz", + "integrity": "sha512-soOk1h6J3VMTZtVeVpv15/Hpdl2cBLX3CAw4TAbkpTJiNPk9YP/zWcD1ND+xEtvyuuvKzbxliTOIyvkSeSJ6ag==", + "dev": true, + "requires": { + "chalk": "^2.4.1", + "source-map": "^0.6.1", + "supports-color": "^5.4.0" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "postcss-modules-extract-imports": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/postcss-modules-extract-imports/-/postcss-modules-extract-imports-1.2.1.tgz", + "integrity": "sha512-6jt9XZwUhwmRUhb/CkyJY020PYaPJsCyt3UjbaWo6XEbH/94Hmv6MP7fG2C5NDU/BcHzyGYxNtHvM+LTf9HrYw==", + "dev": true, + "requires": { + "postcss": "^6.0.1" + } + }, + "postcss-modules-local-by-default": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/postcss-modules-local-by-default/-/postcss-modules-local-by-default-1.2.0.tgz", + "integrity": "sha1-99gMOYxaOT+nlkRmvRlQCn1hwGk=", + "dev": true, + "requires": { + "css-selector-tokenizer": "^0.7.0", + "postcss": "^6.0.1" + } + }, + "postcss-modules-scope": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/postcss-modules-scope/-/postcss-modules-scope-1.1.0.tgz", + "integrity": "sha1-1upkmUx5+XtipytCb75gVqGUu5A=", + "dev": true, + "requires": { + "css-selector-tokenizer": "^0.7.0", + "postcss": "^6.0.1" + } + }, + "postcss-modules-values": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/postcss-modules-values/-/postcss-modules-values-1.3.0.tgz", + "integrity": "sha1-7P+p1+GSUYOJ9CrQ6D9yrsRW6iA=", + "dev": true, + "requires": { + "icss-replace-symbols": "^1.1.0", + "postcss": "^6.0.1" + } + }, + "postcss-value-parser": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz", + "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==", + "dev": true + }, + "regenerate": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.0.tgz", + "integrity": "sha512-1G6jJVDWrt0rK99kBjvEtziZNCICAuvIPkSiUFIQxVP06RCVpq3dmDo2oi6ABpYaDYaTRr67BEhL8r1wgEZZKg==", + "dev": true + }, + "regexpu-core": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-1.0.0.tgz", + "integrity": "sha1-hqdj9Y7k18L2sQLkdkBQ3n7ZDGs=", + "dev": true, + "requires": { + "regenerate": "^1.2.1", + "regjsgen": "^0.2.0", + "regjsparser": "^0.1.4" + } + }, + "regjsgen": { + "version": "0.2.0", + "resolved": "http://registry.npmjs.org/regjsgen/-/regjsgen-0.2.0.tgz", + "integrity": "sha1-bAFq3qxVT3WCP+N6wFuS1aTtsfc=", + "dev": true + }, + "regjsparser": { + "version": "0.1.5", + "resolved": "http://registry.npmjs.org/regjsparser/-/regjsparser-0.1.5.tgz", + "integrity": "sha1-fuj4Tcb6eS0/0K4ijSS9lJ6tIFw=", + "dev": true, + "requires": { + "jsesc": "~0.5.0" + } + }, + "source-list-map": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/source-list-map/-/source-list-map-2.0.1.tgz", + "integrity": "sha512-qnQ7gVMxGNxsiL4lEuJwe/To8UnK7fAnmbGEEH8RpLouuKbeEm0lhbQVFIrNSuB+G7tVrAlVsZgETT5nljf+Iw==", + "dev": true + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "http://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", + "dev": true + } + } + }, + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "decode-uri-component": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", + "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=", + "dev": true + }, + "define-property": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", + "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", + "dev": true, + "requires": { + "is-descriptor": "^1.0.2", + "isobject": "^3.0.1" + }, + "dependencies": { + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + } + } + }, + "es6-shim": { + "version": "0.35.4", + "resolved": "https://registry.npmjs.org/es6-shim/-/es6-shim-0.35.4.tgz", + "integrity": "sha512-oJidbXjN/VWXZJs41E9JEqWzcFbjt43JupimIoVX82Thzt5qy1CiYezdhRmWkj3KOuwJ106IG/ZZrcFC6fgIUQ==" + }, + "expand-brackets": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", + "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", + "dev": true, + "requires": { + "debug": "^2.3.3", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "posix-character-classes": "^0.1.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "expose-loader": { + "version": "0.7.5", + "resolved": "https://registry.npmjs.org/expose-loader/-/expose-loader-0.7.5.tgz", + "integrity": "sha512-iPowgKUZkTPX5PznYsmifVj9Bob0w2wTHVkt/eYNPSzyebkUgIedmskf/kcfEIWpiWjg3JRjnW+a17XypySMuw==", + "dev": true + }, + "extend-shallow": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", + "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", + "dev": true, + "requires": { + "assign-symbols": "^1.0.0", + "is-extendable": "^1.0.1" + }, + "dependencies": { + "is-extendable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "dev": true, + "requires": { + "is-plain-object": "^2.0.4" + } + } + } + }, + "extglob": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", + "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", + "dev": true, + "requires": { + "array-unique": "^0.3.2", + "define-property": "^1.0.0", + "expand-brackets": "^2.1.4", + "extend-shallow": "^2.0.1", + "fragment-cache": "^0.2.1", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "requires": { + "is-descriptor": "^1.0.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + } + } + }, + "extract-text-webpack-plugin": { + "version": "4.0.0-beta.0", + "resolved": "https://registry.npmjs.org/extract-text-webpack-plugin/-/extract-text-webpack-plugin-4.0.0-beta.0.tgz", + "integrity": "sha512-Hypkn9jUTnFr0DpekNam53X47tXn3ucY08BQumv7kdGgeVUBLq3DJHJTi6HNxv4jl9W+Skxjz9+RnK0sJyqqjA==", + "dev": true, + "requires": { + "async": "^2.4.1", + "loader-utils": "^1.1.0", + "schema-utils": "^0.4.5", + "webpack-sources": "^1.1.0" + }, + "dependencies": { + "ajv": { + "version": "6.6.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.6.0.tgz", + "integrity": "sha512-ZCIMdm75ps9usdeb0GQL9rKOUlTtS0p0vU2nQVXgRIu6Yb00G9GY7AvbVLwTQ5Po4JDKIwJlT5nwggoRDrDVAw==", + "dev": true, + "requires": { + "fast-deep-equal": "^2.0.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, + "ajv-keywords": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.2.0.tgz", + "integrity": "sha1-6GuBnGAs+IIa1jdBNpjx3sAhhHo=", + "dev": true + }, + "async": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/async/-/async-2.6.1.tgz", + "integrity": "sha512-fNEiL2+AZt6AlAw/29Cr0UDe4sRAHCpEHh54WMz+Bb7QfNcFw4h3loofyJpLeQs4Yx7yuqu/2dLgM5hKOs6HlQ==", + "dev": true, + "requires": { + "lodash": "^4.17.10" + } + }, + "big.js": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/big.js/-/big.js-3.2.0.tgz", + "integrity": "sha512-+hN/Zh2D08Mx65pZ/4g5bsmNiZUuChDiQfTUQ7qJr4/kuopCr88xZsAXv6mBoZEsUI4OuGHlX59qE94K2mMW8Q==", + "dev": true + }, + "emojis-list": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-2.1.0.tgz", + "integrity": "sha1-TapNnbAPmBmIDHn6RXrlsJof04k=", + "dev": true + }, + "fast-deep-equal": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", + "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=", + "dev": true + }, + "fast-json-stable-stringify": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", + "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=", + "dev": true + }, + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "json5": { + "version": "0.5.1", + "resolved": "http://registry.npmjs.org/json5/-/json5-0.5.1.tgz", + "integrity": "sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE=", + "dev": true + }, + "loader-utils": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.1.0.tgz", + "integrity": "sha1-yYrvSIvM7aL/teLeZG1qdUQp9c0=", + "dev": true, + "requires": { + "big.js": "^3.1.3", + "emojis-list": "^2.0.0", + "json5": "^0.5.0" + } + }, + "lodash": { + "version": "4.17.15", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", + "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", + "dev": true + }, + "punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "dev": true + }, + "schema-utils": { + "version": "0.4.7", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-0.4.7.tgz", + "integrity": "sha512-v/iwU6wvwGK8HbU9yi3/nhGzP0yGSuhQMzL6ySiec1FSrZZDkhm4noOSWzrNFo/jEc+SJY6jRTwuwbSXJPDUnQ==", + "dev": true, + "requires": { + "ajv": "^6.1.0", + "ajv-keywords": "^3.1.0" + } + }, + "source-list-map": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/source-list-map/-/source-list-map-2.0.1.tgz", + "integrity": "sha512-qnQ7gVMxGNxsiL4lEuJwe/To8UnK7fAnmbGEEH8RpLouuKbeEm0lhbQVFIrNSuB+G7tVrAlVsZgETT5nljf+Iw==", + "dev": true + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, + "uri-js": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", + "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", + "dev": true, + "requires": { + "punycode": "^2.1.0" + } + }, + "webpack-sources": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-1.3.0.tgz", + "integrity": "sha512-OiVgSrbGu7NEnEvQJJgdSFPl2qWKkWq5lHMhgiToIiN9w34EBnjYzSYs+VbL5KoYiLNtFFa7BZIKxRED3I32pA==", + "dev": true, + "requires": { + "source-list-map": "^2.0.0", + "source-map": "~0.6.1" + } + } + } + }, + "fill-range": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", + "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", + "dev": true, + "requires": { + "extend-shallow": "^2.0.1", + "is-number": "^3.0.0", + "repeat-string": "^1.6.1", + "to-regex-range": "^2.1.0" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "font-awesome": { + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/font-awesome/-/font-awesome-4.7.0.tgz", + "integrity": "sha1-j6jPBBGhoxr9B7BtKQK7n8gVoTM=" + }, + "for-in": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", + "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", + "dev": true + }, + "fragment-cache": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", + "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", + "dev": true, + "requires": { + "map-cache": "^0.2.2" + } + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "fsevents": { + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.9.tgz", + "integrity": "sha512-oeyj2H3EjjonWcFjD5NvZNE9Rqe4UW+nQBU2HNeKw0koVLEFIhtyETyAakeAM3de7Z/SW5kcA+fZUait9EApnw==", + "dev": true, + "optional": true, + "requires": { + "nan": "^2.12.1", + "node-pre-gyp": "^0.12.0" + }, + "dependencies": { + "abbrev": { + "version": "1.1.1", + "bundled": true, + "dev": true, + "optional": true + }, + "ansi-regex": { + "version": "2.1.1", + "bundled": true, + "dev": true, + "optional": true + }, + "aproba": { + "version": "1.2.0", + "bundled": true, + "dev": true, + "optional": true + }, + "are-we-there-yet": { + "version": "1.1.5", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "delegates": "^1.0.0", + "readable-stream": "^2.0.6" + } + }, + "balanced-match": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "brace-expansion": { + "version": "1.1.11", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "chownr": { + "version": "1.1.1", + "bundled": true, + "dev": true, + "optional": true + }, + "code-point-at": { + "version": "1.1.0", + "bundled": true, + "dev": true, + "optional": true + }, + "concat-map": { + "version": "0.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "console-control-strings": { + "version": "1.1.0", + "bundled": true, + "dev": true, + "optional": true + }, + "core-util-is": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "debug": { + "version": "4.1.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "ms": "^2.1.1" + } + }, + "deep-extend": { + "version": "0.6.0", + "bundled": true, + "dev": true, + "optional": true + }, + "delegates": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "detect-libc": { + "version": "1.0.3", + "bundled": true, + "dev": true, + "optional": true + }, + "fs-minipass": { + "version": "1.2.5", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "minipass": "^2.2.1" + } + }, + "fs.realpath": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "gauge": { + "version": "2.7.4", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "aproba": "^1.0.3", + "console-control-strings": "^1.0.0", + "has-unicode": "^2.0.0", + "object-assign": "^4.1.0", + "signal-exit": "^3.0.0", + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1", + "wide-align": "^1.1.0" + } + }, + "glob": { + "version": "7.1.3", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "has-unicode": { + "version": "2.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "iconv-lite": { + "version": "0.4.24", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "safer-buffer": ">= 2.1.2 < 3" + } + }, + "ignore-walk": { + "version": "3.0.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "minimatch": "^3.0.4" + } + }, + "inflight": { + "version": "1.0.6", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.3", + "bundled": true, + "dev": true, + "optional": true + }, + "ini": { + "version": "1.3.5", + "bundled": true, + "dev": true, + "optional": true + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "isarray": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "minimatch": { + "version": "3.0.4", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "0.0.8", + "bundled": true, + "dev": true, + "optional": true + }, + "minipass": { + "version": "2.3.5", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "safe-buffer": "^5.1.2", + "yallist": "^3.0.0" + } + }, + "minizlib": { + "version": "1.2.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "minipass": "^2.2.1" + } + }, + "mkdirp": { + "version": "0.5.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "minimist": "0.0.8" + } + }, + "ms": { + "version": "2.1.1", + "bundled": true, + "dev": true, + "optional": true + }, + "needle": { + "version": "2.3.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "debug": "^4.1.0", + "iconv-lite": "^0.4.4", + "sax": "^1.2.4" + } + }, + "node-pre-gyp": { + "version": "0.12.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "detect-libc": "^1.0.2", + "mkdirp": "^0.5.1", + "needle": "^2.2.1", + "nopt": "^4.0.1", + "npm-packlist": "^1.1.6", + "npmlog": "^4.0.2", + "rc": "^1.2.7", + "rimraf": "^2.6.1", + "semver": "^5.3.0", + "tar": "^4" + } + }, + "nopt": { + "version": "4.0.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "abbrev": "1", + "osenv": "^0.1.4" + } + }, + "npm-bundled": { + "version": "1.0.6", + "bundled": true, + "dev": true, + "optional": true + }, + "npm-packlist": { + "version": "1.4.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "ignore-walk": "^3.0.1", + "npm-bundled": "^1.0.1" + } + }, + "npmlog": { + "version": "4.1.2", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "are-we-there-yet": "~1.1.2", + "console-control-strings": "~1.1.0", + "gauge": "~2.7.3", + "set-blocking": "~2.0.0" + } + }, + "number-is-nan": { + "version": "1.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "object-assign": { + "version": "4.1.1", + "bundled": true, + "dev": true, + "optional": true + }, + "once": { + "version": "1.4.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "wrappy": "1" + } + }, + "os-homedir": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "os-tmpdir": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "osenv": { + "version": "0.1.5", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "os-homedir": "^1.0.0", + "os-tmpdir": "^1.0.0" + } + }, + "path-is-absolute": { + "version": "1.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "process-nextick-args": { + "version": "2.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "rc": { + "version": "1.2.8", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "deep-extend": "^0.6.0", + "ini": "~1.3.0", + "minimist": "^1.2.0", + "strip-json-comments": "~2.0.1" + }, + "dependencies": { + "minimist": { + "version": "1.2.0", + "bundled": true, + "dev": true, + "optional": true + } + } + }, + "readable-stream": { + "version": "2.3.6", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "rimraf": { + "version": "2.6.3", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "glob": "^7.1.3" + } + }, + "safe-buffer": { + "version": "5.1.2", + "bundled": true, + "dev": true, + "optional": true + }, + "safer-buffer": { + "version": "2.1.2", + "bundled": true, + "dev": true, + "optional": true + }, + "sax": { + "version": "1.2.4", + "bundled": true, + "dev": true, + "optional": true + }, + "semver": { + "version": "5.7.0", + "bundled": true, + "dev": true, + "optional": true + }, + "set-blocking": { + "version": "2.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "signal-exit": { + "version": "3.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "string-width": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + } + }, + "string_decoder": { + "version": "1.1.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "safe-buffer": "~5.1.0" + } + }, + "strip-ansi": { + "version": "3.0.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "strip-json-comments": { + "version": "2.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "tar": { + "version": "4.4.8", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "chownr": "^1.1.1", + "fs-minipass": "^1.2.5", + "minipass": "^2.3.4", + "minizlib": "^1.1.1", + "mkdirp": "^0.5.0", + "safe-buffer": "^5.1.2", + "yallist": "^3.0.2" + } + }, + "util-deprecate": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "wide-align": { + "version": "1.1.3", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "string-width": "^1.0.2 || 2" + } + }, + "wrappy": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "yallist": { + "version": "3.0.3", + "bundled": true, + "dev": true, + "optional": true + } + } + }, + "fstream": { + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.12.tgz", + "integrity": "sha512-WvJ193OHa0GHPEL+AycEJgxvBEwyfRkN1vhjca23OaPVMCaLCXTd5qAu82AjTcgP1UJmytkOKb63Ypde7raDIg==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "inherits": "~2.0.0", + "mkdirp": ">=0.5 0", + "rimraf": "2" + } + }, + "get-value": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", + "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=", + "dev": true + }, + "glob": { + "version": "7.1.4", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz", + "integrity": "sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "glob-parent": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", + "integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=", + "dev": true, + "requires": { + "is-glob": "^3.1.0", + "path-dirname": "^1.0.0" + }, + "dependencies": { + "is-glob": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", + "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", + "dev": true, + "requires": { + "is-extglob": "^2.1.0" + } + } + } + }, + "graceful-fs": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.2.tgz", + "integrity": "sha512-IItsdsea19BoLC7ELy13q1iJFNmd7ofZH5+X/pJr90/nRoPEX0DJo1dHDbgtYWOhJhcCgMDTOw84RZ72q6lB+Q==", + "dev": true + }, + "has-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", + "integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=", + "dev": true, + "requires": { + "get-value": "^2.0.6", + "has-values": "^1.0.0", + "isobject": "^3.0.0" + } + }, + "has-values": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz", + "integrity": "sha1-lbC2P+whRmGab+V/51Yo1aOe/k8=", + "dev": true, + "requires": { + "is-number": "^3.0.0", + "kind-of": "^4.0.0" + }, + "dependencies": { + "kind-of": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", + "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "highlight.js": { + "version": "9.13.1", + "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-9.13.1.tgz", + "integrity": "sha512-Sc28JNQNDzaH6PORtRLMvif9RSn1mYuOoX3omVjnb0+HbpPygU2ALBI0R/wsiqCb4/fcp07Gdo8g+fhtFrQl6A==" + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true + }, + "is-accessor-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-binary-path": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz", + "integrity": "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=", + "dev": true, + "requires": { + "binary-extensions": "^1.0.0" + } + }, + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true + }, + "is-data-descriptor": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^0.1.6", + "is-data-descriptor": "^0.1.4", + "kind-of": "^5.0.0" + }, + "dependencies": { + "kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "dev": true + } + } + }, + "is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", + "dev": true + }, + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "dev": true + }, + "is-glob": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", + "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", + "dev": true, + "requires": { + "is-extglob": "^2.1.1" + } + }, + "is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-plain-object": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "dev": true, + "requires": { + "isobject": "^3.0.1" + } + }, + "is-windows": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", + "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", + "dev": true + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + }, + "jquery": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.4.0.tgz", + "integrity": "sha512-ggRCXln9zEqv6OqAGXFEcshF5dSBvCkzj6Gm2gzuR5fWawaX8t7cxKVkkygKODrDAzKdoYw3l/e3pm3vlT4IbQ==" + }, + "jquery-ui": { + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/jquery-ui/-/jquery-ui-1.12.1.tgz", + "integrity": "sha1-vLQEXI3QU5wTS8FIjN0+dop6nlE=" + }, + "kind-of": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "dev": true + }, + "lodash": { + "version": "4.17.15", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", + "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", + "dev": true + }, + "lodash.mergewith": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.mergewith/-/lodash.mergewith-4.6.2.tgz", + "integrity": "sha512-GK3g5RPZWTRSeLSpgP8Xhra+pnjBC56q9FZYe1d5RN3TJ35dbkGy3YqBSMbyCrlbi+CM9Z3Jk5yTL7RCsqboyQ==", + "dev": true + }, + "map-cache": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", + "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=", + "dev": true + }, + "map-visit": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", + "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=", + "dev": true, + "requires": { + "object-visit": "^1.0.0" + } + }, + "micromatch": { + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", + "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "dev": true, + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "braces": "^2.3.1", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "extglob": "^2.0.4", + "fragment-cache": "^0.2.1", + "kind-of": "^6.0.2", + "nanomatch": "^1.2.9", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.2" + } + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", + "dev": true + }, + "mixin-deep": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz", + "integrity": "sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA==", + "dev": true, + "requires": { + "for-in": "^1.0.2", + "is-extendable": "^1.0.1" + }, + "dependencies": { + "is-extendable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "dev": true, + "requires": { + "is-plain-object": "^2.0.4" + } + } + } + }, + "mkdirp": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "dev": true, + "requires": { + "minimist": "0.0.8" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, + "nan": { + "version": "2.14.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.0.tgz", + "integrity": "sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg==", + "dev": true, + "optional": true + }, + "nanomatch": { + "version": "1.2.13", + "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", + "integrity": "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==", + "dev": true, + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "fragment-cache": "^0.2.1", + "is-windows": "^1.0.2", + "kind-of": "^6.0.2", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + } + }, + "node-sass": { + "version": "4.10.0", + "resolved": "https://registry.npmjs.org/node-sass/-/node-sass-4.10.0.tgz", + "integrity": "sha512-fDQJfXszw6vek63Fe/ldkYXmRYK/QS6NbvM3i5oEo9ntPDy4XX7BcKZyTKv+/kSSxRtXXc7l+MSwEmYc0CSy6Q==", + "dev": true, + "requires": { + "async-foreach": "^0.1.3", + "chalk": "^1.1.1", + "cross-spawn": "^3.0.0", + "gaze": "^1.0.0", + "get-stdin": "^4.0.1", + "glob": "^7.0.3", + "in-publish": "^2.0.0", + "lodash.assign": "^4.2.0", + "lodash.clonedeep": "^4.3.2", + "lodash.mergewith": "^4.6.0", + "meow": "^3.7.0", + "mkdirp": "^0.5.1", + "nan": "^2.10.0", + "node-gyp": "^3.8.0", + "npmlog": "^4.0.0", + "request": "^2.88.0", + "sass-graph": "^2.2.4", + "stdout-stream": "^1.4.0", + "true-case-path": "^1.0.2" + }, + "dependencies": { + "abbrev": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", + "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", + "dev": true + }, + "ajv": { + "version": "6.5.5", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.5.5.tgz", + "integrity": "sha512-7q7gtRQDJSyuEHjuVgHoUa2VuemFiCMrfQc9Tc08XTAc4Zj/5U1buQJ0HU6i7fKjXU09SVgSmxa4sLvuvS8Iyg==", + "dev": true, + "requires": { + "fast-deep-equal": "^2.0.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, + "amdefine": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz", + "integrity": "sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU=", + "dev": true + }, + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true + }, + "ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", + "dev": true + }, + "aproba": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", + "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", + "dev": true + }, + "are-we-there-yet": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz", + "integrity": "sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w==", + "dev": true, + "requires": { + "delegates": "^1.0.0", + "readable-stream": "^2.0.6" + } + }, + "array-find-index": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array-find-index/-/array-find-index-1.0.2.tgz", + "integrity": "sha1-3wEKoSh+Fku9pvlyOwqWoexBh6E=", + "dev": true + }, + "asn1": { + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", + "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", + "dev": true, + "requires": { + "safer-buffer": "~2.1.0" + } + }, + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", + "dev": true + }, + "async-foreach": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/async-foreach/-/async-foreach-0.1.3.tgz", + "integrity": "sha1-NhIfhFwFeBct5Bmpfb6x0W7DRUI=", + "dev": true + }, + "asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", + "dev": true + }, + "aws-sign2": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", + "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=", + "dev": true + }, + "aws4": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.8.0.tgz", + "integrity": "sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==", + "dev": true + }, + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true + }, + "bcrypt-pbkdf": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", + "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", + "dev": true, + "requires": { + "tweetnacl": "^0.14.3" + } + }, + "block-stream": { + "version": "0.0.9", + "resolved": "https://registry.npmjs.org/block-stream/-/block-stream-0.0.9.tgz", + "integrity": "sha1-E+v+d4oDIFz+A3UUgeu0szAMEmo=", + "dev": true, + "requires": { + "inherits": "~2.0.0" + } + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "builtin-modules": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", + "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=", + "dev": true + }, + "camelcase": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-2.1.1.tgz", + "integrity": "sha1-fB0W1nmhu+WcoCys7PsBHiAfWh8=", + "dev": true + }, + "camelcase-keys": { + "version": "2.1.0", + "resolved": "http://registry.npmjs.org/camelcase-keys/-/camelcase-keys-2.1.0.tgz", + "integrity": "sha1-MIvur/3ygRkFHvodkyITyRuPkuc=", + "dev": true, + "requires": { + "camelcase": "^2.0.0", + "map-obj": "^1.0.0" + } + }, + "caseless": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", + "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=", + "dev": true + }, + "chalk": { + "version": "1.1.3", + "resolved": "http://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "dev": true, + "requires": { + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" + } + }, + "cliui": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz", + "integrity": "sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0=", + "dev": true, + "requires": { + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1", + "wrap-ansi": "^2.0.0" + } + }, + "code-point-at": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", + "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", + "dev": true + }, + "combined-stream": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.7.tgz", + "integrity": "sha512-brWl9y6vOB1xYPZcpZde3N9zDByXTosAeMDo4p1wzo6UMOX4vumB+TP1RZ76sfE6Md68Q0NJSrE/gbezd4Ul+w==", + "dev": true, + "requires": { + "delayed-stream": "~1.0.0" + } + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true + }, + "console-control-strings": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", + "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=", + "dev": true + }, + "core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", + "dev": true + }, + "cross-spawn": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-3.0.1.tgz", + "integrity": "sha1-ElYDfsufDF9549bvE14wdwGEuYI=", + "dev": true, + "requires": { + "lru-cache": "^4.0.1", + "which": "^1.2.9" + } + }, + "currently-unhandled": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/currently-unhandled/-/currently-unhandled-0.4.1.tgz", + "integrity": "sha1-mI3zP+qxke95mmE2nddsF635V+o=", + "dev": true, + "requires": { + "array-find-index": "^1.0.1" + } + }, + "dashdash": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", + "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", + "dev": true, + "requires": { + "assert-plus": "^1.0.0" + } + }, + "decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", + "dev": true + }, + "delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", + "dev": true + }, + "delegates": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", + "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=", + "dev": true + }, + "ecc-jsbn": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", + "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", + "dev": true, + "requires": { + "jsbn": "~0.1.0", + "safer-buffer": "^2.1.0" + } + }, + "error-ex": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "dev": true, + "requires": { + "is-arrayish": "^0.2.1" + } + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true + }, + "extend": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", + "dev": true + }, + "extsprintf": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", + "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=", + "dev": true + }, + "fast-deep-equal": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", + "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=", + "dev": true + }, + "fast-json-stable-stringify": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", + "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=", + "dev": true + }, + "find-up": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", + "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", + "dev": true, + "requires": { + "path-exists": "^2.0.0", + "pinkie-promise": "^2.0.0" + } + }, + "forever-agent": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", + "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=", + "dev": true + }, + "form-data": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", + "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", + "dev": true, + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.6", + "mime-types": "^2.1.12" + } + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "gauge": { + "version": "2.7.4", + "resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz", + "integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=", + "dev": true, + "requires": { + "aproba": "^1.0.3", + "console-control-strings": "^1.0.0", + "has-unicode": "^2.0.0", + "object-assign": "^4.1.0", + "signal-exit": "^3.0.0", + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1", + "wide-align": "^1.1.0" + } + }, + "gaze": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/gaze/-/gaze-1.1.3.tgz", + "integrity": "sha512-BRdNm8hbWzFzWHERTrejLqwHDfS4GibPoq5wjTPIoJHoBtKGPg3xAFfxmM+9ztbXelxcf2hwQcaz1PtmFeue8g==", + "dev": true, + "requires": { + "globule": "^1.0.0" + } + }, + "get-caller-file": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz", + "integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==", + "dev": true + }, + "get-stdin": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-4.0.1.tgz", + "integrity": "sha1-uWjGsKBDhDJJAui/Gl3zJXmkUP4=", + "dev": true + }, + "getpass": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", + "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", + "dev": true, + "requires": { + "assert-plus": "^1.0.0" + } + }, + "glob": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", + "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "globule": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/globule/-/globule-1.2.1.tgz", + "integrity": "sha512-g7QtgWF4uYSL5/dn71WxubOrS7JVGCnFPEnoeChJmBnyR9Mw8nGoEwOgJL/RC2Te0WhbsEUCejfH8SZNJ+adYQ==", + "dev": true, + "requires": { + "glob": "~7.1.1", + "lodash": "~4.17.10", + "minimatch": "~3.0.2" + } + }, + "graceful-fs": { + "version": "4.1.15", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.15.tgz", + "integrity": "sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA==", + "dev": true + }, + "har-schema": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", + "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=", + "dev": true + }, + "har-validator": { + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.3.tgz", + "integrity": "sha512-sNvOCzEQNr/qrvJgc3UG/kD4QtlHycrzwS+6mfTrrSq97BvaYcPZZI1ZSqGSPR73Cxn4LKTD4PttRwfU7jWq5g==", + "dev": true, + "requires": { + "ajv": "^6.5.5", + "har-schema": "^2.0.0" + } + }, + "has-ansi": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", + "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "has-unicode": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", + "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=", + "dev": true + }, + "hosted-git-info": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.7.1.tgz", + "integrity": "sha512-7T/BxH19zbcCTa8XkMlbK5lTo1WtgkFi3GvdWEyNuc4Vex7/9Dqbnpsf4JMydcfj9HCg4zUWFTL3Za6lapg5/w==", + "dev": true + }, + "http-signature": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", + "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", + "dev": true, + "requires": { + "assert-plus": "^1.0.0", + "jsprim": "^1.2.2", + "sshpk": "^1.7.0" + } + }, + "in-publish": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/in-publish/-/in-publish-2.0.0.tgz", + "integrity": "sha1-4g/146KvwmkDILbcVSaCqcf631E=", + "dev": true + }, + "indent-string": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-2.1.0.tgz", + "integrity": "sha1-ji1INIdCEhtKghi3oTfppSBJ3IA=", + "dev": true, + "requires": { + "repeating": "^2.0.0" + } + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", + "dev": true + }, + "invert-kv": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz", + "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=", + "dev": true + }, + "is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", + "dev": true + }, + "is-builtin-module": { + "version": "1.0.0", + "resolved": "http://registry.npmjs.org/is-builtin-module/-/is-builtin-module-1.0.0.tgz", + "integrity": "sha1-VAVy0096wxGfj3bDDLwbHgN6/74=", + "dev": true, + "requires": { + "builtin-modules": "^1.0.0" + } + }, + "is-finite": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.0.2.tgz", + "integrity": "sha1-zGZ3aVYCvlUO8R6LSqYwU0K20Ko=", + "dev": true, + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "dev": true, + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "is-typedarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", + "dev": true + }, + "is-utf8": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz", + "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=", + "dev": true + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true + }, + "isstream": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", + "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=", + "dev": true + }, + "js-base64": { + "version": "2.4.9", + "resolved": "https://registry.npmjs.org/js-base64/-/js-base64-2.4.9.tgz", + "integrity": "sha512-xcinL3AuDJk7VSzsHgb9DvvIXayBbadtMZ4HFPx8rUszbW1MuNMlwYVC4zzCZ6e1sqZpnNS5ZFYOhXqA39T7LQ==", + "dev": true + }, + "jsbn": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", + "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", + "dev": true + }, + "json-schema": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", + "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=", + "dev": true + }, + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "json-stringify-safe": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", + "dev": true + }, + "jsprim": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", + "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", + "dev": true, + "requires": { + "assert-plus": "1.0.0", + "extsprintf": "1.3.0", + "json-schema": "0.2.3", + "verror": "1.10.0" + } + }, + "lcid": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz", + "integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=", + "dev": true, + "requires": { + "invert-kv": "^1.0.0" + } + }, + "load-json-file": { + "version": "1.1.0", + "resolved": "http://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", + "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "parse-json": "^2.2.0", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0", + "strip-bom": "^2.0.0" + } + }, + "lodash": { + "version": "4.17.15", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", + "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", + "dev": true + }, + "lodash.assign": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/lodash.assign/-/lodash.assign-4.2.0.tgz", + "integrity": "sha1-DZnzzNem0mHRm9rrkkUAXShYCOc=", + "dev": true + }, + "lodash.clonedeep": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", + "integrity": "sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8=", + "dev": true + }, + "loud-rejection": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/loud-rejection/-/loud-rejection-1.6.0.tgz", + "integrity": "sha1-W0b4AUft7leIcPCG0Eghz5mOVR8=", + "dev": true, + "requires": { + "currently-unhandled": "^0.4.1", + "signal-exit": "^3.0.0" + } + }, + "lru-cache": { + "version": "4.1.4", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.4.tgz", + "integrity": "sha512-EPstzZ23znHUVLKj+lcXO1KvZkrlw+ZirdwvOmnAnA/1PB4ggyXJ77LRkCqkff+ShQ+cqoxCxLQOh4cKITO5iA==", + "dev": true, + "requires": { + "pseudomap": "^1.0.2", + "yallist": "^3.0.2" + } + }, + "map-obj": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz", + "integrity": "sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0=", + "dev": true + }, + "meow": { + "version": "3.7.0", + "resolved": "http://registry.npmjs.org/meow/-/meow-3.7.0.tgz", + "integrity": "sha1-cstmi0JSKCkKu/qFaJJYcwioAfs=", + "dev": true, + "requires": { + "camelcase-keys": "^2.0.0", + "decamelize": "^1.1.2", + "loud-rejection": "^1.0.0", + "map-obj": "^1.0.1", + "minimist": "^1.1.3", + "normalize-package-data": "^2.3.4", + "object-assign": "^4.0.1", + "read-pkg-up": "^1.0.1", + "redent": "^1.0.0", + "trim-newlines": "^1.0.0" + } + }, + "mime-db": { + "version": "1.37.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.37.0.tgz", + "integrity": "sha512-R3C4db6bgQhlIhPU48fUtdVmKnflq+hRdad7IyKhtFj06VPNVdk2RhiYL3UjQIlso8L+YxAtFkobT0VK+S/ybg==", + "dev": true + }, + "mime-types": { + "version": "2.1.21", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.21.tgz", + "integrity": "sha512-3iL6DbwpyLzjR3xHSFNFeb9Nz/M8WDkX33t1GFQnFOllWk8pOrh/LSrB5OXlnlW5P9LH73X6loW/eogc+F5lJg==", + "dev": true, + "requires": { + "mime-db": "~1.37.0" + } + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "1.2.0", + "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "dev": true + }, + "mkdirp": { + "version": "0.5.1", + "resolved": "http://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "dev": true, + "requires": { + "minimist": "0.0.8" + }, + "dependencies": { + "minimist": { + "version": "0.0.8", + "resolved": "http://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", + "dev": true + } + } + }, + "nan": { + "version": "2.11.1", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.11.1.tgz", + "integrity": "sha512-iji6k87OSXa0CcrLl9z+ZiYSuR2o+c0bGuNmXdrhTQTakxytAFsC56SArGYoiHlJlFoHSnvmhpceZJaXkVuOtA==", + "dev": true + }, + "node-gyp": { + "version": "3.8.0", + "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-3.8.0.tgz", + "integrity": "sha512-3g8lYefrRRzvGeSowdJKAKyks8oUpLEd/DyPV4eMhVlhJ0aNaZqIrNUIPuEWWTAoPqyFkfGrM67MC69baqn6vA==", + "dev": true, + "requires": { + "fstream": "^1.0.0", + "glob": "^7.0.3", + "graceful-fs": "^4.1.2", + "mkdirp": "^0.5.0", + "nopt": "2 || 3", + "npmlog": "0 || 1 || 2 || 3 || 4", + "osenv": "0", + "request": "^2.87.0", + "rimraf": "2", + "semver": "~5.3.0", + "tar": "^2.0.0", + "which": "1" + }, + "dependencies": { + "semver": { + "version": "5.3.0", + "resolved": "http://registry.npmjs.org/semver/-/semver-5.3.0.tgz", + "integrity": "sha1-myzl094C0XxgEq0yaqa00M9U+U8=", + "dev": true + } + } + }, + "nopt": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz", + "integrity": "sha1-xkZdvwirzU2zWTF/eaxopkayj/k=", + "dev": true, + "requires": { + "abbrev": "1" + } + }, + "normalize-package-data": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.4.0.tgz", + "integrity": "sha512-9jjUFbTPfEy3R/ad/2oNbKtW9Hgovl5O1FvFWKkKblNXoN/Oou6+9+KKohPK13Yc3/TyunyWhJp6gvRNR/PPAw==", + "dev": true, + "requires": { + "hosted-git-info": "^2.1.4", + "is-builtin-module": "^1.0.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + } + }, + "npmlog": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz", + "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==", + "dev": true, + "requires": { + "are-we-there-yet": "~1.1.2", + "console-control-strings": "~1.1.0", + "gauge": "~2.7.3", + "set-blocking": "~2.0.0" + } + }, + "number-is-nan": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", + "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", + "dev": true + }, + "oauth-sign": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", + "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==", + "dev": true + }, + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "dev": true + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "requires": { + "wrappy": "1" + } + }, + "os-homedir": { + "version": "1.0.2", + "resolved": "http://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", + "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", + "dev": true + }, + "os-locale": { + "version": "1.4.0", + "resolved": "http://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz", + "integrity": "sha1-IPnxeuKe00XoveWDsT0gCYA8FNk=", + "dev": true, + "requires": { + "lcid": "^1.0.0" + } + }, + "os-tmpdir": { + "version": "1.0.2", + "resolved": "http://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", + "dev": true + }, + "osenv": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.5.tgz", + "integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==", + "dev": true, + "requires": { + "os-homedir": "^1.0.0", + "os-tmpdir": "^1.0.0" + } + }, + "parse-json": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", + "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", + "dev": true, + "requires": { + "error-ex": "^1.2.0" + } + }, + "path-exists": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", + "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", + "dev": true, + "requires": { + "pinkie-promise": "^2.0.0" + } + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "http://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true + }, + "path-type": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz", + "integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0" + } + }, + "performance-now": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", + "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=", + "dev": true + }, + "pify": { + "version": "2.3.0", + "resolved": "http://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "dev": true + }, + "pinkie": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", + "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=", + "dev": true + }, + "pinkie-promise": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", + "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", + "dev": true, + "requires": { + "pinkie": "^2.0.0" + } + }, + "process-nextick-args": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", + "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==", + "dev": true + }, + "pseudomap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", + "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=", + "dev": true + }, + "psl": { + "version": "1.1.29", + "resolved": "https://registry.npmjs.org/psl/-/psl-1.1.29.tgz", + "integrity": "sha512-AeUmQ0oLN02flVHXWh9sSJF7mcdFq0ppid/JkErufc3hGIV/AMa8Fo9VgDo/cT2jFdOWoFvHp90qqBH54W+gjQ==", + "dev": true + }, + "punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "dev": true + }, + "qs": { + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", + "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==", + "dev": true + }, + "read-pkg": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz", + "integrity": "sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=", + "dev": true, + "requires": { + "load-json-file": "^1.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^1.0.0" + } + }, + "read-pkg-up": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz", + "integrity": "sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=", + "dev": true, + "requires": { + "find-up": "^1.0.0", + "read-pkg": "^1.0.0" + } + }, + "readable-stream": { + "version": "2.3.6", + "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "redent": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/redent/-/redent-1.0.0.tgz", + "integrity": "sha1-z5Fqsf1fHxbfsggi3W7H9zDCr94=", + "dev": true, + "requires": { + "indent-string": "^2.1.0", + "strip-indent": "^1.0.1" + } + }, + "repeating": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/repeating/-/repeating-2.0.1.tgz", + "integrity": "sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo=", + "dev": true, + "requires": { + "is-finite": "^1.0.0" + } + }, + "request": { + "version": "2.88.0", + "resolved": "https://registry.npmjs.org/request/-/request-2.88.0.tgz", + "integrity": "sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==", + "dev": true, + "requires": { + "aws-sign2": "~0.7.0", + "aws4": "^1.8.0", + "caseless": "~0.12.0", + "combined-stream": "~1.0.6", + "extend": "~3.0.2", + "forever-agent": "~0.6.1", + "form-data": "~2.3.2", + "har-validator": "~5.1.0", + "http-signature": "~1.2.0", + "is-typedarray": "~1.0.0", + "isstream": "~0.1.2", + "json-stringify-safe": "~5.0.1", + "mime-types": "~2.1.19", + "oauth-sign": "~0.9.0", + "performance-now": "^2.1.0", + "qs": "~6.5.2", + "safe-buffer": "^5.1.2", + "tough-cookie": "~2.4.3", + "tunnel-agent": "^0.6.0", + "uuid": "^3.3.2" + } + }, + "require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", + "dev": true + }, + "require-main-filename": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", + "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=", + "dev": true + }, + "rimraf": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz", + "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==", + "dev": true, + "requires": { + "glob": "^7.0.5" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "dev": true + }, + "sass-graph": { + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/sass-graph/-/sass-graph-2.2.4.tgz", + "integrity": "sha1-E/vWPNHK8JCLn9k0dq1DpR0eC0k=", + "dev": true, + "requires": { + "glob": "^7.0.0", + "lodash": "^4.0.0", + "scss-tokenizer": "^0.2.3", + "yargs": "^7.0.0" + } + }, + "scss-tokenizer": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/scss-tokenizer/-/scss-tokenizer-0.2.3.tgz", + "integrity": "sha1-jrBtualyMzOCTT9VMGQRSYR85dE=", + "dev": true, + "requires": { + "js-base64": "^2.1.8", + "source-map": "^0.4.2" + } + }, + "semver": { + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.6.0.tgz", + "integrity": "sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg==", + "dev": true + }, + "set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", + "dev": true + }, + "signal-exit": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", + "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", + "dev": true + }, + "source-map": { + "version": "0.4.4", + "resolved": "http://registry.npmjs.org/source-map/-/source-map-0.4.4.tgz", + "integrity": "sha1-66T12pwNyZneaAMti092FzZSA2s=", + "dev": true, + "requires": { + "amdefine": ">=0.0.4" + } + }, + "spdx-correct": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.0.2.tgz", + "integrity": "sha512-q9hedtzyXHr5S0A1vEPoK/7l8NpfkFYTq6iCY+Pno2ZbdZR6WexZFtqeVGkGxW3TEJMN914Z55EnAGMmenlIQQ==", + "dev": true, + "requires": { + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-exceptions": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.2.0.tgz", + "integrity": "sha512-2XQACfElKi9SlVb1CYadKDXvoajPgBVPn/gOQLrTvHdElaVhr7ZEbqJaRnJLVNeaI4cMEAgVCeBMKF6MWRDCRA==", + "dev": true + }, + "spdx-expression-parse": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz", + "integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==", + "dev": true, + "requires": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-license-ids": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.2.tgz", + "integrity": "sha512-qky9CVt0lVIECkEsYbNILVnPvycuEBkXoMFLRWsREkomQLevYhtRKC+R91a5TOAQ3bCMjikRwhyaRqj1VYatYg==", + "dev": true + }, + "sshpk": { + "version": "1.15.2", + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.15.2.tgz", + "integrity": "sha512-Ra/OXQtuh0/enyl4ETZAfTaeksa6BXks5ZcjpSUNrjBr0DvrJKX+1fsKDPpT9TBXgHAFsa4510aNVgI8g/+SzA==", + "dev": true, + "requires": { + "asn1": "~0.2.3", + "assert-plus": "^1.0.0", + "bcrypt-pbkdf": "^1.0.0", + "dashdash": "^1.12.0", + "ecc-jsbn": "~0.1.1", + "getpass": "^0.1.1", + "jsbn": "~0.1.0", + "safer-buffer": "^2.0.2", + "tweetnacl": "~0.14.0" + } + }, + "stdout-stream": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/stdout-stream/-/stdout-stream-1.4.1.tgz", + "integrity": "sha512-j4emi03KXqJWcIeF8eIXkjMFN1Cmb8gUlDYGeBALLPo5qdyTfA9bOtl8m33lRoC+vFMkP3gl0WsDr6+gzxbbTA==", + "dev": true, + "requires": { + "readable-stream": "^2.0.1" + } + }, + "string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "dev": true, + "requires": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + } + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.0" + } + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "http://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "strip-bom": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", + "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", + "dev": true, + "requires": { + "is-utf8": "^0.2.0" + } + }, + "strip-indent": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-1.0.1.tgz", + "integrity": "sha1-DHlipq3vp7vUrDZkYKY4VSrhoKI=", + "dev": true, + "requires": { + "get-stdin": "^4.0.1" + } + }, + "supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", + "dev": true + }, + "tar": { + "version": "2.2.1", + "resolved": "http://registry.npmjs.org/tar/-/tar-2.2.1.tgz", + "integrity": "sha1-jk0qJWwOIYXGsYrWlK7JaLg8sdE=", + "dev": true, + "requires": { + "block-stream": "*", + "fstream": "^1.0.2", + "inherits": "2" + } + }, + "tough-cookie": { + "version": "2.4.3", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz", + "integrity": "sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==", + "dev": true, + "requires": { + "psl": "^1.1.24", + "punycode": "^1.4.1" + }, + "dependencies": { + "punycode": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", + "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", + "dev": true + } + } + }, + "trim-newlines": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-1.0.0.tgz", + "integrity": "sha1-WIeWa7WCpFA6QetST301ARgVphM=", + "dev": true + }, + "true-case-path": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/true-case-path/-/true-case-path-1.0.3.tgz", + "integrity": "sha512-m6s2OdQe5wgpFMC+pAJ+q9djG82O2jcHPOI6RNg1yy9rCYR+WD6Nbpl32fDpfC56nirdRy+opFa/Vk7HYhqaew==", + "dev": true, + "requires": { + "glob": "^7.1.2" + } + }, + "tunnel-agent": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", + "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", + "dev": true, + "requires": { + "safe-buffer": "^5.0.1" + } + }, + "tweetnacl": { + "version": "0.14.5", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", + "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", + "dev": true + }, + "uri-js": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", + "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", + "dev": true, + "requires": { + "punycode": "^2.1.0" + } + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", + "dev": true + }, + "uuid": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", + "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==", + "dev": true + }, + "validate-npm-package-license": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", + "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", + "dev": true, + "requires": { + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" + } + }, + "verror": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", + "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", + "dev": true, + "requires": { + "assert-plus": "^1.0.0", + "core-util-is": "1.0.2", + "extsprintf": "^1.2.0" + } + }, + "which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + }, + "which-module": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-1.0.0.tgz", + "integrity": "sha1-u6Y8qGGUiZT/MHc2CJ47lgJsKk8=", + "dev": true + }, + "wide-align": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz", + "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", + "dev": true, + "requires": { + "string-width": "^1.0.2 || 2" + } + }, + "wrap-ansi": { + "version": "2.1.0", + "resolved": "http://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", + "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", + "dev": true, + "requires": { + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1" + } + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true + }, + "y18n": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz", + "integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE=", + "dev": true + }, + "yallist": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.0.3.tgz", + "integrity": "sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A==", + "dev": true + }, + "yargs": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-7.1.0.tgz", + "integrity": "sha1-a6MY6xaWFyf10oT46gA+jWFU0Mg=", + "dev": true, + "requires": { + "camelcase": "^3.0.0", + "cliui": "^3.2.0", + "decamelize": "^1.1.1", + "get-caller-file": "^1.0.1", + "os-locale": "^1.4.0", + "read-pkg-up": "^1.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^1.0.1", + "set-blocking": "^2.0.0", + "string-width": "^1.0.2", + "which-module": "^1.0.0", + "y18n": "^3.2.1", + "yargs-parser": "^5.0.0" + }, + "dependencies": { + "camelcase": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-3.0.0.tgz", + "integrity": "sha1-MvxLn82vhF/N9+c7uXysImHwqwo=", + "dev": true + } + } + }, + "yargs-parser": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-5.0.0.tgz", + "integrity": "sha1-J17PDX/+Bcd+ZOfIbkzZS/DhIoo=", + "dev": true, + "requires": { + "camelcase": "^3.0.0" + }, + "dependencies": { + "camelcase": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-3.0.0.tgz", + "integrity": "sha1-MvxLn82vhF/N9+c7uXysImHwqwo=", + "dev": true + } + } + } + } + }, + "normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true + }, + "object-copy": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", + "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=", + "dev": true, + "requires": { + "copy-descriptor": "^0.1.0", + "define-property": "^0.2.5", + "kind-of": "^3.0.3" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "object-visit": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", + "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=", + "dev": true, + "requires": { + "isobject": "^3.0.0" + } + }, + "object.pick": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", + "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", + "dev": true, + "requires": { + "isobject": "^3.0.1" + } + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "requires": { + "wrappy": "1" + } + }, + "pascalcase": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", + "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=", + "dev": true + }, + "path-dirname": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/path-dirname/-/path-dirname-1.0.2.tgz", + "integrity": "sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA=", + "dev": true + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true + }, + "posix-character-classes": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz", + "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=", + "dev": true + }, + "process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", + "dev": true + }, + "purecss": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/purecss/-/purecss-1.0.0.tgz", + "integrity": "sha512-gfC78WCOWNnfkzulx9aoWwcl+0JflhwKeJ+k9s/ZyIawfYNA4bqBmt0DtfgtQK9iuYMtGfbdE8R2AQMjSWR2VQ==" + }, + "readable-stream": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "readdirp": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.2.1.tgz", + "integrity": "sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.11", + "micromatch": "^3.1.10", + "readable-stream": "^2.0.2" + } + }, + "regex-not": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", + "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", + "dev": true, + "requires": { + "extend-shallow": "^3.0.2", + "safe-regex": "^1.1.0" + } + }, + "remove-trailing-separator": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", + "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=", + "dev": true + }, + "repeat-element": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.3.tgz", + "integrity": "sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g==", + "dev": true + }, + "repeat-string": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", + "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", + "dev": true + }, + "reset-css": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/reset-css/-/reset-css-4.0.1.tgz", + "integrity": "sha512-aQFi5IxXVegVTfz0hOmXsPSmc8tlPDQOkfatHfPu3Cm6id7UXM4OzXfsaUWJEgV2yrCngsagpIb3wHXPjKAx+Q==" + }, + "resolve-url": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", + "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=", + "dev": true + }, + "ret": { + "version": "0.1.15", + "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", + "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", + "dev": true + }, + "rimraf": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "safe-regex": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", + "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", + "dev": true, + "requires": { + "ret": "~0.1.10" + } + }, + "sass-loader": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/sass-loader/-/sass-loader-7.1.0.tgz", + "integrity": "sha512-+G+BKGglmZM2GUSfT9TLuEp6tzehHPjAMoRRItOojWIqIGPloVCMhNIQuG639eJ+y033PaGTSjLaTHts8Kw79w==", + "dev": true, + "requires": { + "clone-deep": "^2.0.1", + "loader-utils": "^1.0.1", + "lodash.tail": "^4.1.1", + "neo-async": "^2.5.0", + "pify": "^3.0.0", + "semver": "^5.5.0" + }, + "dependencies": { + "big.js": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/big.js/-/big.js-3.2.0.tgz", + "integrity": "sha512-+hN/Zh2D08Mx65pZ/4g5bsmNiZUuChDiQfTUQ7qJr4/kuopCr88xZsAXv6mBoZEsUI4OuGHlX59qE94K2mMW8Q==", + "dev": true + }, + "clone-deep": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/clone-deep/-/clone-deep-2.0.2.tgz", + "integrity": "sha512-SZegPTKjCgpQH63E+eN6mVEEPdQBOUzjyJm5Pora4lrwWRFS8I0QAxV/KD6vV/i0WuijHZWQC1fMsPEdxfdVCQ==", + "dev": true, + "requires": { + "for-own": "^1.0.0", + "is-plain-object": "^2.0.4", + "kind-of": "^6.0.0", + "shallow-clone": "^1.0.0" + } + }, + "emojis-list": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-2.1.0.tgz", + "integrity": "sha1-TapNnbAPmBmIDHn6RXrlsJof04k=", + "dev": true + }, + "for-in": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", + "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", + "dev": true + }, + "for-own": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/for-own/-/for-own-1.0.0.tgz", + "integrity": "sha1-xjMy9BXO3EsE2/5wz4NklMU8tEs=", + "dev": true, + "requires": { + "for-in": "^1.0.1" + } + }, + "is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", + "dev": true + }, + "is-plain-object": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "dev": true, + "requires": { + "isobject": "^3.0.1" + } + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + }, + "json5": { + "version": "0.5.1", + "resolved": "http://registry.npmjs.org/json5/-/json5-0.5.1.tgz", + "integrity": "sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE=", + "dev": true + }, + "kind-of": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "dev": true + }, + "loader-utils": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.1.0.tgz", + "integrity": "sha1-yYrvSIvM7aL/teLeZG1qdUQp9c0=", + "dev": true, + "requires": { + "big.js": "^3.1.3", + "emojis-list": "^2.0.0", + "json5": "^0.5.0" + } + }, + "lodash.tail": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/lodash.tail/-/lodash.tail-4.1.1.tgz", + "integrity": "sha1-0jM6NtnncXyK0vfKyv7HwytERmQ=", + "dev": true + }, + "mixin-object": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/mixin-object/-/mixin-object-2.0.1.tgz", + "integrity": "sha1-T7lJRB2rGCVA8f4DW6YOGUel5X4=", + "dev": true, + "requires": { + "for-in": "^0.1.3", + "is-extendable": "^0.1.1" + }, + "dependencies": { + "for-in": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/for-in/-/for-in-0.1.8.tgz", + "integrity": "sha1-2Hc5COMSVhCZUrH9ubP6hn0ndeE=", + "dev": true + } + } + }, + "neo-async": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.0.tgz", + "integrity": "sha512-MFh0d/Wa7vkKO3Y3LlacqAEeHK0mckVqzDieUKTT+KGxi+zIpeVsFxymkIiRpbpDziHc290Xr9A1O4Om7otoRA==", + "dev": true + }, + "pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", + "dev": true + }, + "semver": { + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.6.0.tgz", + "integrity": "sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg==", + "dev": true + }, + "shallow-clone": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shallow-clone/-/shallow-clone-1.0.0.tgz", + "integrity": "sha512-oeXreoKR/SyNJtRJMAKPDSvd28OqEwG4eR/xc856cRGBII7gX9lvAqDxusPm0846z/w/hWYjI1NpKwJ00NHzRA==", + "dev": true, + "requires": { + "is-extendable": "^0.1.1", + "kind-of": "^5.0.0", + "mixin-object": "^2.0.1" + }, + "dependencies": { + "kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "dev": true + } + } + } + } + }, + "selectize": { + "version": "0.12.6", + "resolved": "https://registry.npmjs.org/selectize/-/selectize-0.12.6.tgz", + "integrity": "sha512-bWO5A7G+I8+QXyjLfQUgh31VI4WKYagUZQxAXlDyUmDDNrFxrASV0W9hxCOl0XJ/XQ1dZEu3G9HjXV4Wj0yb6w==", + "requires": { + "microplugin": "0.0.3", + "sifter": "^0.5.1" + }, + "dependencies": { + "ansicolors": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/ansicolors/-/ansicolors-0.2.1.tgz", + "integrity": "sha1-vgiVmQl7dKXJxKhKDNvNtivYeu8=" + }, + "async": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/async/-/async-2.6.1.tgz", + "integrity": "sha512-fNEiL2+AZt6AlAw/29Cr0UDe4sRAHCpEHh54WMz+Bb7QfNcFw4h3loofyJpLeQs4Yx7yuqu/2dLgM5hKOs6HlQ==", + "requires": { + "lodash": "^4.17.10" + } + }, + "cardinal": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/cardinal/-/cardinal-1.0.0.tgz", + "integrity": "sha1-UOIcGwqjdyn5N33vGWtanOyTLuk=", + "requires": { + "ansicolors": "~0.2.1", + "redeyed": "~1.0.0" + } + }, + "csv-parse": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/csv-parse/-/csv-parse-2.5.0.tgz", + "integrity": "sha512-4OcjOJQByI0YDU5COYw9HAqjo8/MOLLmT9EKyMCXUzgvh30vS1SlMK+Ho84IH5exN44cSnrYecw/7Zpu2m4lkA==" + }, + "esprima": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-3.0.0.tgz", + "integrity": "sha1-U88kes2ncxPlUcOqLnM0LT+099k=" + }, + "humanize": { + "version": "0.0.9", + "resolved": "https://registry.npmjs.org/humanize/-/humanize-0.0.9.tgz", + "integrity": "sha1-GZT/rs3+nEQe0r2sdFK3u0yeQaQ=" + }, + "lodash": { + "version": "4.17.11", + "resolved": "" + }, + "microplugin": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/microplugin/-/microplugin-0.0.3.tgz", + "integrity": "sha1-H8Lhu3yeGegr2Eu6kTe75xJQ2M0=" + }, + "minimist": { + "version": "0.0.10", + "resolved": "http://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz", + "integrity": "sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8=" + }, + "optimist": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz", + "integrity": "sha1-2j6nRob6IaGaERwybpDrFaAZZoY=", + "requires": { + "minimist": "~0.0.1", + "wordwrap": "~0.0.2" + } + }, + "redeyed": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/redeyed/-/redeyed-1.0.1.tgz", + "integrity": "sha1-6WwZO0DAgWsArshCaY5hGF5VSYo=", + "requires": { + "esprima": "~3.0.0" + } + }, + "sifter": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/sifter/-/sifter-0.5.3.tgz", + "integrity": "sha1-XmUH/owRSyso2Qtr9OW2NuYR5Is=", + "requires": { + "async": "^2.6.0", + "cardinal": "^1.0.0", + "csv-parse": "^2.0.0", + "humanize": "^0.0.9", + "optimist": "^0.6.1" + } + }, + "wordwrap": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz", + "integrity": "sha1-o9XabNXAvAAI03I0u68b7WMFkQc=" + } + } + }, + "set-value": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz", + "integrity": "sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw==", + "dev": true, + "requires": { + "extend-shallow": "^2.0.1", + "is-extendable": "^0.1.1", + "is-plain-object": "^2.0.3", + "split-string": "^3.0.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "snapdragon": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", + "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==", + "dev": true, + "requires": { + "base": "^0.11.1", + "debug": "^2.2.0", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "map-cache": "^0.2.2", + "source-map": "^0.5.6", + "source-map-resolve": "^0.5.0", + "use": "^3.1.0" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "snapdragon-node": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz", + "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==", + "dev": true, + "requires": { + "define-property": "^1.0.0", + "isobject": "^3.0.0", + "snapdragon-util": "^3.0.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "requires": { + "is-descriptor": "^1.0.0" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + } + } + }, + "snapdragon-util": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz", + "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==", + "dev": true, + "requires": { + "kind-of": "^3.2.0" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true + }, + "source-map-resolve": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.2.tgz", + "integrity": "sha512-MjqsvNwyz1s0k81Goz/9vRBe9SZdB09Bdw+/zYyO+3CuPk6fouTaxscHkgtE8jKvf01kVfl8riHzERQ/kefaSA==", + "dev": true, + "requires": { + "atob": "^2.1.1", + "decode-uri-component": "^0.2.0", + "resolve-url": "^0.2.1", + "source-map-url": "^0.4.0", + "urix": "^0.1.0" + } + }, + "source-map-url": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.0.tgz", + "integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM=", + "dev": true + }, + "split-string": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", + "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", + "dev": true, + "requires": { + "extend-shallow": "^3.0.0" + } + }, + "static-extend": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", + "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=", + "dev": true, + "requires": { + "define-property": "^0.2.5", + "object-copy": "^0.1.0" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + } + } + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.0" + } + }, + "style-loader": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/style-loader/-/style-loader-0.23.1.tgz", + "integrity": "sha512-XK+uv9kWwhZMZ1y7mysB+zoihsEj4wneFWAS5qoiLwzW0WzSqMrrsIy+a3zkQJq0ipFtBpX5W3MqyRIBF/WFGg==", + "dev": true, + "requires": { + "loader-utils": "^1.1.0", + "schema-utils": "^1.0.0" + }, + "dependencies": { + "ajv": { + "version": "6.5.5", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.5.5.tgz", + "integrity": "sha512-7q7gtRQDJSyuEHjuVgHoUa2VuemFiCMrfQc9Tc08XTAc4Zj/5U1buQJ0HU6i7fKjXU09SVgSmxa4sLvuvS8Iyg==", + "dev": true, + "requires": { + "fast-deep-equal": "^2.0.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, + "ajv-errors": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/ajv-errors/-/ajv-errors-1.0.0.tgz", + "integrity": "sha1-7PAh+hCP0X37Xms4Py3SM+Mf/Fk=", + "dev": true + }, + "ajv-keywords": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.2.0.tgz", + "integrity": "sha1-6GuBnGAs+IIa1jdBNpjx3sAhhHo=", + "dev": true + }, + "big.js": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/big.js/-/big.js-3.2.0.tgz", + "integrity": "sha512-+hN/Zh2D08Mx65pZ/4g5bsmNiZUuChDiQfTUQ7qJr4/kuopCr88xZsAXv6mBoZEsUI4OuGHlX59qE94K2mMW8Q==", + "dev": true + }, + "emojis-list": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-2.1.0.tgz", + "integrity": "sha1-TapNnbAPmBmIDHn6RXrlsJof04k=", + "dev": true + }, + "fast-deep-equal": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", + "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=", + "dev": true + }, + "fast-json-stable-stringify": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", + "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=", + "dev": true + }, + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "json5": { + "version": "0.5.1", + "resolved": "http://registry.npmjs.org/json5/-/json5-0.5.1.tgz", + "integrity": "sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE=", + "dev": true + }, + "loader-utils": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.1.0.tgz", + "integrity": "sha1-yYrvSIvM7aL/teLeZG1qdUQp9c0=", + "dev": true, + "requires": { + "big.js": "^3.1.3", + "emojis-list": "^2.0.0", + "json5": "^0.5.0" + } + }, + "punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "dev": true + }, + "schema-utils": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-1.0.0.tgz", + "integrity": "sha512-i27Mic4KovM/lnGsy8whRCHhc7VicJajAjTrYg11K9zfZXnYIt4k5F+kZkwjnrhKzLic/HLU4j11mjsz2G/75g==", + "dev": true, + "requires": { + "ajv": "^6.1.0", + "ajv-errors": "^1.0.0", + "ajv-keywords": "^3.1.0" + } + }, + "uri-js": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", + "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", + "dev": true, + "requires": { + "punycode": "^2.1.0" + } + } + } + }, + "to-object-path": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz", + "integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "to-regex": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz", + "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==", + "dev": true, + "requires": { + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "regex-not": "^1.0.2", + "safe-regex": "^1.1.0" + } + }, + "to-regex-range": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", + "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", + "dev": true, + "requires": { + "is-number": "^3.0.0", + "repeat-string": "^1.6.1" + } + }, + "union-value": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz", + "integrity": "sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg==", + "dev": true, + "requires": { + "arr-union": "^3.1.0", + "get-value": "^2.0.6", + "is-extendable": "^0.1.1", + "set-value": "^2.0.1" + } + }, + "unset-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", + "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=", + "dev": true, + "requires": { + "has-value": "^0.3.1", + "isobject": "^3.0.0" + }, + "dependencies": { + "has-value": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz", + "integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=", + "dev": true, + "requires": { + "get-value": "^2.0.3", + "has-values": "^0.1.4", + "isobject": "^2.0.0" + }, + "dependencies": { + "isobject": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", + "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", + "dev": true, + "requires": { + "isarray": "1.0.0" + } + } + } + }, + "has-values": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz", + "integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E=", + "dev": true + } + } + }, + "upath": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/upath/-/upath-1.1.2.tgz", + "integrity": "sha512-kXpym8nmDmlCBr7nKdIx8P2jNBa+pBpIUFRnKJ4dr8htyYGJFokkr2ZvERRtUN+9SY+JqXouNgUPtv6JQva/2Q==", + "dev": true + }, + "urix": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", + "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=", + "dev": true + }, + "use": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", + "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==", + "dev": true + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", + "dev": true + }, + "webpack": { + "version": "4.26.1", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-4.26.1.tgz", + "integrity": "sha512-i2oOvEvuvLLSuSCkdVrknaxAhtUZ9g+nLSoHCWV0gDzqGX2DXaCrMmMUpbRsTSSLrUqAI56PoEiyMUZIZ1msug==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.7.11", + "@webassemblyjs/helper-module-context": "1.7.11", + "@webassemblyjs/wasm-edit": "1.7.11", + "@webassemblyjs/wasm-parser": "1.7.11", + "acorn": "^5.6.2", + "acorn-dynamic-import": "^3.0.0", + "ajv": "^6.1.0", + "ajv-keywords": "^3.1.0", + "chrome-trace-event": "^1.0.0", + "enhanced-resolve": "^4.1.0", + "eslint-scope": "^4.0.0", + "json-parse-better-errors": "^1.0.2", + "loader-runner": "^2.3.0", + "loader-utils": "^1.1.0", + "memory-fs": "~0.4.1", + "micromatch": "^3.1.8", + "mkdirp": "~0.5.0", + "neo-async": "^2.5.0", + "node-libs-browser": "^2.0.0", + "schema-utils": "^0.4.4", + "tapable": "^1.1.0", + "terser-webpack-plugin": "^1.1.0", + "watchpack": "^1.5.0", + "webpack-sources": "^1.3.0" + }, + "dependencies": { + "@webassemblyjs/ast": { + "version": "1.7.11", + "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.7.11.tgz", + "integrity": "sha512-ZEzy4vjvTzScC+SH8RBssQUawpaInUdMTYwYYLh54/s8TuT0gBLuyUnppKsVyZEi876VmmStKsUs28UxPgdvrA==", + "dev": true, + "requires": { + "@webassemblyjs/helper-module-context": "1.7.11", + "@webassemblyjs/helper-wasm-bytecode": "1.7.11", + "@webassemblyjs/wast-parser": "1.7.11" + } + }, + "@webassemblyjs/floating-point-hex-parser": { + "version": "1.7.11", + "resolved": "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.7.11.tgz", + "integrity": "sha512-zY8dSNyYcgzNRNT666/zOoAyImshm3ycKdoLsyDw/Bwo6+/uktb7p4xyApuef1dwEBo/U/SYQzbGBvV+nru2Xg==", + "dev": true + }, + "@webassemblyjs/helper-api-error": { + "version": "1.7.11", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.7.11.tgz", + "integrity": "sha512-7r1qXLmiglC+wPNkGuXCvkmalyEstKVwcueZRP2GNC2PAvxbLYwLLPr14rcdJaE4UtHxQKfFkuDFuv91ipqvXg==", + "dev": true + }, + "@webassemblyjs/helper-buffer": { + "version": "1.7.11", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.7.11.tgz", + "integrity": "sha512-MynuervdylPPh3ix+mKZloTcL06P8tenNH3sx6s0qE8SLR6DdwnfgA7Hc9NSYeob2jrW5Vql6GVlsQzKQCa13w==", + "dev": true + }, + "@webassemblyjs/helper-code-frame": { + "version": "1.7.11", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-code-frame/-/helper-code-frame-1.7.11.tgz", + "integrity": "sha512-T8ESC9KMXFTXA5urJcyor5cn6qWeZ4/zLPyWeEXZ03hj/x9weSokGNkVCdnhSabKGYWxElSdgJ+sFa9G/RdHNw==", + "dev": true, + "requires": { + "@webassemblyjs/wast-printer": "1.7.11" + } + }, + "@webassemblyjs/helper-fsm": { + "version": "1.7.11", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-fsm/-/helper-fsm-1.7.11.tgz", + "integrity": "sha512-nsAQWNP1+8Z6tkzdYlXT0kxfa2Z1tRTARd8wYnc/e3Zv3VydVVnaeePgqUzFrpkGUyhUUxOl5ML7f1NuT+gC0A==", + "dev": true + }, + "@webassemblyjs/helper-module-context": { + "version": "1.7.11", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-module-context/-/helper-module-context-1.7.11.tgz", + "integrity": "sha512-JxfD5DX8Ygq4PvXDucq0M+sbUFA7BJAv/GGl9ITovqE+idGX+J3QSzJYz+LwQmL7fC3Rs+utvWoJxDb6pmC0qg==", + "dev": true + }, + "@webassemblyjs/helper-wasm-bytecode": { + "version": "1.7.11", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.7.11.tgz", + "integrity": "sha512-cMXeVS9rhoXsI9LLL4tJxBgVD/KMOKXuFqYb5oCJ/opScWpkCMEz9EJtkonaNcnLv2R3K5jIeS4TRj/drde1JQ==", + "dev": true + }, + "@webassemblyjs/helper-wasm-section": { + "version": "1.7.11", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.7.11.tgz", + "integrity": "sha512-8ZRY5iZbZdtNFE5UFunB8mmBEAbSI3guwbrsCl4fWdfRiAcvqQpeqd5KHhSWLL5wuxo53zcaGZDBU64qgn4I4Q==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.7.11", + "@webassemblyjs/helper-buffer": "1.7.11", + "@webassemblyjs/helper-wasm-bytecode": "1.7.11", + "@webassemblyjs/wasm-gen": "1.7.11" + } + }, + "@webassemblyjs/ieee754": { + "version": "1.7.11", + "resolved": "https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.7.11.tgz", + "integrity": "sha512-Mmqx/cS68K1tSrvRLtaV/Lp3NZWzXtOHUW2IvDvl2sihAwJh4ACE0eL6A8FvMyDG9abes3saB6dMimLOs+HMoQ==", + "dev": true, + "requires": { + "@xtuc/ieee754": "^1.2.0" + } + }, + "@webassemblyjs/leb128": { + "version": "1.7.11", + "resolved": "https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.7.11.tgz", + "integrity": "sha512-vuGmgZjjp3zjcerQg+JA+tGOncOnJLWVkt8Aze5eWQLwTQGNgVLcyOTqgSCxWTR4J42ijHbBxnuRaL1Rv7XMdw==", + "dev": true, + "requires": { + "@xtuc/long": "4.2.1" + } + }, + "@webassemblyjs/utf8": { + "version": "1.7.11", + "resolved": "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.7.11.tgz", + "integrity": "sha512-C6GFkc7aErQIAH+BMrIdVSmW+6HSe20wg57HEC1uqJP8E/xpMjXqQUxkQw07MhNDSDcGpxI9G5JSNOQCqJk4sA==", + "dev": true + }, + "@webassemblyjs/wasm-edit": { + "version": "1.7.11", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.7.11.tgz", + "integrity": "sha512-FUd97guNGsCZQgeTPKdgxJhBXkUbMTY6hFPf2Y4OedXd48H97J+sOY2Ltaq6WGVpIH8o/TGOVNiVz/SbpEMJGg==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.7.11", + "@webassemblyjs/helper-buffer": "1.7.11", + "@webassemblyjs/helper-wasm-bytecode": "1.7.11", + "@webassemblyjs/helper-wasm-section": "1.7.11", + "@webassemblyjs/wasm-gen": "1.7.11", + "@webassemblyjs/wasm-opt": "1.7.11", + "@webassemblyjs/wasm-parser": "1.7.11", + "@webassemblyjs/wast-printer": "1.7.11" + } + }, + "@webassemblyjs/wasm-gen": { + "version": "1.7.11", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.7.11.tgz", + "integrity": "sha512-U/KDYp7fgAZX5KPfq4NOupK/BmhDc5Kjy2GIqstMhvvdJRcER/kUsMThpWeRP8BMn4LXaKhSTggIJPOeYHwISA==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.7.11", + "@webassemblyjs/helper-wasm-bytecode": "1.7.11", + "@webassemblyjs/ieee754": "1.7.11", + "@webassemblyjs/leb128": "1.7.11", + "@webassemblyjs/utf8": "1.7.11" + } + }, + "@webassemblyjs/wasm-opt": { + "version": "1.7.11", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.7.11.tgz", + "integrity": "sha512-XynkOwQyiRidh0GLua7SkeHvAPXQV/RxsUeERILmAInZegApOUAIJfRuPYe2F7RcjOC9tW3Cb9juPvAC/sCqvg==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.7.11", + "@webassemblyjs/helper-buffer": "1.7.11", + "@webassemblyjs/wasm-gen": "1.7.11", + "@webassemblyjs/wasm-parser": "1.7.11" + } + }, + "@webassemblyjs/wasm-parser": { + "version": "1.7.11", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.7.11.tgz", + "integrity": "sha512-6lmXRTrrZjYD8Ng8xRyvyXQJYUQKYSXhJqXOBLw24rdiXsHAOlvw5PhesjdcaMadU/pyPQOJ5dHreMjBxwnQKg==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.7.11", + "@webassemblyjs/helper-api-error": "1.7.11", + "@webassemblyjs/helper-wasm-bytecode": "1.7.11", + "@webassemblyjs/ieee754": "1.7.11", + "@webassemblyjs/leb128": "1.7.11", + "@webassemblyjs/utf8": "1.7.11" + } + }, + "@webassemblyjs/wast-parser": { + "version": "1.7.11", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-parser/-/wast-parser-1.7.11.tgz", + "integrity": "sha512-lEyVCg2np15tS+dm7+JJTNhNWq9yTZvi3qEhAIIOaofcYlUp0UR5/tVqOwa/gXYr3gjwSZqw+/lS9dscyLelbQ==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.7.11", + "@webassemblyjs/floating-point-hex-parser": "1.7.11", + "@webassemblyjs/helper-api-error": "1.7.11", + "@webassemblyjs/helper-code-frame": "1.7.11", + "@webassemblyjs/helper-fsm": "1.7.11", + "@xtuc/long": "4.2.1" + } + }, + "@webassemblyjs/wast-printer": { + "version": "1.7.11", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.7.11.tgz", + "integrity": "sha512-m5vkAsuJ32QpkdkDOUPGSltrg8Cuk3KBx4YrmAGQwCZPRdUHXxG4phIOuuycLemHFr74sWL9Wthqss4fzdzSwg==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.7.11", + "@webassemblyjs/wast-parser": "1.7.11", + "@xtuc/long": "4.2.1" + } + }, + "@xtuc/ieee754": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@xtuc/ieee754/-/ieee754-1.2.0.tgz", + "integrity": "sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA==", + "dev": true + }, + "@xtuc/long": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/@xtuc/long/-/long-4.2.1.tgz", + "integrity": "sha512-FZdkNBDqBRHKQ2MEbSC17xnPFOhZxeJ2YGSfr2BKf3sujG49Qe3bB+rGCwQfIaA7WHnGeGkSijX4FuBCdrzW/g==", + "dev": true + }, + "acorn": { + "version": "5.7.3", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.3.tgz", + "integrity": "sha512-T/zvzYRfbVojPWahDsE5evJdHb3oJoQfFbsrKM7w5Zcs++Tr257tia3BmMP8XYVjp1S9RZXQMh7gao96BlqZOw==", + "dev": true + }, + "acorn-dynamic-import": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/acorn-dynamic-import/-/acorn-dynamic-import-3.0.0.tgz", + "integrity": "sha512-zVWV8Z8lislJoOKKqdNMOB+s6+XV5WERty8MnKBeFgwA+19XJjJHs2RP5dzM57FftIs+jQnRToLiWazKr6sSWg==", + "dev": true, + "requires": { + "acorn": "^5.0.0" + } + }, + "ajv": { + "version": "6.5.5", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.5.5.tgz", + "integrity": "sha512-7q7gtRQDJSyuEHjuVgHoUa2VuemFiCMrfQc9Tc08XTAc4Zj/5U1buQJ0HU6i7fKjXU09SVgSmxa4sLvuvS8Iyg==", + "dev": true, + "requires": { + "fast-deep-equal": "^2.0.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, + "ajv-errors": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/ajv-errors/-/ajv-errors-1.0.0.tgz", + "integrity": "sha1-7PAh+hCP0X37Xms4Py3SM+Mf/Fk=", + "dev": true + }, + "ajv-keywords": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.2.0.tgz", + "integrity": "sha1-6GuBnGAs+IIa1jdBNpjx3sAhhHo=", + "dev": true + }, + "aproba": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", + "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", + "dev": true + }, + "arr-diff": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", + "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", + "dev": true + }, + "arr-flatten": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", + "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==", + "dev": true + }, + "arr-union": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", + "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=", + "dev": true + }, + "array-unique": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", + "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", + "dev": true + }, + "asn1.js": { + "version": "4.10.1", + "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-4.10.1.tgz", + "integrity": "sha512-p32cOF5q0Zqs9uBiONKYLm6BClCoBCM5O9JfeUSlnQLBTxYdTK+pW+nXflm8UkKd2UYlEbYz5qEi0JuZR9ckSw==", + "dev": true, + "requires": { + "bn.js": "^4.0.0", + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0" + } + }, + "assert": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/assert/-/assert-1.4.1.tgz", + "integrity": "sha1-mZEtWRg2tab1s0XA8H7vwI/GXZE=", + "dev": true, + "requires": { + "util": "0.10.3" + }, + "dependencies": { + "inherits": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz", + "integrity": "sha1-sX0I0ya0Qj5Wjv9xn5GwscvfafE=", + "dev": true + }, + "util": { + "version": "0.10.3", + "resolved": "http://registry.npmjs.org/util/-/util-0.10.3.tgz", + "integrity": "sha1-evsa/lCAUkZInj23/g7TeTNqwPk=", + "dev": true, + "requires": { + "inherits": "2.0.1" + } + } + } + }, + "assign-symbols": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", + "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=", + "dev": true + }, + "atob": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz", + "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==", + "dev": true + }, + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true + }, + "base": { + "version": "0.11.2", + "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", + "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", + "dev": true, + "requires": { + "cache-base": "^1.0.1", + "class-utils": "^0.3.5", + "component-emitter": "^1.2.1", + "define-property": "^1.0.0", + "isobject": "^3.0.1", + "mixin-deep": "^1.2.0", + "pascalcase": "^0.1.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "requires": { + "is-descriptor": "^1.0.0" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + } + } + }, + "base64-js": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.3.0.tgz", + "integrity": "sha512-ccav/yGvoa80BQDljCxsmmQ3Xvx60/UpBIij5QN21W3wBi/hhIC9OoO+KLpu9IJTS9j4DRVJ3aDDF9cMSoa2lw==", + "dev": true + }, + "big.js": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/big.js/-/big.js-3.2.0.tgz", + "integrity": "sha512-+hN/Zh2D08Mx65pZ/4g5bsmNiZUuChDiQfTUQ7qJr4/kuopCr88xZsAXv6mBoZEsUI4OuGHlX59qE94K2mMW8Q==", + "dev": true + }, + "bluebird": { + "version": "3.5.3", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.3.tgz", + "integrity": "sha512-/qKPUQlaW1OyR51WeCPBvRnAlnZFUJkCSG5HzGnuIqhgyJtF+T94lFnn33eiazjRm2LAHVy2guNnaq48X9SJuw==", + "dev": true + }, + "bn.js": { + "version": "4.11.8", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", + "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==", + "dev": true + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "braces": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", + "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", + "dev": true, + "requires": { + "arr-flatten": "^1.1.0", + "array-unique": "^0.3.2", + "extend-shallow": "^2.0.1", + "fill-range": "^4.0.0", + "isobject": "^3.0.1", + "repeat-element": "^1.1.2", + "snapdragon": "^0.8.1", + "snapdragon-node": "^2.0.1", + "split-string": "^3.0.2", + "to-regex": "^3.0.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "brorand": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", + "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=", + "dev": true + }, + "browserify-aes": { + "version": "1.2.0", + "resolved": "http://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", + "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", + "dev": true, + "requires": { + "buffer-xor": "^1.0.3", + "cipher-base": "^1.0.0", + "create-hash": "^1.1.0", + "evp_bytestokey": "^1.0.3", + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "browserify-cipher": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/browserify-cipher/-/browserify-cipher-1.0.1.tgz", + "integrity": "sha512-sPhkz0ARKbf4rRQt2hTpAHqn47X3llLkUGn+xEJzLjwY8LRs2p0v7ljvI5EyoRO/mexrNunNECisZs+gw2zz1w==", + "dev": true, + "requires": { + "browserify-aes": "^1.0.4", + "browserify-des": "^1.0.0", + "evp_bytestokey": "^1.0.0" + } + }, + "browserify-des": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/browserify-des/-/browserify-des-1.0.2.tgz", + "integrity": "sha512-BioO1xf3hFwz4kc6iBhI3ieDFompMhrMlnDFC4/0/vd5MokpuAc3R+LYbwTA9A5Yc9pq9UYPqffKpW2ObuwX5A==", + "dev": true, + "requires": { + "cipher-base": "^1.0.1", + "des.js": "^1.0.0", + "inherits": "^2.0.1", + "safe-buffer": "^5.1.2" + } + }, + "browserify-rsa": { + "version": "4.0.1", + "resolved": "http://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.0.1.tgz", + "integrity": "sha1-IeCr+vbyApzy+vsTNWenAdQTVSQ=", + "dev": true, + "requires": { + "bn.js": "^4.1.0", + "randombytes": "^2.0.1" + } + }, + "browserify-sign": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.0.4.tgz", + "integrity": "sha1-qk62jl17ZYuqa/alfmMMvXqT0pg=", + "dev": true, + "requires": { + "bn.js": "^4.1.1", + "browserify-rsa": "^4.0.0", + "create-hash": "^1.1.0", + "create-hmac": "^1.1.2", + "elliptic": "^6.0.0", + "inherits": "^2.0.1", + "parse-asn1": "^5.0.0" + } + }, + "browserify-zlib": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.2.0.tgz", + "integrity": "sha512-Z942RysHXmJrhqk88FmKBVq/v5tqmSkDz7p54G/MGyjMnCFFnC79XWNbg+Vta8W6Wb2qtSZTSxIGkJrRpCFEiA==", + "dev": true, + "requires": { + "pako": "~1.0.5" + } + }, + "buffer": { + "version": "4.9.1", + "resolved": "http://registry.npmjs.org/buffer/-/buffer-4.9.1.tgz", + "integrity": "sha1-bRu2AbB6TvztlwlBMgkwJ8lbwpg=", + "dev": true, + "requires": { + "base64-js": "^1.0.2", + "ieee754": "^1.1.4", + "isarray": "^1.0.0" + } + }, + "buffer-from": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", + "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", + "dev": true + }, + "buffer-xor": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", + "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=", + "dev": true + }, + "builtin-status-codes": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz", + "integrity": "sha1-hZgoeOIbmOHGZCXgPQF0eI9Wnug=", + "dev": true + }, + "cacache": { + "version": "11.3.1", + "resolved": "https://registry.npmjs.org/cacache/-/cacache-11.3.1.tgz", + "integrity": "sha512-2PEw4cRRDu+iQvBTTuttQifacYjLPhET+SYO/gEFMy8uhi+jlJREDAjSF5FWSdV/Aw5h18caHA7vMTw2c+wDzA==", + "dev": true, + "requires": { + "bluebird": "^3.5.1", + "chownr": "^1.0.1", + "figgy-pudding": "^3.1.0", + "glob": "^7.1.2", + "graceful-fs": "^4.1.11", + "lru-cache": "^4.1.3", + "mississippi": "^3.0.0", + "mkdirp": "^0.5.1", + "move-concurrently": "^1.0.1", + "promise-inflight": "^1.0.1", + "rimraf": "^2.6.2", + "ssri": "^6.0.0", + "unique-filename": "^1.1.0", + "y18n": "^4.0.0" + } + }, + "cache-base": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", + "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", + "dev": true, + "requires": { + "collection-visit": "^1.0.0", + "component-emitter": "^1.2.1", + "get-value": "^2.0.6", + "has-value": "^1.0.0", + "isobject": "^3.0.1", + "set-value": "^2.0.0", + "to-object-path": "^0.3.0", + "union-value": "^1.0.0", + "unset-value": "^1.0.0" + } + }, + "chownr": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.1.tgz", + "integrity": "sha512-j38EvO5+LHX84jlo6h4UzmOwi0UgW61WRyPtJz4qaadK5eY3BTS5TY/S1Stc3Uk2lIM6TPevAlULiEJwie860g==", + "dev": true + }, + "chrome-trace-event": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.0.tgz", + "integrity": "sha512-xDbVgyfDTT2piup/h8dK/y4QZfJRSa73bw1WZ8b4XM1o7fsFubUVGYcE+1ANtOzJJELGpYoG2961z0Z6OAld9A==", + "dev": true, + "requires": { + "tslib": "^1.9.0" + } + }, + "cipher-base": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", + "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "class-utils": { + "version": "0.3.6", + "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", + "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==", + "dev": true, + "requires": { + "arr-union": "^3.1.0", + "define-property": "^0.2.5", + "isobject": "^3.0.0", + "static-extend": "^0.1.1" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + } + } + }, + "collection-visit": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", + "integrity": "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=", + "dev": true, + "requires": { + "map-visit": "^1.0.0", + "object-visit": "^1.0.0" + } + }, + "commander": { + "version": "2.17.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.17.1.tgz", + "integrity": "sha512-wPMUt6FnH2yzG95SA6mzjQOEKUU3aLaDEmzs1ti+1E9h+CsrZghRlqEM/EJ4KscsQVG8uNN4uVreUeT8+drlgg==", + "dev": true + }, + "commondir": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", + "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=", + "dev": true + }, + "component-emitter": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz", + "integrity": "sha1-E3kY1teCg/ffemt8WmPhQOaUJeY=", + "dev": true + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true + }, + "concat-stream": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", + "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", + "dev": true, + "requires": { + "buffer-from": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^2.2.2", + "typedarray": "^0.0.6" + } + }, + "console-browserify": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/console-browserify/-/console-browserify-1.1.0.tgz", + "integrity": "sha1-8CQcRXMKn8YyOyBtvzjtx0HQuxA=", + "dev": true, + "requires": { + "date-now": "^0.1.4" + } + }, + "constants-browserify": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/constants-browserify/-/constants-browserify-1.0.0.tgz", + "integrity": "sha1-wguW2MYXdIqvHBYCF2DNJ/y4y3U=", + "dev": true + }, + "copy-concurrently": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/copy-concurrently/-/copy-concurrently-1.0.5.tgz", + "integrity": "sha512-f2domd9fsVDFtaFcbaRZuYXwtdmnzqbADSwhSWYxYB/Q8zsdUUFMXVRwXGDMWmbEzAn1kdRrtI1T/KTFOL4X2A==", + "dev": true, + "requires": { + "aproba": "^1.1.1", + "fs-write-stream-atomic": "^1.0.8", + "iferr": "^0.1.5", + "mkdirp": "^0.5.1", + "rimraf": "^2.5.4", + "run-queue": "^1.0.0" + } + }, + "copy-descriptor": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", + "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=", + "dev": true + }, + "core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", + "dev": true + }, + "create-ecdh": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.3.tgz", + "integrity": "sha512-GbEHQPMOswGpKXM9kCWVrremUcBmjteUaQ01T9rkKCPDXfUHX0IoP9LpHYo2NPFampa4e+/pFDc3jQdxrxQLaw==", + "dev": true, + "requires": { + "bn.js": "^4.1.0", + "elliptic": "^6.0.0" + } + }, + "create-hash": { + "version": "1.2.0", + "resolved": "http://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", + "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", + "dev": true, + "requires": { + "cipher-base": "^1.0.1", + "inherits": "^2.0.1", + "md5.js": "^1.3.4", + "ripemd160": "^2.0.1", + "sha.js": "^2.4.0" + } + }, + "create-hmac": { + "version": "1.1.7", + "resolved": "http://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", + "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", + "dev": true, + "requires": { + "cipher-base": "^1.0.3", + "create-hash": "^1.1.0", + "inherits": "^2.0.1", + "ripemd160": "^2.0.0", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" + } + }, + "crypto-browserify": { + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.12.0.tgz", + "integrity": "sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg==", + "dev": true, + "requires": { + "browserify-cipher": "^1.0.0", + "browserify-sign": "^4.0.0", + "create-ecdh": "^4.0.0", + "create-hash": "^1.1.0", + "create-hmac": "^1.1.0", + "diffie-hellman": "^5.0.0", + "inherits": "^2.0.1", + "pbkdf2": "^3.0.3", + "public-encrypt": "^4.0.0", + "randombytes": "^2.0.0", + "randomfill": "^1.0.3" + } + }, + "cyclist": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/cyclist/-/cyclist-0.2.2.tgz", + "integrity": "sha1-GzN5LhHpFKL9bW7WRHRkRE5fpkA=", + "dev": true + }, + "date-now": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/date-now/-/date-now-0.1.4.tgz", + "integrity": "sha1-6vQ5/U1ISK105cx9vvIAZyueNFs=", + "dev": true + }, + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "decode-uri-component": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", + "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=", + "dev": true + }, + "define-property": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", + "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", + "dev": true, + "requires": { + "is-descriptor": "^1.0.2", + "isobject": "^3.0.1" + }, + "dependencies": { + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + } + } + }, + "des.js": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.0.0.tgz", + "integrity": "sha1-wHTS4qpqipoH29YfmhXCzYPsjsw=", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0" + } + }, + "diffie-hellman": { + "version": "5.0.3", + "resolved": "http://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz", + "integrity": "sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg==", + "dev": true, + "requires": { + "bn.js": "^4.1.0", + "miller-rabin": "^4.0.0", + "randombytes": "^2.0.0" + } + }, + "domain-browser": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/domain-browser/-/domain-browser-1.2.0.tgz", + "integrity": "sha512-jnjyiM6eRyZl2H+W8Q/zLMA481hzi0eszAaBUzIVnmYVDBbnLxVNnfu1HgEBvCbL+71FrxMl3E6lpKH7Ge3OXA==", + "dev": true + }, + "duplexify": { + "version": "3.6.1", + "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.6.1.tgz", + "integrity": "sha512-vM58DwdnKmty+FSPzT14K9JXb90H+j5emaR4KYbr2KTIz00WHGbWOe5ghQTx233ZCLZtrGDALzKwcjEtSt35mA==", + "dev": true, + "requires": { + "end-of-stream": "^1.0.0", + "inherits": "^2.0.1", + "readable-stream": "^2.0.0", + "stream-shift": "^1.0.0" + } + }, + "elliptic": { + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.4.1.tgz", + "integrity": "sha512-BsXLz5sqX8OHcsh7CqBMztyXARmGQ3LWPtGjJi6DiJHq5C/qvi9P3OqgswKSDftbu8+IoI/QDTAm2fFnQ9SZSQ==", + "dev": true, + "requires": { + "bn.js": "^4.4.0", + "brorand": "^1.0.1", + "hash.js": "^1.0.0", + "hmac-drbg": "^1.0.0", + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.0" + } + }, + "emojis-list": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-2.1.0.tgz", + "integrity": "sha1-TapNnbAPmBmIDHn6RXrlsJof04k=", + "dev": true + }, + "end-of-stream": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz", + "integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==", + "dev": true, + "requires": { + "once": "^1.4.0" + } + }, + "enhanced-resolve": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-4.1.0.tgz", + "integrity": "sha512-F/7vkyTtyc/llOIn8oWclcB25KdRaiPBpZYDgJHgh/UHtpgT2p2eldQgtQnLtUvfMKPKxbRaQM/hHkvLHt1Vng==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "memory-fs": "^0.4.0", + "tapable": "^1.0.0" + } + }, + "errno": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/errno/-/errno-0.1.7.tgz", + "integrity": "sha512-MfrRBDWzIWifgq6tJj60gkAwtLNb6sQPlcFrSOflcP1aFmmruKQ2wRnze/8V6kgyz7H3FF8Npzv78mZ7XLLflg==", + "dev": true, + "requires": { + "prr": "~1.0.1" + } + }, + "eslint-scope": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.0.tgz", + "integrity": "sha512-1G6UTDi7Jc1ELFwnR58HV4fK9OQK4S6N985f166xqXxpjU6plxFISJa2Ba9KCQuFa8RCnj/lSFJbHo7UFDBnUA==", + "dev": true, + "requires": { + "esrecurse": "^4.1.0", + "estraverse": "^4.1.1" + } + }, + "esrecurse": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.2.1.tgz", + "integrity": "sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ==", + "dev": true, + "requires": { + "estraverse": "^4.1.0" + } + }, + "estraverse": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz", + "integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=", + "dev": true + }, + "events": { + "version": "1.1.1", + "resolved": "http://registry.npmjs.org/events/-/events-1.1.1.tgz", + "integrity": "sha1-nr23Y1rQmccNzEwqH1AEKI6L2SQ=", + "dev": true + }, + "evp_bytestokey": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", + "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", + "dev": true, + "requires": { + "md5.js": "^1.3.4", + "safe-buffer": "^5.1.1" + } + }, + "expand-brackets": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", + "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", + "dev": true, + "requires": { + "debug": "^2.3.3", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "posix-character-classes": "^0.1.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "extend-shallow": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", + "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", + "dev": true, + "requires": { + "assign-symbols": "^1.0.0", + "is-extendable": "^1.0.1" + }, + "dependencies": { + "is-extendable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "dev": true, + "requires": { + "is-plain-object": "^2.0.4" + } + } + } + }, + "extglob": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", + "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", + "dev": true, + "requires": { + "array-unique": "^0.3.2", + "define-property": "^1.0.0", + "expand-brackets": "^2.1.4", + "extend-shallow": "^2.0.1", + "fragment-cache": "^0.2.1", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "requires": { + "is-descriptor": "^1.0.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + } + } + }, + "fast-deep-equal": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", + "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=", + "dev": true + }, + "fast-json-stable-stringify": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", + "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=", + "dev": true + }, + "figgy-pudding": { + "version": "3.5.1", + "resolved": "https://registry.npmjs.org/figgy-pudding/-/figgy-pudding-3.5.1.tgz", + "integrity": "sha512-vNKxJHTEKNThjfrdJwHc7brvM6eVevuO5nTj6ez8ZQ1qbXTvGthucRF7S4vf2cr71QVnT70V34v0S1DyQsti0w==", + "dev": true + }, + "fill-range": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", + "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", + "dev": true, + "requires": { + "extend-shallow": "^2.0.1", + "is-number": "^3.0.0", + "repeat-string": "^1.6.1", + "to-regex-range": "^2.1.0" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "find-cache-dir": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-2.0.0.tgz", + "integrity": "sha512-LDUY6V1Xs5eFskUVYtIwatojt6+9xC9Chnlk/jYOOvn3FAFfSaWddxahDGyNHh0b2dMXa6YW2m0tk8TdVaXHlA==", + "dev": true, + "requires": { + "commondir": "^1.0.1", + "make-dir": "^1.0.0", + "pkg-dir": "^3.0.0" + } + }, + "find-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "dev": true, + "requires": { + "locate-path": "^3.0.0" + } + }, + "flush-write-stream": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/flush-write-stream/-/flush-write-stream-1.0.3.tgz", + "integrity": "sha512-calZMC10u0FMUqoiunI2AiGIIUtUIvifNwkHhNupZH4cbNnW1Itkoh/Nf5HFYmDrwWPjrUxpkZT0KhuCq0jmGw==", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "readable-stream": "^2.0.4" + } + }, + "for-in": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", + "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", + "dev": true + }, + "fragment-cache": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", + "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", + "dev": true, + "requires": { + "map-cache": "^0.2.2" + } + }, + "from2": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/from2/-/from2-2.3.0.tgz", + "integrity": "sha1-i/tVAr3kpNNs/e6gB/zKIdfjgq8=", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "readable-stream": "^2.0.0" + } + }, + "fs-write-stream-atomic": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/fs-write-stream-atomic/-/fs-write-stream-atomic-1.0.10.tgz", + "integrity": "sha1-tH31NJPvkR33VzHnCp3tAYnbQMk=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "iferr": "^0.1.5", + "imurmurhash": "^0.1.4", + "readable-stream": "1 || 2" + } + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "get-value": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", + "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=", + "dev": true + }, + "glob": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", + "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "graceful-fs": { + "version": "4.1.15", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.15.tgz", + "integrity": "sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA==", + "dev": true + }, + "has-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", + "integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=", + "dev": true, + "requires": { + "get-value": "^2.0.6", + "has-values": "^1.0.0", + "isobject": "^3.0.0" + } + }, + "has-values": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz", + "integrity": "sha1-lbC2P+whRmGab+V/51Yo1aOe/k8=", + "dev": true, + "requires": { + "is-number": "^3.0.0", + "kind-of": "^4.0.0" + }, + "dependencies": { + "kind-of": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", + "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "hash-base": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.0.4.tgz", + "integrity": "sha1-X8hoaEfs1zSZQDMZprCj8/auSRg=", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "hash.js": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.5.tgz", + "integrity": "sha512-eWI5HG9Np+eHV1KQhisXWwM+4EPPYe5dFX1UZZH7k/E3JzDEazVH+VGlZi6R94ZqImq+A3D1mCEtrFIfg/E7sA==", + "dev": true, + "requires": { + "inherits": "^2.0.3", + "minimalistic-assert": "^1.0.1" + } + }, + "hmac-drbg": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", + "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=", + "dev": true, + "requires": { + "hash.js": "^1.0.3", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.1" + } + }, + "https-browserify": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/https-browserify/-/https-browserify-1.0.0.tgz", + "integrity": "sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM=", + "dev": true + }, + "ieee754": { + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.12.tgz", + "integrity": "sha512-GguP+DRY+pJ3soyIiGPTvdiVXjZ+DbXOxGpXn3eMvNW4x4irjqXm4wHKscC+TfxSJ0yw/S1F24tqdMNsMZTiLA==", + "dev": true + }, + "iferr": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/iferr/-/iferr-0.1.5.tgz", + "integrity": "sha1-xg7taebY/bazEEofy8ocGS3FtQE=", + "dev": true + }, + "imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "dev": true + }, + "indexof": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/indexof/-/indexof-0.0.1.tgz", + "integrity": "sha1-gtwzbSMrkGIXnQWrMpOmYFn9Q10=", + "dev": true + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", + "dev": true + }, + "is-accessor-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true + }, + "is-data-descriptor": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^0.1.6", + "is-data-descriptor": "^0.1.4", + "kind-of": "^5.0.0" + }, + "dependencies": { + "kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "dev": true + } + } + }, + "is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", + "dev": true + }, + "is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-plain-object": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "dev": true, + "requires": { + "isobject": "^3.0.1" + } + }, + "is-windows": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", + "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", + "dev": true + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + }, + "json-parse-better-errors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", + "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", + "dev": true + }, + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "json5": { + "version": "0.5.1", + "resolved": "http://registry.npmjs.org/json5/-/json5-0.5.1.tgz", + "integrity": "sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE=", + "dev": true + }, + "kind-of": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "dev": true + }, + "loader-runner": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-2.3.1.tgz", + "integrity": "sha512-By6ZFY7ETWOc9RFaAIb23IjJVcM4dvJC/N57nmdz9RSkMXvAXGI7SyVlAw3v8vjtDRlqThgVDVmTnr9fqMlxkw==", + "dev": true + }, + "loader-utils": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.1.0.tgz", + "integrity": "sha1-yYrvSIvM7aL/teLeZG1qdUQp9c0=", + "dev": true, + "requires": { + "big.js": "^3.1.3", + "emojis-list": "^2.0.0", + "json5": "^0.5.0" + } + }, + "locate-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "dev": true, + "requires": { + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" + } + }, + "lru-cache": { + "version": "4.1.4", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.4.tgz", + "integrity": "sha512-EPstzZ23znHUVLKj+lcXO1KvZkrlw+ZirdwvOmnAnA/1PB4ggyXJ77LRkCqkff+ShQ+cqoxCxLQOh4cKITO5iA==", + "dev": true, + "requires": { + "pseudomap": "^1.0.2", + "yallist": "^3.0.2" + } + }, + "make-dir": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.3.0.tgz", + "integrity": "sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ==", + "dev": true, + "requires": { + "pify": "^3.0.0" + } + }, + "map-cache": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", + "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=", + "dev": true + }, + "map-visit": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", + "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=", + "dev": true, + "requires": { + "object-visit": "^1.0.0" + } + }, + "md5.js": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", + "integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==", + "dev": true, + "requires": { + "hash-base": "^3.0.0", + "inherits": "^2.0.1", + "safe-buffer": "^5.1.2" + } + }, + "memory-fs": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/memory-fs/-/memory-fs-0.4.1.tgz", + "integrity": "sha1-OpoguEYlI+RHz7x+i7gO1me/xVI=", + "dev": true, + "requires": { + "errno": "^0.1.3", + "readable-stream": "^2.0.1" + } + }, + "micromatch": { + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", + "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "dev": true, + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "braces": "^2.3.1", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "extglob": "^2.0.4", + "fragment-cache": "^0.2.1", + "kind-of": "^6.0.2", + "nanomatch": "^1.2.9", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.2" + } + }, + "miller-rabin": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz", + "integrity": "sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==", + "dev": true, + "requires": { + "bn.js": "^4.0.0", + "brorand": "^1.0.1" + } + }, + "minimalistic-assert": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", + "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==", + "dev": true + }, + "minimalistic-crypto-utils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", + "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=", + "dev": true + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "0.0.8", + "resolved": "http://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", + "dev": true + }, + "mississippi": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/mississippi/-/mississippi-3.0.0.tgz", + "integrity": "sha512-x471SsVjUtBRtcvd4BzKE9kFC+/2TeWgKCgw0bZcw1b9l2X3QX5vCWgF+KaZaYm87Ss//rHnWryupDrgLvmSkA==", + "dev": true, + "requires": { + "concat-stream": "^1.5.0", + "duplexify": "^3.4.2", + "end-of-stream": "^1.1.0", + "flush-write-stream": "^1.0.0", + "from2": "^2.1.0", + "parallel-transform": "^1.1.0", + "pump": "^3.0.0", + "pumpify": "^1.3.3", + "stream-each": "^1.1.0", + "through2": "^2.0.0" + } + }, + "mixin-deep": { + "version": "1.3.1", + "resolved": "", + "dev": true, + "requires": { + "for-in": "^1.0.2", + "is-extendable": "^1.0.1" + }, + "dependencies": { + "is-extendable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "dev": true, + "requires": { + "is-plain-object": "^2.0.4" + } + } + } + }, + "mkdirp": { + "version": "0.5.1", + "resolved": "http://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "dev": true, + "requires": { + "minimist": "0.0.8" + } + }, + "move-concurrently": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/move-concurrently/-/move-concurrently-1.0.1.tgz", + "integrity": "sha1-viwAX9oy4LKa8fBdfEszIUxwH5I=", + "dev": true, + "requires": { + "aproba": "^1.1.1", + "copy-concurrently": "^1.0.0", + "fs-write-stream-atomic": "^1.0.8", + "mkdirp": "^0.5.1", + "rimraf": "^2.5.4", + "run-queue": "^1.0.3" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, + "nanomatch": { + "version": "1.2.13", + "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", + "integrity": "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==", + "dev": true, + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "fragment-cache": "^0.2.1", + "is-windows": "^1.0.2", + "kind-of": "^6.0.2", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + } + }, + "neo-async": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.0.tgz", + "integrity": "sha512-MFh0d/Wa7vkKO3Y3LlacqAEeHK0mckVqzDieUKTT+KGxi+zIpeVsFxymkIiRpbpDziHc290Xr9A1O4Om7otoRA==", + "dev": true + }, + "node-libs-browser": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/node-libs-browser/-/node-libs-browser-2.1.0.tgz", + "integrity": "sha512-5AzFzdoIMb89hBGMZglEegffzgRg+ZFoUmisQ8HI4j1KDdpx13J0taNp2y9xPbur6W61gepGDDotGBVQ7mfUCg==", + "dev": true, + "requires": { + "assert": "^1.1.1", + "browserify-zlib": "^0.2.0", + "buffer": "^4.3.0", + "console-browserify": "^1.1.0", + "constants-browserify": "^1.0.0", + "crypto-browserify": "^3.11.0", + "domain-browser": "^1.1.1", + "events": "^1.0.0", + "https-browserify": "^1.0.0", + "os-browserify": "^0.3.0", + "path-browserify": "0.0.0", + "process": "^0.11.10", + "punycode": "^1.2.4", + "querystring-es3": "^0.2.0", + "readable-stream": "^2.3.3", + "stream-browserify": "^2.0.1", + "stream-http": "^2.7.2", + "string_decoder": "^1.0.0", + "timers-browserify": "^2.0.4", + "tty-browserify": "0.0.0", + "url": "^0.11.0", + "util": "^0.10.3", + "vm-browserify": "0.0.4" + }, + "dependencies": { + "punycode": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", + "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", + "dev": true + } + } + }, + "object-copy": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", + "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=", + "dev": true, + "requires": { + "copy-descriptor": "^0.1.0", + "define-property": "^0.2.5", + "kind-of": "^3.0.3" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "object-visit": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", + "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=", + "dev": true, + "requires": { + "isobject": "^3.0.0" + } + }, + "object.pick": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", + "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", + "dev": true, + "requires": { + "isobject": "^3.0.1" + } + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "requires": { + "wrappy": "1" + } + }, + "os-browserify": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.3.0.tgz", + "integrity": "sha1-hUNzx/XCMVkU/Jv8a9gjj92h7Cc=", + "dev": true + }, + "p-limit": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.0.0.tgz", + "integrity": "sha512-fl5s52lI5ahKCernzzIyAP0QAZbGIovtVHGwpcu1Jr/EpzLVDI2myISHwGqK7m8uQFugVWSrbxH7XnhGtvEc+A==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", + "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "dev": true, + "requires": { + "p-limit": "^2.0.0" + } + }, + "p-try": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.0.0.tgz", + "integrity": "sha512-hMp0onDKIajHfIkdRk3P4CdCmErkYAxxDtP3Wx/4nZ3aGlau2VKh3mZpcuFkH27WQkL/3WBCPOktzA9ZOAnMQQ==", + "dev": true + }, + "pako": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.6.tgz", + "integrity": "sha512-lQe48YPsMJAig+yngZ87Lus+NF+3mtu7DVOBu6b/gHO1YpKwIj5AWjZ/TOS7i46HD/UixzWb1zeWDZfGZ3iYcg==", + "dev": true + }, + "parallel-transform": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/parallel-transform/-/parallel-transform-1.1.0.tgz", + "integrity": "sha1-1BDwZbBdojCB/NEPKIVMKb2jOwY=", + "dev": true, + "requires": { + "cyclist": "~0.2.2", + "inherits": "^2.0.3", + "readable-stream": "^2.1.5" + } + }, + "parse-asn1": { + "version": "5.1.1", + "resolved": "http://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.1.tgz", + "integrity": "sha512-KPx7flKXg775zZpnp9SxJlz00gTd4BmJ2yJufSc44gMCRrRQ7NSzAcSJQfifuOLgW6bEi+ftrALtsgALeB2Adw==", + "dev": true, + "requires": { + "asn1.js": "^4.0.0", + "browserify-aes": "^1.0.0", + "create-hash": "^1.1.0", + "evp_bytestokey": "^1.0.0", + "pbkdf2": "^3.0.3" + } + }, + "pascalcase": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", + "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=", + "dev": true + }, + "path-browserify": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-0.0.0.tgz", + "integrity": "sha1-oLhwcpquIUAFt9UDLsLLuw+0RRo=", + "dev": true + }, + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "dev": true + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "http://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true + }, + "pbkdf2": { + "version": "3.0.17", + "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.0.17.tgz", + "integrity": "sha512-U/il5MsrZp7mGg3mSQfn742na2T+1/vHDCG5/iTI3X9MKUuYUZVLQhyRsg06mCgDBTd57TxzgZt7P+fYfjRLtA==", + "dev": true, + "requires": { + "create-hash": "^1.1.2", + "create-hmac": "^1.1.4", + "ripemd160": "^2.0.1", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" + } + }, + "pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", + "dev": true + }, + "pkg-dir": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-3.0.0.tgz", + "integrity": "sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw==", + "dev": true, + "requires": { + "find-up": "^3.0.0" + } + }, + "posix-character-classes": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz", + "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=", + "dev": true + }, + "process": { + "version": "0.11.10", + "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", + "integrity": "sha1-czIwDoQBYb2j5podHZGn1LwW8YI=", + "dev": true + }, + "process-nextick-args": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", + "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==", + "dev": true + }, + "promise-inflight": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/promise-inflight/-/promise-inflight-1.0.1.tgz", + "integrity": "sha1-mEcocL8igTL8vdhoEputEsPAKeM=", + "dev": true + }, + "prr": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz", + "integrity": "sha1-0/wRS6BplaRexok/SEzrHXj19HY=", + "dev": true + }, + "pseudomap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", + "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=", + "dev": true + }, + "public-encrypt": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/public-encrypt/-/public-encrypt-4.0.3.tgz", + "integrity": "sha512-zVpa8oKZSz5bTMTFClc1fQOnyyEzpl5ozpi1B5YcvBrdohMjH2rfsBtyXcuNuwjsDIXmBYlF2N5FlJYhR29t8Q==", + "dev": true, + "requires": { + "bn.js": "^4.1.0", + "browserify-rsa": "^4.0.0", + "create-hash": "^1.1.0", + "parse-asn1": "^5.0.0", + "randombytes": "^2.0.1", + "safe-buffer": "^5.1.2" + } + }, + "pump": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", + "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "dev": true, + "requires": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "pumpify": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/pumpify/-/pumpify-1.5.1.tgz", + "integrity": "sha512-oClZI37HvuUJJxSKKrC17bZ9Cu0ZYhEAGPsPUy9KlMUmv9dKX2o77RUmq7f3XjIxbwyGwYzbzQ1L2Ks8sIradQ==", + "dev": true, + "requires": { + "duplexify": "^3.6.0", + "inherits": "^2.0.3", + "pump": "^2.0.0" + }, + "dependencies": { + "pump": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pump/-/pump-2.0.1.tgz", + "integrity": "sha512-ruPMNRkN3MHP1cWJc9OWr+T/xDP0jhXYCLfJcBuX54hhfIBnaQmAUMfDcG4DM5UMWByBbJY69QSphm3jtDKIkA==", + "dev": true, + "requires": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + } + } + }, + "punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "dev": true + }, + "querystring": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz", + "integrity": "sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA=", + "dev": true + }, + "querystring-es3": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/querystring-es3/-/querystring-es3-0.2.1.tgz", + "integrity": "sha1-nsYfeQSYdXB9aUFFlv2Qek1xHnM=", + "dev": true + }, + "randombytes": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.0.6.tgz", + "integrity": "sha512-CIQ5OFxf4Jou6uOKe9t1AOgqpeU5fd70A8NPdHSGeYXqXsPe6peOwI0cUl88RWZ6sP1vPMV3avd/R6cZ5/sP1A==", + "dev": true, + "requires": { + "safe-buffer": "^5.1.0" + } + }, + "randomfill": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/randomfill/-/randomfill-1.0.4.tgz", + "integrity": "sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw==", + "dev": true, + "requires": { + "randombytes": "^2.0.5", + "safe-buffer": "^5.1.0" + } + }, + "readable-stream": { + "version": "2.3.6", + "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "regex-not": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", + "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", + "dev": true, + "requires": { + "extend-shallow": "^3.0.2", + "safe-regex": "^1.1.0" + } + }, + "repeat-element": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.3.tgz", + "integrity": "sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g==", + "dev": true + }, + "repeat-string": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", + "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", + "dev": true + }, + "resolve-url": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", + "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=", + "dev": true + }, + "ret": { + "version": "0.1.15", + "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", + "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", + "dev": true + }, + "rimraf": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz", + "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==", + "dev": true, + "requires": { + "glob": "^7.0.5" + } + }, + "ripemd160": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", + "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", + "dev": true, + "requires": { + "hash-base": "^3.0.0", + "inherits": "^2.0.1" + } + }, + "run-queue": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/run-queue/-/run-queue-1.0.3.tgz", + "integrity": "sha1-6Eg5bwV9Ij8kOGkkYY4laUFh7Ec=", + "dev": true, + "requires": { + "aproba": "^1.1.1" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "safe-regex": { + "version": "1.1.0", + "resolved": "http://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", + "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", + "dev": true, + "requires": { + "ret": "~0.1.10" + } + }, + "schema-utils": { + "version": "0.4.7", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-0.4.7.tgz", + "integrity": "sha512-v/iwU6wvwGK8HbU9yi3/nhGzP0yGSuhQMzL6ySiec1FSrZZDkhm4noOSWzrNFo/jEc+SJY6jRTwuwbSXJPDUnQ==", + "dev": true, + "requires": { + "ajv": "^6.1.0", + "ajv-keywords": "^3.1.0" + } + }, + "serialize-javascript": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-1.5.0.tgz", + "integrity": "sha512-Ga8c8NjAAp46Br4+0oZ2WxJCwIzwP60Gq1YPgU+39PiTVxyed/iKE/zyZI6+UlVYH5Q4PaQdHhcegIFPZTUfoQ==", + "dev": true + }, + "set-value": { + "version": "2.0.0", + "resolved": "", + "dev": true, + "requires": { + "extend-shallow": "^2.0.1", + "is-extendable": "^0.1.1", + "is-plain-object": "^2.0.3", + "split-string": "^3.0.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "setimmediate": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", + "integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=", + "dev": true + }, + "sha.js": { + "version": "2.4.11", + "resolved": "http://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", + "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "snapdragon": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", + "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==", + "dev": true, + "requires": { + "base": "^0.11.1", + "debug": "^2.2.0", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "map-cache": "^0.2.2", + "source-map": "^0.5.6", + "source-map-resolve": "^0.5.0", + "use": "^3.1.0" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "snapdragon-node": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz", + "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==", + "dev": true, + "requires": { + "define-property": "^1.0.0", + "isobject": "^3.0.0", + "snapdragon-util": "^3.0.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "requires": { + "is-descriptor": "^1.0.0" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + } + } + }, + "snapdragon-util": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz", + "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==", + "dev": true, + "requires": { + "kind-of": "^3.2.0" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "source-list-map": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/source-list-map/-/source-list-map-2.0.1.tgz", + "integrity": "sha512-qnQ7gVMxGNxsiL4lEuJwe/To8UnK7fAnmbGEEH8RpLouuKbeEm0lhbQVFIrNSuB+G7tVrAlVsZgETT5nljf+Iw==", + "dev": true + }, + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true + }, + "source-map-resolve": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.2.tgz", + "integrity": "sha512-MjqsvNwyz1s0k81Goz/9vRBe9SZdB09Bdw+/zYyO+3CuPk6fouTaxscHkgtE8jKvf01kVfl8riHzERQ/kefaSA==", + "dev": true, + "requires": { + "atob": "^2.1.1", + "decode-uri-component": "^0.2.0", + "resolve-url": "^0.2.1", + "source-map-url": "^0.4.0", + "urix": "^0.1.0" + } + }, + "source-map-support": { + "version": "0.5.9", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.9.tgz", + "integrity": "sha512-gR6Rw4MvUlYy83vP0vxoVNzM6t8MUXqNuRsuBmBHQDu1Fh6X015FrLdgoDKcNdkwGubozq0P4N0Q37UyFVr1EA==", + "dev": true, + "requires": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "source-map-url": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.0.tgz", + "integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM=", + "dev": true + }, + "split-string": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", + "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", + "dev": true, + "requires": { + "extend-shallow": "^3.0.0" + } + }, + "ssri": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/ssri/-/ssri-6.0.1.tgz", + "integrity": "sha512-3Wge10hNcT1Kur4PDFwEieXSCMCJs/7WvSACcrMYrNp+b8kDL1/0wJch5Ni2WrtwEa2IO8OsVfeKIciKCDx/QA==", + "dev": true, + "requires": { + "figgy-pudding": "^3.5.1" + } + }, + "static-extend": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", + "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=", + "dev": true, + "requires": { + "define-property": "^0.2.5", + "object-copy": "^0.1.0" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + } + } + }, + "stream-browserify": { + "version": "2.0.1", + "resolved": "http://registry.npmjs.org/stream-browserify/-/stream-browserify-2.0.1.tgz", + "integrity": "sha1-ZiZu5fm9uZQKTkUUyvtDu3Hlyds=", + "dev": true, + "requires": { + "inherits": "~2.0.1", + "readable-stream": "^2.0.2" + } + }, + "stream-each": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/stream-each/-/stream-each-1.2.3.tgz", + "integrity": "sha512-vlMC2f8I2u/bZGqkdfLQW/13Zihpej/7PmSiMQsbYddxuTsJp8vRe2x2FvVExZg7FaOds43ROAuFJwPR4MTZLw==", + "dev": true, + "requires": { + "end-of-stream": "^1.1.0", + "stream-shift": "^1.0.0" + } + }, + "stream-http": { + "version": "2.8.3", + "resolved": "https://registry.npmjs.org/stream-http/-/stream-http-2.8.3.tgz", + "integrity": "sha512-+TSkfINHDo4J+ZobQLWiMouQYB+UVYFttRA94FpEzzJ7ZdqcL4uUUQ7WkdkI4DSozGmgBUE/a47L+38PenXhUw==", + "dev": true, + "requires": { + "builtin-status-codes": "^3.0.0", + "inherits": "^2.0.1", + "readable-stream": "^2.3.6", + "to-arraybuffer": "^1.0.0", + "xtend": "^4.0.0" + } + }, + "stream-shift": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.0.tgz", + "integrity": "sha1-1cdSgl5TZ+eG944Y5EXqIjoVWVI=", + "dev": true + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "http://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.0" + } + }, + "tapable": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/tapable/-/tapable-1.1.1.tgz", + "integrity": "sha512-9I2ydhj8Z9veORCw5PRm4u9uebCn0mcCa6scWoNcbZ6dAtoo2618u9UUzxgmsCOreJpqDDuv61LvwofW7hLcBA==", + "dev": true + }, + "terser": { + "version": "3.10.12", + "resolved": "https://registry.npmjs.org/terser/-/terser-3.10.12.tgz", + "integrity": "sha512-3ODPC1eVt25EVNb04s/PkHxOmzKBQUF6bwwuR6h2DbEF8/j265Y1UkwNtOk9am/pRxfJ5HPapOlUlO6c16mKQQ==", + "dev": true, + "requires": { + "commander": "~2.17.1", + "source-map": "~0.6.1", + "source-map-support": "~0.5.6" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "terser-webpack-plugin": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-1.1.0.tgz", + "integrity": "sha512-61lV0DSxMAZ8AyZG7/A4a3UPlrbOBo8NIQ4tJzLPAdGOQ+yoNC7l5ijEow27lBAL2humer01KLS6bGIMYQxKoA==", + "dev": true, + "requires": { + "cacache": "^11.0.2", + "find-cache-dir": "^2.0.0", + "schema-utils": "^1.0.0", + "serialize-javascript": "^1.4.0", + "source-map": "^0.6.1", + "terser": "^3.8.1", + "webpack-sources": "^1.1.0", + "worker-farm": "^1.5.2" + }, + "dependencies": { + "schema-utils": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-1.0.0.tgz", + "integrity": "sha512-i27Mic4KovM/lnGsy8whRCHhc7VicJajAjTrYg11K9zfZXnYIt4k5F+kZkwjnrhKzLic/HLU4j11mjsz2G/75g==", + "dev": true, + "requires": { + "ajv": "^6.1.0", + "ajv-errors": "^1.0.0", + "ajv-keywords": "^3.1.0" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "through2": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", + "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", + "dev": true, + "requires": { + "readable-stream": "~2.3.6", + "xtend": "~4.0.1" + } + }, + "timers-browserify": { + "version": "2.0.10", + "resolved": "https://registry.npmjs.org/timers-browserify/-/timers-browserify-2.0.10.tgz", + "integrity": "sha512-YvC1SV1XdOUaL6gx5CoGroT3Gu49pK9+TZ38ErPldOWW4j49GI1HKs9DV+KGq/w6y+LZ72W1c8cKz2vzY+qpzg==", + "dev": true, + "requires": { + "setimmediate": "^1.0.4" + } + }, + "to-arraybuffer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz", + "integrity": "sha1-fSKbH8xjfkZsoIEYCDanqr/4P0M=", + "dev": true + }, + "to-object-path": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz", + "integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "to-regex": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz", + "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==", + "dev": true, + "requires": { + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "regex-not": "^1.0.2", + "safe-regex": "^1.1.0" + } + }, + "to-regex-range": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", + "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", + "dev": true, + "requires": { + "is-number": "^3.0.0", + "repeat-string": "^1.6.1" + } + }, + "tslib": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.9.3.tgz", + "integrity": "sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ==", + "dev": true + }, + "tty-browserify": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.0.tgz", + "integrity": "sha1-oVe6QC2iTpv5V/mqadUk7tQpAaY=", + "dev": true + }, + "typedarray": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", + "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", + "dev": true + }, + "union-value": { + "version": "1.0.0", + "resolved": "", + "dev": true, + "requires": { + "arr-union": "^3.1.0", + "get-value": "^2.0.6", + "is-extendable": "^0.1.1", + "set-value": "^0.4.3" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + }, + "set-value": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/set-value/-/set-value-0.4.3.tgz", + "integrity": "sha1-fbCPnT0i3H945Trzw79GZuzfzPE=", + "dev": true, + "requires": { + "extend-shallow": "^2.0.1", + "is-extendable": "^0.1.1", + "is-plain-object": "^2.0.1", + "to-object-path": "^0.3.0" + } + } + } + }, + "unique-filename": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-1.1.1.tgz", + "integrity": "sha512-Vmp0jIp2ln35UTXuryvjzkjGdRyf9b2lTXuSYUiPmzRcl3FDtYqAwOnTJkAngD9SWhnoJzDbTKwaOrZ+STtxNQ==", + "dev": true, + "requires": { + "unique-slug": "^2.0.0" + } + }, + "unique-slug": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/unique-slug/-/unique-slug-2.0.1.tgz", + "integrity": "sha512-n9cU6+gITaVu7VGj1Z8feKMmfAjEAQGhwD9fE3zvpRRa0wEIx8ODYkVGfSc94M2OX00tUFV8wH3zYbm1I8mxFg==", + "dev": true, + "requires": { + "imurmurhash": "^0.1.4" + } + }, + "unset-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", + "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=", + "dev": true, + "requires": { + "has-value": "^0.3.1", + "isobject": "^3.0.0" + }, + "dependencies": { + "has-value": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz", + "integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=", + "dev": true, + "requires": { + "get-value": "^2.0.3", + "has-values": "^0.1.4", + "isobject": "^2.0.0" + }, + "dependencies": { + "isobject": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", + "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", + "dev": true, + "requires": { + "isarray": "1.0.0" + } + } + } + }, + "has-values": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz", + "integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E=", + "dev": true + } + } + }, + "uri-js": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", + "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", + "dev": true, + "requires": { + "punycode": "^2.1.0" + } + }, + "urix": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", + "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=", + "dev": true + }, + "url": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/url/-/url-0.11.0.tgz", + "integrity": "sha1-ODjpfPxgUh63PFJajlW/3Z4uKPE=", + "dev": true, + "requires": { + "punycode": "1.3.2", + "querystring": "0.2.0" + }, + "dependencies": { + "punycode": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz", + "integrity": "sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0=", + "dev": true + } + } + }, + "use": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", + "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==", + "dev": true + }, + "util": { + "version": "0.10.4", + "resolved": "https://registry.npmjs.org/util/-/util-0.10.4.tgz", + "integrity": "sha512-0Pm9hTQ3se5ll1XihRic3FDIku70C+iHUdT/W926rSgHV5QgXsYbKZN8MSC3tJtSkhuROzvsQjAaFENRXr+19A==", + "dev": true, + "requires": { + "inherits": "2.0.3" + } + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", + "dev": true + }, + "vm-browserify": { + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-0.0.4.tgz", + "integrity": "sha1-XX6kW7755Kb/ZflUOOCofDV9WnM=", + "dev": true, + "requires": { + "indexof": "0.0.1" + } + }, + "watchpack": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-1.6.0.tgz", + "integrity": "sha512-i6dHe3EyLjMmDlU1/bGQpEw25XSjkJULPuAVKCbNRefQVq48yXKUpwg538F7AZTf9kyr57zj++pQFltUa5H7yA==", + "dev": true, + "requires": { + "chokidar": "^2.0.2", + "graceful-fs": "^4.1.2", + "neo-async": "^2.5.0" + } + }, + "webpack-sources": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-1.3.0.tgz", + "integrity": "sha512-OiVgSrbGu7NEnEvQJJgdSFPl2qWKkWq5lHMhgiToIiN9w34EBnjYzSYs+VbL5KoYiLNtFFa7BZIKxRED3I32pA==", + "dev": true, + "requires": { + "source-list-map": "^2.0.0", + "source-map": "~0.6.1" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "worker-farm": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/worker-farm/-/worker-farm-1.6.0.tgz", + "integrity": "sha512-6w+3tHbM87WnSWnENBUvA2pxJPLhQUg5LKwUQHq3r+XPhIM+Gh2R5ycbwPCyuGbNg+lPgdcnQUhuC02kJCvffQ==", + "dev": true, + "requires": { + "errno": "~0.1.7" + } + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true + }, + "xtend": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", + "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=", + "dev": true + }, + "y18n": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz", + "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==", + "dev": true + }, + "yallist": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.0.3.tgz", + "integrity": "sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A==", + "dev": true + } + } + }, + "webpack-cli": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-3.1.2.tgz", + "integrity": "sha512-Cnqo7CeqeSvC6PTdts+dywNi5CRlIPbLx1AoUPK2T6vC1YAugMG3IOoO9DmEscd+Dghw7uRlnzV1KwOe5IrtgQ==", + "dev": true, + "requires": { + "chalk": "^2.4.1", + "cross-spawn": "^6.0.5", + "enhanced-resolve": "^4.1.0", + "global-modules-path": "^2.3.0", + "import-local": "^2.0.0", + "interpret": "^1.1.0", + "loader-utils": "^1.1.0", + "supports-color": "^5.5.0", + "v8-compile-cache": "^2.0.2", + "yargs": "^12.0.2" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "big.js": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/big.js/-/big.js-3.2.0.tgz", + "integrity": "sha512-+hN/Zh2D08Mx65pZ/4g5bsmNiZUuChDiQfTUQ7qJr4/kuopCr88xZsAXv6mBoZEsUI4OuGHlX59qE94K2mMW8Q==", + "dev": true + }, + "camelcase": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.0.0.tgz", + "integrity": "sha512-faqwZqnWxbxn+F1d399ygeamQNy3lPp/H9H6rNrqYh4FSVCtcY+3cub1MxA8o9mDd55mM8Aghuu/kuyYA6VTsA==", + "dev": true + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "cliui": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-4.1.0.tgz", + "integrity": "sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ==", + "dev": true, + "requires": { + "string-width": "^2.1.1", + "strip-ansi": "^4.0.0", + "wrap-ansi": "^2.0.0" + } + }, + "code-point-at": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", + "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", + "dev": true + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, + "core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", + "dev": true + }, + "cross-spawn": { + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "dev": true, + "requires": { + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + } + }, + "decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", + "dev": true + }, + "emojis-list": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-2.1.0.tgz", + "integrity": "sha1-TapNnbAPmBmIDHn6RXrlsJof04k=", + "dev": true + }, + "enhanced-resolve": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-4.1.0.tgz", + "integrity": "sha512-F/7vkyTtyc/llOIn8oWclcB25KdRaiPBpZYDgJHgh/UHtpgT2p2eldQgtQnLtUvfMKPKxbRaQM/hHkvLHt1Vng==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "memory-fs": "^0.4.0", + "tapable": "^1.0.0" + } + }, + "errno": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/errno/-/errno-0.1.7.tgz", + "integrity": "sha512-MfrRBDWzIWifgq6tJj60gkAwtLNb6sQPlcFrSOflcP1aFmmruKQ2wRnze/8V6kgyz7H3FF8Npzv78mZ7XLLflg==", + "dev": true, + "requires": { + "prr": "~1.0.1" + } + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true + }, + "execa": { + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-0.10.0.tgz", + "integrity": "sha512-7XOMnz8Ynx1gGo/3hyV9loYNPWM94jG3+3T3Y8tsfSstFmETmENCMU/A/zj8Lyaj1lkgEepKepvd6240tBRvlw==", + "dev": true, + "requires": { + "cross-spawn": "^6.0.0", + "get-stream": "^3.0.0", + "is-stream": "^1.1.0", + "npm-run-path": "^2.0.0", + "p-finally": "^1.0.0", + "signal-exit": "^3.0.0", + "strip-eof": "^1.0.0" + } + }, + "find-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "dev": true, + "requires": { + "locate-path": "^3.0.0" + } + }, + "get-caller-file": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz", + "integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==", + "dev": true + }, + "get-stream": { + "version": "3.0.0", + "resolved": "http://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", + "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=", + "dev": true + }, + "global-modules-path": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/global-modules-path/-/global-modules-path-2.3.0.tgz", + "integrity": "sha512-HchvMJNYh9dGSCy8pOQ2O8u/hoXaL+0XhnrwH0RyLiSXMMTl9W3N6KUU73+JFOg5PGjtzl6VZzUQsnrpm7Szag==", + "dev": true + }, + "graceful-fs": { + "version": "4.1.15", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.15.tgz", + "integrity": "sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA==", + "dev": true + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "import-local": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/import-local/-/import-local-2.0.0.tgz", + "integrity": "sha512-b6s04m3O+s3CGSbqDIyP4R6aAwAeYlVq9+WUWep6iHa8ETRf9yei1U48C5MmfJmV9AiLYYBKPMq/W+/WRpQmCQ==", + "dev": true, + "requires": { + "pkg-dir": "^3.0.0", + "resolve-cwd": "^2.0.0" + } + }, + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", + "dev": true + }, + "interpret": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.1.0.tgz", + "integrity": "sha1-ftGxQQxqDg94z5XTuEQMY/eLhhQ=", + "dev": true + }, + "invert-kv": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-2.0.0.tgz", + "integrity": "sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA==", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "is-stream": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", + "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", + "dev": true + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true + }, + "json5": { + "version": "0.5.1", + "resolved": "http://registry.npmjs.org/json5/-/json5-0.5.1.tgz", + "integrity": "sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE=", + "dev": true + }, + "lcid": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/lcid/-/lcid-2.0.0.tgz", + "integrity": "sha512-avPEb8P8EGnwXKClwsNUgryVjllcRqtMYa49NTsbQagYuT1DcXnl1915oxWjoyGrXR6zH/Y0Zc96xWsPcoDKeA==", + "dev": true, + "requires": { + "invert-kv": "^2.0.0" + } + }, + "loader-utils": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.1.0.tgz", + "integrity": "sha1-yYrvSIvM7aL/teLeZG1qdUQp9c0=", + "dev": true, + "requires": { + "big.js": "^3.1.3", + "emojis-list": "^2.0.0", + "json5": "^0.5.0" + } + }, + "locate-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "dev": true, + "requires": { + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" + } + }, + "map-age-cleaner": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/map-age-cleaner/-/map-age-cleaner-0.1.3.tgz", + "integrity": "sha512-bJzx6nMoP6PDLPBFmg7+xRKeFZvFboMrGlxmNj9ClvX53KrmvM5bXFXEWjbz4cz1AFn+jWJ9z/DJSz7hrs0w3w==", + "dev": true, + "requires": { + "p-defer": "^1.0.0" + } + }, + "mem": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/mem/-/mem-4.0.0.tgz", + "integrity": "sha512-WQxG/5xYc3tMbYLXoXPm81ET2WDULiU5FxbuIoNbJqLOOI8zehXFdZuiUEgfdrU2mVB1pxBZUGlYORSrpuJreA==", + "dev": true, + "requires": { + "map-age-cleaner": "^0.1.1", + "mimic-fn": "^1.0.0", + "p-is-promise": "^1.1.0" + } + }, + "memory-fs": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/memory-fs/-/memory-fs-0.4.1.tgz", + "integrity": "sha1-OpoguEYlI+RHz7x+i7gO1me/xVI=", + "dev": true, + "requires": { + "errno": "^0.1.3", + "readable-stream": "^2.0.1" + } + }, + "mimic-fn": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", + "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==", + "dev": true + }, + "nice-try": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", + "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", + "dev": true + }, + "npm-run-path": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", + "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", + "dev": true, + "requires": { + "path-key": "^2.0.0" + } + }, + "number-is-nan": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", + "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", + "dev": true + }, + "os-locale": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-3.0.1.tgz", + "integrity": "sha512-7g5e7dmXPtzcP4bgsZ8ixDVqA7oWYuEz4lOSujeWyliPai4gfVDiFIcwBg3aGCPnmSGfzOKTK3ccPn0CKv3DBw==", + "dev": true, + "requires": { + "execa": "^0.10.0", + "lcid": "^2.0.0", + "mem": "^4.0.0" + } + }, + "p-defer": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-defer/-/p-defer-1.0.0.tgz", + "integrity": "sha1-n26xgvbJqozXQwBKfU+WsZaw+ww=", + "dev": true + }, + "p-finally": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", + "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=", + "dev": true + }, + "p-is-promise": { + "version": "1.1.0", + "resolved": "http://registry.npmjs.org/p-is-promise/-/p-is-promise-1.1.0.tgz", + "integrity": "sha1-nJRWmJ6fZYgBewQ01WCXZ1w9oF4=", + "dev": true + }, + "p-limit": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.0.0.tgz", + "integrity": "sha512-fl5s52lI5ahKCernzzIyAP0QAZbGIovtVHGwpcu1Jr/EpzLVDI2myISHwGqK7m8uQFugVWSrbxH7XnhGtvEc+A==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", + "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "dev": true, + "requires": { + "p-limit": "^2.0.0" + } + }, + "p-try": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.0.0.tgz", + "integrity": "sha512-hMp0onDKIajHfIkdRk3P4CdCmErkYAxxDtP3Wx/4nZ3aGlau2VKh3mZpcuFkH27WQkL/3WBCPOktzA9ZOAnMQQ==", + "dev": true + }, + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "dev": true + }, + "path-key": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", + "dev": true + }, + "pkg-dir": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-3.0.0.tgz", + "integrity": "sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw==", + "dev": true, + "requires": { + "find-up": "^3.0.0" + } + }, + "process-nextick-args": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", + "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==", + "dev": true + }, + "prr": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz", + "integrity": "sha1-0/wRS6BplaRexok/SEzrHXj19HY=", + "dev": true + }, + "readable-stream": { + "version": "2.3.6", + "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", + "dev": true + }, + "require-main-filename": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", + "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=", + "dev": true + }, + "resolve-cwd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-2.0.0.tgz", + "integrity": "sha1-AKn3OHVW4nA46uIyyqNypqWbZlo=", + "dev": true, + "requires": { + "resolve-from": "^3.0.0" + } + }, + "resolve-from": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-3.0.0.tgz", + "integrity": "sha1-six699nWiBvItuZTM17rywoYh0g=", + "dev": true + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "semver": { + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.6.0.tgz", + "integrity": "sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg==", + "dev": true + }, + "set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", + "dev": true + }, + "shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "dev": true, + "requires": { + "shebang-regex": "^1.0.0" + } + }, + "shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", + "dev": true + }, + "signal-exit": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", + "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", + "dev": true + }, + "string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "dev": true, + "requires": { + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" + } + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "http://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.0" + } + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "^3.0.0" + } + }, + "strip-eof": { + "version": "1.0.0", + "resolved": "http://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", + "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + }, + "tapable": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/tapable/-/tapable-1.1.1.tgz", + "integrity": "sha512-9I2ydhj8Z9veORCw5PRm4u9uebCn0mcCa6scWoNcbZ6dAtoo2618u9UUzxgmsCOreJpqDDuv61LvwofW7hLcBA==", + "dev": true + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", + "dev": true + }, + "v8-compile-cache": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.0.2.tgz", + "integrity": "sha512-1wFuMUIM16MDJRCrpbpuEPTUGmM5QMUg0cr3KFwra2XgOgFcPGDQHDh3CszSCD2Zewc/dh/pamNEW8CbfDebUw==", + "dev": true + }, + "which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + }, + "which-module": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", + "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", + "dev": true + }, + "wrap-ansi": { + "version": "2.1.0", + "resolved": "http://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", + "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", + "dev": true, + "requires": { + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1" + }, + "dependencies": { + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "dev": true, + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "dev": true, + "requires": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + } + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "http://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } + } + } + }, + "y18n": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz", + "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==", + "dev": true + }, + "yargs": { + "version": "12.0.5", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-12.0.5.tgz", + "integrity": "sha512-Lhz8TLaYnxq/2ObqHDql8dX8CJi97oHxrjUcYtzKbbykPtVW9WB+poxI+NM2UIzsMgNCZTIf0AQwsjK5yMAqZw==", + "dev": true, + "requires": { + "cliui": "^4.0.0", + "decamelize": "^1.2.0", + "find-up": "^3.0.0", + "get-caller-file": "^1.0.1", + "os-locale": "^3.0.0", + "require-directory": "^2.1.1", + "require-main-filename": "^1.0.1", + "set-blocking": "^2.0.0", + "string-width": "^2.0.0", + "which-module": "^2.0.0", + "y18n": "^3.2.1 || ^4.0.0", + "yargs-parser": "^11.1.1" + } + }, + "yargs-parser": { + "version": "11.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-11.1.1.tgz", + "integrity": "sha512-C6kB/WJDiaxONLJQnF8ccx9SEeoTTLek8RVbaOIsrAUS8VrBEXfmeSnCZxygc+XC2sNMBIwOOnfcxiynjHsVSQ==", + "dev": true, + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + } + } + } + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true + } + } +} diff --git a/vendor/simplesamlphp/simplesamlphp/package.json b/vendor/simplesamlphp/simplesamlphp/package.json new file mode 100644 index 0000000000..a8e692745e --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/package.json @@ -0,0 +1,35 @@ +{ + "name": "simplesamlphp", + "main": "index.js", + "repository": "https://github.com/simplesamlphp/simplesamlphp", + "author": "olimpiam", + "license": "MIT", + "scripts": { + "clean": "rm -rf www/assets/css/* && rm -rf www/assets/js/*", + "build": "webpack -p" + }, + "dependencies": { + "clipboard": "^2.0.1", + "es6-shim": "^0.35.4", + "font-awesome": "^4.7.0", + "highlight.js": "^9.13.1", + "jquery": "^3.4.0", + "jquery-ui": "^1.12.1", + "purecss": "^1.0.0", + "reset-css": "^4.0.1", + "selectize": "^0.12.6" + }, + "devDependencies": { + "babel-core": "^6.26.3", + "babel-loader": "^7.1.4", + "copy-webpack-plugin": "^4.6.0", + "css-loader": "^1.0.1", + "extract-text-webpack-plugin": "^4.0.0-beta.0", + "node-sass": "^4.10.0", + "sass-loader": "^7.1.0", + "style-loader": "^0.23.1", + "webpack": "^4.26.1", + "webpack-cli": "^3.1.2", + "expose-loader": "^0.7.5" + } +} diff --git a/vendor/simplesamlphp/simplesamlphp/phpunit.xml b/vendor/simplesamlphp/simplesamlphp/phpunit.xml new file mode 100644 index 0000000000..6915e5c0b1 --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/phpunit.xml @@ -0,0 +1,35 @@ +<?xml version="1.0" encoding="UTF-8"?> +<phpunit backupGlobals="false" + backupStaticAttributes="false" + colors="true" + convertErrorsToExceptions="true" + convertNoticesToExceptions="true" + convertWarningsToExceptions="true" + processIsolation="false" + stopOnFailure="false" + syntaxCheck="false" + bootstrap="./tests/bootstrap.php"> + <testsuites> + <testsuite name="Unit tests"> + <directory>./tests/</directory> + </testsuite> + </testsuites> + <filter> + <whitelist processUncoveredFilesFromWhitelist="true"> + <directory suffix=".php">./lib/</directory> + <directory suffix=".php">./modules/consent/lib/</directory> + <directory suffix=".php">./modules/core/lib/</directory> + <directory suffix=".php">./modules/saml/lib/</directory> + <exclude> + <directory>./vendor/</directory> + <directory>./tests/</directory> + <file>./lib/SimpleSAML/Utils/HttpAdapter.php</file> + </exclude> + </whitelist> + </filter> + <logging> + <log type="coverage-text" target="php://stdout" showUncoveredFiles="true"/> + <log type="coverage-html" target="build/coverage" title="PHP Coveralls" charset="UTF-8" yui="true" highlight="true" lowUpperBound="35" highLowerBound="70"/> + <log type="coverage-clover" target="build/logs/clover.xml"/> + </logging> +</phpunit> diff --git a/vendor/simplesamlphp/simplesamlphp/psalm.xml b/vendor/simplesamlphp/simplesamlphp/psalm.xml index 575f74033e..0ccc8b80b8 100644 --- a/vendor/simplesamlphp/simplesamlphp/psalm.xml +++ b/vendor/simplesamlphp/simplesamlphp/psalm.xml @@ -23,6 +23,8 @@ <PropertyNotSetInConstructor errorLevel="info" /> <MissingConstructor errorLevel="info" /> + <MissingClosureParamType errorLevel="info" /> + <MissingParamType errorLevel="info" /> <UnusedClass errorLevel="info" /> <PossiblyUnusedMethod errorLevel="info" /> <UntypedParam errorLevel="info" /> diff --git a/vendor/simplesamlphp/simplesamlphp/schemas/oasis-sstc-saml-schema-assertion-1.1.xsd b/vendor/simplesamlphp/simplesamlphp/schemas/oasis-sstc-saml-schema-assertion-1.1.xsd index dee3a3e261..1516399bf9 100644 --- a/vendor/simplesamlphp/simplesamlphp/schemas/oasis-sstc-saml-schema-assertion-1.1.xsd +++ b/vendor/simplesamlphp/simplesamlphp/schemas/oasis-sstc-saml-schema-assertion-1.1.xsd @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <schema targetNamespace="urn:oasis:names:tc:SAML:1.0:assertion" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:saml="urn:oasis:names:tc:SAML:1.0:assertion" xmlns="http://www.w3.org/2001/XMLSchema" elementFormDefault="unqualified" attributeFormDefault="unqualified" version="1.1"> - <import namespace="http://www.w3.org/2000/09/xmldsig#" schemaLocation="http://www.w3.org/TR/xmldsig-core/xmldsig-core-schema.xsd"/> + <import namespace="http://www.w3.org/2000/09/xmldsig#" schemaLocation="xmldsig-core-schema.xsd"/> <annotation> <documentation> Document identifier: oasis-sstc-saml-schema-assertion-1.1 diff --git a/vendor/simplesamlphp/simplesamlphp/schemas/oasis-sstc-saml-schema-protocol-1.1.xsd b/vendor/simplesamlphp/simplesamlphp/schemas/oasis-sstc-saml-schema-protocol-1.1.xsd index 8bea3a9444..ea44077258 100644 --- a/vendor/simplesamlphp/simplesamlphp/schemas/oasis-sstc-saml-schema-protocol-1.1.xsd +++ b/vendor/simplesamlphp/simplesamlphp/schemas/oasis-sstc-saml-schema-protocol-1.1.xsd @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <schema targetNamespace="urn:oasis:names:tc:SAML:1.0:protocol" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:saml="urn:oasis:names:tc:SAML:1.0:assertion" xmlns:samlp="urn:oasis:names:tc:SAML:1.0:protocol" xmlns="http://www.w3.org/2001/XMLSchema" elementFormDefault="unqualified" attributeFormDefault="unqualified" version="1.1"> <import namespace="urn:oasis:names:tc:SAML:1.0:assertion" schemaLocation="oasis-sstc-saml-schema-assertion-1.1.xsd"/> - <import namespace="http://www.w3.org/2000/09/xmldsig#" schemaLocation="http://www.w3.org/TR/xmldsig-core/xmldsig-core-schema.xsd"/> + <import namespace="http://www.w3.org/2000/09/xmldsig#" schemaLocation="xmldsig-core-schema.xsd"/> <annotation> <documentation> Document identifier: oasis-sstc-saml-schema-protocol-1.1 diff --git a/vendor/simplesamlphp/simplesamlphp/schemas/saml-schema-assertion-2.0.xsd b/vendor/simplesamlphp/simplesamlphp/schemas/saml-schema-assertion-2.0.xsd index 9bbfa26e31..2b2f7b8018 100644 --- a/vendor/simplesamlphp/simplesamlphp/schemas/saml-schema-assertion-2.0.xsd +++ b/vendor/simplesamlphp/simplesamlphp/schemas/saml-schema-assertion-2.0.xsd @@ -10,9 +10,9 @@ blockDefault="substitution" version="2.0"> <import namespace="http://www.w3.org/2000/09/xmldsig#" - schemaLocation="http://www.w3.org/TR/2002/REC-xmldsig-core-20020212/xmldsig-core-schema.xsd"/> + schemaLocation="xmldsig-core-schema.xsd"/> <import namespace="http://www.w3.org/2001/04/xmlenc#" - schemaLocation="http://www.w3.org/TR/2002/REC-xmlenc-core-20021210/xenc-schema.xsd"/> + schemaLocation="xenc-schema.xsd"/> <annotation> <documentation> Document identifier: saml-schema-assertion-2.0 diff --git a/vendor/simplesamlphp/simplesamlphp/schemas/saml-schema-metadata-2.0.xsd b/vendor/simplesamlphp/simplesamlphp/schemas/saml-schema-metadata-2.0.xsd index 923b598bf8..b656d4f414 100644 --- a/vendor/simplesamlphp/simplesamlphp/schemas/saml-schema-metadata-2.0.xsd +++ b/vendor/simplesamlphp/simplesamlphp/schemas/saml-schema-metadata-2.0.xsd @@ -11,13 +11,13 @@ blockDefault="substitution" version="2.0"> <import namespace="http://www.w3.org/2000/09/xmldsig#" - schemaLocation="http://www.w3.org/TR/2002/REC-xmldsig-core-20020212/xmldsig-core-schema.xsd"/> + schemaLocation="xmldsig-core-schema.xsd"/> <import namespace="http://www.w3.org/2001/04/xmlenc#" - schemaLocation="http://www.w3.org/TR/2002/REC-xmlenc-core-20021210/xenc-schema.xsd"/> + schemaLocation="xenc-schema.xsd"/> <import namespace="urn:oasis:names:tc:SAML:2.0:assertion" schemaLocation="saml-schema-assertion-2.0.xsd"/> <import namespace="http://www.w3.org/XML/1998/namespace" - schemaLocation="http://www.w3.org/2001/xml.xsd"/> + schemaLocation="xml.xsd"/> <annotation> <documentation> Document identifier: saml-schema-metadata-2.0 diff --git a/vendor/simplesamlphp/simplesamlphp/schemas/saml-schema-protocol-2.0.xsd b/vendor/simplesamlphp/simplesamlphp/schemas/saml-schema-protocol-2.0.xsd index 13656b18ae..7fa6f489d6 100644 --- a/vendor/simplesamlphp/simplesamlphp/schemas/saml-schema-protocol-2.0.xsd +++ b/vendor/simplesamlphp/simplesamlphp/schemas/saml-schema-protocol-2.0.xsd @@ -12,7 +12,7 @@ <import namespace="urn:oasis:names:tc:SAML:2.0:assertion" schemaLocation="saml-schema-assertion-2.0.xsd"/> <import namespace="http://www.w3.org/2000/09/xmldsig#" - schemaLocation="http://www.w3.org/TR/2002/REC-xmldsig-core-20020212/xmldsig-core-schema.xsd"/> + schemaLocation="xmldsig-core-schema.xsd"/> <annotation> <documentation> Document identifier: saml-schema-protocol-2.0 diff --git a/vendor/simplesamlphp/simplesamlphp/schemas/xenc-schema.xsd b/vendor/simplesamlphp/simplesamlphp/schemas/xenc-schema.xsd new file mode 100644 index 0000000000..d61229fd50 --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/schemas/xenc-schema.xsd @@ -0,0 +1,146 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE schema PUBLIC "-//W3C//DTD XMLSchema 200102//EN" + "http://www.w3.org/2001/XMLSchema.dtd" + [ + <!ATTLIST schema + xmlns:xenc CDATA #FIXED 'http://www.w3.org/2001/04/xmlenc#' + xmlns:ds CDATA #FIXED 'http://www.w3.org/2000/09/xmldsig#'> + <!ENTITY xenc 'http://www.w3.org/2001/04/xmlenc#'> + <!ENTITY % p ''> + <!ENTITY % s ''> + ]> + +<schema xmlns='http://www.w3.org/2001/XMLSchema' version='1.0' + xmlns:xenc='http://www.w3.org/2001/04/xmlenc#' + xmlns:ds='http://www.w3.org/2000/09/xmldsig#' + targetNamespace='http://www.w3.org/2001/04/xmlenc#' + elementFormDefault='qualified'> + + <import namespace='http://www.w3.org/2000/09/xmldsig#' + schemaLocation='xmldsig-core-schema.xsd'/> + + <complexType name='EncryptedType' abstract='true'> + <sequence> + <element name='EncryptionMethod' type='xenc:EncryptionMethodType' + minOccurs='0'/> + <element ref='ds:KeyInfo' minOccurs='0'/> + <element ref='xenc:CipherData'/> + <element ref='xenc:EncryptionProperties' minOccurs='0'/> + </sequence> + <attribute name='Id' type='ID' use='optional'/> + <attribute name='Type' type='anyURI' use='optional'/> + <attribute name='MimeType' type='string' use='optional'/> + <attribute name='Encoding' type='anyURI' use='optional'/> + </complexType> + + <complexType name='EncryptionMethodType' mixed='true'> + <sequence> + <element name='KeySize' minOccurs='0' type='xenc:KeySizeType'/> + <element name='OAEPparams' minOccurs='0' type='base64Binary'/> + <any namespace='##other' minOccurs='0' maxOccurs='unbounded'/> + </sequence> + <attribute name='Algorithm' type='anyURI' use='required'/> + </complexType> + + <simpleType name='KeySizeType'> + <restriction base="integer"/> + </simpleType> + + <element name='CipherData' type='xenc:CipherDataType'/> + <complexType name='CipherDataType'> + <choice> + <element name='CipherValue' type='base64Binary'/> + <element ref='xenc:CipherReference'/> + </choice> + </complexType> + + <element name='CipherReference' type='xenc:CipherReferenceType'/> + <complexType name='CipherReferenceType'> + <choice> + <element name='Transforms' type='xenc:TransformsType' minOccurs='0'/> + </choice> + <attribute name='URI' type='anyURI' use='required'/> + </complexType> + + <complexType name='TransformsType'> + <sequence> + <element ref='ds:Transform' maxOccurs='unbounded'/> + </sequence> + </complexType> + + + <element name='EncryptedData' type='xenc:EncryptedDataType'/> + <complexType name='EncryptedDataType'> + <complexContent> + <extension base='xenc:EncryptedType'> + </extension> + </complexContent> + </complexType> + + <!-- Children of ds:KeyInfo --> + + <element name='EncryptedKey' type='xenc:EncryptedKeyType'/> + <complexType name='EncryptedKeyType'> + <complexContent> + <extension base='xenc:EncryptedType'> + <sequence> + <element ref='xenc:ReferenceList' minOccurs='0'/> + <element name='CarriedKeyName' type='string' minOccurs='0'/> + </sequence> + <attribute name='Recipient' type='string' + use='optional'/> + </extension> + </complexContent> + </complexType> + + <element name="AgreementMethod" type="xenc:AgreementMethodType"/> + <complexType name="AgreementMethodType" mixed="true"> + <sequence> + <element name="KA-Nonce" minOccurs="0" type="base64Binary"/> + <!-- <element ref="ds:DigestMethod" minOccurs="0"/> --> + <any namespace="##other" minOccurs="0" maxOccurs="unbounded"/> + <element name="OriginatorKeyInfo" minOccurs="0" type="ds:KeyInfoType"/> + <element name="RecipientKeyInfo" minOccurs="0" type="ds:KeyInfoType"/> + </sequence> + <attribute name="Algorithm" type="anyURI" use="required"/> + </complexType> + + <!-- End Children of ds:KeyInfo --> + + <element name='ReferenceList'> + <complexType> + <choice minOccurs='1' maxOccurs='unbounded'> + <element name='DataReference' type='xenc:ReferenceType'/> + <element name='KeyReference' type='xenc:ReferenceType'/> + </choice> + </complexType> + </element> + + <complexType name='ReferenceType'> + <sequence> + <any namespace='##other' minOccurs='0' maxOccurs='unbounded'/> + </sequence> + <attribute name='URI' type='anyURI' use='required'/> + </complexType> + + + <element name='EncryptionProperties' type='xenc:EncryptionPropertiesType'/> + <complexType name='EncryptionPropertiesType'> + <sequence> + <element ref='xenc:EncryptionProperty' maxOccurs='unbounded'/> + </sequence> + <attribute name='Id' type='ID' use='optional'/> + </complexType> + + <element name='EncryptionProperty' type='xenc:EncryptionPropertyType'/> + <complexType name='EncryptionPropertyType' mixed='true'> + <choice maxOccurs='unbounded'> + <any namespace='##other' processContents='lax'/> + </choice> + <attribute name='Target' type='anyURI' use='optional'/> + <attribute name='Id' type='ID' use='optional'/> + <anyAttribute namespace="http://www.w3.org/XML/1998/namespace"/> + </complexType> + +</schema> + diff --git a/vendor/simplesamlphp/simplesamlphp/schemas/xml.xsd b/vendor/simplesamlphp/simplesamlphp/schemas/xml.xsd new file mode 100644 index 0000000000..aea7d0db0a --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/schemas/xml.xsd @@ -0,0 +1,287 @@ +<?xml version='1.0'?> +<?xml-stylesheet href="../2008/09/xsd.xsl" type="text/xsl"?> +<xs:schema targetNamespace="http://www.w3.org/XML/1998/namespace" + xmlns:xs="http://www.w3.org/2001/XMLSchema" + xmlns ="http://www.w3.org/1999/xhtml" + xml:lang="en"> + + <xs:annotation> + <xs:documentation> + <div> + <h1>About the XML namespace</h1> + + <div class="bodytext"> + <p> + This schema document describes the XML namespace, in a form + suitable for import by other schema documents. + </p> + <p> + See <a href="http://www.w3.org/XML/1998/namespace.html"> + http://www.w3.org/XML/1998/namespace.html</a> and + <a href="http://www.w3.org/TR/REC-xml"> + http://www.w3.org/TR/REC-xml</a> for information + about this namespace. + </p> + <p> + Note that local names in this namespace are intended to be + defined only by the World Wide Web Consortium or its subgroups. + The names currently defined in this namespace are listed below. + They should not be used with conflicting semantics by any Working + Group, specification, or document instance. + </p> + <p> + See further below in this document for more information about <a + href="#usage">how to refer to this schema document from your own + XSD schema documents</a> and about <a href="#nsversioning">the + namespace-versioning policy governing this schema document</a>. + </p> + </div> + </div> + </xs:documentation> + </xs:annotation> + + <xs:attribute name="lang"> + <xs:annotation> + <xs:documentation> + <div> + + <h3>lang (as an attribute name)</h3> + <p> + denotes an attribute whose value + is a language code for the natural language of the content of + any element; its value is inherited. This name is reserved + by virtue of its definition in the XML specification.</p> + + </div> + <div> + <h4>Notes</h4> + <p> + Attempting to install the relevant ISO 2- and 3-letter + codes as the enumerated possible values is probably never + going to be a realistic possibility. + </p> + <p> + See BCP 47 at <a href="http://www.rfc-editor.org/rfc/bcp/bcp47.txt"> + http://www.rfc-editor.org/rfc/bcp/bcp47.txt</a> + and the IANA language subtag registry at + <a href="http://www.iana.org/assignments/language-subtag-registry"> + http://www.iana.org/assignments/language-subtag-registry</a> + for further information. + </p> + <p> + The union allows for the 'un-declaration' of xml:lang with + the empty string. + </p> + </div> + </xs:documentation> + </xs:annotation> + <xs:simpleType> + <xs:union memberTypes="xs:language"> + <xs:simpleType> + <xs:restriction base="xs:string"> + <xs:enumeration value=""/> + </xs:restriction> + </xs:simpleType> + </xs:union> + </xs:simpleType> + </xs:attribute> + + <xs:attribute name="space"> + <xs:annotation> + <xs:documentation> + <div> + + <h3>space (as an attribute name)</h3> + <p> + denotes an attribute whose + value is a keyword indicating what whitespace processing + discipline is intended for the content of the element; its + value is inherited. This name is reserved by virtue of its + definition in the XML specification.</p> + + </div> + </xs:documentation> + </xs:annotation> + <xs:simpleType> + <xs:restriction base="xs:NCName"> + <xs:enumeration value="default"/> + <xs:enumeration value="preserve"/> + </xs:restriction> + </xs:simpleType> + </xs:attribute> + + <xs:attribute name="base" type="xs:anyURI"> <xs:annotation> + <xs:documentation> + <div> + + <h3>base (as an attribute name)</h3> + <p> + denotes an attribute whose value + provides a URI to be used as the base for interpreting any + relative URIs in the scope of the element on which it + appears; its value is inherited. This name is reserved + by virtue of its definition in the XML Base specification.</p> + + <p> + See <a + href="http://www.w3.org/TR/xmlbase/">http://www.w3.org/TR/xmlbase/</a> + for information about this attribute. + </p> + </div> + </xs:documentation> + </xs:annotation> + </xs:attribute> + + <xs:attribute name="id" type="xs:ID"> + <xs:annotation> + <xs:documentation> + <div> + + <h3>id (as an attribute name)</h3> + <p> + denotes an attribute whose value + should be interpreted as if declared to be of type ID. + This name is reserved by virtue of its definition in the + xml:id specification.</p> + + <p> + See <a + href="http://www.w3.org/TR/xml-id/">http://www.w3.org/TR/xml-id/</a> + for information about this attribute. + </p> + </div> + </xs:documentation> + </xs:annotation> + </xs:attribute> + + <xs:attributeGroup name="specialAttrs"> + <xs:attribute ref="xml:base"/> + <xs:attribute ref="xml:lang"/> + <xs:attribute ref="xml:space"/> + <xs:attribute ref="xml:id"/> + </xs:attributeGroup> + + <xs:annotation> + <xs:documentation> + <div> + + <h3>Father (in any context at all)</h3> + + <div class="bodytext"> + <p> + denotes Jon Bosak, the chair of + the original XML Working Group. This name is reserved by + the following decision of the W3C XML Plenary and + XML Coordination groups: + </p> + <blockquote> + <p> + In appreciation for his vision, leadership and + dedication the W3C XML Plenary on this 10th day of + February, 2000, reserves for Jon Bosak in perpetuity + the XML name "xml:Father". + </p> + </blockquote> + </div> + </div> + </xs:documentation> + </xs:annotation> + + <xs:annotation> + <xs:documentation> + <div xml:id="usage" id="usage"> + <h2><a name="usage">About this schema document</a></h2> + + <div class="bodytext"> + <p> + This schema defines attributes and an attribute group suitable + for use by schemas wishing to allow <code>xml:base</code>, + <code>xml:lang</code>, <code>xml:space</code> or + <code>xml:id</code> attributes on elements they define. + </p> + <p> + To enable this, such a schema must import this schema for + the XML namespace, e.g. as follows: + </p> + <pre> + <schema . . .> + . . . + <import namespace="http://www.w3.org/XML/1998/namespace" + schemaLocation="http://www.w3.org/2001/xml.xsd"/> + </pre> + <p> + or + </p> + <pre> + <import namespace="http://www.w3.org/XML/1998/namespace" + schemaLocation="http://www.w3.org/2009/01/xml.xsd"/> + </pre> + <p> + Subsequently, qualified reference to any of the attributes or the + group defined below will have the desired effect, e.g. + </p> + <pre> + <type . . .> + . . . + <attributeGroup ref="xml:specialAttrs"/> + </pre> + <p> + will define a type which will schema-validate an instance element + with any of those attributes. + </p> + </div> + </div> + </xs:documentation> + </xs:annotation> + + <xs:annotation> + <xs:documentation> + <div id="nsversioning" xml:id="nsversioning"> + <h2><a name="nsversioning">Versioning policy for this schema document</a></h2> + <div class="bodytext"> + <p> + In keeping with the XML Schema WG's standard versioning + policy, this schema document will persist at + <a href="http://www.w3.org/2009/01/xml.xsd"> + http://www.w3.org/2009/01/xml.xsd</a>. + </p> + <p> + At the date of issue it can also be found at + <a href="http://www.w3.org/2001/xml.xsd"> + http://www.w3.org/2001/xml.xsd</a>. + </p> + <p> + The schema document at that URI may however change in the future, + in order to remain compatible with the latest version of XML + Schema itself, or with the XML namespace itself. In other words, + if the XML Schema or XML namespaces change, the version of this + document at <a href="http://www.w3.org/2001/xml.xsd"> + http://www.w3.org/2001/xml.xsd + </a> + will change accordingly; the version at + <a href="http://www.w3.org/2009/01/xml.xsd"> + http://www.w3.org/2009/01/xml.xsd + </a> + will not change. + </p> + <p> + Previous dated (and unchanging) versions of this schema + document are at: + </p> + <ul> + <li><a href="http://www.w3.org/2009/01/xml.xsd"> + http://www.w3.org/2009/01/xml.xsd</a></li> + <li><a href="http://www.w3.org/2007/08/xml.xsd"> + http://www.w3.org/2007/08/xml.xsd</a></li> + <li><a href="http://www.w3.org/2004/10/xml.xsd"> + http://www.w3.org/2004/10/xml.xsd</a></li> + <li><a href="http://www.w3.org/2001/03/xml.xsd"> + http://www.w3.org/2001/03/xml.xsd</a></li> + </ul> + </div> + </div> + </xs:documentation> + </xs:annotation> + +</xs:schema> + diff --git a/vendor/simplesamlphp/simplesamlphp/schemas/xmldsig-core-schema.xsd b/vendor/simplesamlphp/simplesamlphp/schemas/xmldsig-core-schema.xsd new file mode 100644 index 0000000000..df126b30e6 --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/schemas/xmldsig-core-schema.xsd @@ -0,0 +1,318 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE schema + PUBLIC "-//W3C//DTD XMLSchema 200102//EN" "http://www.w3.org/2001/XMLSchema.dtd" + [ + <!ATTLIST schema + xmlns:ds CDATA #FIXED "http://www.w3.org/2000/09/xmldsig#"> + <!ENTITY dsig 'http://www.w3.org/2000/09/xmldsig#'> + <!ENTITY % p ''> + <!ENTITY % s ''> + ]> + +<!-- Schema for XML Signatures + http://www.w3.org/2000/09/xmldsig# + $Revision: 1.1 $ on $Date: 2002/02/08 20:32:26 $ by $Author: reagle $ + + Copyright 2001 The Internet Society and W3C (Massachusetts Institute + of Technology, Institut National de Recherche en Informatique et en + Automatique, Keio University). All Rights Reserved. + http://www.w3.org/Consortium/Legal/ + + This document is governed by the W3C Software License [1] as described + in the FAQ [2]. + + [1] http://www.w3.org/Consortium/Legal/copyright-software-19980720 + [2] http://www.w3.org/Consortium/Legal/IPR-FAQ-20000620.html#DTD +--> + + +<schema xmlns="http://www.w3.org/2001/XMLSchema" + xmlns:ds="http://www.w3.org/2000/09/xmldsig#" + targetNamespace="http://www.w3.org/2000/09/xmldsig#" + version="0.1" elementFormDefault="qualified"> + +<!-- Basic Types Defined for Signatures --> + +<simpleType name="CryptoBinary"> + <restriction base="base64Binary"> + </restriction> +</simpleType> + +<!-- Start Signature --> + +<element name="Signature" type="ds:SignatureType"/> +<complexType name="SignatureType"> + <sequence> + <element ref="ds:SignedInfo"/> + <element ref="ds:SignatureValue"/> + <element ref="ds:KeyInfo" minOccurs="0"/> + <element ref="ds:Object" minOccurs="0" maxOccurs="unbounded"/> + </sequence> + <attribute name="Id" type="ID" use="optional"/> +</complexType> + + <element name="SignatureValue" type="ds:SignatureValueType"/> + <complexType name="SignatureValueType"> + <simpleContent> + <extension base="base64Binary"> + <attribute name="Id" type="ID" use="optional"/> + </extension> + </simpleContent> + </complexType> + +<!-- Start SignedInfo --> + +<element name="SignedInfo" type="ds:SignedInfoType"/> +<complexType name="SignedInfoType"> + <sequence> + <element ref="ds:CanonicalizationMethod"/> + <element ref="ds:SignatureMethod"/> + <element ref="ds:Reference" maxOccurs="unbounded"/> + </sequence> + <attribute name="Id" type="ID" use="optional"/> +</complexType> + + <element name="CanonicalizationMethod" type="ds:CanonicalizationMethodType"/> + <complexType name="CanonicalizationMethodType" mixed="true"> + <sequence> + <any namespace="##any" minOccurs="0" maxOccurs="unbounded"/> + <!-- (0,unbounded) elements from (1,1) namespace --> + </sequence> + <attribute name="Algorithm" type="anyURI" use="required"/> + </complexType> + + <element name="SignatureMethod" type="ds:SignatureMethodType"/> + <complexType name="SignatureMethodType" mixed="true"> + <sequence> + <element name="HMACOutputLength" minOccurs="0" type="ds:HMACOutputLengthType"/> + <any namespace="##other" minOccurs="0" maxOccurs="unbounded"/> + <!-- (0,unbounded) elements from (1,1) external namespace --> + </sequence> + <attribute name="Algorithm" type="anyURI" use="required"/> + </complexType> + +<!-- Start Reference --> + +<element name="Reference" type="ds:ReferenceType"/> +<complexType name="ReferenceType"> + <sequence> + <element ref="ds:Transforms" minOccurs="0"/> + <element ref="ds:DigestMethod"/> + <element ref="ds:DigestValue"/> + </sequence> + <attribute name="Id" type="ID" use="optional"/> + <attribute name="URI" type="anyURI" use="optional"/> + <attribute name="Type" type="anyURI" use="optional"/> +</complexType> + + <element name="Transforms" type="ds:TransformsType"/> + <complexType name="TransformsType"> + <sequence> + <element ref="ds:Transform" maxOccurs="unbounded"/> + </sequence> + </complexType> + + <element name="Transform" type="ds:TransformType"/> + <complexType name="TransformType" mixed="true"> + <choice minOccurs="0" maxOccurs="unbounded"> + <any namespace="##other" processContents="lax"/> + <!-- (1,1) elements from (0,unbounded) namespaces --> + <element name="XPath" type="string"/> + </choice> + <attribute name="Algorithm" type="anyURI" use="required"/> + </complexType> + +<!-- End Reference --> + +<element name="DigestMethod" type="ds:DigestMethodType"/> +<complexType name="DigestMethodType" mixed="true"> + <sequence> + <any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/> + </sequence> + <attribute name="Algorithm" type="anyURI" use="required"/> +</complexType> + +<element name="DigestValue" type="ds:DigestValueType"/> +<simpleType name="DigestValueType"> + <restriction base="base64Binary"/> +</simpleType> + +<!-- End SignedInfo --> + +<!-- Start KeyInfo --> + +<element name="KeyInfo" type="ds:KeyInfoType"/> +<complexType name="KeyInfoType" mixed="true"> + <choice maxOccurs="unbounded"> + <element ref="ds:KeyName"/> + <element ref="ds:KeyValue"/> + <element ref="ds:RetrievalMethod"/> + <element ref="ds:X509Data"/> + <element ref="ds:PGPData"/> + <element ref="ds:SPKIData"/> + <element ref="ds:MgmtData"/> + <any processContents="lax" namespace="##other"/> + <!-- (1,1) elements from (0,unbounded) namespaces --> + </choice> + <attribute name="Id" type="ID" use="optional"/> +</complexType> + + <element name="KeyName" type="string"/> + <element name="MgmtData" type="string"/> + + <element name="KeyValue" type="ds:KeyValueType"/> + <complexType name="KeyValueType" mixed="true"> + <choice> + <element ref="ds:DSAKeyValue"/> + <element ref="ds:RSAKeyValue"/> + <any namespace="##other" processContents="lax"/> + </choice> + </complexType> + + <element name="RetrievalMethod" type="ds:RetrievalMethodType"/> + <complexType name="RetrievalMethodType"> + <sequence> + <element ref="ds:Transforms" minOccurs="0"/> + </sequence> + <attribute name="URI" type="anyURI"/> + <attribute name="Type" type="anyURI" use="optional"/> + </complexType> + +<!-- Start X509Data --> + +<element name="X509Data" type="ds:X509DataType"/> +<complexType name="X509DataType"> + <sequence maxOccurs="unbounded"> + <choice> + <element name="X509IssuerSerial" type="ds:X509IssuerSerialType"/> + <element name="X509SKI" type="base64Binary"/> + <element name="X509SubjectName" type="string"/> + <element name="X509Certificate" type="base64Binary"/> + <element name="X509CRL" type="base64Binary"/> + <any namespace="##other" processContents="lax"/> + </choice> + </sequence> +</complexType> + +<complexType name="X509IssuerSerialType"> + <sequence> + <element name="X509IssuerName" type="string"/> + <element name="X509SerialNumber" type="integer"/> + </sequence> +</complexType> + +<!-- End X509Data --> + +<!-- Begin PGPData --> + +<element name="PGPData" type="ds:PGPDataType"/> +<complexType name="PGPDataType"> + <choice> + <sequence> + <element name="PGPKeyID" type="base64Binary"/> + <element name="PGPKeyPacket" type="base64Binary" minOccurs="0"/> + <any namespace="##other" processContents="lax" minOccurs="0" + maxOccurs="unbounded"/> + </sequence> + <sequence> + <element name="PGPKeyPacket" type="base64Binary"/> + <any namespace="##other" processContents="lax" minOccurs="0" + maxOccurs="unbounded"/> + </sequence> + </choice> +</complexType> + +<!-- End PGPData --> + +<!-- Begin SPKIData --> + +<element name="SPKIData" type="ds:SPKIDataType"/> +<complexType name="SPKIDataType"> + <sequence maxOccurs="unbounded"> + <element name="SPKISexp" type="base64Binary"/> + <any namespace="##other" processContents="lax" minOccurs="0"/> + </sequence> +</complexType> + +<!-- End SPKIData --> + +<!-- End KeyInfo --> + +<!-- Start Object (Manifest, SignatureProperty) --> + +<element name="Object" type="ds:ObjectType"/> +<complexType name="ObjectType" mixed="true"> + <sequence minOccurs="0" maxOccurs="unbounded"> + <any namespace="##any" processContents="lax"/> + </sequence> + <attribute name="Id" type="ID" use="optional"/> + <attribute name="MimeType" type="string" use="optional"/> <!-- add a grep facet --> + <attribute name="Encoding" type="anyURI" use="optional"/> +</complexType> + +<element name="Manifest" type="ds:ManifestType"/> +<complexType name="ManifestType"> + <sequence> + <element ref="ds:Reference" maxOccurs="unbounded"/> + </sequence> + <attribute name="Id" type="ID" use="optional"/> +</complexType> + +<element name="SignatureProperties" type="ds:SignaturePropertiesType"/> +<complexType name="SignaturePropertiesType"> + <sequence> + <element ref="ds:SignatureProperty" maxOccurs="unbounded"/> + </sequence> + <attribute name="Id" type="ID" use="optional"/> +</complexType> + + <element name="SignatureProperty" type="ds:SignaturePropertyType"/> + <complexType name="SignaturePropertyType" mixed="true"> + <choice maxOccurs="unbounded"> + <any namespace="##other" processContents="lax"/> + <!-- (1,1) elements from (1,unbounded) namespaces --> + </choice> + <attribute name="Target" type="anyURI" use="required"/> + <attribute name="Id" type="ID" use="optional"/> + </complexType> + +<!-- End Object (Manifest, SignatureProperty) --> + +<!-- Start Algorithm Parameters --> + +<simpleType name="HMACOutputLengthType"> + <restriction base="integer"/> +</simpleType> + +<!-- Start KeyValue Element-types --> + +<element name="DSAKeyValue" type="ds:DSAKeyValueType"/> +<complexType name="DSAKeyValueType"> + <sequence> + <sequence minOccurs="0"> + <element name="P" type="ds:CryptoBinary"/> + <element name="Q" type="ds:CryptoBinary"/> + </sequence> + <element name="G" type="ds:CryptoBinary" minOccurs="0"/> + <element name="Y" type="ds:CryptoBinary"/> + <element name="J" type="ds:CryptoBinary" minOccurs="0"/> + <sequence minOccurs="0"> + <element name="Seed" type="ds:CryptoBinary"/> + <element name="PgenCounter" type="ds:CryptoBinary"/> + </sequence> + </sequence> +</complexType> + +<element name="RSAKeyValue" type="ds:RSAKeyValueType"/> +<complexType name="RSAKeyValueType"> + <sequence> + <element name="Modulus" type="ds:CryptoBinary"/> + <element name="Exponent" type="ds:CryptoBinary"/> + </sequence> +</complexType> + +<!-- End KeyValue Element-types --> + +<!-- End Signature --> + +</schema> diff --git a/vendor/simplesamlphp/simplesamlphp/src/css/default-rtl.css b/vendor/simplesamlphp/simplesamlphp/src/css/default-rtl.css new file mode 100644 index 0000000000..3df1c9ce86 --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/src/css/default-rtl.css @@ -0,0 +1,174 @@ +/* these styles are in the head of this page because this is a unique page */ + +/* THE BIG GUYS */ +html { + direction: rtl; +} +#header{ + background: linear-gradient(-141deg, #b8002c 0%, #db0100 51%, #e8410c 75%); +} +#footer{ + background: linear-gradient(-141deg, #b8002c 0%, #db0100 51%, #e8410c 75%); +} +/* LISTS */ +ul { + margin: .3em 2em 1.5em 0; +} + +li { + margin-right: 2em; +} + +/* TYPOGRAPHY */ +dl dd { + margin-right: 3em; +} + +.efieldlist { + border-right: 1px solid #e6e6e6; +} + +div.caution { + padding: .2em 60px .2em .2em; + background-position: right; +} + +th.rowtitle { + text-align: right; +} +.enablebox table { + margin-right: 1em; +} +.enablebox.mini table { + float: left; +} +.enablebox tr td { + padding: .5px .5em 1px 1em; +} + +/* Attribute presentation in example page */ +table.attributes td.attrname { + text-align: left; +} + +fieldset.fancyfieldset { + margin: 2em 0px 1em 1em; +} +fieldset.fancyfieldset legend { + margin-right: 2em; +} + + +/* Reverse Float Left <-> Right */ +.right { + float: left; +} +.left { + float: right; +} +.v-center-right{ + right: 0; +} +.logo-footer-right{ + left:0; + right: auto; +} +.message-box { + border-left-style: initial; + order-left-width: 0; + border-left-color: none; + border-right-style: solid; + border-right-width: 0.3125rem; +} +.message-box.error{ + border-right-color: #cc4b37; +} +.message-box.success{ + border-right-color: #46cc48; +} +.code-box-title .clipboard-btn { + right: auto; + left: 0; + margin-left: 4px; + margin-right: auto; +} + +/*selectize elements*/ +div .item{ + float: right; +} +.selectize-input{ + padding-right:8px; +} +.selectize-input:after{ + transform: translate(-8px, 0); +} + +/*purecss elements*/ +.pure-form-aligned .pure-control-group label { + text-align: left; + margin: 0 0 0 1em; +} +@media only screen and (max-width : 480px) { + .pure-form-aligned .pure-control-group label { + text-align: right; + } +} +.pure-form-aligned .pure-controls { + margin: 1.5em 11em 0 0; +} +.pure-form .pure-help-inline, +.pure-form-message-inline { + padding-left: 0; + padding-right: 0.3em; +} +.pure-select{ + float: left; +} +.pure-table-attributes ul{ + margin:0; +} +.pure-table-attributes li{ + margin:0; +} + +/* language side menu on medium and small screens*/ +#layout.active #menu { + right: initial; + left: 11em; +} +#layout.active .menu-link { + right: initial; + left: 11em; +} +#menu { + right: initial; + margin-right: 0; + margin-left: -11em; /* "#menu" width */ + left: 0; +} +#menu a { + padding: 0.6em 0.6em 0.6em 0em; +} + +.menu-link { + right: initial; + left: 0; /* "#menu width" */ +} + +/* -- Responsive Styles (Media Queries) ------------------------------------- */ + +@media screen and (max-width: 0em), screen and (min-width: 40em) { + #layout.active { + right: auto; + left: 11em; + } + #menuLink.menu-link.active { + right: auto; + left: 13em; + } + #foot.active { + margin-right: auto; + margin-left: 11em; + } +} diff --git a/vendor/simplesamlphp/simplesamlphp/src/css/default.scss b/vendor/simplesamlphp/simplesamlphp/src/css/default.scss new file mode 100644 index 0000000000..77a9fb011e --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/src/css/default.scss @@ -0,0 +1,859 @@ +@import "../../node_modules/reset-css/sass/_reset.scss"; +@import "../../node_modules/purecss/build/pure.css"; +@import "../../node_modules/font-awesome/scss/font-awesome.scss"; +@import "../../node_modules/selectize/dist/css/selectize.css"; +@import "../../node_modules/highlight.js/styles/zenburn.css"; + +/************* + * VARIABLES * + *************/ + +$lighYellow: "#fffdbf"; + +/************************************************************ + * GENERAL + ************************************************************/ +* { + margin: 0; + padding: 0; +} + +html, body { + height: 100%; +} + +body { + font-family: sans-serif; + line-height: 1.5; + min-height: 100%; +} + +.wrap { + width: 80%; + max-width: 1100px; + margin: auto; + position: relative; +} + +.left { + float: left; +} + +.right { + float: right; +} + +.center { + padding: auto; + text-align: center; +} + +.v-center { /*specify a height to center vertically*/ + display: table-cell; + vertical-align: middle; +} + +h1 { + margin: 1em 0; + font-size: 2em; + font-weight: 900; +} + +h2 { + margin: 1em 0; + font-size: 1.5em; + font-weight: 700; + color: #1c1c1c; + border-bottom: solid 1px #bbb; +} + +h3 { + font-weight: 500; + color: #2e3436; + padding: 0; + margin-top: 0; +} + +p { + padding: 0.5em 0; + margin-bottom: 1em; +} + +a { + color: midnightblue; + &:hover, + &:focus, + &.pure-menu-link:hover, + &.pure-menu-link:focus, + .pure-menu-selected &.pure-menu-link:hover, + .pure-menu-selected &.pure-menu-link:focus { + color: white; + background-color: #444444; + padding: .5em 1em; + } + &:hover, + &:focus { + padding: .15rem; + } +} + +.overflow { + overflow: hidden; +} + +ul { + padding-left: 1.5em; +} + +strong, b { + font-weight: bold; +} + +pre, code, kbd, samp, tt { + font-family: monospace, monospace; + font-size: .9rem; + //background-color: rgba(0, 0, 0, .1); + padding: 0 .2rem; +} + +/************************************************************ + * BUTTONS + ************************************************************/ +.code-box-title .clipboard-btn { + background-color: #f0f0f0; + border: 1px solid #ccc; + position: absolute; + right: 0; + height: inherit; + margin-top: -2em; + margin-right: 4px; +} + +.pure-button-red, +a.pure-button-red { + background-color: rgb(219, 1, 0); + color: #fff; + &:hover, &:focus { + background-color: #555; + padding: .5em 1em; + } +} + +.pure-button.hollow { + background-color: #FFFFFF; + color: #6f6f6f; + border: solid 1px #E6E6E6; +} + +.pure-button.hollow:hover { + background-image: none; +} + +.pure-button.hollow[disabled] { + cursor: auto; + opacity: initial; + pointer-events: auto; + -webkit-user-drag: auto; + -webkit-user-select: auto; + -moz-user-select: text; + -ms-user-select: text; + user-select: text; +} + +.pure-button.hljs { + display: inline-block; + border: 0; + background-color: transparent; + &:hover, &:focus { + background-color: #f0f0f0; + color: black; + } +} + +.pure-button-group .pure-button:first-child, +.pure-button-group .pure-button:last-child { + -webkit-border-radius: 0; + -moz-border-radius: 0; + border-radius: 0; +} + +.pure-button-group.two-elements .pure-button { + margin: 0; + line-height: unset; + border: 1px solid #E6E6E6; +} + +.pure-button-group.two-elements .pure-button:first-child { + border-right: none; +} + +.pure-button-group.two-elements .pure-button:last-child { + border-right: 1px solid #E6E6E6; +} + +.pure-button-group .pure-button.show-files { + max-width: 450px; + overflow: hidden; +} + +.top-right-corner { + position: absolute; + right: 1.75em; + +} + +/* *********************************************************** +SLIDING SIDE-MENU FOR SMALL SCREENS +************************************************************ */ +/* +Add transition to containers so they can push in and out. +*/ +#layout, +#menu, +#foot, +.menu-link { + -webkit-transition: all 0.2s ease-out; + -moz-transition: all 0.2s ease-out; + -ms-transition: all 0.2s ease-out; + -o-transition: all 0.2s ease-out; + transition: all 0.2s ease-out; +} + +/* +This is the parent `<div>` that contains the menu and the content area. +*/ +#layout.active #menu { + right: 11em; + width: 11em; +} + +/* +The `#menu` `<div>` is the parent `<div>` that contains the `.pure-menu` that +appears on the left side of the page. +*/ +#menu { + margin-right: -11em; /* "#menu" width */ + width: 11em; + position: fixed; + top: 0; + right: 0; + bottom: 0; + z-index: 1000; /* so the menu or its navicon stays above all content */ + background: $secondaryBackground; + overflow-y: auto; + -webkit-overflow-scrolling: touch; +} + +/* +All anchors inside the menu should be styled like this. +*/ +#menu a { + color: #ffffff; + border: none; + padding: 0.6em 0 0.6em 0.6em; +} + +/* +Remove all background/borders, since we are applying them to #menu. +*/ +#menu .pure-menu, +#menu .pure-menu ul { + border: none; + background: transparent; +} + +/* +Add that light border to separate items into groups. +*/ +#menu .pure-menu ul, +#menu .pure-menu .menu-item-divided { + border-top: 1px solid $transitionBackground; +} + +/* +This styles the selected menu item `<li>`. +*/ +#menu .pure-menu-selected, +#menu .pure-menu-heading { + background: $primaryBackground; + color: black; +} + +/* +This styles a link within a selected menu item `<li>`. +*/ +#menu .pure-menu-selected a { + color: #fff; +} + +/* +This styles the menu heading. +*/ +#menu .pure-menu-heading { + font-size: 110%; + color: #fff; + margin: 0; + text-transform: none; +} + +.frontpage-menu .pure-menu-item { + border-bottom: 1px solid lightgrey; +} + +.frontpage-menu .pure-menu-selected { + border-bottom: 1px solid black; + font-weight: bold; +} + +/* -- Dynamic Button For Responsive Menu -------------------------------------*/ + +/* +The button to open/close the Menu is custom-made and not part of Pure. Here's +how it works: +*/ + +/* +`.menu-link` represents the responsive menu toggle that shows/hides on +small screens. +*/ +.menu-link { + position: relative; + display: block; /* show this only on small screens */ + top: 0; + right: 0; /* "#menu width" */ + background: transparent; + z-index: 10; + height: 2rem; + padding: 2rem 0; + text-decoration: none; + &:hover, &:focus { + padding: 2rem 0; + background: none !important; + } +} + +.menu-link span:hover, +.menu-link span:focus { + color: rgba(1, 1, 1, 0.8); +} + +.menu-link span { + position: relative; + display: block; + color: #FFFFFF; +} + +.menu-link span, +.menu-link span:before, +.menu-link span:after { + background-color: transparent; +} + +/* -- Responsive Styles (Media Queries) ------------------------------------- */ + +@media screen and (max-width: 40em) { + #layout.active { + position: relative; + right: 11em; + /* moves to right as many ems as the one used by the menu */ + } + #menuLink.menu-link.active { + position: fixed; + right: 13em; + } + #foot.active { + margin-right: 11em; + } +} + +/* *********************************************************** +HEADER +************************************************************ */ +#header { + height: 6rem; + background: linear-gradient(141deg, $primaryBackground 0%, $transitionBackground 51%, $secondaryBackground 75%) +} + +.logo-header { + min-width: 8em; + height: 6rem; + max-width: 70%; +} + +#logo { + font-family: sans-serif; + font-size: 2.5em; + color: white; + text-shadow: 0 3px 2px rgba(83, 41, 0, 1); +} + +.simple { + font-weight: 300; +} + +.saml { + font-family: Verdana; + letter-spacing: -0.12em; + font-weight: 600; + margin-left: -0.05em; +} + +.language-menu { + font-family: FontAwesome, sans-serif; + min-width: 10rem; +} + +.language-bar { + height: 6rem; +} + +/* *********************************************************** +CONTENT +************************************************************ */ +#layout { + right: 0; + padding-right: 0; +} + +#content { + padding-top: 2em; + padding-bottom: 2rem; +} + +.message-box { + background-color: #f4f4f4; + border-left-color: #444444; + border-left-style: solid; + border-left-width: 0.3125rem; + box-shadow: 0 5px 8px -6px rgba(0, 0, 0, 0.2); + margin: 1rem 0; + padding: 1.3rem; + position: relative; +} + +.message-box.error { + background-color: #f7e4e1; + border-left-color: #cc4b37; +} + +.message-box.warning { + background-color: $lighYellow; + border-left-color: #f9f56b; +} + +.message-box.success { + background-color: #daf7e6; + border-left-color: #46cc48; +} + +.auth_methods { + margin-top: 2em; + width: 35%; +} + +.code-box { + margin-bottom: 1em; + border: 1px solid #ccc; + a { + padding: .5em; + } +} + +.code-box-content { + font-size: 1em; + line-height: 1.15; + padding: 0.5em 1em; + display: inline-block; + min-height: 1em; + max-height: 20em; + width: 100%; + height: 100%; + white-space: pre-wrap; + &::selection { + color: black; + background: $lighYellow; + } +} + +.code-box-title { + border-bottom: 1px solid #ccc; + background-color: #e0e0e0; + padding: 0.5em 0 0.5em 0.5em; +} + +pre#xmlmetadata { + width: 98%; +} + +/* *********************************************************** +FOOTER +************************************************************ */ +#layout { + min-height: 100%; + margin: 0 auto -6rem auto; /*negative margin = footer height + padding-top + padding-bottom*/ +} + +#bottom, #push { + height: 6rem; +} + +#footer { + width: 100%; + background: linear-gradient(141deg, $primaryBackground 0%, $transitionBackground 51%, $secondaryBackground 75%); + height: 4rem; + padding: 2rem 0 0; + text-align: center; + color: white; + + a, a:visited { + color: white; + &:hover, &:focus { + background-color: white; + color: black; + padding: .15rem; + margin-left: -.15rem; + margin-top: -.15rem; + text-decoration: none; + } + } +} + +.copyrights { + padding-top: .5rem; + height: 3.5rem; + font-size: .8rem; +} + +.logo-footer-right { + position: absolute; + right: 0; + top: 50%; + transform: translate(0, -50%); +} + +.logo-footer { + height: 4rem; +} + +/* *********************************************************** +FORMS +************************************************************ */ +.text-area { + margin-top: .5em; + width: 100%; + font-size: 0.9em; + line-height: 1.15; +} + +.file-upload input[type="url"][disabled] { + cursor: pointer; + color: inherit; +} + +input[type="file"] { + color: black; +} + +.form-align { + position: relative; +} + +.center-form { + display: inline-block; + margin-right: auto; + margin-left: auto; +} + +.v-center-right { + position: absolute; + left: 0; + top: 50%; + transform: translate(0, -50%); +} + +/* PURE */ +.pure-button, +.pure-form input.edge, +.pure-form textarea.edge { + -webkit-border-radius: 0; + -moz-border-radius: 0; + border-radius: 0; +} + +.pure-form-aligned .pure-controls { + margin: 0 0 0 11em; +} + +.pure-select { + float: right; +} + +/* SELECTIZE */ +.selectize-input, +.selectize-dropdown, +.selectize-input.dropdown-active { + -webkit-border-radius: 0; + -moz-border-radius: 0; + border-radius: 0; +} + +.selectize-input:after { + transform: translate(8px, 0); +} + +div .item { + float: left; +} + +.selectize-dropdown { + text-align: left; +} + +.selectize-control.single .selectize-input, .selectize-dropdown.single { + background-color: white; + background-image: none; + border: 1px solid #ccc; + box-shadow: inset 0 1px 3px #ddd; + box-sizing: border-box; + font-size: inherit; + padding: 0.5em 0.6em; + display: inline-block; + vertical-align: middle; +} + +.selectize-dropdown-content { + cursor: pointer; + .option { + &:hover, &:focus, &.active { + color: white; + background-color: #444444; + } + span.highlight { + color: black; + background-color: #fffbd5; + } + } +} + +/* *********************************************************** +IMAGES +************************************************************ */ +.fa { + font-family: FontAwesome !important; +} + +span.fa, i.fa { + padding: 0 0.5em; +} + +.message-box span.fa, +.message-box i.fa { + padding: 0; +} + +/* *********************************************************** +TABLES +************************************************************ */ +.pure-table-attributes { + table-layout: fixed; + width: 100%; +} + +.attrname { + text-align: right; +} + +.attrvalue { + overflow-wrap: break-word; +} + +table.attributes ul { + padding: inherit; +} + +/* *********************************************************** +MEDIA QUERIES +************************************************************ */ + +@media screen and (max-width: 40em) { + .pure-form .pure-input-sm-1-1 { + width: 100%; + } +} + +@media screen and (max-width: 40em) { + .wrap { + width: 90%; + } + .pure-form-aligned .pure-controls { + margin: 0.5em 0 0; + float: left; + } + #layout { + padding-top: 0; + margin-bottom: -4rem; + } + .auth_methods { + width: 60%; + } + #logo { + font-size: 1.8em; + } + #footer { + height: 2.5rem; + padding-top: 1.5rem; + .copyrights { + height: 1rem; + padding-top: 0; + } + } +} + +@media screen and (max-width: 0em), screen and (min-width: 40em) { + .show-for-small-only { + display: none !important; + } + .input-sm-placeholder { + display: inline-block; + } +} + +@media screen and (min-width: 40em) { + .hide-for-large { + display: none !important; + } +} + +@media screen and (max-width: 40em) { + .show-for-large { + display: none !important; + } +} + +/************************************************* + * Specifics for modules/core/frontpage* + ************************************************/ + +.float-r { + float: right; +} + +.enablebox table { + border: 1px solid #eee; + + margin-left: 1em; +} + +.enablebox.mini table { + float: right; +} + +.enablebox tr td { + padding: .5px 1em 1px .5em; + margin: 0; +} + +.enablebox { + font-size: 85%; +} + +.enablebox tr.enabled td { + background: #eee; +} + +.enablebox tr.disabled td { + background: #ccc; +} + +fieldset.fancyfieldset { + padding-left: 1.5em; + //margin: 2em 1em 1em 0; + //border: 1px solid #bbb; +} + +fieldset.fancyfieldset legend { + //margin-left: 2em; + padding: 3px 2em 3px 0; + //border: 1px solid #bbb; + width: 100%; +} + +dt { + font-weight: bold; +} + +.frontpage-menu { + margin-bottom: 1em; +} + +.entity-name, .entity-deprecated, .entity-expired { + font-weight: bold; +} + +.entity-expired { + color: #500; +} + +div.preferredidp { + border: 1px dashed #ccc; + background: #eee; + padding: 2px 2em 2px 2em; +} + + +/********* + * Utils * + *********/ + +.clear { + clear: both; +} + +.breathe-top { + margin-top: 1em; +} + +.expandable { + border: solid 1px #bbb; + width: 100%; + + .general { + padding: 1em; + } + .content { + display: none; + padding: 1em; + } + .expander { + cursor: pointer; + text-align: center; + padding: .25em; + display: block; + color: black; + &:focus, &:hover { + background-color: #555; + color: white; + } + &:after { + content: "\f078"; + font-family: FontAwesome; + } + } + + &.expanded { + .content { + display: block; + border-left: solid .25em #555; + border-right: solid .25em #555; + } + .expander { + border-bottom: none; + border-top: solid 1px #bbb; + border-left: solid .25em #555; + border-right: solid .25em #555; + &:after { + content: "\f077"; + } + } + } +} diff --git a/vendor/simplesamlphp/simplesamlphp/src/js/bundle.js b/vendor/simplesamlphp/simplesamlphp/src/js/bundle.js new file mode 100644 index 0000000000..2766b06fab --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/src/js/bundle.js @@ -0,0 +1,53 @@ +import "es6-shim"; +import ClipboardJS from "clipboard/dist/clipboard"; +import "selectize/dist/js/selectize"; +import hljs from "highlight.js/lib/highlight"; +import xml from "highlight.js/lib/languages/xml"; +import php from "highlight.js/lib/languages/php"; + +$(document).ready(function () { + // get available languages + let languages = $.map($('#language-selector option'), function (option) { + return option.text.toLowerCase(); + }); + + // initialize selectize + $('#language-selector').selectize({ + onChange: function () { + if (-1 !== $.inArray($('#language-selector-selectized').prev().text().toLowerCase(), languages)) { + $('#language-form').submit(); + } + }, + }); + + // side menu + $('#menuLink').click(function (e) { + e.preventDefault(); + $('#layout').toggleClass('active'); + $('#foot').toggleClass('active'); + $(this).toggleClass('active'); + }); + + // expander boxes + $('.expandable > .expander').on('click', function(e) { + e.preventDefault(); + let target = $(e.currentTarget); + target.parents('.expandable').toggleClass('expanded'); + target.blur(); + }); + + // syntax highlight + hljs.registerLanguage('xml', xml); + hljs.registerLanguage('php', php); + $('.code-box-content.xml, .code-box-content.php').each(function(i, block) { + hljs.highlightBlock(block) + }); + + // clipboard + let clipboard = new ClipboardJS('.copy'); + clipboard.on('success', function(e) { + setTimeout(function() { + e.clearSelection(); + }, 150); + }); +}); \ No newline at end of file diff --git a/vendor/simplesamlphp/simplesamlphp/src/js/style.js b/vendor/simplesamlphp/simplesamlphp/src/js/style.js new file mode 100644 index 0000000000..5c5cdfed31 --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/src/js/style.js @@ -0,0 +1 @@ +require('../css/default.scss'); diff --git a/vendor/simplesamlphp/simplesamlphp/templates/IFrameLogoutHandler.tpl.php b/vendor/simplesamlphp/simplesamlphp/templates/IFrameLogoutHandler.tpl.php new file mode 100644 index 0000000000..2a38f4bb86 --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/templates/IFrameLogoutHandler.tpl.php @@ -0,0 +1,16 @@ +<!DOCTYPE html> +<html> + <head> + <title>Logout response from <?= htmlspecialchars(var_export($this->data['assocId'])); ?></title> + <script> +<?php + if (array_key_exists('errorMsg', $this->data)) { + echo 'window.parent.logoutFailed("'.$this->data['spId'].'", "'.addslashes($this->data['errorMsg']).'");'; + } else { + echo 'window.parent.logoutCompleted("'.$this->data['spId'].'");'; + } +?> + </script> + </head> + <body></body> +</html> diff --git a/vendor/simplesamlphp/simplesamlphp/templates/IFrameLogoutHandler.twig b/vendor/simplesamlphp/simplesamlphp/templates/IFrameLogoutHandler.twig new file mode 100644 index 0000000000..ad4d4a6985 --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/templates/IFrameLogoutHandler.twig @@ -0,0 +1,16 @@ +<!DOCTYPE html> +<html> + <head> + <title>Logout response from {{ assocId|escape('html') }}</title> + <script> +{% if errorMsg is defined %} + window.parent.logoutFailed("{{ spId }}", "{{ errorMsg|escape }}"); +{% else %} + window.parent.logoutCompleted("{{ spId }}"); +{% endif %} + </script> + </head> + <body> + </body> +</html> + diff --git a/vendor/simplesamlphp/simplesamlphp/templates/_footer.twig b/vendor/simplesamlphp/simplesamlphp/templates/_footer.twig index f789441c15..a72a31c764 100644 --- a/vendor/simplesamlphp/simplesamlphp/templates/_footer.twig +++ b/vendor/simplesamlphp/simplesamlphp/templates/_footer.twig @@ -1,6 +1,13 @@ - <hr> - - <img src="/{{ baseurlpath }}resources/icons/ssplogo-fish-small.png" alt="Small fish logo" style="float: right"> - Copyright © 2007-2016 <a href="http://uninett.no/">UNINETT AS</a> - - <br style="clear: right"> + <div id="footer"> + <div class="wrap"> + <div class="center copyrights"> + © 2007-{{ year }} + <a href="https://simplesamlphp.org/">SimpleSAMLphp</a> + </div> + <div class="logo-footer-right show-for-large"> + <div class="logo-footer"> + <img class="pure-img" src="/{{ baseurlpath }}resources/icons/ssplogo-fish-small.png" alt="Small fish logo"> + </div> + </div> + </div> + </div> diff --git a/vendor/simplesamlphp/simplesamlphp/templates/_header.twig b/vendor/simplesamlphp/simplesamlphp/templates/_header.twig index 461dfd25d1..bc52df15e1 100644 --- a/vendor/simplesamlphp/simplesamlphp/templates/_header.twig +++ b/vendor/simplesamlphp/simplesamlphp/templates/_header.twig @@ -1,22 +1,81 @@ -<div id="header"> - <h1><a style="text-decoration: none; color: white" href="/{{ baseurlpath }}">{{ pagetitle }}</a></h1> -</div> + <div id="header"> + <div class="wrap"> + <div class="left"> + <div class="v-center logo-header"> + <div id="logo"> + {%- if header == 'SimpleSAMLphp' %} -{% if not hideLanguageBar %} -<div id="languagebar"> - {% for lang in languageBar %} - {%- if not loop.first -%}|{% endif -%} - {% if lang.url %} - <a href="{{ lang.url -}} - {%- if queryParams %}&{% endif -%} - {%- for name, value in queryParams -%} - {%- if not loop.first %}&{% endif -%} - {%- if value %}{{ name }}={{ value }}{% else %}{{ name }}{% endif -%} - {%- endfor %}">{{ lang.name }}</a> - {% else %} - {{ lang.name }} - {% endif %} + <span class="simple">Simple</span>{# -#} + <span class="saml">SAML</span>{# -#} + <span class="simple">php</span> + {%- else %} + + {{ header }} + {%- endif %} + + <img class="pure-img hidden" src="" alt="LOGO"> + </div> + </div> + </div> + {% if not hideLanguageBar -%} + <div class="right"> + <a href="" id="menuLink" class="menu-link hide-for-large"> + <span class="fa fa-globe fa-2x" aria-hidden="true"></span> + </a> + </div> + {% endif %} + {% if not hideLanguageBar -%} + <div id="languagebar" class="hide-for-large"> + <div id="menu"> + <div class="pure-menu"> + <ul class="pure-menu-list"> + {% for key, lang in languageBar -%} + {% if key == currentLanguage -%} + <li><a class="pure-menu-heading" href="#">{{ lang.name }}</a><li> + {% else -%} + {% if lang.url -%} + <li class="pure-menu-item"><a href="{{ lang.url }}{%- spaceless %} + {% if queryParams -%}&{% endif -%} + {% for name, value in queryParams -%} + {%- if not loop.first %}&{% endif -%} + {%- if value %}{{ name }}={{ value }}{% else %}{{ name }}{%- endif %} + {%- endfor %}"{% endspaceless %} class="pure-menu-link">{{ lang.name }}</a></li> + {% endif -%} + {% endif -%} + {% endfor -%} + </ul> + </div> + </div> + </div> + {%- endif -%} + <div class="right show-for-large"> + <div class="v-center language-bar"> + <form id="language-form" class="pure-form" method="get"> + {% if not hideLanguageBar -%} + <div id="languagebar"> + {% for name, value in queryParams -%} + {% if value -%} + <input type="hidden" name="{{ name }}" value="{{ value }}" /> + {%- else -%} + <input type="hidden" name="{{ name }}" /> + {%- endif -%} + {%- endfor %} + + <select class="pure-input-1-4 language-menu selectize" name="language" + id="language-selector"> + {% for key, lang in languageBar -%} + {% if key == currentLanguage -%} + <option value="{{ key }}" selected="selected"> {{ lang.name }}</option> + {% else -%} + <option value="{{ key }}">{{ lang.name }}</option> + {% endif -%} + {% endfor -%} + </select> + </div> + {% endif -%} + </form> + </div> <!--language-bar--> + </div><!--show-for-large--> + </div> <!-- wrap --> + </div> <!-- header --> - {% endfor %} -</div> -{% endif %} diff --git a/vendor/simplesamlphp/simplesamlphp/templates/_table.twig b/vendor/simplesamlphp/simplesamlphp/templates/_table.twig new file mode 100644 index 0000000000..6af434995d --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/templates/_table.twig @@ -0,0 +1,24 @@ + +<table id="table_with_attributes" class="attributes pure-table pure-table-striped pure-table-attributes" summary="attribute overview"> + +{% for name, values in items %} + <tr class="{{ cycle(['odd', 'even'], loop.index0) }}"> + {% block namecol -%} + <td class="attrname">{{ name }}</td> + {%- endblock %} + + <td class="attrvalue">{% spaceless %} + {% for value in values %} + {% if loop.length>1 and loop.first %}<ul>{% endif %} + {% if loop.length>1 %}<li>{% endif -%} + + {% block value %}{% endblock %} + + {% if loop.length>1 %}</li>{% endif %} + {% if loop.length>1 and loop.last %}</ul>{% endif %} + {% endfor %} + {% endspaceless -%} + </td> + </tr> +{% endfor %} +</table><br> diff --git a/vendor/simplesamlphp/simplesamlphp/templates/attributequery.php b/vendor/simplesamlphp/simplesamlphp/templates/attributequery.php index 9c84eaeb47..996d59edb3 100644 --- a/vendor/simplesamlphp/simplesamlphp/templates/attributequery.php +++ b/vendor/simplesamlphp/simplesamlphp/templates/attributequery.php @@ -2,28 +2,25 @@ $this->includeAtTemplateBase('includes/header.php'); $dataId = $this->data['dataId']; -assert('is_string($dataId)'); +assert(is_string($dataId)); $url = $this->data['url']; -assert('is_string($url)'); +assert(is_string($url)); $nameIdFormat = $this->data['nameIdFormat']; -assert('is_string($nameIdFormat)'); +assert(is_string($nameIdFormat)); $nameIdValue = $this->data['nameIdValue']; -assert('is_string($nameIdValue)'); +assert(is_string($nameIdValue)); $nameIdQualifier = $this->data['nameIdQualifier']; -assert('is_string($nameIdQualifier)'); +assert(is_string($nameIdQualifier)); $nameIdSPQualifier = $this->data['nameIdSPQualifier']; -assert('is_string($nameIdSPQualifier)'); - +assert(is_string($nameIdSPQualifier)); $attributes = $this->data['attributes']; -assert('is_null($attributes) || is_array($attributes)'); - - +assert($attributes === null || is_array($attributes)); ?> <h2>Attribute query test</h2> @@ -64,17 +61,16 @@ </form> <?php -if ($attributes !== NULL) { - - echo('<h3>Attributes received</h3><dl>'); - foreach ($attributes as $name => $values) { - echo('<dt>' . htmlspecialchars($name) . '</dt><dd><ul>'); - foreach ($values as $value) { - echo('<li>' . htmlspecialchars($value) . '</li>'); - } - echo('</dd>'); - } - echo('</dl>'); +if ($attributes !== null) { + echo '<h3>Attributes received</h3><dl>'; + foreach ($attributes as $name => $values) { + echo '<dt>'.htmlspecialchars($name).'</dt><dd><ul>'; + foreach ($values as $value) { + echo '<li>'.htmlspecialchars($value).'</li>'; + } + echo '</dd>'; + } + echo '</dl>'; } ?> diff --git a/vendor/simplesamlphp/simplesamlphp/templates/auth_status.twig b/vendor/simplesamlphp/simplesamlphp/templates/auth_status.twig new file mode 100644 index 0000000000..41b5f3fcae --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/templates/auth_status.twig @@ -0,0 +1,82 @@ +{% set pagetitle = 'Authentication status'|trans %} +{% extends 'base.twig' %} + +{% block content %} +<h2>{{ pagetitle }}</h2> + + <p>{% trans %}Hi, this is the status page of SimpleSAMLphp. Here you can see if your session is timed out, how long it lasts until it times out and all the attributes that are attached to your session.{% endtrans %}</p> + +{% if remaining %} + <p>{% trans %}Your session is valid for {{ remaining }} seconds from now.{% endtrans %}</p> +{% endif %} + + +<h2>{{ 'Your attributes'|trans }}</h2> + {% set items = attributes %} + +{% embed '_table.twig' -%} + + {% block namecol -%} + {% set attr = ('{attributes:attribute_'~(name|lower)~'}') %} + {% set translated = attr|trans %} + <td class="attrname">{% if translated != attr %} {{ translated }} <br>{% endif %} <samp>{{ name }}</samp></td> + {% endblock %} + + + {% block value -%} + {% if name =='jpegPhoto'-%} + <img src="data:image/jpeg;base64,{{ value }}" /> + {% else %}{{ value }}{% endif -%} + {% endblock %} + +{%- endembed %} + + +{% if nameid %} + <h2>{{ 'SAML Subject'|trans }}</h2> + + {% set items = {'NameId' : nameid.value} %} + + {% if not nameid.value %} + {% set items = items|merge({'NameID' : 'not set'|trans}) %} + {% endif %} + + {% if nameid.Format %} + {% set items = items|merge({('Format'|trans) : nameid.Format}) %} + {% endif %} + + {% if nameid.NameQualifier %} + {% set items = items|merge({'NameQualifier' : nameid.NameQualifier}) %} + {% endif %} + + {% if nameid.SPNameQualifier %} + {% set items = items|merge({'SPNameQualifier' : nameid.SPNameQualifier}) %} + {% endif %} + + {% if nameid.SPProvidedID %} + {% set items = items|merge({'SPProvidedID' : nameid.SPProvidedID}) %} + {% endif %} + + <table id="table_with_attributes" class="attributes pure-table pure-table-striped pure-table-attributes" summary="attribute overview"> + {% for name, value in items %} + <tr class="{{ cycle(['odd', 'even'], loop.index0) }}"> + <td class="attrname">{{ name }}</td> + <td class="attrvalue">{{ value }}</td> + </tr> + {% endfor %} + </table><br> + +{% endif %} + + +{% if logout %} + <h2>{% trans %}Logout{% endtrans %}</h2> + <p> {{ logout }}</p> +{% endif %} + +{% if logouturl %} + <div class="center"> + <a class="pure-button pure-button-red" href="{{ logouturl }}">{{ 'Logout'|trans }}</a> + </div> +{% endif %} +{% endblock %} diff --git a/vendor/simplesamlphp/simplesamlphp/templates/base.twig b/vendor/simplesamlphp/simplesamlphp/templates/base.twig index 249cb2e23c..29228797c3 100644 --- a/vendor/simplesamlphp/simplesamlphp/templates/base.twig +++ b/vendor/simplesamlphp/simplesamlphp/templates/base.twig @@ -1,53 +1,50 @@ <!DOCTYPE html> -<html> -<head> +<html lang="{{ currentLanguage }}" xml:lang="{{ currentLanguage }}"> + <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta name="viewport" content="initial-scale=1.0"> <title>{{ pagetitle }}</title> - <link rel="stylesheet" type="text/css" href="/{{ baseurlpath }}resources/default.css"> + <link rel="stylesheet" type="text/css" href="{{ asset("css/stylesheet.css") }}"> <link rel="icon" type="image/icon" href="/{{ baseurlpath }}resources/icons/favicon.ico"> - {% if jquery and jquery.css %} - <link rel="stylesheet" media="screen" type="text/css" href="/{{ baseurlpath }}resources/uitheme1.8/jquery-ui.css" /> + {% if isRTL %} + + <link rel="stylesheet" type="text/css" href="/{{ baseurlpath }}assets/css/src/default-rtl.css" /> {% endif %} - {% if isRTL %}<link rel="stylesheet" type="text/css" href="/{{ baseurlpath }}resources/default-rtl.css" />{% endif %} + <meta name="robots" content="noindex, nofollow"> - {% block preload %}{% endblock %} -</head> -<body> - <div id="wrap"> - - {% block header %}{% include "_header.twig" %}{% endblock %} - - <div id="content"> - {% block contentwrapper %} - {% block content %}{% endblock %} - {% endblock %} - </div><!-- #content --> - - <div id="footer"> - {% block footer %}{% include "_footer.twig" %}{% endblock %} - </div> - - </div><!-- #wrap --> - - <!-- postload javascript --> - <script type="text/javascript" src="/{{ baseurlpath }}resources/script.js"></script> - {% if jquery %} - {% set version = '1.8' %} - {% if jquery.version %} - {% set version = jquery.version %} - {% endif %} - {% if version == '1.8' %} - {% if jquery.core %} - <script type="text/javascript" src="/{{ baseurlpath }}resources/jquery-1.8.js"></script> - {% endif %} - {% if jquery.ui %} - <script type="text/javascript" src="/{{ baseurlpath }}resources/jquery-ui-1.8.js"></script> - {% endif %} - {% endif %} - {% endif %} - {% if clipboard %} - <script type="text/javascript" src="/{{ baseurlpath }}resources/clipboard.min.js"></script> - {% endif %} - {% block postload %}{% endblock %} -</body></html> + <link rel="preload" href="{{ asset('js/bundle.js') }}" as="script" /> + {%- block preload %}{% endblock %} + + </head> + <body id="{{ templateId }}"> + <div id="layout"> + {%- block header %}{% include "_header.twig" %}{% endblock %} + + <div id="content"> + <div class="wrap"> + {%- if not isProduction %} + + <div class="message-box warning"> + {% trans %}You are now accessing a pre-production system. This authentication setup + {#- #} is for testing and pre-production verification only. If someone sent you + {#- #} a link that pointed you here, and you are not <i>a tester</i> you + {#- #} probably got the wrong link, and should <b>not be here</b>.{% endtrans %} + </div> + {% endif -%} + {%- block contentwrapper %} + {%- block content %}{% endblock %} + {%- endblock contentwrapper %} + + </div> + </div><!-- content --> + <div id="push"></div> + </div><!-- layout --> + <div id="foot"> + {%- block footer %}{% include "_footer.twig" %}{% endblock %} + + </div> + <script src="{{ asset('js/bundle.js') }}"></script> + {%- block postload %}{% endblock %} + + </body> +</html> diff --git a/vendor/simplesamlphp/simplesamlphp/templates/error.php b/vendor/simplesamlphp/simplesamlphp/templates/error.php index fc0b145a0f..1acf83de34 100644 --- a/vendor/simplesamlphp/simplesamlphp/templates/error.php +++ b/vendor/simplesamlphp/simplesamlphp/templates/error.php @@ -68,7 +68,7 @@ <h2 style="clear: both"><?php echo $this->t('howto_header'); ?></h2> <p><?php echo $this->t('howto_text'); ?></p> <script type="text/javascript"> - var clipboard = new Clipboard('#btntrackid'); + var clipboard = new ClipboardJS('#btntrackid'); </script> <?php $this->includeAtTemplateBase('includes/footer.php'); diff --git a/vendor/simplesamlphp/simplesamlphp/templates/error.twig b/vendor/simplesamlphp/simplesamlphp/templates/error.twig new file mode 100644 index 0000000000..6468acee2e --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/templates/error.twig @@ -0,0 +1,58 @@ + +{% set pagetitle = dictTitle | trans %} +{% extends "base.twig" %} +{% block content %} + <h2>{{ dictTitle | trans }}</h2> + {{ dictDescr | trans(parameters) }} + + {# include optional information for error + Some exceptions set 'includeTemplate' to the name of a template to include. + e.g. "core:no_state.tpl.php". The format is "<module>:<template name>" + #} + {% if includeTemplate -%} + {% set parts = includeTemplate|replace({'.tpl.php':'.twig'})|split(':') %} + {% set namespacedTemplate = "@" ~ parts[0] ~ "/" ~ parts[1] %} + {% include(namespacedTemplate) %} + {%- endif %} + + <div class="message-box"> + <p>{{ '{errors:report_trackid}' | trans }}</p> + <div class="pure-button-group two-elements" role="group"> + <label class="pure-button hollow" disabled><pre id="trackid">{{ error.trackId }}</pre></label> + <button data-clipboard-target="#trackid" id="btntrackid" class="pure-button clipboard-btn copy"> + <i class="fa fa-copy"></i> + </button> + </div> + </div> + + {# print out exception only if the exception is available #} + {% if showerrors -%} + <h2>{{'{errors:debuginfo_header}' | trans}}</h2> + <p>{{'{errors:debuginfo_text}' | trans}}</p> + <div class="code-box code-box-content"> + <pre>{{ error.exceptionMsg }}<br />{{ error.exceptionTrace }} + </pre> + </div> + {%- endif %} + + {# Add error report submit section if we have a valid technical contact. 'errorreportaddress' will only be set if + the technical contact email address has been set. #} + {% if errorReportAddress -%} + <h2>{{ '{errors:report_header}' | trans }}</h2> + <form action="{{ errorReportAddress }}" class="pure-form" method="post"> + <p>{{ '{errors:report_text}' | trans }}</p> + <label for="email">{{ '{errors:report_email}' | trans }}</label> + <input type="email" name="email" id="email" class="edge" value="{{ email }}" /> + + <textarea class="text-area edge" name="text" rows="6" cols="50" placeholder="{{ '{errors:report_explain}' | trans }}" required></textarea> + <p class="center"> + <input type="hidden" name="reportId" value="{{ error.reportId }}" /> + <input type="submit" name="send" class="pure-button pure-button-red" value="{{ '{errors:report_submit}' | trans }}" /> + </p> + </form> + {%- endif %} + + <h2>{{ '{errors:howto_header}' | trans }}</h2> + <p>{{ '{errors:howto_text}' | trans }}</p> + +{% endblock %} diff --git a/vendor/simplesamlphp/simplesamlphp/templates/errorreport.php b/vendor/simplesamlphp/simplesamlphp/templates/errorreport.php index 278d483856..e1154fa8dd 100644 --- a/vendor/simplesamlphp/simplesamlphp/templates/errorreport.php +++ b/vendor/simplesamlphp/simplesamlphp/templates/errorreport.php @@ -1,9 +1,9 @@ <?php - $this->data['header'] = $this->t('errorreport_header'); - $this->includeAtTemplateBase('includes/header.php'); + $this->data['header'] = $this->t('errorreport_header'); + $this->includeAtTemplateBase('includes/header.php'); ?> - <h2><?php echo $this->t('errorreport_header'); ?></h2> <p><?php echo $this->t('errorreport_text'); ?></p> -<?php $this->includeAtTemplateBase('includes/footer.php'); +<?php + $this->includeAtTemplateBase('includes/footer.php'); diff --git a/vendor/simplesamlphp/simplesamlphp/templates/errorreport.twig b/vendor/simplesamlphp/simplesamlphp/templates/errorreport.twig new file mode 100644 index 0000000000..d491aaa8cd --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/templates/errorreport.twig @@ -0,0 +1,8 @@ +{% set pagetitle = 'Error report sent'|trans %} +{% extends "base.twig" %} + +{% block content %} + <h2>{{ pagetitle }}</h2> + + <p>{{ 'The error report has been sent to the administrators.' |trans }}</p> +{% endblock %} diff --git a/vendor/simplesamlphp/simplesamlphp/templates/hostnames.php b/vendor/simplesamlphp/simplesamlphp/templates/hostnames.php index 45ea32f7fd..2404638acc 100644 --- a/vendor/simplesamlphp/simplesamlphp/templates/hostnames.php +++ b/vendor/simplesamlphp/simplesamlphp/templates/hostnames.php @@ -3,7 +3,7 @@ $this->includeAtTemplateBase('includes/header.php'); $this->includeAtTemplateBase('includes/attributes.php'); -echo "<h2>" . $this->t('{core:frontpage:link_diagnostics}') . "</h2>"; +echo "<h2>".$this->t('{core:frontpage:link_diagnostics}')."</h2>"; $attributes = $this->data['attributes']; diff --git a/vendor/simplesamlphp/simplesamlphp/templates/hostnames.twig b/vendor/simplesamlphp/simplesamlphp/templates/hostnames.twig new file mode 100644 index 0000000000..79f6411f03 --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/templates/hostnames.twig @@ -0,0 +1,20 @@ +{% set pagetitle = 'Diagnostics on hostname, port and protocol'|trans %} +{% extends "base.twig" %} + +{% block content %} + <h2>{{ pagetitle }}</h2> + {% set items = attributes %} + + {% embed '_table.twig' %} + + {% block namecol %} + <td class="attrname"><samp>{{ name }}</samp></td> + {% endblock %} + + {% block value %} + {{ value }} + {% endblock %} + + {% endembed %} + +{% endblock %} diff --git a/vendor/simplesamlphp/simplesamlphp/templates/includes/attributes.php b/vendor/simplesamlphp/simplesamlphp/templates/includes/attributes.php index 79aae3130d..8894feb268 100644 --- a/vendor/simplesamlphp/simplesamlphp/templates/includes/attributes.php +++ b/vendor/simplesamlphp/simplesamlphp/templates/includes/attributes.php @@ -33,32 +33,32 @@ function present_assoc($attr) function present_eptid(\SimpleSAML\Locale\Translate $t, \SAML2\XML\saml\NameID $nameID) { - $eptid = array( - 'NameID' => array($nameID->value), - ); - if (!empty($nameID->Format)) { - $eptid[$t->t('{status:subject_format}')] = array($nameID->Format); + $eptid = [ + 'NameID' => [$nameID->getValue()], + ]; + if ($nameID->getFormat() !== null) { + $eptid[$t->t('{status:subject_format}')] = [$nameID->getFormat()]; } - if (!empty($nameID->NameQualifier)) { - $eptid['NameQualifier'] = array($nameID->NameQualifier); + if ($nameID->getNameQualifier() !== null) { + $eptid['NameQualifier'] = [$nameID->getNameQualifier()]; } - if (!empty($nameID->SPNameQualifier)) { - $eptid['SPNameQualifier'] = array($nameID->SPNameQualifier); + if ($nameID->getSPNameQualifier() !== null) { + $eptid['SPNameQualifier'] = [$nameID->getSPNameQualifier()]; } - if (!empty($nameID->SPProvidedID)) { - $eptid['SPProvidedID'] = array($nameID->SPProvidedID); + if ($nameID->getSPProvidedID() !== null) { + $eptid['SPProvidedID'] = [$nameID->getSPProvidedID()]; } return '<td class="attrvalue">'.present_assoc($eptid); } -function present_attributes(SimpleSAML_XHTML_Template $t, $attributes, $nameParent) +function present_attributes(\SimpleSAML\XHTML\Template $t, $attributes, $nameParent) { - $alternate = array('odd', 'even'); + $alternate = ['odd', 'even']; $i = 0; $parentStr = (strlen($nameParent) > 0) ? strtolower($nameParent).'_' : ''; $str = (strlen($nameParent) > 0) ? '<table class="attributes" summary="attribute overview">' : - '<table id="table_with_attributes" class="attributes" summary="attribute overview">'; + '<table id="table_with_attributes" class="attributes" summary="attribute overview">'; foreach ($attributes as $name => $value) { $nameraw = $name; @@ -78,7 +78,7 @@ function present_attributes(SimpleSAML_XHTML_Template $t, $attributes, $namePare if ($nameraw !== $name) { $str .= htmlspecialchars($name).'<br/>'; } - $str .= '<tt>'.htmlspecialchars($nameraw).'</tt>'; + $str .= '<code>'.htmlspecialchars($nameraw).'</code>'; $str .= '</td><td class="attrvalue"><ul>'; foreach ($value as $listitem) { if ($nameraw === 'jpegPhoto') { @@ -93,18 +93,18 @@ function present_attributes(SimpleSAML_XHTML_Template $t, $attributes, $namePare if ($nameraw !== $name) { $str .= htmlspecialchars($name).'<br/>'; } - $str .= '<tt>'.htmlspecialchars($nameraw).'</tt>'; + $str .= '<code>'.htmlspecialchars($nameraw).'</code>'; $str .= '</td>'; if ($nameraw === 'jpegPhoto') { $str .= '<td class="attrvalue"><img src="data:image/jpeg;base64,'.htmlspecialchars($value[0]). '" /></td></tr>'; } elseif (is_a($value[0], 'DOMNodeList')) { // try to see if we have a NameID here - /** @var DOMNodeList $value [0] */ + /** @var \DOMNodeList $value [0] */ $n = $value[0]->length; for ($idx = 0; $idx < $n; $idx++) { $elem = $value[0]->item($idx); - /* @var DOMElement $elem */ + /* @var \DOMElement $elem */ if (!($elem->localName === 'NameID' && $elem->namespaceURI === \SAML2\Constants::NS_SAML)) { continue; } diff --git a/vendor/simplesamlphp/simplesamlphp/templates/includes/expander.twig b/vendor/simplesamlphp/simplesamlphp/templates/includes/expander.twig new file mode 100644 index 0000000000..8096b91332 --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/templates/includes/expander.twig @@ -0,0 +1,11 @@ + <div class="expandable{% if expanded %} expanded{% endif %}"> + <div class="general"> + {%- block general%}{% endblock %} + + </div> + <a tabindex="0" class="expander"></a> + <div class="content"> + {%- block content %}{% endblock %} + + </div> + </div> \ No newline at end of file diff --git a/vendor/simplesamlphp/simplesamlphp/templates/includes/footer.php b/vendor/simplesamlphp/simplesamlphp/templates/includes/footer.php index 0ca7e12c11..58905b0dfb 100644 --- a/vendor/simplesamlphp/simplesamlphp/templates/includes/footer.php +++ b/vendor/simplesamlphp/simplesamlphp/templates/includes/footer.php @@ -1,22 +1,19 @@ <?php -if(!empty($this->data['htmlinject']['htmlContentPost'])) { - foreach($this->data['htmlinject']['htmlContentPost'] AS $c) { - echo $c; - } +if (!empty($this->data['htmlinject']['htmlContentPost'])) { + foreach ($this->data['htmlinject']['htmlContentPost'] as $c) { + echo $c; + } } ?> - </div><!-- #content --> - <div id="footer"> - <hr /> + </div><!-- #content --> + <div id="footer"> + <hr /> + <img src="/<?php echo $this->data['baseurlpath']; ?>resources/icons/ssplogo-fish-small.png" alt="Small fish logo" style="float: right" /> + Copyright © 2007-2019 <a href="http://uninett.no/">UNINETT AS</a> - <img src="/<?php echo $this->data['baseurlpath']; ?>resources/icons/ssplogo-fish-small.png" alt="Small fish logo" style="float: right" /> - Copyright © 2007-2017 <a href="http://uninett.no/">UNINETT AS</a> - - <br style="clear: right" /> - - </div><!-- #footer --> + <br style="clear: right" /> -</div><!-- #wrap --> - -</body> + </div><!-- #footer --> + </div><!-- #wrap --> + </body> </html> diff --git a/vendor/simplesamlphp/simplesamlphp/templates/includes/header-embed.php b/vendor/simplesamlphp/simplesamlphp/templates/includes/header-embed.php index 8749325021..5b83cbf7da 100644 --- a/vendor/simplesamlphp/simplesamlphp/templates/includes/header-embed.php +++ b/vendor/simplesamlphp/simplesamlphp/templates/includes/header-embed.php @@ -1,23 +1,24 @@ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <head> -<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> -<title><?php -if(array_key_exists('header', $this->data)) { - echo $this->data['header']; + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> + <title> +<?php +if (array_key_exists('header', $this->data)) { + echo $this->data['header']; } else { - echo 'SimpleSAMLphp'; + echo 'SimpleSAMLphp'; } -?></title> - - <link rel="stylesheet" type="text/css" href="/<?php echo $this->data['baseurlpath']; ?>resources/default.css" /> - <meta name="robots" content="noindex, nofollow" /> +?> + </title> + <link rel="stylesheet" type="text/css" href="/<?php echo $this->data['baseurlpath']; ?>resources/default.css" /> + <meta name="robots" content="noindex, nofollow" /> <?php -if(array_key_exists('head', $this->data)) { - echo '<!-- head -->' . $this->data['head'] . '<!-- /head -->'; +if (array_key_exists('head', $this->data)) { + echo '<!-- head -->'.$this->data['head'].'<!-- /head -->'; } ?> -</head> -<body class="body-embed"> + </head> + <body class="body-embed"> diff --git a/vendor/simplesamlphp/simplesamlphp/templates/includes/header.php b/vendor/simplesamlphp/simplesamlphp/templates/includes/header.php index 2b3365128c..119e6d1947 100644 --- a/vendor/simplesamlphp/simplesamlphp/templates/includes/header.php +++ b/vendor/simplesamlphp/simplesamlphp/templates/includes/header.php @@ -1,30 +1,29 @@ <?php - - /** * Support the htmlinject hook, which allows modules to change header, pre and post body on all pages. */ -$this->data['htmlinject'] = array( - 'htmlContentPre' => array(), - 'htmlContentPost' => array(), - 'htmlContentHead' => array(), -); - - -$jquery = array(); -if (array_key_exists('jquery', $this->data)) $jquery = $this->data['jquery']; +$this->data['htmlinject'] = [ + 'htmlContentPre' => [], + 'htmlContentPost' => [], + 'htmlContentHead' => [], +]; + +$jquery = []; +if (array_key_exists('jquery', $this->data)) { + $jquery = $this->data['jquery']; +} if (array_key_exists('pageid', $this->data)) { - $hookinfo = array( - 'pre' => &$this->data['htmlinject']['htmlContentPre'], - 'post' => &$this->data['htmlinject']['htmlContentPost'], - 'head' => &$this->data['htmlinject']['htmlContentHead'], - 'jquery' => &$jquery, - 'page' => $this->data['pageid'] - ); - - SimpleSAML\Module::callHooks('htmlinject', $hookinfo); + $hookinfo = [ + 'pre' => &$this->data['htmlinject']['htmlContentPre'], + 'post' => &$this->data['htmlinject']['htmlContentPost'], + 'head' => &$this->data['htmlinject']['htmlContentHead'], + 'jquery' => &$jquery, + 'page' => $this->data['pageid'] + ]; + + SimpleSAML\Module::callHooks('htmlinject', $hookinfo); } // - o - o - o - o - o - o - o - o - o - o - o - o - @@ -46,170 +45,168 @@ <meta name="viewport" content="initial-scale=1.0" /> <script type="text/javascript" src="/<?php echo $this->data['baseurlpath']; ?>resources/script.js"></script> <title><?php -if(array_key_exists('header', $this->data)) { - echo $this->data['header']; +if (array_key_exists('header', $this->data)) { + echo $this->data['header']; } else { - echo 'SimpleSAMLphp'; + echo 'SimpleSAMLphp'; } ?></title> - <link rel="stylesheet" type="text/css" href="/<?php echo $this->data['baseurlpath']; ?>resources/default.css" /> - <link rel="icon" type="image/icon" href="/<?php echo $this->data['baseurlpath']; ?>resources/icons/favicon.ico" /> + <link rel="stylesheet" type="text/css" href="/<?php echo $this->data['baseurlpath']; ?>resources/default.css" /> + <link rel="icon" type="image/icon" href="/<?php echo $this->data['baseurlpath']; ?>resources/icons/favicon.ico" /> <?php -if(!empty($jquery)) { - $version = '1.8'; - if (array_key_exists('version', $jquery)) - $version = $jquery['version']; - - if ($version == '1.8') { - if (isset($jquery['core']) && $jquery['core']) - echo('<script type="text/javascript" src="/' . $this->data['baseurlpath'] . 'resources/jquery-1.8.js"></script>' . "\n"); - - if (isset($jquery['ui']) && $jquery['ui']) - echo('<script type="text/javascript" src="/' . $this->data['baseurlpath'] . 'resources/jquery-ui-1.8.js"></script>' . "\n"); - - if (isset($jquery['css']) && $jquery['css']) - echo('<link rel="stylesheet" media="screen" type="text/css" href="/' . $this->data['baseurlpath'] . - 'resources/uitheme1.8/jquery-ui.css" />' . "\n"); - } +if (!empty($jquery)) { + $version = '1.8'; + if (array_key_exists('version', $jquery)) { + $version = $jquery['version']; + } + + if ($version == '1.8') { + if (isset($jquery['core']) && $jquery['core']) { + echo '<script type="text/javascript" src="/'.$this->data['baseurlpath'].'resources/jquery-1.8.js"></script>'."\n"; + } + + if (isset($jquery['ui']) && $jquery['ui']) { + echo '<script type="text/javascript" src="/'.$this->data['baseurlpath'].'resources/jquery-ui-1.8.js"></script>'."\n"; + } + + if (isset($jquery['css']) && $jquery['css']) { + echo '<link rel="stylesheet" media="screen" type="text/css" href="/'.$this->data['baseurlpath']. + 'resources/uitheme1.8/jquery-ui.css" />'."\n"; + } + } } if (isset($this->data['clipboard.js'])) { - echo '<script type="text/javascript" src="/'. $this->data['baseurlpath'] . - 'resources/clipboard.min.js"></script>'."\n"; + echo '<script type="text/javascript" src="/'.$this->data['baseurlpath'].'resources/clipboard.min.js"></script>'."\n"; } -if(!empty($this->data['htmlinject']['htmlContentHead'])) { - foreach($this->data['htmlinject']['htmlContentHead'] AS $c) { - echo $c; - } +if (!empty($this->data['htmlinject']['htmlContentHead'])) { + foreach ($this->data['htmlinject']['htmlContentHead'] as $c) { + echo $c; + } } - - - if ($this->isLanguageRTL()) { -?> - <link rel="stylesheet" type="text/css" href="/<?php echo $this->data['baseurlpath']; ?>resources/default-rtl.css" /> -<?php + ?> + <link rel="stylesheet" type="text/css" href="/<?php echo $this->data['baseurlpath']; ?>resources/default-rtl.css" /> +<?php } ?> + <meta name="robots" content="noindex, nofollow" /> - - <meta name="robots" content="noindex, nofollow" /> - - -<?php -if(array_key_exists('head', $this->data)) { - echo '<!-- head -->' . $this->data['head'] . '<!-- /head -->'; +<?php +if (array_key_exists('head', $this->data)) { + echo '<!-- head -->'.$this->data['head'].'<!-- /head -->'; } ?> </head> <?php $onLoad = ''; -if(array_key_exists('autofocus', $this->data)) { - $onLoad .= 'SimpleSAML_focus(\'' . $this->data['autofocus'] . '\');'; -} -if (isset($this->data['onLoad'])) { - $onLoad .= $this->data['onLoad']; -} - -if($onLoad !== '') { - $onLoad = ' onload="' . $onLoad . '"'; +if (array_key_exists('autofocus', $this->data)) { + $onLoad .= ' onload="SimpleSAML_focus(\''.$this->data['autofocus'].'\');"'; } ?> <body<?php echo $onLoad; ?>> <div id="wrap"> - - <div id="header"> - <h1><a href="/<?php echo $this->data['baseurlpath']; ?>"><?php - echo (isset($this->data['header']) ? $this->data['header'] : 'SimpleSAMLphp'); - ?></a></h1> - </div> - - - <?php - - $includeLanguageBar = TRUE; - if (!empty($_POST)) - $includeLanguageBar = FALSE; - if (isset($this->data['hideLanguageBar']) && $this->data['hideLanguageBar'] === TRUE) - $includeLanguageBar = FALSE; - - if ($includeLanguageBar) { - - $languages = $this->getLanguageList(); - if ( count($languages) > 1 ) { - echo '<div id="languagebar">'; - $langnames = array( - 'no' => 'Bokmål', // Norwegian Bokmål - 'nn' => 'Nynorsk', // Norwegian Nynorsk - 'se' => 'Sámegiella', // Northern Sami - 'da' => 'Dansk', // Danish - 'en' => 'English', - 'de' => 'Deutsch', // German - 'sv' => 'Svenska', // Swedish - 'fi' => 'Suomeksi', // Finnish - 'es' => 'Español', // Spanish - 'fr' => 'Français', // French - 'it' => 'Italiano', // Italian - 'nl' => 'Nederlands', // Dutch - 'lb' => 'Lëtzebuergesch', // Luxembourgish - 'cs' => 'Čeština', // Czech - 'sl' => 'Slovenščina', // Slovensk - 'lt' => 'Lietuvių kalba', // Lithuanian - 'hr' => 'Hrvatski', // Croatian - 'hu' => 'Magyar', // Hungarian - 'pl' => 'Język polski', // Polish - 'pt' => 'Português', // Portuguese - 'pt-br' => 'Português brasileiro', // Portuguese - 'ru' => 'русский язык', // Russian - 'et' => 'eesti keel', // Estonian - 'tr' => 'Türkçe', // Turkish - 'el' => 'ελληνικά', // Greek - 'ja' => '日本語', // Japanese - 'zh' => '简体中文', // Chinese (simplified) - 'zh-tw' => '繁體中文', // Chinese (traditional) - 'ar' => 'العربية', // Arabic - 'he' => 'עִבְרִית', // Hebrew - 'id' => 'Bahasa Indonesia', // Indonesian - 'sr' => 'Srpski', // Serbian - 'lv' => 'Latviešu', // Latvian - 'ro' => 'Românește', // Romanian - 'eu' => 'Euskara', // Basque - 'af' => 'Afrikaans', // Afrikaans - ); - - $textarray = array(); - foreach ($languages AS $lang => $current) { - $lang = strtolower($lang); - if ($current) { - $textarray[] = $langnames[$lang]; - } else { - $textarray[] = '<a href="' . htmlspecialchars(\SimpleSAML\Utils\HTTP::addURLParameters(\SimpleSAML\Utils\HTTP::getSelfURL(), array($this->getTranslator()->getLanguage()->getLanguageParameterName() => $lang))) . '">' . - $langnames[$lang] . '</a>'; - } - } - echo join(' | ', $textarray); - echo '</div>'; - } - - } - - - - ?> - <div id="content"> - + <div id="header"> + <h1><a href="/<?php echo $this->data['baseurlpath']; ?>"><?php + echo(isset($this->data['header']) ? $this->data['header'] : 'SimpleSAMLphp'); + ?></a></h1> + </div> + + + <?php + + $includeLanguageBar = true; + if (!empty($_POST)) { + $includeLanguageBar = false; + } + if (isset($this->data['hideLanguageBar']) && $this->data['hideLanguageBar'] === true) { + $includeLanguageBar = false; + } + + if ($includeLanguageBar) { + $languages = $this->getLanguageList(); + ksort($languages); + if (count($languages) > 1) { + echo '<div id="languagebar">'; + $langnames = [ + 'no' => 'Bokmål', // Norwegian Bokmål + 'nn' => 'Nynorsk', // Norwegian Nynorsk + 'se' => 'Sámegiella', // Northern Sami + 'da' => 'Dansk', // Danish + 'en' => 'English', + 'de' => 'Deutsch', // German + 'sv' => 'Svenska', // Swedish + 'fi' => 'Suomeksi', // Finnish + 'es' => 'Español', // Spanish + 'ca' => 'Català', // Catalan + 'fr' => 'Français', // French + 'it' => 'Italiano', // Italian + 'nl' => 'Nederlands', // Dutch + 'lb' => 'Lëtzebuergesch', // Luxembourgish + 'cs' => 'Čeština', // Czech + 'sl' => 'Slovenščina', // Slovensk + 'lt' => 'Lietuvių kalba', // Lithuanian + 'hr' => 'Hrvatski', // Croatian + 'hu' => 'Magyar', // Hungarian + 'pl' => 'Język polski', // Polish + 'pt' => 'Português', // Portuguese + 'pt-br' => 'Português brasileiro', // Portuguese + 'ru' => 'русский язык', // Russian + 'et' => 'eesti keel', // Estonian + 'tr' => 'Türkçe', // Turkish + 'el' => 'ελληνικά', // Greek + 'ja' => '日本語', // Japanese + 'zh' => '简体中文', // Chinese (simplified) + 'zh-tw' => '繁體中文', // Chinese (traditional) + 'ar' => 'العربية', // Arabic + 'he' => 'עִבְרִית', // Hebrew + 'id' => 'Bahasa Indonesia', // Indonesian + 'sr' => 'Srpski', // Serbian + 'lv' => 'Latviešu', // Latvian + 'ro' => 'Românește', // Romanian + 'eu' => 'Euskara', // Basque + 'af' => 'Afrikaans', // Afrikaans + 'zu' => 'IsiZulu', // Zulu + 'xh' => 'isiXhosa', // Xhosa + ]; + + $textarray = []; + foreach ($languages as $lang => $current) { + $lang = strtolower($lang); + if ($current) { + $textarray[] = $langnames[$lang]; + } else { + $textarray[] = '<a href="'.htmlspecialchars( + \SimpleSAML\Utils\HTTP::addURLParameters( + \SimpleSAML\Utils\HTTP::getSelfURL(), + [$this->getTranslator()->getLanguage()->getLanguageParameterName() => $lang] + ) + ).'">'.$langnames[$lang].'</a>'; + } + } + echo join(' | ', $textarray); + echo '</div>'; + } + } + + ?> + <div id="content"> <?php -if(!empty($this->data['htmlinject']['htmlContentPre'])) { - foreach($this->data['htmlinject']['htmlContentPre'] AS $c) { - echo $c; - } +if (!empty($this->data['htmlinject']['htmlContentPre'])) { + foreach ($this->data['htmlinject']['htmlContentPre'] as $c) { + echo $c; + } +} +$config = \SimpleSAML\Configuration::getInstance(); +if(! $config->getBoolean('production', true)) { + echo '<div class="caution">' . $this->t('{preprodwarning:warning:warning}'). '</div>'; } diff --git a/vendor/simplesamlphp/simplesamlphp/templates/index.twig b/vendor/simplesamlphp/simplesamlphp/templates/index.twig index 2a6004aa06..e80a9ad701 100644 --- a/vendor/simplesamlphp/simplesamlphp/templates/index.twig +++ b/vendor/simplesamlphp/simplesamlphp/templates/index.twig @@ -2,21 +2,21 @@ {% block content %} <div id="portalmenu" class="ui-tabs ui-widget ui-widget-content ui-corner-all"> <ul class="tabset_tabs ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all"> - <li class="ui-state-default ui-corner-top"><a href="http://simplesaml.arrakis.uninett.no/simplesaml/module.php/core/frontpage_welcome.php">Welcome</a></li> <li class="ui-state-default ui-corner-top ui-tabs-selected ui-state-active"><a href="#">Configuration</a></li> - <li class="ui-state-default ui-corner-top"><a href="http://simplesaml.arrakis.uninett.no/simplesaml/module.php/core/frontpage_auth.php">Authentication</a></li> - <li class="ui-state-default ui-corner-top"><a href="http://simplesaml.arrakis.uninett.no/simplesaml/module.php/core/frontpage_federation.php">Federation</a></li> + <li class="ui-state-default ui-corner-top"><a href="/{{ baseurlpath }}module.php/core/frontpage_auth.php">Authentication</a></li> + <li class="ui-state-default ui-corner-top"><a href="/{{ baseurlpath }}module.php/core/frontpage_federation.php">Federation</a></li> </ul> + <a class='float-r' href='{{ logouturl }}'>{{ '{core:frontpage:logout}'|trans }}</a> <div id="portalcontent" class="ui-tabs-panel ui-widget-content ui-corner-bottom"> <div style="clear: both" class="enablebox mini"> <table> <tr class="disabled"><td>SAML 2.0 IdP</td> - <td><img src="/{{ baseurlpath }}resources/icons/silk/delete.png" alt="disabled" /></td></tr> + <td><i class="fa fa-ban"></i></td></tr> <tr class="disabled"><td>Shib 1.3 IdP</td> - <td><img src="/{{ baseurlpath }}resources/icons/silk/delete.png" alt="disabled" /></td></tr> + <td><i class="fa fa-ban"></i></td></tr> </table> </div> diff --git a/vendor/simplesamlphp/simplesamlphp/templates/login-ldapmulti.php b/vendor/simplesamlphp/simplesamlphp/templates/login-ldapmulti.php index 6f73d5a5d2..a53da3ebed 100644 --- a/vendor/simplesamlphp/simplesamlphp/templates/login-ldapmulti.php +++ b/vendor/simplesamlphp/simplesamlphp/templates/login-ldapmulti.php @@ -1,74 +1,64 @@ <?php - $this->includeAtTemplateBase('includes/header.php'); + $this->includeAtTemplateBase('includes/header.php'); ?> +<?php +if (isset($this->data['error'])) { +?> + <div style="border-left: 1px solid #e8e8e8; border-bottom: 1px solid #e8e8e8; background: #f5f5f5"> + <img src="/<?php echo $this->data['baseurlpath']; ?>resources/icons/experience/gtk-dialog-error.48x48.png" class="float-l erroricon" style="margin: 15px" alt="" /> + <h2><?php echo $this->t('error_header'); ?></h2> + + <p class="logintext"><?php echo htmlspecialchars($this->data['error']); ?> </p> + </div> +<?php +} +?> + <h2 style="break: both"><?php echo $this->t('user_pass_header'); ?></h2> + + <p><?php echo $this->t('user_pass_text'); ?></p> - <?php if (isset($this->data['error'])) { ?> - <div style="border-left: 1px solid #e8e8e8; border-bottom: 1px solid #e8e8e8; background: #f5f5f5"> - <img src="/<?php echo $this->data['baseurlpath']; ?>resources/icons/experience/gtk-dialog-error.48x48.png" class="float-l erroricon" style="margin: 15px" alt="" /> - <h2><?php echo $this->t('error_header'); ?></h2> - - <p class="logintext"><?php echo htmlspecialchars($this->data['error']); ?> </p> - </div> - <?php } ?> - - <h2 style="break: both"><?php echo $this->t('user_pass_header'); ?></h2> - - <p> - <?php echo $this->t('user_pass_text'); ?> - </p> - - <form action="?" method="post" name="f"> + <form action="?" method="post" name="f"> - <table> - <tr> - <td rowspan="3"><img src="/<?php echo $this->data['baseurlpath']; ?>resources/icons/experience/gtk-dialog-authentication.48x48.png" id="loginicon" alt="" /></td> - <td style="padding: .3em;"><?php echo $this->t('username'); ?></td> - <td><input type="text" tabindex="1" name="username" - <?php if (isset($this->data['username'])) { - echo 'value="' . htmlspecialchars($this->data['username']) . '"'; - } ?> /></td> + <table> + <tr> + <td rowspan="3"><img src="/<?php echo $this->data['baseurlpath']; ?>resources/icons/experience/gtk-dialog-authentication.48x48.png" id="loginicon" alt="" /></td> + <td style="padding: .3em;"><?php echo $this->t('username'); ?></td> + <td><input type="text" tabindex="1" name="username" +<?php +if (isset($this->data['username'])) { + echo 'value="'.htmlspecialchars($this->data['username']).'"'; +} +?> + /></td> + + <td style="padding: .4em;" rowspan="3"> + <button type="submit" tabindex="3" id="regularsubmit" class="btn"><?php echo $this->t('login_button'); ?></button> + <input type="hidden" name="RelayState" value="<?php echo htmlspecialchars($this->data['relaystate']); ?>" /> + </td> + </tr> + <tr> + <td style="padding: .3em;"><?php echo $this->t('organization'); ?></td> + <td><select name="org" tabindex="2"> +<?php +foreach ($this->data['ldapconfig'] as $key => $entry) { + echo '<option '.($key == $this->data['org'] ? 'selected="selected" ' : ''). + 'value="'.htmlspecialchars($key).'">'.htmlspecialchars($entry['description']).'</option>'; +} +?> + </select></td> + </tr> - - <td style="padding: .4em;" rowspan="3"> - <button type="submit" tabindex="3" id="regularsubmit" class="btn"><?php echo $this->t('login_button'); ?></button> - <input type="hidden" name="RelayState" value="<?php echo htmlspecialchars($this->data['relaystate']); ?>" /> - </td> - </tr> - - <tr> - <td style="padding: .3em;"><?php echo $this->t('organization'); ?></td> - <td><select name="org" tabindex="2"> - <?php - - foreach ($this->data['ldapconfig'] AS $key => $entry) { - echo '<option ' . - ($key == $this->data['org'] ? 'selected="selected" ' : '') - . 'value="' . htmlspecialchars($key) . '">' . htmlspecialchars($entry['description']) . '</option>'; - } - - ?> - </select></td> - </tr> - - <tr> - <td style="padding: .3em;"><?php echo $this->t('password'); ?></td> - <td><input type="password" tabindex="2" name="password" /></td> - </tr> - <tr><td></td><td> - <button type="submit" tabindex="5" id="mobilesubmit" class="btn"><?php echo $this->t('login_button'); ?></button> - </td></tr> - </table> - - - </form> - - - <h2 class="logintext"><?php echo $this->t('help_header'); ?>.</h2> - - - <p class="logintext"><?php echo $this->t('help_text'); ?>!</p> - - - -<?php $this->includeAtTemplateBase('includes/footer.php'); ?> + <tr> + <td style="padding: .3em;"><?php echo $this->t('password'); ?></td> + <td><input type="password" tabindex="2" name="password" /></td> + </tr> + <tr><td></td><td> + <button type="submit" tabindex="5" id="mobilesubmit" class="btn"><?php echo $this->t('login_button'); ?></button> + </td></tr> + </table> + </form> + <h2 class="logintext"><?php echo $this->t('help_header'); ?>.</h2> + <p class="logintext"><?php echo $this->t('help_text'); ?>!</p> +<?php + $this->includeAtTemplateBase('includes/footer.php'); diff --git a/vendor/simplesamlphp/simplesamlphp/templates/login.php b/vendor/simplesamlphp/simplesamlphp/templates/login.php index fc4e8b28dc..fd0755db98 100644 --- a/vendor/simplesamlphp/simplesamlphp/templates/login.php +++ b/vendor/simplesamlphp/simplesamlphp/templates/login.php @@ -1,71 +1,60 @@ <?php - if (!isset($this->data['autofocus'])) { - $this->data['autofocus'] = 'username'; - } - $this->includeAtTemplateBase('includes/header.php'); + if (!isset($this->data['autofocus'])) { + $this->data['autofocus'] = 'username'; + } + $this->includeAtTemplateBase('includes/header.php'); + if (isset($this->data['error'])) { ?> + <div style="border-left: 1px solid #e8e8e8; border-bottom: 1px solid #e8e8e8; background: #f5f5f5"> + <img src="/<?php echo $this->data['baseurlpath']; ?>resources/icons/experience/gtk-dialog-error.48x48.png" class="float-l erroricon" style="margin: 15px" alt="" /> + <h2><?php echo $this->t('error_header'); ?></h2> - <?php if (isset($this->data['error'])) { ?> - <div style="border-left: 1px solid #e8e8e8; border-bottom: 1px solid #e8e8e8; background: #f5f5f5"> - <img src="/<?php echo $this->data['baseurlpath']; ?>resources/icons/experience/gtk-dialog-error.48x48.png" class="float-l erroricon" style="margin: 15px" alt="" /> - <h2><?php echo $this->t('error_header'); ?></h2> - - <p><?php echo $this->t($this->data['error']); ?> </p> - </div> - <?php } ?> - - <h2 style="break: both"><?php echo $this->t('user_pass_header'); ?></h2> - - <p class="logintext"><?php echo $this->t('user_pass_text'); ?></p> - - <form action="?" method="post" name="f"> - - <table> - <tr> - <td rowspan="2"><img src="/<?php echo $this->data['baseurlpath']; ?>resources/icons/experience/gtk-dialog-authentication.48x48.png" id="loginicon" alt="" /></td> - <td style="padding: .3em;"><?php echo $this->t('username'); ?></td> - - - <td> - <?php - - if (array_key_exists('admin', $this->data)) { - echo '<strong style="font-size: medium">Administrator</strong>'; - } else { - - echo '<input type="text" id="username" tabindex="1" name="username" '; - if (isset($this->data['username'])) { - echo 'value="' . htmlspecialchars($this->data['username']) . '"'; - } - echo '/>'; - } - - - ?> - </td> + <p><?php echo $this->t($this->data['error']); ?> </p> + </div> +<?php +} +?> + <h2 style="break: both"><?php echo $this->t('user_pass_header'); ?></h2> + <p class="logintext"><?php echo $this->t('user_pass_text'); ?></p> - <td style="padding: .4em;" rowspan="2"> - <button type="submit" class="regularsubmit" tabindex="3" class="btn"><?php echo $this->t('login_button'); ?></button> - <input type="hidden" name="RelayState" value="<?php echo htmlspecialchars($this->data['relaystate']); ?>" /> - </td> - </tr> - <tr> - <td style="padding: .3em;"><?php echo $this->t('password'); ?></td> - <td><input id="password" type="password" tabindex="2" name="password" /></td> - </tr> - <tr><td></td><td></td><td> - <button type="submit" tabindex="5" id="mobilesubmit" class="btn"><?php echo $this->t('login_button'); ?></button> - </td></tr> - </table> - - - </form> - - - <h2 class="logintext"><?php echo $this->t('help_header'); ?></h2> - - - <p class="logintext"><?php echo $this->t('help_text'); ?></p> - + <form action="?" method="post" name="f"> -<?php $this->includeAtTemplateBase('includes/footer.php'); + <table> + <tr> + <td rowspan="2"><img src="/<?php echo $this->data['baseurlpath']; ?>resources/icons/experience/gtk-dialog-authentication.48x48.png" id="loginicon" alt="" /></td> + <td style="padding: .3em;"><?php echo $this->t('username'); ?></td> + <td> +<?php +if (array_key_exists('admin', $this->data)) { + echo '<strong style="font-size: medium">Administrator</strong>'; +} else { + echo '<input type="text" id="username" tabindex="1" name="username" '; + if (isset($this->data['username'])) { + echo 'value="'.htmlspecialchars($this->data['username']).'"'; + } + echo '/>'; +} +?> + </td> + <td style="padding: .4em;" rowspan="2"> + <button type="submit" class="regularsubmit" tabindex="3" class="btn"><?php echo $this->t('login_button'); ?></button> + <input type="hidden" name="RelayState" value="<?php echo htmlspecialchars($this->data['relaystate']); ?>" /> + </td> + </tr> + <tr> + <td style="padding: .3em;"><?php echo $this->t('password'); ?></td> + <td><input id="password" type="password" tabindex="2" name="password" /></td> + </tr> + <tr> + <td></td> + <td></td> + <td> + <button type="submit" tabindex="5" id="mobilesubmit" class="btn"><?php echo $this->t('login_button'); ?></button> + </td> + </tr> + </table> + </form> + <h2 class="logintext"><?php echo $this->t('help_header'); ?></h2> + <p class="logintext"><?php echo $this->t('help_text'); ?></p> +<?php + $this->includeAtTemplateBase('includes/footer.php'); diff --git a/vendor/simplesamlphp/simplesamlphp/templates/logout.php b/vendor/simplesamlphp/simplesamlphp/templates/logout.php index 0672ce7259..92ecd7ae4f 100644 --- a/vendor/simplesamlphp/simplesamlphp/templates/logout.php +++ b/vendor/simplesamlphp/simplesamlphp/templates/logout.php @@ -4,15 +4,13 @@ $this->includeAtTemplateBase('includes/header.php'); +echo '<h2>'.$this->data['header'].'</h2>'; +echo '<p>'.$this->t('{logout:logged_out_text}').'</p>'; - -echo('<h2>' . $this->data['header'] . '</h2>'); -echo('<p>' . $this->t('{logout:logged_out_text}') . '</p>'); - -if($this->getTranslator()->getTag($this->data['text']) !== NULL) { - $this->data['text'] = $this->t($this->data['text']); +if ($this->getTranslator()->getTag($this->data['text']) !== null) { + $this->data['text'] = $this->t($this->data['text']); } -echo('<p>[ <a href="' . htmlspecialchars($this->data['link']) . '">' . - htmlspecialchars($this->data['text']) . '</a> ]</p>'); +echo '<p>[ <a href="'.htmlspecialchars($this->data['link']).'">'. + htmlspecialchars($this->data['text']).'</a> ]</p>'; $this->includeAtTemplateBase('includes/footer.php'); diff --git a/vendor/simplesamlphp/simplesamlphp/templates/logout.twig b/vendor/simplesamlphp/simplesamlphp/templates/logout.twig new file mode 100644 index 0000000000..e860aff557 --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/templates/logout.twig @@ -0,0 +1,12 @@ +{% set pagetitle = 'Logged out'|trans %} +{% extends "base.twig" %} + +{% block content %} + <h1>{{ 'Logged out'|trans }}</h1> + <br> + <h3>{% trans %}You have been logged out.{% endtrans %}</h3> + <br> + {% if text %} + <p><a href="{{ link }}">{{ text|trans }}</a></p> + {% endif %} +{% endblock %} \ No newline at end of file diff --git a/vendor/simplesamlphp/simplesamlphp/templates/metadata-converter.php b/vendor/simplesamlphp/simplesamlphp/templates/metadata-converter.php index e784cea2e5..bc46d3a949 100644 --- a/vendor/simplesamlphp/simplesamlphp/templates/metadata-converter.php +++ b/vendor/simplesamlphp/simplesamlphp/templates/metadata-converter.php @@ -48,10 +48,10 @@ class="btn topright" style="margin-right: 0.5em;"> <?php for ($j = 1; $j <= $i; $j++) { ?> - var clipboard<?php echo $j; ?> = new Clipboard('#btn<?php echo $j; ?>'); + var clipboard<?php echo $j; ?> = new ClipboardJS('#btn<?php echo $j; ?>'); <?php } - ?> +?> </script> <?php } diff --git a/vendor/simplesamlphp/simplesamlphp/templates/metadata-converter.twig b/vendor/simplesamlphp/simplesamlphp/templates/metadata-converter.twig new file mode 100644 index 0000000000..d2d936537e --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/templates/metadata-converter.twig @@ -0,0 +1,50 @@ +{% set pagetitle = 'Metadata parser'|trans %} +{% extends "base.twig" %} + +{% set i=1 %} +{% block content %} + <h1>{{ pagetitle }}</h1> + <form method="post" class="pure-form" enctype="multipart/form-data"> + <h3> {% trans 'XML metadata' %}</h3> + <div class="pure-control-group"> + <textarea name="xmldata" rows="20" class="text-area edge">{{ xmldata }}</textarea> + </div> + <br> + <div class="center"> + <div class="pure-button-group two-elements" role="group"> + <label class="pure-button"> + <span class="fa fa-folder-open"></span>{{ 'or select a file:'|trans }} + <input type="file" name="xmlfile" class="hidden" multiple> + </label> + {#needs translation#} + <label id="show-file" class="pure-button hollow show-files" disabled>No file selected.</label> + </div> + <br> + <button class="pure-button pure-button-red pure-input-1-3">{{ 'Parse'|trans }}</button> + </div> + </form> + + {% if output -%} + <br> + <h2>{{ 'Converted metadata'|trans }}</h2> + {% for type, text in output if text -%} +{# spaceless is to work around a clipboard.js bug that would add extra whitespace #} +{% spaceless %} + <div class="code-box"> + <div class="code-box-title"> + <h3>{{ type }}</h3> + <button data-clipboard-target="#metadata{{ loop.index }}" id="btn{{ loop.index }}" class="pure-button right clipboard-btn copy"> + <i class="fa fa-copy"></i> + </button> + </div> + <div class="code-box-content"> + <pre id="metadata{{ loop.index }}">{{ text|escape }}</pre> + </div> + </div> +{% endspaceless %} + <br><br> + {%- set i=i+1 %} + {%- endfor -%} + {% endif -%} +{% endblock content -%} + diff --git a/vendor/simplesamlphp/simplesamlphp/templates/metadata.php b/vendor/simplesamlphp/simplesamlphp/templates/metadata.php index cd43769c24..c851afea27 100644 --- a/vendor/simplesamlphp/simplesamlphp/templates/metadata.php +++ b/vendor/simplesamlphp/simplesamlphp/templates/metadata.php @@ -4,7 +4,7 @@ <h2><?php echo $this->data['header']; ?></h2> <p><?php echo $this->t('metadata_intro'); ?></p> <?php if (isset($this->data['metaurl'])) { ?> - <p><?php echo($this->t('metadata_xmlurl', array('%METAURL%' => htmlspecialchars($this->data['metaurl'])))); ?></p> + <p><?php echo($this->t('metadata_xmlurl', ['%METAURL%' => htmlspecialchars($this->data['metaurl'])])); ?></p> <div class="input-group"> <pre id="metadataurl" class="input-left"><?php echo htmlspecialchars($this->data['metaurl']); ?></pre> <button data-clipboard-target="#metadataurl" id="btnurl" class="btnaddonright"> @@ -32,9 +32,9 @@ <pre id="phpmetadata"><?php echo $this->data['metadataflat']; ?></pre> </div> <script type="text/javascript"> - var clipboard1 = new Clipboard('#btnurl'), - clipboard2 = new Clipboard('#btnxml'), - clipboard3 = new Clipboard('#btnphp'); + var clipboard1 = new ClipboardJS('#btnurl'), + clipboard2 = new ClipboardJS('#btnxml'), + clipboard3 = new ClipboardJS('#btnphp'); </script> <?php if (array_key_exists('available_certs', $this->data)) { ?> @@ -50,8 +50,8 @@ if ($this->data['available_certs'][$certName]['certFingerprint'][0] === 'afe71c28ef740bc87425be13a2263d37971da1f9') { echo ' <img style="display: inline;" src="/'.$this->data['baseurlpath']. - 'resources/icons/silk/exclamation.png" alt="default certificate" />'. - 'This is the default certificate. Generate a new certificate if this is a production system.'; + 'resources/icons/silk/exclamation.png" alt="default certificate" />'. + 'This is the default certificate. Generate a new certificate if this is a production system.'; } echo '</li>'; } ?> diff --git a/vendor/simplesamlphp/simplesamlphp/templates/metadata.twig b/vendor/simplesamlphp/simplesamlphp/templates/metadata.twig new file mode 100644 index 0000000000..cac1051041 --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/templates/metadata.twig @@ -0,0 +1,54 @@ +{% set pagetile = 'SimpleSAMLphp Show Metadata'|trans %} +{% extends 'base.twig' %} +{% block content %} + <h2>{{ header }}</h2> + <p>{{ metadata_intro }}</p> + +{% if metaurl is defined %} + <p>{{ 'You can get the metadata xml on a dedicated URL:' | trans }}</p> + <div class="input-group"> + <pre id="metadataurl" class="input-left">{{ metaurl }}</pre> + <button data-clipboard-target="#metadataurl" id="btnurl" class="pure-button right clipboard-btn copy"> + <span class="fa fa-copy"></span> + </button> + </div> +{% endif %} + + <h2>{{ 'Metadata' | trans }}</h2> + <div class="code-box"> + <div class="code-box-title"> + <p>{{ 'In SAML 2.0 Metadata XML format:' | trans }}</p> + <button data-clipboard-target="#xmlmetadata" id="btnxml" class="pure-button right clipboard-btn copy"> + <span class="fa fa-copy"></span> + </button> + </div> + <div class="code-box-content"> + <pre id="xmlmetadata">{{ metadata | raw }}</pre> + </div> + </div> + + <div class="code-box"> + <div class="code-box-title"> + <p>{{ 'In SimpleSAMLphp flat file format - use this if you are using a SimpleSAMLphp entity on the other side:' | trans }}</p> + <button data-clipboard-target="#phpmetadata" id="btnphp" class="pure-button right clipboard-btn copy"> + <span class="fa fa-copy"></span> + </button> + </div> + <div class="code-box-content"> + <pre id="phpmetadata">{{ metadataflat | raw }}</pre> + </div> + </div> + +{% if certdata is defined %} + <h2>{{ 'Certificates' |trans }}</h2> + <p>{{ 'Download the X509 certificates as PEM-encoded files.' |trans }}</p> + + <ul> + {% for cert in certdata %} + <li><a href="{{ cert.url }}">{{ cert.name }}</a> {{ cert.comment }}</li> + {% endfor %} + </ul> + +{% endif %} + +{% endblock content %} diff --git a/vendor/simplesamlphp/simplesamlphp/templates/post.php b/vendor/simplesamlphp/simplesamlphp/templates/post.php index e8c6c256fe..e8aeaa12d2 100644 --- a/vendor/simplesamlphp/simplesamlphp/templates/post.php +++ b/vendor/simplesamlphp/simplesamlphp/templates/post.php @@ -4,9 +4,8 @@ <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>POST data</title> - <script type="text/javascript" src="/<?php echo $this->data['baseurlpath']; ?>resources/post.js"></script> - <link - type="text/css" rel="stylesheet" href="/<?php echo $this->data['baseurlpath']; ?>resources/post.css" /> + <script src="/<?php echo $this->data['baseurlpath']; ?>resources/post.js"></script> + <link type="text/css" rel="stylesheet" href="/<?php echo $this->data['baseurlpath']; ?>resources/post.css" /> </head> <body> @@ -28,13 +27,13 @@ $post = $this->data['post']; } else { // For backwards compatibility - assert('array_key_exists("response", $this->data)'); - assert('array_key_exists("RelayStateName", $this->data)'); - assert('array_key_exists("RelayState", $this->data)'); - $post = array( + assert(array_key_exists('response', $this->data)); + assert(array_key_exists('RelayStateName', $this->data)); + assert(array_key_exists('RelayState', $this->data)); + $post = [ 'SAMLResponse' => $this->data['response'], $this->data['RelayStateName'] => $this->data['RelayState'], - ); + ]; } /** @@ -47,18 +46,19 @@ * @param string $name The name of the element. * @param string|array $value The value of the element. */ -function printItem($name, $value) { - assert('is_string($name)'); - assert('is_string($value) || is_array($value)'); +function printItem($name, $value) +{ + assert(is_string($name)); + assert(is_string($value) || is_array($value)); if (is_string($value)) { - echo '<input type="hidden" name="' . - htmlspecialchars($name) . '" value="' . - htmlspecialchars($value) . '" />'; + echo '<input type="hidden" name="'. + htmlspecialchars($name).'" value="'. + htmlspecialchars($value).'" />'; return; } // This is an array... foreach ($value as $index => $item) { - printItem($name . '[' . $index . ']', $item); + printItem($name.'['.$index.']', $item); } } @@ -66,11 +66,10 @@ function printItem($name, $value) { printItem($name, $value); } ?> - <noscript> <button type="submit" class="btn">Submit</button> </noscript> </form> </body> -</html> \ No newline at end of file +</html> diff --git a/vendor/simplesamlphp/simplesamlphp/templates/sandbox.twig b/vendor/simplesamlphp/simplesamlphp/templates/sandbox.twig index 316c855cfb..1ff8134fd7 100644 --- a/vendor/simplesamlphp/simplesamlphp/templates/sandbox.twig +++ b/vendor/simplesamlphp/simplesamlphp/templates/sandbox.twig @@ -15,17 +15,6 @@ </p> <h2>Localization</h2> {% set variable = 'Hello, Untranslated World!' %} - <p>SimpleSAMLphp lets you choose which translation backend to choose, thanks to the - <code>language.i18n.backend</code> configuration option. Two possible values are supported there: - </p> - <ul> - <li><code>SimpleSAMLphp</code>: to keep using the old SimpleSAMLphp translation system. This is the - default, and will disappear as an option in SimpleSAMLphp 2.0.</li> - <li><code>gettext/gettext</code>: to use a <em>gettext</em> implementation written entirely in PHP, allowing - you to use any locale, no matter if they are installed on the system or not.</li> - </ul> - <p>Note that <code>gettext/gettext</code> <strong>will become the default</strong> in SimpleSAMLphp 2.0. - Currently, you are using the following backend: <code>{{ localeBackend }}</code>.</p> <p>This page is written in english only, but the examples used here are translated to several languages. The current language is <strong>{{ currentLanguage }}</strong>. Change to other languages to see the examples change.</p> <h4>Usage examples</h4> diff --git a/vendor/simplesamlphp/simplesamlphp/templates/selectidp-dropdown.php b/vendor/simplesamlphp/simplesamlphp/templates/selectidp-dropdown.php index ebe7646b48..4fa03d6ff0 100644 --- a/vendor/simplesamlphp/simplesamlphp/templates/selectidp-dropdown.php +++ b/vendor/simplesamlphp/simplesamlphp/templates/selectidp-dropdown.php @@ -7,20 +7,21 @@ $this->data['autofocus'] = 'dropdownlist'; $this->includeAtTemplateBase('includes/header.php'); +$translator = $this->getTranslator(); foreach ($this->data['idplist'] as $idpentry) { if (!empty($idpentry['name'])) { - $this->getTranslator()->includeInlineTranslation( + $translator->includeInlineTranslation( 'idpname_'.$idpentry['entityid'], $idpentry['name'] ); } elseif (!empty($idpentry['OrganizationDisplayName'])) { - $this->getTranslator()->includeInlineTranslation( + $translator->includeInlineTranslation( 'idpname_'.$idpentry['entityid'], $idpentry['OrganizationDisplayName'] ); } if (!empty($idpentry['description'])) { - $this->getTranslator()->includeInlineTranslation('idpdesc_'.$idpentry['entityid'], $idpentry['description']); + $translator->includeInlineTranslation('idpdesc_'.$idpentry['entityid'], $idpentry['description']); } } ?> @@ -33,21 +34,12 @@ value="<?php echo htmlspecialchars($this->data['returnIDParam']); ?>"/> <select id="dropdownlist" name="idpentityid"> <?php - /* - * TODO: change this to use $this instead when PHP 5.4 is the minimum requirement. - * - * This is a dirty hack because PHP 5.3 does not allow the use of $this inside closures. Therefore, the - * translation function must be passed somehow inside the closure. PHP 5.4 allows using $this, so we can - * then go back to the previous behaviour. - */ - $GLOBALS['__t'] = $this; - usort($this->data['idplist'], function ($idpentry1, $idpentry2) { - return strcmp( - $GLOBALS['__t']->t('idpname_'.$idpentry1['entityid']), - $GLOBALS['__t']->t('idpname_'.$idpentry2['entityid']) + usort($this->data['idplist'], function($idpentry1, $idpentry2) { + return strcasecmp( + $this->t('idpname_'.$idpentry1['entityid']), + $this->t('idpname_'.$idpentry2['entityid']) ); }); - unset($GLOBALS['__t']); foreach ($this->data['idplist'] as $idpentry) { echo '<option value="'.htmlspecialchars($idpentry['entityid']).'"'; diff --git a/vendor/simplesamlphp/simplesamlphp/templates/selectidp-dropdown.twig b/vendor/simplesamlphp/simplesamlphp/templates/selectidp-dropdown.twig new file mode 100644 index 0000000000..22b8f22206 --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/templates/selectidp-dropdown.twig @@ -0,0 +1,31 @@ +{% set pagetitle = "Select your identity provider"|trans %} +{% extends "base.twig" %} + +{% block content %} + <h2>{{ pagetitle }}</h2> + + <p>{{ "Please select the identity provider where you want to authenticate:" | trans }}</p> + <form method="get" action="{{ urlpattern }}" class="pure-form"> + <input type="hidden" name="entityID" value="{{ entityID }}"> + <input type="hidden" name="return" value="{{ return }}"> + <input type="hidden" name="returnIDParam" value="{{ returnIDParam }}"> + <div class="pure-control-group"> + <select id="dropdownlist" name="idpentityid" autofocus> + {% for idpentry in idplist %} + <option value="{{ idpentry.entityid }}" + {% if idpentry.entityid == preferredidp %} + selected + {% endif %} + >{{ idpentry.name }}</option> + {% endfor %} + </select> + <button class="btn pure-button" type="submit">{{ 'Select' | trans }}</button> + </div> + {% if rememberenabled %} + <div class="pure-control-group"> + <input type="checkbox" name="remember" id="remember" value="1"> + <label for="remember">{{ 'Remember my choice' | trans }}</label> + </div> + {% endif %} + </form> +{% endblock %} diff --git a/vendor/simplesamlphp/simplesamlphp/templates/selectidp-links.php b/vendor/simplesamlphp/simplesamlphp/templates/selectidp-links.php index b8f2d6e3d8..6c4eabad3c 100644 --- a/vendor/simplesamlphp/simplesamlphp/templates/selectidp-links.php +++ b/vendor/simplesamlphp/simplesamlphp/templates/selectidp-links.php @@ -34,30 +34,39 @@ } ?></p> <?php - if (!empty($this->data['preferredidp']) && - array_key_exists($this->data['preferredidp'], $this->data['idplist']) - ) { - $idpentry = $this->data['idplist'][$this->data['preferredidp']]; - echo '<div class="preferredidp">'; - echo ' <img src="/'.$this->data['baseurlpath']. - 'resources/icons/experience/gtk-about.64x64.png" class="float-r" alt="'. - $this->t('icon_prefered_idp').'" />'; + usort($this->data['idplist'], function($idpentry1, $idpentry2) { + return strcasecmp( + $this->t('idpname_'.$idpentry1['entityid']), + $this->t('idpname_'.$idpentry2['entityid']) + ); + }); - if (array_key_exists('icon', $idpentry) && $idpentry['icon'] !== null) { - $iconUrl = \SimpleSAML\Utils\HTTP::resolveURL($idpentry['icon']); - echo '<img class="float-l" style="margin: 1em; padding: 3px; border: 1px solid #999" src="'. - htmlspecialchars($iconUrl).'" />'; - } - echo "\n".' <h3 style="margin-top: 8px">'. - htmlspecialchars($this->t('idpname_'.$idpentry['entityid'])).'</h3>'; + if (!empty($this->data['preferredidp'])) { + foreach ($this->data['idplist'] as $idpentry) { + if ($idpentry['entityid'] != $this->data['preferredidp']) { + continue; + } + echo '<div class="preferredidp">'; + echo ' <img src="/'.$this->data['baseurlpath']. + 'resources/icons/experience/gtk-about.64x64.png" class="float-r" alt="'. + $this->t('icon_prefered_idp').'" />'; - if (!empty($idpentry['description'])) { - echo ' <p>'.htmlspecialchars($this->t('idpdesc_'.$idpentry['entityid'])).'<br />'; + if (array_key_exists('icon', $idpentry) && $idpentry['icon'] !== null) { + $iconUrl = \SimpleSAML\Utils\HTTP::resolveURL($idpentry['icon']); + echo '<img class="float-l" style="margin: 1em; padding: 3px; border: 1px solid #999" src="'. + htmlspecialchars($iconUrl).'" />'; + } + echo "\n".' <h3 style="margin-top: 8px">'. + htmlspecialchars($this->t('idpname_'.$idpentry['entityid'])).'</h3>'; + + if (!empty($idpentry['description'])) { + echo ' <p>'.htmlspecialchars($this->t('idpdesc_'.$idpentry['entityid'])).'<br />'; + } + echo('<button id="preferredidp" type="submit" class="btn" name="idp_'. + htmlspecialchars($idpentry['entityid']).'">'. + $this->t('select').'</button></p>'); + echo '</div>'; } - echo('<button id="preferredidp" type="submit" class="btn" name="idp_'. - htmlspecialchars($idpentry['entityid']).'">'. - $this->t('select').'</button></p>'); - echo '</div>'; } foreach ($this->data['idplist'] as $idpentry) { @@ -65,7 +74,7 @@ if (array_key_exists('icon', $idpentry) && $idpentry['icon'] !== null) { $iconUrl = \SimpleSAML\Utils\HTTP::resolveURL($idpentry['icon']); echo '<img class="float-l" style="clear: both; margin: 1em; padding: 3px; border: 1px solid #999"'. - ' src="'.htmlspecialchars($iconUrl).'" />'; + ' src="'.htmlspecialchars($iconUrl).'" />'; } echo "\n".' <h3 style="margin-top: 8px">'.htmlspecialchars($this->t('idpname_'.$idpentry['entityid'])); echo '</h3>'; diff --git a/vendor/simplesamlphp/simplesamlphp/templates/selectidp-links.twig b/vendor/simplesamlphp/simplesamlphp/templates/selectidp-links.twig new file mode 100644 index 0000000000..a7bf1103fd --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/templates/selectidp-links.twig @@ -0,0 +1,45 @@ +{% set pagetitle = "Select your identity provider"|trans %} +{% extends "base.twig" %} + +{% block content %} + <h2>{{ pagetitle }}</h2> + + <p>{{ "Please select the identity provider where you want to authenticate:" | trans }}</p> + <form method="get" action="{{ urlpattern }}"> + <input type="hidden" name="entityID" value="{{ entityID }}"> + <input type="hidden" name="return" value="{{ return }}"> + <input type="hidden" name="returnIDParam" value="{{ returnIDParam }}"> + {% if rememberenabled %} + <p><input type="checkbox" name="remember" id="remember" value="1"> + <label for="remember">{{ 'Remember my choice' | trans }}</label></p> + {% endif %} + + {% for idpentry in idplist %} + {% if idpentry.entityid == preferredidp %} + <div class="preferredidp"> + {% if idpentry.iconurl %} + <img class="float-l" src="{{ idpentry.iconurl }}"> + {% endif %} + <h3><i class="fa fa-star"></i> {{ idpentry.name }}</h3> + {% if idpentry.description %} + <p>{{ idpentry.description }}</p> + {% endif %} + <button type="submit" class="btn" name="idp_{{ idpentry.entityid }}">{{'Select'|trans}}</button> + </div> + {% endif %} + {% endfor %} + + {% for idpentry in idplist %} + {% if idpentry.entityid != preferredidp %} + {% if idpentry.iconurl %} + <img class="float-l" src="{{ idpentry.iconurl }}"> + {% endif %} + <h3>{{ idpentry.name }}</h3> + {% if idpentry.description %} + <p>{{ idpentry.description }}</p> + {% endif %} + <button type="submit" class="btn" name="idp_{{ idpentry.entityid }}">{{'Select'|trans}}</button> + {% endif %} + {% endfor %} + </form> +{% endblock %} diff --git a/vendor/simplesamlphp/simplesamlphp/templates/status.php b/vendor/simplesamlphp/simplesamlphp/templates/status.php index 798b546acc..be24c273d2 100644 --- a/vendor/simplesamlphp/simplesamlphp/templates/status.php +++ b/vendor/simplesamlphp/simplesamlphp/templates/status.php @@ -8,65 +8,69 @@ $this->includeAtTemplateBase('includes/header.php'); $this->includeAtTemplateBase('includes/attributes.php'); ?> - <h2><?php if (isset($this->data['header'])) { - echo($this->data['header']); + echo $this->data['header']; } else { - echo($this->t('{status:some_error_occurred}')); + echo $this->t('{status:some_error_occurred}'); } ?></h2> - <p><?php echo($this->t('{status:intro}')); ?></p> + <p><?php echo $this->t('{status:intro}'); ?></p> <?php if (isset($this->data['remaining'])) { - echo('<p>'.$this->t('{status:validfor}', array('%SECONDS%' => $this->data['remaining'])).'</p>'); + echo '<p>'.$this->t('{status:validfor}', ['%SECONDS%' => $this->data['remaining']]).'</p>'; } if (isset($this->data['sessionsize'])) { - echo('<p>'.$this->t('{status:sessionsize}', array('%SIZE%' => $this->data['sessionsize'])).'</p>'); + echo '<p>'.$this->t('{status:sessionsize}', ['%SIZE%' => $this->data['sessionsize']]).'</p>'; } ?> - <h2><?php echo($this->t('{status:attributes_header}')); ?></h2> - + <h2><?php echo $this->t('{status:attributes_header}'); ?></h2> <?php - $attributes = $this->data['attributes']; -echo(present_attributes($this, $attributes, '')); +echo present_attributes($this, $attributes, ''); $nameid = $this->data['nameid']; if ($nameid !== false) { /** @var \SAML2\XML\saml\NameID $nameid */ echo "<h2>".$this->t('{status:subject_header}')."</h2>"; - if (is_null($nameid->value)) { - $list = array("NameID" => array($this->t('{status:subject_notset}'))); + if ($nameid->getValue() === null) { + $list = ["NameID" => [$this->t('{status:subject_notset}')]]; echo "<p>NameID: <span class=\"notset\">".$this->t('{status:subject_notset}')."</span></p>"; } else { - $list = array( - "NameId" => array($nameid->value), - ); - if (!is_null($nameid->Format)) { - $list[$this->t('{status:subject_format}')] = array($nameid->Format); + $list = [ + "NameId" => [$nameid->getValue()], + ]; + if ($nameid->getFormat() !== null) { + $list[$this->t('{status:subject_format}')] = [$nameid->getFormat()]; } - if (!is_null($nameid->NameQualifier)) { - $list['NameQualifier'] = array($nameid->NameQualifier); + if ($nameid->getNameQualifier() !== null) { + $list['NameQualifier'] = [$nameid->getNameQualifier()]; } - if (!is_null($nameid->SPNameQualifier)) { - $list['SPNameQualifier'] = array($nameid->SPNameQualifier); + if ($nameid->getSPNameQualifier() !== null) { + $list['SPNameQualifier'] = [$nameid->getSPNameQualifier()]; } - if (!is_null($nameid->SPProvidedID)) { - $list['SPProvidedID'] = array($nameid->SPProvidedID); + if ($nameid->getSPProvidedID() !== null) { + $list['SPProvidedID'] = [$nameid->getSPProvidedID()]; } } - echo(present_attributes($this, $list, '')); + echo present_attributes($this, $list, ''); } +$authData = $this->data['authData']; +if (!empty($authData)) { + echo "<h2>".$this->t('{status:authData_header}')."</h2>"; + echo '<details><summary>'.$this->t('{status:authData_summary}').'</summary>'; + echo '<pre>'.htmlspecialchars(json_encode($this->data['authData'], JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES)).'</pre>'; + echo '</details>'; +} if (isset($this->data['logout'])) { - echo('<h2>'.$this->t('{status:logout}').'</h2>'); - echo('<p>'.$this->data['logout'].'</p>'); + echo '<h2>'.$this->t('{status:logout}').'</h2>'; + echo '<p>'.$this->data['logout'].'</p>'; } if (isset($this->data['logouturl'])) { - echo('<a href="'.htmlspecialchars($this->data['logouturl']).'">'.$this->t('{status:logout}').'</a>'); + echo '<a href="'.htmlspecialchars($this->data['logouturl']).'">'.$this->t('{status:logout}').'</a>'; } $this->includeAtTemplateBase('includes/footer.php'); diff --git a/vendor/simplesamlphp/simplesamlphp/webpack.config.js b/vendor/simplesamlphp/simplesamlphp/webpack.config.js new file mode 100644 index 0000000000..2dff590d58 --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/webpack.config.js @@ -0,0 +1,95 @@ +const path = require('path'); +const webpack = require('webpack'); +const ExtractTextPlugin = require('extract-text-webpack-plugin'); +const CopyWebpackPlugin = require('copy-webpack-plugin'); + +const buildDir = __dirname + '/www/assets/'; + +const localConfig = { + css_filename: 'css/[name].css', + js_filename: 'js/[name].js' +}; + +module.exports = environment => { + const env = typeof environment !== 'undefined' ? environment : {}; + const primaryBackground = env.hasOwnProperty('primaryBackground') ? env.primaryBackground : '#b8002c'; + const transitionBackground = env.hasOwnProperty('transitionBackground') ? env.transitionBackground : '#db0100'; + const secondaryBackground = env.hasOwnProperty('secondaryBackground') ? env.secondaryBackground : '#e8410c'; + return { + entry: { + bundle: './src/js/bundle', + stylesheet: './src/js/style' + }, + output: { + path: path.resolve(buildDir), + filename: localConfig['js_filename'] + }, + mode: 'production', + module: { + rules: [ + { + test: /\.js$/, + exclude: /\/node_modules\//, + use: { + loader: 'babel-loader' + } + }, + { + test: /\.scss$/, + use: ExtractTextPlugin.extract({ + fallback: 'style-loader', + use: [ + { + loader: 'css-loader', + options: { + url: false, + sourceMap: true + } + }, + { + loader: 'sass-loader', + options: { + indentedSyntax: false, + sourceMap: true, + data: "$primaryBackground: " + primaryBackground + '; ' + + "$transitionBackground: " + transitionBackground + "; " + + "$secondaryBackground: " + secondaryBackground + ";" + } + } + ] + }) + }, + { + // expose jquery for use outside webpack bundle + test: require.resolve('jquery'), + use: [{ + loader: 'expose-loader', + options: 'jQuery' + }, { + loader: 'expose-loader', + options: '$' + }] + } + ] + }, + devtool: 'source-map', + plugins: [ + // Provides jQuery for other JS bundled with Webpack + new webpack.ProvidePlugin({ + $: 'jquery', + jQuery: 'jquery' + }), + new ExtractTextPlugin({ + filename: localConfig['css_filename'], + ignoreOrder: true + }), + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname + '/node_modules/font-awesome/fonts/*'), + to: 'fonts/', + flatten: true + } + ]) + ] + } +}; diff --git a/vendor/simplesamlphp/simplesamlphp/www/_include.php b/vendor/simplesamlphp/simplesamlphp/www/_include.php index d8117ee18a..1960627f87 100644 --- a/vendor/simplesamlphp/simplesamlphp/www/_include.php +++ b/vendor/simplesamlphp/simplesamlphp/www/_include.php @@ -1,58 +1,28 @@ <?php -/** - * Disable magic quotes if they are enabled. - */ -function removeMagicQuotes() -{ - if (get_magic_quotes_gpc()) { - foreach (array('_GET', '_POST', '_COOKIE', '_REQUEST') as $a) { - if (isset($$a) && is_array($$a)) { - foreach ($$a as &$v) { - // we don't use array-parameters anywhere. Ignore any that may appear - if (is_array($v)) { - continue; - } - // unescape the string - $v = stripslashes($v); - } - } - } - } - if (get_magic_quotes_runtime()) { - set_magic_quotes_runtime(false); - } -} - -if (version_compare(PHP_VERSION, '5.4.0', '<')) { - removeMagicQuotes(); -} - // initialize the autoloader require_once(dirname(dirname(__FILE__)).'/lib/_autoload.php'); // enable assertion handler for all pages -SimpleSAML_Error_Assertion::installHandler(); +\SimpleSAML\Error\Assertion::installHandler(); // show error page on unhandled exceptions function SimpleSAML_exception_handler($exception) { - SimpleSAML\Module::callHooks('exception_handler', $exception); + \SimpleSAML\Module::callHooks('exception_handler', $exception); - if ($exception instanceof SimpleSAML_Error_Error) { + if ($exception instanceof \SimpleSAML\Error\Error) { $exception->show(); - } elseif ($exception instanceof Exception) { - $e = new SimpleSAML_Error_Error('UNHANDLEDEXCEPTION', $exception); + } elseif ($exception instanceof \Exception) { + $e = new \SimpleSAML\Error\Error('UNHANDLEDEXCEPTION', $exception); $e->show(); - } else { - if (class_exists('Error') && $exception instanceof Error) { - $code = $exception->getCode(); - $errno = ($code > 0) ? $code : E_ERROR; - $errstr = $exception->getMessage(); - $errfile = $exception->getFile(); - $errline = $exception->getLine(); - SimpleSAML_error_handler($errno, $errstr, $errfile, $errline); - } + } elseif (class_exists('Error') && $exception instanceof \Error) { + $code = $exception->getCode(); + $errno = ($code > 0) ? $code : E_ERROR; + $errstr = $exception->getMessage(); + $errfile = $exception->getFile(); + $errline = $exception->getLine(); + SimpleSAML_error_handler($errno, $errstr, $errfile, $errline); } } @@ -61,16 +31,7 @@ function SimpleSAML_exception_handler($exception) // log full backtrace on errors and warnings function SimpleSAML_error_handler($errno, $errstr, $errfile = null, $errline = 0, $errcontext = null) { - if (!class_exists('SimpleSAML\Logger')) { - /* We are probably logging a deprecation-warning during parsing. Unfortunately, the autoloader is disabled at - * this point, so we should stop here. - * - * See PHP bug: https://bugs.php.net/bug.php?id=47987 - */ - return false; - } - - if (SimpleSAML\Logger::isErrorMasked($errno)) { + if (\SimpleSAML\Logger::isErrorMasked($errno)) { // masked error return false; } @@ -83,7 +44,8 @@ function SimpleSAML_error_handler($errno, $errstr, $errfile = null, $errline = 0 } // show an error with a full backtrace - $e = new SimpleSAML_Error_Exception('Error '.$errno.' - '.$errstr); + $context = (is_null($errfile) ? '' : " at $errfile:$errline"); + $e = new \SimpleSAML\Error\Exception('Error '.$errno.' - '.$errstr.$context); $e->logError(); // resume normal error processing @@ -93,12 +55,12 @@ function SimpleSAML_error_handler($errno, $errstr, $errfile = null, $errline = 0 set_error_handler('SimpleSAML_error_handler'); try { - SimpleSAML_Configuration::getInstance(); -} catch (Exception $e) { + \SimpleSAML\Configuration::getInstance(); +} catch (\Exception $e) { throw new \SimpleSAML\Error\CriticalConfigurationError( $e->getMessage() ); } // set the timezone -SimpleSAML\Utils\Time::initTimezone(); +\SimpleSAML\Utils\Time::initTimezone(); diff --git a/vendor/simplesamlphp/simplesamlphp/www/admin/hostnames.php b/vendor/simplesamlphp/simplesamlphp/www/admin/hostnames.php index 90d58c3869..2948ef12da 100644 --- a/vendor/simplesamlphp/simplesamlphp/www/admin/hostnames.php +++ b/vendor/simplesamlphp/simplesamlphp/www/admin/hostnames.php @@ -2,30 +2,30 @@ require_once('../_include.php'); -// Load SimpleSAMLphp, configuration -$config = SimpleSAML_Configuration::getInstance(); -$session = SimpleSAML_Session::getSessionFromRequest(); +// Load SimpleSAMLphp configuration +$config = \SimpleSAML\Configuration::getInstance(); +$session = \SimpleSAML\Session::getSessionFromRequest(); // Check if valid local session exists.. -SimpleSAML\Utils\Auth::requireAdmin(); +\SimpleSAML\Utils\Auth::requireAdmin(); -$attributes = array(); +$attributes = []; -$attributes['HTTP_HOST'] = array($_SERVER['HTTP_HOST']); -$attributes['HTTPS'] = isset($_SERVER['HTTPS'])? array($_SERVER['HTTPS']) : array(); -$attributes['SERVER_PROTOCOL'] = array($_SERVER['SERVER_PROTOCOL']); -$attributes['SERVER_PORT'] = array($_SERVER['SERVER_PORT']); +$attributes['HTTP_HOST'] = [$_SERVER['HTTP_HOST']]; +$attributes['HTTPS'] = isset($_SERVER['HTTPS']) ? [$_SERVER['HTTPS']] : []; +$attributes['SERVER_PROTOCOL'] = [$_SERVER['SERVER_PROTOCOL']]; +$attributes['SERVER_PORT'] = [$_SERVER['SERVER_PORT']]; -$attributes['getBaseURL()'] = array(\SimpleSAML\Utils\HTTP::getBaseURL()); -$attributes['getSelfHost()'] = array(\SimpleSAML\Utils\HTTP::getSelfHost()); -$attributes['getSelfHostWithNonStandardPort()'] = array(\SimpleSAML\Utils\HTTP::getSelfHostWithNonStandardPort()); -$attributes['selfURLhost()'] = array(\SimpleSAML\Utils\HTTP::getSelfURLHost()); -$attributes['selfURLNoQuery()'] = array(\SimpleSAML\Utils\HTTP::getSelfURLNoQuery()); -$attributes['getSelfHostWithPath()'] = array(\SimpleSAML\Utils\HTTP::getSelfHostWithPath()); -$attributes['getFirstPathElement()'] = array(\SimpleSAML\Utils\HTTP::getFirstPathElement()); -$attributes['selfURL()'] = array(\SimpleSAML\Utils\HTTP::getSelfURL()); +$attributes['getBaseURL()'] = [\SimpleSAML\Utils\HTTP::getBaseURL()]; +$attributes['getSelfHost()'] = [\SimpleSAML\Utils\HTTP::getSelfHost()]; +$attributes['getSelfHostWithNonStandardPort()'] = [\SimpleSAML\Utils\HTTP::getSelfHostWithNonStandardPort()]; +$attributes['selfURLhost()'] = [\SimpleSAML\Utils\HTTP::getSelfURLHost()]; +$attributes['selfURLNoQuery()'] = [\SimpleSAML\Utils\HTTP::getSelfURLNoQuery()]; +$attributes['getSelfHostWithPath()'] = [\SimpleSAML\Utils\HTTP::getSelfHostWithPath()]; +$attributes['getFirstPathElement()'] = [\SimpleSAML\Utils\HTTP::getFirstPathElement()]; +$attributes['selfURL()'] = [\SimpleSAML\Utils\HTTP::getSelfURL()]; -$template = new SimpleSAML_XHTML_Template($config, 'hostnames.php'); +$template = new \SimpleSAML\XHTML\Template($config, 'hostnames.php'); $template->data['remaining'] = $session->getAuthData('admin', 'Expire') - time(); $template->data['attributes'] = $attributes; diff --git a/vendor/simplesamlphp/simplesamlphp/www/admin/index.php b/vendor/simplesamlphp/simplesamlphp/www/admin/index.php index a1f9558e14..2541aa1d01 100644 --- a/vendor/simplesamlphp/simplesamlphp/www/admin/index.php +++ b/vendor/simplesamlphp/simplesamlphp/www/admin/index.php @@ -2,26 +2,30 @@ require_once('../_include.php'); -// Load SimpleSAMLphp, configuration -$config = SimpleSAML_Configuration::getInstance(); -$session = SimpleSAML_Session::getSessionFromRequest(); +\SimpleSAML\Utils\HTTP::redirectTrustedURL(\SimpleSAML\Module::getModuleURL('admin/')); + +// Load SimpleSAMLphp configuration +$config = \SimpleSAML\Configuration::getInstance(); +$session = \SimpleSAML\Session::getSessionFromRequest(); // Check if valid local session exists.. -//SimpleSAML\Utils\Auth::requireAdmin(); +\SimpleSAML\Utils\Auth::requireAdmin(); -$adminpages = array( +$adminpages = [ 'hostnames.php' => 'Diagnostics on hostname, port and protocol', 'phpinfo.php' => 'PHP info', '../module.php/sanitycheck/index.php' => 'Sanity check of your SimpleSAMLphp setup', 'sandbox.php' => 'Sandbox for testing changes to layout and css', -); +]; + +$logouturl = \SimpleSAML\Utils\Auth::getAdminLogoutURL(); -$template = new SimpleSAML_XHTML_Template($config, 'index.php'); +$template = new \SimpleSAML\XHTML\Template($config, 'index.php'); $template->data['pagetitle'] = 'Admin'; $template->data['adminpages'] = $adminpages; $template->data['remaining'] = $session->getAuthData('admin', 'Expire') - time(); $template->data['valid'] = 'na'; -$template->data['logout'] = null; +$template->data['logouturl'] = $logouturl; $template->show(); diff --git a/vendor/simplesamlphp/simplesamlphp/www/admin/metadata-converter.php b/vendor/simplesamlphp/simplesamlphp/www/admin/metadata-converter.php index 52313f1b76..5ce928ac59 100644 --- a/vendor/simplesamlphp/simplesamlphp/www/admin/metadata-converter.php +++ b/vendor/simplesamlphp/simplesamlphp/www/admin/metadata-converter.php @@ -1,10 +1,11 @@ <?php + require_once('../_include.php'); // make sure that the user has admin access rights -SimpleSAML\Utils\Auth::requireAdmin(); +\SimpleSAML\Utils\Auth::requireAdmin(); -$config = SimpleSAML_Configuration::getInstance(); +$config = \SimpleSAML\Configuration::getInstance(); if (!empty($_FILES['xmlfile']['tmp_name'])) { $xmldata = trim(file_get_contents($_FILES['xmlfile']['tmp_name'])); @@ -14,26 +15,25 @@ if (!empty($xmldata)) { \SimpleSAML\Utils\XML::checkSAMLMessage($xmldata, 'saml-meta'); - $entities = SimpleSAML_Metadata_SAMLParser::parseDescriptorsString($xmldata); + $entities = \SimpleSAML\Metadata\SAMLParser::parseDescriptorsString($xmldata); // get all metadata for the entities foreach ($entities as &$entity) { - $entity = array( + $entity = [ 'shib13-sp-remote' => $entity->getMetadata1xSP(), 'shib13-idp-remote' => $entity->getMetadata1xIdP(), 'saml20-sp-remote' => $entity->getMetadata20SP(), 'saml20-idp-remote' => $entity->getMetadata20IdP(), - ); + ]; } // transpose from $entities[entityid][type] to $output[type][entityid] - $output = SimpleSAML\Utils\Arrays::transpose($entities); + $output = \SimpleSAML\Utils\Arrays::transpose($entities); // merge all metadata of each type to a single string which should be added to the corresponding file foreach ($output as $type => &$entities) { $text = ''; foreach ($entities as $entityId => $entityMetadata) { - if ($entityMetadata === null) { continue; } @@ -48,10 +48,10 @@ } } else { $xmldata = ''; - $output = array(); + $output = []; } -$template = new SimpleSAML_XHTML_Template($config, 'metadata-converter.php', 'admin'); +$template = new \SimpleSAML\XHTML\Template($config, 'metadata-converter.php', 'admin'); $template->data['clipboard.js'] = true; $template->data['xmldata'] = $xmldata; $template->data['output'] = $output; diff --git a/vendor/simplesamlphp/simplesamlphp/www/admin/phpinfo.php b/vendor/simplesamlphp/simplesamlphp/www/admin/phpinfo.php index 2b6b3d7cc5..eb46c93772 100644 --- a/vendor/simplesamlphp/simplesamlphp/www/admin/phpinfo.php +++ b/vendor/simplesamlphp/simplesamlphp/www/admin/phpinfo.php @@ -3,6 +3,6 @@ require_once('../_include.php'); // Make sure that the user has admin access rights -SimpleSAML\Utils\Auth::requireAdmin(); +\SimpleSAML\Utils\Auth::requireAdmin(); phpinfo(); diff --git a/vendor/simplesamlphp/simplesamlphp/www/admin/sandbox.php b/vendor/simplesamlphp/simplesamlphp/www/admin/sandbox.php index ec77569cf8..e2318bd187 100644 --- a/vendor/simplesamlphp/simplesamlphp/www/admin/sandbox.php +++ b/vendor/simplesamlphp/simplesamlphp/www/admin/sandbox.php @@ -2,18 +2,16 @@ require_once('../_include.php'); -// Load SimpleSAMLphp, configuration -$config = SimpleSAML_Configuration::getInstance(); -$session = SimpleSAML_Session::getSessionFromRequest(); - -// Check if valid local session exists.. -//SimpleSAML\Utils\Auth::requireAdmin(); - -$template = new SimpleSAML_XHTML_Template($config, 'sandbox.php'); +// Load SimpleSAMLphp configuration +$config = \SimpleSAML\Configuration::getInstance()->toArray(); +$config['usenewui'] = true; +$config = \SimpleSAML\Configuration::loadFromArray($config, '[ARRAY]', 'simplesaml'); +$session = \SimpleSAML\Session::getSessionFromRequest(); +$template = new \SimpleSAML\XHTML\Template($config, 'sandbox.php'); $template->data['pagetitle'] = 'Sandbox'; $template->data['sometext'] = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec a diam lectus. Sed sit amet ipsum mauris. Maecenas congue ligula ac quam viverra nec consectetur ante hendrerit. Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur.'; -$template->data['remaining'] = $session->getAuthData('admin', 'Expire') - time(); +$template->data['remaining'] = $session->getAuthData('admin', 'Expire') - time(); $template->data['logout'] = null; -$template->show(); +$template->send(); diff --git a/vendor/simplesamlphp/simplesamlphp/www/assets/css/.gitkeep b/vendor/simplesamlphp/simplesamlphp/www/assets/css/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/vendor/simplesamlphp/simplesamlphp/www/assets/css/src/default-rtl.css b/vendor/simplesamlphp/simplesamlphp/www/assets/css/src/default-rtl.css new file mode 100644 index 0000000000..3df1c9ce86 --- /dev/null +++ b/vendor/simplesamlphp/simplesamlphp/www/assets/css/src/default-rtl.css @@ -0,0 +1,174 @@ +/* these styles are in the head of this page because this is a unique page */ + +/* THE BIG GUYS */ +html { + direction: rtl; +} +#header{ + background: linear-gradient(-141deg, #b8002c 0%, #db0100 51%, #e8410c 75%); +} +#footer{ + background: linear-gradient(-141deg, #b8002c 0%, #db0100 51%, #e8410c 75%); +} +/* LISTS */ +ul { + margin: .3em 2em 1.5em 0; +} + +li { + margin-right: 2em; +} + +/* TYPOGRAPHY */ +dl dd { + margin-right: 3em; +} + +.efieldlist { + border-right: 1px solid #e6e6e6; +} + +div.caution { + padding: .2em 60px .2em .2em; + background-position: right; +} + +th.rowtitle { + text-align: right; +} +.enablebox table { + margin-right: 1em; +} +.enablebox.mini table { + float: left; +} +.enablebox tr td { + padding: .5px .5em 1px 1em; +} + +/* Attribute presentation in example page */ +table.attributes td.attrname { + text-align: left; +} + +fieldset.fancyfieldset { + margin: 2em 0px 1em 1em; +} +fieldset.fancyfieldset legend { + margin-right: 2em; +} + + +/* Reverse Float Left <-> Right */ +.right { + float: left; +} +.left { + float: right; +} +.v-center-right{ + right: 0; +} +.logo-footer-right{ + left:0; + right: auto; +} +.message-box { + border-left-style: initial; + order-left-width: 0; + border-left-color: none; + border-right-style: solid; + border-right-width: 0.3125rem; +} +.message-box.error{ + border-right-color: #cc4b37; +} +.message-box.success{ + border-right-color: #46cc48; +} +.code-box-title .clipboard-btn { + right: auto; + left: 0; + margin-left: 4px; + margin-right: auto; +} + +/*selectize elements*/ +div .item{ + float: right; +} +.selectize-input{ + padding-right:8px; +} +.selectize-input:after{ + transform: translate(-8px, 0); +} + +/*purecss elements*/ +.pure-form-aligned .pure-control-group label { + text-align: left; + margin: 0 0 0 1em; +} +@media only screen and (max-width : 480px) { + .pure-form-aligned .pure-control-group label { + text-align: right; + } +} +.pure-form-aligned .pure-controls { + margin: 1.5em 11em 0 0; +} +.pure-form .pure-help-inline, +.pure-form-message-inline { + padding-left: 0; + padding-right: 0.3em; +} +.pure-select{ + float: left; +} +.pure-table-attributes ul{ + margin:0; +} +.pure-table-attributes li{ + margin:0; +} + +/* language side menu on medium and small screens*/ +#layout.active #menu { + right: initial; + left: 11em; +} +#layout.active .menu-link { + right: initial; + left: 11em; +} +#menu { + right: initial; + margin-right: 0; + margin-left: -11em; /* "#menu" width */ + left: 0; +} +#menu a { + padding: 0.6em 0.6em 0.6em 0em; +} + +.menu-link { + right: initial; + left: 0; /* "#menu width" */ +} + +/* -- Responsive Styles (Media Queries) ------------------------------------- */ + +@media screen and (max-width: 0em), screen and (min-width: 40em) { + #layout.active { + right: auto; + left: 11em; + } + #menuLink.menu-link.active { + right: auto; + left: 13em; + } + #foot.active { + margin-right: auto; + margin-left: 11em; + } +} diff --git a/vendor/simplesamlphp/simplesamlphp/www/assets/fonts/.gitkeep b/vendor/simplesamlphp/simplesamlphp/www/assets/fonts/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/vendor/simplesamlphp/simplesamlphp/www/assets/js/.gitkeep b/vendor/simplesamlphp/simplesamlphp/www/assets/js/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/vendor/simplesamlphp/simplesamlphp/www/authmemcookie.php b/vendor/simplesamlphp/simplesamlphp/www/authmemcookie.php index d403aee138..9825c62f54 100644 --- a/vendor/simplesamlphp/simplesamlphp/www/authmemcookie.php +++ b/vendor/simplesamlphp/simplesamlphp/www/authmemcookie.php @@ -16,15 +16,15 @@ try { // load SimpleSAMLphp configuration - $globalConfig = SimpleSAML_Configuration::getInstance(); + $globalConfig = \SimpleSAML\Configuration::getInstance(); // check if this module is enabled if (!$globalConfig->getBoolean('enable.authmemcookie', false)) { - throw new SimpleSAML_Error_Error('NOACCESS'); + throw new \SimpleSAML\Error\Error('NOACCESS'); } // load Auth MemCookie configuration - $amc = SimpleSAML_AuthMemCookie::getInstance(); + $amc = \SimpleSAML\AuthMemCookie::getInstance(); $sourceId = $amc->getAuthSource(); $s = new \SimpleSAML\Auth\Simple($sourceId); @@ -33,19 +33,19 @@ $s->requireAuth(); // generate session id and save it in a cookie - $sessionID = SimpleSAML\Utils\Random::generateID(); + $sessionID = \SimpleSAML\Utils\Random::generateID(); $cookieName = $amc->getCookieName(); \SimpleSAML\Utils\HTTP::setCookie($cookieName, $sessionID); // generate the authentication information $attributes = $s->getAttributes(); - $authData = array(); + $authData = []; // username $usernameAttr = $amc->getUsernameAttr(); if (!array_key_exists($usernameAttr, $attributes)) { - throw new Exception( + throw new \Exception( "The user doesn't have an attribute named '".$usernameAttr. "'. This attribute is expected to contain the username." ); @@ -56,14 +56,14 @@ $groupsAttr = $amc->getGroupsAttr(); if ($groupsAttr !== null) { if (!array_key_exists($groupsAttr, $attributes)) { - throw new Exception( + throw new \Exception( "The user doesn't have an attribute named '".$groupsAttr. "'. This attribute is expected to contain the groups the user is a member of." ); } $authData['Groups'] = $attributes[$groupsAttr]; } else { - $authData['Groups'] = array(); + $authData['Groups'] = []; } $authData['RemoteIP'] = $_SERVER['REMOTE_ADDR']; @@ -96,11 +96,11 @@ $memcache->set($sessionID, $data, 0, $expirationTime); // register logout handler - $session = SimpleSAML_Session::getSessionFromRequest(); - $session->registerLogoutHandler($sourceId, 'SimpleSAML_AuthMemCookie', 'logoutHandler'); + $session = \SimpleSAML\Session::getSessionFromRequest(); + $session->registerLogoutHandler($sourceId, '\SimpleSAML\AuthMemCookie', 'logoutHandler'); // redirect the user back to this page to signal that the login is completed \SimpleSAML\Utils\HTTP::redirectTrustedURL(\SimpleSAML\Utils\HTTP::getSelfURL()); -} catch (Exception $e) { - throw new SimpleSAML_Error_Error('CONFIG', $e); +} catch (\Exception $e) { + throw new \SimpleSAML\Error\Error('CONFIG', $e); } diff --git a/vendor/simplesamlphp/simplesamlphp/www/errorreport.php b/vendor/simplesamlphp/simplesamlphp/www/errorreport.php index d99f313b99..0193e4767b 100644 --- a/vendor/simplesamlphp/simplesamlphp/www/errorreport.php +++ b/vendor/simplesamlphp/simplesamlphp/www/errorreport.php @@ -2,13 +2,13 @@ require_once('_include.php'); -$config = SimpleSAML_Configuration::getInstance(); +$config = \SimpleSAML\Configuration::getInstance(); // this page will redirect to itself after processing a POST request and sending the email if ($_SERVER['REQUEST_METHOD'] !== 'POST') { // the message has been sent. Show error report page - $t = new SimpleSAML_XHTML_Template($config, 'errorreport.php', 'errors'); + $t = new \SimpleSAML\XHTML\Template($config, 'errorreport.php', 'errors'); $t->show(); exit; } @@ -19,14 +19,14 @@ $data = null; try { - $session = SimpleSAML_Session::getSessionFromRequest(); + $session = \SimpleSAML\Session::getSessionFromRequest(); $data = $session->getData('core:errorreport', $reportId); -} catch (Exception $e) { - SimpleSAML\Logger::error('Error loading error report data: '.var_export($e->getMessage(), true)); +} catch (\Exception $e) { + \SimpleSAML\Logger::error('Error loading error report data: '.var_export($e->getMessage(), true)); } if ($data === null) { - $data = array( + $data = [ 'exceptionMsg' => 'not set', 'exceptionTrace' => 'not set', 'reportId' => $reportId, @@ -34,7 +34,7 @@ 'url' => 'not set', 'version' => $config->getVersion(), 'referer' => 'not set', - ); + ]; if (isset($session)) { $data['trackId'] = $session->getTrackID(); @@ -69,11 +69,11 @@ <p>Track ID:</p> <pre>%s</pre> -<p>Version: <tt>%s</tt></p> +<p>Version: <code>%s</code></p> -<p>Report ID: <tt>%s</tt></p> +<p>Report ID: <code>%s</code></p> -<p>Referer: <tt>%s</tt></p> +<p>Referer: <code>%s</code></p> <hr /> <div class="footer"> @@ -82,7 +82,7 @@ MESSAGE; $message = sprintf( $message, - htmlspecialchars($text), + $text, $data['exceptionMsg'], $data['exceptionTrace'], $data['url'], @@ -101,16 +101,27 @@ // check that it looks like a valid email address if (!preg_match('/\s/', $email) && strpos($email, '@') !== false) { $replyto = $email; - $from = $email; } else { $replyto = null; - $from = 'no-reply@simplesamlphp.org'; +} + +$from = $config->getString('sendmail_from', null); +if ($from === null || $from === '') { + $from = ini_get('sendmail_from'); + if ($from === '' || $from === false) { + $from = 'no-reply@example.org'; + } +} + +// If no sender email was configured at least set some relevant from address +if ($from === 'no-reply@example.org' && $replyto !== null) { + $from = $replyto; } // send the email $toAddress = $config->getString('technicalcontact_email', 'na@example.org'); if ($config->getBoolean('errorreporting', true) && $toAddress !== 'na@example.org') { - $email = new SimpleSAML_XHTML_EMail($toAddress, 'SimpleSAMLphp error report', $from); + $email = new \SimpleSAML\XHTML\EMail($toAddress, 'SimpleSAMLphp error report', $from); $email->setBody($message); $email->send(); SimpleSAML\Logger::error('Report with id '.$reportId.' sent to <'.$toAddress.'>.'); diff --git a/vendor/simplesamlphp/simplesamlphp/www/index.php b/vendor/simplesamlphp/simplesamlphp/www/index.php index 42344ed94e..d080b8af96 100644 --- a/vendor/simplesamlphp/simplesamlphp/www/index.php +++ b/vendor/simplesamlphp/simplesamlphp/www/index.php @@ -2,4 +2,10 @@ require_once('_include.php'); +$config = \SimpleSAML\Configuration::getInstance(); + +if ($config->getBoolean('usenewui', false)) { + \SimpleSAML\Utils\HTTP::redirectTrustedURL(SimpleSAML\Module::getModuleURL('core/login')); +} + \SimpleSAML\Utils\HTTP::redirectTrustedURL(SimpleSAML\Module::getModuleURL('core/frontpage_welcome.php')); diff --git a/vendor/simplesamlphp/simplesamlphp/www/logout.php b/vendor/simplesamlphp/simplesamlphp/www/logout.php index b87ca89b77..97c7d2b41b 100644 --- a/vendor/simplesamlphp/simplesamlphp/www/logout.php +++ b/vendor/simplesamlphp/simplesamlphp/www/logout.php @@ -2,7 +2,7 @@ require_once('_include.php'); -$config = SimpleSAML_Configuration::getInstance(); +$config = \SimpleSAML\Configuration::getInstance(); if (array_key_exists('link_href', $_REQUEST)) { $link = \SimpleSAML\Utils\HTTP::checkURLAllowed($_REQUEST['link_href']); @@ -16,7 +16,7 @@ $text = '{logout:default_link_text}'; } -$t = new SimpleSAML_XHTML_Template($config, 'logout.php'); +$t = new \SimpleSAML\XHTML\Template($config, 'logout.php'); $t->data['link'] = $link; $t->data['text'] = $text; $t->show(); diff --git a/vendor/simplesamlphp/simplesamlphp/www/module.php b/vendor/simplesamlphp/simplesamlphp/www/module.php index cb6b64ec65..83ee0ff382 100644 --- a/vendor/simplesamlphp/simplesamlphp/www/module.php +++ b/vendor/simplesamlphp/simplesamlphp/www/module.php @@ -1,171 +1,9 @@ <?php + /** - * Handler for module requests. - * * This web page receives requests for web-pages hosted by modules, and directs them to - * the RequestHandler in the module. - * - * @author Olav Morken, UNINETT AS. - * @package SimpleSAMLphp + * the process() handler in the Module class. */ - require_once('_include.php'); -// index pages - file names to attempt when accessing directories -$indexFiles = array('index.php', 'index.html', 'index.htm', 'index.txt'); - -// MIME types - key is file extension, value is MIME type -$mimeTypes = array( - 'bmp' => 'image/x-ms-bmp', - 'css' => 'text/css', - 'gif' => 'image/gif', - 'htm' => 'text/html', - 'html' => 'text/html', - 'shtml' => 'text/html', - 'ico' => 'image/vnd.microsoft.icon', - 'jpe' => 'image/jpeg', - 'jpeg' => 'image/jpeg', - 'jpg' => 'image/jpeg', - 'js' => 'text/javascript', - 'pdf' => 'application/pdf', - 'png' => 'image/png', - 'svg' => 'image/svg+xml', - 'svgz' => 'image/svg+xml', - 'swf' => 'application/x-shockwave-flash', - 'swfl' => 'application/x-shockwave-flash', - 'txt' => 'text/plain', - 'xht' => 'application/xhtml+xml', - 'xhtml' => 'application/xhtml+xml', -); - -if (empty($_SERVER['PATH_INFO'])) { - throw new SimpleSAML_Error_NotFound('No PATH_INFO to module.php'); -} - -$url = $_SERVER['PATH_INFO']; -assert('substr($url, 0, 1) === "/"'); - -/* clear the PATH_INFO option, so that a script can detect whether it is called with anything following the - *'.php'-ending. - */ -unset($_SERVER['PATH_INFO']); - -$modEnd = strpos($url, '/', 1); -if ($modEnd === false) { - // the path must always be on the form /module/ - throw new SimpleSAML_Error_NotFound('The URL must at least contain a module name followed by a slash.'); -} - -$module = substr($url, 1, $modEnd - 1); -$url = substr($url, $modEnd + 1); -if ($url === false) { - $url = ''; -} - -if (!SimpleSAML\Module::isModuleEnabled($module)) { - throw new SimpleSAML_Error_NotFound('The module \''.$module.'\' was either not found, or wasn\'t enabled.'); -} - -/* Make sure that the request isn't suspicious (contains references to current directory or parent directory or - * anything like that. Searching for './' in the URL will detect both '../' and './'. Searching for '\' will detect - * attempts to use Windows-style paths. - */ -if (strpos($url, '\\') !== false) { - throw new SimpleSAML_Error_BadRequest('Requested URL contained a backslash.'); -} elseif (strpos($url, './') !== false) { - throw new SimpleSAML_Error_BadRequest('Requested URL contained \'./\'.'); -} - -$moduleDir = SimpleSAML\Module::getModuleDir($module).'/www/'; - -// check for '.php/' in the path, the presence of which indicates that another php-script should handle the request -for ($phpPos = strpos($url, '.php/'); $phpPos !== false; $phpPos = strpos($url, '.php/', $phpPos + 1)) { - - $newURL = substr($url, 0, $phpPos + 4); - $param = substr($url, $phpPos + 4); - - if (is_file($moduleDir.$newURL)) { - /* $newPath points to a normal file. Point execution to that file, and - * save the remainder of the path in PATH_INFO. - */ - $url = $newURL; - $_SERVER['PATH_INFO'] = $param; - break; - } -} - -$path = $moduleDir.$url; - -if ($path[strlen($path) - 1] === '/') { - // path ends with a slash - directory reference. Attempt to find index file in directory - foreach ($indexFiles as $if) { - if (file_exists($path.$if)) { - $path .= $if; - break; - } - } -} - -if (is_dir($path)) { - /* Path is a directory - maybe no index file was found in the previous step, or maybe the path didn't end with - * a slash. Either way, we don't do directory listings. - */ - throw new SimpleSAML_Error_NotFound('Directory listing not available.'); -} - -if (!file_exists($path)) { - // file not found - SimpleSAML\Logger::info('Could not find file \''.$path.'\'.'); - throw new SimpleSAML_Error_NotFound('The URL wasn\'t found in the module.'); -} - -if (preg_match('#\.php$#D', $path)) { - // PHP file - attempt to run it - - /* In some environments, $_SERVER['SCRIPT_NAME'] is already set with $_SERVER['PATH_INFO']. Check for that case, - * and append script name only if necessary. - * - * Contributed by Travis Hegner. - */ - $script = "/$module/$url"; - if (stripos($_SERVER['SCRIPT_NAME'], $script) === false) { - $_SERVER['SCRIPT_NAME'] .= '/'.$module.'/'.$url; - } - - require($path); - exit(); -} - -// some other file type - attempt to serve it - -// find MIME type for file, based on extension -$contentType = null; -if (preg_match('#\.([^/\.]+)$#D', $path, $type)) { - $type = strtolower($type[1]); - if (array_key_exists($type, $mimeTypes)) { - $contentType = $mimeTypes[$type]; - } -} - -if ($contentType === null) { - /* We were unable to determine the MIME type from the file extension. Fall back to mime_content_type (if it - * exists). - */ - if (function_exists('mime_content_type')) { - $contentType = mime_content_type($path); - } else { - // mime_content_type doesn't exist. Return a default MIME type - SimpleSAML\Logger::warning('Unable to determine mime content type of file: '.$path); - $contentType = 'application/octet-stream'; - } -} - -$contentLength = sprintf('%u', filesize($path)); // force filesize to an unsigned number - -header('Content-Type: '.$contentType); -header('Content-Length: '.$contentLength); -header('Cache-Control: public,max-age=86400'); -header('Expires: '.gmdate('D, j M Y H:i:s \G\M\T', time() + 10 * 60)); -header('Last-Modified: '.gmdate('D, j M Y H:i:s \G\M\T', filemtime($path))); - -readfile($path); +\SimpleSAML\Module::process()->send(); diff --git a/vendor/simplesamlphp/simplesamlphp/www/resources/clipboard.min.js b/vendor/simplesamlphp/simplesamlphp/www/resources/clipboard.min.js index 69731a4d29..02c549e35c 100644 --- a/vendor/simplesamlphp/simplesamlphp/www/resources/clipboard.min.js +++ b/vendor/simplesamlphp/simplesamlphp/www/resources/clipboard.min.js @@ -1,7 +1,7 @@ /*! - * clipboard.js v1.5.1 + * clipboard.js v2.0.4 * https://zenorocha.github.io/clipboard.js - * + * * Licensed MIT © Zeno Rocha */ -!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e.Clipboard=t()}}(function(){var t,e,n;return function t(e,n,r){function o(a,c){if(!n[a]){if(!e[a]){var s="function"==typeof require&&require;if(!c&&s)return s(a,!0);if(i)return i(a,!0);var u=new Error("Cannot find module '"+a+"'");throw u.code="MODULE_NOT_FOUND",u}var l=n[a]={exports:{}};e[a][0].call(l.exports,function(t){var n=e[a][1][t];return o(n?n:t)},l,l.exports,t,e,n,r)}return n[a].exports}for(var i="function"==typeof require&&require,a=0;a<r.length;a++)o(r[a]);return o}({1:[function(t,e,n){var r=t("matches-selector");e.exports=function(t,e,n){for(var o=n?t:t.parentNode;o&&o!==document;){if(r(o,e))return o;o=o.parentNode}}},{"matches-selector":2}],2:[function(t,e,n){function r(t,e){if(i)return i.call(t,e);for(var n=t.parentNode.querySelectorAll(e),r=0;r<n.length;++r)if(n[r]==t)return!0;return!1}var o=Element.prototype,i=o.matchesSelector||o.webkitMatchesSelector||o.mozMatchesSelector||o.msMatchesSelector||o.oMatchesSelector;e.exports=r},{}],3:[function(t,e,n){function r(t,e,n,r){var i=o.apply(this,arguments);return t.addEventListener(n,i),{destroy:function(){t.removeEventListener(n,i)}}}function o(t,e,n,r){return function(n){var o=i(n.target,e,!0);o&&(Object.defineProperty(n,"target",{value:o}),r.call(t,n))}}var i=t("closest");e.exports=r},{closest:1}],4:[function(t,e,n){n.node=function(t){return void 0!==t&&t instanceof HTMLElement&&1===t.nodeType},n.nodeList=function(t){var e=Object.prototype.toString.call(t);return void 0!==t&&("[object NodeList]"===e||"[object HTMLCollection]"===e)&&"length"in t&&(0===t.length||n.node(t[0]))},n.string=function(t){return"string"==typeof t||t instanceof String},n.function=function(t){var e=Object.prototype.toString.call(t);return"[object Function]"===e}},{}],5:[function(t,e,n){function r(t,e,n){if(!t&&!e&&!n)throw new Error("Missing required arguments");if(!c.string(e))throw new TypeError("Second argument must be a String");if(!c.function(n))throw new TypeError("Third argument must be a Function");if(c.node(t))return o(t,e,n);if(c.nodeList(t))return i(t,e,n);if(c.string(t))return a(t,e,n);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList")}function o(t,e,n){return t.addEventListener(e,n),{destroy:function(){t.removeEventListener(e,n)}}}function i(t,e,n){return Array.prototype.forEach.call(t,function(t){t.addEventListener(e,n)}),{destroy:function(){Array.prototype.forEach.call(t,function(t){t.removeEventListener(e,n)})}}}function a(t,e,n){return s(document.body,t,e,n)}var c=t("./is"),s=t("delegate");e.exports=r},{"./is":4,delegate:3}],6:[function(t,e,n){function r(t){var e;if("INPUT"===t.nodeName||"TEXTAREA"===t.nodeName)t.select(),e=t.value;else{var n=window.getSelection(),r=document.createRange();r.selectNodeContents(t),n.removeAllRanges(),n.addRange(r),e=n.toString()}return e}e.exports=r},{}],7:[function(t,e,n){function r(){}r.prototype={on:function(t,e,n){var r=this.e||(this.e={});return(r[t]||(r[t]=[])).push({fn:e,ctx:n}),this},once:function(t,e,n){function r(){o.off(t,r),e.apply(n,arguments)}var o=this;return r._=e,this.on(t,r,n)},emit:function(t){var e=[].slice.call(arguments,1),n=((this.e||(this.e={}))[t]||[]).slice(),r=0,o=n.length;for(r;o>r;r++)n[r].fn.apply(n[r].ctx,e);return this},off:function(t,e){var n=this.e||(this.e={}),r=n[t],o=[];if(r&&e)for(var i=0,a=r.length;a>i;i++)r[i].fn!==e&&r[i].fn._!==e&&o.push(r[i]);return o.length?n[t]=o:delete n[t],this}},e.exports=r},{}],8:[function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}n.__esModule=!0;var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),a=t("select"),c=r(a),s=function(){function t(e){o(this,t),this.resolveOptions(e),this.initSelection()}return t.prototype.resolveOptions=function t(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];this.action=e.action,this.emitter=e.emitter,this.target=e.target,this.text=e.text,this.trigger=e.trigger,this.selectedText=""},t.prototype.initSelection=function t(){if(this.text&&this.target)throw new Error('Multiple attributes declared, use either "target" or "text"');if(this.text)this.selectFake();else{if(!this.target)throw new Error('Missing required attributes, use either "target" or "text"');this.selectTarget()}},t.prototype.selectFake=function t(){var e=this;this.removeFake(),this.fakeHandler=document.body.addEventListener("click",function(){return e.removeFake()}),this.fakeElem=document.createElement("textarea"),this.fakeElem.style.position="absolute",this.fakeElem.style.left="-9999px",this.fakeElem.style.top=(window.pageYOffset||document.documentElement.scrollTop)+"px",this.fakeElem.setAttribute("readonly",""),this.fakeElem.value=this.text,document.body.appendChild(this.fakeElem),this.selectedText=c.default(this.fakeElem),this.copyText()},t.prototype.removeFake=function t(){this.fakeHandler&&(document.body.removeEventListener("click"),this.fakeHandler=null),this.fakeElem&&(document.body.removeChild(this.fakeElem),this.fakeElem=null)},t.prototype.selectTarget=function t(){this.selectedText=c.default(this.target),this.copyText()},t.prototype.copyText=function t(){var e=void 0;try{e=document.execCommand(this.action)}catch(n){e=!1}this.handleResult(e)},t.prototype.handleResult=function t(e){e?this.emitter.emit("success",{action:this.action,text:this.selectedText,trigger:this.trigger,clearSelection:this.clearSelection.bind(this)}):this.emitter.emit("error",{action:this.action,trigger:this.trigger,clearSelection:this.clearSelection.bind(this)})},t.prototype.clearSelection=function t(){this.target&&this.target.blur(),window.getSelection().removeAllRanges()},t.prototype.destroy=function t(){this.removeFake()},i(t,[{key:"action",set:function t(){var e=arguments.length<=0||void 0===arguments[0]?"copy":arguments[0];if(this._action=e,"copy"!==this._action&&"cut"!==this._action)throw new Error('Invalid "action" value, use either "copy" or "cut"')},get:function t(){return this._action}},{key:"target",set:function t(e){if(void 0!==e){if(!e||"object"!=typeof e||1!==e.nodeType)throw new Error('Invalid "target" value, use a valid Element');this._target=e}},get:function t(){return this._target}}]),t}();n.default=s,e.exports=n.default},{select:6}],9:[function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function a(t,e){var n="data-clipboard-"+t;if(e.hasAttribute(n))return e.getAttribute(n)}n.__esModule=!0;var c=t("./clipboard-action"),s=r(c),u=t("tiny-emitter"),l=r(u),f=t("good-listener"),d=r(f),h=function(t){function e(n,r){o(this,e),t.call(this),this.resolveOptions(r),this.listenClick(n)}return i(e,t),e.prototype.resolveOptions=function t(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];this.action="function"==typeof e.action?e.action:this.defaultAction,this.target="function"==typeof e.target?e.target:this.defaultTarget,this.text="function"==typeof e.text?e.text:this.defaultText},e.prototype.listenClick=function t(e){var n=this;this.listener=d.default(e,"click",function(t){return n.onClick(t)})},e.prototype.onClick=function t(e){this.clipboardAction&&(this.clipboardAction=null),this.clipboardAction=new s.default({action:this.action(e.target),target:this.target(e.target),text:this.text(e.target),trigger:e.target,emitter:this})},e.prototype.defaultAction=function t(e){return a("action",e)},e.prototype.defaultTarget=function t(e){var n=a("target",e);return n?document.querySelector(n):void 0},e.prototype.defaultText=function t(e){return a("text",e)},e.prototype.destroy=function t(){this.listener.destroy(),this.clipboardAction&&(this.clipboardAction.destroy(),this.clipboardAction=null)},e}(l.default);n.default=h,e.exports=n.default},{"./clipboard-action":8,"good-listener":5,"tiny-emitter":7}]},{},[9])(9)}); \ No newline at end of file +!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.ClipboardJS=e():t.ClipboardJS=e()}(this,function(){return function(n){var o={};function r(t){if(o[t])return o[t].exports;var e=o[t]={i:t,l:!1,exports:{}};return n[t].call(e.exports,e,e.exports,r),e.l=!0,e.exports}return r.m=n,r.c=o,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=0)}([function(t,e,n){"use strict";var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i=function(){function o(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(t,e,n){return e&&o(t.prototype,e),n&&o(t,n),t}}(),a=o(n(1)),c=o(n(3)),u=o(n(4));function o(t){return t&&t.__esModule?t:{default:t}}var l=function(t){function o(t,e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o);var n=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(o.__proto__||Object.getPrototypeOf(o)).call(this));return n.resolveOptions(e),n.listenClick(t),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(o,c.default),i(o,[{key:"resolveOptions",value:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};this.action="function"==typeof t.action?t.action:this.defaultAction,this.target="function"==typeof t.target?t.target:this.defaultTarget,this.text="function"==typeof t.text?t.text:this.defaultText,this.container="object"===r(t.container)?t.container:document.body}},{key:"listenClick",value:function(t){var e=this;this.listener=(0,u.default)(t,"click",function(t){return e.onClick(t)})}},{key:"onClick",value:function(t){var e=t.delegateTarget||t.currentTarget;this.clipboardAction&&(this.clipboardAction=null),this.clipboardAction=new a.default({action:this.action(e),target:this.target(e),text:this.text(e),container:this.container,trigger:e,emitter:this})}},{key:"defaultAction",value:function(t){return s("action",t)}},{key:"defaultTarget",value:function(t){var e=s("target",t);if(e)return document.querySelector(e)}},{key:"defaultText",value:function(t){return s("text",t)}},{key:"destroy",value:function(){this.listener.destroy(),this.clipboardAction&&(this.clipboardAction.destroy(),this.clipboardAction=null)}}],[{key:"isSupported",value:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:["copy","cut"],e="string"==typeof t?[t]:t,n=!!document.queryCommandSupported;return e.forEach(function(t){n=n&&!!document.queryCommandSupported(t)}),n}}]),o}();function s(t,e){var n="data-clipboard-"+t;if(e.hasAttribute(n))return e.getAttribute(n)}t.exports=l},function(t,e,n){"use strict";var o,r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i=function(){function o(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(t,e,n){return e&&o(t.prototype,e),n&&o(t,n),t}}(),a=n(2),c=(o=a)&&o.__esModule?o:{default:o};var u=function(){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),this.resolveOptions(t),this.initSelection()}return i(e,[{key:"resolveOptions",value:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};this.action=t.action,this.container=t.container,this.emitter=t.emitter,this.target=t.target,this.text=t.text,this.trigger=t.trigger,this.selectedText=""}},{key:"initSelection",value:function(){this.text?this.selectFake():this.target&&this.selectTarget()}},{key:"selectFake",value:function(){var t=this,e="rtl"==document.documentElement.getAttribute("dir");this.removeFake(),this.fakeHandlerCallback=function(){return t.removeFake()},this.fakeHandler=this.container.addEventListener("click",this.fakeHandlerCallback)||!0,this.fakeElem=document.createElement("textarea"),this.fakeElem.style.fontSize="12pt",this.fakeElem.style.border="0",this.fakeElem.style.padding="0",this.fakeElem.style.margin="0",this.fakeElem.style.position="absolute",this.fakeElem.style[e?"right":"left"]="-9999px";var n=window.pageYOffset||document.documentElement.scrollTop;this.fakeElem.style.top=n+"px",this.fakeElem.setAttribute("readonly",""),this.fakeElem.value=this.text,this.container.appendChild(this.fakeElem),this.selectedText=(0,c.default)(this.fakeElem),this.copyText()}},{key:"removeFake",value:function(){this.fakeHandler&&(this.container.removeEventListener("click",this.fakeHandlerCallback),this.fakeHandler=null,this.fakeHandlerCallback=null),this.fakeElem&&(this.container.removeChild(this.fakeElem),this.fakeElem=null)}},{key:"selectTarget",value:function(){this.selectedText=(0,c.default)(this.target),this.copyText()}},{key:"copyText",value:function(){var e=void 0;try{e=document.execCommand(this.action)}catch(t){e=!1}this.handleResult(e)}},{key:"handleResult",value:function(t){this.emitter.emit(t?"success":"error",{action:this.action,text:this.selectedText,trigger:this.trigger,clearSelection:this.clearSelection.bind(this)})}},{key:"clearSelection",value:function(){this.trigger&&this.trigger.focus(),window.getSelection().removeAllRanges()}},{key:"destroy",value:function(){this.removeFake()}},{key:"action",set:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"copy";if(this._action=t,"copy"!==this._action&&"cut"!==this._action)throw new Error('Invalid "action" value, use either "copy" or "cut"')},get:function(){return this._action}},{key:"target",set:function(t){if(void 0!==t){if(!t||"object"!==(void 0===t?"undefined":r(t))||1!==t.nodeType)throw new Error('Invalid "target" value, use a valid Element');if("copy"===this.action&&t.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if("cut"===this.action&&(t.hasAttribute("readonly")||t.hasAttribute("disabled")))throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes');this._target=t}},get:function(){return this._target}}]),e}();t.exports=u},function(t,e){t.exports=function(t){var e;if("SELECT"===t.nodeName)t.focus(),e=t.value;else if("INPUT"===t.nodeName||"TEXTAREA"===t.nodeName){var n=t.hasAttribute("readonly");n||t.setAttribute("readonly",""),t.select(),t.setSelectionRange(0,t.value.length),n||t.removeAttribute("readonly"),e=t.value}else{t.hasAttribute("contenteditable")&&t.focus();var o=window.getSelection(),r=document.createRange();r.selectNodeContents(t),o.removeAllRanges(),o.addRange(r),e=o.toString()}return e}},function(t,e){function n(){}n.prototype={on:function(t,e,n){var o=this.e||(this.e={});return(o[t]||(o[t]=[])).push({fn:e,ctx:n}),this},once:function(t,e,n){var o=this;function r(){o.off(t,r),e.apply(n,arguments)}return r._=e,this.on(t,r,n)},emit:function(t){for(var e=[].slice.call(arguments,1),n=((this.e||(this.e={}))[t]||[]).slice(),o=0,r=n.length;o<r;o++)n[o].fn.apply(n[o].ctx,e);return this},off:function(t,e){var n=this.e||(this.e={}),o=n[t],r=[];if(o&&e)for(var i=0,a=o.length;i<a;i++)o[i].fn!==e&&o[i].fn._!==e&&r.push(o[i]);return r.length?n[t]=r:delete n[t],this}},t.exports=n},function(t,e,n){var d=n(5),h=n(6);t.exports=function(t,e,n){if(!t&&!e&&!n)throw new Error("Missing required arguments");if(!d.string(e))throw new TypeError("Second argument must be a String");if(!d.fn(n))throw new TypeError("Third argument must be a Function");if(d.node(t))return s=e,f=n,(l=t).addEventListener(s,f),{destroy:function(){l.removeEventListener(s,f)}};if(d.nodeList(t))return a=t,c=e,u=n,Array.prototype.forEach.call(a,function(t){t.addEventListener(c,u)}),{destroy:function(){Array.prototype.forEach.call(a,function(t){t.removeEventListener(c,u)})}};if(d.string(t))return o=t,r=e,i=n,h(document.body,o,r,i);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList");var o,r,i,a,c,u,l,s,f}},function(t,n){n.node=function(t){return void 0!==t&&t instanceof HTMLElement&&1===t.nodeType},n.nodeList=function(t){var e=Object.prototype.toString.call(t);return void 0!==t&&("[object NodeList]"===e||"[object HTMLCollection]"===e)&&"length"in t&&(0===t.length||n.node(t[0]))},n.string=function(t){return"string"==typeof t||t instanceof String},n.fn=function(t){return"[object Function]"===Object.prototype.toString.call(t)}},function(t,e,n){var a=n(7);function i(t,e,n,o,r){var i=function(e,n,t,o){return function(t){t.delegateTarget=a(t.target,n),t.delegateTarget&&o.call(e,t)}}.apply(this,arguments);return t.addEventListener(n,i,r),{destroy:function(){t.removeEventListener(n,i,r)}}}t.exports=function(t,e,n,o,r){return"function"==typeof t.addEventListener?i.apply(null,arguments):"function"==typeof n?i.bind(null,document).apply(null,arguments):("string"==typeof t&&(t=document.querySelectorAll(t)),Array.prototype.map.call(t,function(t){return i(t,e,n,o,r)}))}},function(t,e){if("undefined"!=typeof Element&&!Element.prototype.matches){var n=Element.prototype;n.matches=n.matchesSelector||n.mozMatchesSelector||n.msMatchesSelector||n.oMatchesSelector||n.webkitMatchesSelector}t.exports=function(t,e){for(;t&&9!==t.nodeType;){if("function"==typeof t.matches&&t.matches(e))return t;t=t.parentNode}}}])}); \ No newline at end of file diff --git a/vendor/simplesamlphp/simplesamlphp/www/resources/default-rtl.css b/vendor/simplesamlphp/simplesamlphp/www/resources/default-rtl.css index 0113f82f10..df092c3d2b 100644 --- a/vendor/simplesamlphp/simplesamlphp/www/resources/default-rtl.css +++ b/vendor/simplesamlphp/simplesamlphp/www/resources/default-rtl.css @@ -2,69 +2,69 @@ /* THE BIG GUYS */ html { - direction: rtl; + direction: rtl; } /* LISTS */ ul { - margin: .3em 2em 1.5em 0; + margin: .3em 2em 1.5em 0; } li { - margin-right: 2em; + margin-right: 2em; } #wrap { - text-align: right; + text-align: right; } /* TYPOGRAPHY */ dl dd { - margin-right: 3em; + margin-right: 3em; } .efieldlist { - border-right: 1px solid #e6e6e6; + border-right: 1px solid #e6e6e6; } div.caution { - padding: .2em 60px .2em .2em; - background-position: right; + padding: .2em 60px .2em .2em; + background-position: right; } th.rowtitle { - text-align: right; + text-align: right; } .enablebox table { - margin-right: 1em; + margin-right: 1em; } .enablebox.mini table { - float: left; + float: left; } .enablebox tr td { - padding: .5px .5em 1px 1em; + padding: .5px .5em 1px 1em; } /* Attribute presentation in example page */ table.attributes td.attrname { - text-align: left; + text-align: left; } fieldset.fancyfieldset { - margin: 2em 0px 1em 1em; + margin: 2em 0px 1em 1em; } fieldset.fancyfieldset legend { - margin-right: 2em; + margin-right: 2em; } -.ui-tabs .ui-tabs-nav li { - float: right; +.ui-tabs .ui-tabs-nav li { + float: right; } /* Reverse Float Left <-> Right */ .float-r { - float: left; + float: left; } .float-l { - float: right; + float: right; } diff --git a/vendor/simplesamlphp/simplesamlphp/www/resources/default.css b/vendor/simplesamlphp/simplesamlphp/www/resources/default.css index 3c0371bb5c..f033b77162 100644 --- a/vendor/simplesamlphp/simplesamlphp/www/resources/default.css +++ b/vendor/simplesamlphp/simplesamlphp/www/resources/default.css @@ -2,474 +2,467 @@ /* THE BIG GUYS */ * { - margin: 0; - padding: 0; + margin: 0; + padding: 0; } body { - text-align: center; - padding: 10px 0; - background: #1c1c1c; -/* background-image: url(icons/ssplogo-fish.png); - background-repeat: no-repeat; */ - color: #333; - font: 83%/1.5 arial,tahoma,verdana,sans-serif; + text-align: center; + padding: 10px 0; + background: #1c1c1c; +/* background-image: url(icons/ssplogo-fish.png); */ +/* background-repeat: no-repeat; */ + color: #333; + font: 83%/1.5 arial,tahoma,verdana,sans-serif; } .body-embed { - padding: 0; - background: #ffffff; - font: 83%/1.5 arial,tahoma,verdana,sans-serif; + padding: 0; + background: #ffffff; + font: 83%/1.5 arial,tahoma,verdana,sans-serif; } img { - border: none; - display: block; + border: none; + display: block; } hr { - margin: 1em 0; - background: #eee; - height: 1px; - color: #eee; - border: none; - clear: both; + margin: 1em 0; + background: #eee; + height: 1px; + color: #eee; + border: none; + clear: both; } /* LINKS */ a, a:link, a:link, a:link, a:hover { - - text-decoration: none; - color: #777; - border-bottom: 1px dotted #ccc; - font-weight: normal; + text-decoration: none; + color: #777; + border-bottom: 1px dotted #ccc; + font-weight: normal; } - a:link, a:visited { - text-decoration: none; - color: #777; - border-bottom: 1px dotted #ccc; - font-weight: normal; + text-decoration: none; + color: #777; + border-bottom: 1px dotted #ccc; + font-weight: normal; } .ui-tabs-nav a { - border: none ! important; - text-decoration: none; + border: none ! important; + text-decoration: none; } a:visited { - color: #999; + color: #999; } a:hover, a:active { - color: #069; - text-decoration: none; - color: #333; - border-bottom: 1px solid #333; + color: #069; + text-decoration: none; + color: #333; + border-bottom: 1px solid #333; } #header a { - color: #fff; - text-decoration: none; + color: #fff; + text-decoration: none; } /* LISTS */ ul { - margin: .3em 0 1.5em 2em; + margin: .3em 0 1.5em 2em; } ul.related { - margin-top: -1em; + margin-top: -1em; } li { - margin-left: 2em; + margin-left: 2em; } dt { - font-weight: bold; + font-weight: bold; } #wrap { - background: #fff; + background: #fff; - border: 1px solid #fff; - position: relative; - text-align: left; + border: 1px solid #fff; + position: relative; + text-align: left; - margin: 20px 75px 2em 75px; - max-width: 950px; + margin: 20px 75px 2em 75px; + max-width: 950px; } #languagebar { - padding-left: 10px; - padding-right: 10px; + padding-left: 10px; + padding-right: 10px; } #languagebar a:link, #languagebar a:visited { - text-decoration: none; - color: #777; - border-bottom: 1px dotted #ccc; - font-weight: normal; + text-decoration: none; + color: #777; + border-bottom: 1px dotted #ccc; + font-weight: normal; } #languagebar a:hover { - text-decoration: none; - color: #333; - border-bottom: 1px solid #333; - + text-decoration: none; + color: #333; + border-bottom: 1px solid #333; } #header { - background: #666 url("header-bkg.png") repeat-x 0 100%; - margin: 0px; - padding: 0 0 8px; + background: #666 url("header-bkg.png") repeat-x 0 100%; + margin: 0px; + padding: 0 0 8px; } #header h1 { - color: #fff; - font-size: 145%; - padding: 20px 20px 12px; + color: #fff; + font-size: 145%; + padding: 20px 20px 12px; } - #content, #footer { - padding: 0 20px; + padding: 0 20px; } /* TYPOGRAPHY */ p, ul, ol { - margin: 0 0 1.5em; + margin: 0 0 1.5em; } h1, h2, h3, h4, h5, h6 { - letter-spacing: -1px; - font-family: arial,verdana,sans-serif; - margin: 1.2em 0 .3em; - color: #000; - border-bottom: 1px solid #eee; - padding-bottom: .1em; + letter-spacing: -1px; + font-family: arial,verdana,sans-serif; + margin: 1.2em 0 .3em; + color: #000; + border-bottom: 1px solid #eee; + padding-bottom: .1em; } h1 { - font-size: 196%; - margin-top: 0; - border: none; + font-size: 196%; + margin-top: 0; + border: none; } h2 { - font-size: 136%; + font-size: 136%; } h3 { - font-size: 126%; + font-size: 126%; } h4 { - font-size: 116%; - font-weight: bold; + font-size: 116%; + font-weight: bold; } h5 { - font-size: 106%; + font-size: 106%; } h6 { - font-size: 96%; + font-size: 96%; } input { - border: 1px solid #ddd; - border-radius: 3px; - padding: 5px; - line-height: 1.5em; + border: 1px solid #ddd; + border-radius: 3px; + padding: 5px; + line-height: 1.5em; } h1 a { - text-decoration: none; - border: none ! important; - color: white; + text-decoration: none; + border: none ! important; + color: white; } h1 a:hover { - border-bottom: 1px dotted #eee; + border-bottom: 1px dotted #eee; } #content { - margin-top: 2em; + margin-top: 2em; } .old { - text-decoration: line-through; + text-decoration: line-through; } dl dt { - color: #333; + color: #333; } dl dd { - color: #666; - margin-left: 3em; -/* font-family: monospace; */ + color: #666; + margin-left: 3em; +/* font-family: monospace; */ } .efieldlist { - padding: .4em; - margin: .8em; - border-top: 1px solid #e6e6e6; - border-left: 1px solid #e6e6e6; + padding: .4em; + margin: .8em; + border-top: 1px solid #e6e6e6; + border-left: 1px solid #e6e6e6; } .efieldlist.warning { - background-color: #922; - border: 1px solid #333; - color: white; + background-color: #922; + border: 1px solid #333; + color: white; } .efieldlist.warning h5 { - color: white; + color: white; } .efieldlist h5 { - font-weight: bold; - color: #200; - margin: .3em; + font-weight: bold; + color: #200; + margin: .3em; } .trackidtext { - border: 1px dashed #aaa; - background: #eaeaea; - padding: .6em; - margin: .4em; + border: 1px dashed #aaa; + background: #eaeaea; + padding: .6em; + margin: .4em; } .trackidtext .trackid { - border: 1px solid #ccc; - background: #eee; - margin: .4em; - padding: .4em; - font-family: monospace; - font-size: large; + border: 1px solid #ccc; + background: #eee; + margin: .4em; + padding: .4em; + font-family: monospace; + font-size: large; } div.caution { - background-color: #FF9; - background-image: url('icons/experience/gtk-dialog-warning.48x48.png'); - background-repeat: no-repeat; - border: thin solid #444; - padding: .2em .2em .2em 60px; - margin: 1em 0px 1em 0px; + background-color: #FF9; + background-image: url('icons/experience/gtk-dialog-warning.48x48.png'); + background-repeat: no-repeat; + border: thin solid #444; + padding: .2em .2em .2em 60px; + margin: 1em 0px 1em 0px; } th.rowtitle { - text-align: left; + text-align: left; } .enablebox table { - border: 1px solid #eee; - - margin-left: 1em; + border: 1px solid #eee; + margin-left: 1em; } .enablebox.mini table { - float: right; + float: right; } .enablebox tr td { - padding: .5px 1em 1px .5em; - margin: 0px; + padding: .5px 1em 1px .5em; + margin: 0px; } .enablebox { - font-size: 85%; + font-size: 85%; } .enablebox tr.enabled td { - background: #eee; + background: #eee; } .enablebox tr.disabled td { - background: #ccc; + background: #ccc; } .metadatabox { - overflow: scroll; - border: 1px solid #eee; - padding: 0.5em; - border-radius: 3px; + overflow: scroll; + border: 1px solid #eee; + padding: 0.5em; + border-radius: 3px; } div.preferredidp { - border: 1px dashed #ccc; - background: #eee; - padding: 2px 2em 2px 2em; + border: 1px dashed #ccc; + background: #eee; + padding: 2px 2em 2px 2em; } table.modules { - border-collapse: collapse; + border-collapse: collapse; } table.modules tr td { - border-bottom: 1px solid #ddd; + border-bottom: 1px solid #ddd; } table.modules tr.even td { - background: #f0f0f0; + background: #f0f0f0; } /* Attribute presentation in example page */ table.attributes { - width: 100%; - margin: 0px; - border: 1px solid #bbb; - border-collapse: collapse; + width: 100%; + margin: 0px; + border: 1px solid #bbb; + border-collapse: collapse; } table.attributes td.attrname { - text-align: right; + text-align: right; } table.attributes tr.even td { - background: #eee; + background: #eee; } table.attributes tr td { - border-bottom: 1px solid #bbb; - border-left: 0px; - border-right: 0px; - background: #fff; - padding-top: 5px; - padding-left: 1em; - padding-right: 1em; - - vertical-align: top; + border-bottom: 1px solid #bbb; + border-left: 0px; + border-right: 0px; + background: #fff; + padding-top: 5px; + padding-left: 1em; + padding-right: 1em; + vertical-align: top; } .attrvalue { - word-break: break-all; - word-wrap: break-word; + word-break: break-all; + word-wrap: break-word; } table#table_with_attributes tr:last-child td { - border-bottom: none; + border-bottom: none; } fieldset.fancyfieldset { - margin: 2em 1em 1em 0px; - border: 1px solid #bbb; + margin: 2em 1em 1em 0px; + border: 1px solid #bbb; } fieldset.fancyfieldset legend { - margin-left: 2em; - padding: 3px 2em 3px 2em; - border: 1px solid #bbb; + margin-left: 2em; + padding: 3px 2em 3px 2em; + border: 1px solid #bbb; } div#confirmation input { - margin-top: .5em; - margin-bottom: .5em; + margin-top: .5em; + margin-bottom: .5em; } div#confirmation { - border: 1px solid #aaa; - background: #eee; - padding: .6em 1em .1em 1em; + border: 1px solid #aaa; + background: #eee; + padding: .6em 1em .1em 1em; } caption { - display: none; + display: none; } /* Left-to-Right CSS for RTL (Right to Left Support) */ .float-r { - float: right; + float: right; } .float-l { - float: left; + float: left; } #mobile_remember_username, #mobile_remember_me { - display: none; + display: none; } @media handheld, only screen and (max-width: 480px), only screen and (max-device-width: 480px) { - #header, #languagebar, #footer, .erroricon, .loginicon, .logintext, - #regular_remember_username, #regular_remember_me { - display: none; - } - body { - font-size: 20px; - } - #wrap { - margin: 0; - } - h1,h2,h3,h4 { - font-size: 110%; - } - - #content { - margin-bottom: 10px; - padding: 0; - padding-left: 5px; - } - input[type="text"], input[type="password"] { - height: 1.5em; - font-size: 1em; - } - .youareadmin { - font-size: 50%; - } - #mobilesubmit, #mobile_remember_username, #mobile_remember_me { - display: table-row; - } + #header, #languagebar, #footer, .erroricon, .loginicon, .logintext, + #regular_remember_username, #regular_remember_me { + display: none; + } + body { + font-size: 20px; + } + #wrap { + margin: 0; + } + h1,h2,h3,h4 { + font-size: 110%; + } + + #content { + margin-bottom: 10px; + padding: 0; + padding-left: 5px; + } + input[type="text"], input[type="password"] { + height: 1.5em; + font-size: 1em; + } + .youareadmin { + font-size: 50%; + } + #mobilesubmit, #mobile_remember_username, #mobile_remember_me { + display: table-row; + } } .btn, .btnaddonright { - color: #000000; - border: 1px solid #eee; - border-radius: 3px; - background-color: #eee; - background-image: linear-gradient(#fcfcfc, #eee); - text-align: center; - padding: 5px; - cursor: hand; + color: #000000; + border: 1px solid #eee; + border-radius: 3px; + background-color: #eee; + background-image: linear-gradient(#fcfcfc, #eee); + text-align: center; + padding: 5px; + cursor: hand; } .btn:hover, .btnaddonright:hover { - border-color: #ccc; - background-color: #ddd; - background-image: linear-gradient(#eee, #ddd); - + border-color: #ccc; + background-color: #ddd; + background-image: linear-gradient(#eee, #ddd); } .btn img, .btnaddonright img { - max-height: 15px; - max-width: 15px; + max-height: 15px; + max-width: 15px; } .topright { - position: absolute; - right: 2em; + position: absolute; + right: 2em; } .input-group { - display: table; + display: table; } .input-group pre { - background: white; - position: relative; - width: 100%; - vertical-align: middle; - border: 1px solid #eee; - padding: 0.5em; - display: table-cell; + background: white; + position: relative; + width: 100%; + vertical-align: middle; + border: 1px solid #eee; + padding: 0.5em; + display: table-cell; } .input-group .btnaddonright { - position: relative; - display: inline-block; - border-bottom-left-radius: 0; - border-bottom-right-radius: 3px; - border-top-left-radius: 0; - border-top-right-radius: 3px; - border-left: none; + position: relative; + display: inline-block; + border-bottom-left-radius: 0; + border-bottom-right-radius: 3px; + border-top-left-radius: 0; + border-top-right-radius: 3px; + border-left: none; } .input-group .btnaddonright:hover { - border-left: 1px solid #ccc; + border-left: 1px solid #ccc; } .input-group .input-left { - border-bottom-left-radius: 3px; - border-bottom-right-radius: 0; - border-top-left-radius: 3px; - border-top-right-radius: 0; + border-bottom-left-radius: 3px; + border-bottom-right-radius: 0; + border-top-left-radius: 3px; + border-top-right-radius: 0; } diff --git a/vendor/simplesamlphp/simplesamlphp/www/resources/post.js b/vendor/simplesamlphp/simplesamlphp/www/resources/post.js index f551736512..043bec7332 100644 --- a/vendor/simplesamlphp/simplesamlphp/www/resources/post.js +++ b/vendor/simplesamlphp/simplesamlphp/www/resources/post.js @@ -2,6 +2,6 @@ * Automatically click the input button to redirect the user to * the SSO */ -window.onload = function(){ +window.onload = function () { document.getElementById('postLoginSubmitButton').click(); -}; \ No newline at end of file +}; diff --git a/vendor/simplesamlphp/simplesamlphp/www/resources/script.js b/vendor/simplesamlphp/simplesamlphp/www/resources/script.js index 3adf1b1f88..a195c24cb8 100644 --- a/vendor/simplesamlphp/simplesamlphp/www/resources/script.js +++ b/vendor/simplesamlphp/simplesamlphp/www/resources/script.js @@ -3,11 +3,12 @@ * * @param id The id of the element which should receive focus. */ -function SimpleSAML_focus(id) { - element = document.getElementById(id); - if(element != null) { - element.focus(); - } +function SimpleSAML_focus(id) +{ + element = document.getElementById(id); + if (element != null) { + element.focus(); + } } @@ -16,13 +17,14 @@ function SimpleSAML_focus(id) { * * @param id The id of the element which should be shown. */ -function SimpleSAML_show(id) { - element = document.getElementById(id); - if (element == null) { - return; - } +function SimpleSAML_show(id) +{ + element = document.getElementById(id); + if (element == null) { + return; + } - element.style.display = 'block'; + element.style.display = 'block'; } @@ -31,11 +33,12 @@ function SimpleSAML_show(id) { * * @param id The id of the element which should be hidden. */ -function SimpleSAML_hide(id) { - element = document.getElementById(id); - if (element == null) { - return; - } +function SimpleSAML_hide(id) +{ + element = document.getElementById(id); + if (element == null) { + return; + } - element.style.display = 'none'; + element.style.display = 'none'; } diff --git a/vendor/simplesamlphp/simplesamlphp/www/resources/slo.css b/vendor/simplesamlphp/simplesamlphp/www/resources/slo.css index f1ac2fd4da..13946bcbaa 100644 --- a/vendor/simplesamlphp/simplesamlphp/www/resources/slo.css +++ b/vendor/simplesamlphp/simplesamlphp/www/resources/slo.css @@ -1,19 +1,18 @@ table#slostatustable { -/* width: 100%; */ - border-collapse: collapse; - margin-bottom: 1em; +/* width: 100%; */ + border-collapse: collapse; + margin-bottom: 1em; } table#slostatustable tr td { -/* border-top: 1px solid #ccc; */ - padding-left: 4px; - padding-right: 4px; +/* border-top: 1px solid #ccc; */ + padding-left: 4px; + padding-right: 4px; } table#slostatustable tr td.statustext { - min-width: 5em; - padding-left: 0px; + min-width: 5em; + padding-left: 0px; } - table#slostatustable tr td.statustext span { display: none; } table#slostatustable tr.completed td.statustext span.completed { display: inline; } table#slostatustable tr.onhold td.statustext span.onhold { display: inline; } @@ -21,66 +20,62 @@ table#slostatustable tr.inprogress td.statustext span.inprogress { display: inli table#slostatustable tr.failed td.statustext span.failed { display: inline; } table#slostatustable tr td.icons img { -/* margin: 3px; */ - display: none; +/* margin: 3px; */ + display: none; } table#slostatustable tr.completed td.icons img.completed { display: inline; } table#slostatustable tr.onhold td.icons img.onhold { display: inline; } table#slostatustable tr.inprogress td.icons img.inprogress { display: inline; } table#slostatustable tr.failed td.icons img.failed { display: inline; } - iframe.hiddeniframe { - display: none; + display: none; } /* From old CSS - - div.allcompleted#interrupt { - display: none; + display: none; } div#interrupt a:link { - color: #036; - border-bottom: 1px dotted #036; - text-decoration: none; + color: #036; + border-bottom: 1px dotted #036; + text-decoration: none; } div#interrupt a:hover { - border-bottom: 1px solid #036; + border-bottom: 1px solid #036; } div#interrupt { - display: block; - border: 3px solid #036; - background: #39F; - padding: 1em; - margin: .2em; + display: block; + border: 3px solid #036; + background: #39F; + padding: 1em; + margin: .2em; } div#iscompleted { - display: none; - border: 3px solid #993; - background: #FF9; - padding: 1em; - margin: .2em; + display: none; + border: 3px solid #993; + background: #FF9; + padding: 1em; + margin: .2em; } div.allcompleted#iscompleted { - display: block ! important; + display: block ! important; } div.inprogress, div.loggedout { - - background: #eee; - color: #444; - padding: .2em 1em; - margin: .2em; + background: #eee; + color: #444; + padding: .2em 1em; + margin: .2em; } div.inprogress { - border: 1px dotted #888; + border: 1px dotted #888; } div.loggedout { - border: 1px solid #888; - background: #9f9 ! important ; + border: 1px solid #888; + background: #9f9 ! important; } iframe.hiddeniframe { - display: none; + display: none; } - */ +*/ diff --git a/vendor/simplesamlphp/simplesamlphp/www/saml2/idp/ArtifactResolutionService.php b/vendor/simplesamlphp/simplesamlphp/www/saml2/idp/ArtifactResolutionService.php index 39f705e657..16a99dc62e 100644 --- a/vendor/simplesamlphp/simplesamlphp/www/saml2/idp/ArtifactResolutionService.php +++ b/vendor/simplesamlphp/simplesamlphp/www/saml2/idp/ArtifactResolutionService.php @@ -10,17 +10,17 @@ require_once('../../_include.php'); -$config = SimpleSAML_Configuration::getInstance(); +$config = \SimpleSAML\Configuration::getInstance(); if (!$config->getBoolean('enable.saml20-idp', false)) { - throw new SimpleSAML_Error_Error('NOACCESS'); + throw new \SimpleSAML\Error\Error('NOACCESS'); } -$metadata = SimpleSAML_Metadata_MetaDataStorageHandler::getMetadataHandler(); +$metadata = \SimpleSAML\Metadata\MetaDataStorageHandler::getMetadataHandler(); $idpEntityId = $metadata->getMetaDataCurrentEntityID('saml20-idp-hosted'); $idpMetadata = $metadata->getMetaDataConfig($idpEntityId, 'saml20-idp-hosted'); if (!$idpMetadata->getBoolean('saml20.sendartifact', false)) { - throw new SimpleSAML_Error_Error('NOACCESS'); + throw new \SimpleSAML\Error\Error('NOACCESS'); } $store = \SimpleSAML\Store::getInstance(); @@ -31,12 +31,13 @@ $binding = new \SAML2\SOAP(); try { $request = $binding->receive(); -} catch (Exception $e) { // TODO: look for a specific exception +} catch (Exception $e) { + // TODO: look for a specific exception // This is dirty. Instead of checking the message of the exception, \SAML2\Binding::getCurrentBinding() should throw // an specific exception when the binding is unknown, and we should capture that here. Also note that the exception // message here is bogus! if ($e->getMessage() === 'Invalid message received to AssertionConsumerService endpoint.') { - throw new SimpleSAML_Error_Error('ARSPARAMS', $e, 400); + throw new \SimpleSAML\Error\Error('ARSPARAMS', $e, 400); } else { throw $e; // do not ignore other exceptions! } @@ -46,7 +47,7 @@ } $issuer = $request->getIssuer(); -$spMetadata = $metadata->getMetadataConfig($issuer, 'saml20-sp-remote'); +$spMetadata = $metadata->getMetaDataConfig($issuer, 'saml20-sp-remote'); $artifact = $request->getArtifact(); @@ -64,5 +65,5 @@ $artifactResponse->setIssuer($idpEntityId); $artifactResponse->setInResponseTo($request->getId()); $artifactResponse->setAny($responseXML); -sspmod_saml_Message::addSign($idpMetadata, $spMetadata, $artifactResponse); +\SimpleSAML\Module\saml\Message::addSign($idpMetadata, $spMetadata, $artifactResponse); $binding->send($artifactResponse); diff --git a/vendor/simplesamlphp/simplesamlphp/www/saml2/idp/SSOService.php b/vendor/simplesamlphp/simplesamlphp/www/saml2/idp/SSOService.php index c893fb4395..c3e4916849 100644 --- a/vendor/simplesamlphp/simplesamlphp/www/saml2/idp/SSOService.php +++ b/vendor/simplesamlphp/simplesamlphp/www/saml2/idp/SSOService.php @@ -1,4 +1,5 @@ <?php + /** * The SSOService is part of the SAML 2.0 IdP code, and it receives incoming Authentication Requests * from a SAML 2.0 SP, parses, and process it, and then authenticates the user and sends the user back @@ -10,18 +11,19 @@ require_once('../../_include.php'); -SimpleSAML\Logger::info('SAML2.0 - IdP.SSOService: Accessing SAML 2.0 IdP endpoint SSOService'); +\SimpleSAML\Logger::info('SAML2.0 - IdP.SSOService: Accessing SAML 2.0 IdP endpoint SSOService'); -$metadata = SimpleSAML_Metadata_MetaDataStorageHandler::getMetadataHandler(); +$metadata = \SimpleSAML\Metadata\MetaDataStorageHandler::getMetadataHandler(); $idpEntityId = $metadata->getMetaDataCurrentEntityID('saml20-idp-hosted'); -$idp = SimpleSAML_IdP::getById('saml2:' . $idpEntityId); +$idp = \SimpleSAML\IdP::getById('saml2:'.$idpEntityId); + try { - sspmod_saml_IdP_SAML2::receiveAuthnRequest($idp); -} catch (Exception $e) { + \SimpleSAML\Module\saml\IdP\SAML2::receiveAuthnRequest($idp); +} catch (\Exception $e) { if ($e->getMessage() === "Unable to find the current binding.") { - throw new SimpleSAML_Error_Error('SSOPARAMS', $e, 400); + throw new \SimpleSAML\Error\Error('SSOPARAMS', $e, 400); } else { throw $e; // do not ignore other exceptions! } } -assert('FALSE'); +assert(false); diff --git a/vendor/simplesamlphp/simplesamlphp/www/saml2/idp/SingleLogoutService.php b/vendor/simplesamlphp/simplesamlphp/www/saml2/idp/SingleLogoutService.php index f5ba8be26b..6e6e9a5f85 100644 --- a/vendor/simplesamlphp/simplesamlphp/www/saml2/idp/SingleLogoutService.php +++ b/vendor/simplesamlphp/simplesamlphp/www/saml2/idp/SingleLogoutService.php @@ -10,27 +10,28 @@ require_once('../../_include.php'); -SimpleSAML\Logger::info('SAML2.0 - IdP.SingleLogoutService: Accessing SAML 2.0 IdP endpoint SingleLogoutService'); +\SimpleSAML\Logger::info('SAML2.0 - IdP.SingleLogoutService: Accessing SAML 2.0 IdP endpoint SingleLogoutService'); -$metadata = SimpleSAML_Metadata_MetaDataStorageHandler::getMetadataHandler(); +$metadata = \SimpleSAML\Metadata\MetaDataStorageHandler::getMetadataHandler(); $idpEntityId = $metadata->getMetaDataCurrentEntityID('saml20-idp-hosted'); -$idp = SimpleSAML_IdP::getById('saml2:'.$idpEntityId); +$idp = \SimpleSAML\IdP::getById('saml2:'.$idpEntityId); if (isset($_REQUEST['ReturnTo'])) { $idp->doLogoutRedirect(\SimpleSAML\Utils\HTTP::checkURLAllowed((string) $_REQUEST['ReturnTo'])); } else { try { - sspmod_saml_IdP_SAML2::receiveLogoutMessage($idp); - } catch (Exception $e) { // TODO: look for a specific exception + \SimpleSAML\Module\saml\IdP\SAML2::receiveLogoutMessage($idp); + } catch (\Exception $e) { + // TODO: look for a specific exception /* * This is dirty. Instead of checking the message of the exception, \SAML2\Binding::getCurrentBinding() should * throw an specific exception when the binding is unknown, and we should capture that here */ if ($e->getMessage() === 'Unable to find the current binding.') { - throw new SimpleSAML_Error_Error('SLOSERVICEPARAMS', $e, 400); + throw new \SimpleSAML\Error\Error('SLOSERVICEPARAMS', $e, 400); } else { throw $e; // do not ignore other exceptions! } } } -assert('FALSE'); +assert(false); diff --git a/vendor/simplesamlphp/simplesamlphp/www/saml2/idp/initSLO.php b/vendor/simplesamlphp/simplesamlphp/www/saml2/idp/initSLO.php index 26085a7f73..21576797dc 100644 --- a/vendor/simplesamlphp/simplesamlphp/www/saml2/idp/initSLO.php +++ b/vendor/simplesamlphp/simplesamlphp/www/saml2/idp/initSLO.php @@ -1,15 +1,16 @@ <?php + require_once('../../_include.php'); -$metadata = SimpleSAML_Metadata_MetaDataStorageHandler::getMetadataHandler(); +$metadata = \SimpleSAML\Metadata\MetaDataStorageHandler::getMetadataHandler(); $idpEntityId = $metadata->getMetaDataCurrentEntityID('saml20-idp-hosted'); -$idp = SimpleSAML_IdP::getById('saml2:'.$idpEntityId); +$idp = \SimpleSAML\IdP::getById('saml2:'.$idpEntityId); -SimpleSAML\Logger::info('SAML2.0 - IdP.initSLO: Accessing SAML 2.0 IdP endpoint init Single Logout'); +\SimpleSAML\Logger::info('SAML2.0 - IdP.initSLO: Accessing SAML 2.0 IdP endpoint init Single Logout'); if (!isset($_GET['RelayState'])) { - throw new SimpleSAML_Error_Error('NORELAYSTATE'); + throw new \SimpleSAML\Error\Error('NORELAYSTATE'); } $idp->doLogoutRedirect(\SimpleSAML\Utils\HTTP::checkURLAllowed((string) $_GET['RelayState'])); -assert('FALSE'); +assert(false); diff --git a/vendor/simplesamlphp/simplesamlphp/www/saml2/idp/metadata.php b/vendor/simplesamlphp/simplesamlphp/www/saml2/idp/metadata.php index 897f22d31b..984fb9252d 100644 --- a/vendor/simplesamlphp/simplesamlphp/www/saml2/idp/metadata.php +++ b/vendor/simplesamlphp/simplesamlphp/www/saml2/idp/metadata.php @@ -8,12 +8,12 @@ use SimpleSAML\Utils\HTTP as HTTP; use SimpleSAML\Utils\Config\Metadata as Metadata; -// load SimpleSAMLphp, configuration and metadata -$config = SimpleSAML_Configuration::getInstance(); -$metadata = SimpleSAML_Metadata_MetaDataStorageHandler::getMetadataHandler(); +// load SimpleSAMLphp configuration and metadata +$config = \SimpleSAML\Configuration::getInstance(); +$metadata = \SimpleSAML\Metadata\MetaDataStorageHandler::getMetadataHandler(); if (!$config->getBoolean('enable.saml20-idp', false)) { - throw new SimpleSAML_Error_Error('NOACCESS'); + throw new \SimpleSAML\Error\Error('NOACCESS'); } // check if valid local session exists @@ -23,22 +23,21 @@ try { $idpentityid = isset($_GET['idpentityid']) ? - $_GET['idpentityid'] : - $metadata->getMetaDataCurrentEntityID('saml20-idp-hosted'); + $_GET['idpentityid'] : $metadata->getMetaDataCurrentEntityID('saml20-idp-hosted'); $idpmeta = $metadata->getMetaDataConfig($idpentityid, 'saml20-idp-hosted'); - $availableCerts = array(); + $availableCerts = []; - $keys = array(); + $keys = []; $certInfo = Crypto::loadPublicKey($idpmeta, false, 'new_'); if ($certInfo !== null) { $availableCerts['new_idp.crt'] = $certInfo; - $keys[] = array( + $keys[] = [ 'type' => 'X509Certificate', 'signing' => true, 'encryption' => true, 'X509Certificate' => $certInfo['certData'], - ); + ]; $hasNewCert = true; } else { $hasNewCert = false; @@ -46,29 +45,29 @@ $certInfo = Crypto::loadPublicKey($idpmeta, true); $availableCerts['idp.crt'] = $certInfo; - $keys[] = array( + $keys[] = [ 'type' => 'X509Certificate', 'signing' => true, 'encryption' => ($hasNewCert ? false : true), 'X509Certificate' => $certInfo['certData'], - ); + ]; if ($idpmeta->hasValue('https.certificate')) { $httpsCert = Crypto::loadPublicKey($idpmeta, true, 'https.'); - assert('isset($httpsCert["certData"])'); + assert(isset($httpsCert['certData'])); $availableCerts['https.crt'] = $httpsCert; - $keys[] = array( + $keys[] = [ 'type' => 'X509Certificate', 'signing' => true, 'encryption' => false, 'X509Certificate' => $httpsCert['certData'], - ); + ]; } - $metaArray = array( + $metaArray = [ 'metadata-set' => 'saml20-idp-remote', 'entityid' => $idpentityid, - ); + ]; $ssob = $metadata->getGenerated('SingleSignOnServiceBinding', 'saml20-idp-hosted'); $slob = $metadata->getGenerated('SingleLogoutServiceBinding', 'saml20-idp-hosted'); @@ -77,30 +76,30 @@ if (is_array($ssob)) { foreach ($ssob as $binding) { - $metaArray['SingleSignOnService'][] = array( + $metaArray['SingleSignOnService'][] = [ 'Binding' => $binding, 'Location' => $ssol, - ); + ]; } } else { - $metaArray['SingleSignOnService'][] = array( + $metaArray['SingleSignOnService'][] = [ 'Binding' => $ssob, 'Location' => $ssol, - ); + ]; } if (is_array($slob)) { foreach ($slob as $binding) { - $metaArray['SingleLogoutService'][] = array( + $metaArray['SingleLogoutService'][] = [ 'Binding' => $binding, 'Location' => $slol, - ); + ]; } } else { - $metaArray['SingleLogoutService'][] = array( + $metaArray['SingleLogoutService'][] = [ 'Binding' => $slob, 'Location' => $slol, - ); + ]; } if (count($keys) === 1) { @@ -111,23 +110,31 @@ if ($idpmeta->getBoolean('saml20.sendartifact', false)) { // Artifact sending enabled - $metaArray['ArtifactResolutionService'][] = array( + $metaArray['ArtifactResolutionService'][] = [ 'index' => 0, 'Location' => HTTP::getBaseURL().'saml2/idp/ArtifactResolutionService.php', 'Binding' => Constants::BINDING_SOAP, - ); + ]; } if ($idpmeta->getBoolean('saml20.hok.assertion', false)) { // Prepend HoK SSO Service endpoint. - array_unshift($metaArray['SingleSignOnService'], array( + array_unshift($metaArray['SingleSignOnService'], [ 'hoksso:ProtocolBinding' => Constants::BINDING_HTTP_REDIRECT, 'Binding' => Constants::BINDING_HOK_SSO, 'Location' => HTTP::getBaseURL().'saml2/idp/SSOService.php' - )); + ]); + } + + if ($idpmeta->getBoolean('saml20.ecp', false)) { + $metaArray['SingleSignOnService'][] = [ + 'index' => 0, + 'Binding' => Constants::BINDING_SOAP, + 'Location' => HTTP::getBaseURL().'saml2/idp/SSOService.php', + ]; } - $metaArray['NameIDFormat'] = $idpmeta->getString( + $metaArray['NameIDFormat'] = $idpmeta->getArrayizeString( 'NameIDFormat', 'urn:oasis:names:tc:SAML:2.0:nameid-format:transient' ); @@ -140,7 +147,7 @@ ); if (!$idpmeta->hasValue('OrganizationURL')) { - throw new SimpleSAML_Error_Exception('If OrganizationName is set, OrganizationURL must also be set.'); + throw new \SimpleSAML\Error\Exception('If OrganizationName is set, OrganizationURL must also be set.'); } $metaArray['OrganizationURL'] = $idpmeta->getLocalizedString('OrganizationURL'); } @@ -193,7 +200,7 @@ $metaArray['contacts'][] = Metadata::getContact($techcontact); } - $metaBuilder = new SimpleSAML_Metadata_SAMLBuilder($idpentityid); + $metaBuilder = new \SimpleSAML\Metadata\SAMLBuilder($idpentityid); $metaBuilder->addMetadataIdP20($metaArray); $metaBuilder->addOrganizationInfo($metaArray); @@ -202,29 +209,39 @@ $metaflat = '$metadata['.var_export($idpentityid, true).'] = '.var_export($metaArray, true).';'; // sign the metadata if enabled - $metaxml = SimpleSAML_Metadata_Signer::sign($metaxml, $idpmeta->toArray(), 'SAML 2 IdP'); + $metaxml = \SimpleSAML\Metadata\Signer::sign($metaxml, $idpmeta->toArray(), 'SAML 2 IdP'); if (array_key_exists('output', $_GET) && $_GET['output'] == 'xhtml') { $defaultidp = $config->getString('default-saml20-idp', null); - $t = new SimpleSAML_XHTML_Template($config, 'metadata.php', 'admin'); + $t = new \SimpleSAML\XHTML\Template($config, 'metadata.php', 'admin'); $t->data['clipboard.js'] = true; $t->data['available_certs'] = $availableCerts; + $certdata = []; + foreach (array_keys($availableCerts) as $availableCert) { + $certdata[$availableCert]['name'] = $availableCert; + $certdata[$availableCert]['url'] = SimpleSAML\Module::getModuleURL('saml/idp/certs.php').'/'.$availableCert; + $certdata[$availableCert]['comment'] = ( + $availableCerts[$availableCert]['certFingerprint'][0] === 'afe71c28ef740bc87425be13a2263d37971da1f9' ? + 'This is the default certificate. Generate a new certificate if this is a production system.' : + '' + ); + } + $t->data['certdata'] = $certdata; $t->data['header'] = 'saml20-idp'; // TODO: Replace with headerString in 2.0 - $t->data['headerString'] = $t->noop('metadata_saml20-idp'); + $t->data['headerString'] = \SimpleSAML\Locale\Translate::noop('metadata_saml20-idp'); $t->data['metaurl'] = HTTP::getSelfURLNoQuery(); $t->data['metadata'] = htmlspecialchars($metaxml); $t->data['metadataflat'] = htmlspecialchars($metaflat); $t->data['defaultidp'] = $defaultidp; $t->show(); } else { - header('Content-Type: application/xml'); echo $metaxml; exit(0); } -} catch (Exception $exception) { - throw new SimpleSAML_Error_Error('METADATA', $exception); +} catch (\Exception $exception) { + throw new \SimpleSAML\Error\Error('METADATA', $exception); } diff --git a/vendor/simplesamlphp/simplesamlphp/www/shib13/idp/SSOService.php b/vendor/simplesamlphp/simplesamlphp/www/shib13/idp/SSOService.php index 000d70a398..14a014fcdb 100644 --- a/vendor/simplesamlphp/simplesamlphp/www/shib13/idp/SSOService.php +++ b/vendor/simplesamlphp/simplesamlphp/www/shib13/idp/SSOService.php @@ -1,4 +1,5 @@ <?php + /** * The SSOService is part of the Shibboleth 1.3 IdP code, and it receives incoming Authentication Requests * from a Shibboleth 1.3 SP, parses, and process it, and then authenticates the user and sends the user back @@ -8,12 +9,13 @@ * @package SimpleSAMLphp */ -require_once('../../_include.php'); +require_once '../../_include.php'; -SimpleSAML\Logger::info('Shib1.3 - IdP.SSOService: Accessing Shibboleth 1.3 IdP endpoint SSOService'); +\SimpleSAML\Logger::info('Shib1.3 - IdP.SSOService: Accessing Shibboleth 1.3 IdP endpoint SSOService'); -$metadata = SimpleSAML_Metadata_MetaDataStorageHandler::getMetadataHandler(); +$metadata = \SimpleSAML\Metadata\MetaDataStorageHandler::getMetadataHandler(); $idpEntityId = $metadata->getMetaDataCurrentEntityID('shib13-idp-hosted'); -$idp = SimpleSAML_IdP::getById('saml1:' . $idpEntityId); -sspmod_saml_IdP_SAML1::receiveAuthnRequest($idp); -assert('FALSE'); +$idp = \SimpleSAML\IdP::getById('saml1:'.$idpEntityId); +\SimpleSAML\Module\saml\IdP\SAML1::receiveAuthnRequest($idp); + +assert(false); diff --git a/vendor/simplesamlphp/simplesamlphp/www/shib13/idp/metadata.php b/vendor/simplesamlphp/simplesamlphp/www/shib13/idp/metadata.php index 23c3f6857c..acd5ee33a4 100644 --- a/vendor/simplesamlphp/simplesamlphp/www/shib13/idp/metadata.php +++ b/vendor/simplesamlphp/simplesamlphp/www/shib13/idp/metadata.php @@ -3,48 +3,47 @@ require_once('../../_include.php'); // load configuration and metadata -$config = SimpleSAML_Configuration::getInstance(); -$metadata = SimpleSAML_Metadata_MetaDataStorageHandler::getMetadataHandler(); +$config = \SimpleSAML\Configuration::getInstance(); +$metadata = \SimpleSAML\Metadata\MetaDataStorageHandler::getMetadataHandler(); if (!$config->getBoolean('enable.shib13-idp', false)) { - throw new SimpleSAML_Error_Error('NOACCESS'); + throw new \SimpleSAML\Error\Error('NOACCESS'); } // check if valid local session exists if ($config->getBoolean('admin.protectmetadata', false)) { - SimpleSAML\Utils\Auth::requireAdmin(); + \SimpleSAML\Utils\Auth::requireAdmin(); } try { $idpentityid = isset($_GET['idpentityid']) ? - $_GET['idpentityid'] : - $metadata->getMetaDataCurrentEntityID('shib13-idp-hosted'); + $_GET['idpentityid'] : $metadata->getMetaDataCurrentEntityID('shib13-idp-hosted'); $idpmeta = $metadata->getMetaDataConfig($idpentityid, 'shib13-idp-hosted'); - $keys = array(); - $certInfo = SimpleSAML\Utils\Crypto::loadPublicKey($idpmeta, false, 'new_'); + $keys = []; + $certInfo = \SimpleSAML\Utils\Crypto::loadPublicKey($idpmeta, false, 'new_'); if ($certInfo !== null) { - $keys[] = array( + $keys[] = [ 'type' => 'X509Certificate', 'signing' => true, 'encryption' => false, 'X509Certificate' => $certInfo['certData'], - ); + ]; } - $certInfo = SimpleSAML\Utils\Crypto::loadPublicKey($idpmeta, true); - $keys[] = array( + $certInfo = \SimpleSAML\Utils\Crypto::loadPublicKey($idpmeta, true); + $keys[] = [ 'type' => 'X509Certificate', 'signing' => true, 'encryption' => false, 'X509Certificate' => $certInfo['certData'], - ); + ]; - $metaArray = array( + $metaArray = [ 'metadata-set' => 'shib13-idp-remote', 'entityid' => $idpentityid, 'SingleSignOnService' => $metadata->getGenerated('SingleSignOnService', 'shib13-idp-hosted'), - ); + ]; if (count($keys) === 1) { $metaArray['certData'] = $keys[0]['X509Certificate']; @@ -52,7 +51,7 @@ $metaArray['keys'] = $keys; } - $metaArray['NameIDFormat'] = $idpmeta->getString('NameIDFormat', 'urn:mace:shibboleth:1.0:nameIdentifier'); + $metaArray['NameIDFormat'] = $idpmeta->getArrayizeString('NameIDFormat', 'urn:mace:shibboleth:1.0:nameIdentifier'); if ($idpmeta->hasValue('OrganizationName')) { $metaArray['OrganizationName'] = $idpmeta->getLocalizedString('OrganizationName'); @@ -62,39 +61,37 @@ ); if (!$idpmeta->hasValue('OrganizationURL')) { - throw new SimpleSAML_Error_Exception('If OrganizationName is set, OrganizationURL must also be set.'); + throw new \SimpleSAML\Error\Exception('If OrganizationName is set, OrganizationURL must also be set.'); } $metaArray['OrganizationURL'] = $idpmeta->getLocalizedString('OrganizationURL'); } - $metaflat = '$metadata['.var_export($idpentityid, true).'] = '.var_export($metaArray, true).';'; - $metaBuilder = new SimpleSAML_Metadata_SAMLBuilder($idpentityid); + $metaBuilder = new \SimpleSAML\Metadata\SAMLBuilder($idpentityid); $metaBuilder->addMetadataIdP11($metaArray); $metaBuilder->addOrganizationInfo($metaArray); - $metaBuilder->addContact('technical', \SimpleSAML\Utils\Config\Metadata::getContact(array( + $metaBuilder->addContact('technical', \SimpleSAML\Utils\Config\Metadata::getContact([ 'emailAddress' => $config->getString('technicalcontact_email', null), 'name' => $config->getString('technicalcontact_name', null), 'contactType' => 'technical', - ))); + ])); $metaxml = $metaBuilder->getEntityDescriptorText(); // sign the metadata if enabled - $metaxml = SimpleSAML_Metadata_Signer::sign($metaxml, $idpmeta->toArray(), 'Shib 1.3 IdP'); - + $metaxml = \SimpleSAML\Metadata\Signer::sign($metaxml, $idpmeta->toArray(), 'Shib 1.3 IdP'); if (array_key_exists('output', $_GET) && $_GET['output'] == 'xhtml') { $defaultidp = $config->getString('default-shib13-idp', null); - $t = new SimpleSAML_XHTML_Template($config, 'metadata.php', 'admin'); + $t = new \SimpleSAML\XHTML\Template($config, 'metadata.php', 'admin'); $t->data['clipboard.js'] = true; $t->data['header'] = 'shib13-idp'; // TODO: Replace with headerString in 2.0 - $t->data['headerString'] = $t->noop('metadata_shib13-idp'); + $t->data['headerString'] = \SimpleSAML\Locale\Translate::noop('metadata_shib13-idp'); $t->data['metaurl'] = \SimpleSAML\Utils\HTTP::addURLParameters( \SimpleSAML\Utils\HTTP::getSelfURLNoQuery(), - array('output' => 'xml') + ['output' => 'xml'] ); $t->data['metadata'] = htmlspecialchars($metaxml); $t->data['metadataflat'] = htmlspecialchars($metaflat); @@ -107,6 +104,6 @@ echo $metaxml; exit(0); } -} catch (Exception $exception) { - throw new SimpleSAML_Error_Error('METADATA', $exception); +} catch (\Exception $exception) { + throw new \SimpleSAML\Error\Error('METADATA', $exception); } diff --git a/vendor/symfony/polyfill-ctype/composer.json b/vendor/symfony/polyfill-ctype/composer.json index c24e20ca75..2a2ea044bd 100644 --- a/vendor/symfony/polyfill-ctype/composer.json +++ b/vendor/symfony/polyfill-ctype/composer.json @@ -28,7 +28,7 @@ "minimum-stability": "dev", "extra": { "branch-alias": { - "dev-master": "1.11-dev" + "dev-master": "1.13-dev" } } } diff --git a/vendor/twig/extensions/lib/Twig/Extensions/Extension/Date.php b/vendor/twig/extensions/lib/Twig/Extensions/Extension/Date.php index 56f54a724d..1cdd455d8e 100644 --- a/vendor/twig/extensions/lib/Twig/Extensions/Extension/Date.php +++ b/vendor/twig/extensions/lib/Twig/Extensions/Extension/Date.php @@ -9,6 +9,7 @@ * file that was distributed with this source code. */ use Symfony\Component\Translation\TranslatorInterface; +use Symfony\Component\Translation\IdentityTranslator; /** * @author Robin van der Vleuten <robinvdvleuten@gmail.com> @@ -31,6 +32,11 @@ class Twig_Extensions_Extension_Date extends Twig_Extension public function __construct(TranslatorInterface $translator = null) { + // Ignore the IdentityTranslator, otherwise the parameters won't be replaced properly + if ($translator instanceof IdentityTranslator) { + $translator = null; + } + $this->translator = $translator; } diff --git a/vendor/twig/extensions/lib/Twig/Extensions/Extension/Intl.php b/vendor/twig/extensions/lib/Twig/Extensions/Extension/Intl.php index 81962162d0..49b0f88b50 100644 --- a/vendor/twig/extensions/lib/Twig/Extensions/Extension/Intl.php +++ b/vendor/twig/extensions/lib/Twig/Extensions/Extension/Intl.php @@ -51,7 +51,7 @@ function twig_localized_date_filter(Twig_Environment $env, $date, $dateFormat = 'full' => IntlDateFormatter::FULL, ); - if (PHP_VERSION_ID < 50500) { + if (PHP_VERSION_ID < 50500 || !class_exists('IntlTimeZone')) { $formatter = IntlDateFormatter::create( $locale, $formatValues[$dateFormat], diff --git a/vendor/twig/twig/.gitattributes b/vendor/twig/twig/.gitattributes new file mode 100644 index 0000000000..3a3ce6e7ce --- /dev/null +++ b/vendor/twig/twig/.gitattributes @@ -0,0 +1,2 @@ +/tests export-ignore +/phpunit.xml.dist export-ignore diff --git a/vendor/twig/twig/.gitignore b/vendor/twig/twig/.gitignore index 31103621c6..8a29959e2a 100644 --- a/vendor/twig/twig/.gitignore +++ b/vendor/twig/twig/.gitignore @@ -3,3 +3,4 @@ /ext/twig/autom4te.cache/ /phpunit.xml /vendor +.phpunit.result.cache diff --git a/vendor/twig/twig/.php_cs.dist b/vendor/twig/twig/.php_cs.dist index 1b31c0a3dc..b81882fbf2 100644 --- a/vendor/twig/twig/.php_cs.dist +++ b/vendor/twig/twig/.php_cs.dist @@ -4,6 +4,8 @@ return PhpCsFixer\Config::create() ->setRules([ '@Symfony' => true, '@Symfony:risky' => true, + '@PHPUnit75Migration:risky' => true, + 'php_unit_dedicate_assert' => ['target' => '5.6'], 'array_syntax' => ['syntax' => 'short'], 'php_unit_fqcn_annotation' => true, 'no_unreachable_default_argument_value' => false, diff --git a/vendor/twig/twig/.travis.yml b/vendor/twig/twig/.travis.yml index 291b4a9b88..ff6132b358 100644 --- a/vendor/twig/twig/.travis.yml +++ b/vendor/twig/twig/.travis.yml @@ -1,5 +1,7 @@ language: php +dist: trusty + sudo: false cache: @@ -7,8 +9,11 @@ cache: - vendor - $HOME/.composer/cache/files + env: - - TWIG_EXT=no + global: + - TWIG_EXT=no + - SYMFONY_PHPUNIT_REMOVE_RETURN_TYPEHINT=1 before_install: - phpenv config-rm xdebug.ini || return 0 @@ -25,9 +30,6 @@ script: ./vendor/bin/simple-phpunit jobs: fast_finish: true include: - - php: 5.4 - - php: 5.4 - env: TWIG_EXT=yes - php: 5.5 - php: 5.5 env: TWIG_EXT=yes diff --git a/vendor/twig/twig/CHANGELOG b/vendor/twig/twig/CHANGELOG index 61b3ba4085..b9833e51e9 100644 --- a/vendor/twig/twig/CHANGELOG +++ b/vendor/twig/twig/CHANGELOG @@ -1,3 +1,16 @@ +* 1.42.4 (2019-11-11) + + * optimized "block('foo') ?? 'bar" + * added supported for exponential numbers + +* 1.42.3 (2019-08-24) + + * fixed the "split" filter when the delimiter is "0" + * fixed the "empty" test on Traversable instances + * fixed cache when opcache is installed but disabled + * fixed PHP 7.4 compatibility + * bumped the minimal PHP version to 5.5 + * 1.42.2 (2019-06-18) * Display partial output (PHP buffer) when an error occurs in debug mode diff --git a/vendor/twig/twig/README.rst b/vendor/twig/twig/README.rst index f33ea336d8..d896ff500a 100644 --- a/vendor/twig/twig/README.rst +++ b/vendor/twig/twig/README.rst @@ -7,6 +7,15 @@ and documentation). Twig uses a syntax similar to the Django and Jinja template languages which inspired the Twig runtime environment. +Sponsors +-------- + +.. raw:: html + + <a href="https://blackfire.io/docs/introduction?utm_source=twig&utm_medium=github_readme&utm_campaign=logo"> + <img src="https://static.blackfire.io/assets/intemporals/logo/png/blackfire-io_secondary_horizontal_transparent.png?1" width="255px" alt="Blackfire.io"> + </a> + More Information ---------------- diff --git a/vendor/twig/twig/composer.json b/vendor/twig/twig/composer.json index 2f104658c3..9807aa7711 100644 --- a/vendor/twig/twig/composer.json +++ b/vendor/twig/twig/composer.json @@ -24,12 +24,12 @@ } ], "require": { - "php": ">=5.4.0", + "php": ">=5.5.0", "symfony/polyfill-ctype": "^1.8" }, "require-dev": { - "symfony/phpunit-bridge": "^3.4.19|^4.1.8|^5.0", - "symfony/debug": "^2.7", + "symfony/phpunit-bridge": "^4.4@dev|^5.0", + "symfony/debug": "^3.4|^4.2", "psr/container": "^1.0" }, "autoload": { @@ -40,6 +40,11 @@ "Twig\\" : "src/" } }, + "autoload-dev": { + "psr-4" : { + "Twig\\Tests\\" : "tests" + } + }, "extra": { "branch-alias": { "dev-master": "1.42-dev" diff --git a/vendor/twig/twig/doc/advanced.rst b/vendor/twig/twig/doc/advanced.rst index 29252275be..e253294191 100644 --- a/vendor/twig/twig/doc/advanced.rst +++ b/vendor/twig/twig/doc/advanced.rst @@ -851,7 +851,7 @@ This is very convenient but not recommended as it makes template compilation depend on runtime dependencies even if they are not needed (think for instance as a dependency that connects to a database engine). -As of Twig 1.26, you can easily decouple the extension definitions from their +As of Twig 1.26, you can decouple the extension definitions from their runtime implementations by registering a ``\Twig\RuntimeLoader\RuntimeLoaderInterface`` instance on the environment that knows how to instantiate such runtime classes (runtime classes must be autoload-able):: @@ -943,7 +943,7 @@ The ``IntegrationTest.php`` file should look like this:: public function getFixturesDir() { - return dirname(__FILE__).'/Fixtures/'; + return __DIR__.'/Fixtures/'; } } @@ -958,5 +958,5 @@ Testing the node visitors can be complex, so extend your test cases from `tests/Twig/Node`_ directory. .. _`rot13`: https://secure.php.net/manual/en/function.str-rot13.php -.. _`tests/Twig/Fixtures`: https://github.com/twigphp/Twig/tree/master/test/Twig/Tests/Fixtures -.. _`tests/Twig/Node`: https://github.com/twigphp/Twig/tree/master/test/Twig/Tests/Node +.. _`tests/Twig/Fixtures`: https://github.com/twigphp/Twig/tree/1.x/tests/Fixtures +.. _`tests/Twig/Node`: https://github.com/twigphp/Twig/tree/1.x/tests/Node diff --git a/vendor/twig/twig/doc/advanced_legacy.rst b/vendor/twig/twig/doc/advanced_legacy.rst index 9abfee0509..cc87b9c9e8 100644 --- a/vendor/twig/twig/doc/advanced_legacy.rst +++ b/vendor/twig/twig/doc/advanced_legacy.rst @@ -13,7 +13,7 @@ itself with node visitors. .. note:: - The first section of this chapter describes how to extend Twig easily. If + The first section of this chapter describes how to extend Twig. If you want to reuse your changes in different projects or if you want to share them with others, you should then create an extension as described in the following section. @@ -140,7 +140,7 @@ callable. For instance, let's say you have the following code in a template: When compiling this template to PHP, Twig looks for the PHP callable associated with the ``lower`` filter. The ``lower`` filter is a built-in Twig -filter, and it is simply mapped to the PHP ``strtolower()`` function. After +filter, and it is mapped directly to the PHP ``strtolower()`` function. After compilation, the generated PHP code is roughly equivalent to: .. code-block:: html+php @@ -303,7 +303,7 @@ templates. When compiling this template to PHP, Twig looks for the PHP callable associated with the ``constant`` function. The ``constant`` function is a built-in Twig -function, and it is simply mapped to the PHP ``constant()`` function. After +function, and it is mapped directly to the PHP ``constant()`` function. After compilation, the generated PHP code is roughly equivalent to: .. code-block:: html+php @@ -617,8 +617,7 @@ possible:: .. note:: - Of course, this extension does nothing for now. We will customize it in - the next sections. + This extension does nothing for now. We will customize it in the next sections. Twig does not care where you save your extension on the filesystem, as all extensions must be registered explicitly to be available in your templates. @@ -629,8 +628,8 @@ main ``Environment`` object:: $twig = new \Twig\Environment($loader); $twig->addExtension(new Project_Twig_Extension()); -Of course, you need to first load the extension file by either using -``require_once()`` or by using an autoloader (see `spl_autoload_register()`_). +Don't forget to load first the extension file by either using ``require_once()`` +or by using an autoloader (see `spl_autoload_register()`_). .. tip:: @@ -731,7 +730,7 @@ at the cost of a small overhead. Overriding default Filters .......................... -If some default core filters do not suit your needs, you can easily override +If some default core filters do not suit your needs, you can override them by creating your own extension. Just use the same names as the one you want to override:: @@ -834,7 +833,7 @@ Testing an Extension Functional Tests ~~~~~~~~~~~~~~~~ -You can create functional tests for extensions simply by creating the +You can create functional tests for extensions by creating the following file structure in your test directory:: Fixtures/ @@ -863,7 +862,7 @@ The ``IntegrationTest.php`` file should look like this:: public function getFixturesDir() { - return dirname(__FILE__).'/Fixtures/'; + return __DIR__.'/Fixtures/'; } } @@ -879,5 +878,5 @@ Testing the node visitors can be complex, so extend your test cases from .. _`spl_autoload_register()`: https://secure.php.net/spl_autoload_register .. _`rot13`: https://secure.php.net/manual/en/function.str-rot13.php -.. _`tests/Twig/Fixtures`: https://github.com/twigphp/Twig/tree/master/test/Twig/Tests/Fixtures -.. _`tests/Twig/Node`: https://github.com/twigphp/Twig/tree/master/test/Twig/Tests/Node +.. _`tests/Twig/Fixtures`: https://github.com/twigphp/Twig/tree/1.x/tests/Fixtures +.. _`tests/Twig/Node`: https://github.com/twigphp/Twig/tree/1.x/tests/Node diff --git a/vendor/twig/twig/doc/filters/batch.rst b/vendor/twig/twig/doc/filters/batch.rst index cc50ec8e85..a1271735e4 100644 --- a/vendor/twig/twig/doc/filters/batch.rst +++ b/vendor/twig/twig/doc/filters/batch.rst @@ -49,3 +49,4 @@ Arguments * ``size``: The size of the batch; fractional numbers will be rounded up * ``fill``: Used to fill in missing items +* ``preserve_keys``: Whether to preserve keys or not diff --git a/vendor/twig/twig/doc/filters/date.rst b/vendor/twig/twig/doc/filters/date.rst index b8f00bf2eb..b36a773256 100644 --- a/vendor/twig/twig/doc/filters/date.rst +++ b/vendor/twig/twig/doc/filters/date.rst @@ -47,7 +47,7 @@ date, use a ternary operator: {{ post.published_at is empty ? "" : post.published_at|date("m/d/Y") }} If no format is provided, Twig will use the default one: ``F j, Y H:i``. This -default can be easily changed by calling the ``setDateFormat()`` method on the +default can be changed by calling the ``setDateFormat()`` method on the ``core`` extension instance. The first argument is the default format for dates and the second one is the default format for date intervals: diff --git a/vendor/twig/twig/doc/filters/date_modify.rst b/vendor/twig/twig/doc/filters/date_modify.rst index 562cb634a9..e4217d59fe 100644 --- a/vendor/twig/twig/doc/filters/date_modify.rst +++ b/vendor/twig/twig/doc/filters/date_modify.rst @@ -11,7 +11,7 @@ The ``date_modify`` filter modifies a date with a given modifier string: {{ post.published_at|date_modify("+1 day")|date("m/d/Y") }} The ``date_modify`` filter accepts strings (it must be in a format supported -by the `strtotime`_ function) or `DateTime`_ instances. You can easily combine +by the `strtotime`_ function) or `DateTime`_ instances. You can combine it with the :doc:`date<date>` filter for formatting. Arguments diff --git a/vendor/twig/twig/doc/filters/map.rst b/vendor/twig/twig/doc/filters/map.rst index 777b05a7c3..e983e33b48 100644 --- a/vendor/twig/twig/doc/filters/map.rst +++ b/vendor/twig/twig/doc/filters/map.rst @@ -26,7 +26,7 @@ The arrow function also receives the key as a second argument: "Alice": "Dupond", } %} - {{ people|map((first, last) => "#{first} #{last}")|join(', ') }} + {{ people|map((last, first) => "#{first} #{last}")|join(', ') }} {# outputs Bob Smith, Alice Dupond #} Note that the arrow function has access to the current context. @@ -34,5 +34,4 @@ Note that the arrow function has access to the current context. Arguments --------- -* ``array``: The sequence or mapping * ``arrow``: The arrow function diff --git a/vendor/twig/twig/doc/filters/number_format.rst b/vendor/twig/twig/doc/filters/number_format.rst index 59335e3c63..83366da98d 100644 --- a/vendor/twig/twig/doc/filters/number_format.rst +++ b/vendor/twig/twig/doc/filters/number_format.rst @@ -33,7 +33,7 @@ options of: * ``.`` as the decimal point. * ``,`` as the thousands separator. -These defaults can be easily changed through the core extension: +These defaults can be changed through the core extension: .. code-block:: php diff --git a/vendor/twig/twig/doc/filters/reduce.rst b/vendor/twig/twig/doc/filters/reduce.rst index 7d04d6c7b0..fd3896732a 100644 --- a/vendor/twig/twig/doc/filters/reduce.rst +++ b/vendor/twig/twig/doc/filters/reduce.rst @@ -28,6 +28,5 @@ Note that the arrow function has access to the current context. Arguments --------- -* ``array``: The sequence or mapping * ``arrow``: The arrow function * ``initial``: The initial value diff --git a/vendor/twig/twig/doc/internals.rst b/vendor/twig/twig/doc/internals.rst index 4b1a1abffd..ba908d496c 100644 --- a/vendor/twig/twig/doc/internals.rst +++ b/vendor/twig/twig/doc/internals.rst @@ -1,7 +1,7 @@ Twig Internals ============== -Twig is very extensible and you can easily hack it. Keep in mind that you +Twig is very extensible and you can hack it. Keep in mind that you should probably try to create an extension before hacking the core, as most features and enhancements can be handled with extensions. This chapter is also useful for people who want to understand how Twig works under the hood. diff --git a/vendor/twig/twig/doc/intro.rst b/vendor/twig/twig/doc/intro.rst index d1f9c59e89..1f52c80a89 100644 --- a/vendor/twig/twig/doc/intro.rst +++ b/vendor/twig/twig/doc/intro.rst @@ -26,7 +26,7 @@ Slim, Yii, Laravel, and Codeigniter — just to name a few. Prerequisites ------------- -Twig needs at least **PHP 5.4.0** to run. +Twig needs at least **PHP 5.5.0** to run. Installation ------------ diff --git a/vendor/twig/twig/doc/recipes.rst b/vendor/twig/twig/doc/recipes.rst index a8238b58bf..7e72b71644 100644 --- a/vendor/twig/twig/doc/recipes.rst +++ b/vendor/twig/twig/doc/recipes.rst @@ -131,7 +131,7 @@ might be tempted to write the following: {# page.twig in .../templates/mysite #} {% extends "page.twig" %} {# from .../templates/default #} -Of course, this will not work as Twig will always load the template from +However, this will not work as Twig will always load the template from ``.../templates/mysite``. It turns out it is possible to get this to work, by adding a directory right @@ -361,7 +361,7 @@ To get around this, force Twig to invalidate the bytecode cache:: parent::writeCacheFile($file, $content); // Compile cached file into bytecode cache - if (function_exists('opcache_invalidate')) { + if (function_exists('opcache_invalidate') && filter_var(ini_get('opcache.enable'), FILTER_VALIDATE_BOOLEAN)) { opcache_invalidate($file, true); } elseif (function_exists('apc_compile_file')) { apc_compile_file($file); @@ -376,7 +376,7 @@ When attaching a visitor to a ``\Twig\Environment`` instance, Twig uses it to visit *all* templates it compiles. If you need to keep some state information around, you probably want to reset it when visiting a new template. -This can be easily achieved with the following code:: +This can be achieved with the following code:: protected $someTemplateState = []; @@ -511,7 +511,7 @@ remove it from the database, and everything else will still work as before. Loading a Template from a String -------------------------------- -From a template, you can easily load a template stored in a string via the +From a template, you can load a template stored in a string via the ``template_from_string`` function (available as of Twig 1.11 via the ``\Twig\Extension\StringLoaderExtension`` extension): diff --git a/vendor/twig/twig/doc/tags/extends.rst b/vendor/twig/twig/doc/tags/extends.rst index e2dc76365f..9de5917835 100644 --- a/vendor/twig/twig/doc/tags/extends.rst +++ b/vendor/twig/twig/doc/tags/extends.rst @@ -104,7 +104,7 @@ Named Block End-Tags -------------------- Twig allows you to put the name of the block after the end tag for better -readability: +readability (the name after the ``endblock`` word must match the block name): .. code-block:: twig @@ -114,8 +114,6 @@ readability: {% endblock inner_sidebar %} {% endblock sidebar %} -Of course, the name after the ``endblock`` word must match the block name. - Block Nesting and Scope ----------------------- diff --git a/vendor/twig/twig/doc/tags/include.rst b/vendor/twig/twig/doc/tags/include.rst index 70d05c8569..661280f92e 100644 --- a/vendor/twig/twig/doc/tags/include.rst +++ b/vendor/twig/twig/doc/tags/include.rst @@ -20,7 +20,7 @@ of that file: template outputs its rendered contents in the current scope; a tag should not display anything); - * The rendered template can be more easily stored in a variable when using + * It's easier to store the rendered template in a variable when using the ``include`` function: .. code-block:: twig diff --git a/vendor/twig/twig/doc/tags/macro.rst b/vendor/twig/twig/doc/tags/macro.rst index e1c97f32d4..31bca00a51 100644 --- a/vendor/twig/twig/doc/tags/macro.rst +++ b/vendor/twig/twig/doc/tags/macro.rst @@ -109,7 +109,7 @@ via the ``from`` tag: Importing macros using ``import`` or ``from`` is **local** to the current file. The imported macros are not available in included templates or child - templates; you need to explicitely re-import macros in each file. + templates; you need to explicitly re-import macros in each file. .. tip:: @@ -130,12 +130,10 @@ Named Macro End-Tags -------------------- Twig allows you to put the name of the macro after the end tag for better -readability: +readability (the name after the ``endmacro`` word must match the macro name): .. code-block:: twig {% macro input() %} ... {% endmacro input %} - -Of course, the name after the ``endmacro`` word must match the macro name. diff --git a/vendor/twig/twig/doc/templates.rst b/vendor/twig/twig/doc/templates.rst index e1daaf4515..168a8f7085 100644 --- a/vendor/twig/twig/doc/templates.rst +++ b/vendor/twig/twig/doc/templates.rst @@ -517,7 +517,7 @@ Twig allows expressions everywhere. ``or``, ``and``, ``==``, ``!=``, ``<``, ``>``, ``>=``, ``<=``, ``in``, ``matches``, ``starts with``, ``ends with``, ``..``, ``+``, ``-``, ``~``, ``*``, ``/``, ``//``, ``%``, ``is`` (tests), ``**``, ``??``, ``|`` - (filters), ``[]``, and ``.``. + (filters), ``[]``, and ``.``: .. code-block:: twig diff --git a/vendor/twig/twig/ext/twig/php_twig.h b/vendor/twig/twig/ext/twig/php_twig.h index 0fdc539a9c..6cc47b689e 100644 --- a/vendor/twig/twig/ext/twig/php_twig.h +++ b/vendor/twig/twig/ext/twig/php_twig.h @@ -15,7 +15,7 @@ #ifndef PHP_TWIG_H #define PHP_TWIG_H -#define PHP_TWIG_VERSION "1.42.2" +#define PHP_TWIG_VERSION "1.42.4" #include "php.h" diff --git a/vendor/twig/twig/phpunit.xml.dist b/vendor/twig/twig/phpunit.xml.dist deleted file mode 100644 index c35257f5df..0000000000 --- a/vendor/twig/twig/phpunit.xml.dist +++ /dev/null @@ -1,33 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<phpunit backupGlobals="false" - backupStaticAttributes="false" - colors="true" - convertErrorsToExceptions="true" - convertNoticesToExceptions="true" - convertWarningsToExceptions="true" - processIsolation="false" - stopOnFailure="false" - bootstrap="vendor/autoload.php" -> - <testsuites> - <testsuite name="Twig Test Suite"> - <directory>./test/Twig/</directory> - </testsuite> - </testsuites> - - <php> - <ini name="error_reporting" value="-1" /> - <ini name="xdebug.overload_var_dump" value="0" /> - </php> - - <listeners> - <listener class="Symfony\Bridge\PhpUnit\SymfonyTestsListener" /> - </listeners> - - <filter> - <whitelist> - <directory suffix=".php">./src/</directory> - </whitelist> - </filter> -</phpunit> diff --git a/vendor/twig/twig/src/Cache/FilesystemCache.php b/vendor/twig/twig/src/Cache/FilesystemCache.php index 7e228799a6..b7c1e438e7 100644 --- a/vendor/twig/twig/src/Cache/FilesystemCache.php +++ b/vendor/twig/twig/src/Cache/FilesystemCache.php @@ -67,8 +67,8 @@ public function write($key, $content) if (self::FORCE_BYTECODE_INVALIDATION == ($this->options & self::FORCE_BYTECODE_INVALIDATION)) { // Compile cached file into bytecode cache - if (\function_exists('opcache_invalidate')) { - opcache_invalidate($key, true); + if (\function_exists('opcache_invalidate') && filter_var(ini_get('opcache.enable'), FILTER_VALIDATE_BOOLEAN)) { + @opcache_invalidate($key, true); } elseif (\function_exists('apc_compile_file')) { apc_compile_file($key); } diff --git a/vendor/twig/twig/src/Environment.php b/vendor/twig/twig/src/Environment.php index 509db80276..1f80f3a873 100644 --- a/vendor/twig/twig/src/Environment.php +++ b/vendor/twig/twig/src/Environment.php @@ -41,11 +41,11 @@ */ class Environment { - const VERSION = '1.42.2'; - const VERSION_ID = 14202; + const VERSION = '1.42.4'; + const VERSION_ID = 14204; const MAJOR_VERSION = 1; const MINOR_VERSION = 42; - const RELEASE_VERSION = 2; + const RELEASE_VERSION = 4; const EXTRA_VERSION = ''; protected $charset; @@ -515,7 +515,7 @@ public function loadClass($cls, $name, $index = null) * * This method should not be used as a generic way to load templates. * - * @param string $template The template name + * @param string $template The template source * @param string $name An optional name of the template to be used in error messages * * @return TemplateWrapper A template instance representing the given template name diff --git a/vendor/twig/twig/src/Extension/CoreExtension.php b/vendor/twig/twig/src/Extension/CoreExtension.php index 80ced9815c..5f3cc24a19 100644 --- a/vendor/twig/twig/src/Extension/CoreExtension.php +++ b/vendor/twig/twig/src/Extension/CoreExtension.php @@ -790,7 +790,7 @@ function twig_join_filter($value, $glue = '', $and = null) */ function twig_split_filter(Environment $env, $value, $delimiter, $limit = null) { - if (!empty($delimiter)) { + if (\strlen($delimiter) > 0) { return null === $limit ? explode($delimiter, $value) : explode($delimiter, $value, $limit); } @@ -1507,6 +1507,10 @@ function twig_test_empty($value) return 0 == \count($value); } + if ($value instanceof \Traversable) { + return !iterator_count($value); + } + if (\is_object($value) && method_exists($value, '__toString')) { return '' === (string) $value; } diff --git a/vendor/twig/twig/src/Lexer.php b/vendor/twig/twig/src/Lexer.php index 8cae3597f1..697a6cfa1d 100644 --- a/vendor/twig/twig/src/Lexer.php +++ b/vendor/twig/twig/src/Lexer.php @@ -47,7 +47,7 @@ class Lexer implements \Twig_LexerInterface const STATE_INTERPOLATION = 4; const REGEX_NAME = '/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/A'; - const REGEX_NUMBER = '/[0-9]+(?:\.[0-9]+)?/A'; + const REGEX_NUMBER = '/[0-9]+(?:\.[0-9]+)?([Ee][\+\-][0-9]+)?/A'; const REGEX_STRING = '/"([^#"\\\\]*(?:\\\\.[^#"\\\\]*)*)"|\'([^\'\\\\]*(?:\\\\.[^\'\\\\]*)*)\'/As'; const REGEX_DQ_STRING_DELIM = '/"/A'; const REGEX_DQ_STRING_PART = '/[^#"\\\\]*(?:(?:\\\\.|#(?!\{))[^#"\\\\]*)*/As'; diff --git a/vendor/twig/twig/src/Node/Expression/NullCoalesceExpression.php b/vendor/twig/twig/src/Node/Expression/NullCoalesceExpression.php index 49326d467d..917d31a3b2 100644 --- a/vendor/twig/twig/src/Node/Expression/NullCoalesceExpression.php +++ b/vendor/twig/twig/src/Node/Expression/NullCoalesceExpression.php @@ -22,11 +22,15 @@ class NullCoalesceExpression extends ConditionalExpression { public function __construct(\Twig_NodeInterface $left, \Twig_NodeInterface $right, $lineno) { - $test = new AndBinary( - new DefinedTest(clone $left, 'defined', new Node(), $left->getTemplateLine()), - new NotUnary(new NullTest($left, 'null', new Node(), $left->getTemplateLine()), $left->getTemplateLine()), - $left->getTemplateLine() - ); + $test = new DefinedTest(clone $left, 'defined', new Node(), $left->getTemplateLine()); + // for "block()", we don't need the null test as the return value is always a string + if (!$left instanceof BlockReferenceExpression) { + $test = new AndBinary( + $test, + new NotUnary(new NullTest($left, 'null', new Node(), $left->getTemplateLine()), $left->getTemplateLine()), + $left->getTemplateLine() + ); + } parent::__construct($test, $left, $right, $lineno); } diff --git a/vendor/twig/twig/src/Template.php b/vendor/twig/twig/src/Template.php index 435f8c67e1..3f7447c126 100644 --- a/vendor/twig/twig/src/Template.php +++ b/vendor/twig/twig/src/Template.php @@ -537,7 +537,7 @@ protected function getAttribute($object, $item, array $arguments = [], $type = s if (self::METHOD_CALL !== $type) { $arrayItem = \is_bool($item) || \is_float($item) ? (int) $item : $item; - if (((\is_array($object) || $object instanceof \ArrayObject) && (isset($object[$arrayItem]) || \array_key_exists($arrayItem, $object))) + if (((\is_array($object) || $object instanceof \ArrayObject) && (isset($object[$arrayItem]) || \array_key_exists($arrayItem, (array) $object))) || ($object instanceof \ArrayAccess && isset($object[$arrayItem])) ) { if ($isDefinedTest) { @@ -604,7 +604,7 @@ protected function getAttribute($object, $item, array $arguments = [], $type = s // object property if (self::METHOD_CALL !== $type && !$object instanceof self) { // \Twig\Template does not have public properties, and we don't want to allow access to internal ones - if (isset($object->$item) || \array_key_exists((string) $item, $object)) { + if (isset($object->$item) || \array_key_exists((string) $item, (array) $object)) { if ($isDefinedTest) { return true; } diff --git a/vendor/twig/twig/test/Twig/Tests/AutoloaderTest.php b/vendor/twig/twig/test/Twig/Tests/AutoloaderTest.php deleted file mode 100644 index 42529402e4..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/AutoloaderTest.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -/* - * This file is part of Twig. - * - * (c) Fabien Potencier - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -class Twig_Tests_AutoloaderTest extends \PHPUnit\Framework\TestCase -{ - /** - * @group legacy - */ - public function testAutoload() - { - $this->assertFalse(class_exists('FooBarFoo'), '->autoload() does not try to load classes that does not begin with Twig'); - - $autoloader = new Twig_Autoloader(); - $this->assertNull($autoloader->autoload('Foo'), '->autoload() returns false if it is not able to load a class'); - } -} diff --git a/vendor/twig/twig/test/Twig/Tests/Cache/FilesystemTest.php b/vendor/twig/twig/test/Twig/Tests/Cache/FilesystemTest.php deleted file mode 100644 index 8ea464d632..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Cache/FilesystemTest.php +++ /dev/null @@ -1,195 +0,0 @@ -<?php - -/* - * This file is part of Twig. - * - * (c) Fabien Potencier - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Twig\Cache\FilesystemCache; - -require_once \dirname(__DIR__).'/FilesystemHelper.php'; - -class Twig_Tests_Cache_FilesystemTest extends \PHPUnit\Framework\TestCase -{ - private $classname; - private $directory; - private $cache; - - protected function setUp() - { - $nonce = hash('sha256', uniqid(mt_rand(), true)); - $this->classname = '__Twig_Tests_Cache_FilesystemTest_Template_'.$nonce; - $this->directory = sys_get_temp_dir().'/twig-test'; - $this->cache = new FilesystemCache($this->directory); - } - - protected function tearDown() - { - if (file_exists($this->directory)) { - Twig_Tests_FilesystemHelper::removeDir($this->directory); - } - } - - public function testLoad() - { - $key = $this->directory.'/cache/cachefile.php'; - - $dir = \dirname($key); - @mkdir($dir, 0777, true); - $this->assertTrue(is_dir($dir)); - $this->assertFalse(class_exists($this->classname, false)); - - $content = $this->generateSource(); - file_put_contents($key, $content); - - $this->cache->load($key); - - $this->assertTrue(class_exists($this->classname, false)); - } - - public function testLoadMissing() - { - $key = $this->directory.'/cache/cachefile.php'; - - $this->assertFalse(class_exists($this->classname, false)); - - $this->cache->load($key); - - $this->assertFalse(class_exists($this->classname, false)); - } - - public function testWrite() - { - $key = $this->directory.'/cache/cachefile.php'; - $content = $this->generateSource(); - - $this->assertFileNotExists($key); - $this->assertFileNotExists($this->directory); - - $this->cache->write($key, $content); - - $this->assertFileExists($this->directory); - $this->assertFileExists($key); - $this->assertSame(file_get_contents($key), $content); - } - - /** - * @expectedException \RuntimeException - * @expectedExceptionMessage Unable to create the cache directory - */ - public function testWriteFailMkdir() - { - if (\defined('PHP_WINDOWS_VERSION_BUILD')) { - $this->markTestSkipped('Read-only directories not possible on Windows.'); - } - - $key = $this->directory.'/cache/cachefile.php'; - $content = $this->generateSource(); - - $this->assertFileNotExists($key); - - // Create read-only root directory. - @mkdir($this->directory, 0555, true); - $this->assertTrue(is_dir($this->directory)); - - $this->cache->write($key, $content); - } - - /** - * @expectedException \RuntimeException - * @expectedExceptionMessage Unable to write in the cache directory - */ - public function testWriteFailDirWritable() - { - if (\defined('PHP_WINDOWS_VERSION_BUILD')) { - $this->markTestSkipped('Read-only directories not possible on Windows.'); - } - - $key = $this->directory.'/cache/cachefile.php'; - $content = $this->generateSource(); - - $this->assertFileNotExists($key); - - // Create root directory. - @mkdir($this->directory, 0777, true); - // Create read-only subdirectory. - @mkdir($this->directory.'/cache', 0555); - $this->assertTrue(is_dir($this->directory.'/cache')); - - $this->cache->write($key, $content); - } - - /** - * @expectedException \RuntimeException - * @expectedExceptionMessage Failed to write cache file - */ - public function testWriteFailWriteFile() - { - $key = $this->directory.'/cache/cachefile.php'; - $content = $this->generateSource(); - - $this->assertFileNotExists($key); - - // Create a directory in the place of the cache file. - @mkdir($key, 0777, true); - $this->assertTrue(is_dir($key)); - - $this->cache->write($key, $content); - } - - public function testGetTimestamp() - { - $key = $this->directory.'/cache/cachefile.php'; - - $dir = \dirname($key); - @mkdir($dir, 0777, true); - $this->assertTrue(is_dir($dir)); - - // Create the file with a specific modification time. - touch($key, 1234567890); - - $this->assertSame(1234567890, $this->cache->getTimestamp($key)); - } - - public function testGetTimestampMissingFile() - { - $key = $this->directory.'/cache/cachefile.php'; - $this->assertSame(0, $this->cache->getTimestamp($key)); - } - - /** - * Test file cache is tolerant towards trailing (back)slashes on the configured cache directory. - * - * @dataProvider provideDirectories - */ - public function testGenerateKey($expected, $input) - { - $cache = new FilesystemCache($input); - $this->assertRegExp($expected, $cache->generateKey('_test_', \get_class($this))); - } - - public function provideDirectories() - { - $pattern = '#a/b/[a-zA-Z0-9]+/[a-zA-Z0-9]+.php$#'; - - return [ - [$pattern, 'a/b'], - [$pattern, 'a/b/'], - [$pattern, 'a/b\\'], - [$pattern, 'a/b\\/'], - [$pattern, 'a/b\\//'], - ['#/'.substr($pattern, 1), '/a/b'], - ]; - } - - private function generateSource() - { - return strtr('<?php class {{classname}} {}', [ - '{{classname}}' => $this->classname, - ]); - } -} diff --git a/vendor/twig/twig/test/Twig/Tests/CompilerTest.php b/vendor/twig/twig/test/Twig/Tests/CompilerTest.php deleted file mode 100644 index 5191b28cb9..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/CompilerTest.php +++ /dev/null @@ -1,36 +0,0 @@ -<?php - -/* - * This file is part of Twig. - * - * (c) Fabien Potencier - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Twig\Compiler; -use Twig\Environment; - -class Twig_Tests_CompilerTest extends \PHPUnit\Framework\TestCase -{ - public function testReprNumericValueWithLocale() - { - $compiler = new Compiler(new Environment($this->getMockBuilder('\Twig\Loader\LoaderInterface')->getMock())); - - $locale = setlocale(LC_NUMERIC, 0); - if (false === $locale) { - $this->markTestSkipped('Your platform does not support locales.'); - } - - $required_locales = ['fr_FR.UTF-8', 'fr_FR.UTF8', 'fr_FR.utf-8', 'fr_FR.utf8', 'French_France.1252']; - if (false === setlocale(LC_NUMERIC, $required_locales)) { - $this->markTestSkipped('Could not set any of required locales: '.implode(', ', $required_locales)); - } - - $this->assertEquals('1.2', $compiler->repr(1.2)->getSource()); - $this->assertContains('fr', strtolower(setlocale(LC_NUMERIC, 0))); - - setlocale(LC_NUMERIC, $locale); - } -} diff --git a/vendor/twig/twig/test/Twig/Tests/ContainerRuntimeLoaderTest.php b/vendor/twig/twig/test/Twig/Tests/ContainerRuntimeLoaderTest.php deleted file mode 100644 index 1c04ef2017..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/ContainerRuntimeLoaderTest.php +++ /dev/null @@ -1,42 +0,0 @@ -<?php - -/* - * This file is part of Twig. - * - * (c) Fabien Potencier - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Twig\RuntimeLoader\ContainerRuntimeLoader; - -class Twig_Tests_ContainerRuntimeLoaderTest extends \PHPUnit\Framework\TestCase -{ - /** - * @requires PHP 5.3 - */ - public function testLoad() - { - $container = $this->getMockBuilder('Psr\Container\ContainerInterface')->getMock(); - $container->expects($this->once())->method('has')->with('stdClass')->willReturn(true); - $container->expects($this->once())->method('get')->with('stdClass')->willReturn(new \stdClass()); - - $loader = new ContainerRuntimeLoader($container); - - $this->assertInstanceOf('stdClass', $loader->load('stdClass')); - } - - /** - * @requires PHP 5.3 - */ - public function testLoadUnknownRuntimeReturnsNull() - { - $container = $this->getMockBuilder('Psr\Container\ContainerInterface')->getMock(); - $container->expects($this->once())->method('has')->with('Foo'); - $container->expects($this->never())->method('get'); - - $loader = new ContainerRuntimeLoader($container); - $this->assertNull($loader->load('Foo')); - } -} diff --git a/vendor/twig/twig/test/Twig/Tests/CustomExtensionTest.php b/vendor/twig/twig/test/Twig/Tests/CustomExtensionTest.php deleted file mode 100644 index 6505313738..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/CustomExtensionTest.php +++ /dev/null @@ -1,96 +0,0 @@ -<?php - -/* - * This file is part of Twig. - * - * (c) Fabien Potencier - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Twig\Environment; -use Twig\Extension\ExtensionInterface; - -class CustomExtensionTest extends \PHPUnit\Framework\TestCase -{ - /** - * @requires PHP 5.3 - * @dataProvider provideInvalidExtensions - */ - public function testGetInvalidOperators(ExtensionInterface $extension, $expectedExceptionMessage) - { - if (method_exists($this, 'expectException')) { - $this->expectException('InvalidArgumentException'); - $this->expectExceptionMessage($expectedExceptionMessage); - } else { - $this->setExpectedException('InvalidArgumentException', $expectedExceptionMessage); - } - - $env = new Environment($this->getMockBuilder('\Twig\Loader\LoaderInterface')->getMock()); - $env->addExtension($extension); - $env->getUnaryOperators(); - } - - public function provideInvalidExtensions() - { - return [ - [new InvalidOperatorExtension(new \stdClass()), '"InvalidOperatorExtension::getOperators()" must return an array with operators, got "stdClass".'], - [new InvalidOperatorExtension([1, 2, 3]), '"InvalidOperatorExtension::getOperators()" must return an array of 2 elements, got 3.'], - ]; - } -} - -class InvalidOperatorExtension implements ExtensionInterface -{ - private $operators; - - public function __construct($operators) - { - $this->operators = $operators; - } - - public function initRuntime(Environment $environment) - { - } - - public function getTokenParsers() - { - return []; - } - - public function getNodeVisitors() - { - return []; - } - - public function getFilters() - { - return []; - } - - public function getTests() - { - return []; - } - - public function getFunctions() - { - return []; - } - - public function getGlobals() - { - return []; - } - - public function getOperators() - { - return $this->operators; - } - - public function getName() - { - return __CLASS__; - } -} diff --git a/vendor/twig/twig/test/Twig/Tests/EnvironmentTest.php b/vendor/twig/twig/test/Twig/Tests/EnvironmentTest.php deleted file mode 100644 index 2cb29c9166..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/EnvironmentTest.php +++ /dev/null @@ -1,677 +0,0 @@ -<?php - -/* - * This file is part of Twig. - * - * (c) Fabien Potencier - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Twig\Cache\FilesystemCache; -use Twig\Environment; -use Twig\Extension\AbstractExtension; -use Twig\Extension\GlobalsInterface; -use Twig\Extension\InitRuntimeInterface; -use Twig\Loader\ArrayLoader; -use Twig\Loader\LoaderInterface; -use Twig\Loader\SourceContextLoaderInterface; -use Twig\NodeVisitor\NodeVisitorInterface; -use Twig\Source; -use Twig\Token; -use Twig\TokenParser\AbstractTokenParser; -use Twig\TwigFilter; -use Twig\TwigFunction; -use Twig\TwigTest; - -require_once __DIR__.'/FilesystemHelper.php'; - -class Twig_Tests_EnvironmentTest extends \PHPUnit\Framework\TestCase -{ - private $deprecations = []; - - /** - * @group legacy - */ - public function testLegacyTokenizeSignature() - { - $env = new Environment(); - $stream = $env->tokenize('{{ foo }}', 'foo'); - $this->assertEquals('{{ foo }}', $stream->getSource()); - $this->assertEquals('foo', $stream->getFilename()); - } - - /** - * @group legacy - */ - public function testLegacyCompileSourceSignature() - { - $loader = new ArrayLoader(['foo' => '{{ foo }}']); - $env = new Environment($loader); - $this->assertContains('getTemplateName', $env->compileSource('{{ foo }}', 'foo')); - } - - /** - * @expectedException \LogicException - * @expectedExceptionMessage You must set a loader first. - * @group legacy - */ - public function testRenderNoLoader() - { - $env = new Environment(); - $env->render('test'); - } - - public function testAutoescapeOption() - { - $loader = new ArrayLoader([ - 'html' => '{{ foo }} {{ foo }}', - 'js' => '{{ bar }} {{ bar }}', - ]); - - $twig = new Environment($loader, [ - 'debug' => true, - 'cache' => false, - 'autoescape' => [$this, 'escapingStrategyCallback'], - ]); - - $this->assertEquals('foo<br/ > foo<br/ >', $twig->render('html', ['foo' => 'foo<br/ >'])); - $this->assertEquals('foo\u003Cbr\/\u0020\u003E foo\u003Cbr\/\u0020\u003E', $twig->render('js', ['bar' => 'foo<br/ >'])); - } - - public function escapingStrategyCallback($name) - { - return $name; - } - - public function testGlobals() - { - // to be removed in 2.0 - $loader = $this->getMockBuilder('Twig_EnvironmentTestLoaderInterface')->getMock(); - //$loader = $this->getMockBuilder(['\Twig\Loader\LoaderInterface', '\Twig\Loader\SourceContextLoaderInterface'])->getMock(); - $loader->expects($this->any())->method('getSourceContext')->willReturn(new Source('', '')); - - // globals can be added after calling getGlobals - - $twig = new Environment($loader); - $twig->addGlobal('foo', 'foo'); - $twig->getGlobals(); - $twig->addGlobal('foo', 'bar'); - $globals = $twig->getGlobals(); - $this->assertEquals('bar', $globals['foo']); - - // globals can be modified after a template has been loaded - $twig = new Environment($loader); - $twig->addGlobal('foo', 'foo'); - $twig->getGlobals(); - $twig->load('index'); - $twig->addGlobal('foo', 'bar'); - $globals = $twig->getGlobals(); - $this->assertEquals('bar', $globals['foo']); - - // globals can be modified after extensions init - $twig = new Environment($loader); - $twig->addGlobal('foo', 'foo'); - $twig->getGlobals(); - $twig->getFunctions(); - $twig->addGlobal('foo', 'bar'); - $globals = $twig->getGlobals(); - $this->assertEquals('bar', $globals['foo']); - - // globals can be modified after extensions and a template has been loaded - $arrayLoader = new ArrayLoader(['index' => '{{foo}}']); - $twig = new Environment($arrayLoader); - $twig->addGlobal('foo', 'foo'); - $twig->getGlobals(); - $twig->getFunctions(); - $twig->load('index'); - $twig->addGlobal('foo', 'bar'); - $globals = $twig->getGlobals(); - $this->assertEquals('bar', $globals['foo']); - - $twig = new Environment($arrayLoader); - $twig->getGlobals(); - $twig->addGlobal('foo', 'bar'); - $template = $twig->load('index'); - $this->assertEquals('bar', $template->render([])); - - /* to be uncomment in Twig 2.0 - // globals cannot be added after a template has been loaded - $twig = new Environment($loader); - $twig->addGlobal('foo', 'foo'); - $twig->getGlobals(); - $twig->load('index'); - try { - $twig->addGlobal('bar', 'bar'); - $this->fail(); - } catch (\LogicException $e) { - $this->assertFalse(array_key_exists('bar', $twig->getGlobals())); - } - - // globals cannot be added after extensions init - $twig = new Environment($loader); - $twig->addGlobal('foo', 'foo'); - $twig->getGlobals(); - $twig->getFunctions(); - try { - $twig->addGlobal('bar', 'bar'); - $this->fail(); - } catch (\LogicException $e) { - $this->assertFalse(array_key_exists('bar', $twig->getGlobals())); - } - - // globals cannot be added after extensions and a template has been loaded - $twig = new Environment($loader); - $twig->addGlobal('foo', 'foo'); - $twig->getGlobals(); - $twig->getFunctions(); - $twig->load('index'); - try { - $twig->addGlobal('bar', 'bar'); - $this->fail(); - } catch (\LogicException $e) { - $this->assertFalse(array_key_exists('bar', $twig->getGlobals())); - } - - // test adding globals after a template has been loaded without call to getGlobals - $twig = new Environment($loader); - $twig->load('index'); - try { - $twig->addGlobal('bar', 'bar'); - $this->fail(); - } catch (\LogicException $e) { - $this->assertFalse(array_key_exists('bar', $twig->getGlobals())); - } - */ - } - - public function testExtensionsAreNotInitializedWhenRenderingACompiledTemplate() - { - $cache = new FilesystemCache($dir = sys_get_temp_dir().'/twig'); - $options = ['cache' => $cache, 'auto_reload' => false, 'debug' => false]; - - // force compilation - $twig = new Environment($loader = new ArrayLoader(['index' => '{{ foo }}']), $options); - - $key = $cache->generateKey('index', $twig->getTemplateClass('index')); - $cache->write($key, $twig->compileSource(new Source('{{ foo }}', 'index'))); - - // check that extensions won't be initialized when rendering a template that is already in the cache - $twig = $this - ->getMockBuilder('\Twig\Environment') - ->setConstructorArgs([$loader, $options]) - ->setMethods(['initExtensions']) - ->getMock() - ; - - $twig->expects($this->never())->method('initExtensions'); - - // render template - $output = $twig->render('index', ['foo' => 'bar']); - $this->assertEquals('bar', $output); - - Twig_Tests_FilesystemHelper::removeDir($dir); - } - - public function testAutoReloadCacheMiss() - { - $templateName = __FUNCTION__; - $templateContent = __FUNCTION__; - - $cache = $this->getMockBuilder('\Twig\Cache\CacheInterface')->getMock(); - $loader = $this->getMockLoader($templateName, $templateContent); - $twig = new Environment($loader, ['cache' => $cache, 'auto_reload' => true, 'debug' => false]); - - // Cache miss: getTimestamp returns 0 and as a result the load() is - // skipped. - $cache->expects($this->once()) - ->method('generateKey') - ->willReturn('key'); - $cache->expects($this->once()) - ->method('getTimestamp') - ->willReturn(0); - $loader->expects($this->never()) - ->method('isFresh'); - $cache->expects($this->once()) - ->method('write'); - $cache->expects($this->once()) - ->method('load'); - - $twig->load($templateName); - } - - public function testAutoReloadCacheHit() - { - $templateName = __FUNCTION__; - $templateContent = __FUNCTION__; - - $cache = $this->getMockBuilder('\Twig\Cache\CacheInterface')->getMock(); - $loader = $this->getMockLoader($templateName, $templateContent); - $twig = new Environment($loader, ['cache' => $cache, 'auto_reload' => true, 'debug' => false]); - - $now = time(); - - // Cache hit: getTimestamp returns something > extension timestamps and - // the loader returns true for isFresh(). - $cache->expects($this->once()) - ->method('generateKey') - ->willReturn('key'); - $cache->expects($this->once()) - ->method('getTimestamp') - ->willReturn($now); - $loader->expects($this->once()) - ->method('isFresh') - ->willReturn(true); - $cache->expects($this->atLeastOnce()) - ->method('load'); - - $twig->load($templateName); - } - - public function testAutoReloadOutdatedCacheHit() - { - $templateName = __FUNCTION__; - $templateContent = __FUNCTION__; - - $cache = $this->getMockBuilder('\Twig\Cache\CacheInterface')->getMock(); - $loader = $this->getMockLoader($templateName, $templateContent); - $twig = new Environment($loader, ['cache' => $cache, 'auto_reload' => true, 'debug' => false]); - - $now = time(); - - $cache->expects($this->once()) - ->method('generateKey') - ->willReturn('key'); - $cache->expects($this->once()) - ->method('getTimestamp') - ->willReturn($now); - $loader->expects($this->once()) - ->method('isFresh') - ->willReturn(false); - $cache->expects($this->once()) - ->method('write'); - $cache->expects($this->once()) - ->method('load'); - - $twig->load($templateName); - } - - /** - * @group legacy - */ - public function testHasGetExtensionWithDynamicName() - { - $twig = new Environment($this->getMockBuilder('\Twig\Loader\LoaderInterface')->getMock()); - - $ext1 = new Twig_Tests_EnvironmentTest_Extension_DynamicWithDeprecatedName('ext1'); - $ext2 = new Twig_Tests_EnvironmentTest_Extension_DynamicWithDeprecatedName('ext2'); - $twig->addExtension($ext1); - $twig->addExtension($ext2); - - $this->assertTrue($twig->hasExtension('ext1')); - $this->assertTrue($twig->hasExtension('ext2')); - - $this->assertTrue($twig->hasExtension('Twig_Tests_EnvironmentTest_Extension_DynamicWithDeprecatedName')); - - $this->assertSame($ext1, $twig->getExtension('ext1')); - $this->assertSame($ext2, $twig->getExtension('ext2')); - } - - public function testHasGetExtensionByClassName() - { - $twig = new Environment($this->getMockBuilder('\Twig\Loader\LoaderInterface')->getMock()); - $twig->addExtension($ext = new Twig_Tests_EnvironmentTest_Extension()); - $this->assertTrue($twig->hasExtension('Twig_Tests_EnvironmentTest_Extension')); - $this->assertTrue($twig->hasExtension('\Twig_Tests_EnvironmentTest_Extension')); - - $this->assertSame($ext, $twig->getExtension('Twig_Tests_EnvironmentTest_Extension')); - $this->assertSame($ext, $twig->getExtension('\Twig_Tests_EnvironmentTest_Extension')); - - $this->assertTrue($twig->hasExtension('Twig\Tests\EnvironmentTest\Extension')); - $this->assertSame($ext, $twig->getExtension('Twig\Tests\EnvironmentTest\Extension')); - } - - public function testAddExtension() - { - $twig = new Environment($this->getMockBuilder('\Twig\Loader\LoaderInterface')->getMock()); - $twig->addExtension(new Twig_Tests_EnvironmentTest_Extension()); - - $this->assertArrayHasKey('test', $twig->getTags()); - $this->assertArrayHasKey('foo_filter', $twig->getFilters()); - $this->assertArrayHasKey('foo_function', $twig->getFunctions()); - $this->assertArrayHasKey('foo_test', $twig->getTests()); - $this->assertArrayHasKey('foo_unary', $twig->getUnaryOperators()); - $this->assertArrayHasKey('foo_binary', $twig->getBinaryOperators()); - $this->assertArrayHasKey('foo_global', $twig->getGlobals()); - $visitors = $twig->getNodeVisitors(); - $found = false; - foreach ($visitors as $visitor) { - if ($visitor instanceof Twig_Tests_EnvironmentTest_NodeVisitor) { - $found = true; - } - } - $this->assertTrue($found); - } - - /** - * @requires PHP 5.3 - */ - public function testAddExtensionWithDeprecatedGetGlobals() - { - $twig = new Environment($this->getMockBuilder('\Twig\Loader\LoaderInterface')->getMock()); - $twig->addExtension(new Twig_Tests_EnvironmentTest_Extension_WithGlobals()); - - $this->deprecations = []; - set_error_handler([$this, 'handleError']); - - $this->assertArrayHasKey('foo_global', $twig->getGlobals()); - - $this->assertCount(1, $this->deprecations); - $this->assertContains('Defining the getGlobals() method in the "Twig_Tests_EnvironmentTest_Extension_WithGlobals" extension ', $this->deprecations[0]); - - restore_error_handler(); - } - - /** - * @group legacy - */ - public function testRemoveExtension() - { - $twig = new Environment($this->getMockBuilder('\Twig\Loader\LoaderInterface')->getMock()); - $twig->addExtension(new Twig_Tests_EnvironmentTest_Extension_WithDeprecatedName()); - $twig->removeExtension('environment_test'); - - $this->assertArrayNotHasKey('test', $twig->getTags()); - $this->assertArrayNotHasKey('foo_filter', $twig->getFilters()); - $this->assertArrayNotHasKey('foo_function', $twig->getFunctions()); - $this->assertArrayNotHasKey('foo_test', $twig->getTests()); - $this->assertArrayNotHasKey('foo_unary', $twig->getUnaryOperators()); - $this->assertArrayNotHasKey('foo_binary', $twig->getBinaryOperators()); - $this->assertArrayNotHasKey('foo_global', $twig->getGlobals()); - $this->assertCount(2, $twig->getNodeVisitors()); - } - - public function testAddMockExtension() - { - // should be replaced by the following in 2.0 (this current code is just to avoid a dep notice) - // $extension = $this->getMockBuilder('\Twig\Extension\AbstractExtension')->getMock(); - $extension = eval(<<<EOF -use Twig\Extension\AbstractExtension; - -class Twig_Tests_EnvironmentTest_ExtensionInEval extends AbstractExtension -{ -} -EOF - ); - $extension = new Twig_Tests_EnvironmentTest_ExtensionInEval(); - - $loader = new ArrayLoader(['page' => 'hey']); - - $twig = new Environment($loader); - $twig->addExtension($extension); - - $this->assertInstanceOf('\Twig\Extension\ExtensionInterface', $twig->getExtension(\get_class($extension))); - $this->assertTrue($twig->isTemplateFresh('page', time())); - } - - public function testInitRuntimeWithAnExtensionUsingInitRuntimeNoDeprecation() - { - $twig = new Environment($this->getMockBuilder('\Twig\Loader\LoaderInterface')->getMock()); - $twig->addExtension(new Twig_Tests_EnvironmentTest_ExtensionWithoutDeprecationInitRuntime()); - $twig->initRuntime(); - - // add a dummy assertion here to satisfy PHPUnit, the only thing we want to test is that the code above - // can be executed without throwing any deprecations - $this->addToAssertionCount(1); - } - - /** - * @requires PHP 5.3 - */ - public function testInitRuntimeWithAnExtensionUsingInitRuntimeDeprecation() - { - $twig = new Environment($this->getMockBuilder('\Twig\Loader\LoaderInterface')->getMock()); - $twig->addExtension(new Twig_Tests_EnvironmentTest_ExtensionWithDeprecationInitRuntime()); - - $this->deprecations = []; - set_error_handler([$this, 'handleError']); - - $twig->initRuntime(); - - $this->assertCount(1, $this->deprecations); - $this->assertContains('Defining the initRuntime() method in the "Twig_Tests_EnvironmentTest_ExtensionWithDeprecationInitRuntime" extension is deprecated since version 1.23.', $this->deprecations[0]); - - restore_error_handler(); - } - - public function handleError($type, $msg) - { - if (E_USER_DEPRECATED === $type) { - $this->deprecations[] = $msg; - } - } - - /** - * @requires PHP 5.3 - */ - public function testOverrideExtension() - { - $twig = new Environment($this->getMockBuilder('\Twig\Loader\LoaderInterface')->getMock()); - $twig->addExtension(new Twig_Tests_EnvironmentTest_ExtensionWithDeprecationInitRuntime()); - - $this->deprecations = []; - set_error_handler([$this, 'handleError']); - - $twig->addExtension(new Twig_Tests_EnvironmentTest_Extension_WithDeprecatedName()); - $twig->addExtension(new Twig_Tests_EnvironmentTest_Extension_WithDeprecatedName()); - - $this->assertCount(1, $this->deprecations); - $this->assertContains('The possibility to register the same extension twice', $this->deprecations[0]); - - restore_error_handler(); - } - - public function testAddRuntimeLoader() - { - $runtimeLoader = $this->getMockBuilder('\Twig\RuntimeLoader\RuntimeLoaderInterface')->getMock(); - $runtimeLoader->expects($this->any())->method('load')->willReturn(new Twig_Tests_EnvironmentTest_Runtime()); - - $loader = new ArrayLoader([ - 'func_array' => '{{ from_runtime_array("foo") }}', - 'func_array_default' => '{{ from_runtime_array() }}', - 'func_array_named_args' => '{{ from_runtime_array(name="foo") }}', - 'func_string' => '{{ from_runtime_string("foo") }}', - 'func_string_default' => '{{ from_runtime_string() }}', - 'func_string_named_args' => '{{ from_runtime_string(name="foo") }}', - ]); - - $twig = new Environment($loader); - $twig->addExtension(new Twig_Tests_EnvironmentTest_ExtensionWithoutRuntime()); - $twig->addRuntimeLoader($runtimeLoader); - - $this->assertEquals('foo', $twig->render('func_array')); - $this->assertEquals('bar', $twig->render('func_array_default')); - $this->assertEquals('foo', $twig->render('func_array_named_args')); - $this->assertEquals('foo', $twig->render('func_string')); - $this->assertEquals('bar', $twig->render('func_string_default')); - $this->assertEquals('foo', $twig->render('func_string_named_args')); - } - - protected function getMockLoader($templateName, $templateContent) - { - // to be removed in 2.0 - $loader = $this->getMockBuilder('Twig_EnvironmentTestLoaderInterface')->getMock(); - //$loader = $this->getMockBuilder(['\Twig\Loader\LoaderInterface', '\Twig\Loader\SourceContextLoaderInterface'])->getMock(); - $loader->expects($this->any()) - ->method('getSourceContext') - ->with($templateName) - ->willReturn(new Source($templateContent, $templateName)); - $loader->expects($this->any()) - ->method('getCacheKey') - ->with($templateName) - ->willReturn($templateName); - - return $loader; - } -} - -class Twig_Tests_EnvironmentTest_Extension_WithGlobals extends AbstractExtension -{ - public function getGlobals() - { - return [ - 'foo_global' => 'foo_global', - ]; - } -} - -class Twig_Tests_EnvironmentTest_Extension extends AbstractExtension implements GlobalsInterface -{ - public function getTokenParsers() - { - return [ - new Twig_Tests_EnvironmentTest_TokenParser(), - ]; - } - - public function getNodeVisitors() - { - return [ - new Twig_Tests_EnvironmentTest_NodeVisitor(), - ]; - } - - public function getFilters() - { - return [ - new TwigFilter('foo_filter', 'foo_filter'), - ]; - } - - public function getTests() - { - return [ - new TwigTest('foo_test', 'foo_test'), - ]; - } - - public function getFunctions() - { - return [ - new TwigFunction('foo_function', 'foo_function'), - ]; - } - - public function getOperators() - { - return [ - ['foo_unary' => []], - ['foo_binary' => []], - ]; - } - - public function getGlobals() - { - return [ - 'foo_global' => 'foo_global', - ]; - } -} -class_alias('Twig_Tests_EnvironmentTest_Extension', 'Twig\Tests\EnvironmentTest\Extension', false); - -class Twig_Tests_EnvironmentTest_Extension_WithDeprecatedName extends AbstractExtension -{ - public function getName() - { - return 'environment_test'; - } -} - -class Twig_Tests_EnvironmentTest_Extension_DynamicWithDeprecatedName extends AbstractExtension -{ - private $name; - - public function __construct($name) - { - $this->name = $name; - } - - public function getName() - { - return $this->name; - } -} - -class Twig_Tests_EnvironmentTest_TokenParser extends AbstractTokenParser -{ - public function parse(Token $token) - { - } - - public function getTag() - { - return 'test'; - } -} - -class Twig_Tests_EnvironmentTest_NodeVisitor implements NodeVisitorInterface -{ - public function enterNode(Twig_NodeInterface $node, Environment $env) - { - return $node; - } - - public function leaveNode(Twig_NodeInterface $node, Environment $env) - { - return $node; - } - - public function getPriority() - { - return 0; - } -} - -class Twig_Tests_EnvironmentTest_ExtensionWithDeprecationInitRuntime extends AbstractExtension -{ - public function initRuntime(Environment $env) - { - } -} - -class Twig_Tests_EnvironmentTest_ExtensionWithoutDeprecationInitRuntime extends AbstractExtension implements InitRuntimeInterface -{ - public function initRuntime(Environment $env) - { - } -} - -class Twig_Tests_EnvironmentTest_ExtensionWithoutRuntime extends AbstractExtension -{ - public function getFunctions() - { - return [ - new TwigFunction('from_runtime_array', ['Twig_Tests_EnvironmentTest_Runtime', 'fromRuntime']), - new TwigFunction('from_runtime_string', 'Twig_Tests_EnvironmentTest_Runtime::fromRuntime'), - ]; - } - - public function getName() - { - return 'from_runtime'; - } -} - -class Twig_Tests_EnvironmentTest_Runtime -{ - public function fromRuntime($name = 'bar') - { - return $name; - } -} - -// to be removed in 2.0 -interface Twig_EnvironmentTestLoaderInterface extends LoaderInterface, SourceContextLoaderInterface -{ -} diff --git a/vendor/twig/twig/test/Twig/Tests/ErrorTest.php b/vendor/twig/twig/test/Twig/Tests/ErrorTest.php deleted file mode 100644 index 62578f3184..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/ErrorTest.php +++ /dev/null @@ -1,232 +0,0 @@ -<?php - -/* - * This file is part of Twig. - * - * (c) Fabien Potencier - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Twig\Environment; -use Twig\Error\Error; -use Twig\Error\RuntimeError; -use Twig\Loader\ArrayLoader; -use Twig\Loader\FilesystemLoader; -use Twig\Source; - -class Twig_Tests_ErrorTest extends \PHPUnit\Framework\TestCase -{ - public function testErrorWithObjectFilename() - { - $error = new Error('foo'); - $error->setSourceContext(new Source('', new \SplFileInfo(__FILE__))); - - $this->assertContains('test'.DIRECTORY_SEPARATOR.'Twig'.DIRECTORY_SEPARATOR.'Tests'.DIRECTORY_SEPARATOR.'ErrorTest.php', $error->getMessage()); - } - - public function testErrorWithArrayFilename() - { - $error = new Error('foo'); - $error->setSourceContext(new Source('', ['foo' => 'bar'])); - - $this->assertEquals('foo in {"foo":"bar"}', $error->getMessage()); - } - - public function testTwigExceptionGuessWithMissingVarAndArrayLoader() - { - $loader = new ArrayLoader([ - 'base.html' => '{% block content %}{% endblock %}', - 'index.html' => <<<EOHTML -{% extends 'base.html' %} -{% block content %} - {{ foo.bar }} -{% endblock %} -{% block foo %} - {{ foo.bar }} -{% endblock %} -EOHTML - ]); - $twig = new Environment($loader, ['strict_variables' => true, 'debug' => true, 'cache' => false]); - - $template = $twig->load('index.html'); - try { - $template->render([]); - - $this->fail(); - } catch (RuntimeError $e) { - $this->assertEquals('Variable "foo" does not exist in "index.html" at line 3.', $e->getMessage()); - $this->assertEquals(3, $e->getTemplateLine()); - $this->assertEquals('index.html', $e->getSourceContext()->getName()); - } - } - - public function testTwigExceptionGuessWithExceptionAndArrayLoader() - { - $loader = new ArrayLoader([ - 'base.html' => '{% block content %}{% endblock %}', - 'index.html' => <<<EOHTML -{% extends 'base.html' %} -{% block content %} - {{ foo.bar }} -{% endblock %} -{% block foo %} - {{ foo.bar }} -{% endblock %} -EOHTML - ]); - $twig = new Environment($loader, ['strict_variables' => true, 'debug' => true, 'cache' => false]); - - $template = $twig->load('index.html'); - try { - $template->render(['foo' => new Twig_Tests_ErrorTest_Foo()]); - - $this->fail(); - } catch (RuntimeError $e) { - $this->assertEquals('An exception has been thrown during the rendering of a template ("Runtime error...") in "index.html" at line 3.', $e->getMessage()); - $this->assertEquals(3, $e->getTemplateLine()); - $this->assertEquals('index.html', $e->getSourceContext()->getName()); - } - } - - public function testTwigExceptionGuessWithMissingVarAndFilesystemLoader() - { - $loader = new FilesystemLoader(__DIR__.'/Fixtures/errors'); - $twig = new Environment($loader, ['strict_variables' => true, 'debug' => true, 'cache' => false]); - - $template = $twig->load('index.html'); - try { - $template->render([]); - - $this->fail(); - } catch (RuntimeError $e) { - $this->assertEquals('Variable "foo" does not exist.', $e->getMessage()); - $this->assertEquals(3, $e->getTemplateLine()); - $this->assertEquals('index.html', $e->getSourceContext()->getName()); - $this->assertEquals(3, $e->getLine()); - $this->assertEquals(strtr(__DIR__.'/Fixtures/errors/index.html', '/', DIRECTORY_SEPARATOR), $e->getFile()); - } - } - - public function testTwigExceptionGuessWithExceptionAndFilesystemLoader() - { - $loader = new FilesystemLoader(__DIR__.'/Fixtures/errors'); - $twig = new Environment($loader, ['strict_variables' => true, 'debug' => true, 'cache' => false]); - - $template = $twig->load('index.html'); - try { - $template->render(['foo' => new Twig_Tests_ErrorTest_Foo()]); - - $this->fail(); - } catch (RuntimeError $e) { - $this->assertEquals('An exception has been thrown during the rendering of a template ("Runtime error...").', $e->getMessage()); - $this->assertEquals(3, $e->getTemplateLine()); - $this->assertEquals('index.html', $e->getSourceContext()->getName()); - $this->assertEquals(3, $e->getLine()); - $this->assertEquals(strtr(__DIR__.'/Fixtures/errors/index.html', '/', DIRECTORY_SEPARATOR), $e->getFile()); - } - } - - /** - * @dataProvider getErroredTemplates - */ - public function testTwigExceptionAddsFileAndLine($templates, $name, $line) - { - $loader = new ArrayLoader($templates); - $twig = new Environment($loader, ['strict_variables' => true, 'debug' => true, 'cache' => false]); - - $template = $twig->load('index'); - - try { - $template->render([]); - - $this->fail(); - } catch (RuntimeError $e) { - $this->assertEquals(sprintf('Variable "foo" does not exist in "%s" at line %d.', $name, $line), $e->getMessage()); - $this->assertEquals($line, $e->getTemplateLine()); - $this->assertEquals($name, $e->getSourceContext()->getName()); - } - - try { - $template->render(['foo' => new Twig_Tests_ErrorTest_Foo()]); - - $this->fail(); - } catch (RuntimeError $e) { - $this->assertEquals(sprintf('An exception has been thrown during the rendering of a template ("Runtime error...") in "%s" at line %d.', $name, $line), $e->getMessage()); - $this->assertEquals($line, $e->getTemplateLine()); - $this->assertEquals($name, $e->getSourceContext()->getName()); - } - } - - public function getErroredTemplates() - { - return [ - // error occurs in a template - [ - [ - 'index' => "\n\n{{ foo.bar }}\n\n\n{{ 'foo' }}", - ], - 'index', 3, - ], - - // error occurs in an included template - [ - [ - 'index' => "{% include 'partial' %}", - 'partial' => '{{ foo.bar }}', - ], - 'partial', 1, - ], - - // error occurs in a parent block when called via parent() - [ - [ - 'index' => "{% extends 'base' %} - {% block content %} - {{ parent() }} - {% endblock %}", - 'base' => '{% block content %}{{ foo.bar }}{% endblock %}', - ], - 'base', 1, - ], - - // error occurs in a block from the child - [ - [ - 'index' => "{% extends 'base' %} - {% block content %} - {{ foo.bar }} - {% endblock %} - {% block foo %} - {{ foo.bar }} - {% endblock %}", - 'base' => '{% block content %}{% endblock %}', - ], - 'index', 3, - ], - ]; - } - - public function testTwigLeakOutputInDebugMode() - { - $output = exec(sprintf('%s %s debug', \PHP_BINARY, escapeshellarg(__DIR__.'/Fixtures/errors/leak-output.php'))); - - $this->assertSame('Hello OOPS', $output); - } - - public function testDoesNotTwigLeakOutput() - { - $output = exec(sprintf('%s %s', \PHP_BINARY, escapeshellarg(__DIR__.'/Fixtures/errors/leak-output.php'))); - - $this->assertSame('', $output); - } -} - -class Twig_Tests_ErrorTest_Foo -{ - public function bar() - { - throw new \Exception('Runtime error...'); - } -} diff --git a/vendor/twig/twig/test/Twig/Tests/ExpressionParserTest.php b/vendor/twig/twig/test/Twig/Tests/ExpressionParserTest.php deleted file mode 100644 index 6a447a99a9..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/ExpressionParserTest.php +++ /dev/null @@ -1,387 +0,0 @@ -<?php - -/* - * This file is part of Twig. - * - * (c) Fabien Potencier - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Twig\Environment; -use Twig\Node\Expression\ArrayExpression; -use Twig\Node\Expression\Binary\ConcatBinary; -use Twig\Node\Expression\ConstantExpression; -use Twig\Node\Expression\NameExpression; -use Twig\Parser; -use Twig\Source; - -class Twig_Tests_ExpressionParserTest extends \PHPUnit\Framework\TestCase -{ - /** - * @expectedException \Twig\Error\SyntaxError - * @dataProvider getFailingTestsForAssignment - */ - public function testCanOnlyAssignToNames($template) - { - $env = new Environment($this->getMockBuilder('\Twig\Loader\LoaderInterface')->getMock(), ['cache' => false, 'autoescape' => false]); - $parser = new Parser($env); - - $parser->parse($env->tokenize(new Source($template, 'index'))); - } - - public function getFailingTestsForAssignment() - { - return [ - ['{% set false = "foo" %}'], - ['{% set FALSE = "foo" %}'], - ['{% set true = "foo" %}'], - ['{% set TRUE = "foo" %}'], - ['{% set none = "foo" %}'], - ['{% set NONE = "foo" %}'], - ['{% set null = "foo" %}'], - ['{% set NULL = "foo" %}'], - ['{% set 3 = "foo" %}'], - ['{% set 1 + 2 = "foo" %}'], - ['{% set "bar" = "foo" %}'], - ['{% set %}{% endset %}'], - ]; - } - - /** - * @dataProvider getTestsForArray - */ - public function testArrayExpression($template, $expected) - { - $env = new Environment($this->getMockBuilder('\Twig\Loader\LoaderInterface')->getMock(), ['cache' => false, 'autoescape' => false]); - $stream = $env->tokenize($source = new Source($template, '')); - $parser = new Parser($env); - $expected->setSourceContext($source); - - $this->assertEquals($expected, $parser->parse($stream)->getNode('body')->getNode(0)->getNode('expr')); - } - - /** - * @expectedException \Twig\Error\SyntaxError - * @dataProvider getFailingTestsForArray - */ - public function testArraySyntaxError($template) - { - $env = new Environment($this->getMockBuilder('\Twig\Loader\LoaderInterface')->getMock(), ['cache' => false, 'autoescape' => false]); - $parser = new Parser($env); - - $parser->parse($env->tokenize(new Source($template, 'index'))); - } - - public function getFailingTestsForArray() - { - return [ - ['{{ [1, "a": "b"] }}'], - ['{{ {"a": "b", 2} }}'], - ]; - } - - public function getTestsForArray() - { - return [ - // simple array - ['{{ [1, 2] }}', new ArrayExpression([ - new ConstantExpression(0, 1), - new ConstantExpression(1, 1), - - new ConstantExpression(1, 1), - new ConstantExpression(2, 1), - ], 1), - ], - - // array with trailing , - ['{{ [1, 2, ] }}', new ArrayExpression([ - new ConstantExpression(0, 1), - new ConstantExpression(1, 1), - - new ConstantExpression(1, 1), - new ConstantExpression(2, 1), - ], 1), - ], - - // simple hash - ['{{ {"a": "b", "b": "c"} }}', new ArrayExpression([ - new ConstantExpression('a', 1), - new ConstantExpression('b', 1), - - new ConstantExpression('b', 1), - new ConstantExpression('c', 1), - ], 1), - ], - - // hash with trailing , - ['{{ {"a": "b", "b": "c", } }}', new ArrayExpression([ - new ConstantExpression('a', 1), - new ConstantExpression('b', 1), - - new ConstantExpression('b', 1), - new ConstantExpression('c', 1), - ], 1), - ], - - // hash in an array - ['{{ [1, {"a": "b", "b": "c"}] }}', new ArrayExpression([ - new ConstantExpression(0, 1), - new ConstantExpression(1, 1), - - new ConstantExpression(1, 1), - new ArrayExpression([ - new ConstantExpression('a', 1), - new ConstantExpression('b', 1), - - new ConstantExpression('b', 1), - new ConstantExpression('c', 1), - ], 1), - ], 1), - ], - - // array in a hash - ['{{ {"a": [1, 2], "b": "c"} }}', new ArrayExpression([ - new ConstantExpression('a', 1), - new ArrayExpression([ - new ConstantExpression(0, 1), - new ConstantExpression(1, 1), - - new ConstantExpression(1, 1), - new ConstantExpression(2, 1), - ], 1), - new ConstantExpression('b', 1), - new ConstantExpression('c', 1), - ], 1), - ], - ]; - } - - /** - * @expectedException \Twig\Error\SyntaxError - */ - public function testStringExpressionDoesNotConcatenateTwoConsecutiveStrings() - { - $env = new Environment($this->getMockBuilder('\Twig\Loader\LoaderInterface')->getMock(), ['cache' => false, 'autoescape' => false, 'optimizations' => 0]); - $stream = $env->tokenize(new Source('{{ "a" "b" }}', 'index')); - $parser = new Parser($env); - - $parser->parse($stream); - } - - /** - * @dataProvider getTestsForString - */ - public function testStringExpression($template, $expected) - { - $env = new Environment($this->getMockBuilder('\Twig\Loader\LoaderInterface')->getMock(), ['cache' => false, 'autoescape' => false, 'optimizations' => 0]); - $stream = $env->tokenize($source = new Source($template, '')); - $parser = new Parser($env); - $expected->setSourceContext($source); - - $this->assertEquals($expected, $parser->parse($stream)->getNode('body')->getNode(0)->getNode('expr')); - } - - public function getTestsForString() - { - return [ - [ - '{{ "foo" }}', new ConstantExpression('foo', 1), - ], - [ - '{{ "foo #{bar}" }}', new ConcatBinary( - new ConstantExpression('foo ', 1), - new NameExpression('bar', 1), - 1 - ), - ], - [ - '{{ "foo #{bar} baz" }}', new ConcatBinary( - new ConcatBinary( - new ConstantExpression('foo ', 1), - new NameExpression('bar', 1), - 1 - ), - new ConstantExpression(' baz', 1), - 1 - ), - ], - - [ - '{{ "foo #{"foo #{bar} baz"} baz" }}', new ConcatBinary( - new ConcatBinary( - new ConstantExpression('foo ', 1), - new ConcatBinary( - new ConcatBinary( - new ConstantExpression('foo ', 1), - new NameExpression('bar', 1), - 1 - ), - new ConstantExpression(' baz', 1), - 1 - ), - 1 - ), - new ConstantExpression(' baz', 1), - 1 - ), - ], - ]; - } - - /** - * @expectedException \Twig\Error\SyntaxError - */ - public function testAttributeCallDoesNotSupportNamedArguments() - { - $env = new Environment($this->getMockBuilder('\Twig\Loader\LoaderInterface')->getMock(), ['cache' => false, 'autoescape' => false]); - $parser = new Parser($env); - - $parser->parse($env->tokenize(new Source('{{ foo.bar(name="Foo") }}', 'index'))); - } - - /** - * @expectedException \Twig\Error\SyntaxError - */ - public function testMacroCallDoesNotSupportNamedArguments() - { - $env = new Environment($this->getMockBuilder('\Twig\Loader\LoaderInterface')->getMock(), ['cache' => false, 'autoescape' => false]); - $parser = new Parser($env); - - $parser->parse($env->tokenize(new Source('{% from _self import foo %}{% macro foo() %}{% endmacro %}{{ foo(name="Foo") }}', 'index'))); - } - - /** - * @expectedException \Twig\Error\SyntaxError - * @expectedExceptionMessage An argument must be a name. Unexpected token "string" of value "a" ("name" expected) in "index" at line 1. - */ - public function testMacroDefinitionDoesNotSupportNonNameVariableName() - { - $env = new Environment($this->getMockBuilder('\Twig\Loader\LoaderInterface')->getMock(), ['cache' => false, 'autoescape' => false]); - $parser = new Parser($env); - - $parser->parse($env->tokenize(new Source('{% macro foo("a") %}{% endmacro %}', 'index'))); - } - - /** - * @expectedException \Twig\Error\SyntaxError - * @expectedExceptionMessage A default value for an argument must be a constant (a boolean, a string, a number, or an array) in "index" at line 1 - * @dataProvider getMacroDefinitionDoesNotSupportNonConstantDefaultValues - */ - public function testMacroDefinitionDoesNotSupportNonConstantDefaultValues($template) - { - $env = new Environment($this->getMockBuilder('\Twig\Loader\LoaderInterface')->getMock(), ['cache' => false, 'autoescape' => false]); - $parser = new Parser($env); - - $parser->parse($env->tokenize(new Source($template, 'index'))); - } - - public function getMacroDefinitionDoesNotSupportNonConstantDefaultValues() - { - return [ - ['{% macro foo(name = "a #{foo} a") %}{% endmacro %}'], - ['{% macro foo(name = [["b", "a #{foo} a"]]) %}{% endmacro %}'], - ]; - } - - /** - * @dataProvider getMacroDefinitionSupportsConstantDefaultValues - */ - public function testMacroDefinitionSupportsConstantDefaultValues($template) - { - $env = new Environment($this->getMockBuilder('\Twig\Loader\LoaderInterface')->getMock(), ['cache' => false, 'autoescape' => false]); - $parser = new Parser($env); - - $parser->parse($env->tokenize(new Source($template, 'index'))); - - // add a dummy assertion here to satisfy PHPUnit, the only thing we want to test is that the code above - // can be executed without throwing any exceptions - $this->addToAssertionCount(1); - } - - public function getMacroDefinitionSupportsConstantDefaultValues() - { - return [ - ['{% macro foo(name = "aa") %}{% endmacro %}'], - ['{% macro foo(name = 12) %}{% endmacro %}'], - ['{% macro foo(name = true) %}{% endmacro %}'], - ['{% macro foo(name = ["a"]) %}{% endmacro %}'], - ['{% macro foo(name = [["a"]]) %}{% endmacro %}'], - ['{% macro foo(name = {a: "a"}) %}{% endmacro %}'], - ['{% macro foo(name = {a: {b: "a"}}) %}{% endmacro %}'], - ]; - } - - /** - * @expectedException \Twig\Error\SyntaxError - * @expectedExceptionMessage Unknown "cycl" function. Did you mean "cycle" in "index" at line 1? - */ - public function testUnknownFunction() - { - $env = new Environment($this->getMockBuilder('\Twig\Loader\LoaderInterface')->getMock(), ['cache' => false, 'autoescape' => false]); - $parser = new Parser($env); - - $parser->parse($env->tokenize(new Source('{{ cycl() }}', 'index'))); - } - - /** - * @expectedException \Twig\Error\SyntaxError - * @expectedExceptionMessage Unknown "foobar" function in "index" at line 1. - */ - public function testUnknownFunctionWithoutSuggestions() - { - $env = new Environment($this->getMockBuilder('\Twig\Loader\LoaderInterface')->getMock(), ['cache' => false, 'autoescape' => false]); - $parser = new Parser($env); - - $parser->parse($env->tokenize(new Source('{{ foobar() }}', 'index'))); - } - - /** - * @expectedException \Twig\Error\SyntaxError - * @expectedExceptionMessage Unknown "lowe" filter. Did you mean "lower" in "index" at line 1? - */ - public function testUnknownFilter() - { - $env = new Environment($this->getMockBuilder('\Twig\Loader\LoaderInterface')->getMock(), ['cache' => false, 'autoescape' => false]); - $parser = new Parser($env); - - $parser->parse($env->tokenize(new Source('{{ 1|lowe }}', 'index'))); - } - - /** - * @expectedException \Twig\Error\SyntaxError - * @expectedExceptionMessage Unknown "foobar" filter in "index" at line 1. - */ - public function testUnknownFilterWithoutSuggestions() - { - $env = new Environment($this->getMockBuilder('\Twig\Loader\LoaderInterface')->getMock(), ['cache' => false, 'autoescape' => false]); - $parser = new Parser($env); - - $parser->parse($env->tokenize(new Source('{{ 1|foobar }}', 'index'))); - } - - /** - * @expectedException \Twig\Error\SyntaxError - * @expectedExceptionMessage Unknown "nul" test. Did you mean "null" in "index" at line 1 - */ - public function testUnknownTest() - { - $env = new Environment($this->getMockBuilder('\Twig\Loader\LoaderInterface')->getMock(), ['cache' => false, 'autoescape' => false]); - $parser = new Parser($env); - $stream = $env->tokenize(new Source('{{ 1 is nul }}', 'index')); - $parser->parse($stream); - } - - /** - * @expectedException \Twig\Error\SyntaxError - * @expectedExceptionMessage Unknown "foobar" test in "index" at line 1. - */ - public function testUnknownTestWithoutSuggestions() - { - $env = new Environment($this->getMockBuilder('\Twig\Loader\LoaderInterface')->getMock(), ['cache' => false, 'autoescape' => false]); - $parser = new Parser($env); - - $parser->parse($env->tokenize(new Source('{{ 1 is foobar }}', 'index'))); - } -} diff --git a/vendor/twig/twig/test/Twig/Tests/Extension/CoreTest.php b/vendor/twig/twig/test/Twig/Tests/Extension/CoreTest.php deleted file mode 100644 index c29431824a..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Extension/CoreTest.php +++ /dev/null @@ -1,371 +0,0 @@ -<?php - -/* - * This file is part of Twig. - * - * (c) Fabien Potencier - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Twig\Environment; - -class Twig_Tests_Extension_CoreTest extends \PHPUnit\Framework\TestCase -{ - /** - * @dataProvider getRandomFunctionTestData - */ - public function testRandomFunction(array $expectedInArray, $value1, $value2 = null) - { - $env = new Twig_Environment($this->getMockBuilder('Twig_LoaderInterface')->getMock()); - for ($i = 0; $i < 100; ++$i) { - $this->assertTrue(\in_array(twig_random($env, $value1, $value2), $expectedInArray, true)); // assertContains() would not consider the type - } - } - - public function getRandomFunctionTestData() - { - return [ - 'array' => [ - ['apple', 'orange', 'citrus'], - ['apple', 'orange', 'citrus'], - ], - 'Traversable' => [ - ['apple', 'orange', 'citrus'], - new ArrayObject(['apple', 'orange', 'citrus']), - ], - 'unicode string' => [ - ['Ä', '€', 'é'], - 'Ä€é', - ], - 'numeric but string' => [ - ['1', '2', '3'], - '123', - ], - 'integer' => [ - range(0, 5, 1), - 5, - ], - 'float' => [ - range(0, 5, 1), - 5.9, - ], - 'negative' => [ - [0, -1, -2], - -2, - ], - 'min max int' => [ - range(50, 100), - 50, - 100, - ], - 'min max float' => [ - range(-10, 10), - -9.5, - 9.5, - ], - 'min null' => [ - range(0, 100), - null, - 100, - ], - ]; - } - - public function testRandomFunctionWithoutParameter() - { - $max = mt_getrandmax(); - - for ($i = 0; $i < 100; ++$i) { - $val = twig_random(new Environment($this->getMockBuilder('\Twig\Loader\LoaderInterface')->getMock())); - $this->assertTrue(\is_int($val) && $val >= 0 && $val <= $max); - } - } - - public function testRandomFunctionReturnsAsIs() - { - $this->assertSame('', twig_random(new Environment($this->getMockBuilder('\Twig\Loader\LoaderInterface')->getMock()), '')); - $this->assertSame('', twig_random(new Environment($this->getMockBuilder('\Twig\Loader\LoaderInterface')->getMock(), ['charset' => null]), '')); - - $instance = new \stdClass(); - $this->assertSame($instance, twig_random(new Environment($this->getMockBuilder('\Twig\Loader\LoaderInterface')->getMock()), $instance)); - } - - /** - * @expectedException \Twig\Error\RuntimeError - */ - public function testRandomFunctionOfEmptyArrayThrowsException() - { - twig_random(new Environment($this->getMockBuilder('\Twig\Loader\LoaderInterface')->getMock()), []); - } - - public function testRandomFunctionOnNonUTF8String() - { - if (!\function_exists('iconv') && !\function_exists('mb_convert_encoding')) { - $this->markTestSkipped('needs iconv or mbstring'); - } - - $twig = new Environment($this->getMockBuilder('\Twig\Loader\LoaderInterface')->getMock()); - $twig->setCharset('ISO-8859-1'); - - $text = twig_convert_encoding('Äé', 'ISO-8859-1', 'UTF-8'); - for ($i = 0; $i < 30; ++$i) { - $rand = twig_random($twig, $text); - $this->assertTrue(\in_array(twig_convert_encoding($rand, 'UTF-8', 'ISO-8859-1'), ['Ä', 'é'], true)); - } - } - - public function testReverseFilterOnNonUTF8String() - { - if (!\function_exists('iconv') && !\function_exists('mb_convert_encoding')) { - $this->markTestSkipped('needs iconv or mbstring'); - } - - $twig = new Environment($this->getMockBuilder('\Twig\Loader\LoaderInterface')->getMock()); - $twig->setCharset('ISO-8859-1'); - - $input = twig_convert_encoding('Äé', 'ISO-8859-1', 'UTF-8'); - $output = twig_convert_encoding(twig_reverse_filter($twig, $input), 'UTF-8', 'ISO-8859-1'); - - $this->assertEquals($output, 'éÄ'); - } - - /** - * @dataProvider provideCustomEscaperCases - */ - public function testCustomEscaper($expected, $string, $strategy) - { - $twig = new Environment($this->getMockBuilder('\Twig\Loader\LoaderInterface')->getMock()); - $twig->getExtension('\Twig\Extension\CoreExtension')->setEscaper('foo', 'foo_escaper_for_test'); - - $this->assertSame($expected, twig_escape_filter($twig, $string, $strategy)); - } - - public function provideCustomEscaperCases() - { - return [ - ['fooUTF-8', 'foo', 'foo'], - ['UTF-8', null, 'foo'], - ['42UTF-8', 42, 'foo'], - ]; - } - - /** - * @expectedException \Twig\Error\RuntimeError - */ - public function testUnknownCustomEscaper() - { - twig_escape_filter(new Environment($this->getMockBuilder('\Twig\Loader\LoaderInterface')->getMock()), 'foo', 'bar'); - } - - /** - * @dataProvider provideTwigFirstCases - */ - public function testTwigFirst($expected, $input) - { - $twig = new Environment($this->getMockBuilder('\Twig\Loader\LoaderInterface')->getMock()); - $this->assertSame($expected, twig_first($twig, $input)); - } - - public function provideTwigFirstCases() - { - $i = [1 => 'a', 2 => 'b', 3 => 'c']; - - return [ - ['a', 'abc'], - [1, [1, 2, 3]], - ['', null], - ['', ''], - ['a', new CoreTestIterator($i, array_keys($i), true, 3)], - ]; - } - - /** - * @dataProvider provideTwigLastCases - */ - public function testTwigLast($expected, $input) - { - $twig = new Environment($this->getMockBuilder('\Twig\Loader\LoaderInterface')->getMock()); - $this->assertSame($expected, twig_last($twig, $input)); - } - - public function provideTwigLastCases() - { - $i = [1 => 'a', 2 => 'b', 3 => 'c']; - - return [ - ['c', 'abc'], - [3, [1, 2, 3]], - ['', null], - ['', ''], - ['c', new CoreTestIterator($i, array_keys($i), true)], - ]; - } - - /** - * @dataProvider provideArrayKeyCases - */ - public function testArrayKeysFilter(array $expected, $input) - { - $this->assertSame($expected, twig_get_array_keys_filter($input)); - } - - public function provideArrayKeyCases() - { - $array = ['a' => 'a1', 'b' => 'b1', 'c' => 'c1']; - $keys = array_keys($array); - - return [ - [$keys, $array], - [$keys, new CoreTestIterator($array, $keys)], - [$keys, new CoreTestIteratorAggregate($array, $keys)], - [$keys, new CoreTestIteratorAggregateAggregate($array, $keys)], - [[], null], - [['a'], new \SimpleXMLElement('<xml><a></a></xml>')], - ]; - } - - /** - * @dataProvider provideInFilterCases - */ - public function testInFilter($expected, $value, $compare) - { - $this->assertSame($expected, twig_in_filter($value, $compare)); - } - - public function provideInFilterCases() - { - $array = [1, 2, 'a' => 3, 5, 6, 7]; - $keys = array_keys($array); - - return [ - [true, 1, $array], - [true, '3', $array], - [true, '3', 'abc3def'], - [true, 1, new CoreTestIterator($array, $keys, true, 1)], - [true, '3', new CoreTestIterator($array, $keys, true, 3)], - [true, '3', new CoreTestIteratorAggregateAggregate($array, $keys, true, 3)], - [false, 4, $array], - [false, 4, new CoreTestIterator($array, $keys, true)], - [false, 4, new CoreTestIteratorAggregateAggregate($array, $keys, true)], - [false, 1, 1], - [true, 'b', new \SimpleXMLElement('<xml><a>b</a></xml>')], - ]; - } - - /** - * @dataProvider provideSliceFilterCases - */ - public function testSliceFilter($expected, $input, $start, $length = null, $preserveKeys = false) - { - $twig = new Environment($this->getMockBuilder('\Twig\Loader\LoaderInterface')->getMock()); - $this->assertSame($expected, twig_slice($twig, $input, $start, $length, $preserveKeys)); - } - - public function provideSliceFilterCases() - { - $i = ['a' => 1, 'b' => 2, 'c' => 3, 'd' => 4]; - $keys = array_keys($i); - - return [ - [['a' => 1], $i, 0, 1, true], - [['a' => 1], $i, 0, 1, false], - [['b' => 2, 'c' => 3], $i, 1, 2], - [[1], [1, 2, 3, 4], 0, 1], - [[2, 3], [1, 2, 3, 4], 1, 2], - [[2, 3], new CoreTestIterator($i, $keys, true), 1, 2], - [['c' => 3, 'd' => 4], new CoreTestIteratorAggregate($i, $keys, true), 2, null, true], - [$i, new CoreTestIterator($i, $keys, true), 0, \count($keys) + 10, true], - [[], new CoreTestIterator($i, $keys, true), \count($keys) + 10], - ['de', 'abcdef', 3, 2], - [[], new \SimpleXMLElement('<items><item>1</item><item>2</item></items>'), 3], - [[], new \ArrayIterator([1, 2]), 3], - ]; - } -} - -function foo_escaper_for_test(Environment $env, $string, $charset) -{ - return $string.$charset; -} - -final class CoreTestIteratorAggregate implements \IteratorAggregate -{ - private $iterator; - - public function __construct(array $array, array $keys, $allowAccess = false, $maxPosition = false) - { - $this->iterator = new CoreTestIterator($array, $keys, $allowAccess, $maxPosition); - } - - public function getIterator() - { - return $this->iterator; - } -} - -final class CoreTestIteratorAggregateAggregate implements \IteratorAggregate -{ - private $iterator; - - public function __construct(array $array, array $keys, $allowValueAccess = false, $maxPosition = false) - { - $this->iterator = new CoreTestIteratorAggregate($array, $keys, $allowValueAccess, $maxPosition); - } - - public function getIterator() - { - return $this->iterator; - } -} - -final class CoreTestIterator implements Iterator -{ - private $position; - private $array; - private $arrayKeys; - private $allowValueAccess; - private $maxPosition; - - public function __construct(array $values, array $keys, $allowValueAccess = false, $maxPosition = false) - { - $this->array = $values; - $this->arrayKeys = $keys; - $this->position = 0; - $this->allowValueAccess = $allowValueAccess; - $this->maxPosition = false === $maxPosition ? \count($values) + 1 : $maxPosition; - } - - public function rewind() - { - $this->position = 0; - } - - public function current() - { - if ($this->allowValueAccess) { - return $this->array[$this->key()]; - } - - throw new \LogicException('Code should only use the keys, not the values provided by iterator.'); - } - - public function key() - { - return $this->arrayKeys[$this->position]; - } - - public function next() - { - ++$this->position; - if ($this->position === $this->maxPosition) { - throw new \LogicException(sprintf('Code should not iterate beyond %d.', $this->maxPosition)); - } - } - - public function valid() - { - return isset($this->arrayKeys[$this->position]); - } -} diff --git a/vendor/twig/twig/test/Twig/Tests/Extension/SandboxTest.php b/vendor/twig/twig/test/Twig/Tests/Extension/SandboxTest.php deleted file mode 100644 index 3420b7eae4..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Extension/SandboxTest.php +++ /dev/null @@ -1,364 +0,0 @@ -<?php - -/* - * This file is part of Twig. - * - * (c) Fabien Potencier - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Twig\Environment; -use Twig\Extension\SandboxExtension; -use Twig\Loader\ArrayLoader; -use Twig\Sandbox\SecurityError; -use Twig\Sandbox\SecurityPolicy; - -class Twig_Tests_Extension_SandboxTest extends \PHPUnit\Framework\TestCase -{ - protected static $params; - protected static $templates; - - protected function setUp() - { - self::$params = [ - 'name' => 'Fabien', - 'obj' => new FooObject(), - 'arr' => ['obj' => new FooObject()], - ]; - - self::$templates = [ - '1_basic1' => '{{ obj.foo }}', - '1_basic2' => '{{ name|upper }}', - '1_basic3' => '{% if name %}foo{% endif %}', - '1_basic4' => '{{ obj.bar }}', - '1_basic5' => '{{ obj }}', - '1_basic7' => '{{ cycle(["foo","bar"], 1) }}', - '1_basic8' => '{{ obj.getfoobar }}{{ obj.getFooBar }}', - '1_basic9' => '{{ obj.foobar }}{{ obj.fooBar }}', - '1_basic' => '{% if obj.foo %}{{ obj.foo|upper }}{% endif %}', - '1_layout' => '{% block content %}{% endblock %}', - '1_child' => "{% extends \"1_layout\" %}\n{% block content %}\n{{ \"a\"|json_encode }}\n{% endblock %}", - '1_include' => '{{ include("1_basic1", sandboxed=true) }}', - '1_range_operator' => '{{ (1..2)[0] }}', - ]; - } - - /** - * @expectedException \Twig\Sandbox\SecurityError - * @expectedExceptionMessage Filter "json_encode" is not allowed in "1_child" at line 3. - */ - public function testSandboxWithInheritance() - { - $twig = $this->getEnvironment(true, [], self::$templates, ['block']); - $twig->load('1_child')->render([]); - } - - public function testSandboxGloballySet() - { - $twig = $this->getEnvironment(false, [], self::$templates); - $this->assertEquals('FOO', $twig->load('1_basic')->render(self::$params), 'Sandbox does nothing if it is disabled globally'); - } - - public function testSandboxUnallowedMethodAccessor() - { - $twig = $this->getEnvironment(true, [], self::$templates); - try { - $twig->load('1_basic1')->render(self::$params); - $this->fail('Sandbox throws a SecurityError exception if an unallowed method is called'); - } catch (SecurityError $e) { - $this->assertInstanceOf('\Twig\Sandbox\SecurityNotAllowedMethodError', $e, 'Exception should be an instance of Twig_Sandbox_SecurityNotAllowedMethodError'); - $this->assertEquals('FooObject', $e->getClassName(), 'Exception should be raised on the "FooObject" class'); - $this->assertEquals('foo', $e->getMethodName(), 'Exception should be raised on the "foo" method'); - } - } - - public function testSandboxUnallowedFilter() - { - $twig = $this->getEnvironment(true, [], self::$templates); - try { - $twig->load('1_basic2')->render(self::$params); - $this->fail('Sandbox throws a SecurityError exception if an unallowed filter is called'); - } catch (SecurityError $e) { - $this->assertInstanceOf('\Twig\Sandbox\SecurityNotAllowedFilterError', $e, 'Exception should be an instance of Twig_Sandbox_SecurityNotAllowedFilterError'); - $this->assertEquals('upper', $e->getFilterName(), 'Exception should be raised on the "upper" filter'); - } - } - - public function testSandboxUnallowedTag() - { - $twig = $this->getEnvironment(true, [], self::$templates); - try { - $twig->load('1_basic3')->render(self::$params); - $this->fail('Sandbox throws a SecurityError exception if an unallowed tag is used in the template'); - } catch (SecurityError $e) { - $this->assertInstanceOf('\Twig\Sandbox\SecurityNotAllowedTagError', $e, 'Exception should be an instance of Twig_Sandbox_SecurityNotAllowedTagError'); - $this->assertEquals('if', $e->getTagName(), 'Exception should be raised on the "if" tag'); - } - } - - public function testSandboxUnallowedProperty() - { - $twig = $this->getEnvironment(true, [], self::$templates); - try { - $twig->load('1_basic4')->render(self::$params); - $this->fail('Sandbox throws a SecurityError exception if an unallowed property is called in the template'); - } catch (SecurityError $e) { - $this->assertInstanceOf('\Twig\Sandbox\SecurityNotAllowedPropertyError', $e, 'Exception should be an instance of Twig_Sandbox_SecurityNotAllowedPropertyError'); - $this->assertEquals('FooObject', $e->getClassName(), 'Exception should be raised on the "FooObject" class'); - $this->assertEquals('bar', $e->getPropertyName(), 'Exception should be raised on the "bar" property'); - } - } - - /** - * @dataProvider getSandboxUnallowedToStringTests - */ - public function testSandboxUnallowedToString($template) - { - $twig = $this->getEnvironment(true, [], ['index' => $template], [], ['upper'], ['FooObject' => 'getAnotherFooObject'], [], ['random']); - try { - $twig->load('index')->render(self::$params); - $this->fail('Sandbox throws a SecurityError exception if an unallowed method (__toString()) is called in the template'); - } catch (SecurityError $e) { - $this->assertInstanceOf('\Twig\Sandbox\SecurityNotAllowedMethodError', $e, 'Exception should be an instance of Twig_Sandbox_SecurityNotAllowedMethodError'); - $this->assertEquals('FooObject', $e->getClassName(), 'Exception should be raised on the "FooObject" class'); - $this->assertEquals('__tostring', $e->getMethodName(), 'Exception should be raised on the "__toString" method'); - } - } - - public function getSandboxUnallowedToStringTests() - { - return [ - 'simple' => ['{{ obj }}'], - 'object_from_array' => ['{{ arr.obj }}'], - 'object_chain' => ['{{ obj.anotherFooObject }}'], - 'filter' => ['{{ obj|upper }}'], - 'filter_from_array' => ['{{ arr.obj|upper }}'], - 'function' => ['{{ random(obj) }}'], - 'function_from_array' => ['{{ random(arr.obj) }}'], - 'function_and_filter' => ['{{ random(obj|upper) }}'], - 'function_and_filter_from_array' => ['{{ random(arr.obj|upper) }}'], - 'object_chain_and_filter' => ['{{ obj.anotherFooObject|upper }}'], - 'object_chain_and_function' => ['{{ random(obj.anotherFooObject) }}'], - 'concat' => ['{{ obj ~ "" }}'], - 'concat_again' => ['{{ "" ~ obj }}'], - ]; - } - - /** - * @dataProvider getSandboxAllowedToStringTests - */ - public function testSandboxAllowedToString($template, $output) - { - $twig = $this->getEnvironment(true, [], ['index' => $template], ['set'], [], ['FooObject' => ['foo', 'getAnotherFooObject']]); - $this->assertEquals($output, $twig->load('index')->render(self::$params)); - } - - public function getSandboxAllowedToStringTests() - { - return [ - 'constant_test' => ['{{ obj is constant("PHP_INT_MAX") }}', ''], - 'set_object' => ['{% set a = obj.anotherFooObject %}{{ a.foo }}', 'foo'], - 'is_defined' => ['{{ obj.anotherFooObject is defined }}', '1'], - 'is_null' => ['{{ obj is null }}', ''], - 'is_sameas' => ['{{ obj is same as(obj) }}', '1'], - 'is_sameas_from_array' => ['{{ arr.obj is same as(arr.obj) }}', '1'], - 'is_sameas_from_another_method' => ['{{ obj.anotherFooObject is same as(obj.anotherFooObject) }}', ''], - ]; - } - - public function testSandboxAllowMethodToString() - { - $twig = $this->getEnvironment(true, [], self::$templates, [], [], ['FooObject' => '__toString']); - FooObject::reset(); - $this->assertEquals('foo', $twig->load('1_basic5')->render(self::$params), 'Sandbox allow some methods'); - $this->assertEquals(1, FooObject::$called['__toString'], 'Sandbox only calls method once'); - } - - public function testSandboxAllowMethodToStringDisabled() - { - $twig = $this->getEnvironment(false, [], self::$templates); - FooObject::reset(); - $this->assertEquals('foo', $twig->load('1_basic5')->render(self::$params), 'Sandbox allows __toString when sandbox disabled'); - $this->assertEquals(1, FooObject::$called['__toString'], 'Sandbox only calls method once'); - } - - public function testSandboxUnallowedFunction() - { - $twig = $this->getEnvironment(true, [], self::$templates); - try { - $twig->load('1_basic7')->render(self::$params); - $this->fail('Sandbox throws a SecurityError exception if an unallowed function is called in the template'); - } catch (SecurityError $e) { - $this->assertInstanceOf('\Twig\Sandbox\SecurityNotAllowedFunctionError', $e, 'Exception should be an instance of Twig_Sandbox_SecurityNotAllowedFunctionError'); - $this->assertEquals('cycle', $e->getFunctionName(), 'Exception should be raised on the "cycle" function'); - } - } - - public function testSandboxUnallowedRangeOperator() - { - $twig = $this->getEnvironment(true, [], self::$templates); - try { - $twig->load('1_range_operator')->render(self::$params); - $this->fail('Sandbox throws a SecurityError exception if the unallowed range operator is called'); - } catch (SecurityError $e) { - $this->assertInstanceOf('\Twig\Sandbox\SecurityNotAllowedFunctionError', $e, 'Exception should be an instance of Twig_Sandbox_SecurityNotAllowedFunctionError'); - $this->assertEquals('range', $e->getFunctionName(), 'Exception should be raised on the "range" function'); - } - } - - public function testSandboxAllowMethodFoo() - { - $twig = $this->getEnvironment(true, [], self::$templates, [], [], ['FooObject' => 'foo']); - FooObject::reset(); - $this->assertEquals('foo', $twig->load('1_basic1')->render(self::$params), 'Sandbox allow some methods'); - $this->assertEquals(1, FooObject::$called['foo'], 'Sandbox only calls method once'); - } - - public function testSandboxAllowFilter() - { - $twig = $this->getEnvironment(true, [], self::$templates, [], ['upper']); - $this->assertEquals('FABIEN', $twig->load('1_basic2')->render(self::$params), 'Sandbox allow some filters'); - } - - public function testSandboxAllowTag() - { - $twig = $this->getEnvironment(true, [], self::$templates, ['if']); - $this->assertEquals('foo', $twig->load('1_basic3')->render(self::$params), 'Sandbox allow some tags'); - } - - public function testSandboxAllowProperty() - { - $twig = $this->getEnvironment(true, [], self::$templates, [], [], [], ['FooObject' => 'bar']); - $this->assertEquals('bar', $twig->load('1_basic4')->render(self::$params), 'Sandbox allow some properties'); - } - - public function testSandboxAllowFunction() - { - $twig = $this->getEnvironment(true, [], self::$templates, [], [], [], [], ['cycle']); - $this->assertEquals('bar', $twig->load('1_basic7')->render(self::$params), 'Sandbox allow some functions'); - } - - public function testSandboxAllowRangeOperator() - { - $twig = $this->getEnvironment(true, [], self::$templates, [], [], [], [], ['range']); - $this->assertEquals('1', $twig->load('1_range_operator')->render(self::$params), 'Sandbox allow the range operator'); - } - - public function testSandboxAllowFunctionsCaseInsensitive() - { - foreach (['getfoobar', 'getFoobar', 'getFooBar'] as $name) { - $twig = $this->getEnvironment(true, [], self::$templates, [], [], ['FooObject' => $name]); - FooObject::reset(); - $this->assertEquals('foobarfoobar', $twig->load('1_basic8')->render(self::$params), 'Sandbox allow methods in a case-insensitive way'); - $this->assertEquals(2, FooObject::$called['getFooBar'], 'Sandbox only calls method once'); - - $this->assertEquals('foobarfoobar', $twig->load('1_basic9')->render(self::$params), 'Sandbox allow methods via shortcut names (ie. without get/set)'); - } - } - - public function testSandboxLocallySetForAnInclude() - { - self::$templates = [ - '2_basic' => '{{ obj.foo }}{% include "2_included" %}{{ obj.foo }}', - '2_included' => '{% if obj.foo %}{{ obj.foo|upper }}{% endif %}', - ]; - - $twig = $this->getEnvironment(false, [], self::$templates); - $this->assertEquals('fooFOOfoo', $twig->load('2_basic')->render(self::$params), 'Sandbox does nothing if disabled globally and sandboxed not used for the include'); - - self::$templates = [ - '3_basic' => '{{ obj.foo }}{% sandbox %}{% include "3_included" %}{% endsandbox %}{{ obj.foo }}', - '3_included' => '{% if obj.foo %}{{ obj.foo|upper }}{% endif %}', - ]; - - $twig = $this->getEnvironment(true, [], self::$templates); - try { - $twig->load('3_basic')->render(self::$params); - $this->fail('Sandbox throws a SecurityError exception when the included file is sandboxed'); - } catch (SecurityError $e) { - $this->assertInstanceOf('\Twig\Sandbox\SecurityNotAllowedTagError', $e, 'Exception should be an instance of Twig_Sandbox_SecurityNotAllowedTagError'); - $this->assertEquals('sandbox', $e->getTagName()); - } - } - - public function testMacrosInASandbox() - { - $twig = $this->getEnvironment(true, ['autoescape' => 'html'], ['index' => <<<EOF -{%- import _self as macros %} - -{%- macro test(text) %}<p>{{ text }}</p>{% endmacro %} - -{{- macros.test('username') }} -EOF - ], ['macro', 'import'], ['escape']); - - $this->assertEquals('<p>username</p>', $twig->load('index')->render([])); - } - - public function testSandboxDisabledAfterIncludeFunctionError() - { - $twig = $this->getEnvironment(false, [], self::$templates); - - $e = null; - try { - $twig->load('1_include')->render(self::$params); - } catch (\Throwable $e) { - } catch (\Exception $e) { - } - if (null === $e) { - $this->fail('An exception should be thrown for this test to be valid.'); - } - - $this->assertFalse($twig->getExtension('\Twig\Extension\SandboxExtension')->isSandboxed(), 'Sandboxed include() function call should not leave Sandbox enabled when an error occurs.'); - } - - protected function getEnvironment($sandboxed, $options, $templates, $tags = [], $filters = [], $methods = [], $properties = [], $functions = []) - { - $loader = new ArrayLoader($templates); - $twig = new Environment($loader, array_merge(['debug' => true, 'cache' => false, 'autoescape' => false], $options)); - $policy = new SecurityPolicy($tags, $filters, $methods, $properties, $functions); - $twig->addExtension(new SandboxExtension($policy, $sandboxed)); - - return $twig; - } -} - -class FooObject -{ - public static $called = ['__toString' => 0, 'foo' => 0, 'getFooBar' => 0]; - - public $bar = 'bar'; - - public static function reset() - { - self::$called = ['__toString' => 0, 'foo' => 0, 'getFooBar' => 0]; - } - - public function __toString() - { - ++self::$called['__toString']; - - return 'foo'; - } - - public function foo() - { - ++self::$called['foo']; - - return 'foo'; - } - - public function getFooBar() - { - ++self::$called['getFooBar']; - - return 'foobar'; - } - - public function getAnotherFooObject() - { - return new self(); - } -} diff --git a/vendor/twig/twig/test/Twig/Tests/FactoryRuntimeLoaderTest.php b/vendor/twig/twig/test/Twig/Tests/FactoryRuntimeLoaderTest.php deleted file mode 100644 index 47d62afc88..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/FactoryRuntimeLoaderTest.php +++ /dev/null @@ -1,34 +0,0 @@ -<?php - -/* - * This file is part of Twig. - * - * (c) Fabien Potencier - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Twig\RuntimeLoader\FactoryRuntimeLoader; - -class Twig_Tests_FactoryRuntimeLoaderTest extends \PHPUnit\Framework\TestCase -{ - public function testLoad() - { - $loader = new FactoryRuntimeLoader(['stdClass' => 'getRuntime']); - - $this->assertInstanceOf('stdClass', $loader->load('stdClass')); - } - - public function testLoadReturnsNullForUnmappedRuntime() - { - $loader = new FactoryRuntimeLoader(); - - $this->assertNull($loader->load('stdClass')); - } -} - -function getRuntime() -{ - return new \stdClass(); -} diff --git a/vendor/twig/twig/test/Twig/Tests/FileCachingTest.php b/vendor/twig/twig/test/Twig/Tests/FileCachingTest.php deleted file mode 100644 index fd7a4ebfc4..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/FileCachingTest.php +++ /dev/null @@ -1,66 +0,0 @@ -<?php - -/* - * This file is part of Twig. - * - * (c) Fabien Potencier - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Twig\Environment; -use Twig\Loader\ArrayLoader; - -require_once __DIR__.'/FilesystemHelper.php'; - -class Twig_Tests_FileCachingTest extends \PHPUnit\Framework\TestCase -{ - private $env; - private $tmpDir; - - protected function setUp() - { - $this->tmpDir = sys_get_temp_dir().'/TwigTests'; - if (!file_exists($this->tmpDir)) { - @mkdir($this->tmpDir, 0777, true); - } - - if (!is_writable($this->tmpDir)) { - $this->markTestSkipped(sprintf('Unable to run the tests as "%s" is not writable.', $this->tmpDir)); - } - - $this->env = new Environment(new ArrayLoader(['index' => 'index', 'index2' => 'index2']), ['cache' => $this->tmpDir]); - } - - protected function tearDown() - { - Twig_Tests_FilesystemHelper::removeDir($this->tmpDir); - } - - /** - * @group legacy - */ - public function testWritingCacheFiles() - { - $name = 'index'; - $this->env->load($name); - $cacheFileName = $this->env->getCacheFilename($name); - - $this->assertFileExists($cacheFileName, 'Cache file does not exist.'); - } - - /** - * @group legacy - */ - public function testClearingCacheFiles() - { - $name = 'index2'; - $this->env->load($name); - $cacheFileName = $this->env->getCacheFilename($name); - - $this->assertFileExists($cacheFileName, 'Cache file does not exist.'); - $this->env->clearCacheFiles(); - $this->assertFileNotExists($cacheFileName, 'Cache file was not cleared.'); - } -} diff --git a/vendor/twig/twig/test/Twig/Tests/FileExtensionEscapingStrategyTest.php b/vendor/twig/twig/test/Twig/Tests/FileExtensionEscapingStrategyTest.php deleted file mode 100644 index 120d9ce7c4..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/FileExtensionEscapingStrategyTest.php +++ /dev/null @@ -1,53 +0,0 @@ -<?php - -/* - * This file is part of Twig. - * - * (c) Fabien Potencier - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Twig\FileExtensionEscapingStrategy; - -class Twig_Tests_FileExtensionEscapingStrategyTest extends \PHPUnit\Framework\TestCase -{ - /** - * @dataProvider getGuessData - */ - public function testGuess($strategy, $filename) - { - $this->assertSame($strategy, FileExtensionEscapingStrategy::guess($filename)); - } - - public function getGuessData() - { - return [ - // default - ['html', 'foo.html'], - ['html', 'foo.html.twig'], - ['html', 'foo'], - ['html', 'foo.bar.twig'], - ['html', 'foo.txt/foo'], - ['html', 'foo.txt/foo.js/'], - - // css - ['css', 'foo.css'], - ['css', 'foo.css.twig'], - ['css', 'foo.twig.css'], - ['css', 'foo.js.css'], - ['css', 'foo.js.css.twig'], - - // js - ['js', 'foo.js'], - ['js', 'foo.js.twig'], - ['js', 'foo.txt/foo.js'], - ['js', 'foo.txt.twig/foo.js'], - - // txt - [false, 'foo.txt'], - [false, 'foo.txt.twig'], - ]; - } -} diff --git a/vendor/twig/twig/test/Twig/Tests/FilesystemHelper.php b/vendor/twig/twig/test/Twig/Tests/FilesystemHelper.php deleted file mode 100644 index 17c7ae1a19..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/FilesystemHelper.php +++ /dev/null @@ -1,30 +0,0 @@ -<?php - -/* - * This file is part of Twig. - * - * (c) Fabien Potencier - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -class Twig_Tests_FilesystemHelper -{ - public static function removeDir($dir) - { - $iterator = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($dir, PHP_VERSION_ID < 50300 ? 0 : \FilesystemIterator::SKIP_DOTS), \RecursiveIteratorIterator::CHILD_FIRST); - foreach ($iterator as $filename => $fileInfo) { - if ($iterator->isDot()) { - continue; - } - - if ($fileInfo->isDir()) { - rmdir($filename); - } else { - unlink($filename); - } - } - rmdir($dir); - } -} diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/autoescape/block.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/autoescape/block.test deleted file mode 100644 index a80b80c376..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/autoescape/block.test +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -blocks and autoescape ---TEMPLATE-- -{{ include('unrelated.txt.twig') -}} -{{ include('template.html.twig') -}} ---TEMPLATE(unrelated.txt.twig)-- -{% block content %}{% endblock %} ---TEMPLATE(template.html.twig)-- -{% extends 'parent.html.twig' %} -{% block content %} -{{ br -}} -{% endblock %} ---TEMPLATE(parent.html.twig)-- -{% set _content = block('content')|raw %} -{{ _content|raw }} ---DATA-- -return ['br' => '<br />'] ---CONFIG-- -return ['autoescape' => 'name'] ---EXPECT-- -<br /> diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/autoescape/name.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/autoescape/name.test deleted file mode 100644 index 5ad573cf0a..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/autoescape/name.test +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -"name" autoescape strategy ---TEMPLATE-- -{{ br -}} -{{ include('index.js.twig') -}} -{{ include('index.html.twig') -}} -{{ include('index.txt.twig') -}} ---TEMPLATE(index.js.twig)-- -{{ br -}} ---TEMPLATE(index.html.twig)-- -{{ br -}} ---TEMPLATE(index.txt.twig)-- -{{ br -}} ---DATA-- -return ['br' => '<br />'] ---CONFIG-- -return ['autoescape' => 'name'] ---EXPECT-- -<br /> -\u003Cbr\u0020\/\u003E -<br /> -<br /> diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/errors/base.html b/vendor/twig/twig/test/Twig/Tests/Fixtures/errors/base.html deleted file mode 100644 index cb0dbe444b..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/errors/base.html +++ /dev/null @@ -1 +0,0 @@ -{% block content %}{% endblock %} diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/errors/index.html b/vendor/twig/twig/test/Twig/Tests/Fixtures/errors/index.html deleted file mode 100644 index df57c822f9..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/errors/index.html +++ /dev/null @@ -1,7 +0,0 @@ -{% extends 'base.html' %} -{% block content %} - {{ foo.bar }} -{% endblock %} -{% block foo %} - {{ foo.bar }} -{% endblock %} diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/errors/leak-output.php b/vendor/twig/twig/test/Twig/Tests/Fixtures/errors/leak-output.php deleted file mode 100644 index 152a18287f..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/errors/leak-output.php +++ /dev/null @@ -1,31 +0,0 @@ -<?php - -require __DIR__.'/../../../../../vendor/autoload.php'; - -use Twig\Environment; -use Twig\Extension\AbstractExtension; -use Twig\Loader\ArrayLoader; -use Twig\TwigFilter; - -class BrokenExtension extends AbstractExtension -{ - public function getFilters() - { - return [ - new TwigFilter('broken', [$this, 'broken']), - ]; - } - - public function broken() - { - die('OOPS'); - } -} - -$loader = new ArrayLoader([ - 'index.html.twig' => 'Hello {{ "world"|broken }}', -]); -$twig = new Environment($loader, ['debug' => isset($argv[1])]); -$twig->addExtension(new BrokenExtension()); - -echo $twig->render('index.html.twig'); diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/child_contents_outside_blocks.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/child_contents_outside_blocks.test deleted file mode 100644 index 74a1cc2833..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/child_contents_outside_blocks.test +++ /dev/null @@ -1,15 +0,0 @@ ---TEST-- -Exception for child templates defining content outside blocks defined by parent ---TEMPLATE-- -{% extends 'base.twig' %} - -Content outside a block. - -{% block sidebar %} - Content inside a block. -{% endblock %} ---TEMPLATE(base.twig)-- -{% block sidebar %} -{% endblock %} ---EXCEPTION-- -Twig\Error\SyntaxError: A template that extends another one cannot include content outside Twig blocks. Did you forget to put the content inside a {% block %} tag in "index.twig" at line 3? diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/exception_in_extension_extends.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/exception_in_extension_extends.test deleted file mode 100644 index 2ab298059d..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/exception_in_extension_extends.test +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -Exception thrown from a child for an extension error ---TEMPLATE-- -{% extends 'base.twig' %} ---TEMPLATE(base.twig)-- - - -{{ random([]) }} ---DATA-- -return [] ---EXCEPTION-- -Twig\Error\RuntimeError: The random function cannot pick from an empty array in "base.twig" at line 4. diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/exception_in_extension_include.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/exception_in_extension_include.test deleted file mode 100644 index e2281b2903..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/exception_in_extension_include.test +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -Exception thrown from an include for an extension error ---TEMPLATE-- -{% include 'content.twig' %} ---TEMPLATE(content.twig)-- - - -{{ random([]) }} ---DATA-- -return [] ---EXCEPTION-- -Twig\Error\RuntimeError: The random function cannot pick from an empty array in "content.twig" at line 4. diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/multiline_array_with_undefined_variable.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/multiline_array_with_undefined_variable.test deleted file mode 100644 index 66784292c9..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/multiline_array_with_undefined_variable.test +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -Exception for multiline array with undefined variable ---TEMPLATE-- -{% set foo = { - foo: 'foo', - bar: 'bar', - - - foobar: foobar, - - - - foo2: foo2, -} %} ---DATA-- -return ['foobar' => 'foobar'] ---EXCEPTION-- -Twig\Error\RuntimeError: Variable "foo2" does not exist in "index.twig" at line 11. diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/multiline_array_with_undefined_variable_again.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/multiline_array_with_undefined_variable_again.test deleted file mode 100644 index 7f5e96b049..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/multiline_array_with_undefined_variable_again.test +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -Exception for multiline array with undefined variable ---TEMPLATE-- -{% set foo = { - foo: 'foo', - bar: 'bar', - - - foobar: foobar, - - - - foo2: foo2, -} %} ---DATA-- -return [] ---EXCEPTION-- -Twig\Error\RuntimeError: Variable "foobar" does not exist in "index.twig" at line 7. diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/multiline_function_with_undefined_variable.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/multiline_function_with_undefined_variable.test deleted file mode 100644 index 8bc524ef18..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/multiline_function_with_undefined_variable.test +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -Exception for multile function with undefined variable ---TEMPLATE-- -{{ include('foo', - with_context=with_context -) }} ---TEMPLATE(foo)-- -Foo ---DATA-- -return [] ---EXCEPTION-- -Twig\Error\RuntimeError: Variable "with_context" does not exist in "index.twig" at line 3. diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/multiline_function_with_unknown_argument.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/multiline_function_with_unknown_argument.test deleted file mode 100644 index 5f413d406a..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/multiline_function_with_unknown_argument.test +++ /dev/null @@ -1,9 +0,0 @@ ---TEST-- -Exception for multiline function with unknown argument ---TEMPLATE-- -{{ include('foo', - with_context=True, - invalid=False -) }} ---EXCEPTION-- -Twig\Error\SyntaxError: Unknown argument "invalid" for function "include(template, variables, with_context, ignore_missing, sandboxed)" in "index.twig" at line 4. diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/multiline_tag_with_undefined_variable.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/multiline_tag_with_undefined_variable.test deleted file mode 100644 index 032ad831ec..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/multiline_tag_with_undefined_variable.test +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -Exception for multiline tag with undefined variable ---TEMPLATE-- -{% include 'foo' - with vars -%} ---TEMPLATE(foo)-- -Foo ---DATA-- -return [] ---EXCEPTION-- -Twig\Error\RuntimeError: Variable "vars" does not exist in "index.twig" at line 3. diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/strict_comparison_operator.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/strict_comparison_operator.test deleted file mode 100644 index e14beb672d..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/strict_comparison_operator.test +++ /dev/null @@ -1,6 +0,0 @@ ---TEST-- -The PHP === strict comparison operator is not supported ---TEMPLATE-- -{{ 1 === 2 }} ---EXCEPTION-- -Twig\Error\SyntaxError: Unexpected operator of value "=". Did you try to use "===" or "!==" for strict comparison? Use "is same as(value)" instead in "index.twig" at line 2. diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/syntax_error_in_reused_template.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/syntax_error_in_reused_template.test deleted file mode 100644 index 4ce06854fb..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/syntax_error_in_reused_template.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -Exception for syntax error in reused template ---TEMPLATE-- -{% use 'foo.twig' %} ---TEMPLATE(foo.twig)-- -{% block bar %} - {% do node.data = 5 %} -{% endblock %} ---EXCEPTION-- -Twig\Error\SyntaxError: Unexpected token "operator" of value "=" ("end of statement block" expected) in "foo.twig" at line 3. diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/unclosed_tag.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/unclosed_tag.test deleted file mode 100644 index b4fc169167..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/unclosed_tag.test +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -Exception for an unclosed tag ---TEMPLATE-- -{% block foo %} - {% if foo %} - - - - - {% for i in fo %} - - - - {% endfor %} - - - -{% endblock %} ---EXCEPTION-- -Twig\Error\SyntaxError: Unexpected "endblock" tag (expecting closing tag for the "if" tag defined near line 4) in "index.twig" at line 16. diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/undefined_parent.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/undefined_parent.test deleted file mode 100644 index 07f855a3fe..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/undefined_parent.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -Exception for an undefined parent ---TEMPLATE-- -{% extends 'foo.html' %} - -{% set foo = "foo" %} ---DATA-- -return [] ---EXCEPTION-- -Twig\Error\LoaderError: Template "foo.html" is not defined in "index.twig" at line 2. diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/undefined_template_in_child_template.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/undefined_template_in_child_template.test deleted file mode 100644 index 904faa50ad..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/undefined_template_in_child_template.test +++ /dev/null @@ -1,15 +0,0 @@ ---TEST-- -Exception for an undefined template in a child template ---TEMPLATE-- -{% extends 'base.twig' %} - -{% block sidebar %} - {{ include('include.twig') }} -{% endblock %} ---TEMPLATE(base.twig)-- -{% block sidebar %} -{% endblock %} ---DATA-- -return [] ---EXCEPTION-- -Twig\Error\LoaderError: Template "include.twig" is not defined in "index.twig" at line 5. diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/undefined_trait.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/undefined_trait.test deleted file mode 100644 index 5bfdd07e61..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/undefined_trait.test +++ /dev/null @@ -1,9 +0,0 @@ ---TEST-- -Exception for an undefined trait ---TEMPLATE-- -{% use 'foo' with foobar as bar %} ---TEMPLATE(foo)-- -{% block bar %} -{% endblock %} ---EXCEPTION-- -Twig\Error\RuntimeError: Block "foobar" is not defined in trait "foo" in "index.twig" at line 2. diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/_self.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/_self.test deleted file mode 100644 index fb88f4c859..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/_self.test +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -_self returns the template name ---TEMPLATE-- -{{ _self }} ---DATA-- -return [] ---EXPECT-- -index.twig diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/array.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/array.test deleted file mode 100644 index bf6033356a..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/array.test +++ /dev/null @@ -1,61 +0,0 @@ ---TEST-- -Twig supports array notation ---TEMPLATE-- -{# empty array #} -{{ []|join(',') }} - -{{ [1, 2]|join(',') }} -{{ ['foo', "bar"]|join(',') }} -{{ {0: 1, 'foo': 'bar'}|join(',') }} -{{ {0: 1, 'foo': 'bar'}|keys|join(',') }} - -{{ {0: 1, foo: 'bar'}|join(',') }} -{{ {0: 1, foo: 'bar'}|keys|join(',') }} - -{# nested arrays #} -{% set a = [1, 2, [1, 2], {'foo': {'foo': 'bar'}}] %} -{{ a[2]|join(',') }} -{{ a[3]["foo"]|join(',') }} - -{# works even if [] is used inside the array #} -{{ [foo[bar]]|join(',') }} - -{# elements can be any expression #} -{{ ['foo'|upper, bar|upper, bar == foo]|join(',') }} - -{# arrays can have a trailing , like in PHP #} -{{ - [ - 1, - 2, - ]|join(',') -}} - -{# keys can be any expression #} -{% set a = 1 %} -{% set b = "foo" %} -{% set ary = { (a): 'a', (b): 'b', 'c': 'c', (a ~ b): 'd' } %} -{{ ary|keys|join(',') }} -{{ ary|join(',') }} ---DATA-- -return ['bar' => 'bar', 'foo' => ['bar' => 'bar']] ---EXPECT-- -1,2 -foo,bar -1,bar -0,foo - -1,bar -0,foo - -1,2 -bar - -bar - -FOO,BAR, - -1,2 - -1,foo,c,1foo -a,b,c,d diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/array_call.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/array_call.test deleted file mode 100644 index 8c7a2ee7cb..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/array_call.test +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -Twig supports method calls ---TEMPLATE-- -{{ items.foo }} -{{ items['foo'] }} -{{ items[foo] }} -{{ items[items[foo]] }} ---DATA-- -return ['foo' => 'bar', 'items' => ['foo' => 'bar', 'bar' => 'foo']] ---EXPECT-- -bar -bar -foo -bar diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/binary.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/binary.test deleted file mode 100644 index b4e8be58d3..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/binary.test +++ /dev/null @@ -1,46 +0,0 @@ ---TEST-- -Twig supports binary operations (+, -, *, /, ~, %, and, or) ---TEMPLATE-- -{{ 1 + 1 }} -{{ 2 - 1 }} -{{ 2 * 2 }} -{{ 2 / 2 }} -{{ 3 % 2 }} -{{ 1 and 1 }} -{{ 1 and 0 }} -{{ 0 and 1 }} -{{ 0 and 0 }} -{{ 1 or 1 }} -{{ 1 or 0 }} -{{ 0 or 1 }} -{{ 0 or 0 }} -{{ 0 or 1 and 0 }} -{{ 1 or 0 and 1 }} -{{ "foo" ~ "bar" }} -{{ foo ~ "bar" }} -{{ "foo" ~ bar }} -{{ foo ~ bar }} -{{ 20 // 7 }} ---DATA-- -return ['foo' => 'bar', 'bar' => 'foo'] ---EXPECT-- -2 -1 -4 -1 -1 -1 - - - -1 -1 -1 - - -1 -foobar -barbar -foofoo -barfoo -2 diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/bitwise.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/bitwise.test deleted file mode 100644 index c2bda1cc6b..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/bitwise.test +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -Twig supports bitwise operations ---TEMPLATE-- -{{ 1 b-and 5 }} -{{ 1 b-or 5 }} -{{ 1 b-xor 5 }} -{{ (1 and 0 b-or 0) is same as(1 and (0 b-or 0)) ? 'ok' : 'ko' }} ---DATA-- -return [] ---EXPECT-- -1 -5 -4 -ok diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/call_argument_defined_twice.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/call_argument_defined_twice.test deleted file mode 100644 index 36539a6d13..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/call_argument_defined_twice.test +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -Argument is defined twice in a call ---TEMPLATE-- -{{ date(987654, date = 123456) }} ---DATA-- -return [] ---EXCEPTION-- -Twig\Error\SyntaxError: Argument "date" is defined twice for function "date" in "index.twig" at line 2. diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/call_positional_arg_after_named_arg.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/call_positional_arg_after_named_arg.test deleted file mode 100644 index 729c674859..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/call_positional_arg_after_named_arg.test +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -Positional arguments after named arguments in a call ---TEMPLATE-- -{{ date(date = 123456, 'Y-m-d') }} ---DATA-- -return [] ---EXCEPTION-- -Twig\Error\SyntaxError: Positional arguments cannot be used after named arguments for function "date" in "index.twig" at line 2. diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/comparison.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/comparison.test deleted file mode 100644 index 2811634f76..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/comparison.test +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -Twig supports comparison operators (==, !=, <, >, >=, <=) ---TEMPLATE-- -{{ 1 > 2 }}/{{ 1 > 1 }}/{{ 1 >= 2 }}/{{ 1 >= 1 }} -{{ 1 < 2 }}/{{ 1 < 1 }}/{{ 1 <= 2 }}/{{ 1 <= 1 }} -{{ 1 == 1 }}/{{ 1 == 2 }} -{{ 1 != 1 }}/{{ 1 != 2 }} ---DATA-- -return [] ---EXPECT-- -///1 -1//1/1 -1/ -/1 diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/divisibleby.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/divisibleby.test deleted file mode 100644 index f1bf5681e5..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/divisibleby.test +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -Twig supports the "divisible by" operator ---TEMPLATE-- -{{ 8 is divisible by(2) ? 'OK' }} -{{ 8 is not divisible by(3) ? 'OK' }} -{{ 8 is divisible by (2) ? 'OK' }} -{{ 8 is not - divisible - by - (3) ? 'OK' }} ---DATA-- -return [] ---EXPECT-- -OK -OK -OK -OK diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/dotdot.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/dotdot.test deleted file mode 100644 index 0efa930569..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/dotdot.test +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -Twig supports the .. operator ---TEMPLATE-- -{% for i in 0..10 %}{{ i }} {% endfor %} - -{% for letter in 'a'..'z' %}{{ letter }} {% endfor %} - -{% for letter in 'a'|upper..'z'|upper %}{{ letter }} {% endfor %} - -{% for i in foo[0]..foo[1] %}{{ i }} {% endfor %} - -{% for i in 0 + 1 .. 10 - 1 %}{{ i }} {% endfor %} ---DATA-- -return ['foo' => [1, 10]] ---EXPECT-- -0 1 2 3 4 5 6 7 8 9 10 -a b c d e f g h i j k l m n o p q r s t u v w x y z -A B C D E F G H I J K L M N O P Q R S T U V W X Y Z -1 2 3 4 5 6 7 8 9 10 -1 2 3 4 5 6 7 8 9 diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/ends_with.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/ends_with.test deleted file mode 100644 index c8086d6d4c..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/ends_with.test +++ /dev/null @@ -1,26 +0,0 @@ ---TEST-- -Twig supports the "ends with" operator ---TEMPLATE-- -{{ 'foo' ends with 'o' ? 'OK' : 'KO' }} -{{ not ('foo' ends with 'f') ? 'OK' : 'KO' }} -{{ not ('foo' ends with 'foowaytoolong') ? 'OK' : 'KO' }} -{{ 'foo' ends with '' ? 'OK' : 'KO' }} -{{ '1' ends with true ? 'OK' : 'KO' }} -{{ 1 ends with true ? 'OK' : 'KO' }} -{{ 0 ends with false ? 'OK' : 'KO' }} -{{ '' ends with false ? 'OK' : 'KO' }} -{{ false ends with false ? 'OK' : 'KO' }} -{{ false ends with '' ? 'OK' : 'KO' }} ---DATA-- -return [] ---EXPECT-- -OK -OK -OK -OK -KO -KO -KO -KO -KO -KO diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/floats.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/floats.test deleted file mode 100644 index cdf871cde1..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/floats.test +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -Twig compiles floats properly ---CONDITION-- -version_compare(phpversion(), '7.0.0', '>=') ---TEMPLATE-- -{% set val2 = 0.0 %} - -{{ val is same as (0.0) ? 'Yes' : 'No' }} -{{ val2 is same as (0.0) ? 'Yes' : 'No' }} -{{ val is same as (val2) ? 'Yes' : 'No' }} ---DATA-- -return ['val' => 0.0] ---EXPECT-- -Yes -Yes -Yes diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/grouping.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/grouping.test deleted file mode 100644 index 069ebf793d..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/grouping.test +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -Twig supports grouping of expressions ---TEMPLATE-- -{{ (2 + 2) / 2 }} ---DATA-- -return [] ---EXPECT-- -2 diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/literals.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/literals.test deleted file mode 100644 index 308e8df2ac..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/literals.test +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -Twig supports literals ---TEMPLATE-- -1 {{ true }} -2 {{ TRUE }} -3 {{ false }} -4 {{ FALSE }} -5 {{ none }} -6 {{ NONE }} -7 {{ null }} -8 {{ NULL }} ---DATA-- -return [] ---EXPECT-- -1 1 -2 1 -3 -4 -5 -6 -7 -8 diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/magic_call.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/magic_call.test deleted file mode 100644 index 60417e04ff..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/magic_call.test +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -Twig supports __call() for attributes ---TEMPLATE-- -{{ foo.foo }} -{{ foo.bar }} ---DATA-- -class TestClassForMagicCallAttributes -{ - public function getBar() - { - return 'bar_from_getbar'; - } - - public function __call($method, $arguments) - { - if ('foo' === $method) { - return 'foo_from_call'; - } - - return false; - } -} - -return ['foo' => new TestClassForMagicCallAttributes()] ---EXPECT-- -foo_from_call -bar_from_getbar diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/matches.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/matches.test deleted file mode 100644 index 95459c3b0f..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/matches.test +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -Twig supports the "matches" operator ---TEMPLATE-- -{{ 'foo' matches '/o/' ? 'OK' : 'KO' }} -{{ 'foo' matches '/^fo/' ? 'OK' : 'KO' }} -{{ 'foo' matches '/O/i' ? 'OK' : 'KO' }} ---DATA-- -return [] ---EXPECT-- -OK -OK -OK diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/method_call.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/method_call.test deleted file mode 100644 index 1826842b6f..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/method_call.test +++ /dev/null @@ -1,28 +0,0 @@ ---TEST-- -Twig supports method calls ---TEMPLATE-- -{{ items.foo.foo }} -{{ items.foo.getFoo() }} -{{ items.foo.bar }} -{{ items.foo['bar'] }} -{{ items.foo.bar('a', 43) }} -{{ items.foo.bar(foo) }} -{{ items.foo.self.foo() }} -{{ items.foo.is }} -{{ items.foo.in }} -{{ items.foo.not }} ---DATA-- -return ['foo' => 'bar', 'items' => ['foo' => new TwigTestFoo(), 'bar' => 'foo']] ---CONFIG-- -return ['strict_variables' => false] ---EXPECT-- -foo -foo -bar - -bar_a-43 -bar_bar -foo -is -in -not diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/negative_numbers.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/negative_numbers.test deleted file mode 100644 index c2a6e34024..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/negative_numbers.test +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -Twig manages negative numbers correctly ---TEMPLATE-- -{{ -1 }} -{{ - 1 }} -{{ 5 - 1 }} -{{ 5-1 }} -{{ 5 + -1 }} -{{ 5 + - 1 }} ---DATA-- -return [] ---EXPECT-- --1 --1 -4 -4 -4 -4 diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/not_arrow_fn.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/not_arrow_fn.test deleted file mode 100644 index af82c47cf5..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/not_arrow_fn.test +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -A string in parentheses cannot be confused with an arrow function ---TEMPLATE-- -{{ ["foo", "bar"]|join(("f")) }} ---DATA-- -return [] ---EXPECT-- -foofbar diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/operators_as_variables.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/operators_as_variables.test deleted file mode 100644 index fa9a843c0f..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/operators_as_variables.test +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -Twig allows to use named operators as variable names ---TEMPLATE-- -{% for match in matches %} - {{- match }} -{% endfor %} -{{ in }} -{{ is }} ---DATA-- -return ['matches' => [1, 2, 3], 'in' => 'in', 'is' => 'is'] ---EXPECT-- -1 -2 -3 -in -is diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/postfix.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/postfix.test deleted file mode 100644 index 276cbf197d..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/postfix.test +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -Twig parses postfix expressions ---TEMPLATE-- -{% import _self as macros %} - -{% macro foo() %}foo{% endmacro %} - -{{ 'a' }} -{{ 'a'|upper }} -{{ ('a')|upper }} -{{ -1|upper }} -{{ macros.foo() }} -{{ (macros).foo() }} ---DATA-- -return [] ---EXPECT-- -a -A -A --1 -foo -foo diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/power.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/power.test deleted file mode 100644 index 84fd23692c..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/power.test +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -Twig parses power expressions ---TEMPLATE-- -{{ 2**3 }} -{{ (-2)**3 }} -{{ (-2)**(-3) }} -{{ a ** a }} -{{ a ** b }} -{{ b ** a }} -{{ b ** b }} ---DATA-- -return ['a' => 4, 'b' => -2] ---EXPECT-- -8 --8 --0.125 -256 -0.0625 -16 -0.25 diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/sameas.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/sameas.test deleted file mode 100644 index 83f3691f97..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/sameas.test +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -Twig supports the "same as" operator ---TEMPLATE-- -{{ 1 is same as(1) ? 'OK' }} -{{ 1 is not same as(true) ? 'OK' }} -{{ 1 is same as(1) ? 'OK' }} -{{ 1 is not same as(true) ? 'OK' }} -{{ 1 is same as (1) ? 'OK' }} -{{ 1 is not - same - as - (true) ? 'OK' }} ---DATA-- -return [] ---EXPECT-- -OK -OK -OK -OK -OK -OK diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/starts_with.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/starts_with.test deleted file mode 100644 index a78ff1eac7..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/starts_with.test +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -Twig supports the "starts with" operator ---TEMPLATE-- -{{ 'foo' starts with 'f' ? 'OK' : 'KO' }} -{{ not ('foo' starts with 'oo') ? 'OK' : 'KO' }} -{{ not ('foo' starts with 'foowaytoolong') ? 'OK' : 'KO' }} -{{ 'foo' starts with 'f' ? 'OK' : 'KO' }} -{{ 'foo' starts -with 'f' ? 'OK' : 'KO' }} -{{ 'foo' starts with '' ? 'OK' : 'KO' }} -{{ '1' starts with true ? 'OK' : 'KO' }} -{{ '' starts with false ? 'OK' : 'KO' }} -{{ 'a' starts with false ? 'OK' : 'KO' }} -{{ false starts with '' ? 'OK' : 'KO' }} ---DATA-- -return [] ---EXPECT-- -OK -OK -OK -OK -OK -OK -KO -KO -KO -KO diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/string_operator_as_var_assignment.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/string_operator_as_var_assignment.test deleted file mode 100644 index 478d4eb5e5..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/string_operator_as_var_assignment.test +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -Twig supports the string operators as variable names in assignments ---TEMPLATE-- -{% for matches in [1, 2] %} - {{- matches }} -{% endfor %} - -{% set matches = [1, 2] %} - -OK ---DATA-- -return [] ---EXPECT-- -1 -2 - - -OK diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/strings.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/strings.test deleted file mode 100644 index f402c89399..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/strings.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -Twig supports string interpolation ---TEMPLATE-- -{{ "foo #{"foo #{bar} baz"} baz" }} -{{ "foo #{bar}#{bar} baz" }} ---DATA-- -return ['bar' => 'BAR'] ---EXPECT-- -foo foo BAR baz baz -foo BARBAR baz diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/ternary_operator.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/ternary_operator.test deleted file mode 100644 index 37eccc0f54..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/ternary_operator.test +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -Twig supports the ternary operator ---TEMPLATE-- -{{ 1 ? 'YES' : 'NO' }} -{{ 0 ? 'YES' : 'NO' }} -{{ 0 ? 'YES' : (1 ? 'YES1' : 'NO1') }} -{{ 0 ? 'YES' : (0 ? 'YES1' : 'NO1') }} -{{ 1 == 1 ? 'foo<br />':'' }} -{{ foo ~ (bar ? ('-' ~ bar) : '') }} ---DATA-- -return ['foo' => 'foo', 'bar' => 'bar'] ---EXPECT-- -YES -NO -YES1 -NO1 -foo<br /> -foo-bar diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/ternary_operator_noelse.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/ternary_operator_noelse.test deleted file mode 100644 index 8b0f7284b9..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/ternary_operator_noelse.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -Twig supports the ternary operator ---TEMPLATE-- -{{ 1 ? 'YES' }} -{{ 0 ? 'YES' }} ---DATA-- -return [] ---EXPECT-- -YES - diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/ternary_operator_nothen.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/ternary_operator_nothen.test deleted file mode 100644 index ecd6b75465..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/ternary_operator_nothen.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -Twig supports the ternary operator ---TEMPLATE-- -{{ 'YES' ?: 'NO' }} -{{ 0 ?: 'NO' }} ---DATA-- -return [] ---EXPECT-- -YES -NO diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/two_word_operators_as_variables.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/two_word_operators_as_variables.test deleted file mode 100644 index eca3b285bb..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/two_word_operators_as_variables.test +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -Twig does not allow to use two-word named operators as variable names ---TEMPLATE-- -{{ starts with }} ---DATA-- -return [] ---EXCEPTION-- -Twig\Error\SyntaxError: Unexpected token "operator" of value "starts with" in "index.twig" at line 2. diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/unary.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/unary.test deleted file mode 100644 index 5422531190..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/unary.test +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -Twig supports unary operators (not, -, +) ---TEMPLATE-- -{{ not 1 }}/{{ not 0 }} -{{ +1 + 1 }}/{{ -1 - 1 }} -{{ not (false or true) }} ---DATA-- -return [] ---EXPECT-- -/1 -2/-2 - diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/unary_macro_arguments.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/unary_macro_arguments.test deleted file mode 100644 index 27deba3ef5..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/unary_macro_arguments.test +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -Twig manages negative numbers as default parameters ---TEMPLATE-- -{% import _self as macros %} -{{ macros.negative_number1() }} -{{ macros.negative_number2() }} -{{ macros.negative_number3() }} -{{ macros.positive_number1() }} -{{ macros.positive_number2() }} -{% macro negative_number1(nb=-1) %}{{ nb }}{% endmacro %} -{% macro negative_number2(nb = --1) %}{{ nb }}{% endmacro %} -{% macro negative_number3(nb = - 1) %}{{ nb }}{% endmacro %} -{% macro positive_number1(nb = +1) %}{{ nb }}{% endmacro %} -{% macro positive_number2(nb = ++1) %}{{ nb }}{% endmacro %} ---DATA-- -return [] ---EXPECT-- --1 -1 --1 -1 -1 diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/unary_precedence.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/unary_precedence.test deleted file mode 100644 index 9c56ab12c0..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/unary_precedence.test +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -Twig unary operators precedence ---TEMPLATE-- -{{ -1 - 1 }} -{{ -1 - -1 }} -{{ -1 * -1 }} -{{ 4 / -1 * 5 }} ---DATA-- -return [] ---EXPECT-- --2 -0 -1 --20 diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/abs.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/abs.test deleted file mode 100644 index 7518769d4a..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/abs.test +++ /dev/null @@ -1,30 +0,0 @@ ---TEST-- -"abs" filter ---TEMPLATE-- -{{ (-5.5)|abs }} -{{ (-5)|abs }} -{{ (-0)|abs }} -{{ 0|abs }} -{{ 5|abs }} -{{ 5.5|abs }} -{{ number1|abs }} -{{ number2|abs }} -{{ number3|abs }} -{{ number4|abs }} -{{ number5|abs }} -{{ number6|abs }} ---DATA-- -return ['number1' => -5.5, 'number2' => -5, 'number3' => -0, 'number4' => 0, 'number5' => 5, 'number6' => 5.5] ---EXPECT-- -5.5 -5 -0 -0 -5 -5.5 -5.5 -5 -0 -0 -5 -5.5 diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/batch.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/batch.test deleted file mode 100644 index 0acf25bd61..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/batch.test +++ /dev/null @@ -1,31 +0,0 @@ ---TEST-- -"batch" filter ---TEMPLATE-- -{% for row in items|batch(3) %} - <div class=row> - {% for column in row %} - <div class=item>{{ column }}</div> - {% endfor %} - </div> -{% endfor %} ---DATA-- -return ['items' => ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j']] ---EXPECT-- -<div class=row> - <div class=item>a</div> - <div class=item>b</div> - <div class=item>c</div> - </div> - <div class=row> - <div class=item>d</div> - <div class=item>e</div> - <div class=item>f</div> - </div> - <div class=row> - <div class=item>g</div> - <div class=item>h</div> - <div class=item>i</div> - </div> - <div class=row> - <div class=item>j</div> - </div> diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/batch_float.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/batch_float.test deleted file mode 100644 index dad004ec2c..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/batch_float.test +++ /dev/null @@ -1,29 +0,0 @@ ---TEST-- -"batch" filter ---TEMPLATE-- -{% for row in items|batch(3.1) %} - <div class=row> - {% for column in row %} - <div class=item>{{ column }}</div> - {% endfor %} - </div> -{% endfor %} ---DATA-- -return ['items' => ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j']] ---EXPECT-- -<div class=row> - <div class=item>a</div> - <div class=item>b</div> - <div class=item>c</div> - <div class=item>d</div> - </div> - <div class=row> - <div class=item>e</div> - <div class=item>f</div> - <div class=item>g</div> - <div class=item>h</div> - </div> - <div class=row> - <div class=item>i</div> - <div class=item>j</div> - </div> diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/batch_with_empty_fill.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/batch_with_empty_fill.test deleted file mode 100644 index 411b4fc749..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/batch_with_empty_fill.test +++ /dev/null @@ -1,37 +0,0 @@ ---TEST-- -"batch" filter ---TEMPLATE-- -<table> -{% for row in items|batch(3, '') %} - <tr> - {% for column in row %} - <td>{{ column }}</td> - {% endfor %} - </tr> -{% endfor %} -</table> ---DATA-- -return ['items' => ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j']] ---EXPECT-- -<table> - <tr> - <td>a</td> - <td>b</td> - <td>c</td> - </tr> - <tr> - <td>d</td> - <td>e</td> - <td>f</td> - </tr> - <tr> - <td>g</td> - <td>h</td> - <td>i</td> - </tr> - <tr> - <td>j</td> - <td></td> - <td></td> - </tr> -</table> diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/batch_with_exact_elements.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/batch_with_exact_elements.test deleted file mode 100644 index 750d1557aa..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/batch_with_exact_elements.test +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -"batch" filter ---TEMPLATE-- -{% for row in items|batch(3, 'fill') %} - <div class=row> - {% for column in row %} - <div class=item>{{ column }}</div> - {% endfor %} - </div> -{% endfor %} ---DATA-- -return ['items' => ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l']] ---EXPECT-- -<div class=row> - <div class=item>a</div> - <div class=item>b</div> - <div class=item>c</div> - </div> - <div class=row> - <div class=item>d</div> - <div class=item>e</div> - <div class=item>f</div> - </div> - <div class=row> - <div class=item>g</div> - <div class=item>h</div> - <div class=item>i</div> - </div> - <div class=row> - <div class=item>j</div> - <div class=item>k</div> - <div class=item>l</div> - </div> diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/batch_with_fill.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/batch_with_fill.test deleted file mode 100644 index 5d470d005b..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/batch_with_fill.test +++ /dev/null @@ -1,37 +0,0 @@ ---TEST-- -"batch" filter ---TEMPLATE-- -<table> -{% for row in items|batch(3, 'fill') %} - <tr> - {% for column in row %} - <td>{{ column }}</td> - {% endfor %} - </tr> -{% endfor %} -</table> ---DATA-- -return ['items' => ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j']] ---EXPECT-- -<table> - <tr> - <td>a</td> - <td>b</td> - <td>c</td> - </tr> - <tr> - <td>d</td> - <td>e</td> - <td>f</td> - </tr> - <tr> - <td>g</td> - <td>h</td> - <td>i</td> - </tr> - <tr> - <td>j</td> - <td>fill</td> - <td>fill</td> - </tr> -</table> diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/batch_with_keys.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/batch_with_keys.test deleted file mode 100644 index e56cd79bbc..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/batch_with_keys.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"batch" filter preserves array keys ---TEMPLATE-- -{{ {'foo': 'bar', 'key': 'value'}|batch(4)|first|keys|join(',') }} -{{ {'foo': 'bar', 'key': 'value'}|batch(4, 'fill')|first|keys|join(',') }} ---DATA-- -return [] ---EXPECT-- -foo,key -foo,key,0,1 diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/batch_with_more_elements.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/batch_with_more_elements.test deleted file mode 100644 index 90f4de6859..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/batch_with_more_elements.test +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -"batch" filter ---TEMPLATE-- -{% for row in items|batch(3, 'fill') %} - <div class=row> - {% for key, column in row %} - <div class={{ key }}>{{ column }}</div> - {% endfor %} - </div> -{% endfor %} ---DATA-- -return ['items' => ['a' => 'a', 'b' => 'b', 'c' => 'c', 'd' => 'd', '123' => 'e']] ---EXPECT-- -<div class=row> - <div class=a>a</div> - <div class=b>b</div> - <div class=c>c</div> - </div> - <div class=row> - <div class=d>d</div> - <div class=123>e</div> - <div class=124>fill</div> - </div> diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/batch_with_zero_elements.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/batch_with_zero_elements.test deleted file mode 100644 index bc303da8ab..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/batch_with_zero_elements.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"batch" filter with zero elements ---TEMPLATE-- -{{ []|batch(3)|length }} -{{ []|batch(3, 'fill')|length }} ---DATA-- -return [] ---EXPECT-- -0 -0 diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/convert_encoding.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/convert_encoding.test deleted file mode 100644 index db8acedef5..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/convert_encoding.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"convert_encoding" filter ---CONDITION-- -function_exists('iconv') || function_exists('mb_convert_encoding') ---TEMPLATE-- -{{ "愛していますか?"|convert_encoding('ISO-2022-JP', 'UTF-8')|convert_encoding('UTF-8', 'ISO-2022-JP') }} ---DATA-- -return [] ---EXPECT-- -愛していますか? diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date.test deleted file mode 100644 index 16816aa994..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date.test +++ /dev/null @@ -1,90 +0,0 @@ ---TEST-- -"date" filter ---TEMPLATE-- -{{ date1|date }} -{{ date1|date('d/m/Y') }} -{{ date1|date('d/m/Y H:i:s', 'Asia/Hong_Kong') }} -{{ date1|date('d/m/Y H:i:s P', 'Asia/Hong_Kong') }} -{{ date1|date('d/m/Y H:i:s P', 'America/Chicago') }} -{{ date1|date('e') }} -{{ date1|date('d/m/Y H:i:s') }} - -{{ date2|date }} -{{ date2|date('d/m/Y') }} -{{ date2|date('d/m/Y H:i:s', 'Asia/Hong_Kong') }} -{{ date2|date('d/m/Y H:i:s', timezone1) }} -{{ date2|date('d/m/Y H:i:s') }} - -{{ date3|date }} -{{ date3|date('d/m/Y') }} - -{{ date4|date }} -{{ date4|date('d/m/Y') }} - -{{ date5|date }} -{{ date5|date('d/m/Y') }} - -{{ date6|date('d/m/Y H:i:s P', 'Europe/Paris') }} -{{ date6|date('d/m/Y H:i:s P', 'Asia/Hong_Kong') }} -{{ date6|date('d/m/Y H:i:s P', false) }} -{{ date6|date('e', 'Europe/Paris') }} -{{ date6|date('e', false) }} - -{{ date7|date }} -{{ date7|date(timezone='Europe/Paris') }} -{{ date7|date(timezone='Asia/Hong_Kong') }} -{{ date7|date(timezone=false) }} -{{ date7|date(timezone='Indian/Mauritius') }} - -{{ '2010-01-28 15:00:00'|date(timezone="Europe/Paris") }} -{{ '2010-01-28 15:00:00'|date(timezone="Asia/Hong_Kong") }} ---DATA-- -date_default_timezone_set('Europe/Paris'); -return [ - 'date1' => mktime(13, 45, 0, 10, 4, 2010), - 'date2' => new \DateTime('2010-10-04 13:45'), - 'date3' => '2010-10-04 13:45', - 'date4' => 1286199900, // \DateTime::createFromFormat('Y-m-d H:i', '2010-10-04 13:45', new \DateTimeZone('UTC'))->getTimestamp() -- A unixtimestamp is always GMT - 'date5' => -189291360, // \DateTime::createFromFormat('Y-m-d H:i', '1964-01-02 03:04', new \DateTimeZone('UTC'))->getTimestamp(), - 'date6' => new \DateTime('2010-10-04 13:45', new \DateTimeZone('America/New_York')), - 'date7' => '2010-01-28T15:00:00+04:00', - 'timezone1' => new \DateTimeZone('America/New_York'), -] ---EXPECT-- -October 4, 2010 13:45 -04/10/2010 -04/10/2010 19:45:00 -04/10/2010 19:45:00 +08:00 -04/10/2010 06:45:00 -05:00 -Europe/Paris -04/10/2010 13:45:00 - -October 4, 2010 13:45 -04/10/2010 -04/10/2010 19:45:00 -04/10/2010 07:45:00 -04/10/2010 13:45:00 - -October 4, 2010 13:45 -04/10/2010 - -October 4, 2010 15:45 -04/10/2010 - -January 2, 1964 04:04 -02/01/1964 - -04/10/2010 19:45:00 +02:00 -05/10/2010 01:45:00 +08:00 -04/10/2010 13:45:00 -04:00 -Europe/Paris -America/New_York - -January 28, 2010 12:00 -January 28, 2010 12:00 -January 28, 2010 19:00 -January 28, 2010 15:00 -January 28, 2010 15:00 - -January 28, 2010 15:00 -January 28, 2010 22:00 diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date_default_format.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date_default_format.test deleted file mode 100644 index c6e81302df..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date_default_format.test +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -"date" filter ---TEMPLATE-- -{{ date1|date }} -{{ date1|date('d/m/Y') }} ---DATA-- -date_default_timezone_set('UTC'); -$twig->getExtension('\Twig\Extension\CoreExtension')->setDateFormat('Y-m-d', '%d days %h hours'); -return [ - 'date1' => mktime(13, 45, 0, 10, 4, 2010), -] ---EXPECT-- -2010-10-04 -04/10/2010 diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date_default_format_interval.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date_default_format_interval.test deleted file mode 100644 index a72fb81d62..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date_default_format_interval.test +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -"date" filter (interval support as of PHP 5.3) ---CONDITION-- -version_compare(phpversion(), '5.3.0', '>=') ---TEMPLATE-- -{{ date2|date }} -{{ date2|date('%d days') }} ---DATA-- -date_default_timezone_set('UTC'); -$twig->getExtension('\Twig\Extension\CoreExtension')->setDateFormat('Y-m-d', '%d days %h hours'); -return [ - 'date2' => new \DateInterval('P2D'), -] ---EXPECT-- -2 days 0 hours -2 days diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date_immutable.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date_immutable.test deleted file mode 100644 index 2414db5015..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date_immutable.test +++ /dev/null @@ -1,37 +0,0 @@ ---TEST-- -"date" filter ---CONDITION-- -version_compare(phpversion(), '5.5.0', '>=') ---TEMPLATE-- -{{ date1|date }} -{{ date1|date('d/m/Y') }} -{{ date1|date('d/m/Y H:i:s', 'Asia/Hong_Kong') }} -{{ date1|date('d/m/Y H:i:s', timezone1) }} -{{ date1|date('d/m/Y H:i:s') }} -{{ date1|date_modify('+1 hour')|date('d/m/Y H:i:s') }} - -{{ date2|date('d/m/Y H:i:s P', 'Europe/Paris') }} -{{ date2|date('d/m/Y H:i:s P', 'Asia/Hong_Kong') }} -{{ date2|date('d/m/Y H:i:s P', false) }} -{{ date2|date('e', 'Europe/Paris') }} -{{ date2|date('e', false) }} ---DATA-- -date_default_timezone_set('Europe/Paris'); -return [ - 'date1' => new \DateTimeImmutable('2010-10-04 13:45'), - 'date2' => new \DateTimeImmutable('2010-10-04 13:45', new \DateTimeZone('America/New_York')), - 'timezone1' => new \DateTimeZone('America/New_York'), -] ---EXPECT-- -October 4, 2010 13:45 -04/10/2010 -04/10/2010 19:45:00 -04/10/2010 07:45:00 -04/10/2010 13:45:00 -04/10/2010 14:45:00 - -04/10/2010 19:45:00 +02:00 -05/10/2010 01:45:00 +08:00 -04/10/2010 13:45:00 -04:00 -Europe/Paris -America/New_York diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date_interval.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date_interval.test deleted file mode 100644 index c3333f565b..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date_interval.test +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -"date" filter (interval support as of PHP 5.3) ---CONDITION-- -version_compare(phpversion(), '5.3.0', '>=') ---TEMPLATE-- -{{ date1|date }} -{{ date1|date('%d days %h hours') }} -{{ date1|date('%d days %h hours', timezone1) }} ---DATA-- -date_default_timezone_set('UTC'); -return [ - 'date1' => new \DateInterval('P2D'), - // This should have no effect on \DateInterval formatting - 'timezone1' => new \DateTimeZone('America/New_York'), -] ---EXPECT-- -2 days -2 days 0 hours -2 days 0 hours diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date_modify.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date_modify.test deleted file mode 100644 index d7f8fdf42a..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date_modify.test +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -"date_modify" filter ---TEMPLATE-- -{{ date1|date_modify('-1day')|date('Y-m-d H:i:s') }} -{{ date2|date_modify('-1day')|date('Y-m-d H:i:s') }} ---DATA-- -date_default_timezone_set('UTC'); -return [ - 'date1' => '2010-10-04 13:45', - 'date2' => new \DateTime('2010-10-04 13:45'), -] ---EXPECT-- -2010-10-03 13:45:00 -2010-10-03 13:45:00 diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date_namedargs.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date_namedargs.test deleted file mode 100644 index 2d1aa13449..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date_namedargs.test +++ /dev/null @@ -1,13 +0,0 @@ ---TEST-- -"date" filter ---TEMPLATE-- -{{ date|date(format='d/m/Y H:i:s P', timezone='America/Chicago') }} -{{ date|date(timezone='America/Chicago', format='d/m/Y H:i:s P') }} -{{ date|date('d/m/Y H:i:s P', timezone='America/Chicago') }} ---DATA-- -date_default_timezone_set('UTC'); -return ['date' => mktime(13, 45, 0, 10, 4, 2010)] ---EXPECT-- -04/10/2010 08:45:00 -05:00 -04/10/2010 08:45:00 -05:00 -04/10/2010 08:45:00 -05:00 diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/default.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/default.test deleted file mode 100644 index 058873aae3..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/default.test +++ /dev/null @@ -1,150 +0,0 @@ ---TEST-- -"default" filter ---TEMPLATE-- -Variable: -{{ definedVar |default('default') is same as('default') ? 'ko' : 'ok' }} -{{ zeroVar |default('default') is same as('default') ? 'ko' : 'ok' }} -{{ emptyVar |default('default') is same as('default') ? 'ok' : 'ko' }} -{{ nullVar |default('default') is same as('default') ? 'ok' : 'ko' }} -{{ undefinedVar |default('default') is same as('default') ? 'ok' : 'ko' }} -Array access: -{{ nested.definedVar |default('default') is same as('default') ? 'ko' : 'ok' }} -{{ nested['definedVar'] |default('default') is same as('default') ? 'ko' : 'ok' }} -{{ nested.zeroVar |default('default') is same as('default') ? 'ko' : 'ok' }} -{{ nested.emptyVar |default('default') is same as('default') ? 'ok' : 'ko' }} -{{ nested.nullVar |default('default') is same as('default') ? 'ok' : 'ko' }} -{{ nested.undefinedVar |default('default') is same as('default') ? 'ok' : 'ko' }} -{{ nested['undefinedVar'] |default('default') is same as('default') ? 'ok' : 'ko' }} -{{ undefinedVar.foo |default('default') is same as('default') ? 'ok' : 'ko' }} -Plain values: -{{ 'defined' |default('default') is same as('default') ? 'ko' : 'ok' }} -{{ 0 |default('default') is same as('default') ? 'ko' : 'ok' }} -{{ '' |default('default') is same as('default') ? 'ok' : 'ko' }} -{{ null |default('default') is same as('default') ? 'ok' : 'ko' }} -Precedence: -{{ 'o' ~ nullVar |default('k') }} -{{ 'o' ~ nested.nullVar |default('k') }} -Object methods: -{{ object.foo |default('default') is same as('default') ? 'ko' : 'ok' }} -{{ object.undefinedMethod |default('default') is same as('default') ? 'ok' : 'ko' }} -{{ object.getFoo() |default('default') is same as('default') ? 'ko' : 'ok' }} -{{ object.getFoo('a') |default('default') is same as('default') ? 'ko' : 'ok' }} -{{ object.undefinedMethod() |default('default') is same as('default') ? 'ok' : 'ko' }} -{{ object.undefinedMethod('a') |default('default') is same as('default') ? 'ok' : 'ko' }} -Deep nested: -{{ nested.undefinedVar.foo.bar |default('default') is same as('default') ? 'ok' : 'ko' }} -{{ nested.definedArray.0 |default('default') is same as('default') ? 'ko' : 'ok' }} -{{ nested['definedArray'][0] |default('default') is same as('default') ? 'ko' : 'ok' }} -{{ object.self.foo |default('default') is same as('default') ? 'ko' : 'ok' }} -{{ object.self.undefinedMethod |default('default') is same as('default') ? 'ok' : 'ko' }} -{{ object.undefinedMethod.self |default('default') is same as('default') ? 'ok' : 'ko' }} ---DATA-- -return [ - 'definedVar' => 'defined', - 'zeroVar' => 0, - 'emptyVar' => '', - 'nullVar' => null, - 'nested' => [ - 'definedVar' => 'defined', - 'zeroVar' => 0, - 'emptyVar' => '', - 'nullVar' => null, - 'definedArray' => [0], - ], - 'object' => new TwigTestFoo(), -] ---CONFIG-- -return ['strict_variables' => false] ---EXPECT-- -Variable: -ok -ok -ok -ok -ok -Array access: -ok -ok -ok -ok -ok -ok -ok -ok -Plain values: -ok -ok -ok -ok -Precedence: -ok -ok -Object methods: -ok -ok -ok -ok -ok -ok -Deep nested: -ok -ok -ok -ok -ok -ok ---DATA-- -return [ - 'definedVar' => 'defined', - 'zeroVar' => 0, - 'emptyVar' => '', - 'nullVar' => null, - 'nested' => [ - 'definedVar' => 'defined', - 'zeroVar' => 0, - 'emptyVar' => '', - 'nullVar' => null, - 'definedArray' => [0], - ], - 'object' => new TwigTestFoo(), -] ---CONFIG-- -return ['strict_variables' => true] ---EXPECT-- -Variable: -ok -ok -ok -ok -ok -Array access: -ok -ok -ok -ok -ok -ok -ok -ok -Plain values: -ok -ok -ok -ok -Precedence: -ok -ok -Object methods: -ok -ok -ok -ok -ok -ok -Deep nested: -ok -ok -ok -ok -ok -ok diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/dynamic_filter.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/dynamic_filter.test deleted file mode 100644 index 27dc8784c6..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/dynamic_filter.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -dynamic filter ---TEMPLATE-- -{{ 'bar'|foo_path }} -{{ 'bar'|a_foo_b_bar }} ---DATA-- -return [] ---EXPECT-- -foo/bar -a/b/bar diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/escape.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/escape.test deleted file mode 100644 index 131f5b4e72..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/escape.test +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -"escape" filter ---TEMPLATE-- -{{ "foo <br />"|e }} ---DATA-- -return [] ---EXPECT-- -foo <br /> diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/escape_html_attr.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/escape_html_attr.test deleted file mode 100644 index 10e3275542..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/escape_html_attr.test +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -"escape" filter does not escape with the html strategy when using the html_attr strategy ---TEMPLATE-- -{{ '<br />'|escape('html_attr') }} ---DATA-- -return [] ---EXPECT-- -<br /> diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/escape_javascript.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/escape_javascript.test deleted file mode 100644 index 4c2fb7a366..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/escape_javascript.test +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -"escape" filter ---TEMPLATE-- -{{ "é ♜ 𝌆"|e('js') }} ---DATA-- -return [] ---EXPECT-- -\u00E9\u0020\u265C\u0020\uD834\uDF06 diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/escape_non_supported_charset.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/escape_non_supported_charset.test deleted file mode 100644 index 93f34297b0..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/escape_non_supported_charset.test +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -"escape" filter ---TEMPLATE-- -{{ "愛していますか? <br />"|e }} ---DATA-- -return [] ---EXPECT-- -愛していますか? <br /> diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/filter.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/filter.test deleted file mode 100644 index faaa5e0848..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/filter.test +++ /dev/null @@ -1,46 +0,0 @@ ---TEST-- -"filter" filter ---TEMPLATE-- -{% set offset = 3 %} - -{% for k, v in [1, 5, 3, 4, 5]|filter((v) => v > offset) -%} - {{ k }} = {{ v }} -{% endfor %} - -{% for k, v in {a: 1, b: 2, c: 5, d: 8}|filter(v => v > offset) -%} - {{ k }} = {{ v }} -{% endfor %} - -{% for k, v in [1, 5, 3, 4, 5]|filter(v => v > offset) -%} - {{ k }} = {{ v }} -{% endfor %} - -{% for k, v in it|filter((v) => v > offset) -%} - {{ k }} = {{ v }} -{% endfor %} - -{% for k, v in ita|filter(v => v > offset) -%} - {{ k }} = {{ v }} -{% endfor %} ---DATA-- -return [ - 'it' => new \ArrayIterator(['a' => 1, 'b' => 2, 'c' => 5, 'd' => 8]), - 'ita' => new IteratorAggregateStub(['a' => 1, 'b' => 2, 'c' => 5, 'd' => 8]), -] ---EXPECT-- -1 = 5 -3 = 4 -4 = 5 - -c = 5 -d = 8 - -1 = 5 -3 = 4 -4 = 5 - -c = 5 -d = 8 - -c = 5 -d = 8 diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/filter_php_55.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/filter_php_55.test deleted file mode 100644 index 6684139a1a..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/filter_php_55.test +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -"filter" filter (PHP 5.5 required) ---CONDITION-- -version_compare(phpversion(), '5.5.0', '>=') ---TEMPLATE-- -{% for k, v in xml|filter(x => true) %} -{{ k }}/{{ v }} -{% endfor %} - -{# we can iterate more than once #} -{% for k, v in xml|filter(x => true) %} -{{ k }}/{{ v }} -{% endfor %} ---DATA-- -return ['xml' => new \SimpleXMLElement('<?xml version="1.0" encoding="UTF-8"?><doc><elem>foo</elem><elem>bar</elem><elem>baz</elem></doc>')] ---EXPECT-- -elem/foo -elem/bar -elem/baz - -elem/foo -elem/bar -elem/baz diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/filter_php_56.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/filter_php_56.test deleted file mode 100644 index 0daf4083ad..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/filter_php_56.test +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -"filter" filter (PHP 5.6 required) ---CONDITION-- -version_compare(phpversion(), '5.6.0', '>=') ---TEMPLATE-- -{% set offset = 3 %} - -{% for k, v in {a: 1, b: 2, c: 5, d: 8}|filter((v, k) => (v > offset) and (k != "d")) -%} - {{ k }} = {{ v }} -{% endfor %} - -{% for k, v in it|filter((v, k) => (v > offset) and (k != "d")) -%} - {{ k }} = {{ v }} -{% endfor %} - -{# we can iterate more than once #} -{% for k, v in it|filter((v, k) => (v > offset) and (k != "d")) -%} - {{ k }} = {{ v }} -{% endfor %} ---DATA-- -return ['it' => new \ArrayIterator(['a' => 1, 'b' => 2, 'c' => 5, 'd' => 8])] ---EXPECT-- -c = 5 - -c = 5 - -c = 5 diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/first.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/first.test deleted file mode 100644 index b19f2eed7b..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/first.test +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -"first" filter ---TEMPLATE-- -{{ [1, 2, 3, 4]|first }} -{{ {a: 1, b: 2, c: 3, d: 4}|first }} -{{ '1234'|first }} -{{ arr|first }} -{{ 'Ä€é'|first }} -{{ ''|first }} ---DATA-- -return ['arr' => new \ArrayObject([1, 2, 3, 4])] ---EXPECT-- -1 -1 -1 -1 -Ä diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/force_escape.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/force_escape.test deleted file mode 100644 index 7efbe3200a..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/force_escape.test +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -"escape" filter ---TEMPLATE-- -{% set foo %} - foo<br /> -{% endset %} - -{{ foo|e('html') -}} -{{ foo|e('js') }} -{% autoescape true %} - {{ foo }} -{% endautoescape %} ---DATA-- -return [] ---EXPECT-- - foo<br /> -\u0020\u0020\u0020\u0020foo\u003Cbr\u0020\/\u003E\n - foo<br /> diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/format.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/format.test deleted file mode 100644 index efaf8317a3..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/format.test +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -"format" filter ---TEMPLATE-- -{{ string|format(foo, 3) }} ---DATA-- -return ['string' => '%s/%d', 'foo' => 'bar'] ---EXPECT-- -bar/3 diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/join.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/join.test deleted file mode 100644 index 5792586304..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/join.test +++ /dev/null @@ -1,38 +0,0 @@ ---TEST-- -"join" filter ---TEMPLATE-- -{{ ["foo", "bar"]|join(', ') }} -{{ foo|join(', ') }} -{{ bar|join(', ') }} - -{{ ["foo", "bar"]|join(', ', ' and ') }} -{{ foo|join(', ', ' and ') }} -{{ bar|join(', ', ' and ') }} -{{ ["one", "two", "three"]|join(', ', ' and ') }} -{{ ["a", "b", "c"]|join('','-') }} -{{ ["a", "b", "c"]|join('-','-') }} -{{ ["a", "b", "c"]|join('-','') }} -{{ ["hello"]|join('|','-') }} - -{{ {"a": "w", "b": "x", "c": "y", "d": "z"}|join }} -{{ {"a": "w", "b": "x", "c": "y", "d": "z"}|join(',') }} -{{ {"a": "w", "b": "x", "c": "y", "d": "z"}|join(',','-') }} ---DATA-- -return ['foo' => new TwigTestFoo(), 'bar' => new \ArrayObject([3, 4])] ---EXPECT-- -foo, bar -1, 2 -3, 4 - -foo and bar -1 and 2 -3 and 4 -one, two and three -ab-c -a-b-c -a-bc -hello - -wxyz -w,x,y,z -w,x,y-z diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/json_encode.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/json_encode.test deleted file mode 100644 index 902f90b337..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/json_encode.test +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -"json_encode" filter ---TEMPLATE-- -{{ "foo"|json_encode|raw }} -{{ foo|json_encode|raw }} -{{ [foo, "foo"]|json_encode|raw }} ---DATA-- -return ['foo' => new \Twig\Markup('foo', 'UTF-8')] ---EXPECT-- -"foo" -"foo" -["foo","foo"] diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/last.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/last.test deleted file mode 100644 index f71896c77f..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/last.test +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -"last" filter ---TEMPLATE-- -{{ [1, 2, 3, 4]|last }} -{{ {a: 1, b: 2, c: 3, d: 4}|last }} -{{ '1234'|last }} -{{ arr|last }} -{{ 'Ä€é'|last }} -{{ ''|last }} ---DATA-- -return ['arr' => new \ArrayObject([1, 2, 3, 4])] ---EXPECT-- -4 -4 -4 -4 -é diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/length.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/length.test deleted file mode 100644 index 52ad9e8b24..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/length.test +++ /dev/null @@ -1,40 +0,0 @@ ---TEST-- -"length" filter ---TEMPLATE-- -{{ array|length }} -{{ string|length }} -{{ number|length }} -{{ to_string_able|length }} -{{ countable|length }} -{{ iterator_aggregate|length }} -{{ null|length }} -{{ magic|length }} -{{ non_countable|length }} -{{ simple_xml_element|length }} -{{ iterator|length }} ---DATA-- -return [ - 'array' => [1, 4], - 'string' => 'foo', - 'number' => 1000, - 'to_string_able' => new ToStringStub('foobar'), - 'countable' => new CountableStub(42), /* also asserts we do *not* call __toString() */ - 'iterator_aggregate' => new IteratorAggregateStub(['a', 'b', 'c']), /* also asserts we do *not* call __toString() */ - 'null' => null, - 'magic' => new MagicCallStub(), /* used to assert we do *not* call __call */ - 'non_countable' => new \StdClass(), - 'simple_xml_element' => new \SimpleXMLElement('<?xml version="1.0" encoding="UTF-8"?><doc><elem/><elem/></doc>'), - 'iterator' => new \SimpleIteratorForTesting() -] ---EXPECT-- -2 -3 -4 -6 -42 -3 -0 -1 -1 -2 -7 diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/length_utf8.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/length_utf8.test deleted file mode 100644 index b1e9681a5d..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/length_utf8.test +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -"length" filter ---CONDITION-- -function_exists('mb_get_info') ---TEMPLATE-- -{{ string|length }} -{{ markup|length }} ---DATA-- -return ['string' => 'été', 'markup' => new \Twig\Markup('foo', 'UTF-8')] ---EXPECT-- -3 -3 diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/map.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/map.test deleted file mode 100644 index 5552f81668..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/map.test +++ /dev/null @@ -1,41 +0,0 @@ ---TEST-- -"map" filter ---TEMPLATE-- -{% set offset = 3 %} - -{% for k, v in [1, 2]|map((item) => item + 2 ) -%} - {{ k }} = {{ v }} -{% endfor %} - -{% for k, v in {a: 1, b: 2}|map((item) => item ~ "*" ) -%} - {{ k }} = {{ v }} -{% endfor %} - -{% for k, v in {a: 1, b: 2}|map((item, k) => item ~ "*" ~ k ) -%} - {{ k }} = {{ v }} -{% endfor %} - -{% for k, v in [1, 2]|map(item => item + 2 ) -%} - {{ k }} = {{ v }} -{% endfor %} - -{% for k, v in it|map(item => item + 2 ) -%} - {{ k }} = {{ v }} -{% endfor %} ---DATA-- -return ['it' => new \ArrayIterator([1, 2])] ---EXPECT-- -0 = 3 -1 = 4 - -a = 1* -b = 2* - -a = 1*a -b = 2*b - -0 = 3 -1 = 4 - -0 = 3 -1 = 4 diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/merge.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/merge.test deleted file mode 100644 index 8877501d4c..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/merge.test +++ /dev/null @@ -1,25 +0,0 @@ ---TEST-- -"merge" filter ---TEMPLATE-- -{{ items|merge({'bar': 'foo'})|join }} -{{ items|merge({'bar': 'foo'})|keys|join }} -{{ {'bar': 'foo'}|merge(items)|join }} -{{ {'bar': 'foo'}|merge(items)|keys|join }} -{{ numerics|merge([4, 5, 6])|join }} -{{ traversable.a|merge(traversable.b)|join }} ---DATA-- -return [ - 'items' => ['foo' => 'bar'], - 'numerics' => [1, 2, 3], - 'traversable' => [ - 'a' => new \ArrayObject([0 => 1, 1 => 2, 2 => 3]), - 'b' => new \ArrayObject(['a' => 'b']) - ] -] ---EXPECT-- -barfoo -foobar -foobar -barfoo -123456 -123b diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/nl2br.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/nl2br.test deleted file mode 100644 index 524ec45f96..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/nl2br.test +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -"nl2br" filter ---TEMPLATE-- -{{ "I like Twig.\nYou will like it too.\n\nEverybody like it!"|nl2br }} -{{ text|nl2br }} ---DATA-- -return ['text' => "If you have some <strong>HTML</strong>\nit will be escaped."] ---EXPECT-- -I like Twig.<br /> -You will like it too.<br /> -<br /> -Everybody like it! -If you have some <strong>HTML</strong><br /> -it will be escaped. diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/number_format.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/number_format.test deleted file mode 100644 index 7f1e2e16a2..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/number_format.test +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -"number_format" filter ---TEMPLATE-- -{{ 20|number_format }} -{{ 20.25|number_format }} -{{ 20.25|number_format(2) }} -{{ 20.25|number_format(2, ',') }} -{{ 1020.25|number_format(2, ',') }} -{{ 1020.25|number_format(2, ',', '.') }} ---DATA-- -return [] ---EXPECT-- -20 -20 -20.25 -20,25 -1,020,25 -1.020,25 diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/number_format_default.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/number_format_default.test deleted file mode 100644 index beedd901a0..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/number_format_default.test +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -"number_format" filter with defaults. ---TEMPLATE-- -{{ 20|number_format }} -{{ 20.25|number_format }} -{{ 20.25|number_format(1) }} -{{ 20.25|number_format(2, ',') }} -{{ 1020.25|number_format }} -{{ 1020.25|number_format(2, ',') }} -{{ 1020.25|number_format(2, ',', '.') }} ---DATA-- -$twig->getExtension('\Twig\Extension\CoreExtension')->setNumberFormat(2, '!', '='); -return [] ---EXPECT-- -20!00 -20!25 -20!3 -20,25 -1=020!25 -1=020,25 -1.020,25 diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/reduce.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/reduce.test deleted file mode 100644 index 73cad41686..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/reduce.test +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -"reduce" filter ---TEMPLATE-- -{% set offset = 3 %} - -{{ [1, -1, 4]|reduce((carry, item) => carry + item + offset, 10) }} - -{{ it|reduce((carry, item) => carry + item + offset, 10) }} ---DATA-- -return ['it' => new \ArrayIterator([1, -1, 4])] ---EXPECT-- -23 - -23 diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/replace.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/replace.test deleted file mode 100644 index 1b9670a17b..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/replace.test +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -"replace" filter ---TEMPLATE-- -{{ "I liké %this% and %that%."|replace({'%this%': "foo", '%that%': "bar"}) }} -{{ 'I like single replace operation only %that%'|replace({'%that%' : '%that%1'}) }} -{{ 'I like %this% and %that%.'|replace(traversable) }} ---DATA-- -return ['traversable' => new \ArrayObject(['%this%' => 'foo', '%that%' => 'bar'])] ---EXPECT-- -I liké foo and bar. -I like single replace operation only %that%1 -I like foo and bar. diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/replace_invalid_arg.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/replace_invalid_arg.test deleted file mode 100644 index ba6fea4125..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/replace_invalid_arg.test +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -Exception for invalid argument type in replace call ---TEMPLATE-- -{{ 'test %foo%'|replace(stdClass) }} ---DATA-- -return ['stdClass' => new \stdClass()] ---EXCEPTION-- -Twig\Error\RuntimeError: The "replace" filter expects an array or "Traversable" as replace values, got "stdClass" in "index.twig" at line 2. diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/reverse.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/reverse.test deleted file mode 100644 index 904e5839b0..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/reverse.test +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -"reverse" filter ---TEMPLATE-- -{{ [1, 2, 3, 4]|reverse|join('') }} -{{ '1234évènement'|reverse }} -{{ arr|reverse|join('') }} -{{ {'a': 'c', 'b': 'a'}|reverse()|join(',') }} -{{ {'a': 'c', 'b': 'a'}|reverse(preserveKeys=true)|join(glue=',') }} -{{ {'a': 'c', 'b': 'a'}|reverse(preserve_keys=true)|join(glue=',') }} ---DATA-- -return ['arr' => new \ArrayObject([1, 2, 3, 4])] ---EXPECT-- -4321 -tnemenèvé4321 -4321 -a,c -a,c -a,c diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/round.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/round.test deleted file mode 100644 index 709237543a..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/round.test +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -"round" filter ---TEMPLATE-- -{{ 2.7|round }} -{{ 2.1|round }} -{{ 2.1234|round(3, 'floor') }} -{{ 2.1|round(0, 'ceil') }} - -{{ 21.3|round(-1)}} -{{ 21.3|round(-1, 'ceil')}} -{{ 21.3|round(-1, 'floor')}} ---DATA-- -return [] ---EXPECT-- -3 -2 -2.123 -3 - -20 -30 -20 diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/slice.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/slice.test deleted file mode 100644 index fc975d7bb1..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/slice.test +++ /dev/null @@ -1,54 +0,0 @@ ---TEST-- -"slice" filter ---TEMPLATE-- -{{ [1, 2, 3, 4][1:2]|join('') }} -{{ {a: 1, b: 2, c: 3, d: 4}[1:2]|join('') }} -{{ [1, 2, 3, 4][start:length]|join('') }} -{{ [1, 2, 3, 4]|slice(1, 2)|join('') }} -{{ [1, 2, 3, 4]|slice(1, 2)|keys|join('') }} -{{ [1, 2, 3, 4]|slice(1, 2, true)|keys|join('') }} -{{ {a: 1, b: 2, c: 3, d: 4}|slice(1, 2)|join('') }} -{{ {a: 1, b: 2, c: 3, d: 4}|slice(1, 2)|keys|join('') }} -{{ '1234'|slice(1, 2) }} -{{ '1234'[1:2] }} -{{ arr|slice(1, 2)|join('') }} -{{ arr[1:2]|join('') }} -{{ arr[4:1]|join('') }} -{{ arr[3:2]|join('') }} - -{{ [1, 2, 3, 4]|slice(1)|join('') }} -{{ [1, 2, 3, 4][1:]|join('') }} -{{ '1234'|slice(1) }} -{{ '1234'[1:] }} -{{ '1234'[:1] }} - -{{ arr|slice(3)|join('') }} -{{ arr[2:]|join('') }} -{{ xml|slice(1)|join('')}} ---DATA-- -return ['start' => 1, 'length' => 2, 'arr' => new \ArrayObject([1, 2, 3, 4]), 'xml' => new \SimpleXMLElement('<items><item>1</item><item>2</item></items>')] ---EXPECT-- -23 -23 -23 -23 -01 -12 -23 -bc -23 -23 -23 -23 - -4 - -234 -234 -234 -234 -1 - -4 -34 -2 diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/sort.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/sort.test deleted file mode 100644 index c3b2c70dd4..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/sort.test +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -"sort" filter ---TEMPLATE-- -{{ array1|sort|join }} -{{ array2|sort|join }} -{{ traversable|sort|join }} ---DATA-- -return ['array1' => [4, 1], 'array2' => ['foo', 'bar'], 'traversable' => new \ArrayObject([0 => 3, 1 => 2, 2 => 1])] ---EXPECT-- -14 -barfoo -123 diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/spaceless.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/spaceless.test deleted file mode 100644 index eadc1d4962..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/spaceless.test +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -"spaceless" filter ---TEMPLATE-- -{{ " <div> <div> foo </div> </div>"|spaceless }} ---DATA-- -return [] ---EXPECT-- -<div><div> foo </div></div> diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/special_chars.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/special_chars.test deleted file mode 100644 index 9869ec91c3..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/special_chars.test +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -"§" custom filter ---TEMPLATE-- -{{ 'foo'|§ }} ---DATA-- -return [] ---EXPECT-- -§foo§ diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/split.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/split.test deleted file mode 100644 index 92dbf0a05c..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/split.test +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -"split" filter ---TEMPLATE-- -{{ "one,two,three,four,five"|split(',')|join('-') }} -{{ foo|split(',')|join('-') }} -{{ foo|split(',', 3)|join('-') }} -{{ baz|split('')|join('-') }} -{{ baz|split('', 1)|join('-') }} -{{ baz|split('', 2)|join('-') }} -{{ foo|split(',', -2)|join('-') }} ---DATA-- -return ['foo' => "one,two,three,four,five", 'baz' => '12345',] ---EXPECT-- -one-two-three-four-five -one-two-three-four-five -one-two-three,four,five -1-2-3-4-5 -1-2-3-4-5 -12-34-5 -one-two-three \ No newline at end of file diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/split_utf8.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/split_utf8.test deleted file mode 100644 index bf52e6df76..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/split_utf8.test +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -"split" filter ---CONDITION-- -function_exists('mb_get_info') ---TEMPLATE-- -{{ "é"|split('', 10)|join('-') }} -{{ foo|split(',')|join('-') }} -{{ foo|split(',', 1)|join('-') }} -{{ foo|split(',', 2)|join('-') }} -{{ foo|split(',', 3)|join('-') }} -{{ baz|split('')|join('-') }} -{{ baz|split('', 1)|join('-') }} -{{ baz|split('', 2)|join('-') }} ---DATA-- -return ['foo' => 'Ä,é,Äほ', 'baz' => 'éÄßごa',] ---EXPECT-- -é -Ä-é-Äほ -Ä,é,Äほ -Ä-é,Äほ -Ä-é-Äほ -é-Ä-ß-ご-a -é-Ä-ß-ご-a -éÄ-ßご-a \ No newline at end of file diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/static_calls.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/static_calls.test deleted file mode 100644 index 1626db0c97..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/static_calls.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -Filters as static method calls ---TEMPLATE-- -{{ 'foo'|static_call_string }} -{{ 'foo'|static_call_array }} ---DATA-- -return ['foo' => 'foo'] ---EXPECT-- -*foo* -*foo* diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/trim.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/trim.test deleted file mode 100644 index 432989ff16..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/trim.test +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -"trim" filter ---TEMPLATE-- -{{ " I like Twig. "|trim }} -{{ text|trim }} -{{ " foo/"|trim("/") }} -{{ "xxxI like Twig.xxx"|trim(character_mask="x", side="left") }} -{{ "xxxI like Twig.xxx"|trim(side="right", character_mask="x") }} -{{ "xxxI like Twig.xxx"|trim("x", "right") }} -{{ "/ foo/"|trim("/", "left") }} -{{ "/ foo/"|trim(character_mask="/", side="left") }} -{{ " do nothing. "|trim("", "right") }} ---DATA-- -return ['text' => " If you have some <strong>HTML</strong> it will be escaped. "] ---EXPECT-- -I like Twig. -If you have some <strong>HTML</strong> it will be escaped. - foo -I like Twig.xxx -xxxI like Twig. -xxxI like Twig. - foo/ - foo/ - do nothing. diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/urlencode.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/urlencode.test deleted file mode 100644 index 66a682dd39..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/urlencode.test +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -"url_encode" filter ---CONDITION-- -defined('PHP_QUERY_RFC3986') ---TEMPLATE-- -{{ {foo: "bar", number: 3, "spéßi%l": "e%c0d@d", "spa ce": ""}|url_encode }} -{{ {foo: "bar", number: 3, "spéßi%l": "e%c0d@d", "spa ce": ""}|url_encode|raw }} -{{ {}|url_encode|default("default") }} -{{ 'spéßi%le%c0d@dspa ce'|url_encode }} ---DATA-- -return [] ---EXPECT-- -foo=bar&number=3&sp%C3%A9%C3%9Fi%25l=e%25c0d%40d&spa%20ce= -foo=bar&number=3&sp%C3%A9%C3%9Fi%25l=e%25c0d%40d&spa%20ce= -default -sp%C3%A9%C3%9Fi%25le%25c0d%40dspa%20ce diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/urlencode_deprecated.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/urlencode_deprecated.test deleted file mode 100644 index 38d726492a..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/urlencode_deprecated.test +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -"url_encode" filter for PHP < 5.4 ---CONDITION-- -defined('PHP_QUERY_RFC3986') ---TEMPLATE-- -{{ {foo: "bar", number: 3, "spéßi%l": "e%c0d@d", "spa ce": ""}|url_encode }} -{{ {foo: "bar", number: 3, "spéßi%l": "e%c0d@d", "spa ce": ""}|url_encode|raw }} -{{ {}|url_encode|default("default") }} -{{ 'spéßi%le%c0d@dspa ce'|url_encode }} ---DATA-- -return [] ---EXPECT-- -foo=bar&number=3&sp%C3%A9%C3%9Fi%25l=e%25c0d%40d&spa%20ce= -foo=bar&number=3&sp%C3%A9%C3%9Fi%25l=e%25c0d%40d&spa%20ce= -default -sp%C3%A9%C3%9Fi%25le%25c0d%40dspa%20ce diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/attribute.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/attribute.test deleted file mode 100644 index 2972bd45ed..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/attribute.test +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -"attribute" function ---TEMPLATE-- -{{ attribute(obj, method) }} -{{ attribute(array, item) }} -{{ attribute(obj, "bar", ["a", "b"]) }} -{{ attribute(obj, "bar", arguments) }} -{{ attribute(obj, method) is defined ? 'ok' : 'ko' }} -{{ attribute(obj, nonmethod) is defined ? 'ok' : 'ko' }} ---DATA-- -return ['obj' => new TwigTestFoo(), 'method' => 'foo', 'array' => ['foo' => 'bar'], 'item' => 'foo', 'nonmethod' => 'xxx', 'arguments' => ['a', 'b']] ---EXPECT-- -foo -bar -bar_a-b -bar_a-b -ok -ko diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/block.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/block.test deleted file mode 100644 index 1a4fd5492f..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/block.test +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -"block" function ---TEMPLATE-- -{% extends 'base.twig' %} -{% block bar %}BAR{% endblock %} ---TEMPLATE(base.twig)-- -{% block foo %}{{ block('bar') }}{% endblock %} -{% block bar %}BAR_BASE{% endblock %} ---DATA-- -return [] ---EXPECT-- -BARBAR diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/block_with_template.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/block_with_template.test deleted file mode 100644 index 37cb7a4813..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/block_with_template.test +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -"block" function with a template argument ---TEMPLATE-- -{{ block('foo', 'included.twig') }} -{{ block('foo', included_loaded) }} -{{ block('foo', included_loaded_internal) }} -{% set output = block('foo', 'included.twig') %} -{{ output }} -{% block foo %}NOT FOO{% endblock %} ---TEMPLATE(included.twig)-- -{% block foo %}FOO{% endblock %} ---DATA-- -return [ - 'included_loaded' => $twig->load('included.twig'), - 'included_loaded_internal' => $twig->load('included.twig'), -] ---EXPECT-- -FOO -FOO -FOO -FOO -NOT FOO diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/block_without_name.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/block_without_name.test deleted file mode 100644 index 236df94510..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/block_without_name.test +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -"block" function without arguments ---TEMPLATE-- -{% extends 'base.twig' %} -{% block bar %}BAR{% endblock %} ---TEMPLATE(base.twig)-- -{% block foo %}{{ block() }}{% endblock %} -{% block bar %}BAR_BASE{% endblock %} ---DATA-- -return [] ---EXCEPTION-- -Twig\Error\SyntaxError: The "block" function takes one argument (the block name) in "base.twig" at line 2. diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/constant.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/constant.test deleted file mode 100644 index fd6dd06111..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/constant.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"constant" function ---TEMPLATE-- -{{ constant('DATE_W3C') == expect ? 'true' : 'false' }} -{{ constant('ARRAY_AS_PROPS', object) }} ---DATA-- -return ['expect' => DATE_W3C, 'object' => new \ArrayObject(['hi'])] ---EXPECT-- -true -2 diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/cycle.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/cycle.test deleted file mode 100644 index 0ac6dccd3a..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/cycle.test +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -"cycle" function ---TEMPLATE-- -{% for i in 0..6 %} -{{ cycle(array1, i) }}-{{ cycle(array2, i) }} -{% endfor %} ---DATA-- -return ['array1' => ['odd', 'even'], 'array2' => ['apple', 'orange', 'citrus']] ---EXPECT-- -odd-apple -even-orange -odd-citrus -even-apple -odd-orange -even-citrus -odd-apple diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/date.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/date.test deleted file mode 100644 index c879da3cfd..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/date.test +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -"date" function ---TEMPLATE-- -{{ date().format('r') == date('now').format('r') ? 'OK' : 'KO' }} -{{ date(date1) == date('2010-10-04 13:45') ? 'OK' : 'KO' }} -{{ date(date2) == date('2010-10-04 13:45') ? 'OK' : 'KO' }} -{{ date(date3) == date('2010-10-04 13:45') ? 'OK' : 'KO' }} -{{ date(date4) == date('2010-10-04 13:45') ? 'OK' : 'KO' }} -{{ date(date5) == date('1964-01-02 03:04') ? 'OK' : 'KO' }} -{{ date() > date('-1day') ? 'OK' : 'KO' }} ---DATA-- -date_default_timezone_set('UTC'); -return [ - 'date1' => mktime(13, 45, 0, 10, 4, 2010), - 'date2' => new \DateTime('2010-10-04 13:45'), - 'date3' => '2010-10-04 13:45', - 'date4' => 1286199900, // \DateTime::createFromFormat('Y-m-d H:i', '2010-10-04 13:45', new \DateTimeZone('UTC'))->getTimestamp() -- A unixtimestamp is always GMT - 'date5' => -189291360, // \DateTime::createFromFormat('Y-m-d H:i', '1964-01-02 03:04', new \DateTimeZone('UTC'))->getTimestamp(), -] ---EXPECT-- -OK -OK -OK -OK -OK -OK -OK diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/date_namedargs.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/date_namedargs.test deleted file mode 100644 index 11f60ee8bf..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/date_namedargs.test +++ /dev/null @@ -1,11 +0,0 @@ ---TEST-- -"date" function ---TEMPLATE-- -{{ date(date, "America/New_York")|date('d/m/Y H:i:s P', false) }} -{{ date(timezone="America/New_York", date=date)|date('d/m/Y H:i:s P', false) }} ---DATA-- -date_default_timezone_set('UTC'); -return ['date' => mktime(13, 45, 0, 10, 4, 2010)] ---EXPECT-- -04/10/2010 09:45:00 -04:00 -04/10/2010 09:45:00 -04:00 diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/dump.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/dump.test deleted file mode 100644 index 691a3abea9..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/dump.test +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -"dump" function ---CONDITION-- -!extension_loaded('xdebug') ---TEMPLATE-- -{{ dump('foo') }} -{{ dump('foo', 'bar') }} ---DATA-- -return ['foo' => 'foo', 'bar' => 'bar'] ---CONFIG-- -return ['debug' => true, 'autoescape' => false] ---EXPECT-- -string(3) "foo" - -string(3) "foo" -string(3) "bar" diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/dump_array.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/dump_array.test deleted file mode 100644 index 5fd9383cd6..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/dump_array.test +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -"dump" function, xdebug is not loaded or xdebug <2.2-dev is loaded ---CONDITION-- -!extension_loaded('xdebug') || (($r = new \ReflectionExtension('xdebug')) && version_compare($r->getVersion(), '2.2-dev', '<')) ---TEMPLATE-- -{{ dump() }} ---DATA-- -return ['foo' => 'foo', 'bar' => 'bar'] ---CONFIG-- -return ['debug' => true, 'autoescape' => false] ---EXPECT-- -array(3) { - ["foo"]=> - string(3) "foo" - ["bar"]=> - string(3) "bar" - ["global"]=> - string(6) "global" -} diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/dynamic_function.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/dynamic_function.test deleted file mode 100644 index c7b3539c40..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/dynamic_function.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -dynamic function ---TEMPLATE-- -{{ foo_path('bar') }} -{{ a_foo_b_bar('bar') }} ---DATA-- -return [] ---EXPECT-- -foo/bar -a/b/bar diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/assignment.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/assignment.test deleted file mode 100644 index c9ce8123fe..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/assignment.test +++ /dev/null @@ -1,13 +0,0 @@ ---TEST-- -"include" function ---TEMPLATE-- -{% set tmp = include("foo.twig") %} - -FOO{{ tmp }}BAR ---TEMPLATE(foo.twig)-- -FOOBAR ---DATA-- -return [] ---EXPECT-- -FOO -FOOBARBAR diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/autoescaping.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/autoescaping.test deleted file mode 100644 index a3666261f3..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/autoescaping.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"include" function is safe for auto-escaping ---TEMPLATE-- -{{ include("foo.twig") }} ---TEMPLATE(foo.twig)-- -<p>Test</p> ---DATA-- -return [] ---EXPECT-- -<p>Test</p> diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/basic.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/basic.test deleted file mode 100644 index f90983c02f..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/basic.test +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -"include" function ---TEMPLATE-- -FOO -{{ include("foo.twig") }} - -BAR ---TEMPLATE(foo.twig)-- -FOOBAR ---DATA-- -return [] ---EXPECT-- -FOO - -FOOBAR - -BAR diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/expression.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/expression.test deleted file mode 100644 index c6d3d1c533..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/expression.test +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -"include" function allows expressions for the template to include ---TEMPLATE-- -FOO -{{ include(foo) }} - -BAR ---TEMPLATE(foo.twig)-- -FOOBAR ---DATA-- -return ['foo' => 'foo.twig'] ---EXPECT-- -FOO - -FOOBAR - -BAR diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/ignore_missing.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/ignore_missing.test deleted file mode 100644 index c05b43e140..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/ignore_missing.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"include" function ---TEMPLATE-- -{{ include(["foo.twig", "bar.twig"], ignore_missing = true) }} -{{ include("foo.twig", ignore_missing = true) }} -{{ include("foo.twig", ignore_missing = true, variables = {}) }} -{{ include("foo.twig", ignore_missing = true, variables = {}, with_context = true) }} ---DATA-- -return [] ---EXPECT-- diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/ignore_missing_exists.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/ignore_missing_exists.test deleted file mode 100644 index fc2d211ad8..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/ignore_missing_exists.test +++ /dev/null @@ -1,11 +0,0 @@ ---TEST-- -"include" function ---TEMPLATE-- -{{ include("included.twig", ignore_missing = true) }} -NOT DISPLAYED ---TEMPLATE(included.twig)-- -{{ include("DOES NOT EXIST") }} ---DATA-- -return [] ---EXCEPTION-- -Twig\Error\LoaderError: Template "DOES NOT EXIST" is not defined in "included.twig" at line 2. diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/include_missing_extends.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/include_missing_extends.test deleted file mode 100644 index 810ae82480..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/include_missing_extends.test +++ /dev/null @@ -1,13 +0,0 @@ ---TEST-- -"include" function ---TEMPLATE-- -{{ include(['bad.twig', 'good.twig'], ignore_missing = true) }} -NOT DISPLAYED ---TEMPLATE(bad.twig)-- -{% extends 'DOES NOT EXIST' %} ---TEMPLATE(good.twig)-- -NOT DISPLAYED ---DATA-- -return [] ---EXCEPTION-- -Twig\Error\LoaderError: Template "DOES NOT EXIST" is not defined in "bad.twig" at line 2. diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/missing.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/missing.test deleted file mode 100644 index 1d50f7ac2f..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/missing.test +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -"include" function ---TEMPLATE-- -{{ include("foo.twig") }} ---DATA-- -return [] ---EXCEPTION-- -Twig\Error\LoaderError: Template "foo.twig" is not defined in "index.twig" at line 2. diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/missing_nested.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/missing_nested.test deleted file mode 100644 index 9ae8c9ee75..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/missing_nested.test +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -"include" function ---TEMPLATE-- -{% extends "base.twig" %} - -{% block content %} - {{ parent() }} -{% endblock %} ---TEMPLATE(base.twig)-- -{% block content %} - {{ include("foo.twig") }} -{% endblock %} ---DATA-- -return [] ---EXCEPTION-- -Twig\Error\LoaderError: Template "foo.twig" is not defined in "base.twig" at line 3. diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/sandbox.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/sandbox.test deleted file mode 100644 index ebfdb1eb8f..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/sandbox.test +++ /dev/null @@ -1,13 +0,0 @@ ---TEST-- -"include" tag sandboxed ---TEMPLATE-- -{{ include("foo.twig", sandboxed = true) }} ---TEMPLATE(foo.twig)-- - - -{{ foo|e }} -{{ foo|e }} ---DATA-- -return [] ---EXCEPTION-- -Twig\Sandbox\SecurityNotAllowedFilterError: Filter "e" is not allowed in "foo.twig" at line 4. diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/sandbox_disabling.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/sandbox_disabling.test deleted file mode 100644 index 1206b67fe3..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/sandbox_disabling.test +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -"include" tag sandboxed ---TEMPLATE-- -{{ include("foo.twig", sandboxed = true) }} -{{ include("bar.twig") }} ---TEMPLATE(foo.twig)-- -foo ---TEMPLATE(bar.twig)-- -{{ foo|e }} ---DATA-- -return ['foo' => 'bar<br />'] ---EXPECT-- -foo - - -bar<br /> diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/sandbox_disabling_ignore_missing.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/sandbox_disabling_ignore_missing.test deleted file mode 100644 index c5be0088af..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/sandbox_disabling_ignore_missing.test +++ /dev/null @@ -1,13 +0,0 @@ ---TEST-- -"include" tag sandboxed ---TEMPLATE-- -{{ include("unknown.twig", sandboxed = true, ignore_missing = true) }} -{{ include("bar.twig") }} ---TEMPLATE(bar.twig)-- -{{ foo|e }} ---DATA-- -return ['foo' => 'bar<br />'] ---EXPECT-- - - -bar<br /> diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/template_instance.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/template_instance.test deleted file mode 100644 index 4c8b450835..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/template_instance.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"include" function accepts Twig_Template instance ---TEMPLATE-- -{{ include(foo) }} FOO ---TEMPLATE(foo.twig)-- -BAR ---DATA-- -return ['foo' => $twig->load('foo.twig')] ---EXPECT-- -BAR FOO diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/templates_as_array.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/templates_as_array.test deleted file mode 100644 index 21e5bb2efd..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/templates_as_array.test +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -"include" function ---TEMPLATE-- -{{ include(["foo.twig", "bar.twig"]) }} -{{- include(["bar.twig", "foo.twig"]) }} ---TEMPLATE(foo.twig)-- -foo ---DATA-- -return [] ---EXPECT-- -foo -foo diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/with_context.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/with_context.test deleted file mode 100644 index 46ac8c79bd..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/with_context.test +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -"include" function accept variables and with_context ---TEMPLATE-- -{{ include("foo.twig") }} -{{- include("foo.twig", with_context = false) }} -{{- include("foo.twig", {'foo1': 'bar'}) }} -{{- include("foo.twig", {'foo1': 'bar'}, with_context = false) }} ---TEMPLATE(foo.twig)-- -{% for k, v in _context %}{{ k }},{% endfor %} ---DATA-- -return ['foo' => 'bar'] ---EXPECT-- -foo,global,_parent, -global,_parent, -foo,global,foo1,_parent, -foo1,global,_parent, diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/with_variables.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/with_variables.test deleted file mode 100644 index 0ed98fed02..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/with_variables.test +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -"include" function accept variables ---TEMPLATE-- -{{ include("foo.twig", {'foo': 'bar'}) }} -{{- include("foo.twig", vars) }} ---TEMPLATE(foo.twig)-- -{{ foo }} ---DATA-- -return ['vars' => ['foo' => 'bar']] ---EXPECT-- -bar -bar diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include_template_from_string.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include_template_from_string.test deleted file mode 100644 index 8d9ba60ce6..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include_template_from_string.test +++ /dev/null @@ -1,11 +0,0 @@ ---TEST-- -"template_from_string" function works in an "include" ---TEMPLATE-- -{% set embed = '{% embed "embed.twig" %}{% endembed %}' %} -{{ include(template_from_string(embed)) }} ---TEMPLATE(embed.twig)-- -Cool ---DATA-- -return [] ---EXPECT-- -Cool diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/magic_call.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/magic_call.test deleted file mode 100644 index 4dd5e27042..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/magic_call.test +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -__call calls ---TEMPLATE-- -{{ 'foo'|magic_call }} ---DATA-- -return [] ---EXPECT-- -magic_foo diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/magic_call53.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/magic_call53.test deleted file mode 100644 index a7c65bf676..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/magic_call53.test +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -__staticCall calls ---CONDITION-- -version_compare(phpversion(), '5.3.0', '>=') ---TEMPLATE-- -{{ 'foo'|magic_call_string }} -{{ 'foo'|magic_call_array }} ---DATA-- -return [] ---EXPECT-- -static_magic_foo -static_magic_foo diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/max.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/max.test deleted file mode 100644 index 6d2de000d5..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/max.test +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -"max" function ---TEMPLATE-- -{{ max([2, 1, 3, 5, 4]) }} -{{ max(2, 1, 3, 5, 4) }} -{{ max({2:"two", 1:"one", 3:"three", 5:"five", 4:"for"}) }} ---DATA-- -return [] ---EXPECT-- -5 -5 -two diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/min.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/min.test deleted file mode 100644 index 1fe5446b7c..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/min.test +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -"min" function ---TEMPLATE-- -{{ min(2, 1, 3, 5, 4) }} -{{ min([2, 1, 3, 5, 4]) }} -{{ min({2:"two", 1:"one", 3:"three", 5:"five", 4:"for"}) }} ---DATA-- -return [] ---EXPECT-- -1 -1 -five diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/range.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/range.test deleted file mode 100644 index 2927333b97..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/range.test +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -"range" function ---TEMPLATE-- -{{ range(low=0+1, high=10+0, step=2)|join(',') }} ---DATA-- -return [] ---EXPECT-- -1,3,5,7,9 diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/recursive_block_with_inheritance.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/recursive_block_with_inheritance.test deleted file mode 100644 index 1c3fffb5da..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/recursive_block_with_inheritance.test +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -"block" function recursively called in a parent template ---TEMPLATE-- -{% extends "ordered_menu.twig" %} -{% block label %}"{{ parent() }}"{% endblock %} -{% block list %}{% set class = 'b' %}{{ parent() }}{% endblock %} ---TEMPLATE(ordered_menu.twig)-- -{% extends "menu.twig" %} -{% block list %}{% set class = class|default('a') %}<ol class="{{ class }}">{{ block('children') }}</ol>{% endblock %} ---TEMPLATE(menu.twig)-- -{% extends "base.twig" %} -{% block list %}<ul>{{ block('children') }}</ul>{% endblock %} -{% block children %}{% set currentItem = item %}{% for item in currentItem %}{{ block('item') }}{% endfor %}{% set item = currentItem %}{% endblock %} -{% block item %}<li>{% if item is not iterable %}{{ block('label') }}{% else %}{{ block('list') }}{% endif %}</li>{% endblock %} -{% block label %}{{ item }}{% endblock %} ---TEMPLATE(base.twig)-- -{{ block('list') }} ---DATA-- -return ['item' => ['1', '2', ['3.1', ['3.2.1', '3.2.2'], '3.4']]] ---EXPECT-- -<ol class="b"><li>"1"</li><li>"2"</li><li><ol class="b"><li>"3.1"</li><li><ol class="b"><li>"3.2.1"</li><li>"3.2.2"</li></ol></li><li>"3.4"</li></ol></li></ol> diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/source.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/source.test deleted file mode 100644 index b691ce7bcd..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/source.test +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -"source" function ---TEMPLATE-- -FOO -{{ source("foo.twig") }} - -BAR ---TEMPLATE(foo.twig)-- -{{ foo }}<br /> ---DATA-- -return [] ---EXPECT-- -FOO - -{{ foo }}<br /> - -BAR diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/special_chars.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/special_chars.test deleted file mode 100644 index 9c9e249455..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/special_chars.test +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -"§" custom function ---TEMPLATE-- -{{ §('foo') }} ---DATA-- -return [] ---EXPECT-- -§foo§ diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/static_calls.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/static_calls.test deleted file mode 100644 index dd13abb0bc..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/static_calls.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -Functions as static method calls ---TEMPLATE-- -{{ static_call_string('foo') }} -{{ static_call_array('foo') }} ---DATA-- -return ['foo' => 'foo'] ---EXPECT-- -*foo* -*foo* diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/template_from_string.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/template_from_string.test deleted file mode 100644 index 33b0e40d7c..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/template_from_string.test +++ /dev/null @@ -1,15 +0,0 @@ ---TEST-- -"template_from_string" function ---TEMPLATE-- -{% include template_from_string(template) %} - -{% include template_from_string("Hello {{ name }}") %} -{% include template_from_string('{% extends "parent.twig" %}{% block content %}Hello {{ name }}{% endblock %}') %} ---TEMPLATE(parent.twig)-- -{% block content %}{% endblock %} ---DATA-- -return ['name' => 'Fabien', 'template' => "Hello {{ name }}"] ---EXPECT-- -Hello Fabien -Hello Fabien -Hello Fabien diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/template_from_string_error.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/template_from_string_error.test deleted file mode 100644 index 900d238bd2..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/template_from_string_error.test +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -"template_from_string" function ---TEMPLATE-- -{% include template_from_string("{{ not a Twig template ", "foo.twig") %} ---DATA-- -return [] ---EXCEPTION-- -Twig\Error\SyntaxError: Unclosed "variable" in "foo.twig (string template 4900163d56b1af4b704c6b0afee7f98ba53418ce7a93d37a3af1882735baf9cd)" at line 1. diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/macros/default_values.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/macros/default_values.test deleted file mode 100644 index 18bba524ad..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/macros/default_values.test +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -macro ---TEMPLATE-- -{% from _self import test %} - -{% macro test(a, b = 'bar') -%} -{{ a }}{{ b }} -{%- endmacro %} - -{{ test('foo') }} -{{ test('bar', 'foo') }} ---DATA-- -return [] ---EXPECT-- -foobar -barfoo diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/macros/nested_calls.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/macros/nested_calls.test deleted file mode 100644 index 4577286d0c..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/macros/nested_calls.test +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -macro ---TEMPLATE-- -{% import _self as macros %} - -{% macro foo(data) %} - {{ data }} -{% endmacro %} - -{% macro bar() %} - <br /> -{% endmacro %} - -{{ macros.foo(macros.bar()) }} ---DATA-- -return [] ---EXPECT-- -<br /> diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/macros/reserved_variables.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/macros/reserved_variables.test deleted file mode 100644 index 05dd921300..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/macros/reserved_variables.test +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -macro ---TEMPLATE-- -{% from _self import test %} - -{% macro test(this) -%} - {{ this }} -{%- endmacro %} - -{{ test(this) }} ---DATA-- -return ['this' => 'foo'] ---EXPECT-- -foo diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/macros/simple.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/macros/simple.test deleted file mode 100644 index 8fc6b477fb..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/macros/simple.test +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -macro ---TEMPLATE-- -{% import _self as test %} -{% from _self import test %} - -{% macro test(a, b) -%} - {{ a|default('a') }}<br /> - {{- b|default('b') }}<br /> -{%- endmacro %} - -{{ test.test() }} -{{ test() }} -{{ test.test(1, "c") }} -{{ test(1, "c") }} ---DATA-- -return [] ---EXPECT-- -a<br />b<br /> -a<br />b<br /> -1<br />c<br /> -1<br />c<br /> diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/macros/varargs.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/macros/varargs.test deleted file mode 100644 index dd4b5c9f47..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/macros/varargs.test +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -macro with arbitrary arguments ---TEMPLATE-- -{% from _self import test1, test2 %} - -{% macro test1(var) %} - {{- var }}: {{ varargs|join(", ") }} -{% endmacro %} - -{% macro test2() %} - {{- varargs|join(", ") }} -{% endmacro %} - -{{ test1("foo", "bar", "foobar") }} -{{ test2("foo", "bar", "foobar") }} ---DATA-- -return [] ---EXPECT-- -foo: bar, foobar - -foo, bar, foobar diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/macros/varargs_argument.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/macros/varargs_argument.test deleted file mode 100644 index 1ad368bf1e..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/macros/varargs_argument.test +++ /dev/null @@ -1,7 +0,0 @@ ---TEST-- -macro with varargs argument ---TEMPLATE-- -{% macro test(varargs) %} -{% endmacro %} ---EXCEPTION-- -Twig\Error\SyntaxError: The argument "varargs" in macro "test" cannot be defined because the variable "varargs" is reserved for arbitrary arguments in "index.twig" at line 2. diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/macros/with_filters.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/macros/with_filters.test deleted file mode 100644 index 96064ba012..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/macros/with_filters.test +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -macro with a filter ---TEMPLATE-- -{% import _self as test %} - -{% macro test() %} - {% filter escape %}foo<br />{% endfilter %} -{% endmacro %} - -{{ test.test() }} ---DATA-- -return [] ---EXPECT-- -foo<br /> diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/regression/block_names_unicity.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/regression/block_names_unicity.test deleted file mode 100644 index df07470724..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/regression/block_names_unicity.test +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -Block names are unique per template ---TEMPLATE-- -{% extends 'layout' %} -{% block content -%} - {% filter title -%} - second - {% endfilter %} -{% endblock %} ---TEMPLATE(layout)-- -{% filter title -%} - first -{% endfilter %} -{% block content %}{% endblock %} ---DATA-- -return [] ---EXPECT-- -First -Second diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/regression/combined_debug_info.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/regression/combined_debug_info.test deleted file mode 100644 index 6426d2c1d8..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/regression/combined_debug_info.test +++ /dev/null @@ -1,15 +0,0 @@ ---TEST-- -Exception with bad line number ---TEMPLATE-- -{% block content %} - {{ foo }} - {{ include("foo") }} -{% endblock %} -index ---TEMPLATE(foo)-- -foo -{{ foo.bar }} ---DATA-- -return ['foo' => 'foo'] ---EXCEPTION-- -Twig\Error\RuntimeError: Impossible to access an attribute ("bar") on a string variable ("foo") in "foo" at line 3. diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/regression/empty_token.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/regression/empty_token.test deleted file mode 100644 index 25bdc9e407..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/regression/empty_token.test +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -Twig outputs 0 nodes correctly ---TEMPLATE-- -{{ foo }}0{{ foo }} ---DATA-- -return ['foo' => 'foo'] ---EXPECT-- -foo0foo diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/regression/issue_1143.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/regression/issue_1143.test deleted file mode 100644 index e2ab950e18..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/regression/issue_1143.test +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -error in twig extension ---TEMPLATE-- -{{ object.region is not null ? object.regionChoices[object.region] }} ---DATA-- -class House -{ - const REGION_S = 1; - const REGION_P = 2; - - public static $regionChoices = [self::REGION_S => 'house.region.s', self::REGION_P => 'house.region.p']; - - public function getRegionChoices() - { - return self::$regionChoices; - } -} - -$object = new House(); -$object->region = 1; -return ['object' => $object] ---EXPECT-- -house.region.s diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/regression/multi_word_tests.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/regression/multi_word_tests.test deleted file mode 100644 index 96ca5517a1..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/regression/multi_word_tests.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -Twig allows multi-word tests without a custom node class ---TEMPLATE-- -{{ 'foo' is multi word ? 'yes' : 'no' }} -{{ 'foo bar' is multi word ? 'yes' : 'no' }} ---DATA-- -return [] ---EXPECT-- -no -yes diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/regression/simple_xml_element.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/regression/simple_xml_element.test deleted file mode 100644 index b6e62c8d7e..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/regression/simple_xml_element.test +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -Twig is able to deal with SimpleXMLElement instances as variables ---CONDITION-- -version_compare(phpversion(), '5.3.0', '>=') ---TEMPLATE-- -Hello '{{ images.image.0.group }}'! -{{ images.image.0.group.attributes.myattr }} -{{ images.children().image.count() }} -{% for image in images %} - - {{ image.group }} -{% endfor %} ---DATA-- -return ['images' => new \SimpleXMLElement('<images><image><group myattr="example">foo</group></image><image><group>bar</group></image></images>')] ---EXPECT-- -Hello 'foo'! -example -2 - - foo - - bar diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/regression/strings_like_numbers.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/regression/strings_like_numbers.test deleted file mode 100644 index 62fe884858..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/regression/strings_like_numbers.test +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -Twig does not confuse strings with integers in getAttribute() ---TEMPLATE-- -{{ hash['2e2'] }} ---DATA-- -return ['hash' => ['2e2' => 'works']] ---EXPECT-- -works diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/apply/basic.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/apply/basic.test deleted file mode 100644 index 4848ee0259..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/apply/basic.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"apply" tag applies a filter on its children ---TEMPLATE-- -{% apply upper %} -Some text with a {{ var }} -{% endapply %} ---DATA-- -return ['var' => 'var'] ---EXPECT-- -SOME TEXT WITH A VAR diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/apply/json_encode.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/apply/json_encode.test deleted file mode 100644 index 8a590b44ac..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/apply/json_encode.test +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -"apply" tag applies a filter on its children ---TEMPLATE-- -{% apply json_encode|raw %}test{% endapply %} ---DATA-- -return [] ---EXPECT-- -"test" diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/apply/multiple.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/apply/multiple.test deleted file mode 100644 index e16998a526..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/apply/multiple.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"apply" tags accept multiple chained filters ---TEMPLATE-- -{% apply lower|title %} - {{ var }} -{% endapply %} ---DATA-- -return ['var' => 'VAR'] ---EXPECT-- - Var diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/apply/nested.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/apply/nested.test deleted file mode 100644 index b64a6914c5..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/apply/nested.test +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -"apply" tags can be nested at will ---TEMPLATE-- -{% apply lower|title %} - {{ var }} - {% apply upper %} - {{ var }} - {% endapply %} - {{ var }} -{% endapply %} ---DATA-- -return ['var' => 'var'] ---EXPECT-- - Var - Var - Var diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/apply/scope.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/apply/scope.test deleted file mode 100644 index a87ff9116b..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/apply/scope.test +++ /dev/null @@ -1,15 +0,0 @@ ---TEST-- -"apply" tag does not create a new scope ---TEMPLATE-- -{% set foo = 'baz' %} -{% apply spaceless %} - {% set foo = 'foo' %} - {% set bar = 'bar' %} -{% endapply %} -{{ 'foo' == foo ? 'OK ' ~ foo : 'KO' }} -{{ 'bar' == bar ? 'OK ' ~ bar : 'KO' }} ---DATA-- -return [] ---EXPECT-- -OK foo -OK bar diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/apply/with_for_tag.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/apply/with_for_tag.test deleted file mode 100644 index 4453880b59..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/apply/with_for_tag.test +++ /dev/null @@ -1,13 +0,0 @@ ---TEST-- -"apply" tag applies the filter on "for" tags ---TEMPLATE-- -{% apply upper %} -{% for item in items %} -{{ item }} -{% endfor %} -{% endapply %} ---DATA-- -return ['items' => ['a', 'b']] ---EXPECT-- -A -B diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/apply/with_if_tag.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/apply/with_if_tag.test deleted file mode 100644 index ca7a592cba..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/apply/with_if_tag.test +++ /dev/null @@ -1,29 +0,0 @@ ---TEST-- -"apply" tag applies the filter on "if" tags ---TEMPLATE-- -{% apply upper %} -{% if items %} -{{ items|join(', ') }} -{% endif %} - -{% if items.3 is defined %} -FOO -{% else %} -{{ items.1 }} -{% endif %} - -{% if items.3 is defined %} -FOO -{% elseif items.1 %} -{{ items.0 }} -{% endif %} - -{% endapply %} ---DATA-- -return ['items' => ['a', 'b']] ---EXPECT-- -A, B - -B - -A diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/basic.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/basic.test deleted file mode 100644 index 5979725e38..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/basic.test +++ /dev/null @@ -1,26 +0,0 @@ ---TEST-- -"autoescape" tag applies escaping on its children ---TEMPLATE-- -{% autoescape %} -{{ var }}<br /> -{% endautoescape %} -{% autoescape 'html' %} -{{ var }}<br /> -{% endautoescape %} -{% autoescape false %} -{{ var }}<br /> -{% endautoescape %} -{% autoescape true %} -{{ var }}<br /> -{% endautoescape %} -{% autoescape false %} -{{ var }}<br /> -{% endautoescape %} ---DATA-- -return ['var' => '<br />'] ---EXPECT-- -<br /><br /> -<br /><br /> -<br /><br /> -<br /><br /> -<br /><br /> diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/blocks.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/blocks.test deleted file mode 100644 index 292e1b4167..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/blocks.test +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -"autoescape" tag applies escaping on embedded blocks ---TEMPLATE-- -{% autoescape 'html' %} - {% block foo %} - {{ var }} - {% endblock %} -{% endautoescape %} ---DATA-- -return ['var' => '<br />'] ---EXPECT-- -<br /> diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/double_escaping.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/double_escaping.test deleted file mode 100644 index 1724b48787..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/double_escaping.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"autoescape" tag does not double-escape ---TEMPLATE-- -{% autoescape 'html' %} -{{ var|escape }} -{% endautoescape %} ---DATA-- -return ['var' => '<br />'] ---EXPECT-- -<br /> diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/functions.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/functions.test deleted file mode 100644 index 170e7074ed..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/functions.test +++ /dev/null @@ -1,83 +0,0 @@ ---TEST-- -"autoescape" tag applies escaping after calling functions ---TEMPLATE-- - -autoescape false -{% autoescape false %} - -safe_br -{{ safe_br() }} - -unsafe_br -{{ unsafe_br() }} - -{% endautoescape %} - -autoescape 'html' -{% autoescape 'html' %} - -safe_br -{{ safe_br() }} - -unsafe_br -{{ unsafe_br() }} - -unsafe_br()|raw -{{ (unsafe_br())|raw }} - -safe_br()|escape -{{ (safe_br())|escape }} - -safe_br()|raw -{{ (safe_br())|raw }} - -unsafe_br()|escape -{{ (unsafe_br())|escape }} - -{% endautoescape %} - -autoescape js -{% autoescape 'js' %} - -safe_br -{{ safe_br() }} - -{% endautoescape %} ---DATA-- -return [] ---EXPECT-- - -autoescape false - -safe_br -<br /> - -unsafe_br -<br /> - - -autoescape 'html' - -safe_br -<br /> - -unsafe_br -<br /> - -unsafe_br()|raw -<br /> - -safe_br()|escape -<br /> - -safe_br()|raw -<br /> - -unsafe_br()|escape -<br /> - - -autoescape js - -safe_br -\u003Cbr\u0020\/\u003E diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/literal.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/literal.test deleted file mode 100644 index 3d8d4f8fdd..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/literal.test +++ /dev/null @@ -1,87 +0,0 @@ ---TEST-- -"autoescape" tag does not apply escaping on literals ---TEMPLATE-- -{% autoescape 'html' %} - -1. Simple literal -{{ "<br />" }} - -2. Conditional expression with only literals -{{ true ? "<br />" : "<br>" }} - -3. Conditional expression with a variable -{{ true ? "<br />" : someVar }} -{{ false ? "<br />" : someVar }} -{{ true ? someVar : "<br />" }} -{{ false ? someVar : "<br />" }} - -4. Nested conditionals with only literals -{{ true ? (true ? "<br />" : "<br>") : "\n" }} - -5. Nested conditionals with a variable -{{ true ? (true ? "<br />" : someVar) : "\n" }} -{{ true ? (false ? "<br />" : someVar) : "\n" }} -{{ true ? (true ? someVar : "<br />") : "\n" }} -{{ true ? (false ? someVar : "<br />") : "\n" }} -{{ false ? "\n" : (true ? someVar : "<br />") }} -{{ false ? "\n" : (false ? someVar : "<br />") }} - -6. Nested conditionals with a variable marked safe -{{ true ? (true ? "<br />" : someVar|raw) : "\n" }} -{{ true ? (false ? "<br />" : someVar|raw) : "\n" }} -{{ true ? (true ? someVar|raw : "<br />") : "\n" }} -{{ true ? (false ? someVar|raw : "<br />") : "\n" }} -{{ false ? "\n" : (true ? someVar|raw : "<br />") }} -{{ false ? "\n" : (false ? someVar|raw : "<br />") }} - -7. Without then clause -{{ "<br />" ?: someVar }} -{{ someFalseVar ?: "<br />" }} - -8. NullCoalesce -{{ aaaa ?? "<br />" }} -{{ "<br />" ?? someVar }} - -{% endautoescape %} ---DATA-- -return ['someVar' => '<br />', 'someFalseVar' => false] ---EXPECT-- - -1. Simple literal -<br /> - -2. Conditional expression with only literals -<br /> - -3. Conditional expression with a variable -<br /> -<br /> -<br /> -<br /> - -4. Nested conditionals with only literals -<br /> - -5. Nested conditionals with a variable -<br /> -<br /> -<br /> -<br /> -<br /> -<br /> - -6. Nested conditionals with a variable marked safe -<br /> -<br /> -<br /> -<br /> -<br /> -<br /> - -7. Without then clause -<br /> -<br /> - -8. NullCoalesce -<br /> -<br /> diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/nested.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/nested.test deleted file mode 100644 index 0d88c7e3a2..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/nested.test +++ /dev/null @@ -1,26 +0,0 @@ ---TEST-- -"autoescape" tags can be nested at will ---TEMPLATE-- -{{ var }} -{% autoescape 'html' %} - {{ var }} - {% autoescape false %} - {{ var }} - {% autoescape 'html' %} - {{ var }} - {% endautoescape %} - {{ var }} - {% endautoescape %} - {{ var }} -{% endautoescape %} -{{ var }} ---DATA-- -return ['var' => '<br />'] ---EXPECT-- -<br /> - <br /> - <br /> - <br /> - <br /> - <br /> -<br /> diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/objects.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/objects.test deleted file mode 100644 index 9d959b22b4..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/objects.test +++ /dev/null @@ -1,26 +0,0 @@ ---TEST-- -"autoescape" tag applies escaping to object method calls ---TEMPLATE-- -{% autoescape 'html' %} -{{ user.name }} -{{ user.name|lower }} -{{ user }} -{% endautoescape %} ---DATA-- -class UserForAutoEscapeTest -{ - public function getName() - { - return 'Fabien<br />'; - } - - public function __toString() - { - return 'Fabien<br />'; - } -} -return ['user' => new UserForAutoEscapeTest()] ---EXPECT-- -Fabien<br /> -fabien<br /> -Fabien<br /> diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/raw.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/raw.test deleted file mode 100644 index 187327c801..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/raw.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"autoescape" tag does not escape when raw is used as a filter ---TEMPLATE-- -{% autoescape 'html' %} -{{ var|raw }} -{% endautoescape %} ---DATA-- -return ['var' => '<br />'] ---EXPECT-- -<br /> diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/strategy.legacy.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/strategy.legacy.test deleted file mode 100644 index 289f2b1743..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/strategy.legacy.test +++ /dev/null @@ -1,11 +0,0 @@ ---TEST-- -"autoescape" tag accepts an escaping strategy ---TEMPLATE-- -{% autoescape true js %}{{ var }}{% endautoescape %} - -{% autoescape true html %}{{ var }}{% endautoescape %} ---DATA-- -return ['var' => '<br />"'] ---EXPECT-- -\u003Cbr\u0020\/\u003E\u0022 -<br />" diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/strategy.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/strategy.test deleted file mode 100644 index 9a0137ee27..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/strategy.test +++ /dev/null @@ -1,11 +0,0 @@ ---TEST-- -"autoescape" tag accepts an escaping strategy ---TEMPLATE-- -{% autoescape 'js' %}{{ var }}{% endautoescape %} - -{% autoescape 'html' %}{{ var }}{% endautoescape %} ---DATA-- -return ['var' => '<br />"'] ---EXPECT-- -\u003Cbr\u0020\/\u003E\u0022 -<br />" diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/type.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/type.test deleted file mode 100644 index 9ae8d7bf99..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/type.test +++ /dev/null @@ -1,69 +0,0 @@ ---TEST-- -escape types ---TEMPLATE-- - -1. autoescape 'html' |escape('js') - -{% autoescape 'html' %} -<a onclick="alert("{{ msg|escape('js') }}")"></a> -{% endautoescape %} - -2. autoescape 'html' |escape('js') - -{% autoescape 'html' %} -<a onclick="alert("{{ msg|escape('js') }}")"></a> -{% endautoescape %} - -3. autoescape 'js' |escape('js') - -{% autoescape 'js' %} -<a onclick="alert("{{ msg|escape('js') }}")"></a> -{% endautoescape %} - -4. no escape - -{% autoescape false %} -<a onclick="alert("{{ msg }}")"></a> -{% endautoescape %} - -5. |escape('js')|escape('html') - -{% autoescape false %} -<a onclick="alert("{{ msg|escape('js')|escape('html') }}")"></a> -{% endautoescape %} - -6. autoescape 'html' |escape('js')|escape('html') - -{% autoescape 'html' %} -<a onclick="alert("{{ msg|escape('js')|escape('html') }}")"></a> -{% endautoescape %} - ---DATA-- -return ['msg' => "<>\n'\""] ---EXPECT-- - -1. autoescape 'html' |escape('js') - -<a onclick="alert("\u003C\u003E\n\u0027\u0022")"></a> - -2. autoescape 'html' |escape('js') - -<a onclick="alert("\u003C\u003E\n\u0027\u0022")"></a> - -3. autoescape 'js' |escape('js') - -<a onclick="alert("\u003C\u003E\n\u0027\u0022")"></a> - -4. no escape - -<a onclick="alert("<> -'"")"></a> - -5. |escape('js')|escape('html') - -<a onclick="alert("\u003C\u003E\n\u0027\u0022")"></a> - -6. autoescape 'html' |escape('js')|escape('html') - -<a onclick="alert("\u003C\u003E\n\u0027\u0022")"></a> - diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/with_filters.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/with_filters.test deleted file mode 100644 index f97105bbd1..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/with_filters.test +++ /dev/null @@ -1,131 +0,0 @@ ---TEST-- -"autoescape" tag applies escaping after calling filters ---TEMPLATE-- -{% autoescape 'html' %} - -(escape_and_nl2br is an escaper filter) - -1. Don't escape escaper filter output -( var is escaped by |escape_and_nl2br, line-breaks are added, - the output is not escaped ) -{{ var|escape_and_nl2br }} - -2. Don't escape escaper filter output -( var is escaped by |escape_and_nl2br, line-breaks are added, - the output is not escaped, |raw is redundant ) -{{ var|escape_and_nl2br|raw }} - -3. Explicit escape -( var is escaped by |escape_and_nl2br, line-breaks are added, - the output is explicitly escaped by |escape ) -{{ var|escape_and_nl2br|escape }} - -4. Escape non-escaper filter output -( var is upper-cased by |upper, - the output is auto-escaped ) -{{ var|upper }} - -5. Escape if last filter is not an escaper -( var is escaped by |escape_and_nl2br, line-breaks are added, - the output is upper-cased by |upper, - the output is auto-escaped as |upper is not an escaper ) -{{ var|escape_and_nl2br|upper }} - -6. Don't escape escaper filter output -( var is upper cased by upper, - the output is escaped by |escape_and_nl2br, line-breaks are added, - the output is not escaped as |escape_and_nl2br is an escaper ) -{{ var|upper|escape_and_nl2br }} - -7. Escape if last filter is not an escaper -( the output of |format is "<b>" ~ var ~ "</b>", - the output is auto-escaped ) -{{ "<b>%s</b>"|format(var) }} - -8. Escape if last filter is not an escaper -( the output of |format is "<b>" ~ var ~ "</b>", - |raw is redundant, - the output is auto-escaped ) -{{ "<b>%s</b>"|raw|format(var) }} - -9. Don't escape escaper filter output -( the output of |format is "<b>" ~ var ~ "</b>", - the output is not escaped due to |raw filter at the end ) -{{ "<b>%s</b>"|format(var)|raw }} - -10. Don't escape escaper filter output -( the output of |format is "<b>" ~ var ~ "</b>", - the output is not escaped due to |raw filter at the end, - the |raw filter on var is redundant ) -{{ "<b>%s</b>"|format(var|raw)|raw }} - -{% endautoescape %} ---DATA-- -return ['var' => "<Fabien>\nTwig"] ---EXPECT-- - -(escape_and_nl2br is an escaper filter) - -1. Don't escape escaper filter output -( var is escaped by |escape_and_nl2br, line-breaks are added, - the output is not escaped ) -<Fabien><br /> -Twig - -2. Don't escape escaper filter output -( var is escaped by |escape_and_nl2br, line-breaks are added, - the output is not escaped, |raw is redundant ) -<Fabien><br /> -Twig - -3. Explicit escape -( var is escaped by |escape_and_nl2br, line-breaks are added, - the output is explicitly escaped by |escape ) -&lt;Fabien&gt;<br /> -Twig - -4. Escape non-escaper filter output -( var is upper-cased by |upper, - the output is auto-escaped ) -<FABIEN> -TWIG - -5. Escape if last filter is not an escaper -( var is escaped by |escape_and_nl2br, line-breaks are added, - the output is upper-cased by |upper, - the output is auto-escaped as |upper is not an escaper ) -&LT;FABIEN&GT;<BR /> -TWIG - -6. Don't escape escaper filter output -( var is upper cased by upper, - the output is escaped by |escape_and_nl2br, line-breaks are added, - the output is not escaped as |escape_and_nl2br is an escaper ) -<FABIEN><br /> -TWIG - -7. Escape if last filter is not an escaper -( the output of |format is "<b>" ~ var ~ "</b>", - the output is auto-escaped ) -<b><Fabien> -Twig</b> - -8. Escape if last filter is not an escaper -( the output of |format is "<b>" ~ var ~ "</b>", - |raw is redundant, - the output is auto-escaped ) -<b><Fabien> -Twig</b> - -9. Don't escape escaper filter output -( the output of |format is "<b>" ~ var ~ "</b>", - the output is not escaped due to |raw filter at the end ) -<b><Fabien> -Twig</b> - -10. Don't escape escaper filter output -( the output of |format is "<b>" ~ var ~ "</b>", - the output is not escaped due to |raw filter at the end, - the |raw filter on var is redundant ) -<b><Fabien> -Twig</b> diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/with_filters_arguments.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/with_filters_arguments.test deleted file mode 100644 index 50f72d83a1..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/with_filters_arguments.test +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -"autoescape" tag do not applies escaping on filter arguments ---TEMPLATE-- -{% autoescape 'html' %} -{{ var|nl2br("<br />") }} -{{ var|nl2br("<br />"|escape) }} -{{ var|nl2br(sep) }} -{{ var|nl2br(sep|raw) }} -{{ var|nl2br(sep|escape) }} -{% endautoescape %} ---DATA-- -return ['var' => "<Fabien>\nTwig", 'sep' => '<br />'] ---EXPECT-- -<Fabien><br /> -Twig -<Fabien><br /> -Twig -<Fabien><br /> -Twig -<Fabien><br /> -Twig -<Fabien><br /> -Twig diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/with_pre_escape_filters.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/with_pre_escape_filters.test deleted file mode 100644 index c9c738055d..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/with_pre_escape_filters.test +++ /dev/null @@ -1,68 +0,0 @@ ---TEST-- -"autoescape" tag applies escaping after calling filters, and before calling pre_escape filters ---TEMPLATE-- -{% autoescape 'html' %} - -(nl2br is pre_escaped for "html" and declared safe for "html") - -1. Pre-escape and don't post-escape -( var|escape|nl2br ) -{{ var|nl2br }} - -2. Don't double-pre-escape -( var|escape|nl2br ) -{{ var|escape|nl2br }} - -3. Don't escape safe values -( var|raw|nl2br ) -{{ var|raw|nl2br }} - -4. Don't escape safe values -( var|escape|nl2br|nl2br ) -{{ var|nl2br|nl2br }} - -5. Re-escape values that are escaped for an other contexts -( var|escape_something|escape|nl2br ) -{{ var|escape_something|nl2br }} - -6. Still escape when using filters not declared safe -( var|escape|nl2br|upper|escape ) -{{ var|nl2br|upper }} - -{% endautoescape %} ---DATA-- -return ['var' => "<Fabien>\nTwig"] ---EXPECT-- - -(nl2br is pre_escaped for "html" and declared safe for "html") - -1. Pre-escape and don't post-escape -( var|escape|nl2br ) -<Fabien><br /> -Twig - -2. Don't double-pre-escape -( var|escape|nl2br ) -<Fabien><br /> -Twig - -3. Don't escape safe values -( var|raw|nl2br ) -<Fabien><br /> -Twig - -4. Don't escape safe values -( var|escape|nl2br|nl2br ) -<Fabien><br /><br /> -Twig - -5. Re-escape values that are escaped for an other contexts -( var|escape_something|escape|nl2br ) -<FABIEN><br /> -TWIG - -6. Still escape when using filters not declared safe -( var|escape|nl2br|upper|escape ) -&LT;FABIEN&GT;<BR /> -TWIG - diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/with_preserves_safety_filters.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/with_preserves_safety_filters.test deleted file mode 100644 index c764d434b0..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/with_preserves_safety_filters.test +++ /dev/null @@ -1,50 +0,0 @@ ---TEST-- -"autoescape" tag handles filters preserving the safety ---TEMPLATE-- -{% autoescape 'html' %} - -(preserves_safety is preserving safety for "html") - -1. Unsafe values are still unsafe -( var|preserves_safety|escape ) -{{ var|preserves_safety }} - -2. Safe values are still safe -( var|escape|preserves_safety ) -{{ var|escape|preserves_safety }} - -3. Re-escape values that are escaped for an other contexts -( var|escape_something|preserves_safety|escape ) -{{ var|escape_something|preserves_safety }} - -4. Still escape when using filters not declared safe -( var|escape|preserves_safety|replace({'FABIEN': 'FABPOT'})|escape ) -{{ var|escape|preserves_safety|replace({'FABIEN': 'FABPOT'}) }} - -{% endautoescape %} ---DATA-- -return ['var' => "<Fabien>\nTwig"] ---EXPECT-- - -(preserves_safety is preserving safety for "html") - -1. Unsafe values are still unsafe -( var|preserves_safety|escape ) -<FABIEN> -TWIG - -2. Safe values are still safe -( var|escape|preserves_safety ) -<FABIEN> -TWIG - -3. Re-escape values that are escaped for an other contexts -( var|escape_something|preserves_safety|escape ) -<FABIEN> -TWIG - -4. Still escape when using filters not declared safe -( var|escape|preserves_safety|replace({'FABIEN': 'FABPOT'})|escape ) -&LT;FABPOT&GT; -TWIG - diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/block/basic.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/block/basic.test deleted file mode 100644 index 988b09ce86..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/block/basic.test +++ /dev/null @@ -1,11 +0,0 @@ ---TEST-- -"block" tag ---TEMPLATE-- -{% block title1 %}FOO{% endblock %} -{% block title2 foo|lower %} ---TEMPLATE(foo.twig)-- -{% block content %}{% endblock %} ---DATA-- -return ['foo' => 'bar'] ---EXPECT-- -FOObar diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/block/block_unique_name.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/block/block_unique_name.test deleted file mode 100644 index 3009f8b420..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/block/block_unique_name.test +++ /dev/null @@ -1,11 +0,0 @@ ---TEST-- -"block" tag ---TEMPLATE-- -{% block content %} - {% block content %} - {% endblock %} -{% endblock %} ---DATA-- -return [] ---EXCEPTION-- -Twig\Error\SyntaxError: The block 'content' has already been defined line 2 in "index.twig" at line 3. diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/block/special_chars.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/block/special_chars.test deleted file mode 100644 index e8e240eb77..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/block/special_chars.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"§" special chars in a block name ---TEMPLATE-- -{% block § %} -§ -{% endblock § %} ---DATA-- -return [] ---EXPECT-- -§ diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/deprecated/block.legacy.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/deprecated/block.legacy.test deleted file mode 100644 index 53729dd1f7..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/deprecated/block.legacy.test +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -Deprecating a block with "deprecated" tag ---TEMPLATE-- -{% use 'greeting.twig' %} - -{{ block('welcome') }} - ---TEMPLATE(greeting.twig)-- -{% block welcome %} - {% deprecated 'The "welcome" block is deprecated, use "hello" instead.' %} - {{ block('hello') }} -{% endblock %} - -{% block hello %} -Hello Fabien -{% endblock %} ---DATA-- -return [] ---EXPECT-- - Hello Fabien diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/deprecated/macro.legacy.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/deprecated/macro.legacy.test deleted file mode 100644 index 5cc48dd873..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/deprecated/macro.legacy.test +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -Deprecating a macro with "deprecated" tag ---TEMPLATE-- -{% import 'greeting.twig' as greeting %} - -{{ greeting.welcome('Fabien') }} - ---TEMPLATE(greeting.twig)-- -{% macro welcome(name) %} - {% deprecated 'The "welcome" macro is deprecated, use "hello" instead.' %} - {% import _self as self %} - {{ self.hello(name) }} -{% endmacro %} - -{% macro hello(name) %} -Hello {{ name }} -{% endmacro %} ---DATA-- -return [] ---EXPECT-- - Hello Fabien diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/deprecated/template.legacy.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/deprecated/template.legacy.test deleted file mode 100644 index 7f786d57fc..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/deprecated/template.legacy.test +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -Deprecating a template with "deprecated" tag ---TEMPLATE-- -{% extends 'greeting.twig' %} - -{% deprecated 'The "index.twig" template is deprecated, use "greeting.twig" instead.' %} ---TEMPLATE(greeting.twig)-- -Hello Fabien ---DATA-- -return [] ---EXPECT-- -Hello Fabien diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/embed/basic.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/embed/basic.test deleted file mode 100644 index 16781e4186..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/embed/basic.test +++ /dev/null @@ -1,35 +0,0 @@ ---TEST-- -"embed" tag ---TEMPLATE-- -FOO -{% embed "foo.twig" %} - {% block c1 %} - {{ parent() }} - block1extended - {% endblock %} -{% endembed %} - -BAR ---TEMPLATE(foo.twig)-- -A -{% block c1 %} - block1 -{% endblock %} -B -{% block c2 %} - block2 -{% endblock %} -C ---DATA-- -return [] ---EXPECT-- -FOO - -A - block1 - - block1extended - B - block2 -C -BAR diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/embed/complex_dynamic_parent.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/embed/complex_dynamic_parent.test deleted file mode 100644 index b799a8c95f..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/embed/complex_dynamic_parent.test +++ /dev/null @@ -1,35 +0,0 @@ ---TEST-- -"embed" tag ---TEMPLATE-- -FOO -{% embed foo ~ ".twig" %} - {% block c1 %} - {{ parent() }} - block1extended - {% endblock %} -{% endembed %} - -BAR ---TEMPLATE(foo.twig)-- -A -{% block c1 %} - block1 -{% endblock %} -B -{% block c2 %} - block2 -{% endblock %} -C ---DATA-- -return ['foo' => 'foo'] ---EXPECT-- -FOO - -A - block1 - - block1extended - B - block2 -C -BAR diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/embed/dynamic_parent.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/embed/dynamic_parent.test deleted file mode 100644 index 6f0879e28d..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/embed/dynamic_parent.test +++ /dev/null @@ -1,35 +0,0 @@ ---TEST-- -"embed" tag ---TEMPLATE-- -FOO -{% embed foo %} - {% block c1 %} - {{ parent() }} - block1extended - {% endblock %} -{% endembed %} - -BAR ---TEMPLATE(foo.twig)-- -A -{% block c1 %} - block1 -{% endblock %} -B -{% block c2 %} - block2 -{% endblock %} -C ---DATA-- -return ['foo' => 'foo.twig'] ---EXPECT-- -FOO - -A - block1 - - block1extended - B - block2 -C -BAR diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/embed/error_line.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/embed/error_line.test deleted file mode 100644 index b1c6c85e61..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/embed/error_line.test +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -"embed" tag ---TEMPLATE(index.twig)-- -FOO -{% embed "foo.twig" %} - {% block c1 %} - {{ nothing }} - {% endblock %} -{% endembed %} -BAR ---TEMPLATE(foo.twig)-- -{% block c1 %}{% endblock %} ---DATA-- -return [] ---EXCEPTION-- -Twig\Error\RuntimeError: Variable "nothing" does not exist in "index.twig" at line 5. diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/embed/multiple.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/embed/multiple.test deleted file mode 100644 index 9f7b52f1d8..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/embed/multiple.test +++ /dev/null @@ -1,50 +0,0 @@ ---TEST-- -"embed" tag ---TEMPLATE-- -FOO -{% embed "foo.twig" %} - {% block c1 %} - {{ parent() }} - block1extended - {% endblock %} -{% endembed %} - -{% embed "foo.twig" %} - {% block c1 %} - {{ parent() }} - block1extended - {% endblock %} -{% endembed %} - -BAR ---TEMPLATE(foo.twig)-- -A -{% block c1 %} - block1 -{% endblock %} -B -{% block c2 %} - block2 -{% endblock %} -C ---DATA-- -return [] ---EXPECT-- -FOO - -A - block1 - - block1extended - B - block2 -C - -A - block1 - - block1extended - B - block2 -C -BAR diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/embed/nested.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/embed/nested.test deleted file mode 100644 index 9f33723366..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/embed/nested.test +++ /dev/null @@ -1,42 +0,0 @@ ---TEST-- -"embed" tag ---TEMPLATE-- -{% embed "foo.twig" %} - {% block c1 %} - {{ parent() }} - {% embed "foo.twig" %} - {% block c1 %} - {{ parent() }} - block1extended - {% endblock %} - {% endembed %} - - {% endblock %} -{% endembed %} ---TEMPLATE(foo.twig)-- -A -{% block c1 %} - block1 -{% endblock %} -B -{% block c2 %} - block2 -{% endblock %} -C ---DATA-- -return [] ---EXPECT-- -A - block1 - - -A - block1 - - block1extended - B - block2 -C - B - block2 -C diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/embed/with_extends.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/embed/with_extends.test deleted file mode 100644 index ce726ac009..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/embed/with_extends.test +++ /dev/null @@ -1,60 +0,0 @@ ---TEST-- -"embed" tag ---TEMPLATE-- -{% extends "base.twig" %} - -{% block c1 %} - {{ parent() }} - blockc1baseextended -{% endblock %} - -{% block c2 %} - {{ parent() }} - - {% embed "foo.twig" %} - {% block c1 %} - {{ parent() }} - block1extended - {% endblock %} - {% endembed %} - {{ parent() }} -{% endblock %} ---TEMPLATE(base.twig)-- -A -{% block c1 %} - blockc1base -{% endblock %} -{% block c2 %} - blockc2base -{% endblock %} -B ---TEMPLATE(foo.twig)-- -A -{% block c1 %} - block1 -{% endblock %} -B -{% block c2 %} - block2 -{% endblock %} -C ---DATA-- -return [] ---EXPECT-- -A - blockc1base - - blockc1baseextended - blockc2base - - - -A - block1 - - block1extended - B - block2 -C blockc2base - -B \ No newline at end of file diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/filter/basic.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/filter/basic.test deleted file mode 100644 index 866171ecc5..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/filter/basic.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"filter" tag applies a filter on its children ---TEMPLATE-- -{% filter upper %} -Some text with a {{ var }} -{% endfilter %} ---DATA-- -return ['var' => 'var'] ---EXPECT-- -SOME TEXT WITH A VAR diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/filter/json_encode.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/filter/json_encode.test deleted file mode 100644 index a2562b995b..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/filter/json_encode.test +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -"filter" tag applies a filter on its children ---TEMPLATE-- -{% filter json_encode|raw %}test{% endfilter %} ---DATA-- -return [] ---EXPECT-- -"test" diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/filter/multiple.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/filter/multiple.test deleted file mode 100644 index 8eb3cbdd7d..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/filter/multiple.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"filter" tags accept multiple chained filters ---TEMPLATE-- -{% filter lower|title %} - {{ var }} -{% endfilter %} ---DATA-- -return ['var' => 'VAR'] ---EXPECT-- - Var diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/filter/nested.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/filter/nested.test deleted file mode 100644 index 6d18e1af08..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/filter/nested.test +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -"filter" tags can be nested at will ---TEMPLATE-- -{% filter lower|title %} - {{ var }} - {% filter upper %} - {{ var }} - {% endfilter %} - {{ var }} -{% endfilter %} ---DATA-- -return ['var' => 'var'] ---EXPECT-- - Var - Var - Var diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/filter/scope.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/filter/scope.test deleted file mode 100644 index 889a46f6a2..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/filter/scope.test +++ /dev/null @@ -1,11 +0,0 @@ ---TEST-- -"scope" tag creates a new scope ---TEMPLATE-- -{% filter spaceless %} -{% set item = 'foo' %} -{% endfilter %} -{{ item }} ---DATA-- -return [] ---EXCEPTION-- -Twig\Error\RuntimeError: Variable "item" does not exist in "index.twig" at line 5. diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/filter/with_for_tag.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/filter/with_for_tag.test deleted file mode 100644 index d2d87cfda3..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/filter/with_for_tag.test +++ /dev/null @@ -1,13 +0,0 @@ ---TEST-- -"filter" tag applies the filter on "for" tags ---TEMPLATE-- -{% filter upper %} -{% for item in items %} -{{ item }} -{% endfor %} -{% endfilter %} ---DATA-- -return ['items' => ['a', 'b']] ---EXPECT-- -A -B diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/filter/with_if_tag.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/filter/with_if_tag.test deleted file mode 100644 index f2e804bfb1..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/filter/with_if_tag.test +++ /dev/null @@ -1,29 +0,0 @@ ---TEST-- -"filter" tag applies the filter on "if" tags ---TEMPLATE-- -{% filter upper %} -{% if items %} -{{ items|join(', ') }} -{% endif %} - -{% if items.3 is defined %} -FOO -{% else %} -{{ items.1 }} -{% endif %} - -{% if items.3 is defined %} -FOO -{% elseif items.1 %} -{{ items.0 }} -{% endif %} - -{% endfilter %} ---DATA-- -return ['items' => ['a', 'b']] ---EXPECT-- -A, B - -B - -A diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/condition.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/condition.test deleted file mode 100644 index b1ad22fd53..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/condition.test +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -"for" tag takes a condition ---TEMPLATE-- -{% for i in 1..5 if i is odd -%} - {{ loop.index }}.{{ i }}{{ foo.bar }} -{% endfor %} ---DATA-- -return ['foo' => ['bar' => 'X']] ---CONFIG-- -return ['strict_variables' => false] ---EXPECT-- -1.1X -2.3X -3.5X diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/context.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/context.test deleted file mode 100644 index 3cdd575c83..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/context.test +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -"for" tag keeps the context safe ---TEMPLATE-- -{% for item in items %} - {% for item in items %} - * {{ item }} - {% endfor %} - * {{ item }} -{% endfor %} ---DATA-- -return ['items' => ['a', 'b']] ---EXPECT-- - * a - * b - * a - * a - * b - * b diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/else.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/else.test deleted file mode 100644 index 86ec9c28d3..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/else.test +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -"for" tag can use an "else" clause ---TEMPLATE-- -{% for item in items %} - * {{ item }} -{% else %} - no item -{% endfor %} ---DATA-- -return ['items' => ['a', 'b']] ---EXPECT-- - * a - * b ---DATA-- -return ['items' => []] ---EXPECT-- - no item ---DATA-- -return [] ---CONFIG-- -return ['strict_variables' => false] ---EXPECT-- - no item diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/inner_variables.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/inner_variables.test deleted file mode 100644 index e1ad3c7356..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/inner_variables.test +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -"for" tag does not reset inner variables ---TEMPLATE-- -{% for i in 1..2 %} - {% for j in 0..2 %} - {{k}}{% set k = k+1 %} {{ loop.parent.loop.index }} - {% endfor %} -{% endfor %} ---DATA-- -return ['k' => 0] ---EXPECT-- - 0 1 - 1 1 - 2 1 - 3 2 - 4 2 - 5 2 diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/keys.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/keys.test deleted file mode 100644 index 92135575f6..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/keys.test +++ /dev/null @@ -1,11 +0,0 @@ ---TEST-- -"for" tag can iterate over keys ---TEMPLATE-- -{% for key in items|keys %} - * {{ key }} -{% endfor %} ---DATA-- -return ['items' => ['a', 'b']] ---EXPECT-- - * 0 - * 1 diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/keys_and_values.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/keys_and_values.test deleted file mode 100644 index ab39ddf210..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/keys_and_values.test +++ /dev/null @@ -1,11 +0,0 @@ ---TEST-- -"for" tag can iterate over keys and values ---TEMPLATE-- -{% for key, item in items %} - * {{ key }}/{{ item }} -{% endfor %} ---DATA-- -return ['items' => ['a', 'b']] ---EXPECT-- - * 0/a - * 1/b diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/loop_context.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/loop_context.test deleted file mode 100644 index 56a60c2e6e..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/loop_context.test +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -"for" tag adds a loop variable to the context ---TEMPLATE-- -{% for item in items %} - * {{ loop.index }}/{{ loop.index0 }} - * {{ loop.revindex }}/{{ loop.revindex0 }} - * {{ loop.first }}/{{ loop.last }}/{{ loop.length }} - -{% endfor %} ---DATA-- -return ['items' => ['a', 'b']] ---EXPECT-- - * 1/0 - * 2/1 - * 1//2 - - * 2/1 - * 1/0 - * /1/2 diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/loop_context_local.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/loop_context_local.test deleted file mode 100644 index 58e5a9b345..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/loop_context_local.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"for" tag adds a loop variable to the context locally ---TEMPLATE-- -{% for item in items %} -{% endfor %} -{% if loop is not defined %}WORKS{% endif %} ---DATA-- -return ['items' => []] ---EXPECT-- -WORKS diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/loop_not_defined.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/loop_not_defined.test deleted file mode 100644 index 2d8c0b8738..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/loop_not_defined.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"for" tag ---TEMPLATE-- -{% for i, item in items if i > 0 %} - {{ loop.last }} -{% endfor %} ---DATA-- -return ['items' => ['a', 'b']] ---EXCEPTION-- -Twig\Error\SyntaxError: The "loop.last" variable is not defined when looping with a condition in "index.twig" at line 3. diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/loop_not_defined_cond.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/loop_not_defined_cond.test deleted file mode 100644 index e90e96b4ae..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/loop_not_defined_cond.test +++ /dev/null @@ -1,9 +0,0 @@ ---TEST-- -"for" tag ---TEMPLATE-- -{% for i, item in items if loop.last > 0 %} -{% endfor %} ---DATA-- -return ['items' => ['a', 'b']] ---EXCEPTION-- -Twig\Error\SyntaxError: The "loop" variable cannot be used in a looping condition in "index.twig" at line 2. diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/nested_else.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/nested_else.test deleted file mode 100644 index df1bb07ac0..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/nested_else.test +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -"for" tag can use an "else" clause ---TEMPLATE-- -{% for item in items %} - {% for item in items1 %} - * {{ item }} - {% else %} - no {{ item }} - {% endfor %} -{% else %} - no item1 -{% endfor %} ---DATA-- -return ['items' => ['a', 'b'], 'items1' => []] ---EXPECT-- -no a - no b diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/objects.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/objects.test deleted file mode 100644 index 2ba2d92c2c..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/objects.test +++ /dev/null @@ -1,43 +0,0 @@ ---TEST-- -"for" tag iterates over iterable objects ---TEMPLATE-- -{% for item in items %} - * {{ item }} - * {{ loop.index }}/{{ loop.index0 }} - * {{ loop.first }} - -{% endfor %} - -{% for key, value in items %} - * {{ key }}/{{ value }} -{% endfor %} - -{% for key in items|keys %} - * {{ key }} -{% endfor %} ---DATA-- -class ItemsIterator implements Iterator -{ - protected $values = ['foo' => 'bar', 'bar' => 'foo']; - public function current() { return current($this->values); } - public function key() { return key($this->values); } - public function next() { return next($this->values); } - public function rewind() { return reset($this->values); } - public function valid() { return false !== current($this->values); } -} -return ['items' => new ItemsIterator()] ---EXPECT-- - * bar - * 1/0 - * 1 - - * foo - * 2/1 - * - - - * foo/bar - * bar/foo - - * foo - * bar diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/objects_countable.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/objects_countable.test deleted file mode 100644 index 99146bde36..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/objects_countable.test +++ /dev/null @@ -1,47 +0,0 @@ ---TEST-- -"for" tag iterates over iterable and countable objects ---TEMPLATE-- -{% for item in items %} - * {{ item }} - * {{ loop.index }}/{{ loop.index0 }} - * {{ loop.revindex }}/{{ loop.revindex0 }} - * {{ loop.first }}/{{ loop.last }}/{{ loop.length }} - -{% endfor %} - -{% for key, value in items %} - * {{ key }}/{{ value }} -{% endfor %} - -{% for key in items|keys %} - * {{ key }} -{% endfor %} ---DATA-- -class ItemsIteratorCountable implements Iterator, \Countable -{ - protected $values = ['foo' => 'bar', 'bar' => 'foo']; - public function current() { return current($this->values); } - public function key() { return key($this->values); } - public function next() { return next($this->values); } - public function rewind() { return reset($this->values); } - public function valid() { return false !== current($this->values); } - public function count() { return count($this->values); } -} -return ['items' => new ItemsIteratorCountable()] ---EXPECT-- - * bar - * 1/0 - * 2/1 - * 1//2 - - * foo - * 2/1 - * 1/0 - * /1/2 - - - * foo/bar - * bar/foo - - * foo - * bar diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/recursive.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/recursive.test deleted file mode 100644 index 3b677d60ff..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/recursive.test +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -"for" tags can be nested ---TEMPLATE-- -{% for key, item in items %} -* {{ key }} ({{ loop.length }}): -{% for value in item %} - * {{ value }} ({{ loop.length }}) -{% endfor %} -{% endfor %} ---DATA-- -return ['items' => ['a' => ['a1', 'a2', 'a3'], 'b' => ['b1']]] ---EXPECT-- -* a (2): - * a1 (3) - * a2 (3) - * a3 (3) -* b (2): - * b1 (1) diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/values.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/values.test deleted file mode 100644 index 384c41b288..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/for/values.test +++ /dev/null @@ -1,11 +0,0 @@ ---TEST-- -"for" tag iterates over item values ---TEMPLATE-- -{% for item in items %} - * {{ item }} -{% endfor %} ---DATA-- -return ['items' => ['a', 'b']] ---EXPECT-- - * a - * b diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/from.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/from.test deleted file mode 100644 index 1d3c9e2b58..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/from.test +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -global variables ---TEMPLATE-- -{% include "included.twig" %} -{% from "included.twig" import foobar %} -{{ foobar() }} ---TEMPLATE(included.twig)-- -{% macro foobar() %} -called foobar -{% endmacro %} ---DATA-- -return [] ---EXPECT-- -called foobar diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/if/basic.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/if/basic.test deleted file mode 100644 index a02165e539..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/if/basic.test +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -"if" creates a condition ---TEMPLATE-- -{% if a is defined %} - {{ a }} -{% elseif b is defined %} - {{ b }} -{% else %} - NOTHING -{% endif %} ---DATA-- -return ['a' => 'a'] ---EXPECT-- - a ---DATA-- -return ['b' => 'b'] ---EXPECT-- - b ---DATA-- -return [] ---EXPECT-- - NOTHING diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/if/expression.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/if/expression.test deleted file mode 100644 index eb65083c61..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/if/expression.test +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -"if" takes an expression as a test ---TEMPLATE-- -{% if a < 2 %} - A1 -{% elseif a > 10 %} - A2 -{% else %} - A3 -{% endif %} ---DATA-- -return ['a' => 1] ---EXPECT-- - A1 ---DATA-- -return ['a' => 12] ---EXPECT-- - A2 ---DATA-- -return ['a' => 7] ---EXPECT-- - A3 diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/basic.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/basic.test deleted file mode 100644 index 9982b039d0..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/basic.test +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -"include" tag ---TEMPLATE-- -FOO -{% include "foo.twig" %} - -BAR ---TEMPLATE(foo.twig)-- -FOOBAR ---DATA-- -return [] ---EXPECT-- -FOO - -FOOBAR -BAR diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/expression.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/expression.test deleted file mode 100644 index 23db181238..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/expression.test +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -"include" tag allows expressions for the template to include ---TEMPLATE-- -FOO -{% include foo %} - -BAR ---TEMPLATE(foo.twig)-- -FOOBAR ---DATA-- -return ['foo' => 'foo.twig'] ---EXPECT-- -FOO - -FOOBAR -BAR diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/ignore_missing.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/ignore_missing.test deleted file mode 100644 index 6c8bdb1e92..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/ignore_missing.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"include" tag ---TEMPLATE-- -{% include ["foo.twig", "bar.twig"] ignore missing %} -{% include "foo.twig" ignore missing %} -{% include "foo.twig" ignore missing with {} %} -{% include "foo.twig" ignore missing with {} only %} ---DATA-- -return [] ---EXPECT-- diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/ignore_missing_exists.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/ignore_missing_exists.test deleted file mode 100644 index 1af012210e..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/ignore_missing_exists.test +++ /dev/null @@ -1,11 +0,0 @@ ---TEST-- -"include" tag ---TEMPLATE-- -{% include "included.twig" ignore missing %} -NOT DISPLAYED ---TEMPLATE(included.twig)-- -{% include "DOES NOT EXIST" %} ---DATA-- -return [] ---EXCEPTION-- -Twig\Error\LoaderError: Template "DOES NOT EXIST" is not defined in "included.twig" at line 2. diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/include_missing_extends.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/include_missing_extends.test deleted file mode 100644 index d0d1bfe590..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/include_missing_extends.test +++ /dev/null @@ -1,13 +0,0 @@ ---TEST-- -"include" tag ---TEMPLATE-- -{% include ['bad.twig', 'good.twig'] ignore missing %} -NOT DISPLAYED ---TEMPLATE(bad.twig)-- -{% extends 'DOES NOT EXIST' %} ---TEMPLATE(good.twig)-- -NOT DISPLAYED ---DATA-- -return [] ---EXCEPTION-- -Twig\Error\LoaderError: Template "DOES NOT EXIST" is not defined in "bad.twig" at line 2. diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/missing.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/missing.test deleted file mode 100644 index ac72838e84..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/missing.test +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -"include" tag ---TEMPLATE-- -{% include "foo.twig" %} ---DATA-- -return [] ---EXCEPTION-- -Twig\Error\LoaderError: Template "foo.twig" is not defined in "index.twig" at line 2. diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/missing_nested.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/missing_nested.test deleted file mode 100644 index 0ee51b7862..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/missing_nested.test +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -"include" tag ---TEMPLATE-- -{% extends "base.twig" %} - -{% block content %} - {{ parent() }} -{% endblock %} ---TEMPLATE(base.twig)-- -{% block content %} - {% include "foo.twig" %} -{% endblock %} ---DATA-- -return [] ---EXCEPTION-- -Twig\Error\LoaderError: Template "foo.twig" is not defined in "base.twig" at line 3. diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/only.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/only.test deleted file mode 100644 index 8da402f7a8..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/only.test +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -"include" tag accept variables and only ---TEMPLATE-- -{% include "foo.twig" %} -{% include "foo.twig" only %} -{% include "foo.twig" with vars1 %} -{% include "foo.twig" with vars1 only %} -{% include "foo.twig" with vars2 %} -{% include "foo.twig" with vars2 only %} ---TEMPLATE(foo.twig)-- -{% for k, v in _context %}{{ k }},{% endfor %} ---DATA-- -return ['vars1' => ['foo1' => 'bar'], 'vars2' => new ArrayObject(['foo2' => 'bar'])] ---EXPECT-- -vars1,vars2,global,_parent, -global,_parent, -vars1,vars2,global,foo1,_parent, -foo1,global,_parent, -vars1,vars2,global,foo2,_parent, -foo2,global,_parent, diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/template_instance.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/template_instance.test deleted file mode 100644 index 4fb862a175..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/template_instance.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"include" tag accepts \Twig\TemplateWrapper instance ---TEMPLATE-- -{% include foo %} FOO ---TEMPLATE(foo.twig)-- -BAR ---DATA-- -return ['foo' => $twig->load('foo.twig')] ---EXPECT-- -BAR FOO diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/templates_as_array.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/templates_as_array.test deleted file mode 100644 index 38063952d4..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/templates_as_array.test +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -"include" tag ---TEMPLATE-- -{% include ["foo.twig", "bar.twig"] %} -{% include ["bar.twig", "foo.twig"] %} ---TEMPLATE(foo.twig)-- -foo ---DATA-- -return [] ---EXPECT-- -foo -foo diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/with_variables.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/with_variables.test deleted file mode 100644 index 45a05199ec..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/include/with_variables.test +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -"include" tag accept variables ---TEMPLATE-- -{% include "foo.twig" with {'foo': 'bar'} %} -{% include "foo.twig" with vars1 %} -{% include "foo.twig" with vars2 %} ---TEMPLATE(foo.twig)-- -{{ foo }} ---DATA-- -return ['vars1' => ['foo' => 'bar'], 'vars2' => new ArrayObject(['foo' => 'bar'])] ---EXPECT-- -bar -bar -bar diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/basic.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/basic.test deleted file mode 100644 index 703b61be17..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/basic.test +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -"extends" tag ---TEMPLATE-- -{% extends "foo.twig" %} - -{% block content %} -FOO -{% endblock %} ---TEMPLATE(foo.twig)-- -{% block content %}{% endblock %} ---DATA-- -return [] ---EXPECT-- -FOO diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/block_expr.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/block_expr.test deleted file mode 100644 index 0b82d4cf2d..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/block_expr.test +++ /dev/null @@ -1,30 +0,0 @@ ---TEST-- -block_expr ---TEMPLATE-- -{% extends "base.twig" %} - -{% block element -%} - Element: - {{- parent() -}} -{% endblock %} ---TEMPLATE(base.twig)-- -{% block element -%} - <div> - {%- if item.children is defined %} - {%- for item in item.children %} - {{- block('element') -}} - {% endfor %} - {%- endif -%} - </div> -{%- endblock %} ---DATA-- -return [ - 'item' => [ - 'children' => [ - null, - null, - ] - ] -] ---EXPECT-- -Element:<div>Element:<div></div>Element:<div></div></div> diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/block_expr2.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/block_expr2.test deleted file mode 100644 index 18f6604113..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/block_expr2.test +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -block_expr2 ---TEMPLATE-- -{% extends "base2.twig" %} - -{% block element -%} - Element: - {{- parent() -}} -{% endblock %} ---TEMPLATE(base2.twig)-- -{% extends "base.twig" %} ---TEMPLATE(base.twig)-- -{% block element -%} - <div> - {%- if item.children is defined %} - {%- for item in item.children %} - {{- block('element') -}} - {% endfor %} - {%- endif -%} - </div> -{%- endblock %} ---DATA-- -return [ - 'item' => [ - 'children' => [ - null, - null, - ] - ] -] ---EXPECT-- -Element:<div>Element:<div></div>Element:<div></div></div> diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/conditional.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/conditional.test deleted file mode 100644 index bd28248d13..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/conditional.test +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -"extends" tag ---TEMPLATE-- -{% extends standalone ? foo : 'bar.twig' %} - -{% block content %}{{ parent() }}FOO{% endblock %} ---TEMPLATE(foo.twig)-- -{% block content %}FOO{% endblock %} ---TEMPLATE(bar.twig)-- -{% block content %}BAR{% endblock %} ---DATA-- -return ['foo' => 'foo.twig', 'standalone' => true] ---EXPECT-- -FOOFOO diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/dynamic.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/dynamic.test deleted file mode 100644 index e6a0f01728..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/dynamic.test +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -"extends" tag ---TEMPLATE-- -{% extends foo %} - -{% block content %} -FOO -{% endblock %} ---TEMPLATE(foo.twig)-- -{% block content %}{% endblock %} ---DATA-- -return ['foo' => 'foo.twig'] ---EXPECT-- -FOO diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/empty.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/empty.test deleted file mode 100644 index ca11bf20d1..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/empty.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"extends" tag ---TEMPLATE-- -{% extends "foo.twig" %} ---TEMPLATE(foo.twig)-- -{% block content %}FOO{% endblock %} ---DATA-- -return [] ---EXPECT-- -FOO diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/extends_as_array.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/extends_as_array.test deleted file mode 100644 index 4d2cb6c657..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/extends_as_array.test +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -"extends" tag ---TEMPLATE-- -{% extends ["foo.twig", "bar.twig"] %} ---TEMPLATE(bar.twig)-- -{% block content %} -foo -{% endblock %} ---DATA-- -return [] ---EXPECT-- -foo diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/extends_as_array_with_empty_name.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/extends_as_array_with_empty_name.test deleted file mode 100644 index 5108651103..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/extends_as_array_with_empty_name.test +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -"extends" tag ---TEMPLATE-- -{% extends ["", "bar.twig"] %} ---TEMPLATE(bar.twig)-- -{% block content %} -foo -{% endblock %} ---DATA-- -return [] ---EXPECT-- -foo diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/extends_as_array_with_null_name.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/extends_as_array_with_null_name.test deleted file mode 100644 index c5ee6f193b..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/extends_as_array_with_null_name.test +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -"extends" tag ---TEMPLATE-- -{% extends [null, "bar.twig"] %} ---TEMPLATE(bar.twig)-- -{% block content %} -foo -{% endblock %} ---DATA-- -return [] ---EXPECT-- -foo diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/extends_in_block.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/extends_in_block.test deleted file mode 100644 index a372ea1c81..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/extends_in_block.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"extends" tag in a block ---TEMPLATE-- -{% block foo %} - {% extends "foo.twig" %} -{% endblock %} ---DATA-- -return [] ---EXCEPTION-- -Twig\Error\SyntaxError: Cannot use "extend" in a block in "index.twig" at line 3. diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/extends_in_macro.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/extends_in_macro.test deleted file mode 100644 index dc87b2a8c2..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/extends_in_macro.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"extends" tag in a macro ---TEMPLATE-- -{% macro foo() %} - {% extends "foo.twig" %} -{% endmacro %} ---DATA-- -return [] ---EXCEPTION-- -Twig\Error\SyntaxError: Cannot use "extend" in a macro in "index.twig" at line 3. diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/multiple.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/multiple.test deleted file mode 100644 index fc25badd34..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/multiple.test +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -"extends" tag ---TEMPLATE-- -{% extends "layout.twig" %}{% block content %}{{ parent() }}index {% endblock %} ---TEMPLATE(layout.twig)-- -{% extends "base.twig" %}{% block content %}{{ parent() }}layout {% endblock %} ---TEMPLATE(base.twig)-- -{% block content %}base {% endblock %} ---DATA-- -return [] ---EXPECT-- -base layout index diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/multiple_dynamic.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/multiple_dynamic.test deleted file mode 100644 index fa887177bd..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/multiple_dynamic.test +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -"extends" tag ---TEMPLATE-- -{% set foo = 1 %} -{{ include('parent.twig') }} -{{ include('parent.twig') }} -{% set foo = 2 %} -{{ include('parent.twig') }} ---TEMPLATE(parent.twig)-- -{% extends foo~'_parent.twig' %}{% block content %}{{ parent() }} parent{% endblock %} ---TEMPLATE(1_parent.twig)-- -{% block content %}1{% endblock %} ---TEMPLATE(2_parent.twig)-- -{% block content %}2{% endblock %} ---DATA-- -return [] ---EXPECT-- -1 parent - -1 parent - -2 parent diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/nested_blocks.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/nested_blocks.test deleted file mode 100644 index abea2e9d47..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/nested_blocks.test +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -"block" tag ---TEMPLATE-- -{% extends "foo.twig" %} - -{% block content %} - {% block subcontent %} - {% block subsubcontent %} - SUBSUBCONTENT - {% endblock %} - {% endblock %} -{% endblock %} ---TEMPLATE(foo.twig)-- -{% block content %} - {% block subcontent %} - SUBCONTENT - {% endblock %} -{% endblock %} ---DATA-- -return [] ---EXPECT-- -SUBSUBCONTENT diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/nested_blocks_parent_only.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/nested_blocks_parent_only.test deleted file mode 100644 index 20b7848f8d..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/nested_blocks_parent_only.test +++ /dev/null @@ -1,15 +0,0 @@ ---TEST-- -"block" tag ---TEMPLATE-- -{% block content %} - CONTENT - {%- block subcontent -%} - SUBCONTENT - {%- endblock -%} - ENDCONTENT -{% endblock %} ---TEMPLATE(foo.twig)-- ---DATA-- -return [] ---EXPECT-- -CONTENTSUBCONTENTENDCONTENT diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/nested_inheritance.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/nested_inheritance.test deleted file mode 100644 index 0b585b4809..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/nested_inheritance.test +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -"extends" tag ---TEMPLATE-- -{% extends "layout.twig" %} -{% block inside %}INSIDE{% endblock inside %} ---TEMPLATE(layout.twig)-- -{% extends "base.twig" %} -{% block body %} - {% block inside '' %} -{% endblock body %} ---TEMPLATE(base.twig)-- -{% block body '' %} ---DATA-- -return [] ---EXPECT-- -INSIDE diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent.test deleted file mode 100644 index 73f4c0ec5e..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent.test +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -"extends" tag ---TEMPLATE-- -{% extends "foo.twig" %} - -{% block content %}{{ parent() }}FOO{{ parent() }}{% endblock %} ---TEMPLATE(foo.twig)-- -{% block content %}BAR{% endblock %} ---DATA-- -return [] ---EXPECT-- -BARFOOBAR diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent_as_template_wrapper.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent_as_template_wrapper.test deleted file mode 100644 index 1aaed556c5..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent_as_template_wrapper.test +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -"extends" tag with a parent as a Twig_TemplateWrapper instance ---TEMPLATE-- -{% extends foo %} - -{% block content %}New{% endblock %} ---TEMPLATE(foo.twig)-- -{% block content %}Default{% endblock %} ---DATA-- -return ['foo' => $twig->load('foo.twig')] ---EXPECT-- -New diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent_change.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent_change.test deleted file mode 100644 index 01bd544f83..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent_change.test +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -"extends" tag ---TEMPLATE-- -{% extends foo ? 'foo.twig' : 'bar.twig' %} ---TEMPLATE(foo.twig)-- -FOO ---TEMPLATE(bar.twig)-- -BAR ---DATA-- -return ['foo' => true] ---EXPECT-- -FOO ---DATA-- -return ['foo' => false] ---EXPECT-- -BAR diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent_isolation.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent_isolation.test deleted file mode 100644 index 58a37bd902..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent_isolation.test +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -"extends" tag ---TEMPLATE-- -{% extends "base.twig" %} -{% block content %}{% include "included.twig" %}{% endblock %} - -{% block footer %}Footer{% endblock %} ---TEMPLATE(included.twig)-- -{% extends "base.twig" %} -{% block content %}Included Content{% endblock %} ---TEMPLATE(base.twig)-- -{% block content %}Default Content{% endblock %} - -{% block footer %}Default Footer{% endblock %} ---DATA-- -return [] ---EXPECT-- -Included Content -Default Footer -Footer diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent_nested.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent_nested.test deleted file mode 100644 index d4347bac4f..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent_nested.test +++ /dev/null @@ -1,28 +0,0 @@ ---TEST-- -"extends" tag ---TEMPLATE-- -{% extends "foo.twig" %} - -{% block content %} - {% block inside %} - INSIDE OVERRIDDEN - {% endblock %} - - BEFORE - {{ parent() }} - AFTER -{% endblock %} ---TEMPLATE(foo.twig)-- -{% block content %} - BAR -{% endblock %} ---DATA-- -return [] ---EXPECT-- - -INSIDE OVERRIDDEN - - BEFORE - BAR - - AFTER diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent_without_extends.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent_without_extends.test deleted file mode 100644 index 6d98891553..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent_without_extends.test +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -"parent" tag ---TEMPLATE-- -{% block content %} - {{ parent() }} -{% endblock %} ---EXCEPTION-- -Twig\Error\SyntaxError: Calling "parent" on a template that does not extend nor "use" another template is forbidden in "index.twig" at line 3. diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent_without_extends_but_traits.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent_without_extends_but_traits.test deleted file mode 100644 index 39882b8b39..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/parent_without_extends_but_traits.test +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -"parent" tag ---TEMPLATE-- -{% use 'foo.twig' %} - -{% block content %} - {{ parent() }} -{% endblock %} ---TEMPLATE(foo.twig)-- -{% block content %}BAR{% endblock %} ---DATA-- -return [] ---EXPECT-- -BAR diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/template_instance.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/template_instance.test deleted file mode 100644 index a5a223886d..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/template_instance.test +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -"extends" tag accepts Twig_Template instance ---TEMPLATE-- -{% extends foo %} - -{% block content %} -{{ parent() }}FOO -{% endblock %} ---TEMPLATE(foo.twig)-- -{% block content %}BAR{% endblock %} ---DATA-- -return ['foo' => $twig->load('foo.twig')] ---EXPECT-- -BARFOO diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/use.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/use.test deleted file mode 100644 index 4df32ee9d3..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/use.test +++ /dev/null @@ -1,44 +0,0 @@ ---TEST-- -"parent" function ---TEMPLATE-- -{% extends "parent.twig" %} - -{% use "use1.twig" %} -{% use "use2.twig" %} - -{% block content_parent %} - {{ parent() }} -{% endblock %} - -{% block content_use1 %} - {{ parent() }} -{% endblock %} - -{% block content_use2 %} - {{ parent() }} -{% endblock %} - -{% block content %} - {{ block('content_use1_only') }} - {{ block('content_use2_only') }} -{% endblock %} ---TEMPLATE(parent.twig)-- -{% block content_parent 'content_parent' %} -{% block content_use1 'content_parent' %} -{% block content_use2 'content_parent' %} -{% block content '' %} ---TEMPLATE(use1.twig)-- -{% block content_use1 'content_use1' %} -{% block content_use2 'content_use1' %} -{% block content_use1_only 'content_use1_only' %} ---TEMPLATE(use2.twig)-- -{% block content_use2 'content_use2' %} -{% block content_use2_only 'content_use2_only' %} ---DATA-- -return [] ---EXPECT-- - content_parent - content_use1 - content_use2 - content_use1_only - content_use2_only diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/basic.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/basic.test deleted file mode 100644 index ae090f9a06..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/basic.test +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -"macro" tag ---TEMPLATE-- -{% import _self as macros %} - -{{ macros.input('username') }} -{{ macros.input('password', null, 'password', 1) }} - -{% macro input(name, value, type, size) %} - <input type="{{ type|default("text") }}" name="{{ name }}" value="{{ value|e|default('') }}" size="{{ size|default(20) }}"> -{% endmacro %} ---DATA-- -return [] ---EXPECT-- - <input type="text" name="username" value="" size="20"> - - <input type="password" name="password" value="" size="1"> diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/endmacro_name.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/endmacro_name.test deleted file mode 100644 index 3f3caf7773..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/endmacro_name.test +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -"macro" tag supports name for endmacro ---TEMPLATE-- -{% import _self as macros %} - -{{ macros.foo() }} -{{ macros.bar() }} - -{% macro foo() %}foo{% endmacro %} -{% macro bar() %}bar{% endmacro bar %} ---DATA-- -return [] ---EXPECT-- -foo -bar - diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/external.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/external.test deleted file mode 100644 index b28ca19f02..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/external.test +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -"macro" tag ---TEMPLATE-- -{% import 'forms.twig' as forms %} - -{{ forms.input('username') }} -{{ forms.input('password', null, 'password', 1) }} ---TEMPLATE(forms.twig)-- -{% macro input(name, value, type, size) %} - <input type="{{ type|default("text") }}" name="{{ name }}" value="{{ value|e|default('') }}" size="{{ size|default(20) }}"> -{% endmacro %} ---DATA-- -return [] ---EXPECT-- - <input type="text" name="username" value="" size="20"> - - <input type="password" name="password" value="" size="1"> diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/from.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/from.test deleted file mode 100644 index 8b9aae8789..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/from.test +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -"macro" tag ---TEMPLATE-- -{% from 'forms.twig' import foo %} -{% from 'forms.twig' import foo as foobar, bar %} - -{{ foo('foo') }} -{{ foobar('foo') }} -{{ bar('foo') }} ---TEMPLATE(forms.twig)-- -{% macro foo(name) %}foo{{ name }}{% endmacro %} -{% macro bar(name) %}bar{{ name }}{% endmacro %} ---DATA-- -return [] ---EXPECT-- -foofoo -foofoo -barfoo diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/from_in_block_is_local.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/from_in_block_is_local.test deleted file mode 100644 index 0c89ce62a8..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/from_in_block_is_local.test +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -"macro" tag ---TEMPLATE-- -{% block foo %} - {%- from _self import input as linput %} -{% endblock %} - -{% block bar %} - {{- linput('username') }} -{% endblock %} - -{% macro input(name) -%} - <input name="{{ name }}"> -{% endmacro %} ---DATA-- -return [] ---EXCEPTION-- -Twig\Error\SyntaxError: Unknown "linput" function in "index.twig" at line 7. diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/from_local_override.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/from_local_override.test deleted file mode 100644 index 27bfbaee1f..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/from_local_override.test +++ /dev/null @@ -1,28 +0,0 @@ ---TEST-- -"macro" tag ---TEMPLATE-- -{%- from _self import input %} - -{% block foo %} - {%- from "macros" import input %} - {{- input('username') }} -{% endblock %} - -{% block bar %} - {{- input('username') }} -{% endblock %} - -{% macro input(name) -%} - <input name="{{ name }}"> -{% endmacro %} ---TEMPLATE(macros)-- -{% macro input(name) %} - <input name="{{ name }}" value="local"> -{% endmacro %} ---DATA-- -return [] ---EXPECT-- -<input name="username" value="local"> - - -<input name="username"> diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/from_macro_in_a_macro.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/from_macro_in_a_macro.test deleted file mode 100644 index 87ac25c310..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/from_macro_in_a_macro.test +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -"from" tag with syntax error ---TEMPLATE-- -{% from _self import another, foo %} - -{{ foo() }} - -{% macro foo() %} - {{ another() }} -{% endmacro %} - -{% macro another() %} - OK -{% endmacro %} ---DATA-- -return [] ---EXCEPTION-- -Twig\Error\SyntaxError: Unknown "another" function in "index.twig" at line 7. diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/from_nested_blocks.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/from_nested_blocks.test deleted file mode 100644 index 8ede5db509..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/from_nested_blocks.test +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -"macro" tag ---TEMPLATE-- -{% block foo %} - {%- from _self import input as linput %} - - {% block bar %} - {{- linput('username') }} - {% endblock %} -{% endblock %} - -{% macro input(name) -%} - <input name="{{ name }}"> -{% endmacro %} ---DATA-- -return [] ---EXCEPTION-- -Twig\Error\SyntaxError: Unknown "linput" function in "index.twig" at line 6. diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/from_nested_blocks_with_global_macro.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/from_nested_blocks_with_global_macro.test deleted file mode 100644 index f737bf0d8b..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/from_nested_blocks_with_global_macro.test +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -"macro" tag ---TEMPLATE-- -{%- from _self import input %} - -{% block foo %} - {% block bar %} - {{- input('username') }} - {% endblock %} -{% endblock %} - -{% macro input(name) -%} - <input name="{{ name }}"> -{% endmacro %} ---DATA-- -return [] ---EXCEPTION-- -Twig\Error\SyntaxError: Unknown "input" function in "index.twig" at line 6. diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/from_syntax_error.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/from_syntax_error.test deleted file mode 100644 index 6223cfe947..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/from_syntax_error.test +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -"from" tag with syntax error ---TEMPLATE-- -{% from 'forms.twig' %} ---DATA-- -return [] ---EXCEPTION-- -Twig\Error\SyntaxError: Unexpected token "end of statement block" ("name" expected with value "import") in "index.twig" at line 2. diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/from_with_reserved_name.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/from_with_reserved_name.test deleted file mode 100644 index 19adb9df4c..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/from_with_reserved_name.test +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -"from" tag with reserved name ---TEMPLATE-- -{% from 'forms.twig' import templateName %} ---DATA-- -return [] ---EXCEPTION-- -Twig\Error\SyntaxError: "templateName" cannot be an imported macro as it is a reserved keyword in "index.twig" at line 2. diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/global.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/global.test deleted file mode 100644 index 832740eac5..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/global.test +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -"macro" tag ---TEMPLATE-- -{% from 'forms.twig' import foo %} - -{{ foo('foo') }} -{{ foo() }} ---TEMPLATE(forms.twig)-- -{% macro foo(name) %}{{ name|default('foo') }}{{ global }}{% endmacro %} ---DATA-- -return [] ---EXPECT-- -fooglobal -fooglobal diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/import_and_blocks.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/import_and_blocks.test deleted file mode 100644 index 721f5506a5..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/import_and_blocks.test +++ /dev/null @@ -1,36 +0,0 @@ ---TEST-- -"macro" tag ---TEMPLATE-- -{% import _self as macros %} -{% from _self import input %} - -{% block foo %} - {{- macros.input('username') }} - {{- input('username') }} - - {%- import _self as lmacros %} - {%- from _self import input as linput %} - - {{- lmacros.input('username') }} - {{- linput('username') }} -{% endblock %} - -{% block bar %} - {{- macros.input('username') }} - {{- input('username') }} -{% endblock %} - -{% macro input(name) -%} - <input name="{{ name }}"> -{% endmacro %} ---DATA-- -return [] ---EXPECT-- -<input name="username"> -<input name="username"> -<input name="username"> -<input name="username"> - - -<input name="username"> -<input name="username"> diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/import_from_string_template.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/import_from_string_template.test deleted file mode 100644 index 6c1817be7d..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/import_from_string_template.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"import" tag with a template as string ---TEMPLATE-- -{% import template_from_string("{% macro test() %}ok{% endmacro %}") as m %} -{{ m.test() }} ---TEMPLATE(forms.twig)-- ---DATA-- -return [] ---EXPECT-- -ok diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/import_in_block_is_local.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/import_in_block_is_local.test deleted file mode 100644 index 9443e12221..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/import_in_block_is_local.test +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -"macro" tag ---TEMPLATE-- -{% block foo %} - {%- import _self as lmacros %} -{% endblock %} - -{% block bar %} - {{- lmacros.input('username') }} -{% endblock %} - -{% macro input(name) -%} - <input name="{{ name }}"> -{% endmacro %} ---DATA-- -return [] ---EXCEPTION-- -Twig\Error\RuntimeError: Variable "lmacros" does not exist in "index.twig" at line 7. diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/import_local_override.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/import_local_override.test deleted file mode 100644 index 7cf0552f83..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/import_local_override.test +++ /dev/null @@ -1,28 +0,0 @@ ---TEST-- -"macro" tag ---TEMPLATE-- -{%- import _self as macros %} - -{% block foo %} - {%- import "macros" as macros %} - {{- macros.input('username') }} -{% endblock %} - -{% block bar %} - {{- macros.input('username') }} -{% endblock %} - -{% macro input(name) -%} - <input name="{{ name }}"> -{% endmacro %} ---TEMPLATE(macros)-- -{% macro input(name) %} - <input name="{{ name }}" value="local"> -{% endmacro %} ---DATA-- -return [] ---EXPECT-- -<input name="username" value="local"> - - -<input name="username"> diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/import_macro_in_a_macro.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/import_macro_in_a_macro.test deleted file mode 100644 index d224482e19..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/import_macro_in_a_macro.test +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -"import" tag with syntax error ---TEMPLATE-- -{% import _self as foo %} - -{{ foo.foo() }} - -{% macro foo() %} - {{ foo.another() }} -{% endmacro %} - -{% macro another() %} - OK -{% endmacro %} ---DATA-- -return [] ---EXCEPTION-- -Twig\Error\RuntimeError: Variable "foo" does not exist in "index.twig" at line 7. diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/import_nested_blocks.legacy.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/import_nested_blocks.legacy.test deleted file mode 100644 index e822c7ff48..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/import_nested_blocks.legacy.test +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -"macro" tag ---TEMPLATE-- -{% block foo %} - {%- import _self as lmacros %} - - {% block bar %} - {{- lmacros.input('username') }} - {% endblock %} -{% endblock %} - -{% macro input(name) -%} - <input name="{{ name }}"> -{% endmacro %} ---DATA-- -return [] ---EXPECT-- -<input name="username"> diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/import_nested_blocks_with_global_macro.legacy.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/import_nested_blocks_with_global_macro.legacy.test deleted file mode 100644 index 697d665f84..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/import_nested_blocks_with_global_macro.legacy.test +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -"macro" tag ---TEMPLATE-- -{%- import _self as macros %} - -{% block foo %} - {% block bar %} - {{- macros.input('username') }} - {% endblock %} -{% endblock %} - -{% macro input(name) -%} - <input name="{{ name }}"> -{% endmacro %} ---DATA-- -return [] ---EXPECT-- -<input name="username"> diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/import_self_parent.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/import_self_parent.test deleted file mode 100644 index 24a8cdb50b..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/import_self_parent.test +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -"macro" tag ---TEMPLATE-- -{% extends "parent" %} -{% import _self as me %} - -{% block test %} - {{ me.hello() }} -{% endblock test %} ---TEMPLATE(parent)-- -{% import _self as me %} - -{% block test %} -Hello -{% endblock test %} - -{% macro hello() %} - Test -{% endmacro %} ---DATA-- -return [] ---EXPECT-- -Test diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/import_syntax_error.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/import_syntax_error.test deleted file mode 100644 index b9817f0eed..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/import_syntax_error.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"import" tag with reserved name ---TEMPLATE-- -{% import 'forms.twig' %} - -{{ macros.parent() }} ---DATA-- -return [] ---EXCEPTION-- -Twig\Error\SyntaxError: Unexpected token "end of statement block" ("name" expected with value "as") in "index.twig" at line 2. diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/import_with_reserved_name.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/import_with_reserved_name.test deleted file mode 100644 index 34b8d43a25..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/import_with_reserved_name.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"from" tag with reserved name ---TEMPLATE-- -{% import 'forms.twig' as macros %} - -{{ macros.parent() }} ---DATA-- -return [] ---EXCEPTION-- -Twig\Error\SyntaxError: "parent" cannot be called as macro as it is a reserved keyword in "index.twig" at line 4. diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/reserved_name.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/reserved_name.test deleted file mode 100644 index e58dd7cacc..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/reserved_name.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"macro" tag with reserved name ---TEMPLATE-- -{% macro parent(arg1, arg2) %} - parent -{% endmacro %} ---DATA-- -return [] ---EXCEPTION-- -Twig\Error\SyntaxError: "parent" cannot be used as a macro name as it is a reserved keyword in "index.twig" at line 2. diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/self_import.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/self_import.test deleted file mode 100644 index ca3157dd88..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/self_import.test +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -"macro" tag ---TEMPLATE-- -{% import _self as forms %} - -{{ forms.input('username') }} -{{ forms.input('password', null, 'password', 1) }} - -{% macro input(name, value, type, size) %} - <input type="{{ type|default("text") }}" name="{{ name }}" value="{{ value|e|default('') }}" size="{{ size|default(20) }}"> -{% endmacro %} ---DATA-- -return [] ---EXPECT-- - <input type="text" name="username" value="" size="20"> - - <input type="password" name="password" value="" size="1"> diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/special_chars.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/special_chars.test deleted file mode 100644 index 491e91e80d..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/special_chars.test +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -"§" as a macro name ---TEMPLATE-- -{% import _self as macros %} - -{{ macros.§('foo') }} - -{% macro §(foo) %} - §{{ foo }}§ -{% endmacro %} ---DATA-- -return [] ---EXPECT-- -§foo§ diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/super_globals.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/super_globals.test deleted file mode 100644 index 643697ce28..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/super_globals.test +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -Super globals as macro arguments ---TEMPLATE-- -{% import _self as macros %} - -{{ macros.foo('foo') }} - -{% macro foo(GET) %} - {{ GET }} -{% endmacro %} ---DATA-- -return [] ---EXPECT-- -foo diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/raw/basic.legacy.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/raw/basic.legacy.test deleted file mode 100644 index 7875b2af72..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/raw/basic.legacy.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"raw" tag ---TEMPLATE-- -{% raw %} -{{ foo }} -{% endraw %} ---DATA-- -return [] ---EXPECT-- -{{ foo }} diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/raw/mixed_usage_with_raw.legacy.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/raw/mixed_usage_with_raw.legacy.test deleted file mode 100644 index d4c8dd2cd1..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/raw/mixed_usage_with_raw.legacy.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"raw" tag ---TEMPLATE-- -{% raw %} -{{ foo }} -{% endverbatim %} ---DATA-- -return [] ---EXCEPTION-- -Twig\Error\SyntaxError: Unexpected end of file: Unclosed "raw" block in "index.twig" at line 2. diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/raw/whitespace_control.legacy.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/raw/whitespace_control.legacy.test deleted file mode 100644 index 11f42025e1..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/raw/whitespace_control.legacy.test +++ /dev/null @@ -1,56 +0,0 @@ ---TEST-- -"raw" tag ---TEMPLATE-- -1*** - -{%- raw %} - {{ 'bla' }} -{% endraw %} - -1*** -2*** - -{%- raw -%} - {{ 'bla' }} -{% endraw %} - -2*** -3*** - -{%- raw -%} - {{ 'bla' }} -{% endraw -%} - -3*** -4*** - -{%- raw -%} - {{ 'bla' }} -{%- endraw %} - -4*** -5*** - -{%- raw -%} - {{ 'bla' }} -{%- endraw -%} - -5*** ---DATA-- -return [] ---EXPECT-- -1*** - {{ 'bla' }} - - -1*** -2***{{ 'bla' }} - - -2*** -3***{{ 'bla' }} -3*** -4***{{ 'bla' }} - -4*** -5***{{ 'bla' }}5*** diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/sandbox/array.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/sandbox/array.test deleted file mode 100644 index b432427e4a..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/sandbox/array.test +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -sandbox tag ---TEMPLATE-- -{%- sandbox %} - {%- include "foo.twig" %} -{%- endsandbox %} ---TEMPLATE(foo.twig)-- -{{ [a][0] }} -{{ dump([a][0]) }} ---DATA-- -return ['a' => 'b'] ---CONFIG-- -return ['autoescape' => false, 'debug' => true] ---EXPECT-- -b -string(1) "b" diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/sandbox/not_valid1.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/sandbox/not_valid1.test deleted file mode 100644 index e26a78bc15..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/sandbox/not_valid1.test +++ /dev/null @@ -1,11 +0,0 @@ ---TEST-- -sandbox tag ---TEMPLATE-- -{%- sandbox %} - {%- include "foo.twig" %} - a -{%- endsandbox %} ---TEMPLATE(foo.twig)-- -foo ---EXCEPTION-- -Twig\Error\SyntaxError: Only "include" tags are allowed within a "sandbox" section in "index.twig" at line 4. diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/sandbox/not_valid2.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/sandbox/not_valid2.test deleted file mode 100644 index bb2a329715..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/sandbox/not_valid2.test +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -sandbox tag ---TEMPLATE-- -{%- sandbox %} - {%- include "foo.twig" %} - - {% if 1 %} - {%- include "foo.twig" %} - {% endif %} -{%- endsandbox %} ---TEMPLATE(foo.twig)-- -foo ---EXCEPTION-- -Twig\Error\SyntaxError: Only "include" tags are allowed within a "sandbox" section in "index.twig" at line 5. diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/sandbox/simple.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/sandbox/simple.test deleted file mode 100644 index 4d232d8bbd..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/sandbox/simple.test +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -sandbox tag ---TEMPLATE-- -{%- sandbox %} - {%- include "foo.twig" %} -{%- endsandbox %} - -{%- sandbox %} - {%- include "foo.twig" %} - {%- include "foo.twig" %} -{%- endsandbox %} - -{%- sandbox %}{% include "foo.twig" %}{% endsandbox %} ---TEMPLATE(foo.twig)-- -foo ---DATA-- -return [] ---EXPECT-- -foo -foo -foo -foo diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/set/basic.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/set/basic.test deleted file mode 100644 index aae1427e81..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/set/basic.test +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -"set" tag ---TEMPLATE-- -{% set foo = 'foo' %} -{% set bar = 'foo<br />' %} - -{{ foo }} -{{ bar }} - -{% set foo, bar = 'foo', 'bar' %} - -{{ foo }}{{ bar }} ---DATA-- -return [] ---EXPECT-- -foo -foo<br /> - - -foobar diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/set/capture-empty.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/set/capture-empty.test deleted file mode 100644 index 97fc43cc2a..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/set/capture-empty.test +++ /dev/null @@ -1,9 +0,0 @@ ---TEST-- -"set" tag block empty capture ---TEMPLATE-- -{% set foo %}{% endset %} - -{% if foo %}FAIL{% endif %} ---DATA-- -return [] ---EXPECT-- diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/set/capture.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/set/capture.test deleted file mode 100644 index c3faf25003..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/set/capture.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"set" tag block capture ---TEMPLATE-- -{% set foo %}f<br />o<br />o{% endset %} - -{{ foo }} ---DATA-- -return [] ---EXPECT-- -f<br />o<br />o diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/set/capture_scope.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/set/capture_scope.test deleted file mode 100644 index bb2bbebaf0..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/set/capture_scope.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"set" tag block capture ---TEMPLATE-- -{% set foo %}{{ foo }}{% endset %} - -{{ foo }} ---DATA-- -return ['foo' => 'foo'] ---EXPECT-- -foo diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/set/expression.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/set/expression.test deleted file mode 100644 index bd472771a6..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/set/expression.test +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -"set" tag ---TEMPLATE-- -{% set foo, bar = 'foo' ~ 'bar', 'bar' ~ 'foo' %} - -{{ foo }} -{{ bar }} ---DATA-- -return [] ---EXPECT-- -foobar -barfoo diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/set/inheritance.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/set/inheritance.test deleted file mode 100644 index 79e89ce79b..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/set/inheritance.test +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -"set" tag with inheritance ---TEMPLATE-- -{% extends "layout.twig" %} - -{% set bar %}bar{% endset %} - -{% block var_from_child %} - {{- bar -}} -{% endblock %} ---TEMPLATE(layout.twig)-- -{% set foo %}foo{% endset %} - -{% block var_from_layout %} - {{- foo -}} -{% endblock %} - -{% block var_from_child %} -{% endblock %} ---DATA-- -return [] ---EXPECT-- -foo -bar diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/set/inheritance_overriding.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/set/inheritance_overriding.test deleted file mode 100644 index 2d23c83ae6..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/set/inheritance_overriding.test +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -"set" tag with inheritance ---TEMPLATE-- -{% extends "layout.twig" %} - -{% set foo %}bar{% endset %} - -{% block var_from_child %} - {{- foo -}} -{% endblock %} ---TEMPLATE(layout.twig)-- -{% set foo %}foo{% endset %} - -{% block var_from_layout %} - {{- foo -}} -{% endblock %} - -{% block var_from_child %} -{% endblock %} ---DATA-- -return [] ---EXPECT-- -foo -foo diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/set/mutating.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/set/mutating.test deleted file mode 100644 index ae388bb873..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/set/mutating.test +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -"set" tag ---TEMPLATE-- -{% set foo = "foo" %} - -{% set bar %} - {%- set foo = "bar" -%} - bar -{% endset %} - -{{ foo }} -{{ bar }} ---DATA-- -return [] ---EXPECT-- -bar -bar diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/spaceless/simple.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/spaceless/simple.test deleted file mode 100644 index 98bd27a13a..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/spaceless/simple.test +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -"spaceless" tag removes whites between HTML tags ---TEMPLATE-- -{% spaceless %} - - <div> <div> foo </div> </div> - -{% endspaceless %} ---DATA-- -return [] ---EXPECT-- -<div><div> foo </div></div> diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/special_chars.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/special_chars.test deleted file mode 100644 index 64ffd1d76b..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/special_chars.test +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -"§" custom tag ---TEMPLATE-- -{% § %} ---DATA-- -return [] ---EXPECT-- -§ diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/aliases.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/aliases.test deleted file mode 100644 index b6b1d5c668..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/aliases.test +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -"use" tag ---TEMPLATE-- -{% use "blocks.twig" with content as foo %} - -{{ block('foo') }} ---TEMPLATE(blocks.twig)-- -{% block content 'foo' %} ---DATA-- -return [] ---EXPECT-- -foo diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/basic.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/basic.test deleted file mode 100644 index be622a10e2..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/basic.test +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -"use" tag ---TEMPLATE-- -{% use "blocks.twig" %} - -{{ block('content') }} ---TEMPLATE(blocks.twig)-- -{% block content 'foo' %} ---DATA-- -return [] ---EXPECT-- -foo diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/deep.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/deep.test deleted file mode 100644 index 771ba642b9..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/deep.test +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -"use" tag ---TEMPLATE-- -{% use "foo.twig" %} - -{{ block('content') }} -{{ block('foo') }} -{{ block('bar') }} ---TEMPLATE(foo.twig)-- -{% use "bar.twig" %} - -{% block content 'foo' %} -{% block foo 'foo' %} ---TEMPLATE(bar.twig)-- -{% block content 'bar' %} -{% block bar 'bar' %} ---DATA-- -return [] ---EXPECT-- -foo -foo -bar diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/deep_empty.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/deep_empty.test deleted file mode 100644 index f14ce83de5..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/deep_empty.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"use" tag ---TEMPLATE-- -{% use "foo.twig" %} ---TEMPLATE(foo.twig)-- -{% use "bar.twig" %} ---TEMPLATE(bar.twig)-- ---DATA-- -return [] ---EXPECT-- diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/inheritance.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/inheritance.test deleted file mode 100644 index 1edeaa1115..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/inheritance.test +++ /dev/null @@ -1,25 +0,0 @@ ---TEST-- -"use" tag ---TEMPLATE-- -{% use "parent.twig" %} - -{{ block('container') }} ---TEMPLATE(parent.twig)-- -{% use "ancestor.twig" %} - -{% block sub_container %} - <div class="overridden_sub_container">overridden sub_container</div> -{% endblock %} ---TEMPLATE(ancestor.twig)-- -{% block container %} - <div class="container">{{ block('sub_container') }}</div> -{% endblock %} - -{% block sub_container %} - <div class="sub_container">sub_container</div> -{% endblock %} ---DATA-- -return [] ---EXPECT-- -<div class="container"> <div class="overridden_sub_container">overridden sub_container</div> -</div> diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/inheritance2.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/inheritance2.test deleted file mode 100644 index accec5094b..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/inheritance2.test +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -"use" tag ---TEMPLATE-- -{% use "ancestor.twig" %} -{% use "parent.twig" %} - -{{ block('container') }} ---TEMPLATE(parent.twig)-- -{% block sub_container %} - <div class="overridden_sub_container">overridden sub_container</div> -{% endblock %} ---TEMPLATE(ancestor.twig)-- -{% block container %} - <div class="container">{{ block('sub_container') }}</div> -{% endblock %} - -{% block sub_container %} - <div class="sub_container">sub_container</div> -{% endblock %} ---DATA-- -return [] ---EXPECT-- -<div class="container"> <div class="overridden_sub_container">overridden sub_container</div> -</div> diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/multiple.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/multiple.test deleted file mode 100644 index 85a63958df..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/multiple.test +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -"use" tag ---TEMPLATE-- -{% use "foo.twig" %} -{% use "bar.twig" %} - -{{ block('content') }} -{{ block('foo') }} -{{ block('bar') }} ---TEMPLATE(foo.twig)-- -{% block content 'foo' %} -{% block foo 'foo' %} ---TEMPLATE(bar.twig)-- -{% block content 'bar' %} -{% block bar 'bar' %} ---DATA-- -return [] ---EXPECT-- -bar -foo -bar diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/multiple_aliases.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/multiple_aliases.test deleted file mode 100644 index 413bdfa4dd..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/multiple_aliases.test +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -"use" tag ---TEMPLATE-- -{% use "foo.twig" with content as foo_content %} -{% use "bar.twig" %} - -{{ block('content') }} -{{ block('foo') }} -{{ block('bar') }} -{{ block('foo_content') }} ---TEMPLATE(foo.twig)-- -{% block content 'foo' %} -{% block foo 'foo' %} ---TEMPLATE(bar.twig)-- -{% block content 'bar' %} -{% block bar 'bar' %} ---DATA-- -return [] ---EXPECT-- -bar -foo -bar -foo diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/parent_block.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/parent_block.test deleted file mode 100644 index 49328f6e87..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/parent_block.test +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -"use" tag ---TEMPLATE-- -{% use 'file2.html.twig' with foobar as base_base_foobar %} -{% block foobar %} - {{- block('base_base_foobar') -}} - Content of block (second override) -{% endblock foobar %} ---TEMPLATE(file2.html.twig)-- -{% use 'file1.html.twig' with foobar as base_foobar %} -{% block foobar %} - {{- block('base_foobar') -}} - Content of block (first override) -{% endblock foobar %} ---TEMPLATE(file1.html.twig)-- -{% block foobar -%} - Content of block -{% endblock foobar %} ---DATA-- -return [] ---EXPECT-- -Content of block -Content of block (first override) -Content of block (second override) diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/parent_block2.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/parent_block2.test deleted file mode 100644 index 274baa8216..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/parent_block2.test +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -"use" tag ---TEMPLATE-- -{% use 'file2.html.twig'%} -{% block foobar %} - {{- parent() -}} - Content of block (second override) -{% endblock foobar %} ---TEMPLATE(file2.html.twig)-- -{% use 'file1.html.twig' %} -{% block foobar %} - {{- parent() -}} - Content of block (first override) -{% endblock foobar %} ---TEMPLATE(file1.html.twig)-- -{% block foobar -%} - Content of block -{% endblock foobar %} ---DATA-- -return [] ---EXPECT-- -Content of block -Content of block (first override) -Content of block (second override) diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/parent_block3.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/parent_block3.test deleted file mode 100644 index f6f221273f..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/parent_block3.test +++ /dev/null @@ -1,38 +0,0 @@ ---TEST-- -"use" tag ---TEMPLATE-- -{% use 'file2.html.twig' %} -{% use 'file1.html.twig' with foo %} -{% block foo %} - {{- parent() -}} - Content of foo (second override) -{% endblock foo %} -{% block bar %} - {{- parent() -}} - Content of bar (second override) -{% endblock bar %} ---TEMPLATE(file2.html.twig)-- -{% use 'file1.html.twig' %} -{% block foo %} - {{- parent() -}} - Content of foo (first override) -{% endblock foo %} -{% block bar %} - {{- parent() -}} - Content of bar (first override) -{% endblock bar %} ---TEMPLATE(file1.html.twig)-- -{% block foo -%} - Content of foo -{% endblock foo %} -{% block bar -%} - Content of bar -{% endblock bar %} ---DATA-- -return [] ---EXPECT-- -Content of foo -Content of foo (first override) -Content of foo (second override) -Content of bar -Content of bar (second override) diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/use_with_parent.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/use_with_parent.test deleted file mode 100644 index fad9a2d189..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/use_with_parent.test +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -"use" tag with a parent block ---TEMPLATE-- -{% extends "parent.twig" %} - -{% use 'blocks.twig' %} - -{% block body %} - {{ parent() -}} - CHILD - {{ block('content') }} -{% endblock %} ---TEMPLATE(parent.twig)-- -{% block body %} - PARENT -{% endblock %} ---TEMPLATE(blocks.twig)-- -{% block content 'BLOCK' %} ---DATA-- -return [] ---EXPECT-- -PARENT -CHILD - BLOCK diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/verbatim/basic.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/verbatim/basic.test deleted file mode 100644 index 9b60abc49f..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/verbatim/basic.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"verbatim" tag ---TEMPLATE-- -{% verbatim %} -{{ foo }} -{% endverbatim %} ---DATA-- -return [] ---EXPECT-- -{{ foo }} diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/verbatim/mixed_usage_with_raw.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/verbatim/mixed_usage_with_raw.test deleted file mode 100644 index 2177538d51..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/verbatim/mixed_usage_with_raw.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"verbatim" tag ---TEMPLATE-- -{% verbatim %} -{{ foo }} -{% endraw %} ---DATA-- -return [] ---EXCEPTION-- -Twig\Error\SyntaxError: Unexpected end of file: Unclosed "verbatim" block in "index.twig" at line 2. diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/verbatim/whitespace_control.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/verbatim/whitespace_control.test deleted file mode 100644 index 501922bddd..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/verbatim/whitespace_control.test +++ /dev/null @@ -1,56 +0,0 @@ ---TEST-- -"verbatim" tag ---TEMPLATE-- -1*** - -{%- verbatim %} - {{ 'bla' }} -{% endverbatim %} - -1*** -2*** - -{%- verbatim -%} - {{ 'bla' }} -{% endverbatim %} - -2*** -3*** - -{%- verbatim -%} - {{ 'bla' }} -{% endverbatim -%} - -3*** -4*** - -{%- verbatim -%} - {{ 'bla' }} -{%- endverbatim %} - -4*** -5*** - -{%- verbatim -%} - {{ 'bla' }} -{%- endverbatim -%} - -5*** ---DATA-- -return [] ---EXPECT-- -1*** - {{ 'bla' }} - - -1*** -2***{{ 'bla' }} - - -2*** -3***{{ 'bla' }} -3*** -4***{{ 'bla' }} - -4*** -5***{{ 'bla' }}5*** diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/with/basic.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/with/basic.test deleted file mode 100644 index 7c2abd0f9b..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/with/basic.test +++ /dev/null @@ -1,13 +0,0 @@ ---TEST-- -"with" tag ---TEMPLATE-- -{% with %} - {% set bar = 'BAZ' %} - {{ foo }}{{ bar }} -{% endwith %} -{{ foo }}{{ bar }} ---DATA-- -return ['foo' => 'foo', 'bar' => 'bar'] ---EXPECT-- -fooBAZ -foobar diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/with/expression.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/with/expression.test deleted file mode 100644 index e4433d44c8..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/with/expression.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"with" tag with expression ---TEMPLATE-- -{% with {foo: 'foo', bar: 'BAZ'} %} - {{ foo }}{{ bar }} -{% endwith %} ---DATA-- -return ['foo' => 'baz'] ---EXPECT-- -fooBAZ diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/with/globals.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/with/globals.test deleted file mode 100644 index b030e7eff3..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/with/globals.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"with" tag ---TEMPLATE-- -{% with [] only %} - {{ global }} -{% endwith %} ---DATA-- -return [] ---EXPECT-- -global diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/with/iterable.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/with/iterable.test deleted file mode 100644 index 1b0cbc63e5..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/with/iterable.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"with" tag with an iterable expression ---TEMPLATE-- -{% with vars %} - {{ foo }}{{ bar }} -{% endwith %} ---DATA-- -return ['vars' => new ArrayObject(['foo' => 'baz', 'bar' => 'qux'])] ---EXPECT-- -bazqux diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/with/nested.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/with/nested.test deleted file mode 100644 index 33ca390b2a..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/with/nested.test +++ /dev/null @@ -1,15 +0,0 @@ ---TEST-- -nested "with" tags ---TEMPLATE-- -{% set foo, bar = 'foo', 'bar' %} -{% with {bar: 'BAZ'} %} - {% with {foo: 'FOO'} %} - {{ foo }}{{ bar }} - {% endwith %} -{% endwith %} -{{ foo }}{{ bar }} ---DATA-- -return [] ---EXPECT-- -FOOBAZ - foobar diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/with/with_no_hash.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/with/with_no_hash.test deleted file mode 100644 index 7083050b42..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/with/with_no_hash.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"with" tag with an expression that is not a hash ---TEMPLATE-- -{% with vars %} - {{ foo }}{{ bar }} -{% endwith %} ---DATA-- -return ['vars' => 'no-hash'] ---EXCEPTION-- -Twig\Error\RuntimeError: Variables passed to the "with" tag must be a hash in "index.twig" at line 2. diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/with/with_only.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/with/with_only.test deleted file mode 100644 index 1aca34fc15..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/with/with_only.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"with" tag with expression and only ---TEMPLATE-- -{% with {foo: 'foo', bar: 'BAZ'} only %} - {{ foo }}{{ bar }}{{ baz }} -{% endwith %} ---DATA-- -return ['foo' => 'baz', 'baz' => 'baz'] ---EXCEPTION-- -Twig\Error\RuntimeError: Variable "baz" does not exist in "index.twig" at line 3. diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/array.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/array.test deleted file mode 100644 index 7c9a6c80aa..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/array.test +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -array index test ---TEMPLATE-- -{% for key, value in days %} -{{ key }} -{% endfor %} ---DATA-- -return ['days' => [ - 1 => ['money' => 9], - 2 => ['money' => 21], - 3 => ['money' => 38], - 4 => ['money' => 6], - 18 => ['money' => 6], - 19 => ['money' => 3], - 31 => ['money' => 11], -]] ---EXPECT-- -1 -2 -3 -4 -18 -19 -31 diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/constant.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/constant.test deleted file mode 100644 index 0fa4b37040..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/constant.test +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -"const" test ---TEMPLATE-- -{{ 8 is constant('E_NOTICE') ? 'ok' : 'no' }} -{{ 'bar' is constant('TwigTestFoo::BAR_NAME') ? 'ok' : 'no' }} -{{ value is constant('TwigTestFoo::BAR_NAME') ? 'ok' : 'no' }} -{{ 2 is constant('ARRAY_AS_PROPS', object) ? 'ok' : 'no' }} ---DATA-- -return ['value' => 'bar', 'object' => new \ArrayObject(['hi'])] ---EXPECT-- -ok -ok -ok -ok \ No newline at end of file diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/defined.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/defined.test deleted file mode 100644 index 879c651e15..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/defined.test +++ /dev/null @@ -1,129 +0,0 @@ ---TEST-- -"defined" test ---TEMPLATE-- -{{ definedVar is defined ? 'ok' : 'ko' }} -{{ definedVar is not defined ? 'ko' : 'ok' }} -{{ undefinedVar is defined ? 'ko' : 'ok' }} -{{ undefinedVar is not defined ? 'ok' : 'ko' }} -{{ zeroVar is defined ? 'ok' : 'ko' }} -{{ nullVar is defined ? 'ok' : 'ko' }} -{{ nested.definedVar is defined ? 'ok' : 'ko' }} -{{ nested['definedVar'] is defined ? 'ok' : 'ko' }} -{{ nested.definedVar is not defined ? 'ko' : 'ok' }} -{{ nested.undefinedVar is defined ? 'ko' : 'ok' }} -{{ nested['undefinedVar'] is defined ? 'ko' : 'ok' }} -{{ nested.undefinedVar is not defined ? 'ok' : 'ko' }} -{{ nested.zeroVar is defined ? 'ok' : 'ko' }} -{{ nested.nullVar is defined ? 'ok' : 'ko' }} -{{ nested.definedArray.0 is defined ? 'ok' : 'ko' }} -{{ nested['definedArray'][0] is defined ? 'ok' : 'ko' }} -{{ object.foo is defined ? 'ok' : 'ko' }} -{{ object.undefinedMethod is defined ? 'ko' : 'ok' }} -{{ object.getFoo() is defined ? 'ok' : 'ko' }} -{{ object.getFoo('a') is defined ? 'ok' : 'ko' }} -{{ object.undefinedMethod() is defined ? 'ko' : 'ok' }} -{{ object.undefinedMethod('a') is defined ? 'ko' : 'ok' }} -{{ object.self.foo is defined ? 'ok' : 'ko' }} -{{ object.self.undefinedMethod is defined ? 'ko' : 'ok' }} -{{ object.undefinedMethod.self is defined ? 'ko' : 'ok' }} -{{ 0 is defined ? 'ok' : 'ko' }} -{{ "foo" is defined ? 'ok' : 'ko' }} -{{ true is defined ? 'ok' : 'ko' }} -{{ false is defined ? 'ok' : 'ko' }} -{{ null is defined ? 'ok' : 'ko' }} -{{ [1, 2] is defined ? 'ok' : 'ko' }} -{{ { foo: "bar" } is defined ? 'ok' : 'ko' }} ---DATA-- -return [ - 'definedVar' => 'defined', - 'zeroVar' => 0, - 'nullVar' => null, - 'nested' => [ - 'definedVar' => 'defined', - 'zeroVar' => 0, - 'nullVar' => null, - 'definedArray' => [0], - ], - 'object' => new TwigTestFoo(), -] ---EXPECT-- -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok ---DATA-- -return [ - 'definedVar' => 'defined', - 'zeroVar' => 0, - 'nullVar' => null, - 'nested' => [ - 'definedVar' => 'defined', - 'zeroVar' => 0, - 'nullVar' => null, - 'definedArray' => [0], - ], - 'object' => new TwigTestFoo(), -] ---CONFIG-- -return ['strict_variables' => false] ---EXPECT-- -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/defined_for_attribute.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/defined_for_attribute.test deleted file mode 100644 index 5fd2fe3f2d..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/defined_for_attribute.test +++ /dev/null @@ -1,35 +0,0 @@ ---TEST-- -"defined" support for attribute ---TEMPLATE-- -{{ attribute(nested, "definedVar") is defined ? 'ok' : 'ko' }} -{{ attribute(nested, "undefinedVar") is not defined ? 'ok' : 'ko' }} -{{ attribute(nested, definedVarName) is defined ? 'ok' : 'ko' }} -{{ attribute(nested, undefinedVarName) is not defined ? 'ok' : 'ko' }} ---DATA-- -return [ - 'nested' => [ - 'definedVar' => 'defined', - ], - 'definedVarName' => 'definedVar', - 'undefinedVarName' => 'undefinedVar', -] ---EXPECT-- -ok -ok -ok -ok ---DATA-- -return [ - 'nested' => [ - 'definedVar' => 'defined', - ], - 'definedVarName' => 'definedVar', - 'undefinedVarName' => 'undefinedVar', -] ---CONFIG-- -return ['strict_variables' => false] ---EXPECT-- -ok -ok -ok -ok diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/defined_for_blocks.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/defined_for_blocks.test deleted file mode 100644 index c8b90f8c9c..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/defined_for_blocks.test +++ /dev/null @@ -1,38 +0,0 @@ ---TEST-- -"defined" support for blocks ---TEMPLATE-- -{% extends 'parent' %} -{% block icon %}icon{% endblock %} -{% block body %} - {{ parent() }} - {{ block('foo') is defined ? 'ok' : 'ko' }} - {{ block('footer') is defined ? 'ok' : 'ko' }} - {{ block('icon') is defined ? 'ok' : 'ko' }} - {{ block('block1') is defined ? 'ok' : 'ko' }} - {%- embed 'embed' %} - {% block content %}content{% endblock %} - {% endembed %} -{% endblock %} -{% use 'blocks' %} ---TEMPLATE(parent)-- -{% block body %} - {{ block('icon') is defined ? 'ok' : 'ko' -}} -{% endblock %} -{% block footer %}{% endblock %} ---TEMPLATE(embed)-- -{{ block('icon') is defined ? 'ok' : 'ko' }} -{{ block('content') is defined ? 'ok' : 'ko' }} -{{ block('block1') is defined ? 'ok' : 'ko' }} ---TEMPLATE(blocks)-- -{% block block1 %}{%endblock %} ---DATA-- -return [] ---EXPECT-- -ok - ko - ok - ok - ok -ko -ok -ko diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/defined_for_blocks_with_template.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/defined_for_blocks_with_template.test deleted file mode 100644 index 68540de7aa..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/defined_for_blocks_with_template.test +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -"defined" support for blocks with a template argument ---TEMPLATE-- -{{ block('foo', 'included.twig') is defined ? 'ok' : 'ko' }} -{{ block('foo', included_loaded) is defined ? 'ok' : 'ko' }} -{{ block('foo', included_loaded_internal) is defined ? 'ok' : 'ko' }} ---TEMPLATE(included.twig)-- -{% block foo %}FOO{% endblock %} ---DATA-- -return [ - 'included_loaded' => $twig->load('included.twig'), - 'included_loaded_internal' => $twig->load('included.twig'), -] ---EXPECT-- -ok -ok -ok diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/defined_for_constants.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/defined_for_constants.test deleted file mode 100644 index 62172e4f1f..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/defined_for_constants.test +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -"defined" support for constants ---TEMPLATE-- -{{ constant('DATE_W3C') is defined ? 'ok' : 'ko' }} -{{ constant('ARRAY_AS_PROPS', object) is defined ? 'ok' : 'ko' }} -{{ constant('FOOBAR') is not defined ? 'ok' : 'ko' }} -{{ constant('FOOBAR', object) is not defined ? 'ok' : 'ko' }} ---DATA-- -return ['expect' => DATE_W3C, 'object' => new \ArrayObject(['hi'])] ---EXPECT-- -ok -ok -ok -ok diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/defined_on_complex_expr.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/defined_on_complex_expr.test deleted file mode 100644 index 2d0615832f..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/defined_on_complex_expr.test +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -"defined" support for "complex" expressions ---TEMPLATE-- -{{ (1 + 2) is defined ? 'ok' : 'ko' }} ---DATA-- -return [] ---EXCEPTION-- -Twig\Error\SyntaxError: The "defined" test only works with simple variables in "index.twig" at line 2. diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/dynamic_test.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/dynamic_test.test deleted file mode 100644 index 41625f6af1..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/dynamic_test.test +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -dynamic test ---TEMPLATE-- -{{ 'bar' is test_bar ? '1' :'0' }} -{{ 'foo' is test_foo ? '1' :'0' }} -{{ 'bar' is test_foo ? '1' :'0' }} -{{ 'foo' is test_bar ? '1' :'0' }} ---DATA-- -return [] ---EXPECT-- -1 -1 -0 -0 diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/empty.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/empty.test deleted file mode 100644 index 3e7fcf0183..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/empty.test +++ /dev/null @@ -1,42 +0,0 @@ ---TEST-- -"empty" test ---TEMPLATE-- -{{ string_empty is empty ? 'ok' : 'ko' }} -{{ string_zero is empty ? 'ko' : 'ok' }} -{{ value_null is empty ? 'ok' : 'ko' }} -{{ value_false is empty ? 'ok' : 'ko' }} -{{ value_int_zero is empty ? 'ko' : 'ok' }} -{{ array_empty is empty ? 'ok' : 'ko' }} -{{ array_not_empty is empty ? 'ko' : 'ok' }} -{{ magically_callable is empty ? 'ko' : 'ok' }} -{{ countable_empty is empty ? 'ok' : 'ko' }} -{{ countable_not_empty is empty ? 'ko' : 'ok' }} -{{ tostring_empty is empty ? 'ok' : 'ko' }} -{{ tostring_not_empty is empty ? 'ko' : 'ok' }} -{{ markup_empty is empty ? 'ok' : 'ko' }} -{{ markup_not_empty is empty ? 'ko' : 'ok' }} ---DATA-- -return [ - 'string_empty' => '', 'string_zero' => '0', - 'value_null' => null, 'value_false' => false, 'value_int_zero' => 0, - 'array_empty' => [], 'array_not_empty' => [1, 2], - 'magically_callable' => new MagicCallStub(), - 'countable_empty' => new CountableStub([]), 'countable_not_empty' => new CountableStub([1, 2]), - 'tostring_empty' => new ToStringStub(''), 'tostring_not_empty' => new ToStringStub('0' /* edge case of using "0" as the string */), - 'markup_empty' => new \Twig\Markup('', 'UTF-8'), 'markup_not_empty' => new \Twig\Markup('test', 'UTF-8'), -] ---EXPECT-- -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok -ok diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/even.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/even.test deleted file mode 100644 index 5c73b01e90..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/even.test +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -"even" test ---TEMPLATE-- -{{ 1 is even ? 'ko' : 'ok' }} -{{ 2 is even ? 'ok' : 'ko' }} -{{ 1 is not even ? 'ok' : 'ko' }} -{{ 2 is not even ? 'ko' : 'ok' }} ---DATA-- -return [] ---EXPECT-- -ok -ok -ok -ok diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/in.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/in.test deleted file mode 100644 index f7b172e8d0..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/in.test +++ /dev/null @@ -1,118 +0,0 @@ ---TEST-- -Twig supports the in operator ---TEMPLATE-- -{{ bar in foo ? 'OK' : 'KO' }} -{{ not (bar in foo) ? 'KO' : 'OK' }} -{{ bar not in foo ? 'KO' : 'OK' }} -{{ 'a' in bar ? 'OK' : 'KO' }} -{{ 'c' not in bar ? 'OK' : 'KO' }} -{{ '' in bar ? 'OK' : 'KO' }} -{{ '' in '' ? 'OK' : 'KO' }} -{{ '0' not in '' ? 'OK' : 'KO' }} -{{ 'a' not in '0' ? 'OK' : 'KO' }} -{{ '0' in '0' ? 'OK' : 'KO' }} - -{{ false in [0, 1] ? 'OK' : 'KO' }} -{{ true in [0, 1] ? 'OK' : 'KO' }} -{{ '0' in [0, 1] ? 'OK' : 'KO' }} -{{ '0' in [1, 0] ? 'OK' : 'KO' }} -{{ '' in [0, 1] ? 'OK' : 'KO' }} -{{ '' in [1, 0] ? 'OK' : 'KO' }} -{{ 0 in ['', 1] ? 'OK' : 'KO' }} -{{ 0 in [1, ''] ? 'OK' : 'KO' }} - -{{ '' in 'foo' ? 'OK' : 'KO' }} -{{ 0 in 'foo' ? 'KO' : 'OK' }} -{{ false in 'foo' ? 'KO' : 'OK' }} -{{ false in '100' ? 'KO' : 'OK' }} -{{ true in '100' ? 'KO' : 'OK' }} - -{{ [] in [true, false] ? 'OK' : 'KO' }} -{{ [] in [true, ''] ? 'KO' : 'OK' }} -{{ [] in [true, []] ? 'OK' : 'KO' }} - -{{ resource ? 'OK' : 'KO' }} -{{ resource in 'foo'~resource ? 'KO' : 'OK' }} -{{ object in 'stdClass' ? 'KO' : 'OK' }} -{{ [] in 'Array' ? 'KO' : 'OK' }} -{{ dir_object in 'foo'~dir_object ? 'KO' : 'OK' }} - -{{ ''~resource in resource ? 'KO' : 'OK' }} -{{ 'stdClass' in object ? 'KO' : 'OK' }} -{{ 'Array' in [] ? 'KO' : 'OK' }} -{{ ''~dir_object in dir_object ? 'KO' : 'OK' }} - -{{ resource in [''~resource] ? 'KO' : 'OK' }} -{{ resource in [resource + 1 - 1] ? 'KO' : 'OK' }} -{{ dir_object in [''~dir_object] ? 'KO' : 'OK' }} - -{{ 5 in 125 ? 'KO' : 'OK' }} -{{ 5 in '125' ? 'OK' : 'KO' }} -{{ '5' in 125 ? 'KO' : 'OK' }} -{{ '5' in '125' ? 'OK' : 'KO' }} - -{{ 5.5 in 125.5 ? 'KO' : 'OK' }} -{{ 5.5 in '125.5' ? 'OK' : 'KO' }} -{{ '5.5' in 125.5 ? 'KO' : 'OK' }} - -{{ safe in ['foo', 'bar'] ? 'OK' : 'KO' }} -{{ 'fo' in safe ? 'OK' : 'KO' }} ---DATA-- -return ['bar' => 'bar', 'foo' => ['bar' => 'bar'], 'dir_object' => new \SplFileInfo(dirname(__FILE__)), 'object' => new \stdClass(), 'resource' => opendir(dirname(__FILE__)), 'safe' => new \Twig\Markup('foo', 'UTF-8')] ---EXPECT-- -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK - -OK -OK -OK -OK -OK -OK -OK -OK - -OK -OK -OK -OK -OK - -OK -OK -OK - -OK -OK -OK -OK -OK - -OK -OK -OK -OK - -OK -OK -OK - -OK -OK -OK -OK - -OK -OK -OK - -OK -OK diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/in_with_objects.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/in_with_objects.test deleted file mode 100644 index b53eb067bd..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/in_with_objects.test +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -Twig supports the in operator when using objects ---TEMPLATE-- -{% if object in object_list %} -TRUE -{% endif %} ---DATA-- -$foo = new TwigTestFoo(); -$foo1 = new TwigTestFoo(); - -$foo->position = $foo1; -$foo1->position = $foo; - -return [ - 'object' => $foo, - 'object_list' => [$foo1, $foo], -] ---EXPECT-- -TRUE diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/iterable.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/iterable.test deleted file mode 100644 index 75b5756e1e..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/iterable.test +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -"iterable" test ---TEMPLATE-- -{{ foo is iterable ? 'ok' : 'ko' }} -{{ traversable is iterable ? 'ok' : 'ko' }} -{{ obj is iterable ? 'ok' : 'ko' }} -{{ val is iterable ? 'ok' : 'ko' }} ---DATA-- -return [ - 'foo' => [], - 'traversable' => new \ArrayIterator([]), - 'obj' => new \stdClass(), - 'val' => 'test', -] ---EXPECT-- -ok -ok -ko -ko \ No newline at end of file diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/null_coalesce.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/null_coalesce.test deleted file mode 100644 index 7af3255d61..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/null_coalesce.test +++ /dev/null @@ -1,30 +0,0 @@ ---TEST-- -Twig supports the ?? operator ---TEMPLATE-- -{{ 'OK' ?? 'KO' }} -{{ null ?? 'OK' }} -{{ bar ?? 'KO' }} -{{ baz ?? 'OK' }} -{{ foo.bar ?? 'KO' }} -{{ foo.missing ?? 'OK' }} -{{ foo.bar.baz.missing ?? 'OK' }} -{{ foo['bar'] ?? 'KO' }} -{{ foo['missing'] ?? 'OK' }} -{{ nope ?? nada ?? 'OK' }} -{{ 1 + nope ?? nada ?? 2 }} -{{ 1 + nope ?? 3 + nada ?? 2 }} ---DATA-- -return ['bar' => 'OK', 'foo' => ['bar' => 'OK']] ---EXPECT-- -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -3 -6 diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/odd.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/odd.test deleted file mode 100644 index ec88bb519c..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/tests/odd.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -"odd" test ---TEMPLATE-- -{{ 1 is odd ? 'ok' : 'ko' }} -{{ 2 is odd ? 'ko' : 'ok' }} ---DATA-- -return [] ---EXPECT-- -ok -ok \ No newline at end of file diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/whitespace/trim_block.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/whitespace/trim_block.test deleted file mode 100644 index 346a11076c..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/whitespace/trim_block.test +++ /dev/null @@ -1,68 +0,0 @@ ---TEST-- -Whitespace trimming on tags. ---TEMPLATE-- -Trim on control tag: -{% for i in range(1, 9) -%} - {{ i }} -{%- endfor %} - - -Trim on output tag: -{% for i in range(1, 9) %} - {{- i -}} -{% endfor %} - - -Trim comments: - -{#- Invisible -#} - -After the comment. - -Trim leading space: -{% if leading %} - - {{- leading }} -{% endif %} - -{%- if leading %} - {{- leading }} - -{%- endif %} - - -Trim trailing space: -{% if trailing -%} - {{ trailing -}} - -{% endif -%} - -Combined: - -{%- if both -%} -<ul> - <li> {{- both -}} </li> -</ul> - -{%- endif -%} - -end ---DATA-- -return ['leading' => 'leading space', 'trailing' => 'trailing space', 'both' => 'both'] ---EXPECT-- -Trim on control tag: -123456789 - -Trim on output tag: -123456789 - -Trim comments:After the comment. - -Trim leading space: -leading space -leading space - -Trim trailing space: -trailing spaceCombined:<ul> - <li>both</li> -</ul>end diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/whitespace/trim_delimiter_as_strings.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/whitespace/trim_delimiter_as_strings.test deleted file mode 100644 index a58818dde4..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/whitespace/trim_delimiter_as_strings.test +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -Whitespace trimming as strings. ---TEMPLATE-- -{{ 5 * '{#-'|length }} -{{ '{{-'|length * 5 + '{%-'|length }} ---DATA-- -return [] ---EXPECT-- -15 -18 diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/whitespace/trim_left.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/whitespace/trim_left.test deleted file mode 100644 index 75d0f80319..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/whitespace/trim_left.test +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -Whitespace trimming on tags (left side). ---TEMPLATE-- -**{% if true %} -foo - - {%- endif %}** - -** - - {{- 'foo' }}** - -** - - -{#- comment #}** - -**{% verbatim %} -foo - - {%- endverbatim %}** ---DATA-- -return [] ---EXPECT-- -**foo** - -**foo** - -**** - -** -foo** diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/whitespace/trim_line_left.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/whitespace/trim_line_left.test deleted file mode 100644 index e5e845f08b..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/whitespace/trim_line_left.test +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -Line whitespace trimming on tags (left side). ---TEMPLATE-- -**{% if true %} -foo - {%~ endif %}** - -** - {{~ 'foo' }}** - -** - {#~ comment #}** - -**{% verbatim %} -foo - - {%~ endverbatim %}** ---DATA-- -return [] ---EXPECT-- -**foo -** - -** -foo** - -** -** - -** -foo - -** diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/whitespace/trim_line_right.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/whitespace/trim_line_right.test deleted file mode 100644 index e7b510c85d..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/whitespace/trim_line_right.test +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -Line whitespace trimming on tags (right side). ---TEMPLATE-- -**{% if true ~%} -foo{% endif %}** - -**{{ 'foo' ~}} -foo -** - -**{# comment ~#} - foo -** - -**{% verbatim ~%} - foo{% endverbatim %}** ---DATA-- -return [] ---EXPECT-- -** -foo** - -**foo -foo -** - -** - foo -** - -** - foo** diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/whitespace/trim_right.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/whitespace/trim_right.test deleted file mode 100644 index 0ec3b0ceaa..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Fixtures/whitespace/trim_right.test +++ /dev/null @@ -1,28 +0,0 @@ ---TEST-- -Whitespace trimming on tags (right side). ---TEMPLATE-- -**{% if true -%} - - foo{% endif %}** - -**{{ 'foo' -}} - -** - -**{# comment -#} - -** - -**{% verbatim -%} - -foo{% endverbatim %}** ---DATA-- -return [] ---EXPECT-- -**foo** - -**foo** - -**** - -**foo** diff --git a/vendor/twig/twig/test/Twig/Tests/IntegrationTest.php b/vendor/twig/twig/test/Twig/Tests/IntegrationTest.php deleted file mode 100644 index e4b7d1d82f..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/IntegrationTest.php +++ /dev/null @@ -1,384 +0,0 @@ -<?php - -/* - * This file is part of Twig. - * - * (c) Fabien Potencier - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Twig\Extension\AbstractExtension; -use Twig\Extension\DebugExtension; -use Twig\Extension\SandboxExtension; -use Twig\Extension\StringLoaderExtension; -use Twig\Node\Expression\ConstantExpression; -use Twig\Node\PrintNode; -use Twig\Sandbox\SecurityPolicy; -use Twig\Test\IntegrationTestCase; -use Twig\Token; -use Twig\TokenParser\AbstractTokenParser; -use Twig\TwigFilter; -use Twig\TwigFunction; -use Twig\TwigTest; - -// This function is defined to check that escaping strategies -// like html works even if a function with the same name is defined. -function html() -{ - return 'foo'; -} - -class Twig_Tests_IntegrationTest extends IntegrationTestCase -{ - public function getExtensions() - { - $policy = new SecurityPolicy([], [], [], [], ['dump']); - - return [ - new DebugExtension(), - new SandboxExtension($policy, false), - new StringLoaderExtension(), - new TwigTestExtension(), - ]; - } - - public function getFixturesDir() - { - return __DIR__.'/Fixtures/'; - } -} - -function test_foo($value = 'foo') -{ - return $value; -} - -class TwigTestFoo implements Iterator -{ - const BAR_NAME = 'bar'; - - public $position = 0; - public $array = [1, 2]; - - public function bar($param1 = null, $param2 = null) - { - return 'bar'.($param1 ? '_'.$param1 : '').($param2 ? '-'.$param2 : ''); - } - - public function getFoo() - { - return 'foo'; - } - - public function getSelf() - { - return $this; - } - - public function is() - { - return 'is'; - } - - public function in() - { - return 'in'; - } - - public function not() - { - return 'not'; - } - - public function strToLower($value) - { - return strtolower($value); - } - - public function rewind() - { - $this->position = 0; - } - - public function current() - { - return $this->array[$this->position]; - } - - public function key() - { - return 'a'; - } - - public function next() - { - ++$this->position; - } - - public function valid() - { - return isset($this->array[$this->position]); - } -} - -class TwigTestTokenParser_§ extends AbstractTokenParser -{ - public function parse(Token $token) - { - $this->parser->getStream()->expect(Token::BLOCK_END_TYPE); - - return new PrintNode(new ConstantExpression('§', -1), -1); - } - - public function getTag() - { - return '§'; - } -} - -class TwigTestExtension extends AbstractExtension -{ - public function getTokenParsers() - { - return [ - new TwigTestTokenParser_§(), - ]; - } - - public function getFilters() - { - return [ - new TwigFilter('§', [$this, '§Filter']), - new TwigFilter('escape_and_nl2br', [$this, 'escape_and_nl2br'], ['needs_environment' => true, 'is_safe' => ['html']]), - new TwigFilter('nl2br', [$this, 'nl2br'], ['pre_escape' => 'html', 'is_safe' => ['html']]), - new TwigFilter('escape_something', [$this, 'escape_something'], ['is_safe' => ['something']]), - new TwigFilter('preserves_safety', [$this, 'preserves_safety'], ['preserves_safety' => ['html']]), - new TwigFilter('static_call_string', 'TwigTestExtension::staticCall'), - new TwigFilter('static_call_array', ['TwigTestExtension', 'staticCall']), - new TwigFilter('magic_call', [$this, 'magicCall']), - new TwigFilter('magic_call_string', 'TwigTestExtension::magicStaticCall'), - new TwigFilter('magic_call_array', ['TwigTestExtension', 'magicStaticCall']), - new TwigFilter('*_path', [$this, 'dynamic_path']), - new TwigFilter('*_foo_*_bar', [$this, 'dynamic_foo']), - ]; - } - - public function getFunctions() - { - return [ - new TwigFunction('§', [$this, '§Function']), - new TwigFunction('safe_br', [$this, 'br'], ['is_safe' => ['html']]), - new TwigFunction('unsafe_br', [$this, 'br']), - new TwigFunction('static_call_string', 'TwigTestExtension::staticCall'), - new TwigFunction('static_call_array', ['TwigTestExtension', 'staticCall']), - new TwigFunction('*_path', [$this, 'dynamic_path']), - new TwigFunction('*_foo_*_bar', [$this, 'dynamic_foo']), - ]; - } - - public function getTests() - { - return [ - new TwigTest('multi word', [$this, 'is_multi_word']), - new TwigTest('test_*', [$this, 'dynamic_test']), - ]; - } - - public function §Filter($value) - { - return "§{$value}§"; - } - - public function §Function($value) - { - return "§{$value}§"; - } - - /** - * nl2br which also escapes, for testing escaper filters. - */ - public function escape_and_nl2br($env, $value, $sep = '<br />') - { - return $this->nl2br(twig_escape_filter($env, $value, 'html'), $sep); - } - - /** - * nl2br only, for testing filters with pre_escape. - */ - public function nl2br($value, $sep = '<br />') - { - // not secure if $value contains html tags (not only entities) - // don't use - return str_replace("\n", "$sep\n", $value); - } - - public function dynamic_path($element, $item) - { - return $element.'/'.$item; - } - - public function dynamic_foo($foo, $bar, $item) - { - return $foo.'/'.$bar.'/'.$item; - } - - public function dynamic_test($element, $item) - { - return $element === $item; - } - - public function escape_something($value) - { - return strtoupper($value); - } - - public function preserves_safety($value) - { - return strtoupper($value); - } - - public static function staticCall($value) - { - return "*$value*"; - } - - public function br() - { - return '<br />'; - } - - public function is_multi_word($value) - { - return false !== strpos($value, ' '); - } - - public function __call($method, $arguments) - { - if ('magicCall' !== $method) { - throw new \BadMethodCallException('Unexpected call to __call'); - } - - return 'magic_'.$arguments[0]; - } - - public static function __callStatic($method, $arguments) - { - if ('magicStaticCall' !== $method) { - throw new \BadMethodCallException('Unexpected call to __callStatic'); - } - - return 'static_magic_'.$arguments[0]; - } -} - -/** - * This class is used in tests for the "length" filter and "empty" test. It asserts that __call is not - * used to convert such objects to strings. - */ -class MagicCallStub -{ - public function __call($name, $args) - { - throw new \Exception('__call shall not be called'); - } -} - -class ToStringStub -{ - /** - * @var string - */ - private $string; - - public function __construct($string) - { - $this->string = $string; - } - - public function __toString() - { - return $this->string; - } -} - -/** - * This class is used in tests for the length filter and empty test to show - * that when \Countable is implemented, it is preferred over the __toString() - * method. - */ -class CountableStub implements \Countable -{ - private $count; - - public function __construct($count) - { - $this->count = $count; - } - - public function count() - { - return $this->count; - } - - public function __toString() - { - throw new \Exception('__toString shall not be called on \Countables'); - } -} - -/** - * This class is used in tests for the length filter. - */ -class IteratorAggregateStub implements \IteratorAggregate -{ - private $data; - - public function __construct(array $data) - { - $this->data = $data; - } - - public function getIterator() - { - return new \ArrayIterator($this->data); - } -} - -class SimpleIteratorForTesting implements Iterator -{ - private $data = [1, 2, 3, 4, 5, 6, 7]; - private $key = 0; - - public function current() - { - return $this->key; - } - - public function next() - { - ++$this->key; - } - - public function key() - { - return $this->key; - } - - public function valid() - { - return isset($this->data[$this->key]); - } - - public function rewind() - { - $this->key = 0; - } - - public function __toString() - { - // for testing, make sure string length returned is not the same as the `iterator_count` - return str_repeat('X', iterator_count($this) + 10); - } -} diff --git a/vendor/twig/twig/test/Twig/Tests/LegacyFixtures/autoescape/filename.legacy.test b/vendor/twig/twig/test/Twig/Tests/LegacyFixtures/autoescape/filename.legacy.test deleted file mode 100644 index d25f75e8ee..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/LegacyFixtures/autoescape/filename.legacy.test +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -"filename" autoescape strategy ---TEMPLATE-- -{{ br -}} -{{ include('index.html.twig') -}} -{{ include('index.txt.twig') -}} ---TEMPLATE(index.html.twig)-- -{{ br -}} ---TEMPLATE(index.txt.twig)-- -{{ br -}} ---DATA-- -return ['br' => '<br />'] ---CONFIG-- -return ['autoescape' => 'filename'] ---EXPECT-- -<br /> -<br /> -<br /> diff --git a/vendor/twig/twig/test/Twig/Tests/LegacyFixtures/functions/undefined_block.legacy.test b/vendor/twig/twig/test/Twig/Tests/LegacyFixtures/functions/undefined_block.legacy.test deleted file mode 100644 index e52c3b2592..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/LegacyFixtures/functions/undefined_block.legacy.test +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -"block" function with undefined block ---TEMPLATE-- -{% extends "base.twig" %} -{% block foo %}{{ parent() }}{{ block('unknown') }}{{ block('bar') }}{% endblock %} ---TEMPLATE(base.twig)-- -{% block foo %}Foo{% endblock %} -{% block bar %}Bar{% endblock %} ---DATA-- -return [] ---EXPECT-- -FooBarBar diff --git a/vendor/twig/twig/test/Twig/Tests/LegacyFixtures/test.legacy.test b/vendor/twig/twig/test/Twig/Tests/LegacyFixtures/test.legacy.test deleted file mode 100644 index 4bd1f6ac0a..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/LegacyFixtures/test.legacy.test +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -Old test classes usage ---TEMPLATE-- -{{ 'foo' is multi word ? 'yes' : 'no' }} ---DATA-- -return [] ---EXPECT-- -no diff --git a/vendor/twig/twig/test/Twig/Tests/LegacyIntegrationTest.php b/vendor/twig/twig/test/Twig/Tests/LegacyIntegrationTest.php deleted file mode 100644 index 92cac3f8ad..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/LegacyIntegrationTest.php +++ /dev/null @@ -1,57 +0,0 @@ -<?php - -/* - * This file is part of Twig. - * - * (c) Fabien Potencier - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Twig\Extension\AbstractExtension; -use Twig\Test\IntegrationTestCase; - -class Twig_Tests_LegacyIntegrationTest extends IntegrationTestCase -{ - public function getExtensions() - { - return [ - new LegacyTwigTestExtension(), - ]; - } - - public function getFixturesDir() - { - return __DIR__.'/LegacyFixtures/'; - } - - public function getTests($name, $legacyTests = false) - { - if (!$legacyTests) { - return [['', '', '', [], '', []]]; - } - - return parent::getTests($name, true); - } -} - -class LegacyTwigTestExtension extends AbstractExtension -{ - public function getTests() - { - return [ - 'multi word' => new Twig_Test_Method($this, 'is_multi_word'), - ]; - } - - public function is_multi_word($value) - { - return false !== strpos($value, ' '); - } - - public function getName() - { - return 'legacy_integration_test'; - } -} diff --git a/vendor/twig/twig/test/Twig/Tests/LexerTest.php b/vendor/twig/twig/test/Twig/Tests/LexerTest.php deleted file mode 100644 index c1e62a6674..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/LexerTest.php +++ /dev/null @@ -1,379 +0,0 @@ -<?php - -/* - * This file is part of Twig. - * - * (c) Fabien Potencier - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Twig\Environment; -use Twig\Lexer; -use Twig\Source; -use Twig\Token; - -class Twig_Tests_LexerTest extends \PHPUnit\Framework\TestCase -{ - /** - * @group legacy - */ - public function testLegacyConstructorSignature() - { - $lexer = new Lexer(new Environment($this->getMockBuilder('\Twig\Loader\LoaderInterface')->getMock())); - $stream = $lexer->tokenize('{{ foo }}', 'foo'); - $this->assertEquals('foo', $stream->getFilename()); - $this->assertEquals('{{ foo }}', $stream->getSource()); - } - - public function testNameLabelForTag() - { - $template = '{% § %}'; - - $lexer = new Lexer(new Environment($this->getMockBuilder('\Twig\Loader\LoaderInterface')->getMock())); - $stream = $lexer->tokenize(new Source($template, 'index')); - - $stream->expect(Token::BLOCK_START_TYPE); - $this->assertSame('§', $stream->expect(Token::NAME_TYPE)->getValue()); - } - - public function testNameLabelForFunction() - { - $template = '{{ §() }}'; - - $lexer = new Lexer(new Environment($this->getMockBuilder('\Twig\Loader\LoaderInterface')->getMock())); - $stream = $lexer->tokenize(new Source($template, 'index')); - - $stream->expect(Token::VAR_START_TYPE); - $this->assertSame('§', $stream->expect(Token::NAME_TYPE)->getValue()); - } - - public function testBracketsNesting() - { - $template = '{{ {"a":{"b":"c"}} }}'; - - $this->assertEquals(2, $this->countToken($template, Token::PUNCTUATION_TYPE, '{')); - $this->assertEquals(2, $this->countToken($template, Token::PUNCTUATION_TYPE, '}')); - } - - protected function countToken($template, $type, $value = null) - { - $lexer = new Lexer(new Environment($this->getMockBuilder('\Twig\Loader\LoaderInterface')->getMock())); - $stream = $lexer->tokenize(new Source($template, 'index')); - - $count = 0; - while (!$stream->isEOF()) { - $token = $stream->next(); - if ($type === $token->getType()) { - if (null === $value || $value === $token->getValue()) { - ++$count; - } - } - } - - return $count; - } - - public function testLineDirective() - { - $template = "foo\n" - ."bar\n" - ."{% line 10 %}\n" - ."{{\n" - ."baz\n" - ."}}\n"; - - $lexer = new Lexer(new Environment($this->getMockBuilder('\Twig\Loader\LoaderInterface')->getMock())); - $stream = $lexer->tokenize(new Source($template, 'index')); - - // foo\nbar\n - $this->assertSame(1, $stream->expect(Token::TEXT_TYPE)->getLine()); - // \n (after {% line %}) - $this->assertSame(10, $stream->expect(Token::TEXT_TYPE)->getLine()); - // {{ - $this->assertSame(11, $stream->expect(Token::VAR_START_TYPE)->getLine()); - // baz - $this->assertSame(12, $stream->expect(Token::NAME_TYPE)->getLine()); - } - - public function testLineDirectiveInline() - { - $template = "foo\n" - ."bar{% line 10 %}{{\n" - ."baz\n" - ."}}\n"; - - $lexer = new Lexer(new Environment($this->getMockBuilder('\Twig\Loader\LoaderInterface')->getMock())); - $stream = $lexer->tokenize(new Source($template, 'index')); - - // foo\nbar - $this->assertSame(1, $stream->expect(Token::TEXT_TYPE)->getLine()); - // {{ - $this->assertSame(10, $stream->expect(Token::VAR_START_TYPE)->getLine()); - // baz - $this->assertSame(11, $stream->expect(Token::NAME_TYPE)->getLine()); - } - - public function testLongComments() - { - $template = '{# '.str_repeat('*', 100000).' #}'; - - $lexer = new Lexer(new Environment($this->getMockBuilder('\Twig\Loader\LoaderInterface')->getMock())); - $lexer->tokenize(new Source($template, 'index')); - - // add a dummy assertion here to satisfy PHPUnit, the only thing we want to test is that the code above - // can be executed without throwing any exceptions - $this->addToAssertionCount(1); - } - - public function testLongVerbatim() - { - $template = '{% verbatim %}'.str_repeat('*', 100000).'{% endverbatim %}'; - - $lexer = new Lexer(new Environment($this->getMockBuilder('\Twig\Loader\LoaderInterface')->getMock())); - $lexer->tokenize(new Source($template, 'index')); - - // add a dummy assertion here to satisfy PHPUnit, the only thing we want to test is that the code above - // can be executed without throwing any exceptions - $this->addToAssertionCount(1); - } - - public function testLongVar() - { - $template = '{{ '.str_repeat('x', 100000).' }}'; - - $lexer = new Lexer(new Environment($this->getMockBuilder('\Twig\Loader\LoaderInterface')->getMock())); - $lexer->tokenize(new Source($template, 'index')); - - // add a dummy assertion here to satisfy PHPUnit, the only thing we want to test is that the code above - // can be executed without throwing any exceptions - $this->addToAssertionCount(1); - } - - public function testLongBlock() - { - $template = '{% '.str_repeat('x', 100000).' %}'; - - $lexer = new Lexer(new Environment($this->getMockBuilder('\Twig\Loader\LoaderInterface')->getMock())); - $lexer->tokenize(new Source($template, 'index')); - - // add a dummy assertion here to satisfy PHPUnit, the only thing we want to test is that the code above - // can be executed without throwing any exceptions - $this->addToAssertionCount(1); - } - - public function testBigNumbers() - { - $template = '{{ 922337203685477580700 }}'; - - $lexer = new Lexer(new Environment($this->getMockBuilder('\Twig\Loader\LoaderInterface')->getMock())); - $stream = $lexer->tokenize(new Source($template, 'index')); - $stream->next(); - $node = $stream->next(); - $this->assertEquals('922337203685477580700', $node->getValue()); - } - - public function testStringWithEscapedDelimiter() - { - $tests = [ - "{{ 'foo \' bar' }}" => 'foo \' bar', - '{{ "foo \" bar" }}' => 'foo " bar', - ]; - $lexer = new Lexer(new Environment($this->getMockBuilder('\Twig\Loader\LoaderInterface')->getMock())); - foreach ($tests as $template => $expected) { - $stream = $lexer->tokenize(new Source($template, 'index')); - $stream->expect(Token::VAR_START_TYPE); - $stream->expect(Token::STRING_TYPE, $expected); - - // add a dummy assertion here to satisfy PHPUnit, the only thing we want to test is that the code above - // can be executed without throwing any exceptions - $this->addToAssertionCount(1); - } - } - - public function testStringWithInterpolation() - { - $template = 'foo {{ "bar #{ baz + 1 }" }}'; - - $lexer = new Lexer(new Environment($this->getMockBuilder('\Twig\Loader\LoaderInterface')->getMock())); - $stream = $lexer->tokenize(new Source($template, 'index')); - $stream->expect(Token::TEXT_TYPE, 'foo '); - $stream->expect(Token::VAR_START_TYPE); - $stream->expect(Token::STRING_TYPE, 'bar '); - $stream->expect(Token::INTERPOLATION_START_TYPE); - $stream->expect(Token::NAME_TYPE, 'baz'); - $stream->expect(Token::OPERATOR_TYPE, '+'); - $stream->expect(Token::NUMBER_TYPE, '1'); - $stream->expect(Token::INTERPOLATION_END_TYPE); - $stream->expect(Token::VAR_END_TYPE); - - // add a dummy assertion here to satisfy PHPUnit, the only thing we want to test is that the code above - // can be executed without throwing any exceptions - $this->addToAssertionCount(1); - } - - public function testStringWithEscapedInterpolation() - { - $template = '{{ "bar \#{baz+1}" }}'; - - $lexer = new Lexer(new Environment($this->getMockBuilder('\Twig\Loader\LoaderInterface')->getMock())); - $stream = $lexer->tokenize(new Source($template, 'index')); - $stream->expect(Token::VAR_START_TYPE); - $stream->expect(Token::STRING_TYPE, 'bar #{baz+1}'); - $stream->expect(Token::VAR_END_TYPE); - - // add a dummy assertion here to satisfy PHPUnit, the only thing we want to test is that the code above - // can be executed without throwing any exceptions - $this->addToAssertionCount(1); - } - - public function testStringWithHash() - { - $template = '{{ "bar # baz" }}'; - - $lexer = new Lexer(new Environment($this->getMockBuilder('\Twig\Loader\LoaderInterface')->getMock())); - $stream = $lexer->tokenize(new Source($template, 'index')); - $stream->expect(Token::VAR_START_TYPE); - $stream->expect(Token::STRING_TYPE, 'bar # baz'); - $stream->expect(Token::VAR_END_TYPE); - - // add a dummy assertion here to satisfy PHPUnit, the only thing we want to test is that the code above - // can be executed without throwing any exceptions - $this->addToAssertionCount(1); - } - - /** - * @expectedException \Twig\Error\SyntaxError - * @expectedExceptionMessage Unclosed """ - */ - public function testStringWithUnterminatedInterpolation() - { - $template = '{{ "bar #{x" }}'; - - $lexer = new Lexer(new Environment($this->getMockBuilder('\Twig\Loader\LoaderInterface')->getMock())); - $lexer->tokenize(new Source($template, 'index')); - } - - public function testStringWithNestedInterpolations() - { - $template = '{{ "bar #{ "foo#{bar}" }" }}'; - - $lexer = new Lexer(new Environment($this->getMockBuilder('\Twig\Loader\LoaderInterface')->getMock())); - $stream = $lexer->tokenize(new Source($template, 'index')); - $stream->expect(Token::VAR_START_TYPE); - $stream->expect(Token::STRING_TYPE, 'bar '); - $stream->expect(Token::INTERPOLATION_START_TYPE); - $stream->expect(Token::STRING_TYPE, 'foo'); - $stream->expect(Token::INTERPOLATION_START_TYPE); - $stream->expect(Token::NAME_TYPE, 'bar'); - $stream->expect(Token::INTERPOLATION_END_TYPE); - $stream->expect(Token::INTERPOLATION_END_TYPE); - $stream->expect(Token::VAR_END_TYPE); - - // add a dummy assertion here to satisfy PHPUnit, the only thing we want to test is that the code above - // can be executed without throwing any exceptions - $this->addToAssertionCount(1); - } - - public function testStringWithNestedInterpolationsInBlock() - { - $template = '{% foo "bar #{ "foo#{bar}" }" %}'; - - $lexer = new Lexer(new Environment($this->getMockBuilder('\Twig\Loader\LoaderInterface')->getMock())); - $stream = $lexer->tokenize(new Source($template, 'index')); - $stream->expect(Token::BLOCK_START_TYPE); - $stream->expect(Token::NAME_TYPE, 'foo'); - $stream->expect(Token::STRING_TYPE, 'bar '); - $stream->expect(Token::INTERPOLATION_START_TYPE); - $stream->expect(Token::STRING_TYPE, 'foo'); - $stream->expect(Token::INTERPOLATION_START_TYPE); - $stream->expect(Token::NAME_TYPE, 'bar'); - $stream->expect(Token::INTERPOLATION_END_TYPE); - $stream->expect(Token::INTERPOLATION_END_TYPE); - $stream->expect(Token::BLOCK_END_TYPE); - - // add a dummy assertion here to satisfy PHPUnit, the only thing we want to test is that the code above - // can be executed without throwing any exceptions - $this->addToAssertionCount(1); - } - - public function testOperatorEndingWithALetterAtTheEndOfALine() - { - $template = "{{ 1 and\n0}}"; - - $lexer = new Lexer(new Environment($this->getMockBuilder('\Twig\Loader\LoaderInterface')->getMock())); - $stream = $lexer->tokenize(new Source($template, 'index')); - $stream->expect(Token::VAR_START_TYPE); - $stream->expect(Token::NUMBER_TYPE, 1); - $stream->expect(Token::OPERATOR_TYPE, 'and'); - - // add a dummy assertion here to satisfy PHPUnit, the only thing we want to test is that the code above - // can be executed without throwing any exceptions - $this->addToAssertionCount(1); - } - - /** - * @expectedException \Twig\Error\SyntaxError - * @expectedExceptionMessage Unclosed "variable" in "index" at line 3 - */ - public function testUnterminatedVariable() - { - $template = ' - -{{ - -bar - - -'; - - $lexer = new Lexer(new Environment($this->getMockBuilder('\Twig\Loader\LoaderInterface')->getMock())); - $lexer->tokenize(new Source($template, 'index')); - } - - /** - * @expectedException \Twig\Error\SyntaxError - * @expectedExceptionMessage Unclosed "block" in "index" at line 3 - */ - public function testUnterminatedBlock() - { - $template = ' - -{% - -bar - - -'; - - $lexer = new Lexer(new Environment($this->getMockBuilder('\Twig\Loader\LoaderInterface')->getMock())); - $lexer->tokenize(new Source($template, 'index')); - } - - public function testOverridingSyntax() - { - $template = '[# comment #]{# variable #}/# if true #/true/# endif #/'; - $lexer = new Lexer(new Environment($this->getMockBuilder('\Twig\Loader\LoaderInterface')->getMock()), [ - 'tag_comment' => ['[#', '#]'], - 'tag_block' => ['/#', '#/'], - 'tag_variable' => ['{#', '#}'], - ]); - $stream = $lexer->tokenize(new Source($template, 'index')); - $stream->expect(Token::VAR_START_TYPE); - $stream->expect(Token::NAME_TYPE, 'variable'); - $stream->expect(Token::VAR_END_TYPE); - $stream->expect(Token::BLOCK_START_TYPE); - $stream->expect(Token::NAME_TYPE, 'if'); - $stream->expect(Token::NAME_TYPE, 'true'); - $stream->expect(Token::BLOCK_END_TYPE); - $stream->expect(Token::TEXT_TYPE, 'true'); - $stream->expect(Token::BLOCK_START_TYPE); - $stream->expect(Token::NAME_TYPE, 'endif'); - $stream->expect(Token::BLOCK_END_TYPE); - - // add a dummy assertion here to satisfy PHPUnit, the only thing we want to test is that the code above - // can be executed without throwing any exceptions - $this->addToAssertionCount(1); - } -} diff --git a/vendor/twig/twig/test/Twig/Tests/Loader/ArrayTest.php b/vendor/twig/twig/test/Twig/Tests/Loader/ArrayTest.php deleted file mode 100644 index 6f308f597b..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Loader/ArrayTest.php +++ /dev/null @@ -1,139 +0,0 @@ -<?php - -/* - * This file is part of Twig. - * - * (c) Fabien Potencier - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Twig\Loader\ArrayLoader; - -class Twig_Tests_Loader_ArrayTest extends \PHPUnit\Framework\TestCase -{ - /** - * @group legacy - */ - public function testGetSource() - { - $loader = new ArrayLoader(['foo' => 'bar']); - - $this->assertEquals('bar', $loader->getSource('foo')); - } - - /** - * @group legacy - * @expectedException \Twig\Error\LoaderError - */ - public function testGetSourceWhenTemplateDoesNotExist() - { - $loader = new ArrayLoader([]); - - $loader->getSource('foo'); - } - - /** - * @expectedException \Twig\Error\LoaderError - */ - public function testGetSourceContextWhenTemplateDoesNotExist() - { - $loader = new ArrayLoader([]); - - $loader->getSourceContext('foo'); - } - - public function testGetCacheKey() - { - $loader = new ArrayLoader(['foo' => 'bar']); - - $this->assertEquals('foo:bar', $loader->getCacheKey('foo')); - } - - public function testGetCacheKeyWhenTemplateHasDuplicateContent() - { - $loader = new ArrayLoader([ - 'foo' => 'bar', - 'baz' => 'bar', - ]); - - $this->assertEquals('foo:bar', $loader->getCacheKey('foo')); - $this->assertEquals('baz:bar', $loader->getCacheKey('baz')); - } - - public function testGetCacheKeyIsProtectedFromEdgeCollisions() - { - $loader = new ArrayLoader([ - 'foo__' => 'bar', - 'foo' => '__bar', - ]); - - $this->assertEquals('foo__:bar', $loader->getCacheKey('foo__')); - $this->assertEquals('foo:__bar', $loader->getCacheKey('foo')); - } - - /** - * @expectedException \Twig\Error\LoaderError - */ - public function testGetCacheKeyWhenTemplateDoesNotExist() - { - $loader = new ArrayLoader([]); - - $loader->getCacheKey('foo'); - } - - public function testSetTemplate() - { - $loader = new ArrayLoader([]); - $loader->setTemplate('foo', 'bar'); - - $this->assertEquals('bar', $loader->getSourceContext('foo')->getCode()); - } - - public function testIsFresh() - { - $loader = new ArrayLoader(['foo' => 'bar']); - $this->assertTrue($loader->isFresh('foo', time())); - } - - /** - * @expectedException \Twig\Error\LoaderError - */ - public function testIsFreshWhenTemplateDoesNotExist() - { - $loader = new ArrayLoader([]); - - $loader->isFresh('foo', time()); - } - - public function testTemplateReference() - { - $name = new Twig_Test_Loader_TemplateReference('foo'); - $loader = new ArrayLoader(['foo' => 'bar']); - - $loader->getCacheKey($name); - $loader->getSourceContext($name); - $loader->isFresh($name, time()); - $loader->setTemplate($name, 'foo:bar'); - - // add a dummy assertion here to satisfy PHPUnit, the only thing we want to test is that the code above - // can be executed without crashing PHP - $this->addToAssertionCount(1); - } -} - -class Twig_Test_Loader_TemplateReference -{ - private $name; - - public function __construct($name) - { - $this->name = $name; - } - - public function __toString() - { - return $this->name; - } -} diff --git a/vendor/twig/twig/test/Twig/Tests/Loader/ChainTest.php b/vendor/twig/twig/test/Twig/Tests/Loader/ChainTest.php deleted file mode 100644 index f07e50f3b9..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Loader/ChainTest.php +++ /dev/null @@ -1,132 +0,0 @@ -<?php - -/* - * This file is part of Twig. - * - * (c) Fabien Potencier - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Twig\Loader\ArrayLoader; -use Twig\Loader\ChainLoader; -use Twig\Loader\ExistsLoaderInterface; -use Twig\Loader\FilesystemLoader; -use Twig\Loader\LoaderInterface; -use Twig\Loader\SourceContextLoaderInterface; -use Twig\Source; - -class Twig_Tests_Loader_ChainTest extends \PHPUnit\Framework\TestCase -{ - /** - * @group legacy - */ - public function testGetSource() - { - $loader = new ChainLoader([ - new ArrayLoader(['foo' => 'bar']), - new ArrayLoader(['foo' => 'foobar', 'bar' => 'foo']), - ]); - - $this->assertEquals('bar', $loader->getSource('foo')); - $this->assertEquals('foo', $loader->getSource('bar')); - } - - public function testGetSourceContext() - { - $path = __DIR__.'/../Fixtures'; - $loader = new ChainLoader([ - new ArrayLoader(['foo' => 'bar']), - new ArrayLoader(['errors/index.html' => 'baz']), - new FilesystemLoader([$path]), - ]); - - $this->assertEquals('foo', $loader->getSourceContext('foo')->getName()); - $this->assertSame('', $loader->getSourceContext('foo')->getPath()); - - $this->assertEquals('errors/index.html', $loader->getSourceContext('errors/index.html')->getName()); - $this->assertSame('', $loader->getSourceContext('errors/index.html')->getPath()); - $this->assertEquals('baz', $loader->getSourceContext('errors/index.html')->getCode()); - - $this->assertEquals('errors/base.html', $loader->getSourceContext('errors/base.html')->getName()); - $this->assertEquals(realpath($path.'/errors/base.html'), realpath($loader->getSourceContext('errors/base.html')->getPath())); - $this->assertNotEquals('baz', $loader->getSourceContext('errors/base.html')->getCode()); - } - - /** - * @expectedException \Twig\Error\LoaderError - */ - public function testGetSourceContextWhenTemplateDoesNotExist() - { - $loader = new ChainLoader([]); - - $loader->getSourceContext('foo'); - } - - /** - * @group legacy - * @expectedException \Twig\Error\LoaderError - */ - public function testGetSourceWhenTemplateDoesNotExist() - { - $loader = new ChainLoader([]); - - $loader->getSource('foo'); - } - - public function testGetCacheKey() - { - $loader = new ChainLoader([ - new ArrayLoader(['foo' => 'bar']), - new ArrayLoader(['foo' => 'foobar', 'bar' => 'foo']), - ]); - - $this->assertEquals('foo:bar', $loader->getCacheKey('foo')); - $this->assertEquals('bar:foo', $loader->getCacheKey('bar')); - } - - /** - * @expectedException \Twig\Error\LoaderError - */ - public function testGetCacheKeyWhenTemplateDoesNotExist() - { - $loader = new ChainLoader([]); - - $loader->getCacheKey('foo'); - } - - public function testAddLoader() - { - $loader = new ChainLoader(); - $loader->addLoader(new ArrayLoader(['foo' => 'bar'])); - - $this->assertEquals('bar', $loader->getSourceContext('foo')->getCode()); - } - - public function testExists() - { - $loader1 = $this->getMockBuilder('Twig_ChainTestLoaderWithExistsInterface')->getMock(); - $loader1->expects($this->once())->method('exists')->willReturn(false); - $loader1->expects($this->never())->method('getSourceContext'); - - // can be removed in 2.0 - $loader2 = $this->getMockBuilder('Twig_ChainTestLoaderInterface')->getMock(); - //$loader2 = $this->getMockBuilder(['\Twig\Loader\LoaderInterface', '\Twig\Loader\SourceContextLoaderInterface'])->getMock(); - $loader2->expects($this->once())->method('getSourceContext')->willReturn(new Source('content', 'index')); - - $loader = new ChainLoader(); - $loader->addLoader($loader1); - $loader->addLoader($loader2); - - $this->assertTrue($loader->exists('foo')); - } -} - -interface Twig_ChainTestLoaderInterface extends LoaderInterface, SourceContextLoaderInterface -{ -} - -interface Twig_ChainTestLoaderWithExistsInterface extends LoaderInterface, ExistsLoaderInterface, SourceContextLoaderInterface -{ -} diff --git a/vendor/twig/twig/test/Twig/Tests/Loader/FilesystemTest.php b/vendor/twig/twig/test/Twig/Tests/Loader/FilesystemTest.php deleted file mode 100644 index 86e58e6da8..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Loader/FilesystemTest.php +++ /dev/null @@ -1,245 +0,0 @@ -<?php - -/* - * This file is part of Twig. - * - * (c) Fabien Potencier - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Twig\Environment; -use Twig\Error\LoaderError; -use Twig\Loader\FilesystemLoader; - -class Twig_Tests_Loader_FilesystemTest extends \PHPUnit\Framework\TestCase -{ - public function testGetSourceContext() - { - $path = __DIR__.'/../Fixtures'; - $loader = new FilesystemLoader([$path]); - $this->assertEquals('errors/index.html', $loader->getSourceContext('errors/index.html')->getName()); - $this->assertEquals(realpath($path.'/errors/index.html'), realpath($loader->getSourceContext('errors/index.html')->getPath())); - } - - /** - * @dataProvider getSecurityTests - */ - public function testSecurity($template) - { - $loader = new FilesystemLoader([__DIR__.'/../Fixtures']); - - try { - $loader->getCacheKey($template); - $this->fail(); - } catch (LoaderError $e) { - $this->assertNotContains('Unable to find template', $e->getMessage()); - } - } - - public function getSecurityTests() - { - return [ - ["AutoloaderTest\0.php"], - ['..\\AutoloaderTest.php'], - ['..\\\\\\AutoloaderTest.php'], - ['../AutoloaderTest.php'], - ['..////AutoloaderTest.php'], - ['./../AutoloaderTest.php'], - ['.\\..\\AutoloaderTest.php'], - ['././././././../AutoloaderTest.php'], - ['.\\./.\\./.\\./../AutoloaderTest.php'], - ['foo/../../AutoloaderTest.php'], - ['foo\\..\\..\\AutoloaderTest.php'], - ['foo/../bar/../../AutoloaderTest.php'], - ['foo/bar/../../../AutoloaderTest.php'], - ['filters/../../AutoloaderTest.php'], - ['filters//..//..//AutoloaderTest.php'], - ['filters\\..\\..\\AutoloaderTest.php'], - ['filters\\\\..\\\\..\\\\AutoloaderTest.php'], - ['filters\\//../\\/\\..\\AutoloaderTest.php'], - ['/../AutoloaderTest.php'], - ]; - } - - /** - * @dataProvider getBasePaths - */ - public function testPaths($basePath, $cacheKey, $rootPath) - { - $loader = new FilesystemLoader([$basePath.'/normal', $basePath.'/normal_bis'], $rootPath); - $loader->setPaths([$basePath.'/named', $basePath.'/named_bis'], 'named'); - $loader->addPath($basePath.'/named_ter', 'named'); - $loader->addPath($basePath.'/normal_ter'); - $loader->prependPath($basePath.'/normal_final'); - $loader->prependPath($basePath.'/named/../named_quater', 'named'); - $loader->prependPath($basePath.'/named_final', 'named'); - - $this->assertEquals([ - $basePath.'/normal_final', - $basePath.'/normal', - $basePath.'/normal_bis', - $basePath.'/normal_ter', - ], $loader->getPaths()); - $this->assertEquals([ - $basePath.'/named_final', - $basePath.'/named/../named_quater', - $basePath.'/named', - $basePath.'/named_bis', - $basePath.'/named_ter', - ], $loader->getPaths('named')); - - // do not use realpath here as it would make the test unuseful - $this->assertEquals($cacheKey, str_replace('\\', '/', $loader->getCacheKey('@named/named_absolute.html'))); - $this->assertEquals("path (final)\n", $loader->getSourceContext('index.html')->getCode()); - $this->assertEquals("path (final)\n", $loader->getSourceContext('@__main__/index.html')->getCode()); - $this->assertEquals("named path (final)\n", $loader->getSourceContext('@named/index.html')->getCode()); - } - - public function getBasePaths() - { - return [ - [ - __DIR__.'/Fixtures', - 'test/Twig/Tests/Loader/Fixtures/named_quater/named_absolute.html', - null, - ], - [ - __DIR__.'/Fixtures/../Fixtures', - 'test/Twig/Tests/Loader/Fixtures/named_quater/named_absolute.html', - null, - ], - [ - 'test/Twig/Tests/Loader/Fixtures', - 'test/Twig/Tests/Loader/Fixtures/named_quater/named_absolute.html', - getcwd(), - ], - [ - 'Fixtures', - 'Fixtures/named_quater/named_absolute.html', - getcwd().'/test/Twig/Tests/Loader', - ], - [ - 'Fixtures', - 'Fixtures/named_quater/named_absolute.html', - getcwd().'/test/../test/Twig/Tests/Loader', - ], - ]; - } - - public function testEmptyConstructor() - { - $loader = new FilesystemLoader(); - $this->assertEquals([], $loader->getPaths()); - } - - public function testGetNamespaces() - { - $loader = new FilesystemLoader(sys_get_temp_dir()); - $this->assertEquals([FilesystemLoader::MAIN_NAMESPACE], $loader->getNamespaces()); - - $loader->addPath(sys_get_temp_dir(), 'named'); - $this->assertEquals([FilesystemLoader::MAIN_NAMESPACE, 'named'], $loader->getNamespaces()); - } - - public function testFindTemplateExceptionNamespace() - { - $basePath = __DIR__.'/Fixtures'; - - $loader = new FilesystemLoader([$basePath.'/normal']); - $loader->addPath($basePath.'/named', 'named'); - - try { - $loader->getSourceContext('@named/nowhere.html'); - } catch (\Exception $e) { - $this->assertInstanceOf('\Twig\Error\LoaderError', $e); - $this->assertContains('Unable to find template "@named/nowhere.html"', $e->getMessage()); - } - } - - public function testFindTemplateWithCache() - { - $basePath = __DIR__.'/Fixtures'; - - $loader = new FilesystemLoader([$basePath.'/normal']); - $loader->addPath($basePath.'/named', 'named'); - - // prime the cache for index.html in the named namespace - $namedSource = $loader->getSourceContext('@named/index.html')->getCode(); - $this->assertEquals("named path\n", $namedSource); - - // get index.html from the main namespace - $this->assertEquals("path\n", $loader->getSourceContext('index.html')->getCode()); - } - - public function testLoadTemplateAndRenderBlockWithCache() - { - $loader = new FilesystemLoader([]); - $loader->addPath(__DIR__.'/Fixtures/themes/theme2'); - $loader->addPath(__DIR__.'/Fixtures/themes/theme1'); - $loader->addPath(__DIR__.'/Fixtures/themes/theme1', 'default_theme'); - - $twig = new Environment($loader); - - $template = $twig->load('blocks.html.twig'); - $this->assertSame('block from theme 1', $template->renderBlock('b1', [])); - - $template = $twig->load('blocks.html.twig'); - $this->assertSame('block from theme 2', $template->renderBlock('b2', [])); - } - - public function getArrayInheritanceTests() - { - return [ - 'valid array inheritance' => ['array_inheritance_valid_parent.html.twig'], - 'array inheritance with null first template' => ['array_inheritance_null_parent.html.twig'], - 'array inheritance with empty first template' => ['array_inheritance_empty_parent.html.twig'], - 'array inheritance with non-existent first template' => ['array_inheritance_nonexistent_parent.html.twig'], - ]; - } - - /** - * @dataProvider getArrayInheritanceTests - * - * @param $templateName string Template name with array inheritance - */ - public function testArrayInheritance($templateName) - { - $loader = new FilesystemLoader([]); - $loader->addPath(__DIR__.'/Fixtures/inheritance'); - - $twig = new Environment($loader); - - $template = $twig->load($templateName); - $this->assertSame('VALID Child', $template->renderBlock('body', [])); - } - - /** - * @requires PHP 5.3 - */ - public function testLoadTemplateFromPhar() - { - $loader = new FilesystemLoader([]); - // phar-sample.phar was created with the following script: - // $f = new Phar('phar-test.phar'); - // $f->addFromString('hello.twig', 'hello from phar'); - $loader->addPath('phar://'.__DIR__.'/Fixtures/phar/phar-sample.phar'); - $this->assertSame('hello from phar', $loader->getSourceContext('hello.twig')->getCode()); - } - - public function testTemplateExistsAlwaysReturnsBool() - { - $loader = new FilesystemLoader([]); - $this->assertFalse($loader->exists("foo\0.twig")); - $this->assertFalse($loader->exists('../foo.twig')); - $this->assertFalse($loader->exists('@foo')); - $this->assertFalse($loader->exists('foo')); - $this->assertFalse($loader->exists('@foo/bar.twig')); - - $loader->addPath(__DIR__.'/Fixtures/normal'); - $this->assertTrue($loader->exists('index.html')); - $loader->addPath(__DIR__.'/Fixtures/normal', 'foo'); - $this->assertTrue($loader->exists('@foo/index.html')); - } -} diff --git a/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/inheritance/array_inheritance_empty_parent.html.twig b/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/inheritance/array_inheritance_empty_parent.html.twig deleted file mode 100644 index 6977ebf66c..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/inheritance/array_inheritance_empty_parent.html.twig +++ /dev/null @@ -1,3 +0,0 @@ -{% extends ['','parent.html.twig'] %} - -{% block body %}{{ parent() }} Child{% endblock %} diff --git a/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/inheritance/array_inheritance_nonexistent_parent.html.twig b/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/inheritance/array_inheritance_nonexistent_parent.html.twig deleted file mode 100644 index 5b50a8b211..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/inheritance/array_inheritance_nonexistent_parent.html.twig +++ /dev/null @@ -1,3 +0,0 @@ -{% extends ['nonexistent.html.twig','parent.html.twig'] %} - -{% block body %}{{ parent() }} Child{% endblock %} diff --git a/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/inheritance/array_inheritance_null_parent.html.twig b/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/inheritance/array_inheritance_null_parent.html.twig deleted file mode 100644 index a16b3adedb..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/inheritance/array_inheritance_null_parent.html.twig +++ /dev/null @@ -1,3 +0,0 @@ -{% extends [null,'parent.html.twig'] %} - -{% block body %}{{ parent() }} Child{% endblock %} diff --git a/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/inheritance/array_inheritance_valid_parent.html.twig b/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/inheritance/array_inheritance_valid_parent.html.twig deleted file mode 100644 index 4940dad416..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/inheritance/array_inheritance_valid_parent.html.twig +++ /dev/null @@ -1,3 +0,0 @@ -{% extends ['parent.html.twig','spare_parent.html.twig'] %} - -{% block body %}{{ parent() }} Child{% endblock %} diff --git a/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/inheritance/parent.html.twig b/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/inheritance/parent.html.twig deleted file mode 100644 index d594c0ed49..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/inheritance/parent.html.twig +++ /dev/null @@ -1 +0,0 @@ -{% block body %}VALID{% endblock %} diff --git a/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/inheritance/spare_parent.html.twig b/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/inheritance/spare_parent.html.twig deleted file mode 100644 index 70b7360a2c..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/inheritance/spare_parent.html.twig +++ /dev/null @@ -1 +0,0 @@ -{% block body %}SPARE PARENT{% endblock %} diff --git a/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/named/index.html b/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/named/index.html deleted file mode 100644 index 9e5449c7c5..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/named/index.html +++ /dev/null @@ -1 +0,0 @@ -named path diff --git a/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/named_bis/index.html b/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/named_bis/index.html deleted file mode 100644 index d3a272b19d..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/named_bis/index.html +++ /dev/null @@ -1 +0,0 @@ -named path (bis) diff --git a/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/named_final/index.html b/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/named_final/index.html deleted file mode 100644 index 9f05d15075..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/named_final/index.html +++ /dev/null @@ -1 +0,0 @@ -named path (final) diff --git a/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/named_quater/named_absolute.html b/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/named_quater/named_absolute.html deleted file mode 100644 index b1fb5f5d7c..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/named_quater/named_absolute.html +++ /dev/null @@ -1 +0,0 @@ -named path (quater) diff --git a/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/named_ter/index.html b/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/named_ter/index.html deleted file mode 100644 index 24fb68ad2e..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/named_ter/index.html +++ /dev/null @@ -1 +0,0 @@ -named path (ter) diff --git a/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/normal/index.html b/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/normal/index.html deleted file mode 100644 index e7a8fd4d0a..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/normal/index.html +++ /dev/null @@ -1 +0,0 @@ -path diff --git a/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/normal_bis/index.html b/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/normal_bis/index.html deleted file mode 100644 index bfa916049f..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/normal_bis/index.html +++ /dev/null @@ -1 +0,0 @@ -path (bis) diff --git a/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/normal_final/index.html b/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/normal_final/index.html deleted file mode 100644 index 73a089bbda..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/normal_final/index.html +++ /dev/null @@ -1 +0,0 @@ -path (final) diff --git a/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/normal_ter/index.html b/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/normal_ter/index.html deleted file mode 100644 index b7ad97d8f4..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/normal_ter/index.html +++ /dev/null @@ -1 +0,0 @@ -path (ter) diff --git a/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/phar/phar-sample.phar b/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/phar/phar-sample.phar deleted file mode 100644 index 092bbfae3e..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/phar/phar-sample.phar +++ /dev/null @@ -1,293 +0,0 @@ -<?php - -$web = 'index.php'; - -if (in_array('phar', stream_get_wrappers()) && class_exists('Phar', 0)) { -Phar::interceptFileFuncs(); -set_include_path('phar://' . __FILE__ . PATH_SEPARATOR . get_include_path()); -Phar::webPhar(null, $web); -include 'phar://' . __FILE__ . '/' . Extract_Phar::START; -return; -} - -if (@(isset($_SERVER['REQUEST_URI']) && isset($_SERVER['REQUEST_METHOD']) && ($_SERVER['REQUEST_METHOD'] == 'GET' || $_SERVER['REQUEST_METHOD'] == 'POST'))) { -Extract_Phar::go(true); -$mimes = array( -'phps' => 2, -'c' => 'text/plain', -'cc' => 'text/plain', -'cpp' => 'text/plain', -'c++' => 'text/plain', -'dtd' => 'text/plain', -'h' => 'text/plain', -'log' => 'text/plain', -'rng' => 'text/plain', -'txt' => 'text/plain', -'xsd' => 'text/plain', -'php' => 1, -'inc' => 1, -'avi' => 'video/avi', -'bmp' => 'image/bmp', -'css' => 'text/css', -'gif' => 'image/gif', -'htm' => 'text/html', -'html' => 'text/html', -'htmls' => 'text/html', -'ico' => 'image/x-ico', -'jpe' => 'image/jpeg', -'jpg' => 'image/jpeg', -'jpeg' => 'image/jpeg', -'js' => 'application/x-javascript', -'midi' => 'audio/midi', -'mid' => 'audio/midi', -'mod' => 'audio/mod', -'mov' => 'movie/quicktime', -'mp3' => 'audio/mp3', -'mpg' => 'video/mpeg', -'mpeg' => 'video/mpeg', -'pdf' => 'application/pdf', -'png' => 'image/png', -'swf' => 'application/shockwave-flash', -'tif' => 'image/tiff', -'tiff' => 'image/tiff', -'wav' => 'audio/wav', -'xbm' => 'image/xbm', -'xml' => 'text/xml', -); - -header("Cache-Control: no-cache, must-revalidate"); -header("Pragma: no-cache"); - -$basename = basename(__FILE__); -if (!strpos($_SERVER['REQUEST_URI'], $basename)) { -chdir(Extract_Phar::$temp); -include $web; -return; -} -$pt = substr($_SERVER['REQUEST_URI'], strpos($_SERVER['REQUEST_URI'], $basename) + strlen($basename)); -if (!$pt || $pt == '/') { -$pt = $web; -header('HTTP/1.1 301 Moved Permanently'); -header('Location: ' . $_SERVER['REQUEST_URI'] . '/' . $pt); -exit; -} -$a = realpath(Extract_Phar::$temp . DIRECTORY_SEPARATOR . $pt); -if (!$a || strlen(dirname($a)) < strlen(Extract_Phar::$temp)) { -header('HTTP/1.0 404 Not Found'); -echo "<html>\n <head>\n <title>File Not Found<title>\n </head>\n <body>\n <h1>404 - File ", $pt, " Not Found</h1>\n </body>\n</html>"; -exit; -} -$b = pathinfo($a); -if (!isset($b['extension'])) { -header('Content-Type: text/plain'); -header('Content-Length: ' . filesize($a)); -readfile($a); -exit; -} -if (isset($mimes[$b['extension']])) { -if ($mimes[$b['extension']] === 1) { -include $a; -exit; -} -if ($mimes[$b['extension']] === 2) { -highlight_file($a); -exit; -} -header('Content-Type: ' .$mimes[$b['extension']]); -header('Content-Length: ' . filesize($a)); -readfile($a); -exit; -} -} - -class Extract_Phar -{ -static $temp; -static $origdir; -const GZ = 0x1000; -const BZ2 = 0x2000; -const MASK = 0x3000; -const START = 'index.php'; -const LEN = 6685; - -static function go($return = false) -{ -$fp = fopen(__FILE__, 'rb'); -fseek($fp, self::LEN); -$L = unpack('V', $a = (binary)fread($fp, 4)); -$m = (binary)''; - -do { -$read = 8192; -if ($L[1] - strlen($m) < 8192) { -$read = $L[1] - strlen($m); -} -$last = (binary)fread($fp, $read); -$m .= $last; -} while (strlen($last) && strlen($m) < $L[1]); - -if (strlen($m) < $L[1]) { -die('ERROR: manifest length read was "' . -strlen($m) .'" should be "' . -$L[1] . '"'); -} - -$info = self::_unpack($m); -$f = $info['c']; - -if ($f & self::GZ) { -if (!function_exists('gzinflate')) { -die('Error: zlib extension is not enabled -' . -' gzinflate() function needed for zlib-compressed .phars'); -} -} - -if ($f & self::BZ2) { -if (!function_exists('bzdecompress')) { -die('Error: bzip2 extension is not enabled -' . -' bzdecompress() function needed for bz2-compressed .phars'); -} -} - -$temp = self::tmpdir(); - -if (!$temp || !is_writable($temp)) { -$sessionpath = session_save_path(); -if (strpos ($sessionpath, ";") !== false) -$sessionpath = substr ($sessionpath, strpos ($sessionpath, ";")+1); -if (!file_exists($sessionpath) || !is_dir($sessionpath)) { -die('Could not locate temporary directory to extract phar'); -} -$temp = $sessionpath; -} - -$temp .= '/pharextract/'.basename(__FILE__, '.phar'); -self::$temp = $temp; -self::$origdir = getcwd(); -@mkdir($temp, 0777, true); -$temp = realpath($temp); - -if (!file_exists($temp . DIRECTORY_SEPARATOR . md5_file(__FILE__))) { -self::_removeTmpFiles($temp, getcwd()); -@mkdir($temp, 0777, true); -@file_put_contents($temp . '/' . md5_file(__FILE__), ''); - -foreach ($info['m'] as $path => $file) { -$a = !file_exists(dirname($temp . '/' . $path)); -@mkdir(dirname($temp . '/' . $path), 0777, true); -clearstatcache(); - -if ($path[strlen($path) - 1] == '/') { -@mkdir($temp . '/' . $path, 0777); -} else { -file_put_contents($temp . '/' . $path, self::extractFile($path, $file, $fp)); -@chmod($temp . '/' . $path, 0666); -} -} -} - -chdir($temp); - -if (!$return) { -include self::START; -} -} - -static function tmpdir() -{ -if (strpos(PHP_OS, 'WIN') !== false) { -if ($var = getenv('TMP') ? getenv('TMP') : getenv('TEMP')) { -return $var; -} -if (is_dir('/temp') || mkdir('/temp')) { -return realpath('/temp'); -} -return false; -} -if ($var = getenv('TMPDIR')) { -return $var; -} -return realpath('/tmp'); -} - -static function _unpack($m) -{ -$info = unpack('V', substr($m, 0, 4)); - $l = unpack('V', substr($m, 10, 4)); -$m = substr($m, 14 + $l[1]); -$s = unpack('V', substr($m, 0, 4)); -$o = 0; -$start = 4 + $s[1]; -$ret['c'] = 0; - -for ($i = 0; $i < $info[1]; $i++) { - $len = unpack('V', substr($m, $start, 4)); -$start += 4; - $savepath = substr($m, $start, $len[1]); -$start += $len[1]; - $ret['m'][$savepath] = array_values(unpack('Va/Vb/Vc/Vd/Ve/Vf', substr($m, $start, 24))); -$ret['m'][$savepath][3] = sprintf('%u', $ret['m'][$savepath][3] -& 0xffffffff); -$ret['m'][$savepath][7] = $o; -$o += $ret['m'][$savepath][2]; -$start += 24 + $ret['m'][$savepath][5]; -$ret['c'] |= $ret['m'][$savepath][4] & self::MASK; -} -return $ret; -} - -static function extractFile($path, $entry, $fp) -{ -$data = ''; -$c = $entry[2]; - -while ($c) { -if ($c < 8192) { -$data .= @fread($fp, $c); -$c = 0; -} else { -$c -= 8192; -$data .= @fread($fp, 8192); -} -} - -if ($entry[4] & self::GZ) { -$data = gzinflate($data); -} elseif ($entry[4] & self::BZ2) { -$data = bzdecompress($data); -} - -if (strlen($data) != $entry[0]) { -die("Invalid internal .phar file (size error " . strlen($data) . " != " . -$stat[7] . ")"); -} - -if ($entry[3] != sprintf("%u", crc32((binary)$data) & 0xffffffff)) { -die("Invalid internal .phar file (checksum error)"); -} - -return $data; -} - -static function _removeTmpFiles($temp, $origdir) -{ -chdir($temp); - -foreach (glob('*') as $f) { -if (file_exists($f)) { -is_dir($f) ? @rmdir($f) : @unlink($f); -if (file_exists($f) && is_dir($f)) { -self::_removeTmpFiles($f, getcwd()); -} -} -} - -@rmdir($temp); -clearstatcache(); -chdir($origdir); -} -} - -Extract_Phar::go(); -__HALT_COMPILER(); ?>8������������������ -���hello.twig������W���xY5A�������hello from phar�`�E��8�5��A�����x����GBMB \ No newline at end of file diff --git a/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/themes/theme1/blocks.html.twig b/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/themes/theme1/blocks.html.twig deleted file mode 100644 index dd0cbc2e71..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/themes/theme1/blocks.html.twig +++ /dev/null @@ -1,3 +0,0 @@ -{% block b1 %}block from theme 1{% endblock %} - -{% block b2 %}block from theme 1{% endblock %} diff --git a/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/themes/theme2/blocks.html.twig b/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/themes/theme2/blocks.html.twig deleted file mode 100644 index 07cf9db0de..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/themes/theme2/blocks.html.twig +++ /dev/null @@ -1,3 +0,0 @@ -{% use '@default_theme/blocks.html.twig' %} - -{% block b2 %}block from theme 2{% endblock %} diff --git a/vendor/twig/twig/test/Twig/Tests/NativeExtensionTest.php b/vendor/twig/twig/test/Twig/Tests/NativeExtensionTest.php deleted file mode 100644 index 6a122fa7f7..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/NativeExtensionTest.php +++ /dev/null @@ -1,39 +0,0 @@ -<?php - -/* - * This file is part of Twig. - * - * (c) Fabien Potencier - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Twig\Environment; -use Twig\Loader\ArrayLoader; - -class Twig_Tests_NativeExtensionTest extends \PHPUnit\Framework\TestCase -{ - /** - * @requires PHP 5.3 - */ - public function testGetProperties() - { - if (PHP_VERSION_ID >= 70000) { - $this->markTestSkipped('Extension is not available on PHP 7+'); - } - - $twig = new Environment(new ArrayLoader(['index' => '{{ d1.date }}{{ d2.date }}']), [ - 'debug' => true, - 'cache' => false, - 'autoescape' => false, - ]); - - $d1 = new \DateTime(); - $d2 = new \DateTime(); - $output = $twig->render('index', compact('d1', 'd2')); - - // If it fails, PHP will crash. - $this->assertEquals($output, $d1->date.$d2->date); - } -} diff --git a/vendor/twig/twig/test/Twig/Tests/Node/AutoEscapeTest.php b/vendor/twig/twig/test/Twig/Tests/Node/AutoEscapeTest.php deleted file mode 100644 index 1633e06046..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/AutoEscapeTest.php +++ /dev/null @@ -1,37 +0,0 @@ -<?php - -/* - * This file is part of Twig. - * - * (c) Fabien Potencier - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Twig\Node\AutoEscapeNode; -use Twig\Node\Node; -use Twig\Node\TextNode; -use Twig\Test\NodeTestCase; - -class Twig_Tests_Node_AutoEscapeTest extends NodeTestCase -{ - public function testConstructor() - { - $body = new Node([new TextNode('foo', 1)]); - $node = new AutoEscapeNode(true, $body, 1); - - $this->assertEquals($body, $node->getNode('body')); - $this->assertTrue($node->getAttribute('value')); - } - - public function getTests() - { - $body = new Node([new TextNode('foo', 1)]); - $node = new AutoEscapeNode(true, $body, 1); - - return [ - [$node, "// line 1\necho \"foo\";"], - ]; - } -} diff --git a/vendor/twig/twig/test/Twig/Tests/Node/BlockReferenceTest.php b/vendor/twig/twig/test/Twig/Tests/Node/BlockReferenceTest.php deleted file mode 100644 index ff021ff76f..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/BlockReferenceTest.php +++ /dev/null @@ -1,34 +0,0 @@ -<?php - -/* - * This file is part of Twig. - * - * (c) Fabien Potencier - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Twig\Node\BlockReferenceNode; -use Twig\Test\NodeTestCase; - -class Twig_Tests_Node_BlockReferenceTest extends NodeTestCase -{ - public function testConstructor() - { - $node = new BlockReferenceNode('foo', 1); - - $this->assertEquals('foo', $node->getAttribute('name')); - } - - public function getTests() - { - return [ - [new BlockReferenceNode('foo', 1), <<<EOF -// line 1 -\$this->displayBlock('foo', \$context, \$blocks); -EOF - ], - ]; - } -} diff --git a/vendor/twig/twig/test/Twig/Tests/Node/BlockTest.php b/vendor/twig/twig/test/Twig/Tests/Node/BlockTest.php deleted file mode 100644 index 8b4a1eca4a..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/BlockTest.php +++ /dev/null @@ -1,43 +0,0 @@ -<?php - -/* - * This file is part of Twig. - * - * (c) Fabien Potencier - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Twig\Node\BlockNode; -use Twig\Node\TextNode; -use Twig\Test\NodeTestCase; - -class Twig_Tests_Node_BlockTest extends NodeTestCase -{ - public function testConstructor() - { - $body = new TextNode('foo', 1); - $node = new BlockNode('foo', $body, 1); - - $this->assertEquals($body, $node->getNode('body')); - $this->assertEquals('foo', $node->getAttribute('name')); - } - - public function getTests() - { - $body = new TextNode('foo', 1); - $node = new BlockNode('foo', $body, 1); - - return [ - [$node, <<<EOF -// line 1 -public function block_foo(\$context, array \$blocks = []) -{ - echo "foo"; -} -EOF - ], - ]; - } -} diff --git a/vendor/twig/twig/test/Twig/Tests/Node/DeprecatedTest.php b/vendor/twig/twig/test/Twig/Tests/Node/DeprecatedTest.php deleted file mode 100644 index 2fb6f9621c..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/DeprecatedTest.php +++ /dev/null @@ -1,80 +0,0 @@ -<?php - -/* - * This file is part of Twig. - * - * (c) Fabien Potencier - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Twig\Environment; -use Twig\Node\DeprecatedNode; -use Twig\Node\Expression\ConstantExpression; -use Twig\Node\Expression\FunctionExpression; -use Twig\Node\IfNode; -use Twig\Node\Node; -use Twig\Test\NodeTestCase; -use Twig\TwigFunction; - -class Twig_Tests_Node_DeprecatedTest extends NodeTestCase -{ - public function testConstructor() - { - $expr = new ConstantExpression('foo', 1); - $node = new DeprecatedNode($expr, 1); - - $this->assertEquals($expr, $node->getNode('expr')); - } - - public function getTests() - { - $tests = []; - - $expr = new ConstantExpression('This section is deprecated', 1); - $node = new DeprecatedNode($expr, 1, 'deprecated'); - $node->setTemplateName('foo.twig'); - - $tests[] = [$node, <<<EOF -// line 1 -@trigger_error("This section is deprecated"." (\"foo.twig\" at line 1).", E_USER_DEPRECATED); -EOF - ]; - - $t = new Node([ - new ConstantExpression(true, 1), - new DeprecatedNode($expr, 2, 'deprecated'), - ], [], 1); - $node = new IfNode($t, null, 1); - $node->setTemplateName('foo.twig'); - - $tests[] = [$node, <<<EOF -// line 1 -if (true) { - // line 2 - @trigger_error("This section is deprecated"." (\"foo.twig\" at line 2).", E_USER_DEPRECATED); -} -EOF - ]; - - $environment = new Environment($this->getMockBuilder('\Twig\Loader\LoaderInterface')->getMock()); - $environment->addFunction(new TwigFunction('foo', 'foo', [])); - - $expr = new FunctionExpression('foo', new Node(), 1); - $node = new DeprecatedNode($expr, 1, 'deprecated'); - $node->setTemplateName('foo.twig'); - - $compiler = $this->getCompiler($environment); - $varName = $compiler->getVarName(); - - $tests[] = [$node, <<<EOF -// line 1 -\$$varName = foo(); -@trigger_error(\$$varName." (\"foo.twig\" at line 1).", E_USER_DEPRECATED); -EOF - , $environment]; - - return $tests; - } -} diff --git a/vendor/twig/twig/test/Twig/Tests/Node/DoTest.php b/vendor/twig/twig/test/Twig/Tests/Node/DoTest.php deleted file mode 100644 index ffddda4885..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/DoTest.php +++ /dev/null @@ -1,36 +0,0 @@ -<?php - -/* - * This file is part of Twig. - * - * (c) Fabien Potencier - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Twig\Node\DoNode; -use Twig\Node\Expression\ConstantExpression; -use Twig\Test\NodeTestCase; - -class Twig_Tests_Node_DoTest extends NodeTestCase -{ - public function testConstructor() - { - $expr = new ConstantExpression('foo', 1); - $node = new DoNode($expr, 1); - - $this->assertEquals($expr, $node->getNode('expr')); - } - - public function getTests() - { - $tests = []; - - $expr = new ConstantExpression('foo', 1); - $node = new DoNode($expr, 1); - $tests[] = [$node, "// line 1\n\"foo\";"]; - - return $tests; - } -} diff --git a/vendor/twig/twig/test/Twig/Tests/Node/Expression/ArrayTest.php b/vendor/twig/twig/test/Twig/Tests/Node/Expression/ArrayTest.php deleted file mode 100644 index 842dac40ca..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/Expression/ArrayTest.php +++ /dev/null @@ -1,41 +0,0 @@ -<?php - -/* - * This file is part of Twig. - * - * (c) Fabien Potencier - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Twig\Node\Expression\ArrayExpression; -use Twig\Node\Expression\ConstantExpression; -use Twig\Test\NodeTestCase; - -class Twig_Tests_Node_Expression_ArrayTest extends NodeTestCase -{ - public function testConstructor() - { - $elements = [new ConstantExpression('foo', 1), $foo = new ConstantExpression('bar', 1)]; - $node = new ArrayExpression($elements, 1); - - $this->assertEquals($foo, $node->getNode(1)); - } - - public function getTests() - { - $elements = [ - new ConstantExpression('foo', 1), - new ConstantExpression('bar', 1), - - new ConstantExpression('bar', 1), - new ConstantExpression('foo', 1), - ]; - $node = new ArrayExpression($elements, 1); - - return [ - [$node, '["foo" => "bar", "bar" => "foo"]'], - ]; - } -} diff --git a/vendor/twig/twig/test/Twig/Tests/Node/Expression/AssignNameTest.php b/vendor/twig/twig/test/Twig/Tests/Node/Expression/AssignNameTest.php deleted file mode 100644 index 47fddcae16..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/Expression/AssignNameTest.php +++ /dev/null @@ -1,32 +0,0 @@ -<?php - -/* - * This file is part of Twig. - * - * (c) Fabien Potencier - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Twig\Node\Expression\AssignNameExpression; -use Twig\Test\NodeTestCase; - -class Twig_Tests_Node_Expression_AssignNameTest extends NodeTestCase -{ - public function testConstructor() - { - $node = new AssignNameExpression('foo', 1); - - $this->assertEquals('foo', $node->getAttribute('name')); - } - - public function getTests() - { - $node = new AssignNameExpression('foo', 1); - - return [ - [$node, '$context["foo"]'], - ]; - } -} diff --git a/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/AddTest.php b/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/AddTest.php deleted file mode 100644 index d91ee8e5c5..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/AddTest.php +++ /dev/null @@ -1,38 +0,0 @@ -<?php - -/* - * This file is part of Twig. - * - * (c) Fabien Potencier - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Twig\Node\Expression\Binary\AddBinary; -use Twig\Node\Expression\ConstantExpression; -use Twig\Test\NodeTestCase; - -class Twig_Tests_Node_Expression_Binary_AddTest extends NodeTestCase -{ - public function testConstructor() - { - $left = new ConstantExpression(1, 1); - $right = new ConstantExpression(2, 1); - $node = new AddBinary($left, $right, 1); - - $this->assertEquals($left, $node->getNode('left')); - $this->assertEquals($right, $node->getNode('right')); - } - - public function getTests() - { - $left = new ConstantExpression(1, 1); - $right = new ConstantExpression(2, 1); - $node = new AddBinary($left, $right, 1); - - return [ - [$node, '(1 + 2)'], - ]; - } -} diff --git a/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/AndTest.php b/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/AndTest.php deleted file mode 100644 index 61cc1c935b..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/AndTest.php +++ /dev/null @@ -1,38 +0,0 @@ -<?php - -/* - * This file is part of Twig. - * - * (c) Fabien Potencier - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Twig\Node\Expression\Binary\AndBinary; -use Twig\Node\Expression\ConstantExpression; -use Twig\Test\NodeTestCase; - -class Twig_Tests_Node_Expression_Binary_AndTest extends NodeTestCase -{ - public function testConstructor() - { - $left = new ConstantExpression(1, 1); - $right = new ConstantExpression(2, 1); - $node = new AndBinary($left, $right, 1); - - $this->assertEquals($left, $node->getNode('left')); - $this->assertEquals($right, $node->getNode('right')); - } - - public function getTests() - { - $left = new ConstantExpression(1, 1); - $right = new ConstantExpression(2, 1); - $node = new AndBinary($left, $right, 1); - - return [ - [$node, '(1 && 2)'], - ]; - } -} diff --git a/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/ConcatTest.php b/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/ConcatTest.php deleted file mode 100644 index f8d4c6e6fe..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/ConcatTest.php +++ /dev/null @@ -1,38 +0,0 @@ -<?php - -/* - * This file is part of Twig. - * - * (c) Fabien Potencier - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Twig\Node\Expression\Binary\ConcatBinary; -use Twig\Node\Expression\ConstantExpression; -use Twig\Test\NodeTestCase; - -class Twig_Tests_Node_Expression_Binary_ConcatTest extends NodeTestCase -{ - public function testConstructor() - { - $left = new ConstantExpression(1, 1); - $right = new ConstantExpression(2, 1); - $node = new ConcatBinary($left, $right, 1); - - $this->assertEquals($left, $node->getNode('left')); - $this->assertEquals($right, $node->getNode('right')); - } - - public function getTests() - { - $left = new ConstantExpression(1, 1); - $right = new ConstantExpression(2, 1); - $node = new ConcatBinary($left, $right, 1); - - return [ - [$node, '(1 . 2)'], - ]; - } -} diff --git a/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/DivTest.php b/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/DivTest.php deleted file mode 100644 index b6054239c0..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/DivTest.php +++ /dev/null @@ -1,38 +0,0 @@ -<?php - -/* - * This file is part of Twig. - * - * (c) Fabien Potencier - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Twig\Node\Expression\Binary\DivBinary; -use Twig\Node\Expression\ConstantExpression; -use Twig\Test\NodeTestCase; - -class Twig_Tests_Node_Expression_Binary_DivTest extends NodeTestCase -{ - public function testConstructor() - { - $left = new ConstantExpression(1, 1); - $right = new ConstantExpression(2, 1); - $node = new DivBinary($left, $right, 1); - - $this->assertEquals($left, $node->getNode('left')); - $this->assertEquals($right, $node->getNode('right')); - } - - public function getTests() - { - $left = new ConstantExpression(1, 1); - $right = new ConstantExpression(2, 1); - $node = new DivBinary($left, $right, 1); - - return [ - [$node, '(1 / 2)'], - ]; - } -} diff --git a/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/FloorDivTest.php b/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/FloorDivTest.php deleted file mode 100644 index cb27e007d5..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/FloorDivTest.php +++ /dev/null @@ -1,38 +0,0 @@ -<?php - -/* - * This file is part of Twig. - * - * (c) Fabien Potencier - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Twig\Node\Expression\Binary\FloorDivBinary; -use Twig\Node\Expression\ConstantExpression; -use Twig\Test\NodeTestCase; - -class Twig_Tests_Node_Expression_Binary_FloorDivTest extends NodeTestCase -{ - public function testConstructor() - { - $left = new ConstantExpression(1, 1); - $right = new ConstantExpression(2, 1); - $node = new FloorDivBinary($left, $right, 1); - - $this->assertEquals($left, $node->getNode('left')); - $this->assertEquals($right, $node->getNode('right')); - } - - public function getTests() - { - $left = new ConstantExpression(1, 1); - $right = new ConstantExpression(2, 1); - $node = new FloorDivBinary($left, $right, 1); - - return [ - [$node, '(int) floor((1 / 2))'], - ]; - } -} diff --git a/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/ModTest.php b/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/ModTest.php deleted file mode 100644 index c5497cd6ff..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/ModTest.php +++ /dev/null @@ -1,38 +0,0 @@ -<?php - -/* - * This file is part of Twig. - * - * (c) Fabien Potencier - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Twig\Node\Expression\Binary\ModBinary; -use Twig\Node\Expression\ConstantExpression; -use Twig\Test\NodeTestCase; - -class Twig_Tests_Node_Expression_Binary_ModTest extends NodeTestCase -{ - public function testConstructor() - { - $left = new ConstantExpression(1, 1); - $right = new ConstantExpression(2, 1); - $node = new ModBinary($left, $right, 1); - - $this->assertEquals($left, $node->getNode('left')); - $this->assertEquals($right, $node->getNode('right')); - } - - public function getTests() - { - $left = new ConstantExpression(1, 1); - $right = new ConstantExpression(2, 1); - $node = new ModBinary($left, $right, 1); - - return [ - [$node, '(1 % 2)'], - ]; - } -} diff --git a/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/MulTest.php b/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/MulTest.php deleted file mode 100644 index 3b19b05857..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/MulTest.php +++ /dev/null @@ -1,38 +0,0 @@ -<?php - -/* - * This file is part of Twig. - * - * (c) Fabien Potencier - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Twig\Node\Expression\Binary\MulBinary; -use Twig\Node\Expression\ConstantExpression; -use Twig\Test\NodeTestCase; - -class Twig_Tests_Node_Expression_Binary_MulTest extends NodeTestCase -{ - public function testConstructor() - { - $left = new ConstantExpression(1, 1); - $right = new ConstantExpression(2, 1); - $node = new MulBinary($left, $right, 1); - - $this->assertEquals($left, $node->getNode('left')); - $this->assertEquals($right, $node->getNode('right')); - } - - public function getTests() - { - $left = new ConstantExpression(1, 1); - $right = new ConstantExpression(2, 1); - $node = new MulBinary($left, $right, 1); - - return [ - [$node, '(1 * 2)'], - ]; - } -} diff --git a/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/OrTest.php b/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/OrTest.php deleted file mode 100644 index 0f1c3bf431..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/OrTest.php +++ /dev/null @@ -1,38 +0,0 @@ -<?php - -/* - * This file is part of Twig. - * - * (c) Fabien Potencier - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Twig\Node\Expression\Binary\OrBinary; -use Twig\Node\Expression\ConstantExpression; -use Twig\Test\NodeTestCase; - -class Twig_Tests_Node_Expression_Binary_OrTest extends NodeTestCase -{ - public function testConstructor() - { - $left = new ConstantExpression(1, 1); - $right = new ConstantExpression(2, 1); - $node = new OrBinary($left, $right, 1); - - $this->assertEquals($left, $node->getNode('left')); - $this->assertEquals($right, $node->getNode('right')); - } - - public function getTests() - { - $left = new ConstantExpression(1, 1); - $right = new ConstantExpression(2, 1); - $node = new OrBinary($left, $right, 1); - - return [ - [$node, '(1 || 2)'], - ]; - } -} diff --git a/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/SubTest.php b/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/SubTest.php deleted file mode 100644 index 9955c4be4f..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/SubTest.php +++ /dev/null @@ -1,38 +0,0 @@ -<?php - -/* - * This file is part of Twig. - * - * (c) Fabien Potencier - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Twig\Node\Expression\Binary\SubBinary; -use Twig\Node\Expression\ConstantExpression; -use Twig\Test\NodeTestCase; - -class Twig_Tests_Node_Expression_Binary_SubTest extends NodeTestCase -{ - public function testConstructor() - { - $left = new ConstantExpression(1, 1); - $right = new ConstantExpression(2, 1); - $node = new SubBinary($left, $right, 1); - - $this->assertEquals($left, $node->getNode('left')); - $this->assertEquals($right, $node->getNode('right')); - } - - public function getTests() - { - $left = new ConstantExpression(1, 1); - $right = new ConstantExpression(2, 1); - $node = new SubBinary($left, $right, 1); - - return [ - [$node, '(1 - 2)'], - ]; - } -} diff --git a/vendor/twig/twig/test/Twig/Tests/Node/Expression/CallTest.php b/vendor/twig/twig/test/Twig/Tests/Node/Expression/CallTest.php deleted file mode 100644 index 32b5d19a7a..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/Expression/CallTest.php +++ /dev/null @@ -1,145 +0,0 @@ -<?php - -/* - * This file is part of Twig. - * - * (c) Fabien Potencier - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Twig\Node\Expression\CallExpression; - -class Twig_Tests_Node_Expression_CallTest extends \PHPUnit\Framework\TestCase -{ - public function testGetArguments() - { - $node = new Twig_Tests_Node_Expression_Call([], ['type' => 'function', 'name' => 'date']); - $this->assertEquals(['U', null], $node->getArguments('date', ['format' => 'U', 'timestamp' => null])); - } - - /** - * @expectedException \Twig\Error\SyntaxError - * @expectedExceptionMessage Positional arguments cannot be used after named arguments for function "date". - */ - public function testGetArgumentsWhenPositionalArgumentsAfterNamedArguments() - { - $node = new Twig_Tests_Node_Expression_Call([], ['type' => 'function', 'name' => 'date']); - $node->getArguments('date', ['timestamp' => 123456, 'Y-m-d']); - } - - /** - * @expectedException \Twig\Error\SyntaxError - * @expectedExceptionMessage Argument "format" is defined twice for function "date". - */ - public function testGetArgumentsWhenArgumentIsDefinedTwice() - { - $node = new Twig_Tests_Node_Expression_Call([], ['type' => 'function', 'name' => 'date']); - $node->getArguments('date', ['Y-m-d', 'format' => 'U']); - } - - /** - * @expectedException \Twig\Error\SyntaxError - * @expectedExceptionMessage Unknown argument "unknown" for function "date(format, timestamp)". - */ - public function testGetArgumentsWithWrongNamedArgumentName() - { - $node = new Twig_Tests_Node_Expression_Call([], ['type' => 'function', 'name' => 'date']); - $node->getArguments('date', ['Y-m-d', 'timestamp' => null, 'unknown' => '']); - } - - /** - * @expectedException \Twig\Error\SyntaxError - * @expectedExceptionMessage Unknown arguments "unknown1", "unknown2" for function "date(format, timestamp)". - */ - public function testGetArgumentsWithWrongNamedArgumentNames() - { - $node = new Twig_Tests_Node_Expression_Call([], ['type' => 'function', 'name' => 'date']); - $node->getArguments('date', ['Y-m-d', 'timestamp' => null, 'unknown1' => '', 'unknown2' => '']); - } - - /** - * @expectedException \Twig\Error\SyntaxError - * @expectedExceptionMessage Argument "case_sensitivity" could not be assigned for function "substr_compare(main_str, str, offset, length, case_sensitivity)" because it is mapped to an internal PHP function which cannot determine default value for optional argument "length". - */ - public function testResolveArgumentsWithMissingValueForOptionalArgument() - { - $node = new Twig_Tests_Node_Expression_Call([], ['type' => 'function', 'name' => 'substr_compare']); - $node->getArguments('substr_compare', ['abcd', 'bc', 'offset' => 1, 'case_sensitivity' => true]); - } - - public function testResolveArgumentsOnlyNecessaryArgumentsForCustomFunction() - { - $node = new Twig_Tests_Node_Expression_Call([], ['type' => 'function', 'name' => 'custom_function']); - - $this->assertEquals(['arg1'], $node->getArguments([$this, 'customFunction'], ['arg1' => 'arg1'])); - } - - public function testGetArgumentsForStaticMethod() - { - $node = new Twig_Tests_Node_Expression_Call([], ['type' => 'function', 'name' => 'custom_static_function']); - $this->assertEquals(['arg1'], $node->getArguments(__CLASS__.'::customStaticFunction', ['arg1' => 'arg1'])); - } - - /** - * @expectedException \LogicException - * @expectedExceptionMessage The last parameter of "Twig_Tests_Node_Expression_CallTest::customFunctionWithArbitraryArguments" for function "foo" must be an array with default value, eg. "array $arg = []". - */ - public function testResolveArgumentsWithMissingParameterForArbitraryArguments() - { - $node = new Twig_Tests_Node_Expression_Call([], ['type' => 'function', 'name' => 'foo', 'is_variadic' => true]); - $node->getArguments([$this, 'customFunctionWithArbitraryArguments'], []); - } - - public static function customStaticFunction($arg1, $arg2 = 'default', $arg3 = []) - { - } - - public function customFunction($arg1, $arg2 = 'default', $arg3 = []) - { - } - - public function customFunctionWithArbitraryArguments() - { - } - - /** - * @expectedException \LogicException - * @expectedExceptionMessageRegExp #^The last parameter of "custom_Twig_Tests_Node_Expression_CallTest_function" for function "foo" must be an array with default value, eg\. "array \$arg \= \[\]"\.$# - */ - public function testResolveArgumentsWithMissingParameterForArbitraryArgumentsOnFunction() - { - $node = new Twig_Tests_Node_Expression_Call([], ['type' => 'function', 'name' => 'foo', 'is_variadic' => true]); - $node->getArguments('custom_Twig_Tests_Node_Expression_CallTest_function', []); - } - - /** - * @expectedException \LogicException - * @expectedExceptionMessageRegExp #^The last parameter of "CallableTestClass\:\:__invoke" for function "foo" must be an array with default value, eg\. "array \$arg \= \[\]"\.$# - */ - public function testResolveArgumentsWithMissingParameterForArbitraryArgumentsOnObject() - { - $node = new Twig_Tests_Node_Expression_Call([], ['type' => 'function', 'name' => 'foo', 'is_variadic' => true]); - $node->getArguments(new CallableTestClass(), []); - } -} - -class Twig_Tests_Node_Expression_Call extends CallExpression -{ - public function getArguments($callable, $arguments) - { - return parent::getArguments($callable, $arguments); - } -} - -class CallableTestClass -{ - public function __invoke($required) - { - } -} - -function custom_Twig_Tests_Node_Expression_CallTest_function($required) -{ -} diff --git a/vendor/twig/twig/test/Twig/Tests/Node/Expression/ConditionalTest.php b/vendor/twig/twig/test/Twig/Tests/Node/Expression/ConditionalTest.php deleted file mode 100644 index 32be4d0e5e..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/Expression/ConditionalTest.php +++ /dev/null @@ -1,42 +0,0 @@ -<?php - -/* - * This file is part of Twig. - * - * (c) Fabien Potencier - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Twig\Node\Expression\ConditionalExpression; -use Twig\Node\Expression\ConstantExpression; -use Twig\Test\NodeTestCase; - -class Twig_Tests_Node_Expression_ConditionalTest extends NodeTestCase -{ - public function testConstructor() - { - $expr1 = new ConstantExpression(1, 1); - $expr2 = new ConstantExpression(2, 1); - $expr3 = new ConstantExpression(3, 1); - $node = new ConditionalExpression($expr1, $expr2, $expr3, 1); - - $this->assertEquals($expr1, $node->getNode('expr1')); - $this->assertEquals($expr2, $node->getNode('expr2')); - $this->assertEquals($expr3, $node->getNode('expr3')); - } - - public function getTests() - { - $tests = []; - - $expr1 = new ConstantExpression(1, 1); - $expr2 = new ConstantExpression(2, 1); - $expr3 = new ConstantExpression(3, 1); - $node = new ConditionalExpression($expr1, $expr2, $expr3, 1); - $tests[] = [$node, '((1) ? (2) : (3))']; - - return $tests; - } -} diff --git a/vendor/twig/twig/test/Twig/Tests/Node/Expression/ConstantTest.php b/vendor/twig/twig/test/Twig/Tests/Node/Expression/ConstantTest.php deleted file mode 100644 index ae38101b58..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/Expression/ConstantTest.php +++ /dev/null @@ -1,33 +0,0 @@ -<?php - -/* - * This file is part of Twig. - * - * (c) Fabien Potencier - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Twig\Node\Expression\ConstantExpression; -use Twig\Test\NodeTestCase; - -class Twig_Tests_Node_Expression_ConstantTest extends NodeTestCase -{ - public function testConstructor() - { - $node = new ConstantExpression('foo', 1); - - $this->assertEquals('foo', $node->getAttribute('value')); - } - - public function getTests() - { - $tests = []; - - $node = new ConstantExpression('foo', 1); - $tests[] = [$node, '"foo"']; - - return $tests; - } -} diff --git a/vendor/twig/twig/test/Twig/Tests/Node/Expression/FilterTest.php b/vendor/twig/twig/test/Twig/Tests/Node/Expression/FilterTest.php deleted file mode 100644 index 1cca1a57a9..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/Expression/FilterTest.php +++ /dev/null @@ -1,161 +0,0 @@ -<?php - -/* - * This file is part of Twig. - * - * (c) Fabien Potencier - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Twig\Environment; -use Twig\Node\Expression\ConstantExpression; -use Twig\Node\Expression\FilterExpression; -use Twig\Node\Node; -use Twig\Test\NodeTestCase; -use Twig\TwigFilter; - -class Twig_Tests_Node_Expression_FilterTest extends NodeTestCase -{ - public function testConstructor() - { - $expr = new ConstantExpression('foo', 1); - $name = new ConstantExpression('upper', 1); - $args = new Node(); - $node = new FilterExpression($expr, $name, $args, 1); - - $this->assertEquals($expr, $node->getNode('node')); - $this->assertEquals($name, $node->getNode('filter')); - $this->assertEquals($args, $node->getNode('arguments')); - } - - public function getTests() - { - $environment = new Environment($this->getMockBuilder('\Twig\Loader\LoaderInterface')->getMock()); - $environment->addFilter(new TwigFilter('bar', 'bar', ['needs_environment' => true])); - $environment->addFilter(new TwigFilter('barbar', 'twig_tests_filter_barbar', ['needs_context' => true, 'is_variadic' => true])); - - $tests = []; - - $expr = new ConstantExpression('foo', 1); - $node = $this->createFilter($expr, 'upper'); - $node = $this->createFilter($node, 'number_format', [new ConstantExpression(2, 1), new ConstantExpression('.', 1), new ConstantExpression(',', 1)]); - - if (\function_exists('mb_get_info')) { - $tests[] = [$node, 'twig_number_format_filter($this->env, twig_upper_filter($this->env, "foo"), 2, ".", ",")']; - } else { - $tests[] = [$node, 'twig_number_format_filter($this->env, strtoupper("foo"), 2, ".", ",")']; - } - - // named arguments - $date = new ConstantExpression(0, 1); - $node = $this->createFilter($date, 'date', [ - 'timezone' => new ConstantExpression('America/Chicago', 1), - 'format' => new ConstantExpression('d/m/Y H:i:s P', 1), - ]); - $tests[] = [$node, 'twig_date_format_filter($this->env, 0, "d/m/Y H:i:s P", "America/Chicago")']; - - // skip an optional argument - $date = new ConstantExpression(0, 1); - $node = $this->createFilter($date, 'date', [ - 'timezone' => new ConstantExpression('America/Chicago', 1), - ]); - $tests[] = [$node, 'twig_date_format_filter($this->env, 0, null, "America/Chicago")']; - - // underscores vs camelCase for named arguments - $string = new ConstantExpression('abc', 1); - $node = $this->createFilter($string, 'reverse', [ - 'preserve_keys' => new ConstantExpression(true, 1), - ]); - $tests[] = [$node, 'twig_reverse_filter($this->env, "abc", true)']; - $node = $this->createFilter($string, 'reverse', [ - 'preserveKeys' => new ConstantExpression(true, 1), - ]); - $tests[] = [$node, 'twig_reverse_filter($this->env, "abc", true)']; - - // filter as an anonymous function - if (PHP_VERSION_ID >= 50300) { - $node = $this->createFilter(new ConstantExpression('foo', 1), 'anonymous'); - $tests[] = [$node, 'call_user_func_array($this->env->getFilter(\'anonymous\')->getCallable(), ["foo"])']; - } - - // needs environment - $node = $this->createFilter($string, 'bar'); - $tests[] = [$node, 'bar($this->env, "abc")', $environment]; - - $node = $this->createFilter($string, 'bar', [new ConstantExpression('bar', 1)]); - $tests[] = [$node, 'bar($this->env, "abc", "bar")', $environment]; - - // arbitrary named arguments - $node = $this->createFilter($string, 'barbar'); - $tests[] = [$node, 'twig_tests_filter_barbar($context, "abc")', $environment]; - - $node = $this->createFilter($string, 'barbar', ['foo' => new ConstantExpression('bar', 1)]); - $tests[] = [$node, 'twig_tests_filter_barbar($context, "abc", null, null, ["foo" => "bar"])', $environment]; - - $node = $this->createFilter($string, 'barbar', ['arg2' => new ConstantExpression('bar', 1)]); - $tests[] = [$node, 'twig_tests_filter_barbar($context, "abc", null, "bar")', $environment]; - - $node = $this->createFilter($string, 'barbar', [ - new ConstantExpression('1', 1), - new ConstantExpression('2', 1), - new ConstantExpression('3', 1), - 'foo' => new ConstantExpression('bar', 1), - ]); - $tests[] = [$node, 'twig_tests_filter_barbar($context, "abc", "1", "2", [0 => "3", "foo" => "bar"])', $environment]; - - return $tests; - } - - /** - * @expectedException \Twig\Error\SyntaxError - * @expectedExceptionMessage Unknown argument "foobar" for filter "date(format, timezone)" at line 1. - */ - public function testCompileWithWrongNamedArgumentName() - { - $date = new ConstantExpression(0, 1); - $node = $this->createFilter($date, 'date', [ - 'foobar' => new ConstantExpression('America/Chicago', 1), - ]); - - $compiler = $this->getCompiler(); - $compiler->compile($node); - } - - /** - * @expectedException \Twig\Error\SyntaxError - * @expectedExceptionMessage Value for argument "from" is required for filter "replace" at line 1. - */ - public function testCompileWithMissingNamedArgument() - { - $value = new ConstantExpression(0, 1); - $node = $this->createFilter($value, 'replace', [ - 'to' => new ConstantExpression('foo', 1), - ]); - - $compiler = $this->getCompiler(); - $compiler->compile($node); - } - - protected function createFilter($node, $name, array $arguments = []) - { - $name = new ConstantExpression($name, 1); - $arguments = new Node($arguments); - - return new FilterExpression($node, $name, $arguments, 1); - } - - protected function getEnvironment() - { - if (PHP_VERSION_ID >= 50300) { - return include 'PHP53/FilterInclude.php'; - } - - return parent::getEnvironment(); - } -} - -function twig_tests_filter_barbar($context, $string, $arg1 = null, $arg2 = null, array $args = []) -{ -} diff --git a/vendor/twig/twig/test/Twig/Tests/Node/Expression/FunctionTest.php b/vendor/twig/twig/test/Twig/Tests/Node/Expression/FunctionTest.php deleted file mode 100644 index 51001a63f2..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/Expression/FunctionTest.php +++ /dev/null @@ -1,117 +0,0 @@ -<?php - -/* - * This file is part of Twig. - * - * (c) Fabien Potencier - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Twig\Environment; -use Twig\Node\Expression\ConstantExpression; -use Twig\Node\Expression\FunctionExpression; -use Twig\Node\Node; -use Twig\Test\NodeTestCase; -use Twig\TwigFunction; - -class Twig_Tests_Node_Expression_FunctionTest extends NodeTestCase -{ - public function testConstructor() - { - $name = 'function'; - $args = new Node(); - $node = new FunctionExpression($name, $args, 1); - - $this->assertEquals($name, $node->getAttribute('name')); - $this->assertEquals($args, $node->getNode('arguments')); - } - - public function getTests() - { - $environment = new Environment($this->getMockBuilder('\Twig\Loader\LoaderInterface')->getMock()); - $environment->addFunction(new TwigFunction('foo', 'foo', [])); - $environment->addFunction(new TwigFunction('bar', 'bar', ['needs_environment' => true])); - $environment->addFunction(new TwigFunction('foofoo', 'foofoo', ['needs_context' => true])); - $environment->addFunction(new TwigFunction('foobar', 'foobar', ['needs_environment' => true, 'needs_context' => true])); - $environment->addFunction(new TwigFunction('barbar', 'twig_tests_function_barbar', ['is_variadic' => true])); - - $tests = []; - - $node = $this->createFunction('foo'); - $tests[] = [$node, 'foo()', $environment]; - - $node = $this->createFunction('foo', [new ConstantExpression('bar', 1), new ConstantExpression('foobar', 1)]); - $tests[] = [$node, 'foo("bar", "foobar")', $environment]; - - $node = $this->createFunction('bar'); - $tests[] = [$node, 'bar($this->env)', $environment]; - - $node = $this->createFunction('bar', [new ConstantExpression('bar', 1)]); - $tests[] = [$node, 'bar($this->env, "bar")', $environment]; - - $node = $this->createFunction('foofoo'); - $tests[] = [$node, 'foofoo($context)', $environment]; - - $node = $this->createFunction('foofoo', [new ConstantExpression('bar', 1)]); - $tests[] = [$node, 'foofoo($context, "bar")', $environment]; - - $node = $this->createFunction('foobar'); - $tests[] = [$node, 'foobar($this->env, $context)', $environment]; - - $node = $this->createFunction('foobar', [new ConstantExpression('bar', 1)]); - $tests[] = [$node, 'foobar($this->env, $context, "bar")', $environment]; - - // named arguments - $node = $this->createFunction('date', [ - 'timezone' => new ConstantExpression('America/Chicago', 1), - 'date' => new ConstantExpression(0, 1), - ]); - $tests[] = [$node, 'twig_date_converter($this->env, 0, "America/Chicago")']; - - // arbitrary named arguments - $node = $this->createFunction('barbar'); - $tests[] = [$node, 'twig_tests_function_barbar()', $environment]; - - $node = $this->createFunction('barbar', ['foo' => new ConstantExpression('bar', 1)]); - $tests[] = [$node, 'twig_tests_function_barbar(null, null, ["foo" => "bar"])', $environment]; - - $node = $this->createFunction('barbar', ['arg2' => new ConstantExpression('bar', 1)]); - $tests[] = [$node, 'twig_tests_function_barbar(null, "bar")', $environment]; - - $node = $this->createFunction('barbar', [ - new ConstantExpression('1', 1), - new ConstantExpression('2', 1), - new ConstantExpression('3', 1), - 'foo' => new ConstantExpression('bar', 1), - ]); - $tests[] = [$node, 'twig_tests_function_barbar("1", "2", [0 => "3", "foo" => "bar"])', $environment]; - - // function as an anonymous function - if (PHP_VERSION_ID >= 50300) { - $node = $this->createFunction('anonymous', [new ConstantExpression('foo', 1)]); - $tests[] = [$node, 'call_user_func_array($this->env->getFunction(\'anonymous\')->getCallable(), ["foo"])']; - } - - return $tests; - } - - protected function createFunction($name, array $arguments = []) - { - return new FunctionExpression($name, new Node($arguments), 1); - } - - protected function getEnvironment() - { - if (PHP_VERSION_ID >= 50300) { - return include 'PHP53/FunctionInclude.php'; - } - - return parent::getEnvironment(); - } -} - -function twig_tests_function_barbar($arg1 = null, $arg2 = null, array $args = []) -{ -} diff --git a/vendor/twig/twig/test/Twig/Tests/Node/Expression/GetAttrTest.php b/vendor/twig/twig/test/Twig/Tests/Node/Expression/GetAttrTest.php deleted file mode 100644 index 036b421941..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/Expression/GetAttrTest.php +++ /dev/null @@ -1,57 +0,0 @@ -<?php - -/* - * This file is part of Twig. - * - * (c) Fabien Potencier - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Twig\Node\Expression\ArrayExpression; -use Twig\Node\Expression\ConstantExpression; -use Twig\Node\Expression\GetAttrExpression; -use Twig\Node\Expression\NameExpression; -use Twig\Template; -use Twig\Test\NodeTestCase; - -class Twig_Tests_Node_Expression_GetAttrTest extends NodeTestCase -{ - public function testConstructor() - { - $expr = new NameExpression('foo', 1); - $attr = new ConstantExpression('bar', 1); - $args = new ArrayExpression([], 1); - $args->addElement(new NameExpression('foo', 1)); - $args->addElement(new ConstantExpression('bar', 1)); - $node = new GetAttrExpression($expr, $attr, $args, Template::ARRAY_CALL, 1); - - $this->assertEquals($expr, $node->getNode('node')); - $this->assertEquals($attr, $node->getNode('attribute')); - $this->assertEquals($args, $node->getNode('arguments')); - $this->assertEquals(Template::ARRAY_CALL, $node->getAttribute('type')); - } - - public function getTests() - { - $tests = []; - - $expr = new NameExpression('foo', 1); - $attr = new ConstantExpression('bar', 1); - $args = new ArrayExpression([], 1); - $node = new GetAttrExpression($expr, $attr, $args, Template::ANY_CALL, 1); - $tests[] = [$node, sprintf('%s%s, "bar", [])', $this->getAttributeGetter(), $this->getVariableGetter('foo', 1))]; - - $node = new GetAttrExpression($expr, $attr, $args, Template::ARRAY_CALL, 1); - $tests[] = [$node, sprintf('%s%s, "bar", [], "array")', $this->getAttributeGetter(), $this->getVariableGetter('foo', 1))]; - - $args = new ArrayExpression([], 1); - $args->addElement(new NameExpression('foo', 1)); - $args->addElement(new ConstantExpression('bar', 1)); - $node = new GetAttrExpression($expr, $attr, $args, Template::METHOD_CALL, 1); - $tests[] = [$node, sprintf('%s%s, "bar", [0 => %s, 1 => "bar"], "method")', $this->getAttributeGetter(), $this->getVariableGetter('foo', 1), $this->getVariableGetter('foo'))]; - - return $tests; - } -} diff --git a/vendor/twig/twig/test/Twig/Tests/Node/Expression/NameTest.php b/vendor/twig/twig/test/Twig/Tests/Node/Expression/NameTest.php deleted file mode 100644 index 269c04b4c1..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/Expression/NameTest.php +++ /dev/null @@ -1,47 +0,0 @@ -<?php - -/* - * This file is part of Twig. - * - * (c) Fabien Potencier - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Twig\Environment; -use Twig\Node\Expression\NameExpression; -use Twig\Test\NodeTestCase; - -class Twig_Tests_Node_Expression_NameTest extends NodeTestCase -{ - public function testConstructor() - { - $node = new NameExpression('foo', 1); - - $this->assertEquals('foo', $node->getAttribute('name')); - } - - public function getTests() - { - $node = new NameExpression('foo', 1); - $context = new NameExpression('_context', 1); - - $env = new Environment($this->getMockBuilder('\Twig\Loader\LoaderInterface')->getMock(), ['strict_variables' => true]); - $env1 = new Environment($this->getMockBuilder('\Twig\Loader\LoaderInterface')->getMock(), ['strict_variables' => false]); - - if (PHP_VERSION_ID >= 70000) { - $output = '($context["foo"] ?? $this->getContext($context, "foo"))'; - } elseif (PHP_VERSION_ID >= 50400) { - $output = '(isset($context["foo"]) ? $context["foo"] : $this->getContext($context, "foo"))'; - } else { - $output = '$this->getContext($context, "foo")'; - } - - return [ - [$node, "// line 1\n".$output, $env], - [$node, $this->getVariableGetter('foo', 1), $env1], - [$context, "// line 1\n\$context"], - ]; - } -} diff --git a/vendor/twig/twig/test/Twig/Tests/Node/Expression/NullCoalesceTest.php b/vendor/twig/twig/test/Twig/Tests/Node/Expression/NullCoalesceTest.php deleted file mode 100644 index eb7c33573d..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/Expression/NullCoalesceTest.php +++ /dev/null @@ -1,36 +0,0 @@ -<?php - -/* - * This file is part of Twig. - * - * (c) Fabien Potencier - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Twig\Node\Expression\ConstantExpression; -use Twig\Node\Expression\NameExpression; -use Twig\Node\Expression\NullCoalesceExpression; -use Twig\Test\NodeTestCase; - -class Twig_Tests_Node_Expression_NullCoalesceTest extends NodeTestCase -{ - public function getTests() - { - $tests = []; - - $left = new NameExpression('foo', 1); - $right = new ConstantExpression(2, 1); - $node = new NullCoalesceExpression($left, $right, 1); - if (PHP_VERSION_ID >= 70000) { - $tests[] = [$node, "((// line 1\n\$context[\"foo\"]) ?? (2))"]; - } elseif (PHP_VERSION_ID >= 50400) { - $tests[] = [$node, "(((// line 1\n(isset(\$context[\"foo\"]) || array_key_exists(\"foo\", \$context)) && !(null === (isset(\$context[\"foo\"]) ? \$context[\"foo\"] : null)))) ? ((isset(\$context[\"foo\"]) ? \$context[\"foo\"] : null)) : (2))"]; - } else { - $tests[] = [$node, "(((// line 1\n(isset(\$context[\"foo\"]) || array_key_exists(\"foo\", \$context)) && !(null === \$this->getContext(\$context, \"foo\")))) ? (\$this->getContext(\$context, \"foo\")) : (2))"]; - } - - return $tests; - } -} diff --git a/vendor/twig/twig/test/Twig/Tests/Node/Expression/PHP53/FilterInclude.php b/vendor/twig/twig/test/Twig/Tests/Node/Expression/PHP53/FilterInclude.php deleted file mode 100644 index 5ea41d80bb..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/Expression/PHP53/FilterInclude.php +++ /dev/null @@ -1,6 +0,0 @@ -<?php - -$env = new \Twig\Environment(new \Twig\Loader\ArrayLoader([])); -$env->addFilter(new \Twig\TwigFilter('anonymous', function () {})); - -return $env; diff --git a/vendor/twig/twig/test/Twig/Tests/Node/Expression/PHP53/FunctionInclude.php b/vendor/twig/twig/test/Twig/Tests/Node/Expression/PHP53/FunctionInclude.php deleted file mode 100644 index 44cd979974..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/Expression/PHP53/FunctionInclude.php +++ /dev/null @@ -1,6 +0,0 @@ -<?php - -$env = new \Twig\Environment(new \Twig\Loader\ArrayLoader([])); -$env->addFunction(new \Twig\TwigFunction('anonymous', function () {})); - -return $env; diff --git a/vendor/twig/twig/test/Twig/Tests/Node/Expression/PHP53/TestInclude.php b/vendor/twig/twig/test/Twig/Tests/Node/Expression/PHP53/TestInclude.php deleted file mode 100644 index 1f30a71ecf..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/Expression/PHP53/TestInclude.php +++ /dev/null @@ -1,6 +0,0 @@ -<?php - -$env = new \Twig\Environment(new \Twig\Loader\ArrayLoader([])); -$env->addTest(new \Twig\TwigTest('anonymous', function () {})); - -return $env; diff --git a/vendor/twig/twig/test/Twig/Tests/Node/Expression/ParentTest.php b/vendor/twig/twig/test/Twig/Tests/Node/Expression/ParentTest.php deleted file mode 100644 index 0c3a9aafb1..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/Expression/ParentTest.php +++ /dev/null @@ -1,31 +0,0 @@ -<?php - -/* - * This file is part of Twig. - * - * (c) Fabien Potencier - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Twig\Node\Expression\ParentExpression; -use Twig\Test\NodeTestCase; - -class Twig_Tests_Node_Expression_ParentTest extends NodeTestCase -{ - public function testConstructor() - { - $node = new ParentExpression('foo', 1); - - $this->assertEquals('foo', $node->getAttribute('name')); - } - - public function getTests() - { - $tests = []; - $tests[] = [new ParentExpression('foo', 1), '$this->renderParentBlock("foo", $context, $blocks)']; - - return $tests; - } -} diff --git a/vendor/twig/twig/test/Twig/Tests/Node/Expression/TestTest.php b/vendor/twig/twig/test/Twig/Tests/Node/Expression/TestTest.php deleted file mode 100644 index ef7fb66ef3..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/Expression/TestTest.php +++ /dev/null @@ -1,90 +0,0 @@ -<?php - -/* - * This file is part of Twig. - * - * (c) Fabien Potencier - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Twig\Environment; -use Twig\Node\Expression\ConstantExpression; -use Twig\Node\Expression\Test\NullTest; -use Twig\Node\Expression\TestExpression; -use Twig\Node\Node; -use Twig\Test\NodeTestCase; -use Twig\TwigTest; - -class Twig_Tests_Node_Expression_TestTest extends NodeTestCase -{ - public function testConstructor() - { - $expr = new ConstantExpression('foo', 1); - $name = new ConstantExpression('null', 1); - $args = new Node(); - $node = new TestExpression($expr, $name, $args, 1); - - $this->assertEquals($expr, $node->getNode('node')); - $this->assertEquals($args, $node->getNode('arguments')); - $this->assertEquals($name, $node->getAttribute('name')); - } - - public function getTests() - { - $environment = new Environment($this->getMockBuilder('\Twig\Loader\LoaderInterface')->getMock()); - $environment->addTest(new TwigTest('barbar', 'twig_tests_test_barbar', ['is_variadic' => true, 'need_context' => true])); - - $tests = []; - - $expr = new ConstantExpression('foo', 1); - $node = new NullTest($expr, 'null', new Node([]), 1); - $tests[] = [$node, '(null === "foo")']; - - // test as an anonymous function - if (PHP_VERSION_ID >= 50300) { - $node = $this->createTest(new ConstantExpression('foo', 1), 'anonymous', [new ConstantExpression('foo', 1)]); - $tests[] = [$node, 'call_user_func_array($this->env->getTest(\'anonymous\')->getCallable(), ["foo", "foo"])']; - } - - // arbitrary named arguments - $string = new ConstantExpression('abc', 1); - $node = $this->createTest($string, 'barbar'); - $tests[] = [$node, 'twig_tests_test_barbar("abc")', $environment]; - - $node = $this->createTest($string, 'barbar', ['foo' => new ConstantExpression('bar', 1)]); - $tests[] = [$node, 'twig_tests_test_barbar("abc", null, null, ["foo" => "bar"])', $environment]; - - $node = $this->createTest($string, 'barbar', ['arg2' => new ConstantExpression('bar', 1)]); - $tests[] = [$node, 'twig_tests_test_barbar("abc", null, "bar")', $environment]; - - $node = $this->createTest($string, 'barbar', [ - new ConstantExpression('1', 1), - new ConstantExpression('2', 1), - new ConstantExpression('3', 1), - 'foo' => new ConstantExpression('bar', 1), - ]); - $tests[] = [$node, 'twig_tests_test_barbar("abc", "1", "2", [0 => "3", "foo" => "bar"])', $environment]; - - return $tests; - } - - protected function createTest($node, $name, array $arguments = []) - { - return new TestExpression($node, $name, new Node($arguments), 1); - } - - protected function getEnvironment() - { - if (PHP_VERSION_ID >= 50300) { - return include 'PHP53/TestInclude.php'; - } - - return parent::getEnvironment(); - } -} - -function twig_tests_test_barbar($string, $arg1 = null, $arg2 = null, array $args = []) -{ -} diff --git a/vendor/twig/twig/test/Twig/Tests/Node/Expression/Unary/NegTest.php b/vendor/twig/twig/test/Twig/Tests/Node/Expression/Unary/NegTest.php deleted file mode 100644 index 6c976ad4ca..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/Expression/Unary/NegTest.php +++ /dev/null @@ -1,36 +0,0 @@ -<?php - -/* - * This file is part of Twig. - * - * (c) Fabien Potencier - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Twig\Node\Expression\ConstantExpression; -use Twig\Node\Expression\Unary\NegUnary; -use Twig\Test\NodeTestCase; - -class Twig_Tests_Node_Expression_Unary_NegTest extends NodeTestCase -{ - public function testConstructor() - { - $expr = new ConstantExpression(1, 1); - $node = new NegUnary($expr, 1); - - $this->assertEquals($expr, $node->getNode('node')); - } - - public function getTests() - { - $node = new ConstantExpression(1, 1); - $node = new NegUnary($node, 1); - - return [ - [$node, '-1'], - [new NegUnary($node, 1), '- -1'], - ]; - } -} diff --git a/vendor/twig/twig/test/Twig/Tests/Node/Expression/Unary/NotTest.php b/vendor/twig/twig/test/Twig/Tests/Node/Expression/Unary/NotTest.php deleted file mode 100644 index 493a37e550..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/Expression/Unary/NotTest.php +++ /dev/null @@ -1,35 +0,0 @@ -<?php - -/* - * This file is part of Twig. - * - * (c) Fabien Potencier - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Twig\Node\Expression\ConstantExpression; -use Twig\Node\Expression\Unary\NotUnary; -use Twig\Test\NodeTestCase; - -class Twig_Tests_Node_Expression_Unary_NotTest extends NodeTestCase -{ - public function testConstructor() - { - $expr = new ConstantExpression(1, 1); - $node = new NotUnary($expr, 1); - - $this->assertEquals($expr, $node->getNode('node')); - } - - public function getTests() - { - $node = new ConstantExpression(1, 1); - $node = new NotUnary($node, 1); - - return [ - [$node, '!1'], - ]; - } -} diff --git a/vendor/twig/twig/test/Twig/Tests/Node/Expression/Unary/PosTest.php b/vendor/twig/twig/test/Twig/Tests/Node/Expression/Unary/PosTest.php deleted file mode 100644 index 015446d437..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/Expression/Unary/PosTest.php +++ /dev/null @@ -1,35 +0,0 @@ -<?php - -/* - * This file is part of Twig. - * - * (c) Fabien Potencier - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Twig\Node\Expression\ConstantExpression; -use Twig\Node\Expression\Unary\PosUnary; -use Twig\Test\NodeTestCase; - -class Twig_Tests_Node_Expression_Unary_PosTest extends NodeTestCase -{ - public function testConstructor() - { - $expr = new ConstantExpression(1, 1); - $node = new PosUnary($expr, 1); - - $this->assertEquals($expr, $node->getNode('node')); - } - - public function getTests() - { - $node = new ConstantExpression(1, 1); - $node = new PosUnary($node, 1); - - return [ - [$node, '+1'], - ]; - } -} diff --git a/vendor/twig/twig/test/Twig/Tests/Node/ForTest.php b/vendor/twig/twig/test/Twig/Tests/Node/ForTest.php deleted file mode 100644 index 44b986e46f..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/ForTest.php +++ /dev/null @@ -1,199 +0,0 @@ -<?php - -/* - * This file is part of Twig. - * - * (c) Fabien Potencier - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Twig\Node\Expression\AssignNameExpression; -use Twig\Node\Expression\ConstantExpression; -use Twig\Node\Expression\NameExpression; -use Twig\Node\ForNode; -use Twig\Node\Node; -use Twig\Node\PrintNode; -use Twig\Test\NodeTestCase; - -class Twig_Tests_Node_ForTest extends NodeTestCase -{ - public function testConstructor() - { - $keyTarget = new AssignNameExpression('key', 1); - $valueTarget = new AssignNameExpression('item', 1); - $seq = new NameExpression('items', 1); - $ifexpr = new ConstantExpression(true, 1); - $body = new Node([new PrintNode(new NameExpression('foo', 1), 1)], [], 1); - $else = null; - $node = new ForNode($keyTarget, $valueTarget, $seq, $ifexpr, $body, $else, 1); - $node->setAttribute('with_loop', false); - - $this->assertEquals($keyTarget, $node->getNode('key_target')); - $this->assertEquals($valueTarget, $node->getNode('value_target')); - $this->assertEquals($seq, $node->getNode('seq')); - $this->assertTrue($node->getAttribute('ifexpr')); - $this->assertInstanceOf('\Twig\Node\IfNode', $node->getNode('body')); - $this->assertEquals($body, $node->getNode('body')->getNode('tests')->getNode(1)->getNode(0)); - $this->assertFalse($node->hasNode('else')); - - $else = new PrintNode(new NameExpression('foo', 1), 1); - $node = new ForNode($keyTarget, $valueTarget, $seq, $ifexpr, $body, $else, 1); - $node->setAttribute('with_loop', false); - $this->assertEquals($else, $node->getNode('else')); - } - - public function getTests() - { - $tests = []; - - $keyTarget = new AssignNameExpression('key', 1); - $valueTarget = new AssignNameExpression('item', 1); - $seq = new NameExpression('items', 1); - $ifexpr = null; - $body = new Node([new PrintNode(new NameExpression('foo', 1), 1)], [], 1); - $else = null; - $node = new ForNode($keyTarget, $valueTarget, $seq, $ifexpr, $body, $else, 1); - $node->setAttribute('with_loop', false); - - $tests[] = [$node, <<<EOF -// line 1 -\$context['_parent'] = \$context; -\$context['_seq'] = twig_ensure_traversable({$this->getVariableGetter('items')}); -foreach (\$context['_seq'] as \$context["key"] => \$context["item"]) { - echo {$this->getVariableGetter('foo')}; -} -\$_parent = \$context['_parent']; -unset(\$context['_seq'], \$context['_iterated'], \$context['key'], \$context['item'], \$context['_parent'], \$context['loop']); -\$context = array_intersect_key(\$context, \$_parent) + \$_parent; -EOF - ]; - - $keyTarget = new AssignNameExpression('k', 1); - $valueTarget = new AssignNameExpression('v', 1); - $seq = new NameExpression('values', 1); - $ifexpr = null; - $body = new Node([new PrintNode(new NameExpression('foo', 1), 1)], [], 1); - $else = null; - $node = new ForNode($keyTarget, $valueTarget, $seq, $ifexpr, $body, $else, 1); - $node->setAttribute('with_loop', true); - - $tests[] = [$node, <<<EOF -// line 1 -\$context['_parent'] = \$context; -\$context['_seq'] = twig_ensure_traversable({$this->getVariableGetter('values')}); -\$context['loop'] = [ - 'parent' => \$context['_parent'], - 'index0' => 0, - 'index' => 1, - 'first' => true, -]; -if (is_array(\$context['_seq']) || (is_object(\$context['_seq']) && \$context['_seq'] instanceof \Countable)) { - \$length = count(\$context['_seq']); - \$context['loop']['revindex0'] = \$length - 1; - \$context['loop']['revindex'] = \$length; - \$context['loop']['length'] = \$length; - \$context['loop']['last'] = 1 === \$length; -} -foreach (\$context['_seq'] as \$context["k"] => \$context["v"]) { - echo {$this->getVariableGetter('foo')}; - ++\$context['loop']['index0']; - ++\$context['loop']['index']; - \$context['loop']['first'] = false; - if (isset(\$context['loop']['length'])) { - --\$context['loop']['revindex0']; - --\$context['loop']['revindex']; - \$context['loop']['last'] = 0 === \$context['loop']['revindex0']; - } -} -\$_parent = \$context['_parent']; -unset(\$context['_seq'], \$context['_iterated'], \$context['k'], \$context['v'], \$context['_parent'], \$context['loop']); -\$context = array_intersect_key(\$context, \$_parent) + \$_parent; -EOF - ]; - - $keyTarget = new AssignNameExpression('k', 1); - $valueTarget = new AssignNameExpression('v', 1); - $seq = new NameExpression('values', 1); - $ifexpr = new ConstantExpression(true, 1); - $body = new Node([new PrintNode(new NameExpression('foo', 1), 1)], [], 1); - $else = null; - $node = new ForNode($keyTarget, $valueTarget, $seq, $ifexpr, $body, $else, 1); - $node->setAttribute('with_loop', true); - - $tests[] = [$node, <<<EOF -// line 1 -\$context['_parent'] = \$context; -\$context['_seq'] = twig_ensure_traversable({$this->getVariableGetter('values')}); -\$context['loop'] = [ - 'parent' => \$context['_parent'], - 'index0' => 0, - 'index' => 1, - 'first' => true, -]; -foreach (\$context['_seq'] as \$context["k"] => \$context["v"]) { - if (true) { - echo {$this->getVariableGetter('foo')}; - ++\$context['loop']['index0']; - ++\$context['loop']['index']; - \$context['loop']['first'] = false; - } -} -\$_parent = \$context['_parent']; -unset(\$context['_seq'], \$context['_iterated'], \$context['k'], \$context['v'], \$context['_parent'], \$context['loop']); -\$context = array_intersect_key(\$context, \$_parent) + \$_parent; -EOF - ]; - - $keyTarget = new AssignNameExpression('k', 1); - $valueTarget = new AssignNameExpression('v', 1); - $seq = new NameExpression('values', 1); - $ifexpr = null; - $body = new Node([new PrintNode(new NameExpression('foo', 1), 1)], [], 1); - $else = new PrintNode(new NameExpression('foo', 1), 1); - $node = new ForNode($keyTarget, $valueTarget, $seq, $ifexpr, $body, $else, 1); - $node->setAttribute('with_loop', true); - - $tests[] = [$node, <<<EOF -// line 1 -\$context['_parent'] = \$context; -\$context['_seq'] = twig_ensure_traversable({$this->getVariableGetter('values')}); -\$context['_iterated'] = false; -\$context['loop'] = [ - 'parent' => \$context['_parent'], - 'index0' => 0, - 'index' => 1, - 'first' => true, -]; -if (is_array(\$context['_seq']) || (is_object(\$context['_seq']) && \$context['_seq'] instanceof \Countable)) { - \$length = count(\$context['_seq']); - \$context['loop']['revindex0'] = \$length - 1; - \$context['loop']['revindex'] = \$length; - \$context['loop']['length'] = \$length; - \$context['loop']['last'] = 1 === \$length; -} -foreach (\$context['_seq'] as \$context["k"] => \$context["v"]) { - echo {$this->getVariableGetter('foo')}; - \$context['_iterated'] = true; - ++\$context['loop']['index0']; - ++\$context['loop']['index']; - \$context['loop']['first'] = false; - if (isset(\$context['loop']['length'])) { - --\$context['loop']['revindex0']; - --\$context['loop']['revindex']; - \$context['loop']['last'] = 0 === \$context['loop']['revindex0']; - } -} -if (!\$context['_iterated']) { - echo {$this->getVariableGetter('foo')}; -} -\$_parent = \$context['_parent']; -unset(\$context['_seq'], \$context['_iterated'], \$context['k'], \$context['v'], \$context['_parent'], \$context['loop']); -\$context = array_intersect_key(\$context, \$_parent) + \$_parent; -EOF - ]; - - return $tests; - } -} diff --git a/vendor/twig/twig/test/Twig/Tests/Node/IfTest.php b/vendor/twig/twig/test/Twig/Tests/Node/IfTest.php deleted file mode 100644 index 82a6959319..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/IfTest.php +++ /dev/null @@ -1,95 +0,0 @@ -<?php - -/* - * This file is part of Twig. - * - * (c) Fabien Potencier - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Twig\Node\Expression\ConstantExpression; -use Twig\Node\Expression\NameExpression; -use Twig\Node\IfNode; -use Twig\Node\Node; -use Twig\Node\PrintNode; -use Twig\Test\NodeTestCase; - -class Twig_Tests_Node_IfTest extends NodeTestCase -{ - public function testConstructor() - { - $t = new Node([ - new ConstantExpression(true, 1), - new PrintNode(new NameExpression('foo', 1), 1), - ], [], 1); - $else = null; - $node = new IfNode($t, $else, 1); - - $this->assertEquals($t, $node->getNode('tests')); - $this->assertFalse($node->hasNode('else')); - - $else = new PrintNode(new NameExpression('bar', 1), 1); - $node = new IfNode($t, $else, 1); - $this->assertEquals($else, $node->getNode('else')); - } - - public function getTests() - { - $tests = []; - - $t = new Node([ - new ConstantExpression(true, 1), - new PrintNode(new NameExpression('foo', 1), 1), - ], [], 1); - $else = null; - $node = new IfNode($t, $else, 1); - - $tests[] = [$node, <<<EOF -// line 1 -if (true) { - echo {$this->getVariableGetter('foo')}; -} -EOF - ]; - - $t = new Node([ - new ConstantExpression(true, 1), - new PrintNode(new NameExpression('foo', 1), 1), - new ConstantExpression(false, 1), - new PrintNode(new NameExpression('bar', 1), 1), - ], [], 1); - $else = null; - $node = new IfNode($t, $else, 1); - - $tests[] = [$node, <<<EOF -// line 1 -if (true) { - echo {$this->getVariableGetter('foo')}; -} elseif (false) { - echo {$this->getVariableGetter('bar')}; -} -EOF - ]; - - $t = new Node([ - new ConstantExpression(true, 1), - new PrintNode(new NameExpression('foo', 1), 1), - ], [], 1); - $else = new PrintNode(new NameExpression('bar', 1), 1); - $node = new IfNode($t, $else, 1); - - $tests[] = [$node, <<<EOF -// line 1 -if (true) { - echo {$this->getVariableGetter('foo')}; -} else { - echo {$this->getVariableGetter('bar')}; -} -EOF - ]; - - return $tests; - } -} diff --git a/vendor/twig/twig/test/Twig/Tests/Node/ImportTest.php b/vendor/twig/twig/test/Twig/Tests/Node/ImportTest.php deleted file mode 100644 index 2118bff59b..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/ImportTest.php +++ /dev/null @@ -1,45 +0,0 @@ -<?php - -/* - * This file is part of Twig. - * - * (c) Fabien Potencier - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Twig\Node\Expression\AssignNameExpression; -use Twig\Node\Expression\ConstantExpression; -use Twig\Node\ImportNode; -use Twig\Test\NodeTestCase; - -class Twig_Tests_Node_ImportTest extends NodeTestCase -{ - public function testConstructor() - { - $macro = new ConstantExpression('foo.twig', 1); - $var = new AssignNameExpression('macro', 1); - $node = new ImportNode($macro, $var, 1); - - $this->assertEquals($macro, $node->getNode('expr')); - $this->assertEquals($var, $node->getNode('var')); - } - - public function getTests() - { - $tests = []; - - $macro = new ConstantExpression('foo.twig', 1); - $var = new AssignNameExpression('macro', 1); - $node = new ImportNode($macro, $var, 1); - - $tests[] = [$node, <<<EOF -// line 1 -\$context["macro"] = \$this->loadTemplate("foo.twig", null, 1)->unwrap(); -EOF - ]; - - return $tests; - } -} diff --git a/vendor/twig/twig/test/Twig/Tests/Node/IncludeTest.php b/vendor/twig/twig/test/Twig/Tests/Node/IncludeTest.php deleted file mode 100644 index ae8ff074c1..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/IncludeTest.php +++ /dev/null @@ -1,93 +0,0 @@ -<?php - -/* - * This file is part of Twig. - * - * (c) Fabien Potencier - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Twig\Node\Expression\ArrayExpression; -use Twig\Node\Expression\ConditionalExpression; -use Twig\Node\Expression\ConstantExpression; -use Twig\Node\IncludeNode; -use Twig\Test\NodeTestCase; - -class Twig_Tests_Node_IncludeTest extends NodeTestCase -{ - public function testConstructor() - { - $expr = new ConstantExpression('foo.twig', 1); - $node = new IncludeNode($expr, null, false, false, 1); - - $this->assertFalse($node->hasNode('variables')); - $this->assertEquals($expr, $node->getNode('expr')); - $this->assertFalse($node->getAttribute('only')); - - $vars = new ArrayExpression([new ConstantExpression('foo', 1), new ConstantExpression(true, 1)], 1); - $node = new IncludeNode($expr, $vars, true, false, 1); - $this->assertEquals($vars, $node->getNode('variables')); - $this->assertTrue($node->getAttribute('only')); - } - - public function getTests() - { - $tests = []; - - $expr = new ConstantExpression('foo.twig', 1); - $node = new IncludeNode($expr, null, false, false, 1); - $tests[] = [$node, <<<EOF -// line 1 -\$this->loadTemplate("foo.twig", null, 1)->display(\$context); -EOF - ]; - - $expr = new ConditionalExpression( - new ConstantExpression(true, 1), - new ConstantExpression('foo', 1), - new ConstantExpression('foo', 1), - 0 - ); - $node = new IncludeNode($expr, null, false, false, 1); - $tests[] = [$node, <<<EOF -// line 1 -\$this->loadTemplate(((true) ? ("foo") : ("foo")), null, 1)->display(\$context); -EOF - ]; - - $expr = new ConstantExpression('foo.twig', 1); - $vars = new ArrayExpression([new ConstantExpression('foo', 1), new ConstantExpression(true, 1)], 1); - $node = new IncludeNode($expr, $vars, false, false, 1); - $tests[] = [$node, <<<EOF -// line 1 -\$this->loadTemplate("foo.twig", null, 1)->display(twig_array_merge(\$context, ["foo" => true])); -EOF - ]; - - $node = new IncludeNode($expr, $vars, true, false, 1); - $tests[] = [$node, <<<EOF -// line 1 -\$this->loadTemplate("foo.twig", null, 1)->display(twig_to_array(["foo" => true])); -EOF - ]; - - $node = new IncludeNode($expr, $vars, true, true, 1); - $tests[] = [$node, <<<EOF -// line 1 -\$__internal_%s = null; -try { - \$__internal_%s = \$this->loadTemplate("foo.twig", null, 1); -} catch (LoaderError \$e) { - // ignore missing template -} -if (\$__internal_%s) { - \$__internal_%s->display(twig_to_array(["foo" => true])); -} -EOF - , null, true]; - - return $tests; - } -} diff --git a/vendor/twig/twig/test/Twig/Tests/Node/MacroTest.php b/vendor/twig/twig/test/Twig/Tests/Node/MacroTest.php deleted file mode 100644 index 424d7dab42..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/MacroTest.php +++ /dev/null @@ -1,81 +0,0 @@ -<?php - -/* - * This file is part of Twig. - * - * (c) Fabien Potencier - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Twig\Node\Expression\ConstantExpression; -use Twig\Node\Expression\NameExpression; -use Twig\Node\MacroNode; -use Twig\Node\Node; -use Twig\Node\TextNode; -use Twig\Test\NodeTestCase; - -class Twig_Tests_Node_MacroTest extends NodeTestCase -{ - public function testConstructor() - { - $body = new TextNode('foo', 1); - $arguments = new Node([new NameExpression('foo', 1)], [], 1); - $node = new MacroNode('foo', $body, $arguments, 1); - - $this->assertEquals($body, $node->getNode('body')); - $this->assertEquals($arguments, $node->getNode('arguments')); - $this->assertEquals('foo', $node->getAttribute('name')); - } - - public function getTests() - { - $body = new TextNode('foo', 1); - $arguments = new Node([ - 'foo' => new ConstantExpression(null, 1), - 'bar' => new ConstantExpression('Foo', 1), - ], [], 1); - $node = new MacroNode('foo', $body, $arguments, 1); - - if (PHP_VERSION_ID >= 50600) { - $declaration = ', ...$__varargs__'; - $varargs = '$__varargs__'; - } else { - $declaration = ''; - $varargs = 'func_num_args() > 2 ? array_slice(func_get_args(), 2) : []'; - } - - return [ - [$node, <<<EOF -// line 1 -public function getfoo(\$__foo__ = null, \$__bar__ = "Foo"$declaration) -{ - \$context = \$this->env->mergeGlobals([ - "foo" => \$__foo__, - "bar" => \$__bar__, - "varargs" => $varargs, - ]); - - \$blocks = []; - - ob_start(function () { return ''; }); - try { - echo "foo"; - } catch (\Exception \$e) { - ob_end_clean(); - - throw \$e; - } catch (\Throwable \$e) { - ob_end_clean(); - - throw \$e; - } - - return ('' === \$tmp = ob_get_clean()) ? '' : new Markup(\$tmp, \$this->env->getCharset()); -} -EOF - ], - ]; - } -} diff --git a/vendor/twig/twig/test/Twig/Tests/Node/ModuleTest.php b/vendor/twig/twig/test/Twig/Tests/Node/ModuleTest.php deleted file mode 100644 index 1eb337fd03..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/ModuleTest.php +++ /dev/null @@ -1,268 +0,0 @@ -<?php - -/* - * This file is part of Twig. - * - * (c) Fabien Potencier - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Twig\Environment; -use Twig\Node\Expression\AssignNameExpression; -use Twig\Node\Expression\ConditionalExpression; -use Twig\Node\Expression\ConstantExpression; -use Twig\Node\ImportNode; -use Twig\Node\ModuleNode; -use Twig\Node\Node; -use Twig\Node\SetNode; -use Twig\Node\TextNode; -use Twig\Source; -use Twig\Test\NodeTestCase; - -class Twig_Tests_Node_ModuleTest extends NodeTestCase -{ - public function testConstructor() - { - $body = new TextNode('foo', 1); - $parent = new ConstantExpression('layout.twig', 1); - $blocks = new Node(); - $macros = new Node(); - $traits = new Node(); - $source = new Source('{{ foo }}', 'foo.twig'); - $node = new ModuleNode($body, $parent, $blocks, $macros, $traits, new Node([]), $source); - - $this->assertEquals($body, $node->getNode('body')); - $this->assertEquals($blocks, $node->getNode('blocks')); - $this->assertEquals($macros, $node->getNode('macros')); - $this->assertEquals($parent, $node->getNode('parent')); - $this->assertEquals($source->getName(), $node->getTemplateName()); - } - - public function getTests() - { - $twig = new Environment($this->getMockBuilder('\Twig\Loader\LoaderInterface')->getMock()); - - $tests = []; - - $body = new TextNode('foo', 1); - $extends = null; - $blocks = new Node(); - $macros = new Node(); - $traits = new Node(); - $source = new Source('{{ foo }}', 'foo.twig'); - - $node = new ModuleNode($body, $extends, $blocks, $macros, $traits, new Node([]), $source); - $tests[] = [$node, <<<EOF -<?php - -use Twig\Environment; -use Twig\Error\LoaderError; -use Twig\Error\RuntimeError; -use Twig\Markup; -use Twig\Sandbox\SecurityError; -use Twig\Sandbox\SecurityNotAllowedTagError; -use Twig\Sandbox\SecurityNotAllowedFilterError; -use Twig\Sandbox\SecurityNotAllowedFunctionError; -use Twig\Source; -use Twig\Template; - -/* foo.twig */ -class __TwigTemplate_%x extends \Twig\Template -{ - public function __construct(Environment \$env) - { - parent::__construct(\$env); - - \$this->parent = false; - - \$this->blocks = [ - ]; - } - - protected function doDisplay(array \$context, array \$blocks = []) - { - // line 1 - echo "foo"; - } - - public function getTemplateName() - { - return "foo.twig"; - } - - public function getDebugInfo() - { - return array ( 30 => 1,); - } - - /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */ - public function getSource() - { - @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); - - return \$this->getSourceContext()->getCode(); - } - - public function getSourceContext() - { - return new Source("", "foo.twig", ""); - } -} -EOF - , $twig, true]; - - $import = new ImportNode(new ConstantExpression('foo.twig', 1), new AssignNameExpression('macro', 1), 2); - - $body = new Node([$import]); - $extends = new ConstantExpression('layout.twig', 1); - - $node = new ModuleNode($body, $extends, $blocks, $macros, $traits, new Node([]), $source); - $tests[] = [$node, <<<EOF -<?php - -use Twig\Environment; -use Twig\Error\LoaderError; -use Twig\Error\RuntimeError; -use Twig\Markup; -use Twig\Sandbox\SecurityError; -use Twig\Sandbox\SecurityNotAllowedTagError; -use Twig\Sandbox\SecurityNotAllowedFilterError; -use Twig\Sandbox\SecurityNotAllowedFunctionError; -use Twig\Source; -use Twig\Template; - -/* foo.twig */ -class __TwigTemplate_%x extends \Twig\Template -{ - public function __construct(Environment \$env) - { - parent::__construct(\$env); - - \$this->blocks = [ - ]; - } - - protected function doGetParent(array \$context) - { - // line 1 - return "layout.twig"; - } - - protected function doDisplay(array \$context, array \$blocks = []) - { - // line 2 - \$context["macro"] = \$this->loadTemplate("foo.twig", "foo.twig", 2)->unwrap(); - // line 1 - \$this->parent = \$this->loadTemplate("layout.twig", "foo.twig", 1); - \$this->parent->display(\$context, array_merge(\$this->blocks, \$blocks)); - } - - public function getTemplateName() - { - return "foo.twig"; - } - - public function isTraitable() - { - return false; - } - - public function getDebugInfo() - { - return array ( 36 => 1, 34 => 2, 28 => 1,); - } - - /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */ - public function getSource() - { - @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); - - return \$this->getSourceContext()->getCode(); - } - - public function getSourceContext() - { - return new Source("", "foo.twig", ""); - } -} -EOF - , $twig, true]; - - $set = new SetNode(false, new Node([new AssignNameExpression('foo', 4)]), new Node([new ConstantExpression('foo', 4)]), 4); - $body = new Node([$set]); - $extends = new ConditionalExpression( - new ConstantExpression(true, 2), - new ConstantExpression('foo', 2), - new ConstantExpression('foo', 2), - 2 - ); - - $twig = new Environment($this->getMockBuilder('\Twig\Loader\LoaderInterface')->getMock(), ['debug' => true]); - $node = new ModuleNode($body, $extends, $blocks, $macros, $traits, new Node([]), $source); - $tests[] = [$node, <<<EOF -<?php - -use Twig\Environment; -use Twig\Error\LoaderError; -use Twig\Error\RuntimeError; -use Twig\Markup; -use Twig\Sandbox\SecurityError; -use Twig\Sandbox\SecurityNotAllowedTagError; -use Twig\Sandbox\SecurityNotAllowedFilterError; -use Twig\Sandbox\SecurityNotAllowedFunctionError; -use Twig\Source; -use Twig\Template; - -/* foo.twig */ -class __TwigTemplate_%x extends \Twig\Template -{ - protected function doGetParent(array \$context) - { - // line 2 - return \$this->loadTemplate(((true) ? ("foo") : ("foo")), "foo.twig", 2); - } - - protected function doDisplay(array \$context, array \$blocks = []) - { - // line 4 - \$context["foo"] = "foo"; - // line 2 - \$this->getParent(\$context)->display(\$context, array_merge(\$this->blocks, \$blocks)); - } - - public function getTemplateName() - { - return "foo.twig"; - } - - public function isTraitable() - { - return false; - } - - public function getDebugInfo() - { - return array ( 28 => 2, 26 => 4, 20 => 2,); - } - - /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */ - public function getSource() - { - @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); - - return \$this->getSourceContext()->getCode(); - } - - public function getSourceContext() - { - return new Source("{{ foo }}", "foo.twig", ""); - } -} -EOF - , $twig, true]; - - return $tests; - } -} diff --git a/vendor/twig/twig/test/Twig/Tests/Node/PrintTest.php b/vendor/twig/twig/test/Twig/Tests/Node/PrintTest.php deleted file mode 100644 index efb5ebafcb..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/PrintTest.php +++ /dev/null @@ -1,33 +0,0 @@ -<?php - -/* - * This file is part of Twig. - * - * (c) Fabien Potencier - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Twig\Node\Expression\ConstantExpression; -use Twig\Node\PrintNode; -use Twig\Test\NodeTestCase; - -class Twig_Tests_Node_PrintTest extends NodeTestCase -{ - public function testConstructor() - { - $expr = new ConstantExpression('foo', 1); - $node = new PrintNode($expr, 1); - - $this->assertEquals($expr, $node->getNode('expr')); - } - - public function getTests() - { - $tests = []; - $tests[] = [new PrintNode(new ConstantExpression('foo', 1), 1), "// line 1\necho \"foo\";"]; - - return $tests; - } -} diff --git a/vendor/twig/twig/test/Twig/Tests/Node/SandboxTest.php b/vendor/twig/twig/test/Twig/Tests/Node/SandboxTest.php deleted file mode 100644 index 7dd3e08f0b..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/SandboxTest.php +++ /dev/null @@ -1,47 +0,0 @@ -<?php - -/* - * This file is part of Twig. - * - * (c) Fabien Potencier - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Twig\Node\SandboxNode; -use Twig\Node\TextNode; -use Twig\Test\NodeTestCase; - -class Twig_Tests_Node_SandboxTest extends NodeTestCase -{ - public function testConstructor() - { - $body = new TextNode('foo', 1); - $node = new SandboxNode($body, 1); - - $this->assertEquals($body, $node->getNode('body')); - } - - public function getTests() - { - $tests = []; - - $body = new TextNode('foo', 1); - $node = new SandboxNode($body, 1); - - $tests[] = [$node, <<<EOF -// line 1 -if (!\$alreadySandboxed = \$this->sandbox->isSandboxed()) { - \$this->sandbox->enableSandbox(); -} -echo "foo"; -if (!\$alreadySandboxed) { - \$this->sandbox->disableSandbox(); -} -EOF - ]; - - return $tests; - } -} diff --git a/vendor/twig/twig/test/Twig/Tests/Node/SetTest.php b/vendor/twig/twig/test/Twig/Tests/Node/SetTest.php deleted file mode 100644 index ff4e43e477..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/SetTest.php +++ /dev/null @@ -1,78 +0,0 @@ -<?php - -/* - * This file is part of Twig. - * - * (c) Fabien Potencier - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Twig\Node\Expression\AssignNameExpression; -use Twig\Node\Expression\ConstantExpression; -use Twig\Node\Expression\NameExpression; -use Twig\Node\Node; -use Twig\Node\PrintNode; -use Twig\Node\SetNode; -use Twig\Node\TextNode; -use Twig\Test\NodeTestCase; - -class Twig_Tests_Node_SetTest extends NodeTestCase -{ - public function testConstructor() - { - $names = new Node([new AssignNameExpression('foo', 1)], [], 1); - $values = new Node([new ConstantExpression('foo', 1)], [], 1); - $node = new SetNode(false, $names, $values, 1); - - $this->assertEquals($names, $node->getNode('names')); - $this->assertEquals($values, $node->getNode('values')); - $this->assertFalse($node->getAttribute('capture')); - } - - public function getTests() - { - $tests = []; - - $names = new Node([new AssignNameExpression('foo', 1)], [], 1); - $values = new Node([new ConstantExpression('foo', 1)], [], 1); - $node = new SetNode(false, $names, $values, 1); - $tests[] = [$node, <<<EOF -// line 1 -\$context["foo"] = "foo"; -EOF - ]; - - $names = new Node([new AssignNameExpression('foo', 1)], [], 1); - $values = new Node([new PrintNode(new ConstantExpression('foo', 1), 1)], [], 1); - $node = new SetNode(true, $names, $values, 1); - $tests[] = [$node, <<<EOF -// line 1 -ob_start(function () { return ''; }); -echo "foo"; -\$context["foo"] = ('' === \$tmp = ob_get_clean()) ? '' : new Markup(\$tmp, \$this->env->getCharset()); -EOF - ]; - - $names = new Node([new AssignNameExpression('foo', 1)], [], 1); - $values = new TextNode('foo', 1); - $node = new SetNode(true, $names, $values, 1); - $tests[] = [$node, <<<EOF -// line 1 -\$context["foo"] = ('' === \$tmp = "foo") ? '' : new Markup(\$tmp, \$this->env->getCharset()); -EOF - ]; - - $names = new Node([new AssignNameExpression('foo', 1), new AssignNameExpression('bar', 1)], [], 1); - $values = new Node([new ConstantExpression('foo', 1), new NameExpression('bar', 1)], [], 1); - $node = new SetNode(false, $names, $values, 1); - $tests[] = [$node, <<<EOF -// line 1 -list(\$context["foo"], \$context["bar"]) = ["foo", {$this->getVariableGetter('bar')}]; -EOF - ]; - - return $tests; - } -} diff --git a/vendor/twig/twig/test/Twig/Tests/Node/SpacelessTest.php b/vendor/twig/twig/test/Twig/Tests/Node/SpacelessTest.php deleted file mode 100644 index 13f400fd34..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/SpacelessTest.php +++ /dev/null @@ -1,42 +0,0 @@ -<?php - -/* - * This file is part of Twig. - * - * (c) Fabien Potencier - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Twig\Node\Node; -use Twig\Node\SpacelessNode; -use Twig\Node\TextNode; -use Twig\Test\NodeTestCase; - -class Twig_Tests_Node_SpacelessTest extends NodeTestCase -{ - public function testConstructor() - { - $body = new Node([new TextNode('<div> <div> foo </div> </div>', 1)]); - $node = new SpacelessNode($body, 1); - - $this->assertEquals($body, $node->getNode('body')); - } - - public function getTests() - { - $body = new Node([new TextNode('<div> <div> foo </div> </div>', 1)]); - $node = new SpacelessNode($body, 1); - - return [ - [$node, <<<EOF -// line 1 -ob_start(function () { return ''; }); -echo "<div> <div> foo </div> </div>"; -echo trim(preg_replace('/>\s+</', '><', ob_get_clean())); -EOF - ], - ]; - } -} diff --git a/vendor/twig/twig/test/Twig/Tests/Node/TextTest.php b/vendor/twig/twig/test/Twig/Tests/Node/TextTest.php deleted file mode 100644 index 6735083ce2..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Node/TextTest.php +++ /dev/null @@ -1,31 +0,0 @@ -<?php - -/* - * This file is part of Twig. - * - * (c) Fabien Potencier - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Twig\Node\TextNode; -use Twig\Test\NodeTestCase; - -class Twig_Tests_Node_TextTest extends NodeTestCase -{ - public function testConstructor() - { - $node = new TextNode('foo', 1); - - $this->assertEquals('foo', $node->getAttribute('data')); - } - - public function getTests() - { - $tests = []; - $tests[] = [new TextNode('foo', 1), "// line 1\necho \"foo\";"]; - - return $tests; - } -} diff --git a/vendor/twig/twig/test/Twig/Tests/NodeTraverserTest.php b/vendor/twig/twig/test/Twig/Tests/NodeTraverserTest.php deleted file mode 100644 index 2e08aac367..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/NodeTraverserTest.php +++ /dev/null @@ -1,47 +0,0 @@ -<?php - -/* - * This file is part of Twig. - * - * (c) Fabien Potencier - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Twig\Environment; -use Twig\Node\Node; -use Twig\NodeTraverser; -use Twig\NodeVisitor\NodeVisitorInterface; - -class Twig_Tests_NodeTraverserTest extends \PHPUnit\Framework\TestCase -{ - /** - * @group legacy - */ - public function testNodeIsNullWhenTraversing() - { - $env = new Environment($this->getMockBuilder('\Twig\Loader\LoaderInterface')->getMock()); - $traverser = new NodeTraverser($env, [new IdentityVisitor()]); - $n = new Node([new Node([]), null, new Node([])]); - $this->assertCount(3, $traverser->traverse($n)); - } -} - -class IdentityVisitor implements NodeVisitorInterface -{ - public function enterNode(\Twig_NodeInterface $node, Environment $env) - { - return $node; - } - - public function leaveNode(\Twig_NodeInterface $node, Environment $env) - { - return $node; - } - - public function getPriority() - { - return 0; - } -} diff --git a/vendor/twig/twig/test/Twig/Tests/NodeVisitor/OptimizerTest.php b/vendor/twig/twig/test/Twig/Tests/NodeVisitor/OptimizerTest.php deleted file mode 100644 index 9afdbc6038..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/NodeVisitor/OptimizerTest.php +++ /dev/null @@ -1,129 +0,0 @@ -<?php - -/* - * This file is part of Twig. - * - * (c) Fabien Potencier - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Twig\Environment; -use Twig\Node\ForNode; -use Twig\Source; - -class Twig_Tests_NodeVisitor_OptimizerTest extends \PHPUnit\Framework\TestCase -{ - public function testRenderBlockOptimizer() - { - $env = new Environment($this->getMockBuilder('\Twig\Loader\LoaderInterface')->getMock(), ['cache' => false, 'autoescape' => false]); - - $stream = $env->parse($env->tokenize(new Source('{{ block("foo") }}', 'index'))); - - $node = $stream->getNode('body')->getNode(0); - - $this->assertInstanceOf('\Twig\Node\Expression\BlockReferenceExpression', $node); - $this->assertTrue($node->getAttribute('output')); - } - - public function testRenderParentBlockOptimizer() - { - $env = new Environment($this->getMockBuilder('\Twig\Loader\LoaderInterface')->getMock(), ['cache' => false, 'autoescape' => false]); - - $stream = $env->parse($env->tokenize(new Source('{% extends "foo" %}{% block content %}{{ parent() }}{% endblock %}', 'index'))); - - $node = $stream->getNode('blocks')->getNode('content')->getNode(0)->getNode('body'); - - $this->assertInstanceOf('\Twig\Node\Expression\ParentExpression', $node); - $this->assertTrue($node->getAttribute('output')); - } - - public function testRenderVariableBlockOptimizer() - { - if (PHP_VERSION_ID >= 50400) { - $this->markTestSkipped('not needed on PHP >= 5.4'); - } - - $env = new Environment($this->getMockBuilder('\Twig\Loader\LoaderInterface')->getMock(), ['cache' => false, 'autoescape' => false]); - $stream = $env->parse($env->tokenize(new Source('{{ block(name|lower) }}', 'index'))); - - $node = $stream->getNode('body')->getNode(0)->getNode(1); - - $this->assertInstanceOf('\Twig\Node\Expression\BlockReferenceExpression', $node); - $this->assertTrue($node->getAttribute('output')); - } - - /** - * @dataProvider getTestsForForOptimizer - */ - public function testForOptimizer($template, $expected) - { - $env = new Environment($this->getMockBuilder('\Twig\Loader\LoaderInterface')->getMock(), ['cache' => false]); - - $stream = $env->parse($env->tokenize(new Source($template, 'index'))); - - foreach ($expected as $target => $withLoop) { - $this->assertTrue($this->checkForConfiguration($stream, $target, $withLoop), sprintf('variable %s is %soptimized', $target, $withLoop ? 'not ' : '')); - } - } - - public function getTestsForForOptimizer() - { - return [ - ['{% for i in foo %}{% endfor %}', ['i' => false]], - - ['{% for i in foo %}{{ loop.index }}{% endfor %}', ['i' => true]], - - ['{% for i in foo %}{% for j in foo %}{% endfor %}{% endfor %}', ['i' => false, 'j' => false]], - - ['{% for i in foo %}{% include "foo" %}{% endfor %}', ['i' => true]], - - ['{% for i in foo %}{% include "foo" only %}{% endfor %}', ['i' => false]], - - ['{% for i in foo %}{% include "foo" with { "foo": "bar" } only %}{% endfor %}', ['i' => false]], - - ['{% for i in foo %}{% include "foo" with { "foo": loop.index } only %}{% endfor %}', ['i' => true]], - - ['{% for i in foo %}{% for j in foo %}{{ loop.index }}{% endfor %}{% endfor %}', ['i' => false, 'j' => true]], - - ['{% for i in foo %}{% for j in foo %}{{ loop.parent.loop.index }}{% endfor %}{% endfor %}', ['i' => true, 'j' => true]], - - ['{% for i in foo %}{% set l = loop %}{% for j in foo %}{{ l.index }}{% endfor %}{% endfor %}', ['i' => true, 'j' => false]], - - ['{% for i in foo %}{% for j in foo %}{{ foo.parent.loop.index }}{% endfor %}{% endfor %}', ['i' => false, 'j' => false]], - - ['{% for i in foo %}{% for j in foo %}{{ loop["parent"].loop.index }}{% endfor %}{% endfor %}', ['i' => true, 'j' => true]], - - ['{% for i in foo %}{{ include("foo") }}{% endfor %}', ['i' => true]], - - ['{% for i in foo %}{{ include("foo", with_context = false) }}{% endfor %}', ['i' => false]], - - ['{% for i in foo %}{{ include("foo", with_context = true) }}{% endfor %}', ['i' => true]], - - ['{% for i in foo %}{{ include("foo", { "foo": "bar" }, with_context = false) }}{% endfor %}', ['i' => false]], - - ['{% for i in foo %}{{ include("foo", { "foo": loop.index }, with_context = false) }}{% endfor %}', ['i' => true]], - ]; - } - - public function checkForConfiguration(Twig_NodeInterface $node = null, $target, $withLoop) - { - if (null === $node) { - return; - } - - foreach ($node as $n) { - if ($n instanceof ForNode) { - if ($target === $n->getNode('value_target')->getAttribute('name')) { - return $withLoop == $n->getAttribute('with_loop'); - } - } - - $ret = $this->checkForConfiguration($n, $target, $withLoop); - if (null !== $ret) { - return $ret; - } - } - } -} diff --git a/vendor/twig/twig/test/Twig/Tests/ParserTest.php b/vendor/twig/twig/test/Twig/Tests/ParserTest.php deleted file mode 100644 index bb39dc9b97..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/ParserTest.php +++ /dev/null @@ -1,217 +0,0 @@ -<?php - -/* - * This file is part of Twig. - * - * (c) Fabien Potencier - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Twig\Environment; -use Twig\Node\Node; -use Twig\Node\SetNode; -use Twig\Node\TextNode; -use Twig\Parser; -use Twig\Source; -use Twig\Token; -use Twig\TokenParser\AbstractTokenParser; -use Twig\TokenStream; - -class Twig_Tests_ParserTest extends \PHPUnit\Framework\TestCase -{ - /** - * @expectedException \Twig\Error\SyntaxError - */ - public function testSetMacroThrowsExceptionOnReservedMethods() - { - $parser = $this->getParser(); - $parser->setMacro('parent', $this->getMockBuilder('\Twig\Node\MacroNode')->disableOriginalConstructor()->getMock()); - } - - /** - * @expectedException \Twig\Error\SyntaxError - * @expectedExceptionMessage Unknown "foo" tag. Did you mean "for" at line 1? - */ - public function testUnknownTag() - { - $stream = new TokenStream([ - new Token(Token::BLOCK_START_TYPE, '', 1), - new Token(Token::NAME_TYPE, 'foo', 1), - new Token(Token::BLOCK_END_TYPE, '', 1), - new Token(Token::EOF_TYPE, '', 1), - ]); - $parser = new Parser(new Environment($this->getMockBuilder('\Twig\Loader\LoaderInterface')->getMock())); - $parser->parse($stream); - } - - /** - * @expectedException \Twig\Error\SyntaxError - * @expectedExceptionMessage Unknown "foobar" tag at line 1. - */ - public function testUnknownTagWithoutSuggestions() - { - $stream = new TokenStream([ - new Token(Token::BLOCK_START_TYPE, '', 1), - new Token(Token::NAME_TYPE, 'foobar', 1), - new Token(Token::BLOCK_END_TYPE, '', 1), - new Token(Token::EOF_TYPE, '', 1), - ]); - $parser = new Parser(new Environment($this->getMockBuilder('\Twig\Loader\LoaderInterface')->getMock())); - $parser->parse($stream); - } - - /** - * @dataProvider getFilterBodyNodesData - */ - public function testFilterBodyNodes($input, $expected) - { - $parser = $this->getParser(); - - $this->assertEquals($expected, $parser->filterBodyNodes($input)); - } - - public function getFilterBodyNodesData() - { - return [ - [ - new Node([new TextNode(' ', 1)]), - new Node([]), - ], - [ - $input = new Node([new SetNode(false, new Node(), new Node(), 1)]), - $input, - ], - [ - $input = new Node([new SetNode(true, new Node(), new Node([new Node([new TextNode('foo', 1)])]), 1)]), - $input, - ], - ]; - } - - /** - * @dataProvider getFilterBodyNodesDataThrowsException - * @expectedException \Twig\Error\SyntaxError - */ - public function testFilterBodyNodesThrowsException($input) - { - $parser = $this->getParser(); - - $parser->filterBodyNodes($input); - } - - public function getFilterBodyNodesDataThrowsException() - { - return [ - [new TextNode('foo', 1)], - [new Node([new Node([new TextNode('foo', 1)])])], - ]; - } - - /** - * @dataProvider getFilterBodyNodesWithBOMData - */ - public function testFilterBodyNodesWithBOM($emptyNode) - { - $this->assertNull($this->getParser()->filterBodyNodes(new TextNode(\chr(0xEF).\chr(0xBB).\chr(0xBF).$emptyNode, 1))); - } - - public function getFilterBodyNodesWithBOMData() - { - return [ - [' '], - ["\t"], - ["\n"], - ["\n\t\n "], - ]; - } - - public function testParseIsReentrant() - { - $twig = new Environment($this->getMockBuilder('\Twig\Loader\LoaderInterface')->getMock(), [ - 'autoescape' => false, - 'optimizations' => 0, - ]); - $twig->addTokenParser(new TestTokenParser()); - - $parser = new Parser($twig); - - $parser->parse(new TokenStream([ - new Token(Token::BLOCK_START_TYPE, '', 1), - new Token(Token::NAME_TYPE, 'test', 1), - new Token(Token::BLOCK_END_TYPE, '', 1), - new Token(Token::VAR_START_TYPE, '', 1), - new Token(Token::NAME_TYPE, 'foo', 1), - new Token(Token::VAR_END_TYPE, '', 1), - new Token(Token::EOF_TYPE, '', 1), - ])); - - $this->assertNull($parser->getParent()); - } - - public function testGetVarName() - { - $twig = new Environment($this->getMockBuilder('\Twig\Loader\LoaderInterface')->getMock(), [ - 'autoescape' => false, - 'optimizations' => 0, - ]); - - $twig->parse($twig->tokenize(new Source(<<<EOF -{% from _self import foo %} - -{% macro foo() %} - {{ foo }} -{% endmacro %} -EOF - , 'index'))); - - // The getVarName() must not depend on the template loaders, - // If this test does not throw any exception, that's good. - // see https://github.com/symfony/symfony/issues/4218 - $this->addToAssertionCount(1); - } - - protected function getParser() - { - $parser = new TestParser(new Environment($this->getMockBuilder('\Twig\Loader\LoaderInterface')->getMock())); - $parser->setParent(new Node()); - $parser->stream = new TokenStream([]); - - return $parser; - } -} - -class TestParser extends Parser -{ - public $stream; - - public function filterBodyNodes(Twig_NodeInterface $node) - { - return parent::filterBodyNodes($node); - } -} - -class TestTokenParser extends AbstractTokenParser -{ - public function parse(Token $token) - { - // simulate the parsing of another template right in the middle of the parsing of the current template - $this->parser->parse(new TokenStream([ - new Token(Token::BLOCK_START_TYPE, '', 1), - new Token(Token::NAME_TYPE, 'extends', 1), - new Token(Token::STRING_TYPE, 'base', 1), - new Token(Token::BLOCK_END_TYPE, '', 1), - new Token(Token::EOF_TYPE, '', 1), - ])); - - $this->parser->getStream()->expect(Token::BLOCK_END_TYPE); - - return new Node([]); - } - - public function getTag() - { - return 'test'; - } -} diff --git a/vendor/twig/twig/test/Twig/Tests/Profiler/Dumper/AbstractTest.php b/vendor/twig/twig/test/Twig/Tests/Profiler/Dumper/AbstractTest.php deleted file mode 100644 index 508f79ca52..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Profiler/Dumper/AbstractTest.php +++ /dev/null @@ -1,105 +0,0 @@ -<?php - -/* - * This file is part of Twig. - * - * (c) Fabien Potencier - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Twig\Profiler\Profile; - -abstract class Twig_Tests_Profiler_Dumper_AbstractTest extends \PHPUnit\Framework\TestCase -{ - protected function getProfile() - { - $profile = new Profile('main'); - $subProfiles = [ - $this->getIndexProfile( - [ - $this->getEmbeddedBlockProfile(), - $this->getEmbeddedTemplateProfile( - [ - $this->getIncludedTemplateProfile(), - ] - ), - $this->getMacroProfile(), - $this->getEmbeddedTemplateProfile( - [ - $this->getIncludedTemplateProfile(), - ] - ), - ] - ), - ]; - - $p = new \ReflectionProperty($profile, 'profiles'); - $p->setAccessible(true); - $p->setValue($profile, $subProfiles); - - return $profile; - } - - private function getIndexProfile(array $subProfiles = []) - { - return $this->generateProfile('main', 1, 'template', 'index.twig', $subProfiles); - } - - private function getEmbeddedBlockProfile(array $subProfiles = []) - { - return $this->generateProfile('body', 0.0001, 'block', 'embedded.twig', $subProfiles); - } - - private function getEmbeddedTemplateProfile(array $subProfiles = []) - { - return $this->generateProfile('main', 0.0001, 'template', 'embedded.twig', $subProfiles); - } - - private function getIncludedTemplateProfile(array $subProfiles = []) - { - return $this->generateProfile('main', 0.0001, 'template', 'included.twig', $subProfiles); - } - - private function getMacroProfile(array $subProfiles = []) - { - return $this->generateProfile('foo', 0.0001, 'macro', 'index.twig', $subProfiles); - } - - /** - * @param string $name - * @param float $duration - * @param bool $isTemplate - * @param string $type - * @param string $templateName - * @param array $subProfiles - * - * @return Profile - */ - private function generateProfile($name, $duration, $type, $templateName, array $subProfiles = []) - { - $profile = new Profile($templateName, $type, $name); - - $p = new \ReflectionProperty($profile, 'profiles'); - $p->setAccessible(true); - $p->setValue($profile, $subProfiles); - - $starts = new \ReflectionProperty($profile, 'starts'); - $starts->setAccessible(true); - $starts->setValue($profile, [ - 'wt' => 0, - 'mu' => 0, - 'pmu' => 0, - ]); - $ends = new \ReflectionProperty($profile, 'ends'); - $ends->setAccessible(true); - $ends->setValue($profile, [ - 'wt' => $duration, - 'mu' => 0, - 'pmu' => 0, - ]); - - return $profile; - } -} diff --git a/vendor/twig/twig/test/Twig/Tests/Profiler/Dumper/BlackfireTest.php b/vendor/twig/twig/test/Twig/Tests/Profiler/Dumper/BlackfireTest.php deleted file mode 100644 index 26ef2dad2a..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Profiler/Dumper/BlackfireTest.php +++ /dev/null @@ -1,34 +0,0 @@ -<?php - -/* - * This file is part of Twig. - * - * (c) Fabien Potencier - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Twig\Profiler\Dumper\BlackfireDumper; - -class Twig_Tests_Profiler_Dumper_BlackfireTest extends Twig_Tests_Profiler_Dumper_AbstractTest -{ - public function testDump() - { - $dumper = new BlackfireDumper(); - - $this->assertStringMatchesFormat(<<<EOF -file-format: BlackfireProbe -cost-dimensions: wt mu pmu -request-start: %d.%d - -main()//1 %d %d %d -main()==>index.twig//1 %d %d %d -index.twig==>embedded.twig::block(body)//1 %d %d 0 -index.twig==>embedded.twig//2 %d %d %d -embedded.twig==>included.twig//2 %d %d %d -index.twig==>index.twig::macro(foo)//1 %d %d %d -EOF - , $dumper->dump($this->getProfile())); - } -} diff --git a/vendor/twig/twig/test/Twig/Tests/Profiler/Dumper/HtmlTest.php b/vendor/twig/twig/test/Twig/Tests/Profiler/Dumper/HtmlTest.php deleted file mode 100644 index e04bbcf2b5..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Profiler/Dumper/HtmlTest.php +++ /dev/null @@ -1,32 +0,0 @@ -<?php - -/* - * This file is part of Twig. - * - * (c) Fabien Potencier - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Twig\Profiler\Dumper\HtmlDumper; - -class Twig_Tests_Profiler_Dumper_HtmlTest extends Twig_Tests_Profiler_Dumper_AbstractTest -{ - public function testDump() - { - $dumper = new HtmlDumper(); - $this->assertStringMatchesFormat(<<<EOF -<pre>main <span style="color: #d44">%d.%dms/%d%</span> -└ <span style="background-color: #ffd">index.twig</span> <span style="color: #d44">%d.%dms/%d%</span> - └ embedded.twig::block(<span style="background-color: #dfd">body</span>) - └ <span style="background-color: #ffd">embedded.twig</span> - │ └ <span style="background-color: #ffd">included.twig</span> - └ index.twig::macro(<span style="background-color: #ddf">foo</span>) - └ <span style="background-color: #ffd">embedded.twig</span> - └ <span style="background-color: #ffd">included.twig</span> -</pre> -EOF - , $dumper->dump($this->getProfile())); - } -} diff --git a/vendor/twig/twig/test/Twig/Tests/Profiler/Dumper/TextTest.php b/vendor/twig/twig/test/Twig/Tests/Profiler/Dumper/TextTest.php deleted file mode 100644 index e36d0ad600..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Profiler/Dumper/TextTest.php +++ /dev/null @@ -1,32 +0,0 @@ -<?php - -/* - * This file is part of Twig. - * - * (c) Fabien Potencier - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Twig\Profiler\Dumper\TextDumper; - -class Twig_Tests_Profiler_Dumper_TextTest extends Twig_Tests_Profiler_Dumper_AbstractTest -{ - public function testDump() - { - $dumper = new TextDumper(); - $this->assertStringMatchesFormat(<<<EOF -main %d.%dms/%d% -└ index.twig %d.%dms/%d% - └ embedded.twig::block(body) - └ embedded.twig - │ └ included.twig - └ index.twig::macro(foo) - └ embedded.twig - └ included.twig - -EOF - , $dumper->dump($this->getProfile())); - } -} diff --git a/vendor/twig/twig/test/Twig/Tests/Profiler/ProfileTest.php b/vendor/twig/twig/test/Twig/Tests/Profiler/ProfileTest.php deleted file mode 100644 index 18e2a5b564..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Profiler/ProfileTest.php +++ /dev/null @@ -1,112 +0,0 @@ -<?php - -/* - * This file is part of Twig. - * - * (c) Fabien Potencier - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Twig\Profiler\Profile; - -class Twig_Tests_Profiler_ProfileTest extends \PHPUnit\Framework\TestCase -{ - public function testConstructor() - { - $profile = new Profile('template', 'type', 'name'); - - $this->assertEquals('template', $profile->getTemplate()); - $this->assertEquals('type', $profile->getType()); - $this->assertEquals('name', $profile->getName()); - } - - public function testIsRoot() - { - $profile = new Profile('template', Profile::ROOT); - $this->assertTrue($profile->isRoot()); - - $profile = new Profile('template', Profile::TEMPLATE); - $this->assertFalse($profile->isRoot()); - } - - public function testIsTemplate() - { - $profile = new Profile('template', Profile::TEMPLATE); - $this->assertTrue($profile->isTemplate()); - - $profile = new Profile('template', Profile::ROOT); - $this->assertFalse($profile->isTemplate()); - } - - public function testIsBlock() - { - $profile = new Profile('template', Profile::BLOCK); - $this->assertTrue($profile->isBlock()); - - $profile = new Profile('template', Profile::ROOT); - $this->assertFalse($profile->isBlock()); - } - - public function testIsMacro() - { - $profile = new Profile('template', Profile::MACRO); - $this->assertTrue($profile->isMacro()); - - $profile = new Profile('template', Profile::ROOT); - $this->assertFalse($profile->isMacro()); - } - - public function testGetAddProfile() - { - $profile = new Profile(); - $profile->addProfile($a = new Profile()); - $profile->addProfile($b = new Profile()); - - $this->assertSame([$a, $b], $profile->getProfiles()); - $this->assertSame([$a, $b], iterator_to_array($profile)); - } - - public function testGetDuration() - { - $profile = new Profile(); - usleep(1); - $profile->leave(); - - $this->assertTrue($profile->getDuration() > 0, sprintf('Expected duration > 0, got: %f', $profile->getDuration())); - } - - public function testSerialize() - { - $profile = new Profile('template', 'type', 'name'); - $profile1 = new Profile('template1', 'type1', 'name1'); - $profile->addProfile($profile1); - $profile->leave(); - $profile1->leave(); - - $profile2 = unserialize(serialize($profile)); - $profiles = $profile->getProfiles(); - $this->assertCount(1, $profiles); - $profile3 = $profiles[0]; - - $this->assertEquals($profile->getTemplate(), $profile2->getTemplate()); - $this->assertEquals($profile->getType(), $profile2->getType()); - $this->assertEquals($profile->getName(), $profile2->getName()); - $this->assertEquals($profile->getDuration(), $profile2->getDuration()); - - $this->assertEquals($profile1->getTemplate(), $profile3->getTemplate()); - $this->assertEquals($profile1->getType(), $profile3->getType()); - $this->assertEquals($profile1->getName(), $profile3->getName()); - } - - public function testReset() - { - $profile = new Profile(); - usleep(1); - $profile->leave(); - $profile->reset(); - - $this->assertEquals(0, $profile->getDuration()); - } -} diff --git a/vendor/twig/twig/test/Twig/Tests/TemplateTest.php b/vendor/twig/twig/test/Twig/Tests/TemplateTest.php deleted file mode 100644 index 1b42b93e10..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/TemplateTest.php +++ /dev/null @@ -1,812 +0,0 @@ -<?php - -/* - * This file is part of Twig. - * - * (c) Fabien Potencier - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Twig\Environment; -use Twig\Error\RuntimeError; -use Twig\Extension\SandboxExtension; -use Twig\Loader\ArrayLoader; -use Twig\Loader\LoaderInterface; -use Twig\Loader\SourceContextLoaderInterface; -use Twig\Node\Expression\GetAttrExpression; -use Twig\NodeVisitor\NodeVisitorInterface; -use Twig\Sandbox\SecurityError; -use Twig\Sandbox\SecurityPolicy; -use Twig\Template; - -class Twig_Tests_TemplateTest extends \PHPUnit\Framework\TestCase -{ - /** - * @expectedException \LogicException - */ - public function testDisplayBlocksAcceptTemplateOnlyAsBlocks() - { - $template = $this->getMockForAbstractClass('\Twig\Template', [], '', false); - $template->displayBlock('foo', [], ['foo' => [new \stdClass(), 'foo']]); - } - - /** - * @dataProvider getAttributeExceptions - */ - public function testGetAttributeExceptions($template, $message) - { - $templates = ['index' => $template]; - $env = new Environment(new ArrayLoader($templates), ['strict_variables' => true]); - $template = $env->load('index'); - - $context = [ - 'string' => 'foo', - 'null' => null, - 'empty_array' => [], - 'array' => ['foo' => 'foo'], - 'array_access' => new Twig_TemplateArrayAccessObject(), - 'magic_exception' => new Twig_TemplateMagicPropertyObjectWithException(), - 'object' => new \stdClass(), - ]; - - try { - $template->render($context); - $this->fail('Accessing an invalid attribute should throw an exception.'); - } catch (RuntimeError $e) { - $this->assertSame(sprintf($message, 'index'), $e->getMessage()); - } - } - - public function getAttributeExceptions() - { - return [ - ['{{ string["a"] }}', 'Impossible to access a key ("a") on a string variable ("foo") in "%s" at line 1.'], - ['{{ null["a"] }}', 'Impossible to access a key ("a") on a null variable in "%s" at line 1.'], - ['{{ empty_array["a"] }}', 'Key "a" does not exist as the array is empty in "%s" at line 1.'], - ['{{ array["a"] }}', 'Key "a" for array with keys "foo" does not exist in "%s" at line 1.'], - ['{{ array_access["a"] }}', 'Key "a" in object with ArrayAccess of class "Twig_TemplateArrayAccessObject" does not exist in "%s" at line 1.'], - ['{{ string.a }}', 'Impossible to access an attribute ("a") on a string variable ("foo") in "%s" at line 1.'], - ['{{ string.a() }}', 'Impossible to invoke a method ("a") on a string variable ("foo") in "%s" at line 1.'], - ['{{ null.a }}', 'Impossible to access an attribute ("a") on a null variable in "%s" at line 1.'], - ['{{ null.a() }}', 'Impossible to invoke a method ("a") on a null variable in "%s" at line 1.'], - ['{{ array.a() }}', 'Impossible to invoke a method ("a") on an array in "%s" at line 1.'], - ['{{ empty_array.a }}', 'Key "a" does not exist as the array is empty in "%s" at line 1.'], - ['{{ array.a }}', 'Key "a" for array with keys "foo" does not exist in "%s" at line 1.'], - ['{{ attribute(array, -10) }}', 'Key "-10" for array with keys "foo" does not exist in "%s" at line 1.'], - ['{{ array_access.a }}', 'Neither the property "a" nor one of the methods "a()", "geta()"/"isa()" or "__call()" exist and have public access in class "Twig_TemplateArrayAccessObject" in "%s" at line 1.'], - ['{% from _self import foo %}{% macro foo(obj) %}{{ obj.missing_method() }}{% endmacro %}{{ foo(array_access) }}', 'Neither the property "missing_method" nor one of the methods "missing_method()", "getmissing_method()"/"ismissing_method()" or "__call()" exist and have public access in class "Twig_TemplateArrayAccessObject" in "%s" at line 1.'], - ['{{ magic_exception.test }}', 'An exception has been thrown during the rendering of a template ("Hey! Don\'t try to isset me!") in "%s" at line 1.'], - ['{{ object["a"] }}', 'Impossible to access a key "a" on an object of class "stdClass" that does not implement ArrayAccess interface in "%s" at line 1.'], - ]; - } - - /** - * @dataProvider getGetAttributeWithSandbox - */ - public function testGetAttributeWithSandbox($object, $item, $allowed) - { - $twig = new Environment($this->getMockBuilder('\Twig\Loader\LoaderInterface')->getMock()); - $policy = new SecurityPolicy([], [], [/*method*/], [/*prop*/], []); - $twig->addExtension(new SandboxExtension($policy, !$allowed)); - $template = new Twig_TemplateTest($twig); - - try { - $template->getAttribute($object, $item, [], 'any'); - - if (!$allowed) { - $this->fail(); - } else { - $this->addToAssertionCount(1); - } - } catch (SecurityError $e) { - if ($allowed) { - $this->fail(); - } else { - $this->addToAssertionCount(1); - } - - $this->assertContains('is not allowed', $e->getMessage()); - } - } - - public function getGetAttributeWithSandbox() - { - return [ - [new Twig_TemplatePropertyObject(), 'defined', false], - [new Twig_TemplatePropertyObject(), 'defined', true], - [new Twig_TemplateMethodObject(), 'defined', false], - [new Twig_TemplateMethodObject(), 'defined', true], - ]; - } - - /** - * @group legacy - */ - public function testGetAttributeWithTemplateAsObject() - { - // to be removed in 2.0 - $twig = new Environment($this->getMockBuilder('Twig_TemplateTestLoaderInterface')->getMock()); - //$twig = new Environment($this->getMockBuilder('\Twig\Loader\LoaderInterface', '\Twig\Loader\SourceContextLoaderInterface')->getMock()); - - $template = new Twig_TemplateTest($twig, 'index.twig'); - $template1 = new Twig_TemplateTest($twig, 'index1.twig'); - - $this->assertInstanceOf('\Twig\Markup', $template->getAttribute($template1, 'string')); - $this->assertEquals('some_string', $template->getAttribute($template1, 'string')); - - $this->assertInstanceOf('\Twig\Markup', $template->getAttribute($template1, 'true')); - $this->assertEquals('1', $template->getAttribute($template1, 'true')); - - $this->assertInstanceOf('\Twig\Markup', $template->getAttribute($template1, 'zero')); - $this->assertEquals('0', $template->getAttribute($template1, 'zero')); - - $this->assertNotInstanceof('\Twig\Markup', $template->getAttribute($template1, 'empty')); - $this->assertSame('', $template->getAttribute($template1, 'empty')); - - $this->assertFalse($template->getAttribute($template1, 'env', [], Template::ANY_CALL, true)); - $this->assertFalse($template->getAttribute($template1, 'environment', [], Template::ANY_CALL, true)); - $this->assertFalse($template->getAttribute($template1, 'getEnvironment', [], Template::METHOD_CALL, true)); - $this->assertFalse($template->getAttribute($template1, 'displayWithErrorHandling', [], Template::METHOD_CALL, true)); - } - - /** - * @group legacy - * @expectedDeprecation Calling "string" on template "index1.twig" from template "index.twig" is deprecated since version 1.28 and won't be supported anymore in 2.0. - * @expectedDeprecation Calling "string" on template "index1.twig" from template "index.twig" is deprecated since version 1.28 and won't be supported anymore in 2.0. - * @expectedDeprecation Calling "true" on template "index1.twig" from template "index.twig" is deprecated since version 1.28 and won't be supported anymore in 2.0. - * @expectedDeprecation Calling "true" on template "index1.twig" from template "index.twig" is deprecated since version 1.28 and won't be supported anymore in 2.0. - * @expectedDeprecation Calling "zero" on template "index1.twig" from template "index.twig" is deprecated since version 1.28 and won't be supported anymore in 2.0. - * @expectedDeprecation Calling "zero" on template "index1.twig" from template "index.twig" is deprecated since version 1.28 and won't be supported anymore in 2.0. - * @expectedDeprecation Calling "empty" on template "index1.twig" from template "index.twig" is deprecated since version 1.28 and won't be supported anymore in 2.0. - * @expectedDeprecation Calling "empty" on template "index1.twig" from template "index.twig" is deprecated since version 1.28 and won't be supported anymore in 2.0. - * @expectedDeprecation Calling "renderBlock" on template "index.twig" from template "index.twig" is deprecated since version 1.28 and won't be supported anymore in 2.0. Use block("name") instead). - * @expectedDeprecation Calling "displayBlock" on template "index.twig" from template "index.twig" is deprecated since version 1.28 and won't be supported anymore in 2.0. Use block("name") instead). - * @expectedDeprecation Calling "hasBlock" on template "index.twig" from template "index.twig" is deprecated since version 1.28 and won't be supported anymore in 2.0. Use "block("name") is defined" instead). - * @expectedDeprecation Calling "render" on template "index.twig" from template "index.twig" is deprecated since version 1.28 and won't be supported anymore in 2.0. Use include("index.twig") instead). - * @expectedDeprecation Calling "display" on template "index.twig" from template "index.twig" is deprecated since version 1.28 and won't be supported anymore in 2.0. Use include("index.twig") instead). - * @expectedDeprecation Calling "renderBlock" on template "index1.twig" from template "index.twig" is deprecated since version 1.28 and won't be supported anymore in 2.0. Use block("name", template) instead). - * @expectedDeprecation Calling "displayBlock" on template "index1.twig" from template "index.twig" is deprecated since version 1.28 and won't be supported anymore in 2.0. Use block("name", template) instead). - * @expectedDeprecation Calling "hasBlock" on template "index1.twig" from template "index.twig" is deprecated since version 1.28 and won't be supported anymore in 2.0. Use "block("name", template) is defined" instead). - * @expectedDeprecation Calling "render" on template "index1.twig" from template "index.twig" is deprecated since version 1.28 and won't be supported anymore in 2.0. Use include("index1.twig") instead). - * @expectedDeprecation Calling "display" on template "index1.twig" from template "index.twig" is deprecated since version 1.28 and won't be supported anymore in 2.0. Use include("index1.twig") instead). - */ - public function testGetAttributeWithTemplateAsObjectForDeprecations() - { - // to be removed in 2.0 - $twig = new Environment($this->getMockBuilder('Twig_TemplateTestLoaderInterface')->getMock()); - //$twig = new Environment($this->getMockBuilder('\Twig\Loader\LoaderInterface', '\Twig\Loader\SourceContextLoaderInterface')->getMock()); - - $template = new Twig_TemplateTest($twig, 'index.twig'); - $template1 = new Twig_TemplateTest($twig, 'index1.twig'); - - $this->assertInstanceOf('\Twig\Markup', $template->getAttribute($template1, 'string')); - $this->assertEquals('some_string', $template->getAttribute($template1, 'string')); - - $this->assertInstanceOf('\Twig\Markup', $template->getAttribute($template1, 'true')); - $this->assertEquals('1', $template->getAttribute($template1, 'true')); - - $this->assertInstanceOf('\Twig\Markup', $template->getAttribute($template1, 'zero')); - $this->assertEquals('0', $template->getAttribute($template1, 'zero')); - - $this->assertNotInstanceof('\Twig\Markup', $template->getAttribute($template1, 'empty')); - $this->assertSame('', $template->getAttribute($template1, 'empty')); - - $blocks = ['name' => [$template1, 'block_name']]; - - // trigger some deprecation notice messages to check them with @expectedDeprecation - $template->getAttribute($template, 'renderBlock', ['name', [], $blocks]); - $template->getAttribute($template, 'displayBlock', ['name', [], $blocks]); - $template->getAttribute($template, 'hasBlock', ['name', []]); - $template->getAttribute($template, 'render', [[]]); - $template->getAttribute($template, 'display', [[]]); - - $template->getAttribute($template1, 'renderBlock', ['name', [], $blocks]); - $template->getAttribute($template1, 'displayBlock', ['name', [], $blocks]); - $template->getAttribute($template1, 'hasBlock', ['name', []]); - $template->getAttribute($template1, 'render', [[]]); - $template->getAttribute($template1, 'display', [[]]); - - $this->assertFalse($template->getAttribute($template1, 'env', [], Template::ANY_CALL, true)); - $this->assertFalse($template->getAttribute($template1, 'environment', [], Template::ANY_CALL, true)); - $this->assertFalse($template->getAttribute($template1, 'getEnvironment', [], Template::METHOD_CALL, true)); - $this->assertFalse($template->getAttribute($template1, 'displayWithErrorHandling', [], Template::METHOD_CALL, true)); - } - - /** - * @group legacy - * @expectedDeprecation Silent display of undefined block "unknown" in template "index.twig" is deprecated since version 1.29 and will throw an exception in 2.0. Use the "block('unknown') is defined" expression to test for block existence. - * @expectedDeprecation Silent display of undefined block "unknown" in template "index.twig" is deprecated since version 1.29 and will throw an exception in 2.0. Use the "block('unknown') is defined" expression to test for block existence. - */ - public function testRenderBlockWithUndefinedBlock() - { - $twig = new Environment($this->getMockBuilder('Twig_TemplateTestLoaderInterface')->getMock()); - - $template = new Twig_TemplateTest($twig, 'index.twig'); - $template->renderBlock('unknown', []); - $template->displayBlock('unknown', []); - } - - public function testGetAttributeOnArrayWithConfusableKey() - { - $template = new Twig_TemplateTest(new Environment($this->getMockBuilder('\Twig\Loader\LoaderInterface')->getMock())); - - $array = ['Zero', 'One', -1 => 'MinusOne', '' => 'EmptyString', '1.5' => 'FloatButString', '01' => 'IntegerButStringWithLeadingZeros']; - - $this->assertSame('Zero', $array[false]); - $this->assertSame('One', $array[true]); - $this->assertSame('One', $array[1.5]); - $this->assertSame('One', $array['1']); - $this->assertSame('MinusOne', $array[-1.5]); - $this->assertSame('FloatButString', $array['1.5']); - $this->assertSame('IntegerButStringWithLeadingZeros', $array['01']); - $this->assertSame('EmptyString', $array[null]); - - $this->assertSame('Zero', $template->getAttribute($array, false), 'false is treated as 0 when accessing an array (equals PHP behavior)'); - $this->assertSame('One', $template->getAttribute($array, true), 'true is treated as 1 when accessing an array (equals PHP behavior)'); - $this->assertSame('One', $template->getAttribute($array, 1.5), 'float is casted to int when accessing an array (equals PHP behavior)'); - $this->assertSame('One', $template->getAttribute($array, '1'), '"1" is treated as integer 1 when accessing an array (equals PHP behavior)'); - $this->assertSame('MinusOne', $template->getAttribute($array, -1.5), 'negative float is casted to int when accessing an array (equals PHP behavior)'); - $this->assertSame('FloatButString', $template->getAttribute($array, '1.5'), '"1.5" is treated as-is when accessing an array (equals PHP behavior)'); - $this->assertSame('IntegerButStringWithLeadingZeros', $template->getAttribute($array, '01'), '"01" is treated as-is when accessing an array (equals PHP behavior)'); - $this->assertSame('EmptyString', $template->getAttribute($array, null), 'null is treated as "" when accessing an array (equals PHP behavior)'); - } - - /** - * @dataProvider getGetAttributeTests - */ - public function testGetAttribute($defined, $value, $object, $item, $arguments, $type) - { - $template = new Twig_TemplateTest(new Environment($this->getMockBuilder('\Twig\Loader\LoaderInterface')->getMock())); - - $this->assertEquals($value, $template->getAttribute($object, $item, $arguments, $type)); - } - - /** - * @dataProvider getGetAttributeTests - */ - public function testGetAttributeStrict($defined, $value, $object, $item, $arguments, $type, $exceptionMessage = null) - { - $template = new Twig_TemplateTest(new Environment($this->getMockBuilder('\Twig\Loader\LoaderInterface')->getMock(), ['strict_variables' => true])); - - if ($defined) { - $this->assertEquals($value, $template->getAttribute($object, $item, $arguments, $type)); - } else { - if (method_exists($this, 'expectException')) { - $this->expectException('\Twig\Error\RuntimeError'); - if (null !== $exceptionMessage) { - $this->expectExceptionMessage($exceptionMessage); - } - } else { - $this->setExpectedException('\Twig\Error\RuntimeError', $exceptionMessage); - } - $this->assertEquals($value, $template->getAttribute($object, $item, $arguments, $type)); - } - } - - /** - * @dataProvider getGetAttributeTests - */ - public function testGetAttributeDefined($defined, $value, $object, $item, $arguments, $type) - { - $template = new Twig_TemplateTest(new Environment($this->getMockBuilder('\Twig\Loader\LoaderInterface')->getMock())); - - $this->assertEquals($defined, $template->getAttribute($object, $item, $arguments, $type, true)); - } - - /** - * @dataProvider getGetAttributeTests - */ - public function testGetAttributeDefinedStrict($defined, $value, $object, $item, $arguments, $type) - { - $template = new Twig_TemplateTest(new Environment($this->getMockBuilder('\Twig\Loader\LoaderInterface')->getMock(), ['strict_variables' => true])); - - $this->assertEquals($defined, $template->getAttribute($object, $item, $arguments, $type, true)); - } - - public function testGetAttributeCallExceptions() - { - $template = new Twig_TemplateTest(new Environment($this->getMockBuilder('\Twig\Loader\LoaderInterface')->getMock())); - - $object = new Twig_TemplateMagicMethodExceptionObject(); - - $this->assertNull($template->getAttribute($object, 'foo')); - } - - public function getGetAttributeTests() - { - $array = [ - 'defined' => 'defined', - 'zero' => 0, - 'null' => null, - '1' => 1, - 'bar' => true, - 'baz' => 'baz', - '09' => '09', - '+4' => '+4', - ]; - - $objectArray = new Twig_TemplateArrayAccessObject(); - $arrayObject = new \ArrayObject($array); - $stdObject = (object) $array; - $magicPropertyObject = new Twig_TemplateMagicPropertyObject(); - $propertyObject = new Twig_TemplatePropertyObject(); - $propertyObject1 = new Twig_TemplatePropertyObjectAndIterator(); - $propertyObject2 = new Twig_TemplatePropertyObjectAndArrayAccess(); - $propertyObject3 = new Twig_TemplatePropertyObjectDefinedWithUndefinedValue(); - $methodObject = new Twig_TemplateMethodObject(); - $magicMethodObject = new Twig_TemplateMagicMethodObject(); - - $anyType = Template::ANY_CALL; - $methodType = Template::METHOD_CALL; - $arrayType = Template::ARRAY_CALL; - - $basicTests = [ - // array(defined, value, property to fetch) - [true, 'defined', 'defined'], - [false, null, 'undefined'], - [false, null, 'protected'], - [true, 0, 'zero'], - [true, 1, 1], - [true, 1, 1.0], - [true, null, 'null'], - [true, true, 'bar'], - [true, 'baz', 'baz'], - [true, '09', '09'], - [true, '+4', '+4'], - ]; - $testObjects = [ - // array(object, type of fetch) - [$array, $arrayType], - [$objectArray, $arrayType], - [$arrayObject, $anyType], - [$stdObject, $anyType], - [$magicPropertyObject, $anyType], - [$methodObject, $methodType], - [$methodObject, $anyType], - [$propertyObject, $anyType], - [$propertyObject1, $anyType], - [$propertyObject2, $anyType], - ]; - - $tests = []; - foreach ($testObjects as $testObject) { - foreach ($basicTests as $test) { - // properties cannot be numbers - if (($testObject[0] instanceof \stdClass || $testObject[0] instanceof Twig_TemplatePropertyObject) && is_numeric($test[2])) { - continue; - } - - if ('+4' === $test[2] && $methodObject === $testObject[0]) { - continue; - } - - $tests[] = [$test[0], $test[1], $testObject[0], $test[2], [], $testObject[1]]; - } - } - - // additional properties tests - $tests = array_merge($tests, [ - [true, null, $propertyObject3, 'foo', [], $anyType], - ]); - - // additional method tests - $tests = array_merge($tests, [ - [true, 'defined', $methodObject, 'defined', [], $methodType], - [true, 'defined', $methodObject, 'DEFINED', [], $methodType], - [true, 'defined', $methodObject, 'getDefined', [], $methodType], - [true, 'defined', $methodObject, 'GETDEFINED', [], $methodType], - [true, 'static', $methodObject, 'static', [], $methodType], - [true, 'static', $methodObject, 'getStatic', [], $methodType], - - [true, '__call_undefined', $magicMethodObject, 'undefined', [], $methodType], - [true, '__call_UNDEFINED', $magicMethodObject, 'UNDEFINED', [], $methodType], - ]); - - // add the same tests for the any type - foreach ($tests as $test) { - if ($anyType !== $test[5]) { - $test[5] = $anyType; - $tests[] = $test; - } - } - - $methodAndPropObject = new Twig_TemplateMethodAndPropObject(); - - // additional method tests - $tests = array_merge($tests, [ - [true, 'a', $methodAndPropObject, 'a', [], $anyType], - [true, 'a', $methodAndPropObject, 'a', [], $methodType], - [false, null, $methodAndPropObject, 'a', [], $arrayType], - - [true, 'b_prop', $methodAndPropObject, 'b', [], $anyType], - [true, 'b', $methodAndPropObject, 'B', [], $anyType], - [true, 'b', $methodAndPropObject, 'b', [], $methodType], - [true, 'b', $methodAndPropObject, 'B', [], $methodType], - [false, null, $methodAndPropObject, 'b', [], $arrayType], - - [false, null, $methodAndPropObject, 'c', [], $anyType], - [false, null, $methodAndPropObject, 'c', [], $methodType], - [false, null, $methodAndPropObject, 'c', [], $arrayType], - ]); - - $arrayAccess = new Twig_TemplateArrayAccess(); - $tests = array_merge($tests, [ - [true, ['foo' => 'bar'], $arrayAccess, 'vars', [], $anyType], - ]); - - // tests when input is not an array or object - $tests = array_merge($tests, [ - [false, null, 42, 'a', [], $anyType, 'Impossible to access an attribute ("a") on a integer variable ("42") in "index.twig".'], - [false, null, 'string', 'a', [], $anyType, 'Impossible to access an attribute ("a") on a string variable ("string") in "index.twig".'], - [false, null, [], 'a', [], $anyType, 'Key "a" does not exist as the array is empty in "index.twig".'], - ]); - - return $tests; - } - - /** - * @expectedException \Twig\Error\RuntimeError - */ - public function testGetIsMethods() - { - $getIsObject = new Twig_TemplateGetIsMethods(); - $template = new Twig_TemplateTest(new Environment($this->getMockBuilder('\Twig\Loader\LoaderInterface')->getMock(), ['strict_variables' => true])); - // first time should not create a cache for "get" - $this->assertNull($template->getAttribute($getIsObject, 'get')); - // 0 should be in the method cache now, so this should fail - $this->assertNull($template->getAttribute($getIsObject, 0)); - } -} - -class Twig_TemplateTest extends Template -{ - private $name; - - public function __construct(Environment $env, $name = 'index.twig') - { - parent::__construct($env); - self::$cache = []; - $this->name = $name; - } - - public function getZero() - { - return 0; - } - - public function getEmpty() - { - return ''; - } - - public function getString() - { - return 'some_string'; - } - - public function getTrue() - { - return true; - } - - public function getTemplateName() - { - return $this->name; - } - - public function getDebugInfo() - { - return []; - } - - protected function doGetParent(array $context) - { - return false; - } - - protected function doDisplay(array $context, array $blocks = []) - { - } - - public function getAttribute($object, $item, array $arguments = [], $type = Template::ANY_CALL, $isDefinedTest = false, $ignoreStrictCheck = false) - { - if (\function_exists('twig_template_get_attributes')) { - return twig_template_get_attributes($this, $object, $item, $arguments, $type, $isDefinedTest, $ignoreStrictCheck); - } else { - return parent::getAttribute($object, $item, $arguments, $type, $isDefinedTest, $ignoreStrictCheck); - } - } - - public function block_name($context, array $blocks = []) - { - } -} - -class Twig_TemplateArrayAccessObject implements \ArrayAccess -{ - protected $protected = 'protected'; - - public $attributes = [ - 'defined' => 'defined', - 'zero' => 0, - 'null' => null, - '1' => 1, - 'bar' => true, - 'baz' => 'baz', - '09' => '09', - '+4' => '+4', - ]; - - public function offsetExists($name) - { - return \array_key_exists($name, $this->attributes); - } - - public function offsetGet($name) - { - return \array_key_exists($name, $this->attributes) ? $this->attributes[$name] : null; - } - - public function offsetSet($name, $value) - { - } - - public function offsetUnset($name) - { - } -} - -class Twig_TemplateMagicPropertyObject -{ - public $defined = 'defined'; - - public $attributes = [ - 'zero' => 0, - 'null' => null, - '1' => 1, - 'bar' => true, - 'baz' => 'baz', - '09' => '09', - '+4' => '+4', - ]; - - protected $protected = 'protected'; - - public function __isset($name) - { - return \array_key_exists($name, $this->attributes); - } - - public function __get($name) - { - return \array_key_exists($name, $this->attributes) ? $this->attributes[$name] : null; - } -} - -class Twig_TemplateMagicPropertyObjectWithException -{ - public function __isset($key) - { - throw new \Exception('Hey! Don\'t try to isset me!'); - } -} - -class Twig_TemplatePropertyObject -{ - public $defined = 'defined'; - public $zero = 0; - public $null = null; - public $bar = true; - public $baz = 'baz'; - - protected $protected = 'protected'; -} - -class Twig_TemplatePropertyObjectAndIterator extends Twig_TemplatePropertyObject implements \IteratorAggregate -{ - public function getIterator() - { - return new \ArrayIterator(['foo', 'bar']); - } -} - -class Twig_TemplatePropertyObjectAndArrayAccess extends Twig_TemplatePropertyObject implements \ArrayAccess -{ - private $data = [ - 'defined' => 'defined', - 'zero' => 0, - 'null' => null, - 'bar' => true, - 'foo' => true, - 'baz' => 'baz', - 'baf' => 'baf', - ]; - - public function offsetExists($offset) - { - return \array_key_exists($offset, $this->data); - } - - public function offsetGet($offset) - { - return $this->offsetExists($offset) ? $this->data[$offset] : 'n/a'; - } - - public function offsetSet($offset, $value) - { - } - - public function offsetUnset($offset) - { - } -} - -class Twig_TemplatePropertyObjectDefinedWithUndefinedValue -{ - public $foo; - - public function __construct() - { - $this->foo = @$notExist; - } -} - -class Twig_TemplateMethodObject -{ - public function getDefined() - { - return 'defined'; - } - - public function get1() - { - return 1; - } - - public function get09() - { - return '09'; - } - - public function getZero() - { - return 0; - } - - public function getNull() - { - } - - public function isBar() - { - return true; - } - - public function isBaz() - { - return 'should never be returned'; - } - - public function getBaz() - { - return 'baz'; - } - - protected function getProtected() - { - return 'protected'; - } - - public static function getStatic() - { - return 'static'; - } -} - -class Twig_TemplateGetIsMethods -{ - public function get() - { - } - - public function is() - { - } -} - -class Twig_TemplateMethodAndPropObject -{ - private $a = 'a_prop'; - - public function getA() - { - return 'a'; - } - - public $b = 'b_prop'; - - public function getB() - { - return 'b'; - } - - private $c = 'c_prop'; - - private function getC() - { - return 'c'; - } -} - -class Twig_TemplateArrayAccess implements \ArrayAccess -{ - public $vars = [ - 'foo' => 'bar', - ]; - private $children = []; - - public function offsetExists($offset) - { - return \array_key_exists($offset, $this->children); - } - - public function offsetGet($offset) - { - return $this->children[$offset]; - } - - public function offsetSet($offset, $value) - { - $this->children[$offset] = $value; - } - - public function offsetUnset($offset) - { - unset($this->children[$offset]); - } -} - -class Twig_TemplateMagicMethodObject -{ - public function __call($method, $arguments) - { - return '__call_'.$method; - } -} - -class Twig_TemplateMagicMethodExceptionObject -{ - public function __call($method, $arguments) - { - throw new \BadMethodCallException(sprintf('Unknown method "%s".', $method)); - } -} - -class CExtDisablingNodeVisitor implements NodeVisitorInterface -{ - public function enterNode(Twig_NodeInterface $node, Environment $env) - { - if ($node instanceof GetAttrExpression) { - $node->setAttribute('disable_c_ext', true); - } - - return $node; - } - - public function leaveNode(Twig_NodeInterface $node, Environment $env) - { - return $node; - } - - public function getPriority() - { - return 0; - } -} - -// to be removed in 2.0 -interface Twig_TemplateTestLoaderInterface extends LoaderInterface, SourceContextLoaderInterface -{ -} diff --git a/vendor/twig/twig/test/Twig/Tests/TemplateWrapperTest.php b/vendor/twig/twig/test/Twig/Tests/TemplateWrapperTest.php deleted file mode 100644 index 74618406c7..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/TemplateWrapperTest.php +++ /dev/null @@ -1,68 +0,0 @@ -<?php - -/* - * This file is part of Twig. - * - * (c) Fabien Potencier - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Twig\Environment; -use Twig\Loader\ArrayLoader; - -class Twig_Tests_TemplateWrapperTest extends \PHPUnit\Framework\TestCase -{ - public function testHasGetBlocks() - { - $twig = new Environment(new ArrayLoader([ - 'index' => '{% block foo %}{% endblock %}', - 'index_with_use' => '{% use "imported" %}{% block foo %}{% endblock %}', - 'index_with_extends' => '{% extends "extended" %}{% block foo %}{% endblock %}', - 'imported' => '{% block imported %}{% endblock %}', - 'extended' => '{% block extended %}{% endblock %}', - ])); - - $wrapper = $twig->load('index'); - $this->assertTrue($wrapper->hasBlock('foo')); - $this->assertFalse($wrapper->hasBlock('bar')); - $this->assertEquals(['foo'], $wrapper->getBlockNames()); - - $wrapper = $twig->load('index_with_use'); - $this->assertTrue($wrapper->hasBlock('foo')); - $this->assertTrue($wrapper->hasBlock('imported')); - $this->assertEquals(['imported', 'foo'], $wrapper->getBlockNames()); - - $wrapper = $twig->load('index_with_extends'); - $this->assertTrue($wrapper->hasBlock('foo')); - $this->assertTrue($wrapper->hasBlock('extended')); - $this->assertEquals(['foo', 'extended'], $wrapper->getBlockNames()); - } - - public function testRenderBlock() - { - $twig = new Environment(new ArrayLoader([ - 'index' => '{% block foo %}{{ foo }}{{ bar }}{% endblock %}', - ])); - $twig->addGlobal('bar', 'BAR'); - - $wrapper = $twig->load('index'); - $this->assertEquals('FOOBAR', $wrapper->renderBlock('foo', ['foo' => 'FOO'])); - } - - public function testDisplayBlock() - { - $twig = new Environment(new ArrayLoader([ - 'index' => '{% block foo %}{{ foo }}{{ bar }}{% endblock %}', - ])); - $twig->addGlobal('bar', 'BAR'); - - $wrapper = $twig->load('index'); - - ob_start(); - $wrapper->displayBlock('foo', ['foo' => 'FOO']); - - $this->assertEquals('FOOBAR', ob_get_clean()); - } -} diff --git a/vendor/twig/twig/test/Twig/Tests/TokenStreamTest.php b/vendor/twig/twig/test/Twig/Tests/TokenStreamTest.php deleted file mode 100644 index e5cd568b0c..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/TokenStreamTest.php +++ /dev/null @@ -1,85 +0,0 @@ -<?php - -/* - * This file is part of Twig. - * - * (c) Fabien Potencier - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Twig\Token; -use Twig\TokenStream; - -class Twig_Tests_TokenStreamTest extends \PHPUnit\Framework\TestCase -{ - protected static $tokens; - - protected function setUp() - { - self::$tokens = [ - new Token(Token::TEXT_TYPE, 1, 1), - new Token(Token::TEXT_TYPE, 2, 1), - new Token(Token::TEXT_TYPE, 3, 1), - new Token(Token::TEXT_TYPE, 4, 1), - new Token(Token::TEXT_TYPE, 5, 1), - new Token(Token::TEXT_TYPE, 6, 1), - new Token(Token::TEXT_TYPE, 7, 1), - new Token(Token::EOF_TYPE, 0, 1), - ]; - } - - /** - * @group legacy - */ - public function testLegacyConstructorSignature() - { - $stream = new TokenStream([], 'foo', '{{ foo }}'); - $this->assertEquals('foo', $stream->getFilename()); - $this->assertEquals('{{ foo }}', $stream->getSource()); - $this->assertEquals('foo', $stream->getSourceContext()->getName()); - $this->assertEquals('{{ foo }}', $stream->getSourceContext()->getCode()); - } - - public function testNext() - { - $stream = new TokenStream(self::$tokens); - $repr = []; - while (!$stream->isEOF()) { - $token = $stream->next(); - - $repr[] = $token->getValue(); - } - $this->assertEquals('1, 2, 3, 4, 5, 6, 7', implode(', ', $repr), '->next() advances the pointer and returns the current token'); - } - - /** - * @expectedException \Twig\Error\SyntaxError - * @expectedExceptionMessage Unexpected end of template - */ - public function testEndOfTemplateNext() - { - $stream = new TokenStream([ - new Token(Token::BLOCK_START_TYPE, 1, 1), - ]); - while (!$stream->isEOF()) { - $stream->next(); - } - } - - /** - * @expectedException \Twig\Error\SyntaxError - * @expectedExceptionMessage Unexpected end of template - */ - public function testEndOfTemplateLook() - { - $stream = new TokenStream([ - new Token(Token::BLOCK_START_TYPE, 1, 1), - ]); - while (!$stream->isEOF()) { - $stream->look(); - $stream->next(); - } - } -} diff --git a/vendor/twig/twig/test/Twig/Tests/Util/DeprecationCollectorTest.php b/vendor/twig/twig/test/Twig/Tests/Util/DeprecationCollectorTest.php deleted file mode 100644 index 0f577c60f5..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/Util/DeprecationCollectorTest.php +++ /dev/null @@ -1,46 +0,0 @@ -<?php - -/* - * This file is part of Twig. - * - * (c) Fabien Potencier - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Twig\Environment; -use Twig\TwigFunction; -use Twig\Util\DeprecationCollector; - -class Twig_Tests_Util_DeprecationCollectorTest extends \PHPUnit\Framework\TestCase -{ - /** - * @requires PHP 5.3 - */ - public function testCollect() - { - $twig = new Environment($this->getMockBuilder('\Twig\Loader\LoaderInterface')->getMock()); - $twig->addFunction(new TwigFunction('deprec', [$this, 'deprec'], ['deprecated' => true])); - - $collector = new DeprecationCollector($twig); - $deprecations = $collector->collect(new Twig_Tests_Util_Iterator()); - - $this->assertEquals(['Twig Function "deprec" is deprecated in deprec.twig at line 1.'], $deprecations); - } - - public function deprec() - { - } -} - -class Twig_Tests_Util_Iterator implements \IteratorAggregate -{ - public function getIterator() - { - return new \ArrayIterator([ - 'ok.twig' => '{{ foo }}', - 'deprec.twig' => '{{ deprec("foo") }}', - ]); - } -} diff --git a/vendor/twig/twig/test/Twig/Tests/escapingTest.php b/vendor/twig/twig/test/Twig/Tests/escapingTest.php deleted file mode 100644 index 6de31a9354..0000000000 --- a/vendor/twig/twig/test/Twig/Tests/escapingTest.php +++ /dev/null @@ -1,325 +0,0 @@ -<?php - -/** - * This class is adapted from code coming from Zend Framework. - * - * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (https://www.zend.com) - * @license https://framework.zend.com/license/new-bsd New BSD License - */ -class Twig_Test_EscapingTest extends \PHPUnit\Framework\TestCase -{ - /** - * All character encodings supported by htmlspecialchars(). - */ - protected $htmlSpecialChars = [ - '\'' => ''', - '"' => '"', - '<' => '<', - '>' => '>', - '&' => '&', - ]; - - protected $htmlAttrSpecialChars = [ - '\'' => ''', - /* Characters beyond ASCII value 255 to unicode escape */ - 'Ā' => 'Ā', - '😀' => '😀', - /* Immune chars excluded */ - ',' => ',', - '.' => '.', - '-' => '-', - '_' => '_', - /* Basic alnums excluded */ - 'a' => 'a', - 'A' => 'A', - 'z' => 'z', - 'Z' => 'Z', - '0' => '0', - '9' => '9', - /* Basic control characters and null */ - "\r" => '
', - "\n" => '
', - "\t" => '	', - "\0" => '�', // should use Unicode replacement char - /* Encode chars as named entities where possible */ - '<' => '<', - '>' => '>', - '&' => '&', - '"' => '"', - /* Encode spaces for quoteless attribute protection */ - ' ' => ' ', - ]; - - protected $jsSpecialChars = [ - /* HTML special chars - escape without exception to hex */ - '<' => '\\u003C', - '>' => '\\u003E', - '\'' => '\\u0027', - '"' => '\\u0022', - '&' => '\\u0026', - '/' => '\\/', - /* Characters beyond ASCII value 255 to unicode escape */ - 'Ā' => '\\u0100', - '😀' => '\\uD83D\\uDE00', - /* Immune chars excluded */ - ',' => ',', - '.' => '.', - '_' => '_', - /* Basic alnums excluded */ - 'a' => 'a', - 'A' => 'A', - 'z' => 'z', - 'Z' => 'Z', - '0' => '0', - '9' => '9', - /* Basic control characters and null */ - "\r" => '\r', - "\n" => '\n', - "\x08" => '\b', - "\t" => '\t', - "\x0C" => '\f', - "\0" => '\\u0000', - /* Encode spaces for quoteless attribute protection */ - ' ' => '\\u0020', - ]; - - protected $urlSpecialChars = [ - /* HTML special chars - escape without exception to percent encoding */ - '<' => '%3C', - '>' => '%3E', - '\'' => '%27', - '"' => '%22', - '&' => '%26', - /* Characters beyond ASCII value 255 to hex sequence */ - 'Ā' => '%C4%80', - /* Punctuation and unreserved check */ - ',' => '%2C', - '.' => '.', - '_' => '_', - '-' => '-', - ':' => '%3A', - ';' => '%3B', - '!' => '%21', - /* Basic alnums excluded */ - 'a' => 'a', - 'A' => 'A', - 'z' => 'z', - 'Z' => 'Z', - '0' => '0', - '9' => '9', - /* Basic control characters and null */ - "\r" => '%0D', - "\n" => '%0A', - "\t" => '%09', - "\0" => '%00', - /* PHP quirks from the past */ - ' ' => '%20', - '~' => '~', - '+' => '%2B', - ]; - - protected $cssSpecialChars = [ - /* HTML special chars - escape without exception to hex */ - '<' => '\\3C ', - '>' => '\\3E ', - '\'' => '\\27 ', - '"' => '\\22 ', - '&' => '\\26 ', - /* Characters beyond ASCII value 255 to unicode escape */ - 'Ā' => '\\100 ', - /* Immune chars excluded */ - ',' => '\\2C ', - '.' => '\\2E ', - '_' => '\\5F ', - /* Basic alnums excluded */ - 'a' => 'a', - 'A' => 'A', - 'z' => 'z', - 'Z' => 'Z', - '0' => '0', - '9' => '9', - /* Basic control characters and null */ - "\r" => '\\D ', - "\n" => '\\A ', - "\t" => '\\9 ', - "\0" => '\\0 ', - /* Encode spaces for quoteless attribute protection */ - ' ' => '\\20 ', - ]; - - protected $env; - - protected function setUp() - { - $this->env = new \Twig\Environment($this->getMockBuilder('\Twig\Loader\LoaderInterface')->getMock()); - } - - public function testHtmlEscapingConvertsSpecialChars() - { - foreach ($this->htmlSpecialChars as $key => $value) { - $this->assertEquals($value, twig_escape_filter($this->env, $key, 'html'), 'Failed to escape: '.$key); - } - } - - public function testHtmlAttributeEscapingConvertsSpecialChars() - { - foreach ($this->htmlAttrSpecialChars as $key => $value) { - $this->assertEquals($value, twig_escape_filter($this->env, $key, 'html_attr'), 'Failed to escape: '.$key); - } - } - - public function testJavascriptEscapingConvertsSpecialChars() - { - foreach ($this->jsSpecialChars as $key => $value) { - $this->assertEquals($value, twig_escape_filter($this->env, $key, 'js'), 'Failed to escape: '.$key); - } - } - - public function testJavascriptEscapingReturnsStringIfZeroLength() - { - $this->assertEquals('', twig_escape_filter($this->env, '', 'js')); - } - - public function testJavascriptEscapingReturnsStringIfContainsOnlyDigits() - { - $this->assertEquals('123', twig_escape_filter($this->env, '123', 'js')); - } - - public function testCssEscapingConvertsSpecialChars() - { - foreach ($this->cssSpecialChars as $key => $value) { - $this->assertEquals($value, twig_escape_filter($this->env, $key, 'css'), 'Failed to escape: '.$key); - } - } - - public function testCssEscapingReturnsStringIfZeroLength() - { - $this->assertEquals('', twig_escape_filter($this->env, '', 'css')); - } - - public function testCssEscapingReturnsStringIfContainsOnlyDigits() - { - $this->assertEquals('123', twig_escape_filter($this->env, '123', 'css')); - } - - public function testUrlEscapingConvertsSpecialChars() - { - foreach ($this->urlSpecialChars as $key => $value) { - $this->assertEquals($value, twig_escape_filter($this->env, $key, 'url'), 'Failed to escape: '.$key); - } - } - - /** - * Range tests to confirm escaped range of characters is within OWASP recommendation. - */ - - /** - * Only testing the first few 2 ranges on this prot. function as that's all these - * other range tests require. - */ - public function testUnicodeCodepointConversionToUtf8() - { - $expected = ' ~ޙ'; - $codepoints = [0x20, 0x7e, 0x799]; - $result = ''; - foreach ($codepoints as $value) { - $result .= $this->codepointToUtf8($value); - } - $this->assertEquals($expected, $result); - } - - /** - * Convert a Unicode Codepoint to a literal UTF-8 character. - * - * @param int $codepoint Unicode codepoint in hex notation - * - * @return string UTF-8 literal string - */ - protected function codepointToUtf8($codepoint) - { - if ($codepoint < 0x80) { - return \chr($codepoint); - } - if ($codepoint < 0x800) { - return \chr($codepoint >> 6 & 0x3f | 0xc0) - .\chr($codepoint & 0x3f | 0x80); - } - if ($codepoint < 0x10000) { - return \chr($codepoint >> 12 & 0x0f | 0xe0) - .\chr($codepoint >> 6 & 0x3f | 0x80) - .\chr($codepoint & 0x3f | 0x80); - } - if ($codepoint < 0x110000) { - return \chr($codepoint >> 18 & 0x07 | 0xf0) - .\chr($codepoint >> 12 & 0x3f | 0x80) - .\chr($codepoint >> 6 & 0x3f | 0x80) - .\chr($codepoint & 0x3f | 0x80); - } - throw new \Exception('Codepoint requested outside of Unicode range.'); - } - - public function testJavascriptEscapingEscapesOwaspRecommendedRanges() - { - $immune = [',', '.', '_']; // Exceptions to escaping ranges - for ($chr = 0; $chr < 0xFF; ++$chr) { - if ($chr >= 0x30 && $chr <= 0x39 - || $chr >= 0x41 && $chr <= 0x5A - || $chr >= 0x61 && $chr <= 0x7A) { - $literal = $this->codepointToUtf8($chr); - $this->assertEquals($literal, twig_escape_filter($this->env, $literal, 'js')); - } else { - $literal = $this->codepointToUtf8($chr); - if (\in_array($literal, $immune)) { - $this->assertEquals($literal, twig_escape_filter($this->env, $literal, 'js')); - } else { - $this->assertNotEquals( - $literal, - twig_escape_filter($this->env, $literal, 'js'), - "$literal should be escaped!"); - } - } - } - } - - public function testHtmlAttributeEscapingEscapesOwaspRecommendedRanges() - { - $immune = [',', '.', '-', '_']; // Exceptions to escaping ranges - for ($chr = 0; $chr < 0xFF; ++$chr) { - if ($chr >= 0x30 && $chr <= 0x39 - || $chr >= 0x41 && $chr <= 0x5A - || $chr >= 0x61 && $chr <= 0x7A) { - $literal = $this->codepointToUtf8($chr); - $this->assertEquals($literal, twig_escape_filter($this->env, $literal, 'html_attr')); - } else { - $literal = $this->codepointToUtf8($chr); - if (\in_array($literal, $immune)) { - $this->assertEquals($literal, twig_escape_filter($this->env, $literal, 'html_attr')); - } else { - $this->assertNotEquals( - $literal, - twig_escape_filter($this->env, $literal, 'html_attr'), - "$literal should be escaped!"); - } - } - } - } - - public function testCssEscapingEscapesOwaspRecommendedRanges() - { - // CSS has no exceptions to escaping ranges - for ($chr = 0; $chr < 0xFF; ++$chr) { - if ($chr >= 0x30 && $chr <= 0x39 - || $chr >= 0x41 && $chr <= 0x5A - || $chr >= 0x61 && $chr <= 0x7A) { - $literal = $this->codepointToUtf8($chr); - $this->assertEquals($literal, twig_escape_filter($this->env, $literal, 'css')); - } else { - $literal = $this->codepointToUtf8($chr); - $this->assertNotEquals( - $literal, - twig_escape_filter($this->env, $literal, 'css'), - "$literal should be escaped!"); - } - } - } -} diff --git a/web/modules/simplesamlphp_auth/composer.json b/web/modules/simplesamlphp_auth/composer.json index fbf4e901ee..0ed7d1f901 100644 --- a/web/modules/simplesamlphp_auth/composer.json +++ b/web/modules/simplesamlphp_auth/composer.json @@ -5,6 +5,7 @@ "license": "GPL-2.0+", "homepage": "https://www.drupal.org/project/simplesamlphp_auth", "require": { - "simplesamlphp/simplesamlphp": "~1.15" + "drupal/externalauth": "^1.1", + "simplesamlphp/simplesamlphp": "~1.17.2" } } diff --git a/web/modules/simplesamlphp_auth/simplesamlphp_auth.api.php b/web/modules/simplesamlphp_auth/simplesamlphp_auth.api.php index 76bd622e73..024cd1a1a7 100644 --- a/web/modules/simplesamlphp_auth/simplesamlphp_auth.api.php +++ b/web/modules/simplesamlphp_auth/simplesamlphp_auth.api.php @@ -97,7 +97,7 @@ function hook_simplesamphp_auth_account_authname_alter(&$authname, \Drupal\user\ * @param array $attributes * The SimpleSAMLphp attributes for this user. * - * @return \Drupal\user\UserInterface | bool + * @return \Drupal\user\UserInterface|bool * The pre-existing Drupal user to be SAML-enabled, or FALSE if none found. */ function hook_simplesamlphp_auth_existing_user($attributes) { diff --git a/web/modules/simplesamlphp_auth/simplesamlphp_auth.info.yml b/web/modules/simplesamlphp_auth/simplesamlphp_auth.info.yml index 221d7ce252..f3685f5c6a 100644 --- a/web/modules/simplesamlphp_auth/simplesamlphp_auth.info.yml +++ b/web/modules/simplesamlphp_auth/simplesamlphp_auth.info.yml @@ -4,11 +4,11 @@ description: Allows users to authenticate to a remote SAML identity provider (Id # core: 8.x configure: simplesamlphp_auth.admin_settings dependencies: - - user - - externalauth + - drupal:user + - externalauth:externalauth -# Information added by Drupal.org packaging script on 2018-03-17 -version: '8.x-3.0' +# Information added by Drupal.org packaging script on 2019-08-06 +version: '8.x-3.1' core: '8.x' project: 'simplesamlphp_auth' -datestamp: 1521252789 +datestamp: 1565118487 diff --git a/web/modules/simplesamlphp_auth/simplesamlphp_auth.install b/web/modules/simplesamlphp_auth/simplesamlphp_auth.install index 13eb7dadad..897fc9be54 100644 --- a/web/modules/simplesamlphp_auth/simplesamlphp_auth.install +++ b/web/modules/simplesamlphp_auth/simplesamlphp_auth.install @@ -23,7 +23,7 @@ function simplesamlphp_auth_install() { $user_settings->set('register', 'admin_only'); $user_settings->save(); // Inform the user about disabling the open registration. - drupal_set_message(t('The SimpleSAMLphp Authentication module disabled the user registration. You can manually enable it again in the <a href=":user_settings_url">Account settings</a>.', [ + \Drupal::messenger()->addMessage(t('The SimpleSAMLphp Authentication module disabled the user registration. You can manually enable it again in the <a href=":user_settings_url">Account settings</a>.', [ ':user_settings_url' => Url::fromRoute('entity.user.admin_form')->toString(), ]), 'warning'); $config->save(); @@ -49,9 +49,9 @@ function simplesamlphp_auth_requirements($phase) { if ($phase == 'install') { simplesamlphp_auth_check_library(); - if (!class_exists('SimpleSAML_Configuration')) { + if (!class_exists('SimpleSAML\Configuration')) { $requirements['simplesamlphp_library'] = [ - 'description' => t('SimpleSAMLphp module requires the simplesamlphp library. See README file for installation instructions.'), + 'description' => t('SimpleSAMLphp module requires the simplesamlphp library, version 1.17.2 or later. See README file for installation instructions.'), 'severity' => REQUIREMENT_ERROR, ]; } @@ -64,7 +64,7 @@ function simplesamlphp_auth_requirements($phase) { 'severity' => REQUIREMENT_INFO, 'title' => 'simpleSAMLphp_auth', 'value' => t('SimpleSAMLphp authentication is NOT activated'), - 'description' => t('It can be activated on the <a href=":config_page">configuration page</a>.', [':config_page' => \Drupal::url('simplesamlphp_auth.admin_settings')]), + 'description' => t('It can be activated on the <a href=":config_page">configuration page</a>.', [':config_page' => Url::fromRoute('simplesamlphp_auth.admin_settings')->toString()]), ]; } } @@ -78,8 +78,7 @@ function simplesamlphp_auth_requirements($phase) { * Fallback for when the library was not found via Composer. */ function simplesamlphp_auth_check_library() { - if (!class_exists('SimpleSAML_Configuration')) { - $dir = Settings::get('simplesamlphp_dir'); + if ($dir = Settings::get('simplesamlphp_dir')) { include_once $dir . '/lib/_autoload.php'; } } diff --git a/web/modules/simplesamlphp_auth/simplesamlphp_auth.module b/web/modules/simplesamlphp_auth/simplesamlphp_auth.module index 43711175b3..dba7d35293 100644 --- a/web/modules/simplesamlphp_auth/simplesamlphp_auth.module +++ b/web/modules/simplesamlphp_auth/simplesamlphp_auth.module @@ -53,21 +53,38 @@ function simplesamlphp_auth_user_logout($account) { $logout_url = \Drupal::config('simplesamlphp_auth.settings')->get('logout_goto_url'); $simplesaml = \Drupal::service('simplesamlphp_auth.manager'); - // Have to destroy the session here as some configurations of - // SimpleSAMLphp_auth can create infinite loops. By removing IdP auth before - // Drupal auth, checks for local authentication will trigger before the - // session is destroyed naturally. We must therefore destroy the session - // manually here. - session_destroy(); - - if ($logout_url) { - $simplesaml->logout($logout_url); - } - else { - $simplesaml->logout(); + // Only interfere if this user was logged in through simplesaml. + if ($simplesaml->isAuthenticated()) { + // Have to destroy the session here as some configurations of + // SimpleSAMLphp_auth can create infinite loops. By removing IdP auth before + // Drupal auth, checks for local authentication will trigger before the + // session is destroyed naturally. We must therefore destroy the session + // manually here. + session_destroy(); + + if ($logout_url) { + $simplesaml->logout($logout_url); + } + else { + $simplesaml->logout(); + } } } +/** + * Implements hook_entity_extra_field_info(). + */ +function simplesamlphp_auth_entity_extra_field_info() { + $fields = []; + $fields['user']['user']['form']['simplesamlphp_auth_user_enable'] = [ + 'label' => t('SAML authentication settings'), + 'description' => '', + 'weight' => 0, + 'visible' => TRUE, + ]; + return $fields; +} + /** * Implements hook_form_FORM_ID_alter(). * @@ -126,7 +143,7 @@ function simplesamlphp_auth_form_user_register_form_alter(&$form, FormStateInter * @see simplesamlphp_auth_form_user_register_form_alter() * @see simplesamlphp_auth_user_form_submit() */ -function simplesamlphp_auth_user_form_includes(&$form) { +function simplesamlphp_auth_user_form_includes(array &$form) { $form['simplesamlphp_auth_user_enable'] = [ '#type' => 'checkbox', '#title' => t('Enable this user to leverage SAML authentication'), @@ -146,11 +163,13 @@ function simplesamlphp_auth_user_form_includes(&$form) { */ function simplesamlphp_auth_form_user_login_form_alter(&$form, FormStateInterface $form_state, $form_id) { // Return without executing if the functionality is not enabled. - if (!\Drupal::config('simplesamlphp_auth.settings')->get('activate')) { + $config = \Drupal::config('simplesamlphp_auth.settings'); + \Drupal::service('renderer')->addCacheableDependency($form, $config); + if (!$config->get('activate')) { return; } - $label = Drupal::config('simplesamlphp_auth.settings')->get('login_link_display_name'); + $label = $config->get('login_link_display_name'); $form['simplesamlphp_auth_login_link'] = [ '#title' => $label, '#type' => 'link', diff --git a/web/modules/simplesamlphp_auth/simplesamlphp_auth.routing.yml b/web/modules/simplesamlphp_auth/simplesamlphp_auth.routing.yml index f3b7eec62d..99b4401570 100644 --- a/web/modules/simplesamlphp_auth/simplesamlphp_auth.routing.yml +++ b/web/modules/simplesamlphp_auth/simplesamlphp_auth.routing.yml @@ -24,7 +24,7 @@ simplesamlphp_auth.saml_login: defaults: _controller: '\Drupal\simplesamlphp_auth\Controller\SimplesamlphpAuthController::authenticate' requirements: - _access: 'TRUE' + _user_is_logged_in: 'FALSE' options: _maintenance_access: TRUE no_cache: TRUE diff --git a/web/modules/simplesamlphp_auth/simplesamlphp_auth.services.yml b/web/modules/simplesamlphp_auth/simplesamlphp_auth.services.yml index 33aa931a23..96dca56a0d 100644 --- a/web/modules/simplesamlphp_auth/simplesamlphp_auth.services.yml +++ b/web/modules/simplesamlphp_auth/simplesamlphp_auth.services.yml @@ -1,18 +1,18 @@ services: simplesamlphp_auth.manager: class: Drupal\simplesamlphp_auth\Service\SimplesamlphpAuthManager - arguments: ['@config.factory'] + arguments: ['@config.factory', '@current_user', '@router.admin_context', '@module_handler', '@request_stack', '@messenger'] simplesamlphp_auth.drupalauth: class: Drupal\simplesamlphp_auth\Service\SimplesamlphpDrupalAuth - arguments: ['@simplesamlphp_auth.manager', '@config.factory', '@entity_type.manager', '@logger.channel.simplesamlphp_auth', '@externalauth.externalauth', '@current_user'] + arguments: ['@simplesamlphp_auth.manager', '@config.factory', '@entity_type.manager', '@logger.channel.simplesamlphp_auth', '@externalauth.externalauth', '@current_user', '@messenger', '@module_handler'] simplesamlphp_auth_event_subscriber: class: Drupal\simplesamlphp_auth\EventSubscriber\SimplesamlSubscriber - arguments: ['@simplesamlphp_auth.manager', '@current_user', '@config.factory', '@logger.channel.simplesamlphp_auth'] + arguments: ['@simplesamlphp_auth.manager', '@current_user', '@config.factory', '@logger.channel.simplesamlphp_auth', '@current_route_match'] tags: - {name: event_subscriber} simplesamlphp_auth_externalauth_event_subscriber: class: Drupal\simplesamlphp_auth\EventSubscriber\SimplesamlExternalauthSubscriber - arguments: ['@simplesamlphp_auth.manager', '@simplesamlphp_auth.drupalauth', '@config.factory', '@logger.channel.simplesamlphp_auth'] + arguments: ['@simplesamlphp_auth.manager', '@simplesamlphp_auth.drupalauth', '@config.factory', '@logger.channel.simplesamlphp_auth', '@module_handler'] tags: - {name: event_subscriber} logger.channel.simplesamlphp_auth: diff --git a/web/modules/simplesamlphp_auth/src/EventSubscriber/SimplesamlExternalauthSubscriber.php b/web/modules/simplesamlphp_auth/src/EventSubscriber/SimplesamlExternalauthSubscriber.php index 03949462f0..73b844af06 100644 --- a/web/modules/simplesamlphp_auth/src/EventSubscriber/SimplesamlExternalauthSubscriber.php +++ b/web/modules/simplesamlphp_auth/src/EventSubscriber/SimplesamlExternalauthSubscriber.php @@ -10,6 +10,7 @@ use Drupal\externalauth\Event\ExternalAuthLoginEvent; use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Psr\Log\LoggerInterface; +use Drupal\Core\Extension\ModuleHandlerInterface; /** * Event subscriber subscribing to ExternalAuthEvents. @@ -44,6 +45,13 @@ class SimplesamlExternalauthSubscriber implements EventSubscriberInterface { */ protected $logger; + /** + * The module handler service. + * + * @var \Drupal\Core\Extension\ModuleHandlerInterface + */ + protected $moduleHandler; + /** * {@inheritdoc} * @@ -55,12 +63,15 @@ class SimplesamlExternalauthSubscriber implements EventSubscriberInterface { * The configuration factory. * @param \Psr\Log\LoggerInterface $logger * A logger instance. + * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler + * The module handler service. */ - public function __construct(SimplesamlphpAuthManager $simplesaml, SimplesamlphpDrupalAuth $simplesaml_drupalauth, ConfigFactoryInterface $config_factory, LoggerInterface $logger) { + public function __construct(SimplesamlphpAuthManager $simplesaml, SimplesamlphpDrupalAuth $simplesaml_drupalauth, ConfigFactoryInterface $config_factory, LoggerInterface $logger, ModuleHandlerInterface $module_handler) { $this->simplesaml = $simplesaml; $this->simplesamlDrupalauth = $simplesaml_drupalauth; $this->config = $config_factory->get('simplesamlphp_auth.settings'); $this->logger = $logger; + $this->moduleHandler = $module_handler; } /** @@ -87,8 +98,8 @@ public function externalauthLogin(ExternalAuthLoginEvent $event) { // SimpleSAMLphp attributes. $account_altered = FALSE; $attributes = $this->simplesaml->getAttributes(); - foreach (\Drupal::moduleHandler()->getImplementations('simplesamlphp_auth_user_attributes') as $module) { - $return_value = \Drupal::moduleHandler()->invoke($module, 'simplesamlphp_auth_user_attributes', [$account, $attributes]); + foreach ($this->moduleHandler->getImplementations('simplesamlphp_auth_user_attributes') as $module) { + $return_value = $this->moduleHandler->invoke($module, 'simplesamlphp_auth_user_attributes', [$account, $attributes]); if ($return_value instanceof UserInterface) { if ($this->config->get('debug')) { $this->logger->debug('Drupal user attributes have altered based on SAML attributes by %module module.', [ diff --git a/web/modules/simplesamlphp_auth/src/EventSubscriber/SimplesamlSubscriber.php b/web/modules/simplesamlphp_auth/src/EventSubscriber/SimplesamlSubscriber.php index 3bc47b915e..0e29647372 100644 --- a/web/modules/simplesamlphp_auth/src/EventSubscriber/SimplesamlSubscriber.php +++ b/web/modules/simplesamlphp_auth/src/EventSubscriber/SimplesamlSubscriber.php @@ -4,6 +4,8 @@ use Drupal\Core\Config\ConfigFactoryInterface; use Drupal\Core\Session\AccountInterface; +use Drupal\Core\Routing\RouteMatchInterface; +use Drupal\Core\Url; use Drupal\simplesamlphp_auth\Service\SimplesamlphpAuthManager; use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\HttpKernel\KernelEvents; @@ -44,6 +46,13 @@ class SimplesamlSubscriber implements EventSubscriberInterface { */ protected $logger; + /** + * The current route match. + * + * @var \Drupal\Core\Routing\RouteMatchInterface + */ + protected $routeMatch; + /** * {@inheritdoc} * @@ -55,12 +64,15 @@ class SimplesamlSubscriber implements EventSubscriberInterface { * The configuration factory. * @param \Psr\Log\LoggerInterface $logger * A logger instance. + * @param \Drupal\Core\Routing\RouteMatchInterface $route_match + * The current route match. */ - public function __construct(SimplesamlphpAuthManager $simplesaml, AccountInterface $account, ConfigFactoryInterface $config_factory, LoggerInterface $logger) { + public function __construct(SimplesamlphpAuthManager $simplesaml, AccountInterface $account, ConfigFactoryInterface $config_factory, LoggerInterface $logger, RouteMatchInterface $route_match) { $this->simplesaml = $simplesaml; $this->account = $account; $this->config = $config_factory->get('simplesamlphp_auth.settings'); $this->logger = $logger; + $this->routeMatch = $route_match; } /** @@ -107,9 +119,9 @@ public function checkAuthStatus(GetResponseEvent $event) { } /** - * Redirect anonymous users from the Drupal login page directly to the external IdP. + * Redirect anonymous users to the external IdP from the Drupal login page. * - * @param GetResponseEvent $event + * @param \Symfony\Component\HttpKernel\Event\GetResponseEvent $event * The subscribed event. */ public function login_directly_with_external_IdP(GetResponseEvent $event) { @@ -119,10 +131,10 @@ public function login_directly_with_external_IdP(GetResponseEvent $event) { } // Check if an anonymous user tries to access the Drupal login page. - if (\Drupal::currentUser()->isAnonymous() && \Drupal::routeMatch()->getRouteName() == 'user.login') { - - // Get the path (default: '/saml_login') from the 'simplesamlphp_auth.saml_login' route. - $saml_login_path = \Drupal::url('simplesamlphp_auth.saml_login'); + if ($this->account->isAnonymous() && $this->routeMatch->getRouteName() == 'user.login') { + // Get the path (default: '/saml_login') from the + // 'simplesamlphp_auth.saml_login' route. + $saml_login_path = Url::fromRoute('simplesamlphp_auth.saml_login')->toString(); // Redirect directly to the external IdP. $response = new RedirectResponse($saml_login_path, RedirectResponse::HTTP_FOUND); diff --git a/web/modules/simplesamlphp_auth/src/Form/BasicSettingsForm.php b/web/modules/simplesamlphp_auth/src/Form/BasicSettingsForm.php index 5a6a27c0d3..dd81df9cb9 100644 --- a/web/modules/simplesamlphp_auth/src/Form/BasicSettingsForm.php +++ b/web/modules/simplesamlphp_auth/src/Form/BasicSettingsForm.php @@ -100,7 +100,7 @@ public function buildForm(array $form, FormStateInterface $form_state) { '#type' => 'checkbox', '#title' => $this->t('Cookie only accessible over HTTP protocol'), '#default_value' => $config->get('httponly'), - '#description' => $this->t('Cookie will be made accessible only through the HTTP protocol. This means that the cookie won\'t be accessible by scripting languages, such as JavaScript.'), + '#description' => $this->t("Cookie will be made accessible only through the HTTP protocol. This means that the cookie won't be accessible by scripting languages, such as JavaScript."), ]; return parent::buildForm($form, $form_state); diff --git a/web/modules/simplesamlphp_auth/src/Plugin/Block/SimplesamlphpAuthBlock.php b/web/modules/simplesamlphp_auth/src/Plugin/Block/SimplesamlphpAuthBlock.php index 3d5e896939..70f9c1a01f 100644 --- a/web/modules/simplesamlphp_auth/src/Plugin/Block/SimplesamlphpAuthBlock.php +++ b/web/modules/simplesamlphp_auth/src/Plugin/Block/SimplesamlphpAuthBlock.php @@ -75,6 +75,7 @@ public function build() { '#title' => $this->t('SimpleSAMLphp Auth Status'), '#cache' => [ 'contexts' => ['user'], + 'tags' => $this->config->getCacheTags(), ], ]; diff --git a/web/modules/simplesamlphp_auth/src/Service/SimplesamlphpAuthManager.php b/web/modules/simplesamlphp_auth/src/Service/SimplesamlphpAuthManager.php index 34b869de36..5e257709a5 100644 --- a/web/modules/simplesamlphp_auth/src/Service/SimplesamlphpAuthManager.php +++ b/web/modules/simplesamlphp_auth/src/Service/SimplesamlphpAuthManager.php @@ -4,14 +4,22 @@ use Drupal\Core\Config\ConfigFactoryInterface; use SimpleSAML\Auth\Simple; -use SimpleSAML_Configuration; +use SimpleSAML\Configuration; +use Drupal\Core\StringTranslation\StringTranslationTrait; use Drupal\simplesamlphp_auth\Exception\SimplesamlphpAttributeException; use Drupal\Core\Site\Settings; +use SimpleSAML\Error\CriticalConfigurationError; +use Drupal\Core\Session\AccountInterface; +use Drupal\Core\Routing\AdminContext; +use Drupal\Core\Extension\ModuleHandlerInterface; +use Symfony\Component\HttpFoundation\RequestStack; +use Drupal\Core\Messenger\MessengerInterface; /** * Service to interact with the SimpleSAMLPHP authentication library. */ class SimplesamlphpAuthManager { + use StringTranslationTrait; /** * A configuration object. @@ -23,7 +31,7 @@ class SimplesamlphpAuthManager { /** * A SimpleSAML configuration instance. * - * @var \SimpleSAML_Configuration + * @var \SimpleSAML\Configuration */ protected $simplesamlConfig; @@ -42,40 +50,142 @@ class SimplesamlphpAuthManager { protected $attributes; /** - * {@inheritdoc} + * The current user. + * + * @var \Drupal\Core\Session\AccountInterface + */ + protected $currentUser; + + /** + * The route admin context to determine whether a route is an admin one. + * + * @var \Drupal\Core\Routing\AdminContext + */ + protected $adminContext; + + /** + * The module handler service. + * + * @var \Drupal\Core\Extension\ModuleHandlerInterface + */ + protected $moduleHandler; + + /** + * The request stack. + * + * @var \Symfony\Component\HttpFoundation\RequestStack + */ + protected $requestStack; + + /** + * The messenger. + * + * @var \Drupal\Core\Messenger\MessengerInterface + */ + protected $messenger; + + /** + * Constructor for SimplesamlphpAuthManager. * * @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory * The configuration factory. + * @param \Drupal\Core\Session\AccountInterface $current_user + * The current user. + * @param \Drupal\Core\Routing\AdminContext $admin_context + * The route admin context to determine whether the route is an admin one. + * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler + * The module handler service. + * @param \Symfony\Component\HttpFoundation\RequestStack $request_stack + * The request stack. + * @param \Drupal\Core\Messenger\MessengerInterface $messenger + * The messenger. * @param \SimpleSAML\Auth\Simple $instance * Simple instance. - * @param \SimpleSAML_Configuration $config - * SimpleSAML_Configuration instance. + * @param \SimpleSAML\Configuration $config + * \SimpleSAML\Configuration instance. */ - public function __construct(ConfigFactoryInterface $config_factory, Simple $instance = NULL, SimpleSAML_Configuration $config = NULL) { - $this->checkLibrary(); - $this->config = $config_factory->get('simplesamlphp_auth.settings'); - if (!$instance) { - $auth_source = $this->config->get('auth_source'); - $this->instance = new Simple($auth_source); - } - else { - $this->instance = $instance; + public function __construct(ConfigFactoryInterface $config_factory, AccountInterface $current_user, AdminContext $admin_context, ModuleHandlerInterface $module_handler, RequestStack $request_stack, MessengerInterface $messenger, Simple $instance = NULL, Configuration $config = NULL) { + $this->config = $config_factory + ->get('simplesamlphp_auth.settings'); + $this->currentUser = $current_user; + $this->adminContext = $admin_context; + $this->moduleHandler = $module_handler; + $this->requestStack = $request_stack; + $this->messenger = $messenger; + $this->instance = $instance; + $this->simplesamlConfig = $config; + } + + /** + * Forwards the user to the IdP for authentication. + */ + public function externalAuthenticate() { + $uri = $this->requestStack->getCurrentRequest()->getUri(); + + $instance = $this->getSimpleSamlInstance(); + + if (empty($instance)) { + return FALSE; } - if (!$config) { - $this->simplesamlConfig = \SimpleSAML_Configuration::getInstance(); + $instance->requireAuth(['ReturnTo' => $uri]); + } + + /** + * Returns a SimpleSAML Simple class instance. + * + * @return \SimpleSAML\Auth\Simple|null + * The SimpleSAML Simple instance. + */ + protected function getSimpleSamlInstance() { + if (!empty($this->instance)) { + return $this->instance; } else { - $this->simplesamlConfig = $config; + + $this->checkLibrary(); + + $auth_source = $this->config->get('auth_source'); + try { + $this->instance = new Simple($auth_source); + return $this->instance; + } + catch (CriticalConfigurationError $e) { + if ($this->currentUser->hasPermission('administer simplesamlphp authentication') + && $this->adminContext->isAdminRoute()) { + $this->messenger->addError($this->t('There is a Simplesamlphp configuration problem. @message', ['@message' => $e->getMessage()]), 'error'); + } + return NULL; + } } } /** - * Forwards the user to the IdP for authentication. + * Returns a SimpleSAML configuration instance. + * + * @return \SimpleSAML\Configuration|null + * The SimpleSAML Configuration instance. */ - public function externalAuthenticate() { - $uri = \Drupal::request()->getUri(); - $this->instance->requireAuth(['ReturnTo' => $uri]); + protected function getSimpleSamlConfiguration() { + if (!empty($this->simplesamlConfig)) { + return $this->simplesamlConfig; + } + else { + + $this->checkLibrary(); + + try { + $this->simplesamlConfig = Configuration::getInstance(); + return $this->simplesamlConfig; + } + catch (CriticalConfigurationError $e) { + if ($this->currentUser->hasPermission('administer simplesamlphp authentication') + && $this->currentUser->isAdminRoute()) { + $this->messenger->addError($this->t('There is a Simplesamlphp configuration problem. @message', ['@message' => $e->getMessage()]), 'error'); + } + return NULL; + } + } } /** @@ -85,7 +195,11 @@ public function externalAuthenticate() { * The storage type. */ public function getStorage() { - return $this->simplesamlConfig->getValue('store.type'); + $config = $this->getSimpleSamlConfiguration(); + if (!empty($config) && !empty($config->getValue('store.type'))) { + return $config->getValue('store.type'); + } + return NULL; } /** @@ -95,7 +209,12 @@ public function getStorage() { * If the user is authenticated by the IdP. */ public function isAuthenticated() { - return $this->instance->isAuthenticated(); + + if ($instance = $this->getSimpleSamlInstance()) { + return $instance->isAuthenticated(); + } + + return FALSE; } /** @@ -136,7 +255,7 @@ public function getDefaultEmail() { */ public function getAttributes() { if (!$this->attributes) { - $this->attributes = $this->instance->getAttributes(); + $this->attributes = $this->getSimpleSamlInstance()->getAttributes(); } return $this->attributes; } @@ -150,7 +269,7 @@ public function getAttributes() { * @return mixed|bool * The attribute value or FALSE. * - * @throws SimplesamlphpAttributeException + * @throws \Drupal\simplesamlphp_auth\Exception\SimplesamlphpAttributeException * Exception when attribute is not set. */ public function getAttribute($attribute) { @@ -173,8 +292,8 @@ public function getAttribute($attribute) { */ public function allowUserByAttribute() { $attributes = $this->getAttributes(); - foreach (\Drupal::moduleHandler()->getImplementations('simplesamlphp_auth_allow_login') as $module) { - if (\Drupal::moduleHandler()->invoke($module, 'simplesamlphp_auth_allow_login', [$attributes]) === FALSE) { + foreach ($this->moduleHandler->getImplementations('simplesamlphp_auth_allow_login') as $module) { + if ($this->moduleHandler->invoke($module, 'simplesamlphp_auth_allow_login', [$attributes]) === FALSE) { return FALSE; } } @@ -204,7 +323,10 @@ public function logout($redirect_path = NULL) { if (!$redirect_path) { $redirect_path = base_path(); } - $this->instance->logout($redirect_path); + + if ($instance = $this->getSimpleSamlInstance()) { + $instance->logout($redirect_path); + } } /** @@ -213,10 +335,13 @@ public function logout($redirect_path = NULL) { * Fallback for when the library was not found via Composer. */ protected function checkLibrary() { - if (!class_exists('SimpleSAML_Configuration')) { - $dir = Settings::get('simplesamlphp_dir'); + if ($dir = Settings::get('simplesamlphp_dir')) { include_once $dir . '/lib/_autoload.php'; } + + if (!class_exists('SimpleSAML\Configuration')) { + $this->messenger->addError($this->t('The SimpleSAMLphp library cannot be found.')); + } } } diff --git a/web/modules/simplesamlphp_auth/src/Service/SimplesamlphpDrupalAuth.php b/web/modules/simplesamlphp_auth/src/Service/SimplesamlphpDrupalAuth.php index d8036abb4c..79d62f8f8f 100644 --- a/web/modules/simplesamlphp_auth/src/Service/SimplesamlphpDrupalAuth.php +++ b/web/modules/simplesamlphp_auth/src/Service/SimplesamlphpDrupalAuth.php @@ -8,12 +8,17 @@ use Drupal\Core\Session\AccountInterface; use Psr\Log\LoggerInterface; use Drupal\externalauth\ExternalAuthInterface; +use Drupal\Core\Messenger\MessengerInterface; +use Drupal\Core\Extension\ModuleHandlerInterface; +use Drupal\Core\StringTranslation\StringTranslationTrait; /** * Service to link SimpleSAMLphp authentication with Drupal users. */ class SimplesamlphpDrupalAuth { + use StringTranslationTrait; + /** * SimpleSAMLphp Authentication helper. * @@ -56,6 +61,20 @@ class SimplesamlphpDrupalAuth { */ protected $currentUser; + /** + * The messenger. + * + * @var \Drupal\Core\Messenger\MessengerInterface + */ + protected $messenger; + + /** + * The module handler service. + * + * @var \Drupal\Core\Extension\ModuleHandlerInterface + */ + protected $moduleHandler; + /** * {@inheritdoc} * @@ -71,14 +90,20 @@ class SimplesamlphpDrupalAuth { * The ExternalAuth service. * @param \Drupal\Core\Session\AccountInterface $account * The currently logged in user. + * @param \Drupal\Core\Messenger\MessengerInterface $messenger + * The messenger. + * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler + * The module handler service. */ - public function __construct(SimplesamlphpAuthManager $simplesaml_auth, ConfigFactoryInterface $config_factory, EntityTypeManagerInterface $entity_type_manager, LoggerInterface $logger, ExternalAuthInterface $externalauth, AccountInterface $account) { + public function __construct(SimplesamlphpAuthManager $simplesaml_auth, ConfigFactoryInterface $config_factory, EntityTypeManagerInterface $entity_type_manager, LoggerInterface $logger, ExternalAuthInterface $externalauth, AccountInterface $account, MessengerInterface $messenger, ModuleHandlerInterface $module_handler) { $this->simplesamlAuth = $simplesaml_auth; $this->config = $config_factory->get('simplesamlphp_auth.settings'); $this->entityTypeManager = $entity_type_manager; $this->logger = $logger; $this->externalauth = $externalauth; $this->currentUser = $account; + $this->messenger = $messenger; + $this->moduleHandler = $module_handler; } /** @@ -127,7 +152,8 @@ public function externalRegister($authname) { // We're not allowed to register new users on the site through simpleSAML. // We let the user know about this and redirect to the user/login page. - drupal_set_message(t("We are sorry. While you have successfully authenticated, you are not yet entitled to access this site. Please ask the site administrator to provision access for you.")); + $this->messenger + ->addMessage($this->t('We are sorry. While you have successfully authenticated, you are not yet entitled to access this site. Please ask the site administrator to provision access for you.'), 'status'); $this->simplesamlAuth->logout(base_path()); return FALSE; @@ -157,7 +183,8 @@ public function externalRegister($authname) { } // User is not permitted to login to Drupal via SAML. // Log out of SAML and redirect to the front page. - drupal_set_message(t('We are sorry, your user account is not SAML enabled.')); + $this->messenger + ->addMessage($this->t('We are sorry, your user account is not SAML enabled.'), 'status'); $this->simplesamlAuth->logout(base_path()); return FALSE; } @@ -169,8 +196,8 @@ public function externalRegister($authname) { // Allow other modules to decide if there is an existing Drupal user, // based on the supplied SAML atttributes. $attributes = $this->simplesamlAuth->getAttributes(); - foreach (\Drupal::moduleHandler()->getImplementations('simplesamlphp_auth_existing_user') as $module) { - $return_value = \Drupal::moduleHandler()->invoke($module, 'simplesamlphp_auth_existing_user', [$attributes]); + foreach ($this->moduleHandler->getImplementations('simplesamlphp_auth_existing_user') as $module) { + $return_value = $this->moduleHandler->invoke($module, 'simplesamlphp_auth_existing_user', [$attributes]); if ($return_value instanceof UserInterface) { $account = $return_value; if ($this->config->get('debug')) { @@ -192,7 +219,8 @@ public function externalRegister($authname) { } catch (\Exception $ex) { watchdog_exception('simplesamlphp_auth', $ex); - drupal_set_message(t('Error registering user: An account with this username already exists.'), 'error'); + $this->messenger + ->addMessage($this->t('Error registering user: An account with this username already exists.'), 'error'); } } @@ -223,8 +251,12 @@ public function synchronizeUserAttributes(AccountInterface $account, $force = FA if ($existing_account = reset($account_search)) { if ($this->currentUser->id() != $existing_account->id()) { $existing = TRUE; - $this->logger->critical("Error on synchronizing name attribute for uid %new_uid: an account with the username %username and uid %existing_uid already exists.", ['%username' => $name, '%new_uid' => $this->currentUser->id(), '%existing_uid' => $existing_account->id()]); - drupal_set_message(t('Error synchronizing username: an account with this username already exists.'), 'error'); + $logger_params = [ + '%username' => $name, '%new_uid' => $this->currentUser->id(), + '%existing_uid' => $existing_account->id(), + ]; + $this->logger->critical("Error on synchronizing name attribute for uid %new_uid: an account with the username %username and uid %existing_uid already exists.", $logger_params); + $this->messenger->addMessage($this->t('Error synchronizing username: an account with this username already exists.'), 'error'); } } @@ -234,18 +266,18 @@ public function synchronizeUserAttributes(AccountInterface $account, $force = FA } else { $this->logger->critical("Error on synchronizing name attribute: no username available for Drupal user %id.", ['%id' => $account->id()]); - drupal_set_message(t('Error synchronizing username: no username is provided by SAML.'), 'error'); + $this->messenger->addMessage($this->t('Error synchronizing username: no username is provided by SAML.'), 'error'); } } - if ($sync_mail) { + if ($sync_mail && $this->config->get('mail_attr')) { $mail = $this->simplesamlAuth->getDefaultEmail(); if ($mail) { $account->setEmail($mail); } else { $this->logger->critical("Error on synchronizing mail attribute: no email address available for Drupal user %id.", ['%id' => $account->id()]); - drupal_set_message(t('Error synchronizing mail: no email address is provided by SAML.'), 'error'); + $this->messenger->addMessage($this->t('Error synchronizing mail: no email address is provided by SAML.'), 'error'); } } @@ -308,7 +340,7 @@ public function getMatchingRoles() { } $attributes = $this->simplesamlAuth->getAttributes(); - \Drupal::modulehandler()->alter('simplesamlphp_auth_user_roles', $roles, $attributes); + $this->moduleHandler->alter('simplesamlphp_auth_user_roles', $roles, $attributes); return $roles; } diff --git a/web/modules/simplesamlphp_auth/tests/simplesamlphp_auth_test/simplesamlphp_auth_test.info.yml b/web/modules/simplesamlphp_auth/tests/simplesamlphp_auth_test/simplesamlphp_auth_test.info.yml index 68de0ba774..30a7fa8209 100644 --- a/web/modules/simplesamlphp_auth/tests/simplesamlphp_auth_test/simplesamlphp_auth_test.info.yml +++ b/web/modules/simplesamlphp_auth/tests/simplesamlphp_auth_test/simplesamlphp_auth_test.info.yml @@ -3,11 +3,11 @@ type: module description: 'Support module for SimpleSAMLPHP Authentication tests' # core: 8.x dependencies: - - user + - drupal:user hidden: true -# Information added by Drupal.org packaging script on 2018-03-17 -version: '8.x-3.0' +# Information added by Drupal.org packaging script on 2019-08-06 +version: '8.x-3.1' core: '8.x' project: 'simplesamlphp_auth' -datestamp: 1521252789 +datestamp: 1565118487 diff --git a/web/modules/simplesamlphp_auth/tests/simplesamlphp_auth_test/src/SimplesamlphpAuthTestManager.php b/web/modules/simplesamlphp_auth/tests/simplesamlphp_auth_test/src/SimplesamlphpAuthTestManager.php index e8de6e6e4b..512852e5d2 100644 --- a/web/modules/simplesamlphp_auth/tests/simplesamlphp_auth_test/src/SimplesamlphpAuthTestManager.php +++ b/web/modules/simplesamlphp_auth/tests/simplesamlphp_auth_test/src/SimplesamlphpAuthTestManager.php @@ -3,9 +3,6 @@ namespace Drupal\simplesamlphp_auth_test; use Drupal\simplesamlphp_auth\Service\SimplesamlphpAuthManager; -use Drupal\Core\Config\ConfigFactoryInterface; -use SimpleSAML\Auth\Simple; -use SimpleSAML_Configuration; /** * Mock SimplesamlphpAuthManager class for testing purposes. @@ -17,22 +14,7 @@ class SimplesamlphpAuthTestManager extends SimplesamlphpAuthManager { * * @var bool */ - protected $authenticated; - - /** - * {@inheritdoc} - * - * @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory - * The configuration factory. - * @param \SimpleSAML\Auth\Simple $instance - * Simple instance. - * @param \SimpleSAML_Configuration $config - * SimpleSAML_Configuration instance. - */ - public function __construct(ConfigFactoryInterface $config_factory, Simple $instance = NULL, SimpleSAML_Configuration $config = NULL) { - $this->config = $config_factory->get('simplesamlphp_auth.settings'); - $this->authenticated = FALSE; - } + protected $authenticated = FALSE; /** * {@inheritdoc} diff --git a/web/modules/simplesamlphp_auth/src/Tests/SimplesamlphpAuthTest.php b/web/modules/simplesamlphp_auth/tests/src/Functional/SimplesamlphpAuthTest.php similarity index 62% rename from web/modules/simplesamlphp_auth/src/Tests/SimplesamlphpAuthTest.php rename to web/modules/simplesamlphp_auth/tests/src/Functional/SimplesamlphpAuthTest.php index 49a479b15c..b3c18a0352 100644 --- a/web/modules/simplesamlphp_auth/src/Tests/SimplesamlphpAuthTest.php +++ b/web/modules/simplesamlphp_auth/tests/src/Functional/SimplesamlphpAuthTest.php @@ -1,16 +1,15 @@ <?php -namespace Drupal\simplesamlphp_auth\Tests; +namespace Drupal\Tests\simplesamlphp_auth\Functional; -use Drupal\simpletest\WebTestBase; +use Drupal\Tests\BrowserTestBase; /** * Tests authentication via SimpleSAMLphp. * * @group simplesamlphp_auth */ -class SimplesamlphpAuthTest extends WebTestBase { - +class SimplesamlphpAuthTest extends BrowserTestBase { /** * Modules to enable for this test. @@ -53,26 +52,14 @@ public function setUp() { } /** - * Test if the test SAML config gets loaded correctly. + * Test the SimplesamlphpAuthBlock Block plugin. */ - public function testConfig() { - $config = $this->config('simplesamlphp_auth.settings'); - $this->assertEqual("Federated test login", $config->get('login_link_display_name')); - } + public function testFederatedLoginLink() { - /** - * Test the SimpleSAMLphp federated login link on the user login form. - */ - public function testSamlLoginLink() { - // Check if the SimpleSAMLphp auth link is shown. + // Check if the SimpleSAMLphp auth link is shown on the login form. $this->drupalGet('user/login'); - $this->assertText(t('Federated test login')); - } + $this->assertSession()->pageTextContains(t('Federated test login')); - /** - * Test the SimplesamlphpAuthBlock Block plugin. - */ - public function testSamlAuthBlock() { $this->drupalLogin($this->adminUser); $default_theme = $this->config('system.theme')->get('default'); @@ -83,11 +70,19 @@ public function testSamlAuthBlock() { $this->drupalPostForm('admin/structure/block/add/simplesamlphp_auth_block/' . $default_theme, $edit, t('Save block')); // Assert Login link in SimplesamlphpAuthBlock. - $result = $this->xpath('//div[contains(@class, "region-sidebar-first")]/div[contains(@class, "block-simplesamlphp-auth-block")]/h2'); - $this->assertEqual((string) $result[0], 'SimpleSAMLphp Auth Status'); + $this->assertSession()->elementTextContains('css', '.region-sidebar-first .block-simplesamlphp-auth-block h2', 'SimpleSAMLphp Auth Status'); $this->drupalGet('<front>'); - $this->assertText(t('Federated test login')); - $this->assertLinkByHref('saml_login'); + $this->assertSession()->pageTextContains(t('Federated test login')); + $this->assertSession()->linkByHrefExists('saml_login'); + + // Disable and ensure the link is no longer shown. + $this->config('simplesamlphp_auth.settings') + ->set('activate', FALSE) + ->save(); + + $this->drupalGet('user/login'); + $this->assertSession()->pageTextNotContains(t('Federated test login')); + } } diff --git a/web/modules/simplesamlphp_auth/tests/src/Unit/Service/SimplesamlphpAuthManagerTest.php b/web/modules/simplesamlphp_auth/tests/src/Unit/Service/SimplesamlphpAuthManagerTest.php index 7bd8e62947..3642287a4a 100644 --- a/web/modules/simplesamlphp_auth/tests/src/Unit/Service/SimplesamlphpAuthManagerTest.php +++ b/web/modules/simplesamlphp_auth/tests/src/Unit/Service/SimplesamlphpAuthManagerTest.php @@ -2,10 +2,15 @@ namespace Drupal\Tests\simplesamlphp_auth\Unit\Service; +use Drupal\Core\Messenger\MessengerInterface; +use Drupal\Core\Routing\AdminContext; +use Drupal\Core\Session\AccountInterface; use Drupal\Tests\UnitTestCase; use Drupal\simplesamlphp_auth\Service\SimplesamlphpAuthManager; use Drupal\Core\DependencyInjection\ContainerBuilder; use Drupal\Core\Extension\ModuleHandlerInterface; +use SimpleSAML\Auth\Simple; +use SimpleSAML\Configuration; use Symfony\Component\HttpFoundation\RequestStack; use Symfony\Component\HttpFoundation\Request; @@ -30,7 +35,7 @@ class SimplesamlphpAuthManagerTest extends UnitTestCase { /** * A mocked SimpleSAML configuration instance. * - * @var \SimpleSAML_Configuration|\PHPUnit_Framework_MockObject_MockObject + * @var \SimpleSAML\Configuration|\PHPUnit_Framework_MockObject_MockObject */ protected $simplesamlConfig; @@ -41,6 +46,41 @@ class SimplesamlphpAuthManagerTest extends UnitTestCase { */ public $instance; + /** + * A mocked current user. + * + * @var \Drupal\Core\Session\AccountInterface|\PHPUnit_Framework_MockObject_MockObject + */ + protected $currentUser; + + /** + * A mocked AdminContext. + * + * @var \Drupal\Core\Routing\AdminContext|\PHPUnit_Framework_MockObject_MockObject + */ + protected $adminContext; + + /** + * A mocked ModuleHandlerInterface. + * + * @var \Drupal\Core\Extension\ModuleHandlerInterface|\PHPUnit_Framework_MockObject_MockObject + */ + protected $moduleHandler; + + /** + * A mocked RequestStack. + * + * @var \Symfony\Component\HttpFoundation\RequestStack|\PHPUnit_Framework_MockObject_MockObject + */ + protected $requestStack; + + /** + * A mocked messenger. + * + * @var \Drupal\Core\Messenger\MessengerInterface|\PHPUnit_Framework_MockObject_MockObject + */ + protected $messenger; + /** * {@inheritdoc} */ @@ -59,7 +99,7 @@ protected function setUp() { ], ]); - $this->instance = $this->getMockBuilder('\SimpleSAML\Auth\Simple') + $this->instance = $this->getMockBuilder(Simple::class) ->setMethods([ 'isAuthenticated', 'requireAuth', @@ -69,7 +109,32 @@ protected function setUp() { ->disableOriginalConstructor() ->getMock(); - $this->simplesamlConfig = $this->getMockBuilder('\SimpleSAML_Configuration') + $this->currentUser = $this->getMockBuilder(AccountInterface::class) + ->disableOriginalConstructor() + ->getMock(); + + $this->adminContext = $this->getMockBuilder(AdminContext::class) + ->disableOriginalConstructor() + ->getMock(); + + $this->moduleHandler = $this->getMockBuilder(ModuleHandlerInterface::class) + ->disableOriginalConstructor() + ->getMock(); + + $this->moduleHandler->expects($this->any()) + ->method('getImplementations') + ->with($this->equalTo('simplesamlphp_auth_allow_login')) + ->will($this->returnValue([])); + + $this->requestStack = $this->getMockBuilder(RequestStack::class) + ->disableOriginalConstructor() + ->getMock(); + + $this->messenger = $this->getMockBuilder(MessengerInterface::class) + ->disableOriginalConstructor() + ->getMock(); + + $this->simplesamlConfig = $this->getMockBuilder(Configuration::class) ->setMethods(['getValue']) ->disableOriginalConstructor() ->getMock(); @@ -78,28 +143,42 @@ protected function setUp() { $request = $this->getMockBuilder(Request::class) ->disableOriginalConstructor() ->getMock(); - $request_stack = $this->getMock(RequestStack::class); - $request_stack->expects($this->any()) + + $this->requestStack->expects($this->any()) ->method('getCurrentRequest') ->will($this->returnValue($request)); - $container->set('request_stack', $request_stack); + $container->set('request_stack', $this->requestStack); \Drupal::setContainer($container); + } /** - * Tests isActivated() method. + * Get a new manager instance using mocked constructor arguments. * - * @covers ::__construct - * @covers ::isActivated + * @return \Drupal\simplesamlphp_auth\Service\SimplesamlphpAuthManager + * A mocked manager. */ - public function testIsActivated() { - // Test isActivated() method. - $simplesaml = new SimplesamlphpAuthManager( + protected function getManagerInContext() { + return new SimplesamlphpAuthManager( $this->configFactory, + $this->currentUser, + $this->adminContext, + $this->moduleHandler, + $this->requestStack, + $this->messenger, $this->instance, $this->simplesamlConfig ); + } + /** + * Tests isActivated() method. + * + * @covers ::__construct + * @covers ::isActivated + */ + public function testIsActivated() { + $simplesaml = $this->getManagerInContext(); $return = $simplesaml->isActivated(); $this->assertTrue($return); } @@ -117,12 +196,7 @@ public function testIsAuthenticated() { ->will($this->returnValue(TRUE)); // Test isAuthenticated() method. - $simplesaml = new SimplesamlphpAuthManager( - $this->configFactory, - $this->instance, - $this->simplesamlConfig - ); - + $simplesaml = $this->getManagerInContext(); $return = $simplesaml->isAuthenticated(); $this->assertTrue($return); } @@ -139,12 +213,7 @@ public function testExternalAuthenticate() { ->method('requireAuth'); // Test externalAuthenticate() method. - $simplesaml = new SimplesamlphpAuthManager( - $this->configFactory, - $this->instance, - $this->simplesamlConfig - ); - + $simplesaml = $this->getManagerInContext(); $simplesaml->externalAuthenticate(); } @@ -156,18 +225,13 @@ public function testExternalAuthenticate() { */ public function testGetStorage() { // Set expectations for config. - $this->simplesamlConfig->expects($this->once()) + $this->simplesamlConfig->expects($this->any()) ->method('getValue') ->with($this->equalTo('store.type')) ->will($this->returnValue('sql')); // Test getStorage() method. - $simplesaml = new SimplesamlphpAuthManager( - $this->configFactory, - $this->instance, - $this->simplesamlConfig - ); - + $simplesaml = $this->getManagerInContext(); $return = $simplesaml->getStorage(); $this->assertEquals('sql', $return); } @@ -196,12 +260,7 @@ public function testAttributes() { ->will($this->returnValue($data)); // Test attribute methods. - $simplesaml = new SimplesamlphpAuthManager( - $this->configFactory, - $this->instance, - $this->simplesamlConfig - ); - + $simplesaml = $this->getManagerInContext(); $this->assertEquals('ext_user_123', $simplesaml->getAuthname()); $this->assertEquals('External User', $simplesaml->getDefaultName()); $this->assertEquals('ext_user_123@example.com', $simplesaml->getDefaultEmail()); @@ -224,11 +283,7 @@ public function testAttributesException() { ->method('getAttributes') ->will($this->returnValue(['uid' => ['ext_user_123']])); - $simplesaml = new SimplesamlphpAuthManager( - $this->configFactory, - $this->instance, - $this->simplesamlConfig - ); + $simplesaml = $this->getManagerInContext(); $simplesaml->getAttribute('name'); } @@ -251,24 +306,9 @@ public function testAllowUserByAttribute() { ->method('getAttributes') ->will($this->returnValue($data)); - $container = new ContainerBuilder(); - $module_handler = $this->getMock(ModuleHandlerInterface::class); - $module_handler->expects($this->any()) - ->method('getImplementations') - ->with($this->equalTo('simplesamlphp_auth_allow_login')) - ->will($this->returnValue([])); - $container->set('module_handler', $module_handler); - \Drupal::setContainer($container); - // Test allowUserByAttribute method. - $simplesaml = new SimplesamlphpAuthManager( - $this->configFactory, - $this->instance, - $this->simplesamlConfig - ); - - $return = $simplesaml->allowUserByAttribute(); - $this->assertTrue($return); + $simplesaml = $this->getManagerInContext(); + $this->assertTrue($simplesaml->allowUserByAttribute()); } /** @@ -286,12 +326,7 @@ public function testLogout() { ->with($this->equalTo($redirect_path)); // Test logout() method. - $simplesaml = new SimplesamlphpAuthManager( - $this->configFactory, - $this->instance, - $this->simplesamlConfig - ); - + $simplesaml = $this->getManagerInContext(); $simplesaml->logout($redirect_path); } diff --git a/web/modules/simplesamlphp_auth/tests/src/Unit/Service/SimplesamlphpDrupalAuthTest.php b/web/modules/simplesamlphp_auth/tests/src/Unit/Service/SimplesamlphpDrupalAuthTest.php index a39451dbc2..b6f80ab5a3 100644 --- a/web/modules/simplesamlphp_auth/tests/src/Unit/Service/SimplesamlphpDrupalAuthTest.php +++ b/web/modules/simplesamlphp_auth/tests/src/Unit/Service/SimplesamlphpDrupalAuthTest.php @@ -5,8 +5,8 @@ use Drupal\Tests\UnitTestCase; use Drupal\user\UserInterface; use Drupal\simplesamlphp_auth\Service\SimplesamlphpDrupalAuth; -use Drupal\Core\DependencyInjection\ContainerBuilder; use Drupal\Core\Extension\ModuleHandlerInterface; +use Drupal\Core\Messenger\MessengerInterface; /** * SimplesamlphpDrupalAuth unit tests. @@ -60,44 +60,60 @@ class SimplesamlphpDrupalAuthTest extends UnitTestCase { */ protected $entityAccount; + /** + * A mocked messenger. + * + * @var \Drupal\Core\Messenger\MessengerInterface|\PHPUnit_Framework_MockObject_MockObject + */ + protected $messenger; + + /** + * A mocked ModuleHandlerInterface. + * + * @var \Drupal\Core\Extension\ModuleHandlerInterface|\PHPUnit_Framework_MockObject_MockObject + */ + protected $moduleHandler; + /** * {@inheritdoc} */ protected function setUp() { parent::setUp(); - // Create a Mock EntityManager object. - $this->entityManager = $this->getMock('\Drupal\Core\Entity\EntityManagerInterface'); + $this->entityManager = $this->createMock('\Drupal\Core\Entity\EntityManagerInterface'); - // Create a Mock Logger object. $this->logger = $this->getMockBuilder('\Psr\Log\LoggerInterface') ->disableOriginalConstructor() ->getMock(); - // Create a Mock SimplesamlphpAuthManager object. + $this->messenger = $this->getMockBuilder(MessengerInterface::class) + ->disableOriginalConstructor() + ->getMock(); + + $this->moduleHandler = $this->getMockBuilder(ModuleHandlerInterface::class) + ->disableOriginalConstructor() + ->getMock(); + + $this->moduleHandler->expects($this->any()) + ->method('alter'); + $this->simplesaml = $this->getMockBuilder('\Drupal\simplesamlphp_auth\Service\SimplesamlphpAuthManager') ->disableOriginalConstructor() ->getMock(); - // Set up default test configuration Mock object. $this->configFactory = $this->getConfigFactoryStub([ 'simplesamlphp_auth.settings' => [ 'register_users' => TRUE, 'activate' => TRUE, + 'mail_attr' => 'mail', ], ]); - $this->externalauth = $this->getMock('\Drupal\externalauth\ExternalAuthInterface'); + $this->externalauth = $this->createMock('\Drupal\externalauth\ExternalAuthInterface'); // Create a Mock User object to test against. - $this->entityAccount = $this->getMock('Drupal\user\UserInterface'); + $this->entityAccount = $this->createMock('Drupal\user\UserInterface'); - $container = new ContainerBuilder(); - $module_handler = $this->getMock(ModuleHandlerInterface::class); - $module_handler->expects($this->any()) - ->method('alter'); - $container->set('module_handler', $module_handler); - \Drupal::setContainer($container); } /** @@ -122,6 +138,8 @@ public function testExternalLoginRegister() { $this->logger, $this->externalauth, $this->entityAccount, + $this->messenger, + $this->moduleHandler, ]) ->getMock(); @@ -190,6 +208,8 @@ public function testExternalLoginWithRoleMatch() { $this->logger, $this->externalauth, $this->entityAccount, + $this->messenger, + $this->moduleHandler, ]) ->getMock(); @@ -205,7 +225,7 @@ public function testExternalLoginWithRoleMatch() { */ public function testExternalRegister() { // Mock the User storage layer. - $entity_storage = $this->getMock('Drupal\Core\Entity\EntityStorageInterface'); + $entity_storage = $this->createMock('Drupal\Core\Entity\EntityStorageInterface'); // Expect the entity storage to return no existing user. $entity_storage->expects($this->any()) ->method('loadByProperties') @@ -216,10 +236,7 @@ public function testExternalRegister() { ->will($this->returnValue($entity_storage)); // Create a Mock ExternalAuth object. - $externalauth = $this->getMockBuilder('\Drupal\externalauth\ExternalAuth') - ->disableOriginalConstructor() - ->setMethods(['register', 'userLoginFinalize']) - ->getMock(); + $externalauth = $this->createMock('\Drupal\externalauth\ExternalAuthInterface'); // Set up expectations for ExternalAuth service. $externalauth->expects($this->once()) @@ -241,6 +258,8 @@ public function testExternalRegister() { $this->logger, $externalauth, $this->entityAccount, + $this->messenger, + $this->moduleHandler, ]) ->getMock(); @@ -270,7 +289,7 @@ public function testExternalRegisterWithAutoEnableSaml() { ]); // Mock the User storage layer. - $entity_storage = $this->getMock('Drupal\Core\Entity\EntityStorageInterface'); + $entity_storage = $this->createMock('Drupal\Core\Entity\EntityStorageInterface'); // Expect the entity storage to return an existing user. $entity_storage->expects($this->any()) ->method('loadByProperties') @@ -283,7 +302,7 @@ public function testExternalRegisterWithAutoEnableSaml() { // Create a Mock ExternalAuth object. $externalauth = $this->getMockBuilder('\Drupal\externalauth\ExternalAuth') ->disableOriginalConstructor() - ->setMethods(['linkExistingAccount', 'userLoginFinalize']) + ->setMethods(['register', 'linkExistingAccount', 'userLoginFinalize']) ->getMock(); // Set up expectations for ExternalAuth service. @@ -309,6 +328,8 @@ public function testExternalRegisterWithAutoEnableSaml() { $this->logger, $externalauth, $this->entityAccount, + $this->messenger, + $this->moduleHandler, ]) ->getMock(); @@ -341,7 +362,7 @@ public function testSynchronizeUserAttributes() { ->will($this->returnValue("test@example.com")); // Mock the User storage layer. - $entity_storage = $this->getMock('Drupal\Core\Entity\EntityStorageInterface'); + $entity_storage = $this->createMock('Drupal\Core\Entity\EntityStorageInterface'); // Expect the entity storage to return no existing user. $entity_storage->expects($this->any()) ->method('loadByProperties') @@ -367,7 +388,9 @@ public function testSynchronizeUserAttributes() { $this->entityManager, $this->logger, $this->externalauth, - $this->entityAccount + $this->entityAccount, + $this->messenger, + $this->moduleHandler ); $simplesaml_drupalauth->synchronizeUserAttributes($this->entityAccount, TRUE); @@ -408,7 +431,9 @@ public function testRoleMatching($rolemap, $attributes, $expected_roles) { $this->entityManager, $this->logger, $this->externalauth, - $this->entityAccount + $this->entityAccount, + $this->messenger, + $this->moduleHandler ); $matching_roles = $simplesaml_drupalauth->getMatchingRoles(); -- GitLab