diff --git a/.circleci/config.yml b/.circleci/config.yml index 6ab1d246b2..76f7c42a12 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -37,7 +37,8 @@ jobs: - run: git clone https://github.com/alanxz/rabbitmq-c - run: cd rabbitmq-c && git checkout 2ca1774489328cde71195f5fa95e17cf3a80cb8a - run: cd rabbitmq-c && git submodule init && git submodule update && autoreconf -i && ./configure && make && sudo make install - - run: pecl channel-update pear.php.net + # disabled because pear.php.net is down cause of security failure + #- run: pecl channel-update pear.php.net - run: yes '' | pecl install amqp-1.9.3 - run: yes '' | pecl install imagick - run: sudo apt-get install libzmq-dev diff --git a/composer.json b/composer.json index bd39a204e7..98a77a6f1a 100644 --- a/composer.json +++ b/composer.json @@ -50,7 +50,7 @@ "alchemy/embed-bundle": "^0.3.4", "alchemy/geonames-api-consumer": "~0.1.0", "alchemy/mediavorus": "^0.4.4", - "alchemy/oauth2php": "1.0.0", + "alchemy/oauth2php": "1.1.0", "alchemy/phlickr": "0.2.9", "alchemy/phpexiftool": "^0.7.0", "alchemy/rest-bundle": "^0.0.5", diff --git a/composer.lock b/composer.lock index 9745425f25..80ccaa0827 100644 --- a/composer.lock +++ b/composer.lock @@ -1,10 +1,10 @@ { "_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": "253990d4c81f9ae5f78c6c1221d6cf29", + "content-hash": "adf4074eb26ea80d414430d4f7b61311", "packages": [ { "name": "alchemy-fr/tcpdf-clone", @@ -275,16 +275,16 @@ }, { "name": "alchemy/mediavorus", - "version": "0.4.8", + "version": "0.4.9", "source": { "type": "git", "url": "https://github.com/alchemy-fr/MediaVorus.git", - "reference": "6a50c397211dfdf6da108ea1ebc7527c37419ab7" + "reference": "1a96dc4142ff8474c11285cab9eab11df9683255" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/alchemy-fr/MediaVorus/zipball/6a50c397211dfdf6da108ea1ebc7527c37419ab7", - "reference": "6a50c397211dfdf6da108ea1ebc7527c37419ab7", + "url": "https://api.github.com/repos/alchemy-fr/MediaVorus/zipball/1a96dc4142ff8474c11285cab9eab11df9683255", + "reference": "1a96dc4142ff8474c11285cab9eab11df9683255", "shasum": "" }, "require": { @@ -333,20 +333,20 @@ "keywords": [ "metadata" ], - "time": "2018-05-03T14:17:10+00:00" + "time": "2019-01-22T11:23:34+00:00" }, { "name": "alchemy/oauth2php", - "version": "1.0.0", + "version": "1.1.0", "source": { "type": "git", "url": "https://github.com/alchemy-fr/oauth2-php.git", - "reference": "cb4fcb73e30ab54e0fb85a65b4d57147f7a0df15" + "reference": "801510972240555fa182813851efd96659d37a68" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/alchemy-fr/oauth2-php/zipball/cb4fcb73e30ab54e0fb85a65b4d57147f7a0df15", - "reference": "cb4fcb73e30ab54e0fb85a65b4d57147f7a0df15", + "url": "https://api.github.com/repos/alchemy-fr/oauth2-php/zipball/801510972240555fa182813851efd96659d37a68", + "reference": "801510972240555fa182813851efd96659d37a68", "shasum": "" }, "type": "library", @@ -356,7 +356,7 @@ ] }, "notification-url": "https://packagist.org/downloads/", - "time": "2013-07-01T09:46:59+00:00" + "time": "2019-01-17T14:34:10+00:00" }, { "name": "alchemy/phlickr", @@ -1898,12 +1898,12 @@ "version": "v2.5.6", "source": { "type": "git", - "url": "https://github.com/doctrine/doctrine2.git", + "url": "https://github.com/doctrine/orm.git", "reference": "e6c434196c8ef058239aaa0724b4aadb0107940b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/doctrine2/zipball/e6c434196c8ef058239aaa0724b4aadb0107940b", + "url": "https://api.github.com/repos/doctrine/orm/zipball/e6c434196c8ef058239aaa0724b4aadb0107940b", "reference": "e6c434196c8ef058239aaa0724b4aadb0107940b", "shasum": "" }, @@ -2304,12 +2304,12 @@ "version": "v2.2.1", "source": { "type": "git", - "url": "https://github.com/google/google-api-php-client.git", + "url": "https://github.com/googleapis/google-api-php-client.git", "reference": "b69b8ac4bf6501793c389d4e013a79d09c85c5f2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/google/google-api-php-client/zipball/b69b8ac4bf6501793c389d4e013a79d09c85c5f2", + "url": "https://api.github.com/repos/googleapis/google-api-php-client/zipball/b69b8ac4bf6501793c389d4e013a79d09c85c5f2", "reference": "b69b8ac4bf6501793c389d4e013a79d09c85c5f2", "shasum": "" }, @@ -2363,12 +2363,12 @@ "version": "v0.36", "source": { "type": "git", - "url": "https://github.com/google/google-api-php-client-services.git", + "url": "https://github.com/googleapis/google-api-php-client-services.git", "reference": "2fd7d2876fbc0174faddba3241956a1393536159" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/google/google-api-php-client-services/zipball/2fd7d2876fbc0174faddba3241956a1393536159", + "url": "https://api.github.com/repos/googleapis/google-api-php-client-services/zipball/2fd7d2876fbc0174faddba3241956a1393536159", "reference": "2fd7d2876fbc0174faddba3241956a1393536159", "shasum": "" }, @@ -2400,12 +2400,12 @@ "version": "v1.1.0", "source": { "type": "git", - "url": "https://github.com/google/google-auth-library-php.git", + "url": "https://github.com/googleapis/google-auth-library-php.git", "reference": "548d27d670f0236dc5258fa4cdde6e7b63464cfd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/google/google-auth-library-php/zipball/548d27d670f0236dc5258fa4cdde6e7b63464cfd", + "url": "https://api.github.com/repos/googleapis/google-auth-library-php/zipball/548d27d670f0236dc5258fa4cdde6e7b63464cfd", "reference": "548d27d670f0236dc5258fa4cdde6e7b63464cfd", "shasum": "" }, @@ -5766,17 +5766,6 @@ { "name": "roave/security-advisories", "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/Roave/SecurityAdvisories.git", - "reference": "3db4b0df21d1f527304650e717c66af48981f1c4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/3db4b0df21d1f527304650e717c66af48981f1c4", - "reference": "3db4b0df21d1f527304650e717c66af48981f1c4", - "shasum": "" - }, "conflict": { "adodb/adodb-php": "<5.20.6", "amphp/artax": ">=2,<2.0.4|>0.7.1,<1.0.4", @@ -6015,6 +6004,7 @@ "keywords": [ "microframework" ], + "abandoned": "symfony/flex", "time": "2016-01-06T14:59:35+00:00" }, { @@ -6060,6 +6050,7 @@ ], "description": "A WebProfiler for Silex", "homepage": "http://silex.sensiolabs.org/", + "abandoned": true, "time": "2016-01-10T11:39:13+00:00" }, { diff --git a/config/configuration.sample.yml b/config/configuration.sample.yml index 5ae54d2134..050b6562c1 100644 --- a/config/configuration.sample.yml +++ b/config/configuration.sample.yml @@ -7,6 +7,7 @@ main: languages: [] key: '' api_require_ssl: true + api_token_header: false database: host: 127.0.0.1 port: 3306 diff --git a/lib/Alchemy/Phrasea/Core/Version.php b/lib/Alchemy/Phrasea/Core/Version.php index 860c3b2679..b2bf620798 100644 --- a/lib/Alchemy/Phrasea/Core/Version.php +++ b/lib/Alchemy/Phrasea/Core/Version.php @@ -16,7 +16,7 @@ class Version /** * @var string */ - private $number = '4.1.0-alpha.13b'; + private $number = '4.1.0-alpha.14a'; /** * @var string diff --git a/lib/Alchemy/Phrasea/SearchEngine/Elastic/Structure/Field.php b/lib/Alchemy/Phrasea/SearchEngine/Elastic/Structure/Field.php index 7ea7d68d43..3b71f6f451 100644 --- a/lib/Alchemy/Phrasea/SearchEngine/Elastic/Structure/Field.php +++ b/lib/Alchemy/Phrasea/SearchEngine/Elastic/Structure/Field.php @@ -89,7 +89,6 @@ class Field implements Typed case databox_field::TYPE_NUMBER: return FieldMapping::TYPE_DOUBLE; case databox_field::TYPE_STRING: - case databox_field::TYPE_TEXT: return FieldMapping::TYPE_STRING; } diff --git a/lib/classes/API/OAuth2/Adapter.php b/lib/classes/API/OAuth2/Adapter.php index c674aa277b..4de6639d4d 100644 --- a/lib/classes/API/OAuth2/Adapter.php +++ b/lib/classes/API/OAuth2/Adapter.php @@ -537,7 +537,11 @@ class API_OAuth2_Adapter extends OAuth2 public function verifyAccessToken($scope = null, $exit_not_present = true, $exit_invalid = true, $exit_expired = true, $exit_scope = true, $realm = null) { - $token_param = $this->getAccessTokenParams(); + $apiTokenHeader = $this->app['conf']->get(['main', 'api_token_header']); + + $useTokenHeader = $this->useTokenHeaderChoice($apiTokenHeader); + + $token_param = $this->getAccessTokenParams($useTokenHeader); // Access token was not provided if ($token_param === false) { @@ -808,4 +812,21 @@ class API_OAuth2_Adapter extends OAuth2 return false; } } + + /** + * Get the correct constante to call on Oauth2 + * + * @param $apiTokenHeader + * @return string + */ + private function useTokenHeaderChoice($apiTokenHeader) + { + if ($apiTokenHeader === true) { + return Oauth2::TOKEN_ONLY_IN_HEADER; + } elseif ($apiTokenHeader === false) { + return Oauth2::TOKEN_ONLY_IN_GETPOST; + } else { + return Oauth2::TOKEN_AUTO_FIND; + } + } } diff --git a/lib/classes/databox.php b/lib/classes/databox.php index 76f98524cf..c02ef4ffba 100644 --- a/lib/classes/databox.php +++ b/lib/classes/databox.php @@ -446,7 +446,6 @@ class databox extends base implements ThumbnailedElement databox_field::TYPE_DATE , databox_field::TYPE_NUMBER , databox_field::TYPE_STRING - , databox_field::TYPE_TEXT ] ) ? $type : databox_field::TYPE_STRING; diff --git a/lib/classes/databox/field.php b/lib/classes/databox/field.php index cd12bc8682..35fc525265 100644 --- a/lib/classes/databox/field.php +++ b/lib/classes/databox/field.php @@ -100,7 +100,6 @@ class databox_field implements cache_cacheableInterface protected $original_dces; protected $aggregable; - const TYPE_TEXT = "text"; const TYPE_DATE = "date"; const TYPE_STRING = "string"; const TYPE_NUMBER = "number"; diff --git a/lib/classes/patch/410alpha14a.php b/lib/classes/patch/410alpha14a.php new file mode 100644 index 0000000000..719b1a9700 --- /dev/null +++ b/lib/classes/patch/410alpha14a.php @@ -0,0 +1,64 @@ +release; + } + + /** + * {@inheritdoc} + */ + public function getDoctrineMigrations() + { + return []; + } + + /** + * {@inheritdoc} + */ + public function require_all_upgrades() + { + return false; + } + + /** + * {@inheritdoc} + */ + public function concern() + { + return $this->concern; + } + + /** + * {@inheritdoc} + */ + public function apply(base $databox, Application $app) + { + $sql = "UPDATE metadatas_structure SET type = 'string' where type = 'text' OR type = '' "; + $databox->get_connection()->executeQuery($sql); + + return true; + } +} diff --git a/lib/conf.d/bases_structure.xml b/lib/conf.d/bases_structure.xml index 13ed58fcb9..a4d0d2f9c5 100644 --- a/lib/conf.d/bases_structure.xml +++ b/lib/conf.d/bases_structure.xml @@ -1901,7 +1901,7 @@ type - enum('string','text','date','number') + enum('string','date','number') diff --git a/lib/conf.d/data_templates/DublinCore.xml b/lib/conf.d/data_templates/DublinCore.xml index 5de4f32945..aada9b2258 100644 --- a/lib/conf.d/data_templates/DublinCore.xml +++ b/lib/conf.d/data_templates/DublinCore.xml @@ -198,7 +198,7 @@ - + diff --git a/lib/conf.d/data_templates/en-simple.xml b/lib/conf.d/data_templates/en-simple.xml index a9b2e33460..e42b18a490 100644 --- a/lib/conf.d/data_templates/en-simple.xml +++ b/lib/conf.d/data_templates/en-simple.xml @@ -202,7 +202,7 @@ - + diff --git a/lib/conf.d/data_templates/fr-simple.xml b/lib/conf.d/data_templates/fr-simple.xml index 550b8adac8..6af9a072f3 100644 --- a/lib/conf.d/data_templates/fr-simple.xml +++ b/lib/conf.d/data_templates/fr-simple.xml @@ -202,7 +202,7 @@ - + diff --git a/resources/ansible/roles/app/tasks/main.yml b/resources/ansible/roles/app/tasks/main.yml index 66de8ad0ea..623d28d124 100644 --- a/resources/ansible/roles/app/tasks/main.yml +++ b/resources/ansible/roles/app/tasks/main.yml @@ -60,7 +60,7 @@ chdir: /vagrant/ - name: Create ElasticSearch indexes - shell: php bin/console s:i:c + shell: php bin/console searchengine:index -c args: chdir: /vagrant/ diff --git a/resources/ansible/roles/server/tasks/main.yml b/resources/ansible/roles/server/tasks/main.yml index d1aac1d10f..531e6fa74d 100644 --- a/resources/ansible/roles/server/tasks/main.yml +++ b/resources/ansible/roles/server/tasks/main.yml @@ -18,6 +18,10 @@ with_items: '{{ server.packages }}' when: server.packages is defined +- name: Pip install ndg-httpsclient + shell: pip install ndg-httpsclient + sudo: yes + - name: Configure the timezone sudo: yes template: src=timezone.j2 dest=/etc/timezone diff --git a/resources/ansible/vars/all.yml b/resources/ansible/vars/all.yml index d90cfd8640..e1282c99b5 100644 --- a/resources/ansible/vars/all.yml +++ b/resources/ansible/vars/all.yml @@ -21,6 +21,13 @@ server: - xpdf - libav-tools - gpac + - python + - python-urllib3 + - python3-openssl + - python-pyasn1 + - python-pyasn1-modules + - python3-pyasn1 + - python-pip timezone: UTC locales: - en_GB.UTF-8 diff --git a/resources/www/common/images/icons/Share.png b/resources/www/common/images/icons/Share.png new file mode 100644 index 0000000000..447ced8ba7 Binary files /dev/null and b/resources/www/common/images/icons/Share.png differ diff --git a/resources/www/common/images/icons/archive.png b/resources/www/common/images/icons/archive.png new file mode 100644 index 0000000000..0d63a2e6f6 Binary files /dev/null and b/resources/www/common/images/icons/archive.png differ diff --git a/resources/www/common/images/icons/basket-1.png b/resources/www/common/images/icons/basket-1.png new file mode 100644 index 0000000000..fa62394842 Binary files /dev/null and b/resources/www/common/images/icons/basket-1.png differ diff --git a/resources/www/common/images/icons/detach.png b/resources/www/common/images/icons/detach.png new file mode 100644 index 0000000000..0f9080d04f Binary files /dev/null and b/resources/www/common/images/icons/detach.png differ diff --git a/resources/www/common/images/icons/disktt_history.png b/resources/www/common/images/icons/disktt_history.png index 849c5acdc2..e81e9e383a 100644 Binary files a/resources/www/common/images/icons/disktt_history.png and b/resources/www/common/images/icons/disktt_history.png differ diff --git a/resources/www/common/images/icons/edit-pen.png b/resources/www/common/images/icons/edit-pen.png new file mode 100644 index 0000000000..efba208714 Binary files /dev/null and b/resources/www/common/images/icons/edit-pen.png differ diff --git a/resources/www/common/images/icons/export-shadow.png b/resources/www/common/images/icons/export-shadow.png new file mode 100644 index 0000000000..90ba5c1b53 Binary files /dev/null and b/resources/www/common/images/icons/export-shadow.png differ diff --git a/resources/www/common/images/icons/print-shadow.png b/resources/www/common/images/icons/print-shadow.png new file mode 100644 index 0000000000..8f13ffd61a Binary files /dev/null and b/resources/www/common/images/icons/print-shadow.png differ diff --git a/resources/www/common/images/icons/print_history.png b/resources/www/common/images/icons/print_history.png index c4e4090c41..139cb45458 100644 Binary files a/resources/www/common/images/icons/print_history.png and b/resources/www/common/images/icons/print_history.png differ diff --git a/resources/www/common/images/icons/rename.png b/resources/www/common/images/icons/rename.png new file mode 100644 index 0000000000..f86b6c80b7 Binary files /dev/null and b/resources/www/common/images/icons/rename.png differ diff --git a/resources/www/common/images/icons/set-order.png b/resources/www/common/images/icons/set-order.png new file mode 100644 index 0000000000..e49be67dc8 Binary files /dev/null and b/resources/www/common/images/icons/set-order.png differ diff --git a/resources/www/lightbox/images/lightbox-icon.png b/resources/www/lightbox/images/lightbox-icon.png new file mode 100644 index 0000000000..ef9f72ec70 Binary files /dev/null and b/resources/www/lightbox/images/lightbox-icon.png differ diff --git a/templates/web/admin/fields/templates.html.twig b/templates/web/admin/fields/templates.html.twig index 7a566a2df4..c785a9a701 100644 --- a/templates/web/admin/fields/templates.html.twig +++ b/templates/web/admin/fields/templates.html.twig @@ -130,7 +130,6 @@ diff --git a/templates/web/prod/WorkZone/Macros.html.twig b/templates/web/prod/WorkZone/Macros.html.twig index 04f3d3d735..d496cb2e7c 100644 --- a/templates/web/prod/WorkZone/Macros.html.twig +++ b/templates/web/prod/WorkZone/Macros.html.twig @@ -136,55 +136,72 @@ -
+ @@ -222,24 +239,33 @@ -
+
{{ 'action::exporter' | trans }} + data-kind="record" data-id="{{story.getRecord(app).get_serialize_key()}}"> + + {{ 'action::exporter' | trans }} + {{ 'action::exporter' | trans }} +
- {% if app.getAclForUser(app.getAuthenticatedUser()).has_right(constant('\\ACL::CANMODIFRECORD')) %} + {% if app.getAclForUser(app.getAuthenticatedUser()).has_right(constant('\\ACL::CANMODIFRECORD')) %} - {% endif %} + {% endif %} @@ -249,7 +275,8 @@ data-db-id="{{ story.getRecord(app).get_sbas_id }}" data-record-id="{{ story.getRecord(app).get_record_id() }}" href="#"> - {{ 'Re-ordonner' | trans }} + {{ 'Re-ordonner' | trans }} + {{ 'Re-ordonner' | trans }}
diff --git a/templates/web/prod/results/record.html.twig b/templates/web/prod/results/record.html.twig index 413cd04769..2d537dd72c 100644 --- a/templates/web/prod/results/record.html.twig +++ b/templates/web/prod/results/record.html.twig @@ -111,25 +111,34 @@ -
+
{% if granted_on_collection(record.baseId, [constant('\\ACL::CANPUTINALBUM')]) and not record.story %}
- {{ 'action : ajouter au panier' | trans }} + + {{ 'action : ajouter au panier' | trans }} + {{ 'action : ajouter au panier' | trans }} +
{% endif %} {% if granted_on_collection(record.baseId, [constant('\\ACL::CANDWNLDPREVIEW')]) or granted_on_collection(record.baseId, [constant('\\ACL::CANDWNLDHD')]) %}
- {{ 'action : exporter' | trans }} + + {{ 'action : exporter' | trans }} + {{ 'action : exporter' | trans }} +
{% endif %}
- {{ 'action : print' | trans }} + + {{ 'action : print' | trans }} + {{ 'action : print' | trans }} +
{% if app['conf'].get(['registry', 'actions', 'social-tools']) == 'all' @@ -138,7 +147,10 @@ {% if record.story is empty %}
{% endif %} diff --git a/tests/Alchemy/Tests/Phrasea/Controller/Api/ApiJsonTest.php b/tests/Alchemy/Tests/Phrasea/Controller/Api/ApiJsonTest.php index 49c1677fd8..d78194c4d7 100644 --- a/tests/Alchemy/Tests/Phrasea/Controller/Api/ApiJsonTest.php +++ b/tests/Alchemy/Tests/Phrasea/Controller/Api/ApiJsonTest.php @@ -742,7 +742,7 @@ class ApiJsonTest extends ApiTestCase } $this->assertTrue(is_string($metadatas['thesaurus_branch'])); - $this->assertTrue(in_array($metadatas['type'], [\databox_field::TYPE_DATE, \databox_field::TYPE_STRING, \databox_field::TYPE_NUMBER, \databox_field::TYPE_TEXT])); + $this->assertTrue(in_array($metadatas['type'], [\databox_field::TYPE_DATE, \databox_field::TYPE_STRING, \databox_field::TYPE_NUMBER])); $this->assertTrue(is_bool($metadatas['indexable'])); $this->assertTrue(is_bool($metadatas['multivalue'])); $this->assertTrue(is_bool($metadatas['readonly']));