From ba84c9ea77a7f20ae88f6689409d8c5f45880664 Mon Sep 17 00:00:00 2001 From: Nicolas Le Goff Date: Tue, 31 Jan 2012 12:35:12 +0100 Subject: [PATCH 1/4] fix twig strict variable issue --- lib/Alchemy/Phrasea/Application/OAuth2.php | 3 ++- templates/web/api/auth/application_dev_show.twig | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/Alchemy/Phrasea/Application/OAuth2.php b/lib/Alchemy/Phrasea/Application/OAuth2.php index 01fcc88400..b4a1627e2b 100644 --- a/lib/Alchemy/Phrasea/Application/OAuth2.php +++ b/lib/Alchemy/Phrasea/Application/OAuth2.php @@ -271,7 +271,7 @@ return call_user_func(function() $route = "/applications/dev/new"; $app->get($route, function() use ($app) { - $var = array("violations" => null); + $var = array("violations" => null, 'form' => null); return $app['response']('api/auth/application_dev_new.twig', $var); }); @@ -443,6 +443,7 @@ return call_user_func(function() */ $app->error(function (\Exception $e) use ($app) { + var_dump($e->getMessage()); if ($e instanceof NotFoundHttpException || $e instanceof \Exception_NotFound) { return new Response('The requested page could not be found.', 404); diff --git a/templates/web/api/auth/application_dev_show.twig b/templates/web/api/auth/application_dev_show.twig index 3134c16407..d247d76b3e 100644 --- a/templates/web/api/auth/application_dev_show.twig +++ b/templates/web/api/auth/application_dev_show.twig @@ -6,7 +6,7 @@
  • {{app.get_name}} - {{app.get_desciption }} + {{app.get_description }}
  • From 05452bef0e3f87956d7d055a9f306d4cabc26588 Mon Sep 17 00:00:00 2001 From: Nicolas Le Goff Date: Tue, 31 Jan 2012 12:36:11 +0100 Subject: [PATCH 2/4] remove var_dump --- lib/Alchemy/Phrasea/Application/OAuth2.php | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/Alchemy/Phrasea/Application/OAuth2.php b/lib/Alchemy/Phrasea/Application/OAuth2.php index b4a1627e2b..6c943c940a 100644 --- a/lib/Alchemy/Phrasea/Application/OAuth2.php +++ b/lib/Alchemy/Phrasea/Application/OAuth2.php @@ -443,7 +443,6 @@ return call_user_func(function() */ $app->error(function (\Exception $e) use ($app) { - var_dump($e->getMessage()); if ($e instanceof NotFoundHttpException || $e instanceof \Exception_NotFound) { return new Response('The requested page could not be found.', 404); From 50af32532e3c0f7f3c966644fe94daec6a534280 Mon Sep 17 00:00:00 2001 From: Nicolas Le Goff Date: Tue, 31 Jan 2012 17:05:44 +0100 Subject: [PATCH 3/4] correct rfc oauth2.0 V9 issue, scope and state value are no more provided if not filled in authorization response --- lib/classes/API/OAuth2/Adapter.class.php | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/lib/classes/API/OAuth2/Adapter.class.php b/lib/classes/API/OAuth2/Adapter.class.php index 5e93db5c2a..8a36bfc717 100644 --- a/lib/classes/API/OAuth2/Adapter.class.php +++ b/lib/classes/API/OAuth2/Adapter.class.php @@ -406,11 +406,22 @@ class API_OAuth2_Adapter extends OAuth2 'response_type' => $request->get('response_type', false) , 'client_id' => $request->get('client_id', false) , 'redirect_uri' => $request->get('redirect_uri', false) - , 'scope' => $request->get('scope', false) - , 'state' => $request->get('state', false) ); + $scope = $request->get('scope', false); + $state = $request->get('state', false); + + if($state) + { + $datas["state"] = $state; + } + + if($scope) + { + $datas["scope"] = $scope; + } + $filters = array( "client_id" => array( "filter" => FILTER_VALIDATE_REGEXP From d86657c633f1d11342118ef0c75a05ea17202845 Mon Sep 17 00:00:00 2001 From: jygaulier Date: Tue, 31 Jan 2012 19:32:24 +0100 Subject: [PATCH 4/4] fix #262 : archive task / waiting for a 'magic file' in any subfolder locked whole archiving --- lib/classes/task/period/archive.class.php | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/lib/classes/task/period/archive.class.php b/lib/classes/task/period/archive.class.php index 4299bbebd1..ae3bd1d95d 100644 --- a/lib/classes/task/period/archive.class.php +++ b/lib/classes/task/period/archive.class.php @@ -825,7 +825,20 @@ class task_period_archive extends task_abstract $xp = new DOMXPath($dom); - while (($file = $listFolder->read()) !== NULL) + if(($sxDotPhrasea = @simplexml_load_file($path . '/.phrasea.xml'))) + { + // on gere le magicfile + if(($magicfile = trim((string) ($sxDotPhrasea->magicfile))) != '') + { + $magicmethod = strtoupper($sxDotPhrasea->magicfile['method']); + if($magicmethod == 'LOCK' && file_exists($path . '/' . $magicfile)) + return; + elseif($magicmethod == 'UNLOCK' && !file_exists($path . '/' . $magicfile)) + return; + } + } + + while(($file = $listFolder->read()) !== NULL) { if ($this->isIgnoredFile($file)) continue;