From 4c5548120d00277f02bbf6d3d71d04e3104b590b Mon Sep 17 00:00:00 2001 From: Romain Neutron Date: Thu, 31 Oct 2013 12:11:21 +0100 Subject: [PATCH 1/4] Fix #1558 : Do not restrict thesaurus browsing to thesaurus admins --- .../Phrasea/Controller/Thesaurus/Xmlhttp.php | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/lib/Alchemy/Phrasea/Controller/Thesaurus/Xmlhttp.php b/lib/Alchemy/Phrasea/Controller/Thesaurus/Xmlhttp.php index f2ca34c3dc..57c2b0b66c 100644 --- a/lib/Alchemy/Phrasea/Controller/Thesaurus/Xmlhttp.php +++ b/lib/Alchemy/Phrasea/Controller/Thesaurus/Xmlhttp.php @@ -26,11 +26,16 @@ class Xmlhttp implements ControllerProviderInterface $controllers->before(function() use ($app) { $app['firewall']->requireAuthentication(); - $app['firewall']->requireAccessToModule('thesaurus'); }); - $controllers->match('acceptcandidates.j.php', $this->call('AcceptCandidatesJson')); - $controllers->match('checkcandidatetarget.j.php', $this->call('CheckCandidateTargetJson')); + $controllers->match('acceptcandidates.j.php', $this->call('AcceptCandidatesJson')) + ->before(function () use ($app) { + $app['firewall']->requireAccessToModule('thesaurus'); + }); + $controllers->match('checkcandidatetarget.j.php', $this->call('CheckCandidateTargetJson')) + ->before(function () use ($app) { + $app['firewall']->requireAccessToModule('thesaurus'); + }); $controllers->match('editing_presets.j.php', $this->call('EditingPresetsJson')); $controllers->match('getsy_prod.x.php', $this->call('GetSynonymsXml')); $controllers->match('getterm_prod.h.php', $this->call('GetTermHtml')); @@ -38,7 +43,10 @@ class Xmlhttp implements ControllerProviderInterface $controllers->match('openbranch_prod.j.php', $this->call('OpenBranchJson')); $controllers->match('openbranches_prod.h.php', $this->call('OpenBranchesHtml')); $controllers->match('openbranches_prod.x.php', $this->call('OpenBranchesXml')); - $controllers->match('replacecandidate.j.php', $this->call('ReplaceCandidateJson')); + $controllers->match('replacecandidate.j.php', $this->call('ReplaceCandidateJson')) + ->before(function () use ($app) { + $app['firewall']->requireAccessToModule('thesaurus'); + }); $controllers->match('search_th_term_prod.j.php', $this->call('SearchTermJson')); return $controllers; From fe3aabd6d17d814dd3471531fcda347baf62d401 Mon Sep 17 00:00:00 2001 From: Romain Neutron Date: Thu, 31 Oct 2013 13:15:11 +0100 Subject: [PATCH 2/4] Fix #1544 : Upgrade data from 3.5 does not work --- lib/Alchemy/Phrasea/Command/Upgrade/Step35.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Alchemy/Phrasea/Command/Upgrade/Step35.php b/lib/Alchemy/Phrasea/Command/Upgrade/Step35.php index 28c9944ca9..b47c916291 100644 --- a/lib/Alchemy/Phrasea/Command/Upgrade/Step35.php +++ b/lib/Alchemy/Phrasea/Command/Upgrade/Step35.php @@ -76,7 +76,7 @@ class Step35 implements DatasUpgraderInterface $stmt->execute(array(':record_id' => $row['record_id'])); try { - $record = new \record_adapter($app, $databox->get_sbas_id(), $row['record_id']); + $record = new \record_adapter($this->app, $databox->get_sbas_id(), $row['record_id']); } catch (\Exception $e) { $this->app['monolog']->addError(sprintf("Unable to load record %d on databox %d : %s", $record->get_record_id(), $record->get_sbas_id(), $record->get_sbas_id(), $e->getMessage())); continue; From fa88305bfef1bf754e73ebf5d1c52ca057df0dcd Mon Sep 17 00:00:00 2001 From: Romain Neutron Date: Thu, 31 Oct 2013 13:23:26 +0100 Subject: [PATCH 3/4] Update to latest twig --- composer.json | 2 +- composer.lock | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/composer.json b/composer.json index e69797d5a5..6638fdc4e2 100644 --- a/composer.json +++ b/composer.json @@ -37,7 +37,7 @@ "symfony/symfony" : "2.3.3", "alchemy-fr/tcpdf-clone" : "~6.0", "themattharris/tmhoauth" : "~0.7", - "twig/twig" : "~1.13.0", + "twig/twig" : "~1.14, >=1.14.2", "twig/extensions" : "~1.0", "zend/gdata" : "~1.12.1" }, diff --git a/composer.lock b/composer.lock index 8c8260111f..a63626919f 100644 --- a/composer.lock +++ b/composer.lock @@ -3,7 +3,7 @@ "This file locks the dependencies of your project to a known state", "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file" ], - "hash": "7c844fa6bef5e861c16a13b1dc9eca37", + "hash": "55c5aaf5173cac55c8869a159830a3d5", "packages": [ { "name": "alchemy-fr/tcpdf-clone", @@ -2868,16 +2868,16 @@ }, { "name": "twig/twig", - "version": "v1.13.2", + "version": "v1.14.2", "source": { "type": "git", "url": "https://github.com/fabpot/Twig.git", - "reference": "6d6a1009427d1f398c9d40904147bf9f723d5755" + "reference": "ca445842fcea4f844d68203ffa2d00f5e3cdea64" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/fabpot/Twig/zipball/6d6a1009427d1f398c9d40904147bf9f723d5755", - "reference": "6d6a1009427d1f398c9d40904147bf9f723d5755", + "url": "https://api.github.com/repos/fabpot/Twig/zipball/ca445842fcea4f844d68203ffa2d00f5e3cdea64", + "reference": "ca445842fcea4f844d68203ffa2d00f5e3cdea64", "shasum": "" }, "require": { @@ -2886,7 +2886,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.13-dev" + "dev-master": "1.14-dev" } }, "autoload": { @@ -2913,7 +2913,7 @@ "keywords": [ "templating" ], - "time": "2013-08-03 15:35:31" + "time": "2013-10-30 08:20:53" }, { "name": "zend/gdata", From 57b5f4490813aea9bd4abfe3747da70489205ba4 Mon Sep 17 00:00:00 2001 From: Romain Neutron Date: Thu, 31 Oct 2013 15:20:50 +0100 Subject: [PATCH 4/4] Fix configuration fixtures --- .../Phrasea/Core/Configuration/Fixtures/configuration-setup.yml | 2 +- .../Tests/Phrasea/Core/Configuration/Fixtures/configuration.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/Alchemy/Tests/Phrasea/Core/Configuration/Fixtures/configuration-setup.yml b/tests/Alchemy/Tests/Phrasea/Core/Configuration/Fixtures/configuration-setup.yml index 21dc8d7c58..8ebfa9f96a 100644 --- a/tests/Alchemy/Tests/Phrasea/Core/Configuration/Fixtures/configuration-setup.yml +++ b/tests/Alchemy/Tests/Phrasea/Core/Configuration/Fixtures/configuration-setup.yml @@ -14,7 +14,7 @@ main: driver: pdo_sqlite path: '/tmp/db.sqlite' charset: UTF8 - api-timers: true + api-timers: false cache: type: MemcacheCache options: diff --git a/tests/Alchemy/Tests/Phrasea/Core/Configuration/Fixtures/configuration.yml b/tests/Alchemy/Tests/Phrasea/Core/Configuration/Fixtures/configuration.yml index 21dc8d7c58..8ebfa9f96a 100644 --- a/tests/Alchemy/Tests/Phrasea/Core/Configuration/Fixtures/configuration.yml +++ b/tests/Alchemy/Tests/Phrasea/Core/Configuration/Fixtures/configuration.yml @@ -14,7 +14,7 @@ main: driver: pdo_sqlite path: '/tmp/db.sqlite' charset: UTF8 - api-timers: true + api-timers: false cache: type: MemcacheCache options: