mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-18 07:23:13 +00:00
Fix CS lib/Alchemy
This commit is contained in:
@@ -160,7 +160,7 @@ class Application extends SilexApplication
|
|||||||
|
|
||||||
if ($this['debug'] === true) {
|
if ($this['debug'] === true) {
|
||||||
ini_set('display_errors', 'on');
|
ini_set('display_errors', 'on');
|
||||||
if($this->getEnvironment() === 'dev') {
|
if ($this->getEnvironment() === 'dev') {
|
||||||
ini_set('log_errors', 'on');
|
ini_set('log_errors', 'on');
|
||||||
ini_set('error_log', __DIR__ . '/../../../logs/php_error.log');
|
ini_set('error_log', __DIR__ . '/../../../logs/php_error.log');
|
||||||
}
|
}
|
||||||
@@ -368,8 +368,8 @@ class Application extends SilexApplication
|
|||||||
$response = $event->getResponse();
|
$response = $event->getResponse();
|
||||||
|
|
||||||
foreach ($response->headers->getCookies(ResponseHeaderBag::COOKIES_ARRAY) as $cookie_domains) {
|
foreach ($response->headers->getCookies(ResponseHeaderBag::COOKIES_ARRAY) as $cookie_domains) {
|
||||||
foreach($cookie_domains as $cookie_paths) {
|
foreach ($cookie_domains as $cookie_paths) {
|
||||||
foreach($cookie_paths as $cookie) {
|
foreach ($cookie_paths as $cookie) {
|
||||||
$response->headers->removeCookie($cookie->getName(), $cookie->getPath(), $cookie->getDomain());
|
$response->headers->removeCookie($cookie->getName(), $cookie->getPath(), $cookie->getDomain());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -408,11 +408,12 @@ class Application extends SilexApplication
|
|||||||
return $event->getRequest()->getLocale();
|
return $event->getRequest()->getLocale();
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach($app['bad-faith']->headerLists['accept_language']->items as $language) {
|
foreach ($app['bad-faith']->headerLists['accept_language']->items as $language) {
|
||||||
$code = $language->lang.'_'.$language->sublang;
|
$code = $language->lang.'_'.$language->sublang;
|
||||||
if(isset($languages[$code])) {
|
if (isset($languages[$code])) {
|
||||||
|
|
||||||
$event->getRequest()->setLocale($code);
|
$event->getRequest()->setLocale($code);
|
||||||
|
|
||||||
return $event->getRequest()->getLocale();
|
return $event->getRequest()->getLocale();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -499,8 +500,8 @@ class Application extends SilexApplication
|
|||||||
/**
|
/**
|
||||||
* Open user session
|
* Open user session
|
||||||
*
|
*
|
||||||
* @param \Session_Authentication_Interface $auth
|
* @param \Session_Authentication_Interface $auth
|
||||||
* @param integer $ses_id use previous phrasea session id
|
* @param integer $ses_id use previous phrasea session id
|
||||||
* @throws \Exception_InternalServerError
|
* @throws \Exception_InternalServerError
|
||||||
*/
|
*/
|
||||||
public function openAccount(\Session_Authentication_Interface $auth, $ses_id = null)
|
public function openAccount(\Session_Authentication_Interface $auth, $ses_id = null)
|
||||||
@@ -651,4 +652,3 @@ class Application extends SilexApplication
|
|||||||
$this->sessionCookieEnabled = false;
|
$this->sessionCookieEnabled = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -710,7 +710,6 @@ return call_user_func(function($environment = 'prod') {
|
|||||||
})->assert('databox_id', '\d+')->assert('story_id', '\d+');
|
})->assert('databox_id', '\d+')->assert('story_id', '\d+');
|
||||||
$app->get('/stories/{any_id}/{anyother_id}/', $bad_request_exception);
|
$app->get('/stories/{any_id}/{anyother_id}/', $bad_request_exception);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Route Errors
|
* Route Errors
|
||||||
*/
|
*/
|
||||||
|
@@ -15,7 +15,6 @@ use Silex\Application as SilexApplication;
|
|||||||
use Alchemy\Phrasea\Application as PhraseaApplication;
|
use Alchemy\Phrasea\Application as PhraseaApplication;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
|
|
||||||
|
|
||||||
return call_user_func(function($environment = 'prod') {
|
return call_user_func(function($environment = 'prod') {
|
||||||
|
|
||||||
$app = new PhraseaApplication($environment);
|
$app = new PhraseaApplication($environment);
|
||||||
|
@@ -83,7 +83,6 @@ return call_user_func(function($environment = 'prod') {
|
|||||||
|
|
||||||
$app->openAccount($auth);
|
$app->openAccount($auth);
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
|
|
||||||
return new Response($app['twig']->render($template, array("auth" => $oauth2_adapter)));
|
return new Response($app['twig']->render($template, array("auth" => $oauth2_adapter)));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@@ -25,10 +25,10 @@ class CLI extends Application
|
|||||||
/**
|
/**
|
||||||
* Registers the autoloader and necessary components.
|
* Registers the autoloader and necessary components.
|
||||||
*
|
*
|
||||||
* @param string $name Name for this application.
|
* @param string $name Name for this application.
|
||||||
* @param string|null $version Version number for this application.
|
* @param string|null $version Version number for this application.
|
||||||
*/
|
*/
|
||||||
function __construct($name, $version = null, $environment = null)
|
public function __construct($name, $version = null, $environment = null)
|
||||||
{
|
{
|
||||||
parent::__construct($environment);
|
parent::__construct($environment);
|
||||||
|
|
||||||
|
@@ -110,4 +110,3 @@ class Manager
|
|||||||
file_put_contents($this->cacheFile->getPathname(), $datas);
|
file_put_contents($this->cacheFile->getPathname(), $datas);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -71,6 +71,7 @@ class RecordAdd extends Command
|
|||||||
|
|
||||||
if (strtolower($continue) !== 'y') {
|
if (strtolower($continue) !== 'y') {
|
||||||
$output->writeln('Aborted !');
|
$output->writeln('Aborted !');
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -32,4 +32,3 @@ interface DatasUpgraderInterface
|
|||||||
*/
|
*/
|
||||||
public function getTimeEstimation();
|
public function getTimeEstimation();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -92,7 +92,7 @@ class Step31 implements DatasUpgraderInterface
|
|||||||
/**
|
/**
|
||||||
* Return a maximum of 100 recods without UUIDs
|
* Return a maximum of 100 recods without UUIDs
|
||||||
*
|
*
|
||||||
* @param \databox $databox
|
* @param \databox $databox
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
protected function getNullUUIDs(\databox $databox)
|
protected function getNullUUIDs(\databox $databox)
|
||||||
@@ -115,7 +115,7 @@ class Step31 implements DatasUpgraderInterface
|
|||||||
* Update a record with a UUID
|
* Update a record with a UUID
|
||||||
*
|
*
|
||||||
* @param \databox $databox
|
* @param \databox $databox
|
||||||
* @param array $record
|
* @param array $record
|
||||||
*/
|
*/
|
||||||
protected function updateRecordUUID(\databox $databox, array $record)
|
protected function updateRecordUUID(\databox $databox, array $record)
|
||||||
{
|
{
|
||||||
|
@@ -101,7 +101,6 @@ class Step35 implements DatasUpgraderInterface
|
|||||||
} while (count($rs) > 0);
|
} while (count($rs) > 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
foreach ($this->app['phraseanet.appbox']->get_databoxes() as $databox) {
|
foreach ($this->app['phraseanet.appbox']->get_databoxes() as $databox) {
|
||||||
$this->ensureDropMigrateColumn($databox);
|
$this->ensureDropMigrateColumn($databox);
|
||||||
}
|
}
|
||||||
@@ -133,7 +132,7 @@ class Step35 implements DatasUpgraderInterface
|
|||||||
* Update the metadatas of a record
|
* Update the metadatas of a record
|
||||||
*
|
*
|
||||||
* @param \record_adapter $record
|
* @param \record_adapter $record
|
||||||
* @param string $xml
|
* @param string $xml
|
||||||
*/
|
*/
|
||||||
protected function updateMetadatas(\record_adapter $record, $xml)
|
protected function updateMetadatas(\record_adapter $record, $xml)
|
||||||
{
|
{
|
||||||
@@ -200,7 +199,7 @@ class Step35 implements DatasUpgraderInterface
|
|||||||
*
|
*
|
||||||
* @staticvar \PDO_statement $stmt
|
* @staticvar \PDO_statement $stmt
|
||||||
* @param \databox $databox
|
* @param \databox $databox
|
||||||
* @param array $record
|
* @param array $record
|
||||||
*/
|
*/
|
||||||
protected function setOriginalName(\databox $databox, array $record)
|
protected function setOriginalName(\databox $databox, array $record)
|
||||||
{
|
{
|
||||||
|
@@ -102,7 +102,7 @@ EOF
|
|||||||
{
|
{
|
||||||
$this->generateUpgradesFromOption($input);
|
$this->generateUpgradesFromOption($input);
|
||||||
|
|
||||||
if ( ! $this->upgrades) {
|
if (! $this->upgrades) {
|
||||||
throw new \Exception('No upgrade available');
|
throw new \Exception('No upgrade available');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -376,9 +376,9 @@ class Collection implements ControllerProviderInterface
|
|||||||
/**
|
/**
|
||||||
* Display collection information page
|
* Display collection information page
|
||||||
*
|
*
|
||||||
* @param Application $app The silex application
|
* @param Application $app The silex application
|
||||||
* @param Request $request The current request
|
* @param Request $request The current request
|
||||||
* @param integer $bas_id The collection base_id
|
* @param integer $bas_id The collection base_id
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function getCollection(Application $app, Request $request, $bas_id)
|
public function getCollection(Application $app, Request $request, $bas_id)
|
||||||
@@ -421,10 +421,10 @@ class Collection implements ControllerProviderInterface
|
|||||||
/**
|
/**
|
||||||
* Set new admin to handle orders
|
* Set new admin to handle orders
|
||||||
*
|
*
|
||||||
* @param Application $app The silex application
|
* @param Application $app The silex application
|
||||||
* @param Request $request The current request
|
* @param Request $request The current request
|
||||||
* @param integer $bas_id The collection base_id
|
* @param integer $bas_id The collection base_id
|
||||||
* @return RedirectResponse
|
* @return RedirectResponse
|
||||||
*/
|
*/
|
||||||
public function setOrderAdmins(Application $app, Request $request, $bas_id)
|
public function setOrderAdmins(Application $app, Request $request, $bas_id)
|
||||||
{
|
{
|
||||||
@@ -471,9 +471,9 @@ class Collection implements ControllerProviderInterface
|
|||||||
/**
|
/**
|
||||||
* Empty a collection
|
* Empty a collection
|
||||||
*
|
*
|
||||||
* @param Application $app The silex application
|
* @param Application $app The silex application
|
||||||
* @param Request $request The current request
|
* @param Request $request The current request
|
||||||
* @param integer $bas_id The collection base_id
|
* @param integer $bas_id The collection base_id
|
||||||
* @return JsonResponse|RedirectResponse
|
* @return JsonResponse|RedirectResponse
|
||||||
*/
|
*/
|
||||||
public function emptyCollection(Application $app, Request $request, $bas_id)
|
public function emptyCollection(Application $app, Request $request, $bas_id)
|
||||||
@@ -499,7 +499,6 @@ class Collection implements ControllerProviderInterface
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ('json' === $app['request']->getRequestFormat()) {
|
if ('json' === $app['request']->getRequestFormat()) {
|
||||||
|
|
||||||
return $app->json(array(
|
return $app->json(array(
|
||||||
'success' => $success,
|
'success' => $success,
|
||||||
'msg' => $msg,
|
'msg' => $msg,
|
||||||
@@ -513,10 +512,10 @@ class Collection implements ControllerProviderInterface
|
|||||||
/**
|
/**
|
||||||
* Delete the collection banner
|
* Delete the collection banner
|
||||||
*
|
*
|
||||||
* @param Application $app The silex application
|
* @param Application $app The silex application
|
||||||
* @param Request $request The current request
|
* @param Request $request The current request
|
||||||
* @param integer $bas_id The collection base_id
|
* @param integer $bas_id The collection base_id
|
||||||
* @return JsonResponse|RedirectResponse
|
* @return JsonResponse|RedirectResponse
|
||||||
*/
|
*/
|
||||||
public function deleteBanner(Application $app, Request $request, $bas_id)
|
public function deleteBanner(Application $app, Request $request, $bas_id)
|
||||||
{
|
{
|
||||||
@@ -532,7 +531,6 @@ class Collection implements ControllerProviderInterface
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ('json' === $app['request']->getRequestFormat()) {
|
if ('json' === $app['request']->getRequestFormat()) {
|
||||||
|
|
||||||
return $app->json(array(
|
return $app->json(array(
|
||||||
'success' => $success,
|
'success' => $success,
|
||||||
'msg' => $success ? _('Successful removal') : _('An error occured'),
|
'msg' => $success ? _('Successful removal') : _('An error occured'),
|
||||||
@@ -546,10 +544,10 @@ class Collection implements ControllerProviderInterface
|
|||||||
/**
|
/**
|
||||||
* Delete the collection stamp
|
* Delete the collection stamp
|
||||||
*
|
*
|
||||||
* @param Application $app The silex application
|
* @param Application $app The silex application
|
||||||
* @param Request $request The current request
|
* @param Request $request The current request
|
||||||
* @param integer $bas_id The collection base_id
|
* @param integer $bas_id The collection base_id
|
||||||
* @return JsonResponse|RedirectResponse
|
* @return JsonResponse|RedirectResponse
|
||||||
*/
|
*/
|
||||||
public function deleteStamp(Application $app, Request $request, $bas_id)
|
public function deleteStamp(Application $app, Request $request, $bas_id)
|
||||||
{
|
{
|
||||||
@@ -565,7 +563,6 @@ class Collection implements ControllerProviderInterface
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ('json' === $app['request']->getRequestFormat()) {
|
if ('json' === $app['request']->getRequestFormat()) {
|
||||||
|
|
||||||
return $app->json(array(
|
return $app->json(array(
|
||||||
'success' => $success,
|
'success' => $success,
|
||||||
'msg' => $success ? _('Successful removal') : _('An error occured'),
|
'msg' => $success ? _('Successful removal') : _('An error occured'),
|
||||||
@@ -579,10 +576,10 @@ class Collection implements ControllerProviderInterface
|
|||||||
/**
|
/**
|
||||||
* Delete the collection watermark
|
* Delete the collection watermark
|
||||||
*
|
*
|
||||||
* @param Application $app The silex application
|
* @param Application $app The silex application
|
||||||
* @param Request $request The current request
|
* @param Request $request The current request
|
||||||
* @param integer $bas_id The collection base_id
|
* @param integer $bas_id The collection base_id
|
||||||
* @return JsonResponse|RedirectResponse
|
* @return JsonResponse|RedirectResponse
|
||||||
*/
|
*/
|
||||||
public function deleteWatermark(Application $app, Request $request, $bas_id)
|
public function deleteWatermark(Application $app, Request $request, $bas_id)
|
||||||
{
|
{
|
||||||
@@ -598,7 +595,6 @@ class Collection implements ControllerProviderInterface
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ('json' === $app['request']->getRequestFormat()) {
|
if ('json' === $app['request']->getRequestFormat()) {
|
||||||
|
|
||||||
return $app->json(array(
|
return $app->json(array(
|
||||||
'success' => $success,
|
'success' => $success,
|
||||||
'msg' => $success ? _('Successful removal') : _('An error occured'),
|
'msg' => $success ? _('Successful removal') : _('An error occured'),
|
||||||
@@ -612,10 +608,10 @@ class Collection implements ControllerProviderInterface
|
|||||||
/**
|
/**
|
||||||
* Delete the current collection logo
|
* Delete the current collection logo
|
||||||
*
|
*
|
||||||
* @param Application $app The silex application
|
* @param Application $app The silex application
|
||||||
* @param Request $request The current request
|
* @param Request $request The current request
|
||||||
* @param integer $bas_id The collection base_id
|
* @param integer $bas_id The collection base_id
|
||||||
* @return JsonResponse|RedirectResponse
|
* @return JsonResponse|RedirectResponse
|
||||||
*/
|
*/
|
||||||
public function deleteLogo(Application $app, Request $request, $bas_id)
|
public function deleteLogo(Application $app, Request $request, $bas_id)
|
||||||
{
|
{
|
||||||
@@ -632,7 +628,6 @@ class Collection implements ControllerProviderInterface
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ('json' === $app['request']->getRequestFormat()) {
|
if ('json' === $app['request']->getRequestFormat()) {
|
||||||
|
|
||||||
return $app->json(array(
|
return $app->json(array(
|
||||||
'success' => $success,
|
'success' => $success,
|
||||||
'msg' => $success ? _('Successful removal') : _('An error occured'),
|
'msg' => $success ? _('Successful removal') : _('An error occured'),
|
||||||
@@ -646,10 +641,10 @@ class Collection implements ControllerProviderInterface
|
|||||||
/**
|
/**
|
||||||
* Set a collection banner
|
* Set a collection banner
|
||||||
*
|
*
|
||||||
* @param Application $app The silex application
|
* @param Application $app The silex application
|
||||||
* @param Request $request The current request
|
* @param Request $request The current request
|
||||||
* @param integer $bas_id The collection base_id
|
* @param integer $bas_id The collection base_id
|
||||||
* @return RedirectResponse
|
* @return RedirectResponse
|
||||||
*/
|
*/
|
||||||
public function setBanner(Application $app, Request $request, $bas_id)
|
public function setBanner(Application $app, Request $request, $bas_id)
|
||||||
{
|
{
|
||||||
@@ -681,10 +676,10 @@ class Collection implements ControllerProviderInterface
|
|||||||
/**
|
/**
|
||||||
* Set a collection stamp
|
* Set a collection stamp
|
||||||
*
|
*
|
||||||
* @param Application $app The silex application
|
* @param Application $app The silex application
|
||||||
* @param Request $request The current request
|
* @param Request $request The current request
|
||||||
* @param integer $bas_id The collection base_id
|
* @param integer $bas_id The collection base_id
|
||||||
* @return RedirectResponse
|
* @return RedirectResponse
|
||||||
*/
|
*/
|
||||||
public function setStamp(Application $app, Request $request, $bas_id)
|
public function setStamp(Application $app, Request $request, $bas_id)
|
||||||
{
|
{
|
||||||
@@ -716,10 +711,10 @@ class Collection implements ControllerProviderInterface
|
|||||||
/**
|
/**
|
||||||
* Set a collection watermark
|
* Set a collection watermark
|
||||||
*
|
*
|
||||||
* @param Application $app The silex application
|
* @param Application $app The silex application
|
||||||
* @param Request $request The current request
|
* @param Request $request The current request
|
||||||
* @param integer $bas_id The collection base_id
|
* @param integer $bas_id The collection base_id
|
||||||
* @return RedirectResponse
|
* @return RedirectResponse
|
||||||
*/
|
*/
|
||||||
public function setWatermark(Application $app, Request $request, $bas_id)
|
public function setWatermark(Application $app, Request $request, $bas_id)
|
||||||
{
|
{
|
||||||
@@ -750,10 +745,10 @@ class Collection implements ControllerProviderInterface
|
|||||||
/**
|
/**
|
||||||
* Set collection minilogo
|
* Set collection minilogo
|
||||||
*
|
*
|
||||||
* @param Application $app The silex application
|
* @param Application $app The silex application
|
||||||
* @param Request $request The current request
|
* @param Request $request The current request
|
||||||
* @param integer $bas_id The collection base_id
|
* @param integer $bas_id The collection base_id
|
||||||
* @return RedirectResponse
|
* @return RedirectResponse
|
||||||
*/
|
*/
|
||||||
public function setMiniLogo(Application $app, Request $request, $bas_id)
|
public function setMiniLogo(Application $app, Request $request, $bas_id)
|
||||||
{
|
{
|
||||||
@@ -784,10 +779,10 @@ class Collection implements ControllerProviderInterface
|
|||||||
/**
|
/**
|
||||||
* Delete a Collection
|
* Delete a Collection
|
||||||
*
|
*
|
||||||
* @param Application $app The silex application
|
* @param Application $app The silex application
|
||||||
* @param Request $request The current request
|
* @param Request $request The current request
|
||||||
* @param integer $bas_id The collection base_id
|
* @param integer $bas_id The collection base_id
|
||||||
* @return JsonResponse|RedirectResponse
|
* @return JsonResponse|RedirectResponse
|
||||||
*/
|
*/
|
||||||
public function delete(Application $app, Request $request, $bas_id)
|
public function delete(Application $app, Request $request, $bas_id)
|
||||||
{
|
{
|
||||||
@@ -810,7 +805,6 @@ class Collection implements ControllerProviderInterface
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ('json' === $app['request']->getRequestFormat()) {
|
if ('json' === $app['request']->getRequestFormat()) {
|
||||||
|
|
||||||
return $app->json(array(
|
return $app->json(array(
|
||||||
'success' => $success,
|
'success' => $success,
|
||||||
'msg' => $msg
|
'msg' => $msg
|
||||||
@@ -831,10 +825,10 @@ class Collection implements ControllerProviderInterface
|
|||||||
/**
|
/**
|
||||||
* Unmount a collection from application box
|
* Unmount a collection from application box
|
||||||
*
|
*
|
||||||
* @param Application $app The silex application
|
* @param Application $app The silex application
|
||||||
* @param Request $request The current request
|
* @param Request $request The current request
|
||||||
* @param integer $bas_id The collection base_id
|
* @param integer $bas_id The collection base_id
|
||||||
* @return JsonResponse|RedirectResponse
|
* @return JsonResponse|RedirectResponse
|
||||||
*/
|
*/
|
||||||
public function unmount(Application $app, Request $request, $bas_id)
|
public function unmount(Application $app, Request $request, $bas_id)
|
||||||
{
|
{
|
||||||
@@ -862,10 +856,10 @@ class Collection implements ControllerProviderInterface
|
|||||||
/**
|
/**
|
||||||
* Rename a collection
|
* Rename a collection
|
||||||
*
|
*
|
||||||
* @param Application $app The silex application
|
* @param Application $app The silex application
|
||||||
* @param Request $request The current request
|
* @param Request $request The current request
|
||||||
* @param integer $bas_id The collection base_id
|
* @param integer $bas_id The collection base_id
|
||||||
* @return JsonResponse|RedirectResponse
|
* @return JsonResponse|RedirectResponse
|
||||||
*/
|
*/
|
||||||
public function rename(Application $app, Request $request, $bas_id)
|
public function rename(Application $app, Request $request, $bas_id)
|
||||||
{
|
{
|
||||||
@@ -897,10 +891,10 @@ class Collection implements ControllerProviderInterface
|
|||||||
/**
|
/**
|
||||||
* Set public presentation watermark
|
* Set public presentation watermark
|
||||||
*
|
*
|
||||||
* @param Application $app The silex application
|
* @param Application $app The silex application
|
||||||
* @param Request $request The current request
|
* @param Request $request The current request
|
||||||
* @param integer $bas_id The collection base_id
|
* @param integer $bas_id The collection base_id
|
||||||
* @return JsonResponse|RedirectResponse
|
* @return JsonResponse|RedirectResponse
|
||||||
*/
|
*/
|
||||||
public function setPublicationDisplay(Application $app, Request $request, $bas_id)
|
public function setPublicationDisplay(Application $app, Request $request, $bas_id)
|
||||||
{
|
{
|
||||||
@@ -932,10 +926,10 @@ class Collection implements ControllerProviderInterface
|
|||||||
/**
|
/**
|
||||||
* Enable a collection
|
* Enable a collection
|
||||||
*
|
*
|
||||||
* @param Application $app The silex application
|
* @param Application $app The silex application
|
||||||
* @param Request $request The current request
|
* @param Request $request The current request
|
||||||
* @param integer $bas_id The collection base_id
|
* @param integer $bas_id The collection base_id
|
||||||
* @return JsonResponse|RedirectResponse
|
* @return JsonResponse|RedirectResponse
|
||||||
*/
|
*/
|
||||||
public function enable(Application $app, Request $request, $bas_id)
|
public function enable(Application $app, Request $request, $bas_id)
|
||||||
{
|
{
|
||||||
@@ -963,10 +957,10 @@ class Collection implements ControllerProviderInterface
|
|||||||
/**
|
/**
|
||||||
* Disable a collection
|
* Disable a collection
|
||||||
*
|
*
|
||||||
* @param Application $app The silex application
|
* @param Application $app The silex application
|
||||||
* @param Request $request The current request
|
* @param Request $request The current request
|
||||||
* @param integer $bas_id The collection base_id
|
* @param integer $bas_id The collection base_id
|
||||||
* @return JsonResponse|RedirectResponse
|
* @return JsonResponse|RedirectResponse
|
||||||
*/
|
*/
|
||||||
public function disabled(Application $app, Request $request, $bas_id)
|
public function disabled(Application $app, Request $request, $bas_id)
|
||||||
{
|
{
|
||||||
@@ -994,9 +988,9 @@ class Collection implements ControllerProviderInterface
|
|||||||
/**
|
/**
|
||||||
* Display suggested values
|
* Display suggested values
|
||||||
*
|
*
|
||||||
* @param Application $app The silex application
|
* @param Application $app The silex application
|
||||||
* @param Request $request The current request
|
* @param Request $request The current request
|
||||||
* @param integer $bas_id The collection base_id
|
* @param integer $bas_id The collection base_id
|
||||||
*/
|
*/
|
||||||
public function getSuggestedValues(Application $app, Request $request, $bas_id)
|
public function getSuggestedValues(Application $app, Request $request, $bas_id)
|
||||||
{
|
{
|
||||||
@@ -1035,7 +1029,7 @@ class Collection implements ControllerProviderInterface
|
|||||||
|
|
||||||
if ($ki == 'status') {
|
if ($ki == 'status') {
|
||||||
$pref['status'] = $vi;
|
$pref['status'] = $vi;
|
||||||
} else if ($ki != 'sugestedValues') {
|
} elseif ($ki != 'sugestedValues') {
|
||||||
$pref['xml'] = $vi->asXML();
|
$pref['xml'] = $vi->asXML();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1056,10 +1050,10 @@ class Collection implements ControllerProviderInterface
|
|||||||
/**
|
/**
|
||||||
* Register suggested values
|
* Register suggested values
|
||||||
*
|
*
|
||||||
* @param Application $app The silex application
|
* @param Application $app The silex application
|
||||||
* @param Request $request The current request
|
* @param Request $request The current request
|
||||||
* @param integer $bas_id The collection base_id
|
* @param integer $bas_id The collection base_id
|
||||||
* @return JsonResponse|RedirectResponse
|
* @return JsonResponse|RedirectResponse
|
||||||
*/
|
*/
|
||||||
public function submitSuggestedValues(Application $app, Request $request, $bas_id)
|
public function submitSuggestedValues(Application $app, Request $request, $bas_id)
|
||||||
{
|
{
|
||||||
@@ -1078,7 +1072,6 @@ class Collection implements ControllerProviderInterface
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ('json' === $app['request']->getRequestFormat()) {
|
if ('json' === $app['request']->getRequestFormat()) {
|
||||||
|
|
||||||
return $app->json(array(
|
return $app->json(array(
|
||||||
'success' => $success,
|
'success' => $success,
|
||||||
'msg' => $success ? _('Successful update') : _('An error occured'),
|
'msg' => $success ? _('Successful update') : _('An error occured'),
|
||||||
@@ -1092,9 +1085,9 @@ class Collection implements ControllerProviderInterface
|
|||||||
/**
|
/**
|
||||||
* Get document details in the requested collection
|
* Get document details in the requested collection
|
||||||
*
|
*
|
||||||
* @param Application $app The silex application
|
* @param Application $app The silex application
|
||||||
* @param Request $request The current request
|
* @param Request $request The current request
|
||||||
* @param integer $bas_id The collection base_id
|
* @param integer $bas_id The collection base_id
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function getDetails(Application $app, Request $request, $bas_id)
|
public function getDetails(Application $app, Request $request, $bas_id)
|
||||||
|
@@ -14,7 +14,6 @@ namespace Alchemy\Phrasea\Controller\Admin;
|
|||||||
use Silex\Application;
|
use Silex\Application;
|
||||||
use Silex\ControllerProviderInterface;
|
use Silex\ControllerProviderInterface;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
use Symfony\Component\HttpFoundation\Response;
|
|
||||||
|
|
||||||
class ConnectedUsers implements ControllerProviderInterface
|
class ConnectedUsers implements ControllerProviderInterface
|
||||||
{
|
{
|
||||||
@@ -27,7 +26,6 @@ class ConnectedUsers implements ControllerProviderInterface
|
|||||||
$app['firewall']->requireAccessToModule('Admin');
|
$app['firewall']->requireAccessToModule('Admin');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
$controllers->get('/', $this->call('listConnectedUsers'));
|
$controllers->get('/', $this->call('listConnectedUsers'));
|
||||||
|
|
||||||
return $controllers;
|
return $controllers;
|
||||||
@@ -74,7 +72,7 @@ class ConnectedUsers implements ControllerProviderInterface
|
|||||||
/**
|
/**
|
||||||
* Return module name according to its ID
|
* Return module name according to its ID
|
||||||
*
|
*
|
||||||
* @param integer $appId
|
* @param integer $appId
|
||||||
* @return string
|
* @return string
|
||||||
* @return null
|
* @return null
|
||||||
*/
|
*/
|
||||||
|
@@ -121,9 +121,9 @@ class Dashboard implements ControllerProviderInterface
|
|||||||
/**
|
/**
|
||||||
* Display admin dashboard page
|
* Display admin dashboard page
|
||||||
*
|
*
|
||||||
* @param Application $app
|
* @param Application $app
|
||||||
* @param Request $request
|
* @param Request $request
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function slash(Application $app, Request $request)
|
public function slash(Application $app, Request $request)
|
||||||
{
|
{
|
||||||
@@ -157,14 +157,13 @@ class Dashboard implements ControllerProviderInterface
|
|||||||
/**
|
/**
|
||||||
* Flush all cash services
|
* Flush all cash services
|
||||||
*
|
*
|
||||||
* @param Application $app
|
* @param Application $app
|
||||||
* @param Request $request
|
* @param Request $request
|
||||||
* @return RedirectResponse
|
* @return RedirectResponse
|
||||||
*/
|
*/
|
||||||
public function flush(Application $app, Request $request)
|
public function flush(Application $app, Request $request)
|
||||||
{
|
{
|
||||||
if ($app['phraseanet.cache-service']->flushAll()) {
|
if ($app['phraseanet.cache-service']->flushAll()) {
|
||||||
|
|
||||||
return $app->redirect('/admin/dashboard/?flush_cache=ok');
|
return $app->redirect('/admin/dashboard/?flush_cache=ok');
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -174,9 +173,9 @@ class Dashboard implements ControllerProviderInterface
|
|||||||
/**
|
/**
|
||||||
* Test a mail address
|
* Test a mail address
|
||||||
*
|
*
|
||||||
* @param Application $app
|
* @param Application $app
|
||||||
* @param Request $request
|
* @param Request $request
|
||||||
* @return RedirectResponse
|
* @return RedirectResponse
|
||||||
*/
|
*/
|
||||||
public function sendMail(Application $app, Request $request)
|
public function sendMail(Application $app, Request $request)
|
||||||
{
|
{
|
||||||
@@ -205,9 +204,9 @@ class Dashboard implements ControllerProviderInterface
|
|||||||
/**
|
/**
|
||||||
* Reset admin rights
|
* Reset admin rights
|
||||||
*
|
*
|
||||||
* @param Application $app
|
* @param Application $app
|
||||||
* @param Request $request
|
* @param Request $request
|
||||||
* @return RedirectResponse
|
* @return RedirectResponse
|
||||||
*/
|
*/
|
||||||
public function resetAdminRights(Application $app, Request $request)
|
public function resetAdminRights(Application $app, Request $request)
|
||||||
{
|
{
|
||||||
@@ -219,9 +218,9 @@ class Dashboard implements ControllerProviderInterface
|
|||||||
/**
|
/**
|
||||||
* Grant to an user admin rights
|
* Grant to an user admin rights
|
||||||
*
|
*
|
||||||
* @param Application $app
|
* @param Application $app
|
||||||
* @param Request $request
|
* @param Request $request
|
||||||
* @return RedirectResponse
|
* @return RedirectResponse
|
||||||
*/
|
*/
|
||||||
public function addAdmins(Application $app, Request $request)
|
public function addAdmins(Application $app, Request $request)
|
||||||
{
|
{
|
||||||
|
@@ -398,8 +398,8 @@ class Databox implements ControllerProviderInterface
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param \Silex\Application $app
|
* @param \Silex\Application $app
|
||||||
* @param \Symfony\Component\HttpFoundation\Request $request
|
* @param \Symfony\Component\HttpFoundation\Request $request
|
||||||
* @return \Symfony\Component\HttpFoundation\Response
|
* @return \Symfony\Component\HttpFoundation\Response
|
||||||
*/
|
*/
|
||||||
public function getDatabase(Application $app, Request $request, $databox_id)
|
public function getDatabase(Application $app, Request $request, $databox_id)
|
||||||
@@ -429,10 +429,10 @@ class Databox implements ControllerProviderInterface
|
|||||||
/**
|
/**
|
||||||
* Get databox CGU's
|
* Get databox CGU's
|
||||||
*
|
*
|
||||||
* @param Application $app The silex application
|
* @param Application $app The silex application
|
||||||
* @param Request $request The current HTTP request
|
* @param Request $request The current HTTP request
|
||||||
* @param integer $databox_id The requested databox
|
* @param integer $databox_id The requested databox
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function getDatabaseCGU(Application $app, Request $request, $databox_id)
|
public function getDatabaseCGU(Application $app, Request $request, $databox_id)
|
||||||
{
|
{
|
||||||
@@ -446,10 +446,10 @@ class Databox implements ControllerProviderInterface
|
|||||||
/**
|
/**
|
||||||
* Delete a databox
|
* Delete a databox
|
||||||
*
|
*
|
||||||
* @param Application $app The silex application
|
* @param Application $app The silex application
|
||||||
* @param Request $request The current HTTP request
|
* @param Request $request The current HTTP request
|
||||||
* @param integer $databox_id The requested databox
|
* @param integer $databox_id The requested databox
|
||||||
* @return JsonResponse|RedirectResponse
|
* @return JsonResponse|RedirectResponse
|
||||||
*/
|
*/
|
||||||
public function deleteBase(Application $app, Request $request, $databox_id)
|
public function deleteBase(Application $app, Request $request, $databox_id)
|
||||||
{
|
{
|
||||||
@@ -485,10 +485,10 @@ class Databox implements ControllerProviderInterface
|
|||||||
/**
|
/**
|
||||||
* Reindex databox content
|
* Reindex databox content
|
||||||
*
|
*
|
||||||
* @param Application $app The silex application
|
* @param Application $app The silex application
|
||||||
* @param Request $request The current HTTP request
|
* @param Request $request The current HTTP request
|
||||||
* @param integer $databox_id The requested databox
|
* @param integer $databox_id The requested databox
|
||||||
* @return JsonResponse|RedirectResponse
|
* @return JsonResponse|RedirectResponse
|
||||||
*/
|
*/
|
||||||
public function reindex(Application $app, Request $request, $databox_id)
|
public function reindex(Application $app, Request $request, $databox_id)
|
||||||
{
|
{
|
||||||
@@ -515,10 +515,10 @@ class Databox implements ControllerProviderInterface
|
|||||||
/**
|
/**
|
||||||
* Make a databox indexable
|
* Make a databox indexable
|
||||||
*
|
*
|
||||||
* @param Application $app The silex application
|
* @param Application $app The silex application
|
||||||
* @param Request $request The current HTTP request
|
* @param Request $request The current HTTP request
|
||||||
* @param integer $databox_id The requested databox
|
* @param integer $databox_id The requested databox
|
||||||
* @return JsonResponse|RedirectResponse
|
* @return JsonResponse|RedirectResponse
|
||||||
*/
|
*/
|
||||||
public function setIndexable(Application $app, Request $request, $databox_id)
|
public function setIndexable(Application $app, Request $request, $databox_id)
|
||||||
{
|
{
|
||||||
@@ -545,10 +545,10 @@ class Databox implements ControllerProviderInterface
|
|||||||
/**
|
/**
|
||||||
* Update databox CGU's
|
* Update databox CGU's
|
||||||
*
|
*
|
||||||
* @param Application $app The silex application
|
* @param Application $app The silex application
|
||||||
* @param Request $request The current HTTP request
|
* @param Request $request The current HTTP request
|
||||||
* @param integer $databox_id The requested databox
|
* @param integer $databox_id The requested databox
|
||||||
* @return RedirectResponse
|
* @return RedirectResponse
|
||||||
*/
|
*/
|
||||||
public function updateDatabaseCGU(Application $app, Request $request, $databox_id)
|
public function updateDatabaseCGU(Application $app, Request $request, $databox_id)
|
||||||
{
|
{
|
||||||
@@ -568,10 +568,10 @@ class Databox implements ControllerProviderInterface
|
|||||||
/**
|
/**
|
||||||
* Mount a collection on a databox
|
* Mount a collection on a databox
|
||||||
*
|
*
|
||||||
* @param Application $app The silex application
|
* @param Application $app The silex application
|
||||||
* @param Request $request The current HTTP request
|
* @param Request $request The current HTTP request
|
||||||
* @param integer $databox_id The requested databox
|
* @param integer $databox_id The requested databox
|
||||||
* @return RedirectResponse
|
* @return RedirectResponse
|
||||||
*/
|
*/
|
||||||
public function mountCollection(Application $app, Request $request, $databox_id, $collection_id)
|
public function mountCollection(Application $app, Request $request, $databox_id, $collection_id)
|
||||||
{
|
{
|
||||||
@@ -609,10 +609,10 @@ class Databox implements ControllerProviderInterface
|
|||||||
/**
|
/**
|
||||||
* Set a new logo for a databox
|
* Set a new logo for a databox
|
||||||
*
|
*
|
||||||
* @param Application $app The silex application
|
* @param Application $app The silex application
|
||||||
* @param Request $request The current HTTP request
|
* @param Request $request The current HTTP request
|
||||||
* @param integer $databox_id The requested databox
|
* @param integer $databox_id The requested databox
|
||||||
* @return RedirectResponse
|
* @return RedirectResponse
|
||||||
*/
|
*/
|
||||||
public function sendLogoPdf(Application $app, Request $request, $databox_id)
|
public function sendLogoPdf(Application $app, Request $request, $databox_id)
|
||||||
{
|
{
|
||||||
@@ -639,10 +639,10 @@ class Databox implements ControllerProviderInterface
|
|||||||
/**
|
/**
|
||||||
* Delete an existing logo for a databox
|
* Delete an existing logo for a databox
|
||||||
*
|
*
|
||||||
* @param Application $app The silex application
|
* @param Application $app The silex application
|
||||||
* @param Request $request The current HTTP request
|
* @param Request $request The current HTTP request
|
||||||
* @param integer $databox_id The requested databox
|
* @param integer $databox_id The requested databox
|
||||||
* @return JsonResponse|RedirectResponse
|
* @return JsonResponse|RedirectResponse
|
||||||
*/
|
*/
|
||||||
public function deleteLogoPdf(Application $app, Request $request, $databox_id)
|
public function deleteLogoPdf(Application $app, Request $request, $databox_id)
|
||||||
{
|
{
|
||||||
@@ -669,10 +669,10 @@ class Databox implements ControllerProviderInterface
|
|||||||
/**
|
/**
|
||||||
* Clear databox logs
|
* Clear databox logs
|
||||||
*
|
*
|
||||||
* @param Application $app The silex application
|
* @param Application $app The silex application
|
||||||
* @param Request $request The current HTTP request
|
* @param Request $request The current HTTP request
|
||||||
* @param integer $databox_id The requested databox
|
* @param integer $databox_id The requested databox
|
||||||
* @return JsonResponse|RedirectResponse
|
* @return JsonResponse|RedirectResponse
|
||||||
*/
|
*/
|
||||||
public function clearLogs(Application $app, Request $request, $databox_id)
|
public function clearLogs(Application $app, Request $request, $databox_id)
|
||||||
{
|
{
|
||||||
@@ -699,10 +699,10 @@ class Databox implements ControllerProviderInterface
|
|||||||
/**
|
/**
|
||||||
* Change the name of a databox
|
* Change the name of a databox
|
||||||
*
|
*
|
||||||
* @param Application $app The silex application
|
* @param Application $app The silex application
|
||||||
* @param Request $request The current HTTP request
|
* @param Request $request The current HTTP request
|
||||||
* @param integer $databox_id The requested databox
|
* @param integer $databox_id The requested databox
|
||||||
* @return JsonResponse|RedirectResponse
|
* @return JsonResponse|RedirectResponse
|
||||||
*/
|
*/
|
||||||
public function changeViewName(Application $app, Request $request, $databox_id)
|
public function changeViewName(Application $app, Request $request, $databox_id)
|
||||||
{
|
{
|
||||||
@@ -733,10 +733,10 @@ class Databox implements ControllerProviderInterface
|
|||||||
/**
|
/**
|
||||||
* Unmount a databox
|
* Unmount a databox
|
||||||
*
|
*
|
||||||
* @param Application $app The silex application
|
* @param Application $app The silex application
|
||||||
* @param Request $request The current HTTP request
|
* @param Request $request The current HTTP request
|
||||||
* @param integer $databox_id The requested databox
|
* @param integer $databox_id The requested databox
|
||||||
* @return JsonResponse|RedirectResponse
|
* @return JsonResponse|RedirectResponse
|
||||||
*/
|
*/
|
||||||
public function unmountDatabase(Application $app, Request $request, $databox_id)
|
public function unmountDatabase(Application $app, Request $request, $databox_id)
|
||||||
{
|
{
|
||||||
@@ -765,10 +765,10 @@ class Databox implements ControllerProviderInterface
|
|||||||
/**
|
/**
|
||||||
* Empty a databox
|
* Empty a databox
|
||||||
*
|
*
|
||||||
* @param Application $app The silex application
|
* @param Application $app The silex application
|
||||||
* @param Request $request The current HTTP request
|
* @param Request $request The current HTTP request
|
||||||
* @param integer $databox_id The requested databox
|
* @param integer $databox_id The requested databox
|
||||||
* @return JsonResponse|RedirectResponse
|
* @return JsonResponse|RedirectResponse
|
||||||
*/
|
*/
|
||||||
public function emptyDatabase(Application $app, Request $request, $databox_id)
|
public function emptyDatabase(Application $app, Request $request, $databox_id)
|
||||||
{
|
{
|
||||||
@@ -808,10 +808,10 @@ class Databox implements ControllerProviderInterface
|
|||||||
/**
|
/**
|
||||||
* Get number of indexed items for a databox
|
* Get number of indexed items for a databox
|
||||||
*
|
*
|
||||||
* @param Application $app The silex application
|
* @param Application $app The silex application
|
||||||
* @param Request $request The current HTTP request
|
* @param Request $request The current HTTP request
|
||||||
* @param integer $databox_id The requested databox
|
* @param integer $databox_id The requested databox
|
||||||
* @return JsonResponse
|
* @return JsonResponse
|
||||||
*/
|
*/
|
||||||
public function progressBarInfos(Application $app, Request $request, $databox_id)
|
public function progressBarInfos(Application $app, Request $request, $databox_id)
|
||||||
{
|
{
|
||||||
@@ -860,10 +860,10 @@ class Databox implements ControllerProviderInterface
|
|||||||
/**
|
/**
|
||||||
* Display page for reaorder collections on a databox
|
* Display page for reaorder collections on a databox
|
||||||
*
|
*
|
||||||
* @param Application $app The silex application
|
* @param Application $app The silex application
|
||||||
* @param Request $request The current HTTP request
|
* @param Request $request The current HTTP request
|
||||||
* @param integer $databox_id The requested databox
|
* @param integer $databox_id The requested databox
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function getReorder(Application $app, Request $request, $databox_id)
|
public function getReorder(Application $app, Request $request, $databox_id)
|
||||||
{
|
{
|
||||||
@@ -875,10 +875,10 @@ class Databox implements ControllerProviderInterface
|
|||||||
/**
|
/**
|
||||||
* Apply collection reorder changes
|
* Apply collection reorder changes
|
||||||
*
|
*
|
||||||
* @param Application $app The silex application
|
* @param Application $app The silex application
|
||||||
* @param Request $request The current HTTP request
|
* @param Request $request The current HTTP request
|
||||||
* @param integer $databox_id The requested databox
|
* @param integer $databox_id The requested databox
|
||||||
* @return JsonResponse|RedirectResponse
|
* @return JsonResponse|RedirectResponse
|
||||||
*/
|
*/
|
||||||
public function setReorder(Application $app, Request $request, $databox_id)
|
public function setReorder(Application $app, Request $request, $databox_id)
|
||||||
{
|
{
|
||||||
@@ -910,10 +910,10 @@ class Databox implements ControllerProviderInterface
|
|||||||
/**
|
/**
|
||||||
* Display page to create a new collection
|
* Display page to create a new collection
|
||||||
*
|
*
|
||||||
* @param Application $app The silex application
|
* @param Application $app The silex application
|
||||||
* @param Request $request The current HTTP request
|
* @param Request $request The current HTTP request
|
||||||
* @param integer $databox_id The requested databox
|
* @param integer $databox_id The requested databox
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function getNewCollection(Application $app, Request $request, $databox_id)
|
public function getNewCollection(Application $app, Request $request, $databox_id)
|
||||||
{
|
{
|
||||||
@@ -923,15 +923,14 @@ class Databox implements ControllerProviderInterface
|
|||||||
/**
|
/**
|
||||||
* Create a new collection
|
* Create a new collection
|
||||||
*
|
*
|
||||||
* @param Application $app The silex application
|
* @param Application $app The silex application
|
||||||
* @param Request $request The current HTTP request
|
* @param Request $request The current HTTP request
|
||||||
* @param integer $databox_id The requested databox
|
* @param integer $databox_id The requested databox
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function createCollection(Application $app, Request $request, $databox_id)
|
public function createCollection(Application $app, Request $request, $databox_id)
|
||||||
{
|
{
|
||||||
if (($name = trim($request->request->get('name', ''))) === '') {
|
if (($name = trim($request->request->get('name', ''))) === '') {
|
||||||
|
|
||||||
return $app->redirect('/admin/databox/' . $databox_id . '/collection/error=name');
|
return $app->redirect('/admin/databox/' . $databox_id . '/collection/error=name');
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -962,10 +961,10 @@ class Databox implements ControllerProviderInterface
|
|||||||
/**
|
/**
|
||||||
* Display page to get some details on a appbox
|
* Display page to get some details on a appbox
|
||||||
*
|
*
|
||||||
* @param Application $app The silex application
|
* @param Application $app The silex application
|
||||||
* @param Request $request The current HTTP request
|
* @param Request $request The current HTTP request
|
||||||
* @param integer $databox_id The requested databox
|
* @param integer $databox_id The requested databox
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function getDetails(Application $app, Request $request, $databox_id)
|
public function getDetails(Application $app, Request $request, $databox_id)
|
||||||
{
|
{
|
||||||
|
@@ -33,7 +33,6 @@ class Databoxes implements ControllerProviderInterface
|
|||||||
$app['firewall']->requireAccessToModule('admin');
|
$app['firewall']->requireAccessToModule('admin');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get Databases control panel
|
* Get Databases control panel
|
||||||
*
|
*
|
||||||
@@ -50,7 +49,6 @@ class Databoxes implements ControllerProviderInterface
|
|||||||
$controllers->get('/', $this->call('getDatabases'))
|
$controllers->get('/', $this->call('getDatabases'))
|
||||||
->bind('admin_databases');
|
->bind('admin_databases');
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create Database
|
* Create Database
|
||||||
*
|
*
|
||||||
@@ -114,9 +112,9 @@ class Databoxes implements ControllerProviderInterface
|
|||||||
/**
|
/**
|
||||||
* Get Databases control panel
|
* Get Databases control panel
|
||||||
*
|
*
|
||||||
* @param $app Application $app
|
* @param $app Application $app
|
||||||
* @param $request Request $request
|
* @param $request Request $request
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function getDatabases(Application $app, Request $request)
|
public function getDatabases(Application $app, Request $request)
|
||||||
{
|
{
|
||||||
@@ -194,10 +192,10 @@ class Databoxes implements ControllerProviderInterface
|
|||||||
/**
|
/**
|
||||||
* Create a new databox
|
* Create a new databox
|
||||||
*
|
*
|
||||||
* @param Application $app The silex application
|
* @param Application $app The silex application
|
||||||
* @param Request $request The current HTTP request
|
* @param Request $request The current HTTP request
|
||||||
* @param integer $databox_id The requested databox
|
* @param integer $databox_id The requested databox
|
||||||
* @return RedirectResponse
|
* @return RedirectResponse
|
||||||
*/
|
*/
|
||||||
public function createDatabase(Application $app, Request $request)
|
public function createDatabase(Application $app, Request $request)
|
||||||
{
|
{
|
||||||
@@ -267,9 +265,9 @@ class Databoxes implements ControllerProviderInterface
|
|||||||
/**
|
/**
|
||||||
* Mount a databox
|
* Mount a databox
|
||||||
*
|
*
|
||||||
* @param Application $app The silex application
|
* @param Application $app The silex application
|
||||||
* @param Request $request The current HTTP request
|
* @param Request $request The current HTTP request
|
||||||
* @return RedirectResponse
|
* @return RedirectResponse
|
||||||
*/
|
*/
|
||||||
public function databaseMount(Application $app, Request $request)
|
public function databaseMount(Application $app, Request $request)
|
||||||
{
|
{
|
||||||
@@ -299,6 +297,7 @@ class Databoxes implements ControllerProviderInterface
|
|||||||
return $app->redirect('/admin/databox/' . $base->get_sbas_id() . '/?success=1&reload-tree=1');
|
return $app->redirect('/admin/databox/' . $base->get_sbas_id() . '/?success=1&reload-tree=1');
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
$app['phraseanet.appbox']->get_connection()->rollBack();
|
$app['phraseanet.appbox']->get_connection()->rollBack();
|
||||||
|
|
||||||
return $app->redirect('/admin/databoxes/?success=0&error=mount-failed');
|
return $app->redirect('/admin/databoxes/?success=0&error=mount-failed');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -328,14 +327,13 @@ class Databoxes implements ControllerProviderInterface
|
|||||||
/**
|
/**
|
||||||
* Upgrade all databases
|
* Upgrade all databases
|
||||||
*
|
*
|
||||||
* @param $app Application $app
|
* @param $app Application $app
|
||||||
* @param $request Request $request
|
* @param $request Request $request
|
||||||
* @return RedirectResponse
|
* @return RedirectResponse
|
||||||
*/
|
*/
|
||||||
public function databasesUpgrade(Application $app, Request $request)
|
public function databasesUpgrade(Application $app, Request $request)
|
||||||
{
|
{
|
||||||
if (\phrasea::is_scheduler_started($app)) {
|
if (\phrasea::is_scheduler_started($app)) {
|
||||||
|
|
||||||
return $app->redirect('/admin/databoxes/?success=0&error=scheduler-started');
|
return $app->redirect('/admin/databoxes/?success=0&error=scheduler-started');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -16,7 +16,6 @@ use PHPExiftool\Driver\TagProvider;
|
|||||||
use Silex\Application;
|
use Silex\Application;
|
||||||
use Silex\ControllerProviderInterface;
|
use Silex\ControllerProviderInterface;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -227,7 +226,6 @@ class Description implements ControllerProviderInterface
|
|||||||
$field = \databox_field::create($app, $databox, $request->request->get('newfield'), $request->request->get('newfield_multi'));
|
$field = \databox_field::create($app, $databox, $request->request->get('newfield'), $request->request->get('newfield_multi'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (is_array($request->request->get('todelete_ids'))) {
|
if (is_array($request->request->get('todelete_ids'))) {
|
||||||
foreach ($request->request->get('todelete_ids') as $id) {
|
foreach ($request->request->get('todelete_ids') as $id) {
|
||||||
try {
|
try {
|
||||||
|
@@ -77,9 +77,9 @@ class Setup implements ControllerProviderInterface
|
|||||||
/**
|
/**
|
||||||
* Display global values
|
* Display global values
|
||||||
*
|
*
|
||||||
* @param Application $app
|
* @param Application $app
|
||||||
* @param Request $request
|
* @param Request $request
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function getGlobals(Application $app, Request $request)
|
public function getGlobals(Application $app, Request $request)
|
||||||
{
|
{
|
||||||
@@ -103,9 +103,9 @@ class Setup implements ControllerProviderInterface
|
|||||||
/**
|
/**
|
||||||
* Submit global values
|
* Submit global values
|
||||||
*
|
*
|
||||||
* @param Application $app
|
* @param Application $app
|
||||||
* @param Request $request
|
* @param Request $request
|
||||||
* @return RedirectResponse
|
* @return RedirectResponse
|
||||||
*/
|
*/
|
||||||
public function postGlobals(Application $app, Request $request)
|
public function postGlobals(Application $app, Request $request)
|
||||||
{
|
{
|
||||||
|
@@ -32,8 +32,6 @@ class TaskManager implements ControllerProviderInterface
|
|||||||
return $app->redirect('/admin/task-manager/tasks/');
|
return $app->redirect('/admin/task-manager/tasks/');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* route /admin/task-manager/tasks/
|
* route /admin/task-manager/tasks/
|
||||||
* tasks status in json
|
* tasks status in json
|
||||||
@@ -43,7 +41,6 @@ class TaskManager implements ControllerProviderInterface
|
|||||||
$controllers->get('/tasks/', function(Application $app, Request $request) {
|
$controllers->get('/tasks/', function(Application $app, Request $request) {
|
||||||
|
|
||||||
if ($request->getContentType() == 'json') {
|
if ($request->getContentType() == 'json') {
|
||||||
|
|
||||||
return $app->json($app['task-manager']->toArray());
|
return $app->json($app['task-manager']->toArray());
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
@@ -126,7 +123,6 @@ class TaskManager implements ControllerProviderInterface
|
|||||||
}, 200, array('Content-Type' => 'text/html'));
|
}, 200, array('Content-Type' => 'text/html'));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
$controllers->get('/task/{id}/log', function(Application $app, Request $request, $id) {
|
$controllers->get('/task/{id}/log', function(Application $app, Request $request, $id) {
|
||||||
$logdir = \p4string::addEndSlash($app['phraseanet.registry']->get('GV_RootPath') . 'logs');
|
$logdir = \p4string::addEndSlash($app['phraseanet.registry']->get('GV_RootPath') . 'logs');
|
||||||
|
|
||||||
@@ -183,6 +179,7 @@ class TaskManager implements ControllerProviderInterface
|
|||||||
/*
|
/*
|
||||||
* todo : add a message back
|
* todo : add a message back
|
||||||
*/
|
*/
|
||||||
|
|
||||||
return $app->redirect('/admin/task-manager/tasks/');
|
return $app->redirect('/admin/task-manager/tasks/');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -246,7 +243,6 @@ class TaskManager implements ControllerProviderInterface
|
|||||||
|
|
||||||
return $app->json(true);
|
return $app->json(true);
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
|
|
||||||
return $app->json(false);
|
return $app->json(false);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -279,7 +275,6 @@ class TaskManager implements ControllerProviderInterface
|
|||||||
|
|
||||||
return $app->json(true);
|
return $app->json(true);
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
|
|
||||||
return new Response(
|
return new Response(
|
||||||
'Bad task ID',
|
'Bad task ID',
|
||||||
404 // Not Found
|
404 // Not Found
|
||||||
@@ -327,6 +322,7 @@ class TaskManager implements ControllerProviderInterface
|
|||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $ret;
|
return $ret;
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -339,6 +335,7 @@ class TaskManager implements ControllerProviderInterface
|
|||||||
$task = $app['task-manager']->getTask($id);
|
$task = $app['task-manager']->getTask($id);
|
||||||
|
|
||||||
$template = 'admin/task.html.twig';
|
$template = 'admin/task.html.twig';
|
||||||
|
|
||||||
return $app['twig']->render($template, array(
|
return $app['twig']->render($template, array(
|
||||||
'task' => $task,
|
'task' => $task,
|
||||||
'view' => 'XML'
|
'view' => 'XML'
|
||||||
@@ -364,6 +361,7 @@ class TaskManager implements ControllerProviderInterface
|
|||||||
412 // Precondition Failed
|
412 // Precondition Failed
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $ret;
|
return $ret;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@@ -350,7 +350,6 @@ class Users implements ControllerProviderInterface
|
|||||||
$models = $stmt->fetchAll(\PDO::FETCH_ASSOC);
|
$models = $stmt->fetchAll(\PDO::FETCH_ASSOC);
|
||||||
$stmt->closeCursor();
|
$stmt->closeCursor();
|
||||||
|
|
||||||
|
|
||||||
$sql = "
|
$sql = "
|
||||||
SELECT demand.date_modif,demand.base_id, usr.usr_id , usr.usr_login ,usr.usr_nom,usr.usr_prenom,
|
SELECT demand.date_modif,demand.base_id, usr.usr_id , usr.usr_login ,usr.usr_nom,usr.usr_prenom,
|
||||||
usr.societe, usr.fonction, usr.usr_mail, usr.tel, usr.activite,
|
usr.societe, usr.fonction, usr.usr_mail, usr.tel, usr.activite,
|
||||||
@@ -434,7 +433,6 @@ class Users implements ControllerProviderInterface
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (count($templates) > 0 || count($deny) > 0 || count($accept) > 0) {
|
if (count($templates) > 0 || count($deny) > 0 || count($accept) > 0) {
|
||||||
$done = array();
|
$done = array();
|
||||||
$cache_to_update = array();
|
$cache_to_update = array();
|
||||||
@@ -448,7 +446,6 @@ class Users implements ControllerProviderInterface
|
|||||||
|
|
||||||
$user->ACL()->apply_model($user_template, $base_ids);
|
$user->ACL()->apply_model($user_template, $base_ids);
|
||||||
|
|
||||||
|
|
||||||
if (!isset($done[$usr])) {
|
if (!isset($done[$usr])) {
|
||||||
$done[$usr] = array();
|
$done[$usr] = array();
|
||||||
}
|
}
|
||||||
@@ -575,7 +572,6 @@ class Users implements ControllerProviderInterface
|
|||||||
$controllers->post('/import/file/', function(Application $app, Request $request) {
|
$controllers->post('/import/file/', function(Application $app, Request $request) {
|
||||||
|
|
||||||
if ((null === $file = $request->files->get('files')) || !$file->isValid()) {
|
if ((null === $file = $request->files->get('files')) || !$file->isValid()) {
|
||||||
|
|
||||||
return $app->redirect('/admin/users/import/file/?error=file-invalid');
|
return $app->redirect('/admin/users/import/file/?error=file-invalid');
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -604,12 +600,10 @@ class Users implements ControllerProviderInterface
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!$loginDefined) {
|
if (!$loginDefined) {
|
||||||
|
|
||||||
return $app->redirect('/admin/users/import/file/?error=row-login');
|
return $app->redirect('/admin/users/import/file/?error=row-login');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$pwdDefined) {
|
if (!$pwdDefined) {
|
||||||
|
|
||||||
return $app->redirect('/admin/users/import/file/?error=row-pwd');
|
return $app->redirect('/admin/users/import/file/?error=row-pwd');
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -667,12 +661,10 @@ class Users implements ControllerProviderInterface
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (count($out['errors']) > 0) {
|
if (count($out['errors']) > 0) {
|
||||||
|
|
||||||
return $app['twig']->render('admin/user/import/file.html.twig', array(
|
return $app['twig']->render('admin/user/import/file.html.twig', array(
|
||||||
'errors' => $out['errors']
|
'errors' => $out['errors']
|
||||||
));
|
));
|
||||||
} else if ($nbUsrToAdd === 0) {
|
} elseif ($nbUsrToAdd === 0) {
|
||||||
|
|
||||||
return $app->redirect('/admin/users/import/file/?error=no-user');
|
return $app->redirect('/admin/users/import/file/?error=no-user');
|
||||||
} else {
|
} else {
|
||||||
for ($i = 1; $i < sizeof($array); $i++) {
|
for ($i = 1; $i < sizeof($array); $i++) {
|
||||||
@@ -905,4 +897,3 @@ class Users implements ControllerProviderInterface
|
|||||||
return $equivalenceToMysqlField;
|
return $equivalenceToMysqlField;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -102,7 +102,6 @@ class Datafiles extends AbstractDelivery
|
|||||||
return $that->deliverContent($app['request'], $record, $subdef, $watermark, $stamp, $app);
|
return $that->deliverContent($app['request'], $record, $subdef, $watermark, $stamp, $app);
|
||||||
})->assert('sbas_id', '\d+')->assert('record_id', '\d+');
|
})->assert('sbas_id', '\d+')->assert('record_id', '\d+');
|
||||||
|
|
||||||
|
|
||||||
return $controllers;
|
return $controllers;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -122,9 +122,9 @@ class Bridge implements ControllerProviderInterface
|
|||||||
|
|
||||||
$account->delete();
|
$account->delete();
|
||||||
$success = true;
|
$success = true;
|
||||||
} catch(\Bridge_Exception_AccountNotFound $e) {
|
} catch (\Bridge_Exception_AccountNotFound $e) {
|
||||||
$message = _('Account is not found.');
|
$message = _('Account is not found.');
|
||||||
} catch(\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
$message = _('Something went wrong, please contact an administrator');
|
$message = _('Something went wrong, please contact an administrator');
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -320,7 +320,6 @@ class Bridge implements ControllerProviderInterface
|
|||||||
|
|
||||||
$account->get_api()->create_container($container_type, $app['request']);
|
$account->get_api()->create_container($container_type, $app['request']);
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
|
|
||||||
return $app->redirect('/prod/bridge/action/' . $account_id . '/' . $action . '/' . $element_type . '/?error=' . get_class($e) . ' : ' . $e->getMessage());
|
return $app->redirect('/prod/bridge/action/' . $account_id . '/' . $action . '/' . $element_type . '/?error=' . get_class($e) . ' : ' . $e->getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -77,16 +77,15 @@ class DoDownload implements ControllerProviderInterface
|
|||||||
->bind('execute_download')
|
->bind('execute_download')
|
||||||
->assert('token', '[a-zA-Z0-9]{8,16}');
|
->assert('token', '[a-zA-Z0-9]{8,16}');
|
||||||
|
|
||||||
|
|
||||||
return $controllers;
|
return $controllers;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Prepare a set of documents for download
|
* Prepare a set of documents for download
|
||||||
*
|
*
|
||||||
* @param Application $app
|
* @param Application $app
|
||||||
* @param Request $request
|
* @param Request $request
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function prepareDownload(Application $app, Request $request, $token)
|
public function prepareDownload(Application $app, Request $request, $token)
|
||||||
{
|
{
|
||||||
@@ -96,21 +95,21 @@ class DoDownload implements ControllerProviderInterface
|
|||||||
$app->abort(404, 'Invalid token');
|
$app->abort(404, 'Invalid token');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (false === $list = @unserialize((string)$datas['datas'])) {
|
if (false === $list = @unserialize((string) $datas['datas'])) {
|
||||||
$app->abort(500, 'Invalid datas');
|
$app->abort(500, 'Invalid datas');
|
||||||
}
|
}
|
||||||
|
|
||||||
$records = array();
|
$records = array();
|
||||||
|
|
||||||
foreach($list['files'] as $file) {
|
foreach ($list['files'] as $file) {
|
||||||
if(!is_array($file) || !isset($file['base_id']) || !isset($file['record_id'])) {
|
if (!is_array($file) || !isset($file['base_id']) || !isset($file['record_id'])) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
$sbasId = \phrasea::sbasFromBas($app, $file['base_id']);
|
$sbasId = \phrasea::sbasFromBas($app, $file['base_id']);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$record = new \record_adapter($app, $sbasId, $file['record_id']);
|
$record = new \record_adapter($app, $sbasId, $file['record_id']);
|
||||||
} catch (\Exception $e){
|
} catch (\Exception $e) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -131,9 +130,9 @@ class DoDownload implements ControllerProviderInterface
|
|||||||
/**
|
/**
|
||||||
* Download a set of documents
|
* Download a set of documents
|
||||||
*
|
*
|
||||||
* @param Application $app
|
* @param Application $app
|
||||||
* @param Request $request
|
* @param Request $request
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function downloadDocuments(Application $app, Request $request, $token)
|
public function downloadDocuments(Application $app, Request $request, $token)
|
||||||
{
|
{
|
||||||
@@ -149,7 +148,7 @@ class DoDownload implements ControllerProviderInterface
|
|||||||
|
|
||||||
$exportName = $list['export_name'];
|
$exportName = $list['export_name'];
|
||||||
|
|
||||||
if($list['count'] === 1) {
|
if ($list['count'] === 1) {
|
||||||
$file = end($list['files']);
|
$file = end($list['files']);
|
||||||
$subdef = end($file['subdefs']);
|
$subdef = end($file['subdefs']);
|
||||||
$exportName = sprintf('%s%s.%s', $file['export_name'], $subdef['ajout'], $subdef['exportExt']);
|
$exportName = sprintf('%s%s.%s', $file['export_name'], $subdef['ajout'], $subdef['exportExt']);
|
||||||
@@ -161,7 +160,7 @@ class DoDownload implements ControllerProviderInterface
|
|||||||
$mime = 'application/zip';
|
$mime = 'application/zip';
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!$app['filesystem']->exists($exportFile)) {
|
if (!$app['filesystem']->exists($exportFile)) {
|
||||||
$app->abort(404, 'Download file not found');
|
$app->abort(404, 'Download file not found');
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -186,13 +185,12 @@ class DoDownload implements ControllerProviderInterface
|
|||||||
return $response;
|
return $response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Build a zip of downloaded documents
|
* Build a zip of downloaded documents
|
||||||
*
|
*
|
||||||
* @param Application $app
|
* @param Application $app
|
||||||
* @param Request $request
|
* @param Request $request
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function downloadExecute(Application $app, Request $request, $token)
|
public function downloadExecute(Application $app, Request $request, $token)
|
||||||
{
|
{
|
||||||
|
@@ -52,9 +52,9 @@ class Download implements ControllerProviderInterface
|
|||||||
/**
|
/**
|
||||||
* Download a set of documents
|
* Download a set of documents
|
||||||
*
|
*
|
||||||
* @param Application $app
|
* @param Application $app
|
||||||
* @param Request $request
|
* @param Request $request
|
||||||
* @return RedirectResponse
|
* @return RedirectResponse
|
||||||
*/
|
*/
|
||||||
public function checkDownload(Application $app, Request $request)
|
public function checkDownload(Application $app, Request $request)
|
||||||
{
|
{
|
||||||
@@ -64,7 +64,7 @@ class Download implements ControllerProviderInterface
|
|||||||
|
|
||||||
$download = new \set_export($app, $lst, $ssttid);
|
$download = new \set_export($app, $lst, $ssttid);
|
||||||
|
|
||||||
if(0 === $download->get_total_download()) {
|
if (0 === $download->get_total_download()) {
|
||||||
$app->abort(403);
|
$app->abort(403);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -85,7 +85,6 @@ class Edit implements ControllerProviderInterface
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* generate javascript sugg values
|
* generate javascript sugg values
|
||||||
*/
|
*/
|
||||||
@@ -117,7 +116,6 @@ class Edit implements ControllerProviderInterface
|
|||||||
unset($collection);
|
unset($collection);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* generate javascript status
|
* generate javascript status
|
||||||
*/
|
*/
|
||||||
@@ -402,8 +400,6 @@ class Edit implements ControllerProviderInterface
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return $app['twig']->render('prod/actions/edit_default.html.twig', array('edit' => $editing, 'message' => ''));
|
return $app['twig']->render('prod/actions/edit_default.html.twig', array('edit' => $editing, 'message' => ''));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@@ -106,9 +106,9 @@ class Export implements ControllerProviderInterface
|
|||||||
/**
|
/**
|
||||||
* Display form to export documents
|
* Display form to export documents
|
||||||
*
|
*
|
||||||
* @param Application $app
|
* @param Application $app
|
||||||
* @param Request $request
|
* @param Request $request
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function displayMultiExport(Application $app, Request $request)
|
public function displayMultiExport(Application $app, Request $request)
|
||||||
{
|
{
|
||||||
@@ -131,9 +131,9 @@ class Export implements ControllerProviderInterface
|
|||||||
/**
|
/**
|
||||||
* Test a FTP connexion
|
* Test a FTP connexion
|
||||||
*
|
*
|
||||||
* @param Application $app
|
* @param Application $app
|
||||||
* @param Request $request
|
* @param Request $request
|
||||||
* @return JsonResponse
|
* @return JsonResponse
|
||||||
*/
|
*/
|
||||||
public function testFtpConnexion(Application $app, Request $request)
|
public function testFtpConnexion(Application $app, Request $request)
|
||||||
{
|
{
|
||||||
@@ -160,9 +160,9 @@ class Export implements ControllerProviderInterface
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param Application $app
|
* @param Application $app
|
||||||
* @param Request $request
|
* @param Request $request
|
||||||
* @return JsonResponse
|
* @return JsonResponse
|
||||||
*/
|
*/
|
||||||
public function exportFtp(Application $app, Request $request)
|
public function exportFtp(Application $app, Request $request)
|
||||||
{
|
{
|
||||||
@@ -210,7 +210,6 @@ class Export implements ControllerProviderInterface
|
|||||||
'message' => _('Export saved in the waiting queue')
|
'message' => _('Export saved in the waiting queue')
|
||||||
));
|
));
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
|
|
||||||
return $app->json(array(
|
return $app->json(array(
|
||||||
'success' => false,
|
'success' => false,
|
||||||
'message' => _('Something went wrong')
|
'message' => _('Something went wrong')
|
||||||
@@ -221,8 +220,8 @@ class Export implements ControllerProviderInterface
|
|||||||
/**
|
/**
|
||||||
* Export document by mail
|
* Export document by mail
|
||||||
*
|
*
|
||||||
* @param Application $app
|
* @param Application $app
|
||||||
* @param Request $request
|
* @param Request $request
|
||||||
* @return JsonResponse
|
* @return JsonResponse
|
||||||
*/
|
*/
|
||||||
public function exportMail(Application $app, Request $request)
|
public function exportMail(Application $app, Request $request)
|
||||||
|
@@ -401,7 +401,7 @@ class Lazaret implements ControllerProviderInterface
|
|||||||
* Empty lazaret
|
* Empty lazaret
|
||||||
*
|
*
|
||||||
* @param Application $app
|
* @param Application $app
|
||||||
* @param Request $request
|
* @param Request $request
|
||||||
*
|
*
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
@@ -516,7 +516,6 @@ class Lazaret implements ControllerProviderInterface
|
|||||||
|
|
||||||
/* @var $lazaretFile \Entities\LazaretFile */
|
/* @var $lazaretFile \Entities\LazaretFile */
|
||||||
if (null === $lazaretFile) {
|
if (null === $lazaretFile) {
|
||||||
|
|
||||||
return new Response(null, 404);
|
return new Response(null, 404);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -72,11 +72,13 @@ class MoveCollection implements ControllerProviderInterface
|
|||||||
try {
|
try {
|
||||||
if (null === $request->request->get('base_id')) {
|
if (null === $request->request->get('base_id')) {
|
||||||
$datas['message'] = _('Missing target collection');
|
$datas['message'] = _('Missing target collection');
|
||||||
|
|
||||||
return $app->json($datas);
|
return $app->json($datas);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$app['phraseanet.user']->ACL()->has_right_on_base($request->request->get('base_id'), 'canaddrecord')) {
|
if (!$app['phraseanet.user']->ACL()->has_right_on_base($request->request->get('base_id'), 'canaddrecord')) {
|
||||||
$datas['message'] = sprintf(_("You do not have the permission to move records to %s"), \phrasea::bas_names($move->getBaseIdDestination(), $app));
|
$datas['message'] = sprintf(_("You do not have the permission to move records to %s"), \phrasea::bas_names($move->getBaseIdDestination(), $app));
|
||||||
|
|
||||||
return $app->json($datas);
|
return $app->json($datas);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -84,6 +86,7 @@ class MoveCollection implements ControllerProviderInterface
|
|||||||
$collection = \collection::get_from_base_id($app, $request->request->get('base_id'));
|
$collection = \collection::get_from_base_id($app, $request->request->get('base_id'));
|
||||||
} catch (\Exception_Databox_CollectionNotFound $e) {
|
} catch (\Exception_Databox_CollectionNotFound $e) {
|
||||||
$datas['message'] = _('Invalid target collection');
|
$datas['message'] = _('Invalid target collection');
|
||||||
|
|
||||||
return $app->json($datas);
|
return $app->json($datas);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -141,10 +141,10 @@ class Order implements ControllerProviderInterface
|
|||||||
/**
|
/**
|
||||||
* Create a new order
|
* Create a new order
|
||||||
*
|
*
|
||||||
* @param Application $app
|
* @param Application $app
|
||||||
* @param Request $request
|
* @param Request $request
|
||||||
* @param integer $order_id
|
* @param integer $order_id
|
||||||
* @return RedirectResponse|JsonResponse
|
* @return RedirectResponse|JsonResponse
|
||||||
*/
|
*/
|
||||||
public function createOrder(Application $app, Request $request)
|
public function createOrder(Application $app, Request $request)
|
||||||
{
|
{
|
||||||
@@ -203,7 +203,6 @@ class Order implements ControllerProviderInterface
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ('json' === $app['request']->getRequestFormat()) {
|
if ('json' === $app['request']->getRequestFormat()) {
|
||||||
|
|
||||||
return $app->json(array(
|
return $app->json(array(
|
||||||
'success' => $success,
|
'success' => $success,
|
||||||
'msg' => $msg,
|
'msg' => $msg,
|
||||||
@@ -219,10 +218,10 @@ class Order implements ControllerProviderInterface
|
|||||||
/**
|
/**
|
||||||
* Display list of orders
|
* Display list of orders
|
||||||
*
|
*
|
||||||
* @param Application $app
|
* @param Application $app
|
||||||
* @param Request $request
|
* @param Request $request
|
||||||
* @param integer $order_id
|
* @param integer $order_id
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function displayOrders(Application $app, Request $request)
|
public function displayOrders(Application $app, Request $request)
|
||||||
{
|
{
|
||||||
@@ -249,10 +248,10 @@ class Order implements ControllerProviderInterface
|
|||||||
/**
|
/**
|
||||||
* Display a single order identified by its id
|
* Display a single order identified by its id
|
||||||
*
|
*
|
||||||
* @param Application $app
|
* @param Application $app
|
||||||
* @param Request $request
|
* @param Request $request
|
||||||
* @param integer $order_id
|
* @param integer $order_id
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function displayOneOrder(Application $app, Request $request, $order_id)
|
public function displayOneOrder(Application $app, Request $request, $order_id)
|
||||||
{
|
{
|
||||||
@@ -270,10 +269,10 @@ class Order implements ControllerProviderInterface
|
|||||||
/**
|
/**
|
||||||
* Send an order
|
* Send an order
|
||||||
*
|
*
|
||||||
* @param Application $app
|
* @param Application $app
|
||||||
* @param Request $request
|
* @param Request $request
|
||||||
* @param integer $order_id
|
* @param integer $order_id
|
||||||
* @return RedirectResponse|JsonResponse
|
* @return RedirectResponse|JsonResponse
|
||||||
*/
|
*/
|
||||||
public function sendOrder(Application $app, Request $request, $order_id)
|
public function sendOrder(Application $app, Request $request, $order_id)
|
||||||
{
|
{
|
||||||
@@ -293,7 +292,6 @@ class Order implements ControllerProviderInterface
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ('json' === $app['request']->getRequestFormat()) {
|
if ('json' === $app['request']->getRequestFormat()) {
|
||||||
|
|
||||||
return $app->json(array(
|
return $app->json(array(
|
||||||
'success' => $success,
|
'success' => $success,
|
||||||
'msg' => $success ? _('Order has been sent') : _('An error occured while sending, please retry or contact an admin if problem persists'),
|
'msg' => $success ? _('Order has been sent') : _('An error occured while sending, please retry or contact an admin if problem persists'),
|
||||||
@@ -310,10 +308,10 @@ class Order implements ControllerProviderInterface
|
|||||||
/**
|
/**
|
||||||
* Deny an order
|
* Deny an order
|
||||||
*
|
*
|
||||||
* @param Application $app
|
* @param Application $app
|
||||||
* @param Request $request
|
* @param Request $request
|
||||||
* @param integer $order_id
|
* @param integer $order_id
|
||||||
* @return RedirectResponse|JsonResponse
|
* @return RedirectResponse|JsonResponse
|
||||||
*/
|
*/
|
||||||
public function denyOrder(Application $app, Request $request, $order_id)
|
public function denyOrder(Application $app, Request $request, $order_id)
|
||||||
{
|
{
|
||||||
@@ -333,7 +331,6 @@ class Order implements ControllerProviderInterface
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ('json' === $app['request']->getRequestFormat()) {
|
if ('json' === $app['request']->getRequestFormat()) {
|
||||||
|
|
||||||
return $app->json(array(
|
return $app->json(array(
|
||||||
'success' => $success,
|
'success' => $success,
|
||||||
'msg' => $success ? _('Order has been denied') : _('An error occured while denying, please retry or contact an admin if problem persists'),
|
'msg' => $success ? _('Order has been denied') : _('An error occured while denying, please retry or contact an admin if problem persists'),
|
||||||
|
@@ -102,9 +102,9 @@ class Property implements ControllerProviderInterface
|
|||||||
/**
|
/**
|
||||||
* Display Status property
|
* Display Status property
|
||||||
*
|
*
|
||||||
* @param Application $app
|
* @param Application $app
|
||||||
* @param Request $request
|
* @param Request $request
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function displayStatusProperty(Application $app, Request $request)
|
public function displayStatusProperty(Application $app, Request $request)
|
||||||
{
|
{
|
||||||
@@ -162,9 +162,9 @@ class Property implements ControllerProviderInterface
|
|||||||
/**
|
/**
|
||||||
* Display type property
|
* Display type property
|
||||||
*
|
*
|
||||||
* @param Application $app
|
* @param Application $app
|
||||||
* @param Request $request
|
* @param Request $request
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function displayTypeProperty(Application $app, Request $request)
|
public function displayTypeProperty(Application $app, Request $request)
|
||||||
{
|
{
|
||||||
@@ -200,9 +200,9 @@ class Property implements ControllerProviderInterface
|
|||||||
/**
|
/**
|
||||||
* Change record status
|
* Change record status
|
||||||
*
|
*
|
||||||
* @param Application $app
|
* @param Application $app
|
||||||
* @param Request $request
|
* @param Request $request
|
||||||
* @return JsonResponse
|
* @return JsonResponse
|
||||||
*/
|
*/
|
||||||
public function changeStatus(Application $app, Request $request)
|
public function changeStatus(Application $app, Request $request)
|
||||||
{
|
{
|
||||||
@@ -235,8 +235,8 @@ class Property implements ControllerProviderInterface
|
|||||||
/**
|
/**
|
||||||
* Change record type
|
* Change record type
|
||||||
*
|
*
|
||||||
* @param Application $app
|
* @param Application $app
|
||||||
* @param Request $request
|
* @param Request $request
|
||||||
* @return type
|
* @return type
|
||||||
*/
|
*/
|
||||||
public function changeType(Application $app, Request $request)
|
public function changeType(Application $app, Request $request)
|
||||||
@@ -265,9 +265,9 @@ class Property implements ControllerProviderInterface
|
|||||||
/**
|
/**
|
||||||
* Set new status to selected record
|
* Set new status to selected record
|
||||||
*
|
*
|
||||||
* @param \record_adapter $record
|
* @param \record_adapter $record
|
||||||
* @param array $postStatus
|
* @param array $postStatus
|
||||||
* @return array|null
|
* @return array|null
|
||||||
*/
|
*/
|
||||||
private function updateRecordStatus(\record_adapter $record, Array $postStatus)
|
private function updateRecordStatus(\record_adapter $record, Array $postStatus)
|
||||||
{
|
{
|
||||||
|
@@ -88,9 +88,9 @@ class Query implements ControllerProviderInterface
|
|||||||
/**
|
/**
|
||||||
* Query Phraseanet to fetch records
|
* Query Phraseanet to fetch records
|
||||||
*
|
*
|
||||||
* @param Application $app
|
* @param Application $app
|
||||||
* @param Request $request
|
* @param Request $request
|
||||||
* @return JsonResponse
|
* @return JsonResponse
|
||||||
*/
|
*/
|
||||||
public function query(Application $app, Request $request)
|
public function query(Application $app, Request $request)
|
||||||
{
|
{
|
||||||
@@ -244,9 +244,9 @@ class Query implements ControllerProviderInterface
|
|||||||
/**
|
/**
|
||||||
* Get a preview answer train
|
* Get a preview answer train
|
||||||
*
|
*
|
||||||
* @param Application $app
|
* @param Application $app
|
||||||
* @param Request $request
|
* @param Request $request
|
||||||
* @return JsonResponse
|
* @return JsonResponse
|
||||||
*/
|
*/
|
||||||
public function queryAnswerTrain(Application $app, Request $request)
|
public function queryAnswerTrain(Application $app, Request $request)
|
||||||
{
|
{
|
||||||
@@ -277,9 +277,9 @@ class Query implements ControllerProviderInterface
|
|||||||
/**
|
/**
|
||||||
* Get a preview reg train
|
* Get a preview reg train
|
||||||
*
|
*
|
||||||
* @param Application $app
|
* @param Application $app
|
||||||
* @param Request $request
|
* @param Request $request
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function queryRegTrain(Application $app, Request $request)
|
public function queryRegTrain(Application $app, Request $request)
|
||||||
{
|
{
|
||||||
|
@@ -103,15 +103,15 @@ class Records implements ControllerProviderInterface
|
|||||||
/**
|
/**
|
||||||
* Get record detailed view
|
* Get record detailed view
|
||||||
*
|
*
|
||||||
* @param Application $app
|
* @param Application $app
|
||||||
* @param Request $request
|
* @param Request $request
|
||||||
* @param integer $sbas_id
|
* @param integer $sbas_id
|
||||||
* @param integer $record_id
|
* @param integer $record_id
|
||||||
* @return JsonResponse
|
* @return JsonResponse
|
||||||
*/
|
*/
|
||||||
public function getRecord(Application $app, Request $request)
|
public function getRecord(Application $app, Request $request)
|
||||||
{
|
{
|
||||||
if(!$request->isXmlHttpRequest()){
|
if (!$request->isXmlHttpRequest()) {
|
||||||
$app->abort(400);
|
$app->abort(400);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -195,9 +195,9 @@ class Records implements ControllerProviderInterface
|
|||||||
/**
|
/**
|
||||||
* Delete a record or a list of records
|
* Delete a record or a list of records
|
||||||
*
|
*
|
||||||
* @param Application $app
|
* @param Application $app
|
||||||
* @param Request $request
|
* @param Request $request
|
||||||
* @return JsonResponse
|
* @return JsonResponse
|
||||||
*/
|
*/
|
||||||
public function doDeleteRecords(Application $app, Request $request)
|
public function doDeleteRecords(Application $app, Request $request)
|
||||||
{
|
{
|
||||||
@@ -240,9 +240,9 @@ class Records implements ControllerProviderInterface
|
|||||||
/**
|
/**
|
||||||
* Delete a record or a list of records
|
* Delete a record or a list of records
|
||||||
*
|
*
|
||||||
* @param Application $app
|
* @param Application $app
|
||||||
* @param Request $request
|
* @param Request $request
|
||||||
* @return JsonResponse
|
* @return JsonResponse
|
||||||
*/
|
*/
|
||||||
public function whatCanIDelete(Application $app, Request $request)
|
public function whatCanIDelete(Application $app, Request $request)
|
||||||
{
|
{
|
||||||
@@ -258,11 +258,11 @@ class Records implements ControllerProviderInterface
|
|||||||
/**
|
/**
|
||||||
* Renew url list of records
|
* Renew url list of records
|
||||||
*
|
*
|
||||||
* @param Application $app
|
* @param Application $app
|
||||||
* @param Request $request
|
* @param Request $request
|
||||||
* @param integer $databox_id
|
* @param integer $databox_id
|
||||||
* @param integer $record_id
|
* @param integer $record_id
|
||||||
* @return JsonResponse
|
* @return JsonResponse
|
||||||
*/
|
*/
|
||||||
public function renewUrl(Application $app, Request $request)
|
public function renewUrl(Application $app, Request $request)
|
||||||
{
|
{
|
||||||
|
@@ -55,11 +55,11 @@ class Share implements ControllerProviderInterface
|
|||||||
/**
|
/**
|
||||||
* Share a record
|
* Share a record
|
||||||
*
|
*
|
||||||
* @param Application $app
|
* @param Application $app
|
||||||
* @param Request $request
|
* @param Request $request
|
||||||
* @param integer $base_id
|
* @param integer $base_id
|
||||||
* @param integer $record_id
|
* @param integer $record_id
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function shareRecord(Application $app, Request $request, $base_id, $record_id)
|
public function shareRecord(Application $app, Request $request, $base_id, $record_id)
|
||||||
{
|
{
|
||||||
|
@@ -70,9 +70,9 @@ class TOU implements ControllerProviderInterface
|
|||||||
/**
|
/**
|
||||||
* Deny database terms of use
|
* Deny database terms of use
|
||||||
*
|
*
|
||||||
* @param Application $app
|
* @param Application $app
|
||||||
* @param Request $request
|
* @param Request $request
|
||||||
* @param integer $sbas_id
|
* @param integer $sbas_id
|
||||||
* @return JsonResponse
|
* @return JsonResponse
|
||||||
*/
|
*/
|
||||||
public function denyTermsOfUse(Application $app, Request $request, $sbas_id)
|
public function denyTermsOfUse(Application $app, Request $request, $sbas_id)
|
||||||
@@ -100,9 +100,9 @@ class TOU implements ControllerProviderInterface
|
|||||||
/**
|
/**
|
||||||
* Display database terms of use
|
* Display database terms of use
|
||||||
*
|
*
|
||||||
* @param Application $app
|
* @param Application $app
|
||||||
* @param Request $request
|
* @param Request $request
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function displayTermsOfUse(Application $app, Request $request)
|
public function displayTermsOfUse(Application $app, Request $request)
|
||||||
{
|
{
|
||||||
|
@@ -129,7 +129,6 @@ class Tools implements ControllerProviderInterface
|
|||||||
$tempoFile = $tempoFile . DIRECTORY_SEPARATOR . $fileName;
|
$tempoFile = $tempoFile . DIRECTORY_SEPARATOR . $fileName;
|
||||||
copy($file->getPathname(), $tempoFile);
|
copy($file->getPathname(), $tempoFile);
|
||||||
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$record = new \record_adapter(
|
$record = new \record_adapter(
|
||||||
$app,
|
$app,
|
||||||
|
@@ -136,7 +136,7 @@ class Tooltip implements ControllerProviderInterface
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
$document = $record->get_subdef('document');
|
$document = $record->get_subdef('document');
|
||||||
} catch(\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
$document = null;
|
$document = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -293,7 +293,7 @@ class Upload implements ControllerProviderInterface
|
|||||||
/**
|
/**
|
||||||
* Get current user's granted collections where he can upload
|
* Get current user's granted collections where he can upload
|
||||||
*
|
*
|
||||||
* @param \User_Adapter $user
|
* @param \User_Adapter $user
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
private function getGrantedCollections(\User_Adapter $user)
|
private function getGrantedCollections(\User_Adapter $user)
|
||||||
|
@@ -26,10 +26,10 @@ class RecordsRequest extends ArrayCollection
|
|||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @param array $elements
|
* @param array $elements
|
||||||
* @param ArrayCollection $received
|
* @param ArrayCollection $received
|
||||||
* @param Basket $basket
|
* @param Basket $basket
|
||||||
* @param Boolean $flatten
|
* @param Boolean $flatten
|
||||||
*/
|
*/
|
||||||
public function __construct(array $elements, ArrayCollection $received, Basket $basket = null, $flatten = false)
|
public function __construct(array $elements, ArrayCollection $received, Basket $basket = null, $flatten = false)
|
||||||
{
|
{
|
||||||
@@ -184,11 +184,11 @@ class RecordsRequest extends ArrayCollection
|
|||||||
/**
|
/**
|
||||||
* Create a new RecordRequest from current request
|
* Create a new RecordRequest from current request
|
||||||
*
|
*
|
||||||
* @param Application $app
|
* @param Application $app
|
||||||
* @param Request $request
|
* @param Request $request
|
||||||
* @param boolean $flattenStories
|
* @param boolean $flattenStories
|
||||||
* @param array $rightsColl
|
* @param array $rightsColl
|
||||||
* @param array $rightsDatabox
|
* @param array $rightsDatabox
|
||||||
* @return RecordsRequest
|
* @return RecordsRequest
|
||||||
*/
|
*/
|
||||||
public static function fromRequest(Application $app, Request $request, $flattenStories = false, array $rightsColl = array(), array $rightsDatabox = array())
|
public static function fromRequest(Application $app, Request $request, $flattenStories = false, array $rightsColl = array(), array $rightsDatabox = array())
|
||||||
|
@@ -227,9 +227,9 @@ class Account implements ControllerProviderInterface
|
|||||||
/**
|
/**
|
||||||
* Reset Password
|
* Reset Password
|
||||||
*
|
*
|
||||||
* @param Application $app
|
* @param Application $app
|
||||||
* @param Request $request
|
* @param Request $request
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function resetPassword(Application $app, Request $request)
|
public function resetPassword(Application $app, Request $request)
|
||||||
{
|
{
|
||||||
@@ -255,9 +255,9 @@ class Account implements ControllerProviderInterface
|
|||||||
/**
|
/**
|
||||||
* Reset Email
|
* Reset Email
|
||||||
*
|
*
|
||||||
* @param Application $app
|
* @param Application $app
|
||||||
* @param Request $request
|
* @param Request $request
|
||||||
* @return RedirectResponse
|
* @return RedirectResponse
|
||||||
*/
|
*/
|
||||||
public function resetEmail(Application $app, Request $request)
|
public function resetEmail(Application $app, Request $request)
|
||||||
{
|
{
|
||||||
@@ -270,7 +270,6 @@ class Account implements ControllerProviderInterface
|
|||||||
|
|
||||||
return $app->redirect('/account/reset-email/?update=ok');
|
return $app->redirect('/account/reset-email/?update=ok');
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
|
|
||||||
return $app->redirect('/account/reset-email/?update=ko');
|
return $app->redirect('/account/reset-email/?update=ko');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -316,9 +315,9 @@ class Account implements ControllerProviderInterface
|
|||||||
/**
|
/**
|
||||||
* Display reset email form
|
* Display reset email form
|
||||||
*
|
*
|
||||||
* @param Application $app
|
* @param Application $app
|
||||||
* @param Request $request
|
* @param Request $request
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function displayResetEmailForm(Application $app, Request $request)
|
public function displayResetEmailForm(Application $app, Request $request)
|
||||||
{
|
{
|
||||||
@@ -362,9 +361,9 @@ class Account implements ControllerProviderInterface
|
|||||||
/**
|
/**
|
||||||
* Submit the new password
|
* Submit the new password
|
||||||
*
|
*
|
||||||
* @param Application $app A Silex application where the controller is mounted on
|
* @param Application $app A Silex application where the controller is mounted on
|
||||||
* @param Request $request The current request
|
* @param Request $request The current request
|
||||||
* @return RedirectResponse
|
* @return RedirectResponse
|
||||||
*/
|
*/
|
||||||
public function renewPassword(Application $app, Request $request)
|
public function renewPassword(Application $app, Request $request)
|
||||||
{
|
{
|
||||||
@@ -393,9 +392,9 @@ class Account implements ControllerProviderInterface
|
|||||||
/**
|
/**
|
||||||
* Display authorized applications that can access user informations
|
* Display authorized applications that can access user informations
|
||||||
*
|
*
|
||||||
* @param Application $app A Silex application where the controller is mounted on
|
* @param Application $app A Silex application where the controller is mounted on
|
||||||
* @param Request $request The current request
|
* @param Request $request The current request
|
||||||
* @return JsonResponse
|
* @return JsonResponse
|
||||||
*/
|
*/
|
||||||
public function grantAccess(Application $app, Request $request, $application_id)
|
public function grantAccess(Application $app, Request $request, $application_id)
|
||||||
{
|
{
|
||||||
@@ -423,9 +422,9 @@ class Account implements ControllerProviderInterface
|
|||||||
/**
|
/**
|
||||||
* Display account base access
|
* Display account base access
|
||||||
*
|
*
|
||||||
* @param Application $app A Silex application where the controller is mounted on
|
* @param Application $app A Silex application where the controller is mounted on
|
||||||
* @param Request $request The current request
|
* @param Request $request The current request
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function accountAccess(Application $app, Request $request)
|
public function accountAccess(Application $app, Request $request)
|
||||||
{
|
{
|
||||||
@@ -439,9 +438,9 @@ class Account implements ControllerProviderInterface
|
|||||||
/**
|
/**
|
||||||
* Display authorized applications that can access user informations
|
* Display authorized applications that can access user informations
|
||||||
*
|
*
|
||||||
* @param Application $app A Silex application where the controller is mounted on
|
* @param Application $app A Silex application where the controller is mounted on
|
||||||
* @param Request $request The current request
|
* @param Request $request The current request
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function accountAuthorizedApps(Application $app, Request $request)
|
public function accountAuthorizedApps(Application $app, Request $request)
|
||||||
{
|
{
|
||||||
@@ -453,9 +452,9 @@ class Account implements ControllerProviderInterface
|
|||||||
/**
|
/**
|
||||||
* Display account session accesss
|
* Display account session accesss
|
||||||
*
|
*
|
||||||
* @param Application $app A Silex application where the controller is mounted on
|
* @param Application $app A Silex application where the controller is mounted on
|
||||||
* @param Request $request The current request
|
* @param Request $request The current request
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function accountSessionsAccess(Application $app, Request $request)
|
public function accountSessionsAccess(Application $app, Request $request)
|
||||||
{
|
{
|
||||||
@@ -473,9 +472,9 @@ class Account implements ControllerProviderInterface
|
|||||||
/**
|
/**
|
||||||
* Display account form
|
* Display account form
|
||||||
*
|
*
|
||||||
* @param Application $app A Silex application where the controller is mounted on
|
* @param Application $app A Silex application where the controller is mounted on
|
||||||
* @param Request $request The current request
|
* @param Request $request The current request
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function displayAccount(Application $app, Request $request)
|
public function displayAccount(Application $app, Request $request)
|
||||||
{
|
{
|
||||||
@@ -508,8 +507,8 @@ class Account implements ControllerProviderInterface
|
|||||||
/**
|
/**
|
||||||
* Update account informations
|
* Update account informations
|
||||||
*
|
*
|
||||||
* @param Application $app A Silex application where the controller is mounted on
|
* @param Application $app A Silex application where the controller is mounted on
|
||||||
* @param Request $request The current request
|
* @param Request $request The current request
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function updateAccount(Application $app, Request $request)
|
public function updateAccount(Application $app, Request $request)
|
||||||
|
@@ -49,8 +49,6 @@ class Developers implements ControllerProviderInterface
|
|||||||
$controllers->get('/applications/', $this->call('listApps'))
|
$controllers->get('/applications/', $this->call('listApps'))
|
||||||
->bind('developers_applications');
|
->bind('developers_applications');
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the form to create a new application
|
* Get the form to create a new application
|
||||||
*
|
*
|
||||||
@@ -83,7 +81,6 @@ class Developers implements ControllerProviderInterface
|
|||||||
$controllers->post('/application/', $this->call('newApp'))
|
$controllers->post('/application/', $this->call('newApp'))
|
||||||
->bind('submit_developers_application');
|
->bind('submit_developers_application');
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get application information
|
* Get application information
|
||||||
*
|
*
|
||||||
@@ -176,10 +173,10 @@ class Developers implements ControllerProviderInterface
|
|||||||
/**
|
/**
|
||||||
* Delete application
|
* Delete application
|
||||||
*
|
*
|
||||||
* @param Application $app A Silex application where the controller is mounted on
|
* @param Application $app A Silex application where the controller is mounted on
|
||||||
* @param Request $request The current request
|
* @param Request $request The current request
|
||||||
* @param integer $id The application id
|
* @param integer $id The application id
|
||||||
* @return JsonResponse
|
* @return JsonResponse
|
||||||
*/
|
*/
|
||||||
public function deleteApp(Application $app, Request $request, $id)
|
public function deleteApp(Application $app, Request $request, $id)
|
||||||
{
|
{
|
||||||
@@ -202,10 +199,10 @@ class Developers implements ControllerProviderInterface
|
|||||||
/**
|
/**
|
||||||
* Change application callback
|
* Change application callback
|
||||||
*
|
*
|
||||||
* @param Application $app A Silex application where the controller is mounted on
|
* @param Application $app A Silex application where the controller is mounted on
|
||||||
* @param Request $request The current request
|
* @param Request $request The current request
|
||||||
* @param integer $id The application id
|
* @param integer $id The application id
|
||||||
* @return JsonResponse
|
* @return JsonResponse
|
||||||
*/
|
*/
|
||||||
public function renewAppCallback(Application $app, Request $request, $id)
|
public function renewAppCallback(Application $app, Request $request, $id)
|
||||||
{
|
{
|
||||||
@@ -233,10 +230,10 @@ class Developers implements ControllerProviderInterface
|
|||||||
/**
|
/**
|
||||||
* Authorize application to use a grant password type
|
* Authorize application to use a grant password type
|
||||||
*
|
*
|
||||||
* @param Application $app A Silex application where the controller is mounted on
|
* @param Application $app A Silex application where the controller is mounted on
|
||||||
* @param Request $request The current request
|
* @param Request $request The current request
|
||||||
* @param integer $id The application id
|
* @param integer $id The application id
|
||||||
* @return JsonResponse
|
* @return JsonResponse
|
||||||
*/
|
*/
|
||||||
public function renewAccessToken(Application $app, Request $request, $id)
|
public function renewAccessToken(Application $app, Request $request, $id)
|
||||||
{
|
{
|
||||||
@@ -270,10 +267,10 @@ class Developers implements ControllerProviderInterface
|
|||||||
/**
|
/**
|
||||||
* Authorize application to use a grant password type
|
* Authorize application to use a grant password type
|
||||||
*
|
*
|
||||||
* @param Application $app A Silex application where the controller is mounted on
|
* @param Application $app A Silex application where the controller is mounted on
|
||||||
* @param Request $request The current request
|
* @param Request $request The current request
|
||||||
* @param integer $id The application id
|
* @param integer $id The application id
|
||||||
* @return JsonResponse
|
* @return JsonResponse
|
||||||
*/
|
*/
|
||||||
public function authorizeGrantpassword(Application $app, Request $request, $id)
|
public function authorizeGrantpassword(Application $app, Request $request, $id)
|
||||||
{
|
{
|
||||||
@@ -296,9 +293,9 @@ class Developers implements ControllerProviderInterface
|
|||||||
/**
|
/**
|
||||||
* Create a new developer applications
|
* Create a new developer applications
|
||||||
*
|
*
|
||||||
* @param Application $app A Silex application where the controller is mounted on
|
* @param Application $app A Silex application where the controller is mounted on
|
||||||
* @param Request $request The current request
|
* @param Request $request The current request
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function newApp(Application $app, Request $request)
|
public function newApp(Application $app, Request $request)
|
||||||
{
|
{
|
||||||
@@ -332,9 +329,9 @@ class Developers implements ControllerProviderInterface
|
|||||||
/**
|
/**
|
||||||
* List of apps created by the user
|
* List of apps created by the user
|
||||||
*
|
*
|
||||||
* @param Application $app A Silex application where the controller is mounted on
|
* @param Application $app A Silex application where the controller is mounted on
|
||||||
* @param Request $request The current request
|
* @param Request $request The current request
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function listApps(Application $app, Request $request)
|
public function listApps(Application $app, Request $request)
|
||||||
{
|
{
|
||||||
@@ -346,9 +343,9 @@ class Developers implements ControllerProviderInterface
|
|||||||
/**
|
/**
|
||||||
* Display form application
|
* Display form application
|
||||||
*
|
*
|
||||||
* @param Application $app A Silex application where the controller is mounted on
|
* @param Application $app A Silex application where the controller is mounted on
|
||||||
* @param Request $request The current request
|
* @param Request $request The current request
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function displayFormApp(Application $app, Request $request)
|
public function displayFormApp(Application $app, Request $request)
|
||||||
{
|
{
|
||||||
@@ -362,10 +359,10 @@ class Developers implements ControllerProviderInterface
|
|||||||
/**
|
/**
|
||||||
* Get application information
|
* Get application information
|
||||||
*
|
*
|
||||||
* @param Application $app A Silex application where the controller is mounted on
|
* @param Application $app A Silex application where the controller is mounted on
|
||||||
* @param Request $request The current request
|
* @param Request $request The current request
|
||||||
* @param integer $id The application id
|
* @param integer $id The application id
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function getApp(Application $app, Request $request, $id)
|
public function getApp(Application $app, Request $request, $id)
|
||||||
{
|
{
|
||||||
|
@@ -44,8 +44,6 @@ class Login implements ControllerProviderInterface
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Login
|
* Login
|
||||||
*
|
*
|
||||||
@@ -227,9 +225,9 @@ class Login implements ControllerProviderInterface
|
|||||||
/**
|
/**
|
||||||
* Send a confirmation mail after register
|
* Send a confirmation mail after register
|
||||||
*
|
*
|
||||||
* @param Application $app A Silex application where the controller is mounted on
|
* @param Application $app A Silex application where the controller is mounted on
|
||||||
* @param Request $request The current request
|
* @param Request $request The current request
|
||||||
* @return RedirectResponse
|
* @return RedirectResponse
|
||||||
*/
|
*/
|
||||||
public function sendConfirmMail(Application $app, Request $request)
|
public function sendConfirmMail(Application $app, Request $request)
|
||||||
{
|
{
|
||||||
@@ -268,9 +266,9 @@ class Login implements ControllerProviderInterface
|
|||||||
/**
|
/**
|
||||||
* Validation of email adress
|
* Validation of email adress
|
||||||
*
|
*
|
||||||
* @param Application $app A Silex application where the controller is mounted on
|
* @param Application $app A Silex application where the controller is mounted on
|
||||||
* @param Request $request The current request
|
* @param Request $request The current request
|
||||||
* @return RedirectResponse
|
* @return RedirectResponse
|
||||||
*/
|
*/
|
||||||
public function registerConfirm(Application $app, Request $request)
|
public function registerConfirm(Application $app, Request $request)
|
||||||
{
|
{
|
||||||
@@ -321,9 +319,9 @@ class Login implements ControllerProviderInterface
|
|||||||
/**
|
/**
|
||||||
* Submit the new password
|
* Submit the new password
|
||||||
*
|
*
|
||||||
* @param Application $app A Silex application where the controller is mounted on
|
* @param Application $app A Silex application where the controller is mounted on
|
||||||
* @param Request $request The current request
|
* @param Request $request The current request
|
||||||
* @return RedirectResponse
|
* @return RedirectResponse
|
||||||
*/
|
*/
|
||||||
public function renewPassword(Application $app, Request $request)
|
public function renewPassword(Application $app, Request $request)
|
||||||
{
|
{
|
||||||
@@ -358,13 +356,10 @@ class Login implements ControllerProviderInterface
|
|||||||
&& (null !== $passwordConfirm = $request->request->get('form_password_confirm'))) {
|
&& (null !== $passwordConfirm = $request->request->get('form_password_confirm'))) {
|
||||||
|
|
||||||
if ($password !== $passwordConfirm) {
|
if ($password !== $passwordConfirm) {
|
||||||
|
|
||||||
return $app->redirect($app['url_generator']->generate('login_forgot_password', array('pass-error' => 'pass-match')));
|
return $app->redirect($app['url_generator']->generate('login_forgot_password', array('pass-error' => 'pass-match')));
|
||||||
} elseif (strlen(trim($password)) < 8) {
|
} elseif (strlen(trim($password)) < 8) {
|
||||||
|
|
||||||
return $app->redirect($app['url_generator']->generate('login_forgot_password', array('pass-error' => 'pass-short')));
|
return $app->redirect($app['url_generator']->generate('login_forgot_password', array('pass-error' => 'pass-short')));
|
||||||
} elseif (trim($password) !== str_replace(array("\r\n", "\n", "\r", "\t", " "), "_", $password)) {
|
} elseif (trim($password) !== str_replace(array("\r\n", "\n", "\r", "\t", " "), "_", $password)) {
|
||||||
|
|
||||||
return $app->redirect($app['url_generator']->generate('login_forgot_password', array('pass-error' => 'pass-invalid')));
|
return $app->redirect($app['url_generator']->generate('login_forgot_password', array('pass-error' => 'pass-invalid')));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -386,9 +381,9 @@ class Login implements ControllerProviderInterface
|
|||||||
/**
|
/**
|
||||||
* Get the fogot password form
|
* Get the fogot password form
|
||||||
*
|
*
|
||||||
* @param Application $app A Silex application where the controller is mounted on
|
* @param Application $app A Silex application where the controller is mounted on
|
||||||
* @param Request $request The current request
|
* @param Request $request The current request
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function displayForgotPasswordForm(Application $app, Request $request)
|
public function displayForgotPasswordForm(Application $app, Request $request)
|
||||||
{
|
{
|
||||||
@@ -457,9 +452,9 @@ class Login implements ControllerProviderInterface
|
|||||||
/**
|
/**
|
||||||
* Get the register form
|
* Get the register form
|
||||||
*
|
*
|
||||||
* @param Application $app A Silex application where the controller is mounted on
|
* @param Application $app A Silex application where the controller is mounted on
|
||||||
* @param Request $request The current request
|
* @param Request $request The current request
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function displayRegisterForm(Application $app, Request $request)
|
public function displayRegisterForm(Application $app, Request $request)
|
||||||
{
|
{
|
||||||
@@ -521,8 +516,6 @@ class Login implements ControllerProviderInterface
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$arrayVerif = $this->getRegisterFieldConfiguration($app);
|
$arrayVerif = $this->getRegisterFieldConfiguration($app);
|
||||||
|
|
||||||
return $app['twig']->render('login/register.html.twig', array(
|
return $app['twig']->render('login/register.html.twig', array(
|
||||||
@@ -539,9 +532,9 @@ class Login implements ControllerProviderInterface
|
|||||||
/**
|
/**
|
||||||
* Do the registration
|
* Do the registration
|
||||||
*
|
*
|
||||||
* @param Application $app A Silex application where the controller is mounted on
|
* @param Application $app A Silex application where the controller is mounted on
|
||||||
* @param Request $request The current request
|
* @param Request $request The current request
|
||||||
* @return RedirectResponse
|
* @return RedirectResponse
|
||||||
*/
|
*/
|
||||||
public function register(Application $app, Request $request)
|
public function register(Application $app, Request $request)
|
||||||
{
|
{
|
||||||
@@ -724,9 +717,9 @@ class Login implements ControllerProviderInterface
|
|||||||
/**
|
/**
|
||||||
* Logout from Phraseanet
|
* Logout from Phraseanet
|
||||||
*
|
*
|
||||||
* @param Application $app A Silex application where the controller is mounted on
|
* @param Application $app A Silex application where the controller is mounted on
|
||||||
* @param Request $request The current request
|
* @param Request $request The current request
|
||||||
* @return RedirectResponse
|
* @return RedirectResponse
|
||||||
*/
|
*/
|
||||||
public function logout(PhraseaApplication $app, Request $request)
|
public function logout(PhraseaApplication $app, Request $request)
|
||||||
{
|
{
|
||||||
@@ -748,9 +741,9 @@ class Login implements ControllerProviderInterface
|
|||||||
/**
|
/**
|
||||||
* Login into Phraseanet
|
* Login into Phraseanet
|
||||||
*
|
*
|
||||||
* @param Application $app A Silex application where the controller is mounted on
|
* @param Application $app A Silex application where the controller is mounted on
|
||||||
* @param Request $request The current request
|
* @param Request $request The current request
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function login(Application $app, Request $request)
|
public function login(Application $app, Request $request)
|
||||||
{
|
{
|
||||||
@@ -862,9 +855,9 @@ class Login implements ControllerProviderInterface
|
|||||||
/**
|
/**
|
||||||
* Authenticate to phraseanet
|
* Authenticate to phraseanet
|
||||||
*
|
*
|
||||||
* @param Application $app A Silex application where the controller is mounted on
|
* @param Application $app A Silex application where the controller is mounted on
|
||||||
* @param Request $request The current request
|
* @param Request $request The current request
|
||||||
* @return RedirectResponse
|
* @return RedirectResponse
|
||||||
*/
|
*/
|
||||||
public function authenticate(Application $app, Request $request)
|
public function authenticate(Application $app, Request $request)
|
||||||
{
|
{
|
||||||
@@ -1067,7 +1060,7 @@ class Login implements ControllerProviderInterface
|
|||||||
/**
|
/**
|
||||||
* Get required fields configuration
|
* Get required fields configuration
|
||||||
*
|
*
|
||||||
* @param Application $app
|
* @param Application $app
|
||||||
* @return boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
private function getRegisterFieldConfiguration(Application $app)
|
private function getRegisterFieldConfiguration(Application $app)
|
||||||
|
@@ -45,13 +45,13 @@ class Session implements ControllerProviderInterface
|
|||||||
/**
|
/**
|
||||||
* Check session state
|
* Check session state
|
||||||
*
|
*
|
||||||
* @param Application $app
|
* @param Application $app
|
||||||
* @param Request $request
|
* @param Request $request
|
||||||
* @return JsonResponse
|
* @return JsonResponse
|
||||||
*/
|
*/
|
||||||
public function updateSession(Application $app, Request $request)
|
public function updateSession(Application $app, Request $request)
|
||||||
{
|
{
|
||||||
if(!$request->isXmlHttpRequest()) {
|
if (!$request->isXmlHttpRequest()) {
|
||||||
$app->abort(400);
|
$app->abort(400);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -66,10 +66,12 @@ class Session implements ControllerProviderInterface
|
|||||||
$usr_id = $app['phraseanet.user']->get_id();
|
$usr_id = $app['phraseanet.user']->get_id();
|
||||||
if ($usr_id != $request->request->get('usr')) { // I logged with another user
|
if ($usr_id != $request->request->get('usr')) { // I logged with another user
|
||||||
$ret['status'] = 'disconnected';
|
$ret['status'] = 'disconnected';
|
||||||
|
|
||||||
return $app->json($ret);
|
return $app->json($ret);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$ret['status'] = 'disconnected';
|
$ret['status'] = 'disconnected';
|
||||||
|
|
||||||
return $app->json($ret);
|
return $app->json($ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -81,6 +83,7 @@ class Session implements ControllerProviderInterface
|
|||||||
|
|
||||||
if ($moduleId = (int) $request->request->get('module') < 1) {
|
if ($moduleId = (int) $request->request->get('module') < 1) {
|
||||||
$ret['message'] = 'Missing or Invalid `module` parameter';
|
$ret['message'] = 'Missing or Invalid `module` parameter';
|
||||||
|
|
||||||
return $app->json($ret);
|
return $app->json($ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -121,7 +124,6 @@ class Session implements ControllerProviderInterface
|
|||||||
return $app->json($ret);
|
return $app->json($ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Prefix the method to call with the controller class name
|
* Prefix the method to call with the controller class name
|
||||||
*
|
*
|
||||||
|
@@ -68,9 +68,9 @@ class Notifications implements ControllerProviderInterface
|
|||||||
/**
|
/**
|
||||||
* Set notifications as readed
|
* Set notifications as readed
|
||||||
*
|
*
|
||||||
* @param Application $app
|
* @param Application $app
|
||||||
* @param Request $request
|
* @param Request $request
|
||||||
* @return JsonResponse
|
* @return JsonResponse
|
||||||
*/
|
*/
|
||||||
public function readNotifications(Application $app, Request $request)
|
public function readNotifications(Application $app, Request $request)
|
||||||
{
|
{
|
||||||
@@ -86,7 +86,6 @@ class Notifications implements ControllerProviderInterface
|
|||||||
|
|
||||||
return $app->json(array('success' => true, 'message' => ''));
|
return $app->json(array('success' => true, 'message' => ''));
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
|
|
||||||
return $app->json(array('success' => false, 'message' => $e->getMessage()));
|
return $app->json(array('success' => false, 'message' => $e->getMessage()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -94,9 +93,9 @@ class Notifications implements ControllerProviderInterface
|
|||||||
/**
|
/**
|
||||||
* Get all notifications
|
* Get all notifications
|
||||||
*
|
*
|
||||||
* @param Application $app
|
* @param Application $app
|
||||||
* @param Request $request
|
* @param Request $request
|
||||||
* @return JsonResponse
|
* @return JsonResponse
|
||||||
*/
|
*/
|
||||||
public function listNotifications(Application $app, Request $request)
|
public function listNotifications(Application $app, Request $request)
|
||||||
{
|
{
|
||||||
@@ -105,6 +104,7 @@ class Notifications implements ControllerProviderInterface
|
|||||||
}
|
}
|
||||||
|
|
||||||
$page = (int) $request->query->get('page', 1);
|
$page = (int) $request->query->get('page', 1);
|
||||||
|
|
||||||
return $app->json($app['events-manager']->get_json_notifications(($page < 1 ? 1 : $page)));
|
return $app->json($app['events-manager']->get_json_notifications(($page < 1 ? 1 : $page)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -68,9 +68,9 @@ class Preferences implements ControllerProviderInterface
|
|||||||
/**
|
/**
|
||||||
* Save temporary user preferences
|
* Save temporary user preferences
|
||||||
*
|
*
|
||||||
* @param Application $app
|
* @param Application $app
|
||||||
* @param Request $request
|
* @param Request $request
|
||||||
* @return JsonResponse
|
* @return JsonResponse
|
||||||
*/
|
*/
|
||||||
public function saveTemporaryPref(Application $app, Request $request)
|
public function saveTemporaryPref(Application $app, Request $request)
|
||||||
{
|
{
|
||||||
@@ -95,9 +95,9 @@ class Preferences implements ControllerProviderInterface
|
|||||||
/**
|
/**
|
||||||
* Save user preferenes
|
* Save user preferenes
|
||||||
*
|
*
|
||||||
* @param Application $app
|
* @param Application $app
|
||||||
* @param Request $request
|
* @param Request $request
|
||||||
* @return JsonResponse
|
* @return JsonResponse
|
||||||
*/
|
*/
|
||||||
public function saveUserPref(Application $app, Request $request)
|
public function saveUserPref(Application $app, Request $request)
|
||||||
{
|
{
|
||||||
|
@@ -42,12 +42,12 @@ class Configuration
|
|||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param ApplicationSpecification $specifications
|
* @param ApplicationSpecification $specifications
|
||||||
* @param type $environment
|
* @param type $environment
|
||||||
* @return Configuration
|
* @return Configuration
|
||||||
*/
|
*/
|
||||||
public static function build($specifications = null, $environment = null)
|
public static function build($specifications = null, $environment = null)
|
||||||
{
|
{
|
||||||
if ( ! $specifications) {
|
if (! $specifications) {
|
||||||
$specifications = new ApplicationSpecification();
|
$specifications = new ApplicationSpecification();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -56,8 +56,8 @@ class Configuration
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param SpecificationInterface $specifications
|
* @param SpecificationInterface $specifications
|
||||||
* @param type $environment
|
* @param type $environment
|
||||||
* @return Configuration
|
* @return Configuration
|
||||||
*/
|
*/
|
||||||
public function __construct(SpecificationInterface $specifications, $environment = null)
|
public function __construct(SpecificationInterface $specifications, $environment = null)
|
||||||
@@ -104,7 +104,6 @@ class Configuration
|
|||||||
*/
|
*/
|
||||||
public function getEnvironnement()
|
public function getEnvironnement()
|
||||||
{
|
{
|
||||||
|
|
||||||
return $this->environment;
|
return $this->environment;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -26,6 +26,7 @@ class TaskManagerServiceProvider implements ServiceProviderInterface
|
|||||||
->getService($app['phraseanet.configuration']->getTaskManager());
|
->getService($app['phraseanet.configuration']->getTaskManager());
|
||||||
|
|
||||||
$service = Builder::create($app, $configuration);
|
$service = Builder::create($app, $configuration);
|
||||||
|
|
||||||
return $service->getDriver();
|
return $service->getDriver();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@@ -48,7 +48,7 @@ class BorderManager extends ServiceAbstract
|
|||||||
|
|
||||||
$registeredCheckers = array();
|
$registeredCheckers = array();
|
||||||
|
|
||||||
if ( ! ! $options['enabled']) {
|
if (! ! $options['enabled']) {
|
||||||
foreach ($options['checkers'] as $checker) {
|
foreach ($options['checkers'] as $checker) {
|
||||||
|
|
||||||
if ( ! isset($checker['type'])) {
|
if ( ! isset($checker['type'])) {
|
||||||
|
@@ -29,7 +29,7 @@ class ApcCache extends ServiceAbstract
|
|||||||
throw new \Exception('The APC cache requires the APC extension.');
|
throw new \Exception('The APC cache requires the APC extension.');
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( ! $this->cache) {
|
if (! $this->cache) {
|
||||||
$this->cache = new CacheDriver\ApcCache();
|
$this->cache = new CacheDriver\ApcCache();
|
||||||
|
|
||||||
$this->cache->setNamespace(md5(realpath(__DIR__ . '/../../../../../../')));
|
$this->cache->setNamespace(md5(realpath(__DIR__ . '/../../../../../../')));
|
||||||
@@ -43,4 +43,3 @@ class ApcCache extends ServiceAbstract
|
|||||||
return 'apc';
|
return 'apc';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -26,7 +26,7 @@ class ArrayCache extends ServiceAbstract
|
|||||||
|
|
||||||
public function getDriver()
|
public function getDriver()
|
||||||
{
|
{
|
||||||
if ( ! $this->cache) {
|
if (! $this->cache) {
|
||||||
$this->cache = new CacheDriver\ArrayCache();
|
$this->cache = new CacheDriver\ArrayCache();
|
||||||
|
|
||||||
$this->cache->setNamespace(md5(realpath(__DIR__ . '/../../../../../../')));
|
$this->cache->setNamespace(md5(realpath(__DIR__ . '/../../../../../../')));
|
||||||
@@ -40,4 +40,3 @@ class ArrayCache extends ServiceAbstract
|
|||||||
return 'array';
|
return 'array';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -43,7 +43,7 @@ class MemcacheCache extends ServiceAbstract
|
|||||||
throw new \Exception('The Memcache cache requires the Memcache extension.');
|
throw new \Exception('The Memcache cache requires the Memcache extension.');
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( ! $this->cache) {
|
if (! $this->cache) {
|
||||||
$memcache = new \Memcache();
|
$memcache = new \Memcache();
|
||||||
|
|
||||||
$memcache->addServer($this->host, $this->port);
|
$memcache->addServer($this->host, $this->port);
|
||||||
@@ -80,4 +80,3 @@ class MemcacheCache extends ServiceAbstract
|
|||||||
return $this->port;
|
return $this->port;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -47,7 +47,7 @@ class RedisCache extends ServiceAbstract
|
|||||||
throw new \Exception('The Redis cache requires the Redis extension.');
|
throw new \Exception('The Redis cache requires the Redis extension.');
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( ! $this->cache) {
|
if (! $this->cache) {
|
||||||
$redis = new \Redis();
|
$redis = new \Redis();
|
||||||
|
|
||||||
if ($redis->connect($this->host, $this->port)) {
|
if ($redis->connect($this->host, $this->port)) {
|
||||||
@@ -81,4 +81,3 @@ class RedisCache extends ServiceAbstract
|
|||||||
return $this->port;
|
return $this->port;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -32,7 +32,7 @@ class WinCacheCache extends ServiceAbstract
|
|||||||
throw new \Exception('The WinCache cache requires the WinCache extension.');
|
throw new \Exception('The WinCache cache requires the WinCache extension.');
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( ! $this->cache) {
|
if (! $this->cache) {
|
||||||
$this->cache = new CacheDriver\WinCacheCache();
|
$this->cache = new CacheDriver\WinCacheCache();
|
||||||
|
|
||||||
$this->cache->setNamespace(md5(realpath(__DIR__ . '/../../../../../../')));
|
$this->cache->setNamespace(md5(realpath(__DIR__ . '/../../../../../../')));
|
||||||
@@ -46,4 +46,3 @@ class WinCacheCache extends ServiceAbstract
|
|||||||
return 'wincache';
|
return 'wincache';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -29,7 +29,7 @@ class XcacheCache extends ServiceAbstract
|
|||||||
throw new \Exception('The XCache cache requires the XCache extension.');
|
throw new \Exception('The XCache cache requires the XCache extension.');
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( ! $this->cache) {
|
if (! $this->cache) {
|
||||||
$this->cache = new CacheDriver\XcacheCache();
|
$this->cache = new CacheDriver\XcacheCache();
|
||||||
|
|
||||||
$this->cache->setNamespace(md5(realpath(__DIR__ . '/../../../../../../')));
|
$this->cache->setNamespace(md5(realpath(__DIR__ . '/../../../../../../')));
|
||||||
|
@@ -26,7 +26,7 @@ class FirePHP extends ServiceAbstract
|
|||||||
|
|
||||||
public function getDriver()
|
public function getDriver()
|
||||||
{
|
{
|
||||||
if ( ! $this->logger) {
|
if (! $this->logger) {
|
||||||
$this->logger = new Logger('FirePHP');
|
$this->logger = new Logger('FirePHP');
|
||||||
|
|
||||||
$this->logger->pushHandler(new FirePHPHandler());
|
$this->logger->pushHandler(new FirePHPHandler());
|
||||||
|
@@ -44,7 +44,7 @@ class Monolog extends ServiceAbstract
|
|||||||
//defaut to main handler
|
//defaut to main handler
|
||||||
$handler = isset($options["handler"]) ? $options["handler"] : false;
|
$handler = isset($options["handler"]) ? $options["handler"] : false;
|
||||||
|
|
||||||
if ( ! $handler) {
|
if (! $handler) {
|
||||||
throw new \Exception(sprintf(
|
throw new \Exception(sprintf(
|
||||||
"You must specify at least one handler for '%s' service"
|
"You must specify at least one handler for '%s' service"
|
||||||
, __CLASS__
|
, __CLASS__
|
||||||
@@ -117,4 +117,3 @@ class Monolog extends ServiceAbstract
|
|||||||
return array('channel', 'handler', 'filename');
|
return array('channel', 'handler', 'filename');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -29,7 +29,7 @@ class Prod extends Helper
|
|||||||
|
|
||||||
$bases = $fields = $dates = array();
|
$bases = $fields = $dates = array();
|
||||||
|
|
||||||
if ( ! $this->app['phraseanet.user'] instanceof \User_Adapter) {
|
if (! $this->app['phraseanet.user'] instanceof \User_Adapter) {
|
||||||
return $search_datas;
|
return $search_datas;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -80,7 +80,7 @@ class Prod extends Helper
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( ! $bases[$sbas_id]['thesaurus']) {
|
if (! $bases[$sbas_id]['thesaurus']) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if ( ! $this->app['phraseanet.user']->ACL()->has_right_on_sbas($sbas_id, 'bas_modif_th')) {
|
if ( ! $this->app['phraseanet.user']->ACL()->has_right_on_sbas($sbas_id, 'bas_modif_th')) {
|
||||||
|
@@ -65,4 +65,3 @@ class WorkZone extends Helper
|
|||||||
$tmp_baskets = array();
|
$tmp_baskets = array();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -49,7 +49,7 @@ class Audio extends Provider
|
|||||||
|
|
||||||
public function getMediaAlchemystSpec()
|
public function getMediaAlchemystSpec()
|
||||||
{
|
{
|
||||||
if ( ! $this->spec) {
|
if (! $this->spec) {
|
||||||
$this->spec = new \MediaAlchemyst\Specification\Audio();
|
$this->spec = new \MediaAlchemyst\Specification\Audio();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -38,7 +38,7 @@ class FlexPaper extends Provider
|
|||||||
|
|
||||||
public function getMediaAlchemystSpec()
|
public function getMediaAlchemystSpec()
|
||||||
{
|
{
|
||||||
if ( ! $this->spec) {
|
if (! $this->spec) {
|
||||||
$this->spec = new \MediaAlchemyst\Specification\Flash();
|
$this->spec = new \MediaAlchemyst\Specification\Flash();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -40,7 +40,7 @@ class Gif extends Image
|
|||||||
|
|
||||||
public function getMediaAlchemystSpec()
|
public function getMediaAlchemystSpec()
|
||||||
{
|
{
|
||||||
if ( ! $this->spec) {
|
if (! $this->spec) {
|
||||||
$this->spec = new \MediaAlchemyst\Specification\Animation();
|
$this->spec = new \MediaAlchemyst\Specification\Animation();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -48,7 +48,7 @@ class Image extends Provider
|
|||||||
|
|
||||||
public function getMediaAlchemystSpec()
|
public function getMediaAlchemystSpec()
|
||||||
{
|
{
|
||||||
if ( ! $this->spec) {
|
if (! $this->spec) {
|
||||||
$this->spec = new ImageSpecification();
|
$this->spec = new ImageSpecification();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -39,7 +39,7 @@ class Enum implements OptionType
|
|||||||
|
|
||||||
public function setValue($value)
|
public function setValue($value)
|
||||||
{
|
{
|
||||||
if ( ! $value) {
|
if (! $value) {
|
||||||
$this->value = null;
|
$this->value = null;
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
|
@@ -45,8 +45,7 @@ class Multi implements OptionType
|
|||||||
$this->available[$k] = false;
|
$this->available[$k] = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( ! $value) {
|
if (! $value) {
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -50,7 +50,7 @@ class Video extends Audio
|
|||||||
|
|
||||||
public function getMediaAlchemystSpec()
|
public function getMediaAlchemystSpec()
|
||||||
{
|
{
|
||||||
if ( ! $this->spec) {
|
if (! $this->spec) {
|
||||||
$this->spec = new \MediaAlchemyst\Specification\Video();
|
$this->spec = new \MediaAlchemyst\Specification\Video();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -31,7 +31,7 @@ abstract class AbstractConfigurationPanel implements ConfigurationPanelInterface
|
|||||||
$date_fields = array();
|
$date_fields = array();
|
||||||
|
|
||||||
foreach ($databoxes as $databox) {
|
foreach ($databoxes as $databox) {
|
||||||
foreach($databox->get_meta_structure() as $field) {
|
foreach ($databox->get_meta_structure() as $field) {
|
||||||
if ($field->get_type() !== \databox_field::TYPE_DATE) {
|
if ($field->get_type() !== \databox_field::TYPE_DATE) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@@ -20,8 +20,8 @@ interface ConfigurationPanelInterface
|
|||||||
/**
|
/**
|
||||||
* Handles the GET request to the configuration panel
|
* Handles the GET request to the configuration panel
|
||||||
*
|
*
|
||||||
* @param Application $app
|
* @param Application $app
|
||||||
* @param Request $request
|
* @param Request $request
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function get(Application $app, Request $request);
|
public function get(Application $app, Request $request);
|
||||||
@@ -29,8 +29,8 @@ interface ConfigurationPanelInterface
|
|||||||
/**
|
/**
|
||||||
* Handles the POST request to the configuration panel
|
* Handles the POST request to the configuration panel
|
||||||
*
|
*
|
||||||
* @param Application $app
|
* @param Application $app
|
||||||
* @param Request $request
|
* @param Request $request
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function post(Application $app, Request $request);
|
public function post(Application $app, Request $request);
|
||||||
@@ -52,7 +52,7 @@ interface ConfigurationPanelInterface
|
|||||||
/**
|
/**
|
||||||
* Saves the search engine configuration
|
* Saves the search engine configuration
|
||||||
*
|
*
|
||||||
* @param array $configuration
|
* @param array $configuration
|
||||||
* @return ConfigurationPanelInterface
|
* @return ConfigurationPanelInterface
|
||||||
*/
|
*/
|
||||||
public function saveConfiguration(array $configuration);
|
public function saveConfiguration(array $configuration);
|
||||||
@@ -60,7 +60,7 @@ interface ConfigurationPanelInterface
|
|||||||
/**
|
/**
|
||||||
* Return the names of the date fields
|
* Return the names of the date fields
|
||||||
*
|
*
|
||||||
* @param array $databoxes
|
* @param array $databoxes
|
||||||
* @return array An array of date fields names
|
* @return array An array of date fields names
|
||||||
*/
|
*/
|
||||||
public function getAvailableDateFields(array $databoxes);
|
public function getAvailableDateFields(array $databoxes);
|
||||||
|
@@ -452,7 +452,7 @@ class PhraseaEngine implements SearchEngineInterface
|
|||||||
/**
|
/**
|
||||||
* Format proposals from QueryParser to HTML
|
* Format proposals from QueryParser to HTML
|
||||||
*
|
*
|
||||||
* @param array $proposals
|
* @param array $proposals
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
private static function proposalsToHTML($proposals)
|
private static function proposalsToHTML($proposals)
|
||||||
@@ -480,7 +480,7 @@ class PhraseaEngine implements SearchEngineInterface
|
|||||||
/**
|
/**
|
||||||
* Factory
|
* Factory
|
||||||
*
|
*
|
||||||
* @param Application $app
|
* @param Application $app
|
||||||
* @return PhraseaEngine
|
* @return PhraseaEngine
|
||||||
*/
|
*/
|
||||||
public static function create(Application $app)
|
public static function create(Application $app)
|
||||||
@@ -491,7 +491,7 @@ class PhraseaEngine implements SearchEngineInterface
|
|||||||
/**
|
/**
|
||||||
* Executes the Phrasea query
|
* Executes the Phrasea query
|
||||||
*
|
*
|
||||||
* @param string $query
|
* @param string $query
|
||||||
* @return PhraseaEngine
|
* @return PhraseaEngine
|
||||||
*/
|
*/
|
||||||
private function executeQuery($query)
|
private function executeQuery($query)
|
||||||
@@ -623,7 +623,7 @@ class PhraseaEngine implements SearchEngineInterface
|
|||||||
/**
|
/**
|
||||||
* Prepares the query
|
* Prepares the query
|
||||||
*
|
*
|
||||||
* @param string $query
|
* @param string $query
|
||||||
* @return PhraseaEngine
|
* @return PhraseaEngine
|
||||||
*/
|
*/
|
||||||
private function addQuery($query)
|
private function addQuery($query)
|
||||||
@@ -723,8 +723,8 @@ class PhraseaEngine implements SearchEngineInterface
|
|||||||
/**
|
/**
|
||||||
* Parses the query for search engine
|
* Parses the query for search engine
|
||||||
*
|
*
|
||||||
* @param integer $sbas
|
* @param integer $sbas
|
||||||
* @param string $query
|
* @param string $query
|
||||||
* @return PhraseaEngine
|
* @return PhraseaEngine
|
||||||
*/
|
*/
|
||||||
private function singleParse($sbas, $query)
|
private function singleParse($sbas, $query)
|
||||||
|
@@ -143,7 +143,6 @@ class PhraseaEngineQueryParser
|
|||||||
if (is_array($tree["VALUE"])) {
|
if (is_array($tree["VALUE"])) {
|
||||||
return(implode(" ", $tree["VALUE"]));
|
return(implode(" ", $tree["VALUE"]));
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
return($tree["VALUE"]);
|
return($tree["VALUE"]);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -1140,7 +1139,6 @@ class PhraseaEngineQueryParser
|
|||||||
"LB" => $newTreeLB,
|
"LB" => $newTreeLB,
|
||||||
"RB" => $newTreeRB);
|
"RB" => $newTreeRB);
|
||||||
|
|
||||||
|
|
||||||
return $tree;
|
return $tree;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1893,4 +1891,3 @@ class PhraseaEngineQueryParser
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -32,8 +32,8 @@ interface SearchEngineInterface
|
|||||||
/**
|
/**
|
||||||
* Check the status of the search engine
|
* Check the status of the search engine
|
||||||
*
|
*
|
||||||
* @return array An array of key/value parameters
|
* @return array An array of key/value parameters
|
||||||
* @throws RuntimeException if something is wrong
|
* @throws RuntimeException if something is wrong
|
||||||
*/
|
*/
|
||||||
public function getStatus();
|
public function getStatus();
|
||||||
|
|
||||||
@@ -76,7 +76,7 @@ interface SearchEngineInterface
|
|||||||
/**
|
/**
|
||||||
* Add a record to index
|
* Add a record to index
|
||||||
*
|
*
|
||||||
* @param \record_adapter $record
|
* @param \record_adapter $record
|
||||||
* @return SearchEngineInterface
|
* @return SearchEngineInterface
|
||||||
* @throws RuntimeException
|
* @throws RuntimeException
|
||||||
*/
|
*/
|
||||||
@@ -85,7 +85,7 @@ interface SearchEngineInterface
|
|||||||
/**
|
/**
|
||||||
* Remove a record from index
|
* Remove a record from index
|
||||||
*
|
*
|
||||||
* @param \record_adapter $record
|
* @param \record_adapter $record
|
||||||
* @return SearchEngineInterface
|
* @return SearchEngineInterface
|
||||||
* @throws RuntimeException
|
* @throws RuntimeException
|
||||||
*/
|
*/
|
||||||
@@ -94,7 +94,7 @@ interface SearchEngineInterface
|
|||||||
/**
|
/**
|
||||||
* Update a record in index
|
* Update a record in index
|
||||||
*
|
*
|
||||||
* @param \record_adapter $record
|
* @param \record_adapter $record
|
||||||
* @return SearchEngineInterface
|
* @return SearchEngineInterface
|
||||||
* @throws RuntimeException
|
* @throws RuntimeException
|
||||||
*/
|
*/
|
||||||
@@ -103,7 +103,7 @@ interface SearchEngineInterface
|
|||||||
/**
|
/**
|
||||||
* Add a story to index
|
* Add a story to index
|
||||||
*
|
*
|
||||||
* @param \record_adapter $story
|
* @param \record_adapter $story
|
||||||
* @return SearchEngineInterface
|
* @return SearchEngineInterface
|
||||||
* @throws RuntimeException
|
* @throws RuntimeException
|
||||||
*/
|
*/
|
||||||
@@ -112,7 +112,7 @@ interface SearchEngineInterface
|
|||||||
/**
|
/**
|
||||||
* Remove a story from index
|
* Remove a story from index
|
||||||
*
|
*
|
||||||
* @param \record_adapter $story
|
* @param \record_adapter $story
|
||||||
* @return SearchEngineInterface
|
* @return SearchEngineInterface
|
||||||
* @throws RuntimeException
|
* @throws RuntimeException
|
||||||
*/
|
*/
|
||||||
@@ -121,7 +121,7 @@ interface SearchEngineInterface
|
|||||||
/**
|
/**
|
||||||
* Update a story in index
|
* Update a story in index
|
||||||
*
|
*
|
||||||
* @param \record_adapter $story
|
* @param \record_adapter $story
|
||||||
* @return SearchEngineInterface
|
* @return SearchEngineInterface
|
||||||
* @throws RuntimeException
|
* @throws RuntimeException
|
||||||
*/
|
*/
|
||||||
@@ -130,7 +130,7 @@ interface SearchEngineInterface
|
|||||||
/**
|
/**
|
||||||
* Add an entry to index
|
* Add an entry to index
|
||||||
*
|
*
|
||||||
* @param \Feed_Entry_Adapter $entry
|
* @param \Feed_Entry_Adapter $entry
|
||||||
* @return SearchEngineInterface
|
* @return SearchEngineInterface
|
||||||
* @throws RuntimeException
|
* @throws RuntimeException
|
||||||
*/
|
*/
|
||||||
@@ -139,7 +139,7 @@ interface SearchEngineInterface
|
|||||||
/**
|
/**
|
||||||
* Remove an entry to index
|
* Remove an entry to index
|
||||||
*
|
*
|
||||||
* @param \Feed_Entry_Adapter $entry
|
* @param \Feed_Entry_Adapter $entry
|
||||||
* @return SearchEngineInterface
|
* @return SearchEngineInterface
|
||||||
* @throws RuntimeException
|
* @throws RuntimeException
|
||||||
*/
|
*/
|
||||||
@@ -148,7 +148,7 @@ interface SearchEngineInterface
|
|||||||
/**
|
/**
|
||||||
* Update an entry in the index
|
* Update an entry in the index
|
||||||
*
|
*
|
||||||
* @param \Feed_Entry_Adapter $entry
|
* @param \Feed_Entry_Adapter $entry
|
||||||
* @return SearchEngineInterface
|
* @return SearchEngineInterface
|
||||||
* @throws RuntimeException
|
* @throws RuntimeException
|
||||||
*/
|
*/
|
||||||
@@ -157,7 +157,7 @@ interface SearchEngineInterface
|
|||||||
/**
|
/**
|
||||||
* Set options to search-engine
|
* Set options to search-engine
|
||||||
*
|
*
|
||||||
* @param SearchEngineOptions $options
|
* @param SearchEngineOptions $options
|
||||||
* @return SearchEngineInterface
|
* @return SearchEngineInterface
|
||||||
* @throws RuntimeException
|
* @throws RuntimeException
|
||||||
*/
|
*/
|
||||||
@@ -173,7 +173,7 @@ interface SearchEngineInterface
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param string $query
|
* @param string $query
|
||||||
* @param integer $offset
|
* @param integer $offset
|
||||||
* @param integer $perPage
|
* @param integer $perPage
|
||||||
*
|
*
|
||||||
@@ -194,8 +194,8 @@ interface SearchEngineInterface
|
|||||||
/**
|
/**
|
||||||
* Highlight the fields of a record
|
* Highlight the fields of a record
|
||||||
*
|
*
|
||||||
* @param type $query
|
* @param type $query
|
||||||
* @param type $fields
|
* @param type $fields
|
||||||
* @param \record_adapter $record
|
* @param \record_adapter $record
|
||||||
*
|
*
|
||||||
* @return array The array of highlighted fields
|
* @return array The array of highlighted fields
|
||||||
@@ -225,4 +225,3 @@ interface SearchEngineInterface
|
|||||||
*/
|
*/
|
||||||
public function clearAllCache(\DateTime $date = null);
|
public function clearAllCache(\DateTime $date = null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -131,8 +131,8 @@ class SearchEngineOptions
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param const $sort_by
|
* @param const $sort_by
|
||||||
* @param const $sort_ord
|
* @param const $sort_ord
|
||||||
* @return SearchEngineOptions
|
* @return SearchEngineOptions
|
||||||
*/
|
*/
|
||||||
public function setSort($sort_by, $sort_ord = self::SORT_MODE_DESC)
|
public function setSort($sort_by, $sort_ord = self::SORT_MODE_DESC)
|
||||||
@@ -146,7 +146,7 @@ class SearchEngineOptions
|
|||||||
/**
|
/**
|
||||||
* Allows business fields query on the given collections
|
* Allows business fields query on the given collections
|
||||||
*
|
*
|
||||||
* @param array $collection An array of collection
|
* @param array $collection An array of collection
|
||||||
* @return SearchEngineOptions
|
* @return SearchEngineOptions
|
||||||
*/
|
*/
|
||||||
public function allowBusinessFieldsOn(Array $collection)
|
public function allowBusinessFieldsOn(Array $collection)
|
||||||
@@ -202,7 +202,7 @@ class SearchEngineOptions
|
|||||||
/**
|
/**
|
||||||
* Tells whether to use stemming or not
|
* Tells whether to use stemming or not
|
||||||
*
|
*
|
||||||
* @param boolean $boolean
|
* @param boolean $boolean
|
||||||
* @return SearchEngineOptions
|
* @return SearchEngineOptions
|
||||||
*/
|
*/
|
||||||
public function setStemming($boolean)
|
public function setStemming($boolean)
|
||||||
@@ -225,7 +225,7 @@ class SearchEngineOptions
|
|||||||
/**
|
/**
|
||||||
* Set document type to search for
|
* Set document type to search for
|
||||||
*
|
*
|
||||||
* @param int $search_type
|
* @param int $search_type
|
||||||
* @return SearchEngineOptions
|
* @return SearchEngineOptions
|
||||||
*/
|
*/
|
||||||
public function setSearchType($search_type)
|
public function setSearchType($search_type)
|
||||||
@@ -256,7 +256,7 @@ class SearchEngineOptions
|
|||||||
/**
|
/**
|
||||||
* Set the collections where to search for
|
* Set the collections where to search for
|
||||||
*
|
*
|
||||||
* @param array $collections An array of collection
|
* @param array $collections An array of collection
|
||||||
* @return SearchEngineOptions
|
* @return SearchEngineOptions
|
||||||
*/
|
*/
|
||||||
public function onCollections(Array $collections)
|
public function onCollections(Array $collections)
|
||||||
@@ -295,7 +295,7 @@ class SearchEngineOptions
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param array $fields An array of Databox fields
|
* @param array $fields An array of Databox fields
|
||||||
*/
|
*/
|
||||||
public function setFields(Array $fields)
|
public function setFields(Array $fields)
|
||||||
{
|
{
|
||||||
@@ -315,7 +315,7 @@ class SearchEngineOptions
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param array $status
|
* @param array $status
|
||||||
* @return SearchEngineOptions
|
* @return SearchEngineOptions
|
||||||
*/
|
*/
|
||||||
public function setStatus(Array $status)
|
public function setStatus(Array $status)
|
||||||
@@ -353,7 +353,7 @@ class SearchEngineOptions
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param string $record_type
|
* @param string $record_type
|
||||||
* @return SearchEngineOptions
|
* @return SearchEngineOptions
|
||||||
*/
|
*/
|
||||||
public function setRecordType($record_type)
|
public function setRecordType($record_type)
|
||||||
@@ -417,7 +417,7 @@ class SearchEngineOptions
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param string $max_date
|
* @param string $max_date
|
||||||
* @return SearchEngineOptions
|
* @return SearchEngineOptions
|
||||||
*/
|
*/
|
||||||
public function setMaxDate(\DateTime $max_date = null)
|
public function setMaxDate(\DateTime $max_date = null)
|
||||||
@@ -442,7 +442,7 @@ class SearchEngineOptions
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param array $fields
|
* @param array $fields
|
||||||
* @return SearchEngineOptions
|
* @return SearchEngineOptions
|
||||||
*/
|
*/
|
||||||
public function setDateFields(Array $fields)
|
public function setDateFields(Array $fields)
|
||||||
@@ -491,7 +491,7 @@ class SearchEngineOptions
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param string $serialized
|
* @param string $serialized
|
||||||
* @return SearchEngineOptions
|
* @return SearchEngineOptions
|
||||||
*/
|
*/
|
||||||
public static function hydrate(Application $app, $serialized)
|
public static function hydrate(Application $app, $serialized)
|
||||||
@@ -603,7 +603,7 @@ class SearchEngineOptions
|
|||||||
* Creates options based on a Symfony Request object
|
* Creates options based on a Symfony Request object
|
||||||
*
|
*
|
||||||
* @param Application $app
|
* @param Application $app
|
||||||
* @param Request $request
|
* @param Request $request
|
||||||
*
|
*
|
||||||
* @return SearchEngineOptions
|
* @return SearchEngineOptions
|
||||||
*/
|
*/
|
||||||
@@ -614,7 +614,6 @@ class SearchEngineOptions
|
|||||||
$options->disallowBusinessFields();
|
$options->disallowBusinessFields();
|
||||||
$options->setLocale($app['locale.I18n']);
|
$options->setLocale($app['locale.I18n']);
|
||||||
|
|
||||||
|
|
||||||
if (is_array($request->get('bases'))) {
|
if (is_array($request->get('bases'))) {
|
||||||
$bas = array_map(function($base_id) use ($app) {
|
$bas = array_map(function($base_id) use ($app) {
|
||||||
return \collection::get_from_base_id($app, $base_id);
|
return \collection::get_from_base_id($app, $base_id);
|
||||||
|
@@ -77,7 +77,7 @@ class SearchEngineResult
|
|||||||
/**
|
/**
|
||||||
* Return the number of page depending on the amount displayed on each page
|
* Return the number of page depending on the amount displayed on each page
|
||||||
*
|
*
|
||||||
* @param integer $amountPerPage
|
* @param integer $amountPerPage
|
||||||
* @return integer
|
* @return integer
|
||||||
*/
|
*/
|
||||||
public function getTotalPages($amountPerPage)
|
public function getTotalPages($amountPerPage)
|
||||||
@@ -89,7 +89,7 @@ class SearchEngineResult
|
|||||||
* Return the number of the current page depending on the amount displayed
|
* Return the number of the current page depending on the amount displayed
|
||||||
* on each page
|
* on each page
|
||||||
*
|
*
|
||||||
* @param integer $amountPerPage
|
* @param integer $amountPerPage
|
||||||
* @return integer
|
* @return integer
|
||||||
*/
|
*/
|
||||||
public function getCurrentPage($amountPerPage)
|
public function getCurrentPage($amountPerPage)
|
||||||
@@ -173,4 +173,3 @@ class SearchEngineResult
|
|||||||
return $this->indexes;
|
return $this->indexes;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -159,8 +159,8 @@ class ConfigurationPanel extends AbstractConfigurationPanel
|
|||||||
/**
|
/**
|
||||||
* Generates Sphinx Search configuration depending on the service configuration
|
* Generates Sphinx Search configuration depending on the service configuration
|
||||||
*
|
*
|
||||||
* @param array $databoxes The databoxes to index
|
* @param array $databoxes The databoxes to index
|
||||||
* @param array $configuration The configuration
|
* @param array $configuration The configuration
|
||||||
* @return string The sphinx search configuration
|
* @return string The sphinx search configuration
|
||||||
*/
|
*/
|
||||||
public function generateSphinxConf(array $databoxes, array $configuration)
|
public function generateSphinxConf(array $databoxes, array $configuration)
|
||||||
|
@@ -526,7 +526,7 @@ class SphinxSearchEngine implements SearchEngineInterface
|
|||||||
/**
|
/**
|
||||||
* Return unique integer key for a databox
|
* Return unique integer key for a databox
|
||||||
*
|
*
|
||||||
* @param \databox $databox
|
* @param \databox $databox
|
||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
public function CRCdatabox(\databox $databox)
|
public function CRCdatabox(\databox $databox)
|
||||||
@@ -545,7 +545,7 @@ class SphinxSearchEngine implements SearchEngineInterface
|
|||||||
*
|
*
|
||||||
* Only apply filters and group by
|
* Only apply filters and group by
|
||||||
*
|
*
|
||||||
* @param SearchEngineOptions $options
|
* @param SearchEngineOptions $options
|
||||||
* @return SphinxSearch
|
* @return SphinxSearch
|
||||||
*/
|
*/
|
||||||
protected function applyOptions(SearchEngineOptions $options)
|
protected function applyOptions(SearchEngineOptions $options)
|
||||||
@@ -689,7 +689,7 @@ class SphinxSearchEngine implements SearchEngineInterface
|
|||||||
/**
|
/**
|
||||||
* Remove all keywords, operators, quotes from a query string
|
* Remove all keywords, operators, quotes from a query string
|
||||||
*
|
*
|
||||||
* @param string $query
|
* @param string $query
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
private function cleanupQuery($query)
|
private function cleanupQuery($query)
|
||||||
@@ -700,7 +700,7 @@ class SphinxSearchEngine implements SearchEngineInterface
|
|||||||
/**
|
/**
|
||||||
* Return a collection of suggestion corresponding a query
|
* Return a collection of suggestion corresponding a query
|
||||||
*
|
*
|
||||||
* @param string $query
|
* @param string $query
|
||||||
* @return ArrayCollection An array collection of SearchEngineSuggestion
|
* @return ArrayCollection An array collection of SearchEngineSuggestion
|
||||||
*/
|
*/
|
||||||
private function getSuggestions($query)
|
private function getSuggestions($query)
|
||||||
@@ -1007,4 +1007,3 @@ class SphinxSearchEngine implements SearchEngineInterface
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -75,7 +75,6 @@ class Migration35 implements MigrationInterface
|
|||||||
rename(__DIR__ . '/../../../../../../config/connexion.inc', __DIR__ . '/../../../../../../config/connexion.inc.old');
|
rename(__DIR__ . '/../../../../../../config/connexion.inc', __DIR__ . '/../../../../../../config/connexion.inc.old');
|
||||||
rename(__DIR__ . '/../../../../../../config/config.inc', __DIR__ . '/../../../../../../config/config.inc.old');
|
rename(__DIR__ . '/../../../../../../config/config.inc', __DIR__ . '/../../../../../../config/config.inc.old');
|
||||||
|
|
||||||
|
|
||||||
$this->app['phraseanet.configuration']->setConfigurations($configs);
|
$this->app['phraseanet.configuration']->setConfigurations($configs);
|
||||||
$this->app['phraseanet.configuration']->setEnvironnement('prod');
|
$this->app['phraseanet.configuration']->setEnvironnement('prod');
|
||||||
}
|
}
|
||||||
|
@@ -28,6 +28,7 @@ class Probe31 implements ProbeInterface
|
|||||||
/**
|
/**
|
||||||
* We can not use registry to inject a path as the install is not yet done
|
* We can not use registry to inject a path as the install is not yet done
|
||||||
*/
|
*/
|
||||||
|
|
||||||
return is_file(__DIR__ . "/../../../../../../config/connexion.inc")
|
return is_file(__DIR__ . "/../../../../../../config/connexion.inc")
|
||||||
&& is_file(__DIR__ . "/../../../../../../config/_GV.php");
|
&& is_file(__DIR__ . "/../../../../../../config/_GV.php");
|
||||||
}
|
}
|
||||||
|
@@ -28,6 +28,7 @@ class Probe35 implements ProbeInterface
|
|||||||
/**
|
/**
|
||||||
* We can not use registry to inject a path as the install is not yet done
|
* We can not use registry to inject a path as the install is not yet done
|
||||||
*/
|
*/
|
||||||
|
|
||||||
return is_file(__DIR__ . "/../../../../../../config/connexion.inc")
|
return is_file(__DIR__ . "/../../../../../../config/connexion.inc")
|
||||||
&& is_file(__DIR__ . "/../../../../../../config/config.inc");
|
&& is_file(__DIR__ . "/../../../../../../config/config.inc");
|
||||||
}
|
}
|
||||||
|
@@ -27,9 +27,9 @@ class Controller
|
|||||||
/**
|
/**
|
||||||
* Factory of ControlProvider
|
* Factory of ControlProvider
|
||||||
*
|
*
|
||||||
* @param string $type
|
* @param string $type
|
||||||
* @return \Alchemy\Phrasea\Vocabulary\ControlProvider\ControlProviderInterface
|
* @return \Alchemy\Phrasea\Vocabulary\ControlProvider\ControlProviderInterface
|
||||||
* @throws \Exception when ControlProvider is not found
|
* @throws \Exception when ControlProvider is not found
|
||||||
*/
|
*/
|
||||||
public static function get(Application $app, $type)
|
public static function get(Application $app, $type)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user