This commit is contained in:
Romain Neutron
2012-06-19 10:40:14 +02:00
parent cd78d5566b
commit e28184167e
153 changed files with 183 additions and 568 deletions

View File

@@ -23,7 +23,6 @@ use Symfony\Component\HttpKernel\Exception;
*/ */
return call_user_func(function() { return call_user_func(function() {
$app = new \Silex\Application(); $app = new \Silex\Application();
/** /**
@@ -86,7 +85,7 @@ return call_user_func(function() {
return; return;
} catch (\Exception $e) { } catch (\Exception $e) {
} }
} }
$auth = new \Session_Authentication_None($user); $auth = new \Session_Authentication_None($user);
@@ -96,7 +95,6 @@ return call_user_func(function() {
return; return;
}); });
/** /**
* oAUth log process * oAUth log process
* *
@@ -297,7 +295,6 @@ return call_user_func(function() {
} }
)->before($mustBeAdmin); )->before($mustBeAdmin);
/** /**
* ******************************************************************* * *******************************************************************
* Route : /databoxes/list/ * Route : /databoxes/list/
@@ -335,7 +332,6 @@ return call_user_func(function() {
$app->get('/databoxes/{any_id}/collections/', $bad_request_exception); $app->get('/databoxes/{any_id}/collections/', $bad_request_exception);
/** /**
* ******************************************************************* * *******************************************************************
* Route /databoxes/DATABOX_ID/status/ * Route /databoxes/DATABOX_ID/status/
@@ -395,7 +391,6 @@ return call_user_func(function() {
$app->get('/databoxes/{any_id}/termsOfUse/', $bad_request_exception); $app->get('/databoxes/{any_id}/termsOfUse/', $bad_request_exception);
$route = '/quarantine/list/'; $route = '/quarantine/list/';
$app->get( $app->get(
$route, function(\Silex\Application $app, Request $request) { $route, function(\Silex\Application $app, Request $request) {
@@ -410,7 +405,6 @@ return call_user_func(function() {
} }
); );
/** /**
* ******************************************************************* * *******************************************************************
* Route : /records/add/ * Route : /records/add/
@@ -427,7 +421,6 @@ return call_user_func(function() {
} }
); );
/** /**
* Route : /records/search/ * Route : /records/search/
* *
@@ -453,7 +446,6 @@ return call_user_func(function() {
} }
); );
$route = '/records/{databox_id}/{record_id}/caption/'; $route = '/records/{databox_id}/{record_id}/caption/';
$app->get( $app->get(
$route, function($databox_id, $record_id) use ($app) { $route, function($databox_id, $record_id) use ($app) {
@@ -465,7 +457,6 @@ return call_user_func(function() {
$app->get('/records/{any_id}/{anyother_id}/caption/', $bad_request_exception); $app->get('/records/{any_id}/{anyother_id}/caption/', $bad_request_exception);
/** /**
* Route : /records/DATABOX_ID/RECORD_ID/metadatas/ * Route : /records/DATABOX_ID/RECORD_ID/metadatas/
* *
@@ -592,7 +583,6 @@ return call_user_func(function() {
$app->post('/records/{any_id}/{anyother_id}/setstatus/', $bad_request_exception); $app->post('/records/{any_id}/{anyother_id}/setstatus/', $bad_request_exception);
/** /**
* Route : /records/DATABOX_ID/RECORD_ID/setcollection/ * Route : /records/DATABOX_ID/RECORD_ID/setcollection/
* *
@@ -613,7 +603,6 @@ return call_user_func(function() {
)->assert('databox_id', '\d+')->assert('record_id', '\d+'); )->assert('databox_id', '\d+')->assert('record_id', '\d+');
$app->post('/records/{wrong_databox_id}/{wrong_record_id}/setcollection/', $bad_request_exception); $app->post('/records/{wrong_databox_id}/{wrong_record_id}/setcollection/', $bad_request_exception);
$route = '/records/{databox_id}/{record_id}/'; $route = '/records/{databox_id}/{record_id}/';
$app->get($route, function($databox_id, $record_id) use ($app) { $app->get($route, function($databox_id, $record_id) use ($app) {
$result = $app['api']->get_record($app['request'], $databox_id, $record_id); $result = $app['api']->get_record($app['request'], $databox_id, $record_id);
@@ -639,7 +628,6 @@ return call_user_func(function() {
} }
); );
/** /**
* Route : /baskets/add/ * Route : /baskets/add/
* *
@@ -657,8 +645,6 @@ return call_user_func(function() {
} }
); );
/** /**
* Route : /baskets/BASKET_ID/content/ * Route : /baskets/BASKET_ID/content/
* *
@@ -678,7 +664,6 @@ return call_user_func(function() {
)->assert('basket_id', '\d+'); )->assert('basket_id', '\d+');
$app->get('/baskets/{wrong_basket_id}/content/', $bad_request_exception); $app->get('/baskets/{wrong_basket_id}/content/', $bad_request_exception);
/** /**
* Route : /baskets/BASKET_ID/settitle/ * Route : /baskets/BASKET_ID/settitle/
* *
@@ -698,7 +683,6 @@ return call_user_func(function() {
)->assert('basket_id', '\d+'); )->assert('basket_id', '\d+');
$app->post('/baskets/{wrong_basket_id}/setname/', $bad_request_exception); $app->post('/baskets/{wrong_basket_id}/setname/', $bad_request_exception);
/** /**
* Route : /baskets/BASKET_ID/setdescription/ * Route : /baskets/BASKET_ID/setdescription/
* *
@@ -737,7 +721,6 @@ return call_user_func(function() {
)->assert('basket_id', '\d+'); )->assert('basket_id', '\d+');
$app->post('/baskets/{wrong_basket_id}/delete/', $bad_request_exception); $app->post('/baskets/{wrong_basket_id}/delete/', $bad_request_exception);
/** /**
* Route : /feeds/list/ * Route : /feeds/list/
* *
@@ -755,7 +738,6 @@ return call_user_func(function() {
} }
); );
$route = '/feeds/content/'; $route = '/feeds/content/';
$app->get( $app->get(
$route, function() use ($app) { $route, function() use ($app) {
@@ -803,7 +785,7 @@ return call_user_func(function() {
$app->error(function (\Exception $e) use ($app) { $app->error(function (\Exception $e) use ($app) {
$headers = array(); $headers = array();
if ($e instanceof \API_V1_exception_methodnotallowed) { if ($e instanceof \API_V1_exception_methodnotallowed) {
$code = \API_V1_result::ERROR_METHODNOTALLOWED; $code = \API_V1_result::ERROR_METHODNOTALLOWED;
} elseif ($e instanceof Exception\MethodNotAllowedHttpException) { } elseif ($e instanceof Exception\MethodNotAllowedHttpException) {
@@ -824,18 +806,19 @@ return call_user_func(function() {
$code = \API_V1_result::ERROR_INTERNALSERVERERROR; $code = \API_V1_result::ERROR_INTERNALSERVERERROR;
} }
if($e instanceof \Symfony\Component\HttpKernel\Exception\HttpException) { if ($e instanceof \Symfony\Component\HttpKernel\Exception\HttpException) {
$headers = $e->getHeaders(); $headers = $e->getHeaders();
} }
$result = $app['api']->get_error_message($app['request'], $code, $e->getMessage()); $result = $app['api']->get_error_message($app['request'], $code, $e->getMessage());
$response = $result->get_response(); $response = $result->get_response();
foreach ($headers as $key => $value) { foreach ($headers as $key => $value) {
$response->headers->set($key, $value); $response->headers->set($key, $value);
} }
return $response; return $response;
}); });
return $app; return $app;
}); });

View File

@@ -75,7 +75,6 @@ return call_user_func(
return new Response(''); return new Response('');
} }
$em = $app['Core']->getEntityManager(); $em = $app['Core']->getEntityManager();
/* @var $repository \Repositories\BasketElementRepository */ /* @var $repository \Repositories\BasketElementRepository */
@@ -126,7 +125,6 @@ return call_user_func(
$appbox = \appbox::get_instance($app['Core']); $appbox = \appbox::get_instance($app['Core']);
$usr_id = $appbox->get_session()->get_usr_id(); $usr_id = $appbox->get_session()->get_usr_id();
$Basket = $BasketElement->getBasket(); $Basket = $BasketElement->getBasket();
$ret = array(); $ret = array();
@@ -151,9 +149,6 @@ return call_user_func(
} }
)->assert('sselcont_id', '\d+'); )->assert('sselcont_id', '\d+');
$app->get('/ajax/LOAD_FEED_ITEM/{entry_id}/{item_id}/', function(\Silex\Application $app, $entry_id, $item_id) { $app->get('/ajax/LOAD_FEED_ITEM/{entry_id}/{item_id}/', function(\Silex\Application $app, $entry_id, $item_id) {
/* @var $twig \Twig_Environment */ /* @var $twig \Twig_Environment */
$twig = $app['Core']->getTwig(); $twig = $app['Core']->getTwig();
@@ -190,7 +185,6 @@ return call_user_func(
$ret['options_html'] = $twig->render($template_options, array('feed_element' => $item)); $ret['options_html'] = $twig->render($template_options, array('feed_element' => $item));
$ret['caption'] = $twig->render($template_caption, array('view' => 'preview', 'record' => $item->get_record())); $ret['caption'] = $twig->render($template_caption, array('view' => 'preview', 'record' => $item->get_record()));
$ret['agreement_html'] = $ret['selector_html'] = $ret['note_html'] = ''; $ret['agreement_html'] = $ret['selector_html'] = $ret['note_html'] = '';
$Serializer = $app['Core']['Serializer']; $Serializer = $app['Core']['Serializer'];
@@ -224,7 +218,6 @@ return call_user_func(
, false , false
); );
if ($basket->getIsRead() === false) { if ($basket->getIsRead() === false) {
$basket = $em->merge($basket); $basket = $em->merge($basket);
$basket->setIsRead(true); $basket->setIsRead(true);
@@ -279,7 +272,6 @@ return call_user_func(
, false , false
); );
if ($basket->getIsRead() === false) { if ($basket->getIsRead() === false) {
$basket = $em->merge($basket); $basket = $em->merge($basket);
$basket->setIsRead(true); $basket->setIsRead(true);
@@ -314,8 +306,6 @@ return call_user_func(
} }
)->assert('ssel_id', '\d+'); )->assert('ssel_id', '\d+');
$app->get('/feeds/entry/{entry_id}/', function (\Silex\Application $app, $entry_id) use ($appbox) { $app->get('/feeds/entry/{entry_id}/', function (\Silex\Application $app, $entry_id) use ($appbox) {
\User_Adapter::updateClientInfos((6)); \User_Adapter::updateClientInfos((6));
@@ -493,7 +483,6 @@ return call_user_func(
} }
)->assert('sselcont_id', '\d+'); )->assert('sselcont_id', '\d+');
$app->post('/ajax/SET_RELEASE/{ssel_id}/', function(\Silex\Application $app, $ssel_id) use ($appbox) { $app->post('/ajax/SET_RELEASE/{ssel_id}/', function(\Silex\Application $app, $ssel_id) use ($appbox) {
$em = $app['Core']->getEntityManager(); $em = $app['Core']->getEntityManager();
@@ -535,7 +524,6 @@ return call_user_func(
, $basket->getId() , $basket->getId()
); );
$to = $basket->getValidation()->getInitiator()->get_id(); $to = $basket->getValidation()->getInitiator()->get_id();
$params = array( $params = array(
'ssel_id' => $basket->getId(), 'ssel_id' => $basket->getId(),
@@ -544,11 +532,8 @@ return call_user_func(
'to' => $to 'to' => $to
); );
$evt_mngr->trigger('__VALIDATION_DONE__', $params); $evt_mngr->trigger('__VALIDATION_DONE__', $params);
$participant->setIsConfirmed(true); $participant->setIsConfirmed(true);
$em->merge($participant); $em->merge($participant);
@@ -574,8 +559,6 @@ return call_user_func(
} }
)->assert('ssel_id', '\d+'); )->assert('ssel_id', '\d+');
$app->error(function($e) use($app) { $app->error(function($e) use($app) {
/* @var $twig \Twig_Environment */ /* @var $twig \Twig_Environment */

View File

@@ -60,12 +60,10 @@ return call_user_func(function() {
return $response; return $response;
}); });
/* * ******************************************************************* /* * *******************************************************************
* AUTHENTIFICATION API * AUTHENTIFICATION API
*/ */
/** /**
* AUTHORIZE ENDPOINT * AUTHORIZE ENDPOINT
* *
@@ -93,7 +91,6 @@ return call_user_func(function() {
$action_accept = $request->get("action_accept", null); $action_accept = $request->get("action_accept", null);
$action_login = $request->get("action_login", null); $action_login = $request->get("action_login", null);
$template = "api/auth/end_user_authorization.twig"; $template = "api/auth/end_user_authorization.twig";
$custom_template = sprintf( $custom_template = sprintf(
@@ -102,7 +99,6 @@ return call_user_func(function() {
, $client->get_id() , $client->get_id()
); );
if (file_exists($custom_template)) { if (file_exists($custom_template)) {
$template = sprintf( $template = sprintf(
'api/auth/end_user_authorization/%s.twig' 'api/auth/end_user_authorization/%s.twig'
@@ -188,8 +184,6 @@ return call_user_func(function() {
$app->get($route, $authorize_func); $app->get($route, $authorize_func);
$app->post($route, $authorize_func); $app->post($route, $authorize_func);
/** /**
* TOKEN ENDPOINT * TOKEN ENDPOINT
* Token endpoint - used to exchange an authorization grant for an access token. * Token endpoint - used to exchange an authorization grant for an access token.
@@ -207,7 +201,6 @@ return call_user_func(function() {
return; return;
}); });
/****************************************************************** /******************************************************************
* MANAGEMENT APPS * MANAGEMENT APPS
* *
@@ -243,8 +236,6 @@ return call_user_func(function() {
return $app['response']('api/auth/application_dev_new.twig', $var); return $app['response']('api/auth/application_dev_new.twig', $var);
}); });
$route = "/applications/dev/create"; $route = "/applications/dev/create";
$app->post($route, function() use ($app) { $app->post($route, function() use ($app) {
$submit = false; $submit = false;
@@ -279,7 +270,6 @@ return call_user_func(function() {
return $app['response']('api/auth/application_dev_new.twig', $var); return $app['response']('api/auth/application_dev_new.twig', $var);
}); });
/** /**
* show details of app identified by its id * show details of app identified by its id
*/ */
@@ -443,6 +433,5 @@ return call_user_func(function() {
return new Response($msg, $code, $headers); return new Response($msg, $code, $headers);
}); });
return $app; return $app;
}); });

View File

@@ -41,7 +41,6 @@ return call_user_func(
$pathOut = \recordutils_image::stamp($record->get_base_id(), $record->get_record_id()); $pathOut = \recordutils_image::stamp($record->get_base_id(), $record->get_record_id());
} }
$log_id = null; $log_id = null;
try { try {
$registry = \registry::get_instance(); $registry = \registry::get_instance();
@@ -55,7 +54,7 @@ return call_user_func(
$record->log_view($log_id, $referrer, $registry->get('GV_sit')); $record->log_view($log_id, $referrer, $registry->get('GV_sit'));
} catch (\Exception $e) { } catch (\Exception $e) {
} }
$response = \set_export::stream_file($pathOut, $file->get_file(), $file->get_mime(), 'attachment'); $response = \set_export::stream_file($pathOut, $file->get_file(), $file->get_mime(), 'attachment');
@@ -82,7 +81,6 @@ return call_user_func(
throw new \Exception_Session_NotAuthenticated(); throw new \Exception_Session_NotAuthenticated();
} }
$all_access = false; $all_access = false;
$subdefStruct = $databox->get_subdef_structure(); $subdefStruct = $databox->get_subdef_structure();
@@ -139,7 +137,6 @@ return call_user_func(
return $deliver_content($app['request'], $session, $record, $subdef, $watermark, $stamp, $app); return $deliver_content($app['request'], $session, $record, $subdef, $watermark, $stamp, $app);
})->assert('sbas_id', '\d+')->assert('record_id', '\d+'); })->assert('sbas_id', '\d+')->assert('record_id', '\d+');
$app->get('/permalink/v1/{label}/{sbas_id}/{record_id}/{key}/{subdef}/view/' $app->get('/permalink/v1/{label}/{sbas_id}/{record_id}/{key}/{subdef}/view/'
, function($label, $sbas_id, $record_id, $key, $subdef) use($app) { , function($label, $sbas_id, $record_id, $key, $subdef) use($app) {
@@ -164,7 +161,6 @@ return call_user_func(
return $twig->render('overview.twig', $params); return $twig->render('overview.twig', $params);
})->assert('sbas_id', '\d+')->assert('record_id', '\d+'); })->assert('sbas_id', '\d+')->assert('record_id', '\d+');
$app->get('/permalink/v1/{label}/{sbas_id}/{record_id}/{key}/{subdef}/' $app->get('/permalink/v1/{label}/{sbas_id}/{record_id}/{key}/{subdef}/'
, function($label, $sbas_id, $record_id, $key, $subdef) use ($app, $session, $deliver_content) { , function($label, $sbas_id, $record_id, $key, $subdef) use ($app, $session, $deliver_content) {
$databox = \databox::get_instance((int) $sbas_id); $databox = \databox::get_instance((int) $sbas_id);
@@ -214,7 +210,6 @@ return call_user_func(
) )
->assert('sbas_id', '\d+')->assert('record_id', '\d+'); ->assert('sbas_id', '\d+')->assert('record_id', '\d+');
$app->error(function (\Exception $e) { $app->error(function (\Exception $e) {
if ($e instanceof \Exception_Session_NotAuthenticated) { if ($e instanceof \Exception_Session_NotAuthenticated) {
$code = 403; $code = 403;
@@ -233,9 +228,6 @@ return call_user_func(
return new Response($message, $code); return new Response($message, $code);
}); });
return $app; return $app;
} }
); );

View File

@@ -114,6 +114,5 @@ return call_user_func(function() {
} }
}); });
return $app; return $app;
}); });

View File

@@ -52,7 +52,6 @@ return call_user_func(function() {
return; return;
}); });
$app->get('/', function() use ($app) { $app->get('/', function() use ($app) {
if ($app['install'] === true) { if ($app['install'] === true) {
return $app->redirect('/setup/installer/'); return $app->redirect('/setup/installer/');
@@ -61,7 +60,6 @@ return call_user_func(function() {
} }
}); });
$app->mount('/installer/', new Controller\Installer()); $app->mount('/installer/', new Controller\Installer());
$app->mount('/upgrader/', new Controller\Upgrader()); $app->mount('/upgrader/', new Controller\Upgrader());
$app->mount('/test', new ControllerUtils\PathFileTest()); $app->mount('/test', new ControllerUtils\PathFileTest());

View File

@@ -25,10 +25,10 @@ abstract class AbstractChecker implements CheckerInterface
* Restrict the checker to a set of databoxes. * Restrict the checker to a set of databoxes.
* Warning, you can not restrict on both databoxes and collections * Warning, you can not restrict on both databoxes and collections
* *
* @param databox|array $databoxes A databox or an array of databoxes * @param databox|array $databoxes A databox or an array of databoxes
* @return Boolean * @return Boolean
* *
* @throws \LogicException If already restricted to collections * @throws \LogicException If already restricted to collections
* @throws \InvalidArgumentException In case invalid databoxes are provided * @throws \InvalidArgumentException In case invalid databoxes are provided
*/ */
public function restrictToDataboxes($databoxes) public function restrictToDataboxes($databoxes)
@@ -53,10 +53,10 @@ abstract class AbstractChecker implements CheckerInterface
* Restrict the checker to a set of collections. * Restrict the checker to a set of collections.
* Warning, you can not restrict on both databoxes and collections * Warning, you can not restrict on both databoxes and collections
* *
* @param collection|array $collections * @param collection|array $collections
* @return Boolean * @return Boolean
* *
* @throws \LogicException If already restricted to databoxes * @throws \LogicException If already restricted to databoxes
* @throws \InvalidArgumentException In case invalid collections are provided * @throws \InvalidArgumentException In case invalid collections are provided
*/ */
public function restrictToCollections($collections) public function restrictToCollections($collections)
@@ -90,7 +90,6 @@ abstract class AbstractChecker implements CheckerInterface
return true; return true;
} }
$fileDatabox = $file->getCollection()->get_databox(); $fileDatabox = $file->getCollection()->get_databox();
foreach ($this->databoxes as $databox) { foreach ($this->databoxes as $databox) {

View File

@@ -31,8 +31,8 @@ interface CheckerInterface
/** /**
* Checks if a Checker is applicable on a file * Checks if a Checker is applicable on a file
* *
* @param File $file The file package object * @param File $file The file package object
* @return Boolean * @return Boolean
*/ */
public function isApplicable(File $file); public function isApplicable(File $file);

View File

@@ -277,7 +277,7 @@ class File
public function buildFromPathfile($pathfile, \collection $collection, $originalName = null) public function buildFromPathfile($pathfile, \collection $collection, $originalName = null)
{ {
$core = \bootstrap::getCore(); $core = \bootstrap::getCore();
try { try {
$media = $core['mediavorus']->guess(new \SplFileInfo($pathfile)); $media = $core['mediavorus']->guess(new \SplFileInfo($pathfile));
} catch (\MediaVorus\Exception\FileNotFoundException $e) { } catch (\MediaVorus\Exception\FileNotFoundException $e) {

View File

@@ -36,7 +36,7 @@ class ApcCache extends DoctrineApc implements Cache
{ {
return false; return false;
} }
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */

View File

@@ -36,7 +36,7 @@ class ArrayCache extends DoctrineArray implements Cache
{ {
return false; return false;
} }
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */

View File

@@ -95,7 +95,7 @@ class RedisCache extends CacheProvider implements Cache
protected function doGetStats() protected function doGetStats()
{ {
$stats = $this->_redis->info(); $stats = $this->_redis->info();
return array( return array(
Cache::STATS_HITS => false, Cache::STATS_HITS => false,
Cache::STATS_MISSES => false, Cache::STATS_MISSES => false,

View File

@@ -36,7 +36,7 @@ class XcacheCache extends DoctrineXcache implements Cache
{ {
return false; return false;
} }
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */

View File

@@ -33,7 +33,6 @@ class BuildMissingSubdefs extends Command
{ {
parent::__construct($name); parent::__construct($name);
return $this; return $this;
} }
@@ -129,7 +128,7 @@ class BuildMissingSubdefs extends Command
/** /**
* Format a duration in seconds to human readable * Format a duration in seconds to human readable
* *
* @param type $seconds the time to format * @param type $seconds the time to format
* @return string * @return string
*/ */
public function getFormattedDuration($seconds) public function getFormattedDuration($seconds)

View File

@@ -13,7 +13,6 @@ namespace Alchemy\Phrasea\Command;
use Monolog\Logger; use Monolog\Logger;
use Symfony\Component\Console\Command\Command as SymfoCommand; use Symfony\Component\Console\Command\Command as SymfoCommand;
use Symfony\Component\Console\Output\OutputInterface;
/** /**
* Abstract command which represents a Phraseanet base command * Abstract command which represents a Phraseanet base command
@@ -26,7 +25,7 @@ abstract class Command extends SymfoCommand
/** /**
* Constructor * Constructor
* @param type $name * @param type $name
*/ */
public function __construct($name) public function __construct($name)
{ {
@@ -38,8 +37,8 @@ abstract class Command extends SymfoCommand
/** /**
* Set a logger to the command * Set a logger to the command
* *
* @param Logger $logger * @param Logger $logger
* @return \Alchemy\Phrasea\Command\Command * @return \Alchemy\Phrasea\Command\Command
*/ */
public function setLogger(Logger $logger) public function setLogger(Logger $logger)
{ {

View File

@@ -25,7 +25,7 @@ use Symfony\Component\Console\Output\OutputInterface;
class RescanTechnicalDatas extends Command class RescanTechnicalDatas extends Command
{ {
/** /**
* The average speed (record/sec), used to warn about duration * The average speed (record/sec), used to warn about duration
*/ */
const AVG_SPEED = 2.8; const AVG_SPEED = 2.8;
@@ -38,7 +38,6 @@ class RescanTechnicalDatas extends Command
{ {
parent::__construct($name); parent::__construct($name);
$this->setDescription('Rescan databases for technical datas'); $this->setDescription('Rescan databases for technical datas');
$this->setHelp('Old Phraseanet version did not fully read technical datas. This command rescan all records of these datas.'); $this->setHelp('Old Phraseanet version did not fully read technical datas. This command rescan all records of these datas.');
@@ -72,6 +71,7 @@ class RescanTechnicalDatas extends Command
if (strtolower($continue) !== 'y') { if (strtolower($continue) !== 'y') {
$output->writeln('Aborting !'); $output->writeln('Aborting !');
return; return;
} }
@@ -108,8 +108,8 @@ class RescanTechnicalDatas extends Command
/** /**
* Format a duration in seconds to human readable * Format a duration in seconds to human readable
* *
* @param type $seconds the time to format * @param type $seconds the time to format
* @return string * @return string
*/ */
public function getFormattedDuration($seconds) public function getFormattedDuration($seconds)
{ {
@@ -128,7 +128,7 @@ class RescanTechnicalDatas extends Command
/** /**
* Return the total quantity of records to process * Return the total quantity of records to process
* *
* @return integer * @return integer
*/ */
protected function computeQuantity() protected function computeQuantity()
{ {

View File

@@ -31,7 +31,6 @@ class Description implements ControllerProviderInterface
$controllers = new ControllerCollection(); $controllers = new ControllerCollection();
$controllers->get('/metadatas/search/', function(Application $app, Request $request) { $controllers->get('/metadatas/search/', function(Application $app, Request $request) {
$term = trim(strtolower($request->get('term'))); $term = trim(strtolower($request->get('term')));
@@ -171,7 +170,6 @@ class Description implements ControllerProviderInterface
$fields = $databox->get_meta_structure(); $fields = $databox->get_meta_structure();
$available_dc_fields = $databox->get_available_dcfields(); $available_dc_fields = $databox->get_available_dcfields();
$databox->get_connection()->beginTransaction(); $databox->get_connection()->beginTransaction();
$error = false; $error = false;
try { try {
@@ -200,7 +198,7 @@ class Description implements ControllerProviderInterface
$field->setVocabularyControl($vocabulary); $field->setVocabularyControl($vocabulary);
$field->setVocabularyRestricted($request->get('vocabularyrestricted_' . $id)); $field->setVocabularyRestricted($request->get('vocabularyrestricted_' . $id));
} catch (\Exception $e) { } catch (\Exception $e) {
} }
$dces_element = null; $dces_element = null;
@@ -227,7 +225,7 @@ class Description implements ControllerProviderInterface
$field = \databox_field::get_instance($databox, $id); $field = \databox_field::get_instance($databox, $id);
$field->delete(); $field->delete();
} catch (\Exception $e) { } catch (\Exception $e) {
} }
} }
} }
@@ -258,7 +256,6 @@ class Description implements ControllerProviderInterface
$fields = $databox->get_meta_structure(); $fields = $databox->get_meta_structure();
$available_dc_fields = $databox->get_available_dcfields(); $available_dc_fields = $databox->get_available_dcfields();
$params = array( $params = array(
'databox' => $databox, 'databox' => $databox,
'fields' => $fields, 'fields' => $fields,

View File

@@ -43,7 +43,6 @@ class Publications implements ControllerProviderInterface
return $twig->render($template, array('feeds' => $feeds)); return $twig->render($template, array('feeds' => $feeds));
}); });
$controllers->post('/create/', function() use ($app, $appbox) { $controllers->post('/create/', function() use ($app, $appbox) {
$user = \User_Adapter::getInstance($appbox->get_session()->get_usr_id(), $appbox); $user = \User_Adapter::getInstance($appbox->get_session()->get_usr_id(), $appbox);
@@ -59,7 +58,6 @@ class Publications implements ControllerProviderInterface
return $app->redirect('/admin/publications/list/'); return $app->redirect('/admin/publications/list/');
}); });
$controllers->get('/feed/{id}/', function($id) use ($app, $appbox) { $controllers->get('/feed/{id}/', function($id) use ($app, $appbox) {
$feed = new \Feed_Adapter($appbox, $id); $feed = new \Feed_Adapter($appbox, $id);
@@ -74,7 +72,6 @@ class Publications implements ControllerProviderInterface
); );
})->assert('id', '\d+'); })->assert('id', '\d+');
$controllers->post('/feed/{id}/update/', function($id) use ($app, $appbox) { $controllers->post('/feed/{id}/update/', function($id) use ($app, $appbox) {
$feed = new \Feed_Adapter($appbox, $id); $feed = new \Feed_Adapter($appbox, $id);
@@ -100,7 +97,6 @@ class Publications implements ControllerProviderInterface
return $app->redirect('/admin/publications/list/'); return $app->redirect('/admin/publications/list/');
})->assert('id', '\d+'); })->assert('id', '\d+');
$controllers->post('/feed/{id}/iconupload/', function($id) use ($app, $appbox) { $controllers->post('/feed/{id}/iconupload/', function($id) use ($app, $appbox) {
try { try {
$datas = array( $datas = array(
@@ -188,7 +184,6 @@ class Publications implements ControllerProviderInterface
return $app->redirect('/admin/publications/feed/' . $id . '/?err=' . $error); return $app->redirect('/admin/publications/feed/' . $id . '/?err=' . $error);
})->assert('id', '\d+'); })->assert('id', '\d+');
$controllers->post('/feed/{id}/removepublisher/', function($id) use ($app, $appbox) { $controllers->post('/feed/{id}/removepublisher/', function($id) use ($app, $appbox) {
try { try {
$request = $app['request']; $request = $app['request'];

View File

@@ -81,7 +81,6 @@ class Root implements ControllerProviderInterface
$databoxes[] = $databox; $databoxes[] = $databox;
} }
$twig = $Core->getTwig(); $twig = $Core->getTwig();
return new Response($twig->render('admin/index.html.twig', array( return new Response($twig->render('admin/index.html.twig', array(

View File

@@ -79,7 +79,6 @@ class Subdefs implements ControllerProviderInterface
$subdefs = $databox->get_subdef_structure(); $subdefs = $databox->get_subdef_structure();
foreach ($Parmsubdefs as $post_sub) { foreach ($Parmsubdefs as $post_sub) {
$options = array(); $options = array();

View File

@@ -33,7 +33,6 @@ class Users implements ControllerProviderInterface
$controllers = new ControllerCollection(); $controllers = new ControllerCollection();
$controllers->post('/rights/', function(Application $app) { $controllers->post('/rights/', function(Application $app) {
$rights = new UserHelper\Edit($app['Core'], $app['request']); $rights = new UserHelper\Edit($app['Core'], $app['request']);
@@ -233,7 +232,6 @@ class Users implements ControllerProviderInterface
); );
} }
$CSVDatas = \format::arr_to_csv($userTable); $CSVDatas = \format::arr_to_csv($userTable);
$response = new Response($CSVDatas, 200, array('Content-Type' => 'text/plain')); $response = new Response($CSVDatas, 200, array('Content-Type' => 'text/plain'));
@@ -265,7 +263,6 @@ class Users implements ControllerProviderInterface
$have_not_right = $request->get('have_not_right') ? : array(); $have_not_right = $request->get('have_not_right') ? : array();
$on_base = $request->get('on_base') ? : array(); $on_base = $request->get('on_base') ? : array();
$elligible_users = $user_query $elligible_users = $user_query
->on_sbas_where_i_am($user->ACL(), $rights) ->on_sbas_where_i_am($user->ACL(), $rights)
->like(\User_Query::LIKE_EMAIL, $like_value) ->like(\User_Query::LIKE_EMAIL, $like_value)
@@ -299,7 +296,6 @@ class Users implements ControllerProviderInterface
); );
}); });
$controllers->post('/create/', function(Application $app) { $controllers->post('/create/', function(Application $app) {
$datas = array('error' => false, 'message' => '', 'data' => null); $datas = array('error' => false, 'message' => '', 'data' => null);

View File

@@ -231,7 +231,6 @@ class Basket implements ControllerProviderInterface
); );
})->assert('basket_id', '\d+'); })->assert('basket_id', '\d+');
/** /**
* Get the Basket reorder form * Get the Basket reorder form
*/ */
@@ -255,7 +254,6 @@ class Basket implements ControllerProviderInterface
); );
})->assert('basket_id', '\d+'); })->assert('basket_id', '\d+');
$controllers->post( $controllers->post(
'/{basket_id}/reorder/' '/{basket_id}/reorder/'
, function(Application $app, $basket_id) { , function(Application $app, $basket_id) {
@@ -267,10 +265,8 @@ class Basket implements ControllerProviderInterface
$basket = $em->getRepository('\Entities\Basket') $basket = $em->getRepository('\Entities\Basket')
->findUserBasket($basket_id, $app['Core']->getAuthenticatedUser(), true); ->findUserBasket($basket_id, $app['Core']->getAuthenticatedUser(), true);
$order = $app['request']->get('element'); $order = $app['request']->get('element');
/* @var $basket \Entities\Basket */ /* @var $basket \Entities\Basket */
foreach ($basket->getElements() as $basketElement) { foreach ($basket->getElements() as $basketElement) {
if (isset($order[$basketElement->getId()])) { if (isset($order[$basketElement->getId()])) {
@@ -290,7 +286,6 @@ class Basket implements ControllerProviderInterface
return new Response($Serializer->serialize($ret, 'json'), 200, array('Content-type' => 'application/json')); return new Response($Serializer->serialize($ret, 'json'), 200, array('Content-type' => 'application/json'));
})->assert('basket_id', '\d+'); })->assert('basket_id', '\d+');
/** /**
* Toggle the status of a Basket * Toggle the status of a Basket
* *
@@ -407,9 +402,6 @@ class Basket implements ControllerProviderInterface
} }
})->assert('basket_id', '\d+'); })->assert('basket_id', '\d+');
/** /**
* *
* Move Basket element from a basket to another * Move Basket element from a basket to another

View File

@@ -106,7 +106,6 @@ class Bridge implements ControllerProviderInterface
return new Response($twig->render('prod/actions/Bridge/callback.twig', $params)); return new Response($twig->render('prod/actions/Bridge/callback.twig', $params));
}); });
$controllers->get('/adapter/{account_id}/logout/' $controllers->get('/adapter/{account_id}/logout/'
, function($account_id) use ($app, $twig) { , function($account_id) use ($app, $twig) {
$appbox = \appbox::get_instance($app['Core']); $appbox = \appbox::get_instance($app['Core']);
@@ -117,7 +116,6 @@ class Bridge implements ControllerProviderInterface
return $app->redirect('/prod/bridge/adapter/' . $account_id . '/load-elements/' . $account->get_api()->get_connector()->get_default_element_type() . '/'); return $app->redirect('/prod/bridge/adapter/' . $account_id . '/load-elements/' . $account->get_api()->get_connector()->get_default_element_type() . '/');
})->assert('account_id', '\d+'); })->assert('account_id', '\d+');
$controllers->get('/adapter/{account_id}/load-records/' $controllers->get('/adapter/{account_id}/load-records/'
, function($account_id) use ($app, $twig) { , function($account_id) use ($app, $twig) {
$page = max((int) $app['request']->get('page'), 0); $page = max((int) $app['request']->get('page'), 0);
@@ -191,7 +189,6 @@ class Bridge implements ControllerProviderInterface
}) })
->assert('account_id', '\d+'); ->assert('account_id', '\d+');
$controllers->get('/action/{account_id}/{action}/{element_type}/' $controllers->get('/action/{account_id}/{action}/{element_type}/'
, function($account_id, $action, $element_type) use ($app, $twig) { , function($account_id, $action, $element_type) use ($app, $twig) {
@@ -259,7 +256,6 @@ class Bridge implements ControllerProviderInterface
return new Response($html); return new Response($html);
})->assert('account_id', '\d+'); })->assert('account_id', '\d+');
$controllers->post('/action/{account_id}/{action}/{element_type}/' $controllers->post('/action/{account_id}/{action}/{element_type}/'
, function($account_id, $action, $element_type) use ($app, $twig) { , function($account_id, $action, $element_type) use ($app, $twig) {
$appbox = \appbox::get_instance($app['Core']); $appbox = \appbox::get_instance($app['Core']);
@@ -361,11 +357,9 @@ class Bridge implements ControllerProviderInterface
break; break;
} }
return new Response($html); return new Response($html);
})->assert('account_id', '\d+'); })->assert('account_id', '\d+');
$controllers->get('/upload/', function(Application $app) use ($twig) { $controllers->get('/upload/', function(Application $app) use ($twig) {
$request = $app['request']; $request = $app['request'];
$appbox = \appbox::get_instance($app['Core']); $appbox = \appbox::get_instance($app['Core']);
@@ -392,7 +386,6 @@ class Bridge implements ControllerProviderInterface
return new Response($html); return new Response($html);
}); });
$controllers->post('/upload/' $controllers->post('/upload/'
, function(Application $app) use ($twig) { , function(Application $app) use ($twig) {
$errors = array(); $errors = array();

View File

@@ -46,7 +46,6 @@ class Feed implements ControllerProviderInterface
return new Response($datas); return new Response($datas);
}); });
/** /**
* I've selected a publication for my ocs, let's publish them * I've selected a publication for my ocs, let's publish them
*/ */
@@ -82,7 +81,6 @@ class Feed implements ControllerProviderInterface
); );
}); });
$controllers->get('/entry/{id}/edit/', function(Application $app, Request $request, $id) use ($appbox, $twig) { $controllers->get('/entry/{id}/edit/', function(Application $app, Request $request, $id) use ($appbox, $twig) {
$user = $app["Core"]->getAuthenticatedUser(); $user = $app["Core"]->getAuthenticatedUser();
@@ -100,7 +98,6 @@ class Feed implements ControllerProviderInterface
return new Response($datas); return new Response($datas);
})->assert('id', '\d+'); })->assert('id', '\d+');
$controllers->post('/entry/{id}/update/', function(Application $app, Request $request, $id) use ($appbox, $twig) { $controllers->post('/entry/{id}/update/', function(Application $app, Request $request, $id) use ($appbox, $twig) {
$datas = array('error' => true, 'message' => '', 'datas' => ''); $datas = array('error' => true, 'message' => '', 'datas' => '');
try { try {
@@ -123,20 +120,20 @@ class Feed implements ControllerProviderInterface
->set_author_name($author_name) ->set_author_name($author_name)
->set_title($title) ->set_title($title)
->set_subtitle($subtitle); ->set_subtitle($subtitle);
$current_feed_id = $entry->get_feed()->get_id(); $current_feed_id = $entry->get_feed()->get_id();
$new_feed_id = $request->get('feed_id',$current_feed_id); $new_feed_id = $request->get('feed_id',$current_feed_id);
if($current_feed_id != $new_feed_id) { if ($current_feed_id != $new_feed_id) {
try { try {
$new_feed = \Feed_Adapter::load_with_user($appbox, $user, $new_feed_id); $new_feed = \Feed_Adapter::load_with_user($appbox, $user, $new_feed_id);
} catch(\Exception_NotFound $e) { } catch (\Exception_NotFound $e) {
throw new \Exception_Forbidden('You have no access to this feed'); throw new \Exception_Forbidden('You have no access to this feed');
} }
if ( ! $new_feed->is_publisher($user)) { if ( ! $new_feed->is_publisher($user)) {
throw new \Exception_Forbidden('You are not publisher of this feed'); throw new \Exception_Forbidden('You are not publisher of this feed');
} }
$entry->set_feed($new_feed); $entry->set_feed($new_feed);
} }
@@ -180,7 +177,6 @@ class Feed implements ControllerProviderInterface
); );
})->assert('id', '\d+'); })->assert('id', '\d+');
$controllers->post('/entry/{id}/delete/', function(Application $app, Request $request, $id) use ($appbox, $twig) { $controllers->post('/entry/{id}/delete/', function(Application $app, Request $request, $id) use ($appbox, $twig) {
$datas = array('error' => true, 'message' => ''); $datas = array('error' => true, 'message' => '');
try { try {
@@ -255,7 +251,6 @@ class Feed implements ControllerProviderInterface
return new Response($datas); return new Response($datas);
}); });
$controllers->get('/feed/{id}/', function(Application $app, Request $request, $id) use ($appbox, $twig) { $controllers->get('/feed/{id}/', function(Application $app, Request $request, $id) use ($appbox, $twig) {
$page = (int) $request->get('page'); $page = (int) $request->get('page');
$page = $page > 0 ? $page : 1; $page = $page > 0 ? $page : 1;
@@ -270,7 +265,6 @@ class Feed implements ControllerProviderInterface
return new Response($datas); return new Response($datas);
})->assert('id', '\d+'); })->assert('id', '\d+');
$controllers->get('/subscribe/aggregated/', function(Application $app, Request $request) use ( $appbox, $twig) { $controllers->get('/subscribe/aggregated/', function(Application $app, Request $request) use ( $appbox, $twig) {
$renew = ($request->get('renew') === 'true'); $renew = ($request->get('renew') === 'true');
@@ -279,7 +273,6 @@ class Feed implements ControllerProviderInterface
$feeds = \Feed_Collection::load_all($appbox, $user); $feeds = \Feed_Collection::load_all($appbox, $user);
$registry = $appbox->get_registry(); $registry = $appbox->get_registry();
$output = array( $output = array(
'texte' => '<p>' . _('publication::Voici votre fil RSS personnel. Il vous permettra d\'etre tenu au courrant des publications.') 'texte' => '<p>' . _('publication::Voici votre fil RSS personnel. Il vous permettra d\'etre tenu au courrant des publications.')
. '</p><p>' . _('publications::Ne le partagez pas, il est strictement confidentiel') . '</p> . '</p><p>' . _('publications::Ne le partagez pas, il est strictement confidentiel') . '</p>
@@ -296,7 +289,6 @@ class Feed implements ControllerProviderInterface
); );
}); });
$controllers->get('/subscribe/{id}/', function(Application $app, Request $request, $id) use ($appbox, $twig) { $controllers->get('/subscribe/{id}/', function(Application $app, Request $request, $id) use ($appbox, $twig) {
$renew = ($request->get('renew') === 'true'); $renew = ($request->get('renew') === 'true');
$user = $app["Core"]->getAuthenticatedUser(); $user = $app["Core"]->getAuthenticatedUser();

View File

@@ -42,7 +42,6 @@ class MoveCollection implements ControllerProviderInterface
} }
); );
$controllers->post('/apply/', function(Application $app) { $controllers->post('/apply/', function(Application $app) {
$request = $app['request']; $request = $app['request'];
$move = new RecordHelper\MoveCollection($app['Core'], $app['request']); $move = new RecordHelper\MoveCollection($app['Core'], $app['request']);

View File

@@ -42,8 +42,6 @@ class Printer implements ControllerProviderInterface
} }
); );
$controllers->post('/print.pdf', function(Application $app) { $controllers->post('/print.pdf', function(Application $app) {
$printer = new RecordHelper\Printer($app['Core'], $app['request']); $printer = new RecordHelper\Printer($app['Core'], $app['request']);

View File

@@ -189,7 +189,6 @@ class Push implements ControllerProviderInterface
throw new ControllerException(_('No elements to push')); throw new ControllerException(_('No elements to push'));
} }
$events_manager = \eventsmanager_broker::getInstance(\appbox::get_instance($app['Core']), $app['Core']); $events_manager = \eventsmanager_broker::getInstance(\appbox::get_instance($app['Core']), $app['Core']);
foreach ($receivers as $receiver) { foreach ($receivers as $receiver) {
@@ -363,7 +362,6 @@ class Push implements ControllerProviderInterface
$Validation = $Basket->getValidation(); $Validation = $Basket->getValidation();
} }
$appbox = \appbox::get_instance($app['Core']); $appbox = \appbox::get_instance($app['Core']);
$found = false; $found = false;
@@ -608,7 +606,6 @@ class Push implements ControllerProviderInterface
} }
} }
return new Response($Serializer->serialize($result, 'json'), 200, array('Content-Type' => 'application/json')); return new Response($Serializer->serialize($result, 'json'), 200, array('Content-Type' => 'application/json'));
}); });
@@ -660,9 +657,6 @@ class Push implements ControllerProviderInterface
} }
); );
$controllers->match('/edit-list/{list_id}/', function(Application $app, Request $request, $list_id) { $controllers->match('/edit-list/{list_id}/', function(Application $app, Request $request, $list_id) {
$user = $app['Core']->getAuthenticatedUser(); $user = $app['Core']->getAuthenticatedUser();

View File

@@ -46,7 +46,6 @@ class Query implements ControllerProviderInterface
$options = new \searchEngine_options(); $options = new \searchEngine_options();
$bas = is_array($request->get('bas')) ? $request->get('bas') : array_keys($user->ACL()->get_granted_base()); $bas = is_array($request->get('bas')) ? $request->get('bas') : array_keys($user->ACL()->get_granted_base());
/* @var $user \User_Adapter */ /* @var $user \User_Adapter */
@@ -148,7 +147,6 @@ class Query implements ControllerProviderInterface
} }
$string .= '<div style="display:none;"><div id="NEXT_PAGE"></div><div id="PREV_PAGE"></div></div>'; $string .= '<div style="display:none;"><div id="NEXT_PAGE"></div><div id="PREV_PAGE"></div></div>';
$explain = "<div id=\"explainResults\" class=\"myexplain\">"; $explain = "<div id=\"explainResults\" class=\"myexplain\">";
$explain .= "<img src=\"/skins/icons/answers.gif\" /><span><b>"; $explain .= "<img src=\"/skins/icons/answers.gif\" /><span><b>";
@@ -204,7 +202,6 @@ class Query implements ControllerProviderInterface
) )
); );
$json['query'] = $query; $json['query'] = $query;
$json['phrasea_props'] = $proposals; $json['phrasea_props'] = $proposals;
$json['total_answers'] = (int) $result->get_count_available_results(); $json['total_answers'] = (int) $result->get_count_available_results();
@@ -212,7 +209,6 @@ class Query implements ControllerProviderInterface
$json['prev_page'] = ($page > 1 && $result->get_count_available_results() > 0) ? ($page - 1) : false; $json['prev_page'] = ($page > 1 && $result->get_count_available_results() > 0) ? ($page - 1) : false;
$json['form'] = $form; $json['form'] = $form;
$datas = $app['Core']['Serializer']->serialize($json, 'json'); $datas = $app['Core']['Serializer']->serialize($json, 'json');
return new Response($datas, 200, array('Content-Type' => 'application/json')); return new Response($datas, 200, array('Content-Type' => 'application/json'));

View File

@@ -67,7 +67,6 @@ class Root implements ControllerProviderInterface
$cssfile = '000000'; $cssfile = '000000';
} }
$user_feeds = \Feed_Collection::load_all($appbox, $user); $user_feeds = \Feed_Collection::load_all($appbox, $user);
$feeds = array_merge(array($user_feeds->get_aggregate()), $user_feeds->get_feeds()); $feeds = array_merge(array($user_feeds->get_aggregate()), $user_feeds->get_feeds());

View File

@@ -35,7 +35,6 @@ class Story implements ControllerProviderInterface
{ {
$controllers = new ControllerCollection(); $controllers = new ControllerCollection();
$controllers->get('/create/', function(Application $app) { $controllers->get('/create/', function(Application $app) {
/* @var $twig \Twig_Environment */ /* @var $twig \Twig_Environment */
$twig = $app['Core']->getTwig(); $twig = $app['Core']->getTwig();
@@ -51,7 +50,6 @@ class Story implements ControllerProviderInterface
$collection = \collection::get_from_base_id($request->get('base_id')); $collection = \collection::get_from_base_id($request->get('base_id'));
if ( ! $user->ACL()->has_right_on_base($collection->get_base_id(), 'canaddrecord')) { if ( ! $user->ACL()->has_right_on_base($collection->get_base_id(), 'canaddrecord')) {
throw new \Exception_Forbidden('You can not create a story on this collection'); throw new \Exception_Forbidden('You can not create a story on this collection');
} }
@@ -126,8 +124,6 @@ class Story implements ControllerProviderInterface
} }
}); });
$controllers->get('/{sbas_id}/{record_id}/', function(Application $app, $sbas_id, $record_id) { $controllers->get('/{sbas_id}/{record_id}/', function(Application $app, $sbas_id, $record_id) {
$Story = new \record_adapter($sbas_id, $record_id); $Story = new \record_adapter($sbas_id, $record_id);
@@ -139,7 +135,6 @@ class Story implements ControllerProviderInterface
return new Response($html); return new Response($html);
})->assert('sbas_id', '\d+')->assert('record_id', '\d+'); })->assert('sbas_id', '\d+')->assert('record_id', '\d+');
$controllers->post( $controllers->post(
'/{sbas_id}/{record_id}/addElements/' '/{sbas_id}/{record_id}/addElements/'
, function(Application $app, Request $request, $sbas_id, $record_id) { , function(Application $app, Request $request, $sbas_id, $record_id) {
@@ -225,7 +220,6 @@ class Story implements ControllerProviderInterface
->assert('child_sbas_id', '\d+') ->assert('child_sbas_id', '\d+')
->assert('child_record_id', '\d+'); ->assert('child_record_id', '\d+');
/** /**
* Get the Basket reorder form * Get the Basket reorder form
*/ */
@@ -254,7 +248,6 @@ class Story implements ControllerProviderInterface
->assert('sbas_id', '\d+') ->assert('sbas_id', '\d+')
->assert('record_id', '\d+'); ->assert('record_id', '\d+');
$controllers->post( $controllers->post(
'/{sbas_id}/{record_id}/reorder/' '/{sbas_id}/{record_id}/reorder/'
, function(Application $app, $sbas_id, $record_id) { , function(Application $app, $sbas_id, $record_id) {
@@ -302,7 +295,6 @@ class Story implements ControllerProviderInterface
->assert('sbas_id', '\d+') ->assert('sbas_id', '\d+')
->assert('record_id', '\d+'); ->assert('record_id', '\d+');
return $controllers; return $controllers;
} }
} }

View File

@@ -54,9 +54,9 @@ class Tools implements ControllerProviderInterface
->files($record->get_subdef('document')->get_pathfile()) ->files($record->get_subdef('document')->get_pathfile())
->first()->getMetadatas(); ->first()->getMetadatas();
} catch (\PHPExiftool\Exception\Exception $e) { } catch (\PHPExiftool\Exception\Exception $e) {
} catch (\Exception_Media_SubdefNotFound $e) { } catch (\Exception_Media_SubdefNotFound $e) {
} }
} }
} }
@@ -114,7 +114,7 @@ class Tools implements ControllerProviderInterface
break; break;
} }
} }
if ( ! $substituted || $request->get('ForceThumbSubstit') == '1') { if ( ! $substituted || $request->get('ForceThumbSubstit') == '1') {
$record->rebuild_subdefs(); $record->rebuild_subdefs();
} }

View File

@@ -53,7 +53,6 @@ class Tooltip implements ControllerProviderInterface
return $twig->render('prod/Tooltip/Story.html.twig', array('Story' => $Story)); return $twig->render('prod/Tooltip/Story.html.twig', array('Story' => $Story));
})->assert('sbas_id', '\d+')->assert('record_id', '\d+'); })->assert('sbas_id', '\d+')->assert('record_id', '\d+');
$controllers->post('/user/{usr_id}/' $controllers->post('/user/{usr_id}/'
, function(Application $app, $usr_id) { , function(Application $app, $usr_id) {
$user = \User_Adapter::getInstance($usr_id, \appbox::get_instance($app['Core'])); $user = \User_Adapter::getInstance($usr_id, \appbox::get_instance($app['Core']));
@@ -68,7 +67,6 @@ class Tooltip implements ControllerProviderInterface
); );
})->assert('usr_id', '\d+'); })->assert('usr_id', '\d+');
$controllers->post('/preview/{sbas_id}/{record_id}/' $controllers->post('/preview/{sbas_id}/{record_id}/'
, function(Application $app, $sbas_id, $record_id) { , function(Application $app, $sbas_id, $record_id) {
$record = new \record_adapter($sbas_id, $record_id); $record = new \record_adapter($sbas_id, $record_id);
@@ -86,7 +84,6 @@ class Tooltip implements ControllerProviderInterface
); );
})->assert('sbas_id', '\d+')->assert('record_id', '\d+'); })->assert('sbas_id', '\d+')->assert('record_id', '\d+');
$controllers->post('/caption/{sbas_id}/{record_id}/{view}/' $controllers->post('/caption/{sbas_id}/{record_id}/{view}/'
, function(Application $app, $sbas_id, $record_id, $view) { , function(Application $app, $sbas_id, $record_id, $view) {
$number = (int) $app['request']->get('number'); $number = (int) $app['request']->get('number');
@@ -117,7 +114,6 @@ class Tooltip implements ControllerProviderInterface
); );
})->assert('sbas_id', '\d+')->assert('record_id', '\d+'); })->assert('sbas_id', '\d+')->assert('record_id', '\d+');
$controllers->post('/tc_datas/{sbas_id}/{record_id}/' $controllers->post('/tc_datas/{sbas_id}/{record_id}/'
, function(Application $app, $sbas_id, $record_id) { , function(Application $app, $sbas_id, $record_id) {
$record = new \record_adapter($sbas_id, $record_id); $record = new \record_adapter($sbas_id, $record_id);
@@ -134,7 +130,6 @@ class Tooltip implements ControllerProviderInterface
); );
})->assert('sbas_id', '\d+')->assert('record_id', '\d+'); })->assert('sbas_id', '\d+')->assert('record_id', '\d+');
$controllers->post('/metas/FieldInfos/{sbas_id}/{field_id}/' $controllers->post('/metas/FieldInfos/{sbas_id}/{field_id}/'
, function(Application $app, $sbas_id, $field_id) { , function(Application $app, $sbas_id, $field_id) {
$databox = \databox::get_instance((int) $sbas_id); $databox = \databox::get_instance((int) $sbas_id);
@@ -151,7 +146,6 @@ class Tooltip implements ControllerProviderInterface
); );
})->assert('sbas_id', '\d+')->assert('field_id', '\d+'); })->assert('sbas_id', '\d+')->assert('field_id', '\d+');
$controllers->post('/DCESInfos/{sbas_id}/{field_id}/' $controllers->post('/DCESInfos/{sbas_id}/{field_id}/'
, function(Application $app, $sbas_id, $field_id) { , function(Application $app, $sbas_id, $field_id) {
$databox = \databox::get_instance((int) $sbas_id); $databox = \databox::get_instance((int) $sbas_id);
@@ -168,7 +162,6 @@ class Tooltip implements ControllerProviderInterface
); );
})->assert('sbas_id', '\d+')->assert('field_id', '\d+'); })->assert('sbas_id', '\d+')->assert('field_id', '\d+');
$controllers->post('/metas/restrictionsInfos/{sbas_id}/{field_id}/' $controllers->post('/metas/restrictionsInfos/{sbas_id}/{field_id}/'
, function(Application $app, $sbas_id, $field_id) { , function(Application $app, $sbas_id, $field_id) {
$databox = \databox::get_instance((int) $sbas_id); $databox = \databox::get_instance((int) $sbas_id);

View File

@@ -81,7 +81,6 @@ class UsrLists implements ControllerProviderInterface
); );
} }
/* @var $list \Entities\UsrList */ /* @var $list \Entities\UsrList */
$result[] = array( $result[] = array(
'name' => $list->getName(), 'name' => $list->getName(),
@@ -212,7 +211,6 @@ class UsrLists implements ControllerProviderInterface
); );
} }
/* @var $list \Entities\UsrList */ /* @var $list \Entities\UsrList */
$result = array( $result = array(
'id' => $list->getId(), 'id' => $list->getId(),
@@ -223,7 +221,6 @@ class UsrLists implements ControllerProviderInterface
'users' => $entries 'users' => $entries
); );
return new Response($app['Core']->getTwig()->render('prod/actions/Feedback/list.html.twig', $result)); return new Response($app['Core']->getTwig()->render('prod/actions/Feedback/list.html.twig', $result));
} }
); );
@@ -323,7 +320,6 @@ class UsrLists implements ControllerProviderInterface
} }
)->assert('list_id', '\d+'); )->assert('list_id', '\d+');
/** /**
* Remove a usr_id from a list * Remove a usr_id from a list
*/ */
@@ -590,7 +586,6 @@ class UsrLists implements ControllerProviderInterface
} }
)->assert('list_id', '\d+')->assert('usr_id', '\d+'); )->assert('list_id', '\d+')->assert('usr_id', '\d+');
return $controllers; return $controllers;
} }
} }

View File

@@ -42,7 +42,6 @@ class WorkZone implements ControllerProviderInterface
, 'srt' => $app['request']->get('sort') , 'srt' => $app['request']->get('sort')
); );
return new Response($app['Core']->getTwig()->render('prod/WorkZone/WorkZone.html.twig', $params)); return new Response($app['Core']->getTwig()->render('prod/WorkZone/WorkZone.html.twig', $params));
}); });
@@ -76,7 +75,6 @@ class WorkZone implements ControllerProviderInterface
$PerPage = 10; $PerPage = 10;
$offsetStart = max(($Page - 1) * $PerPage, 0); $offsetStart = max(($Page - 1) * $PerPage, 0);
$Baskets = $BasketRepo->findWorkzoneBasket( $Baskets = $BasketRepo->findWorkzoneBasket(
$user $user
, $request->get('Query') , $request->get('Query')
@@ -89,7 +87,6 @@ class WorkZone implements ControllerProviderInterface
$page = floor($offsetStart / $PerPage) + 1; $page = floor($offsetStart / $PerPage) + 1;
$maxPage = floor(count($Baskets) / $PerPage) + 1; $maxPage = floor(count($Baskets) / $PerPage) + 1;
$params = array( $params = array(
'Baskets' => $Baskets 'Baskets' => $Baskets
, 'Page' => $page , 'Page' => $page
@@ -117,7 +114,6 @@ class WorkZone implements ControllerProviderInterface
return new Response($app['Core']->getTwig()->render('prod/WorkZone/Browser/Basket.html.twig', $params)); return new Response($app['Core']->getTwig()->render('prod/WorkZone/Browser/Basket.html.twig', $params));
})->assert('basket_id', '\d+'); })->assert('basket_id', '\d+');
$controllers->post( $controllers->post(
'/attachStories/' '/attachStories/'
, function(Application $app, Request $request) { , function(Application $app, Request $request) {
@@ -145,7 +141,6 @@ class WorkZone implements ControllerProviderInterface
if ( ! $user->ACL()->has_access_to_base($Story->get_base_id())) if ( ! $user->ACL()->has_access_to_base($Story->get_base_id()))
throw new \Exception_Forbidden('You do not have access to this Story'); throw new \Exception_Forbidden('You do not have access to this Story');
if ($StoryWZRepo->findUserStory($user, $Story)) { if ($StoryWZRepo->findUserStory($user, $Story)) {
$alreadyFixed ++; $alreadyFixed ++;
continue; continue;
@@ -204,7 +199,6 @@ class WorkZone implements ControllerProviderInterface
} }
}); });
$controllers->post( $controllers->post(
'/detachStory/{sbas_id}/{record_id}/' '/detachStory/{sbas_id}/{record_id}/'
, function(Application $app, Request $request, $sbas_id, $record_id) { , function(Application $app, Request $request, $sbas_id, $record_id) {
@@ -240,7 +234,6 @@ class WorkZone implements ControllerProviderInterface
} }
})->assert('sbas_id', '\d+')->assert('record_id', '\d+'); })->assert('sbas_id', '\d+')->assert('record_id', '\d+');
return $controllers; return $controllers;
} }
} }

View File

@@ -82,8 +82,6 @@ class RSSFeeds implements ControllerProviderInterface
return $response; return $response;
}; };
$controllers->get('/feed/{id}/{format}/', function($id, $format) use ($app, $appbox, $display_feed) { $controllers->get('/feed/{id}/{format}/', function($id, $format) use ($app, $appbox, $display_feed) {
$feed = new \Feed_Adapter($appbox, $id); $feed = new \Feed_Adapter($appbox, $id);
@@ -99,8 +97,6 @@ class RSSFeeds implements ControllerProviderInterface
return $display_feed($feed, $format, $page); return $display_feed($feed, $format, $page);
})->assert('id', '\d+')->assert('format', '(rss|atom)'); })->assert('id', '\d+')->assert('format', '(rss|atom)');
$controllers->get('/userfeed/{token}/{id}/{format}/', function($token, $id, $format) use ($app, $appbox, $display_feed) { $controllers->get('/userfeed/{token}/{id}/{format}/', function($token, $id, $format) use ($app, $appbox, $display_feed) {
try { try {
$token = new \Feed_Token($appbox, $token, $id); $token = new \Feed_Token($appbox, $token, $id);
@@ -116,8 +112,6 @@ class RSSFeeds implements ControllerProviderInterface
return $display_feed($feed, $format, $page, $token->get_user()); return $display_feed($feed, $format, $page, $token->get_user());
})->assert('id', '\d+')->assert('format', '(rss|atom)'); })->assert('id', '\d+')->assert('format', '(rss|atom)');
$controllers->get('/userfeed/aggregated/{token}/{format}/', function($token, $format) use ($app, $appbox, $display_feed) { $controllers->get('/userfeed/aggregated/{token}/{format}/', function($token, $format) use ($app, $appbox, $display_feed) {
try { try {
$token = new \Feed_TokenAggregate($appbox, $token); $token = new \Feed_TokenAggregate($appbox, $token);
@@ -134,8 +128,6 @@ class RSSFeeds implements ControllerProviderInterface
return $display_feed($feed, $format, $page, $token->get_user()); return $display_feed($feed, $format, $page, $token->get_user());
})->assert('format', '(rss|atom)'); })->assert('format', '(rss|atom)');
$controllers->get('/aggregated/{format}/', function($format) use ($app, $appbox, $display_feed) { $controllers->get('/aggregated/{format}/', function($format) use ($app, $appbox, $display_feed) {
$feeds = \Feed_Collection::load_public_feeds($appbox); $feeds = \Feed_Collection::load_public_feeds($appbox);
$feed = $feeds->get_aggregate(); $feed = $feeds->get_aggregate();

View File

@@ -64,7 +64,6 @@ class Installer implements ControllerProviderInterface
return $app->redirect('/setup/installer/step2/'); return $app->redirect('/setup/installer/step2/');
} }
$ld_path = array(__DIR__ . '/../../../../../templates/web'); $ld_path = array(__DIR__ . '/../../../../../templates/web');
$loader = new \Twig_Loader_Filesystem($ld_path); $loader = new \Twig_Loader_Filesystem($ld_path);
$twig = new \Twig_Environment($loader); $twig = new \Twig_Environment($loader);

View File

@@ -68,7 +68,6 @@ class PathFileTest implements ControllerProviderInterface
); );
}); });
return $controllers; return $controllers;
} }
} }

View File

@@ -99,7 +99,6 @@ class Configuration
$this->setConnexions($connexions); $this->setConnexions($connexions);
$configs = $this->getConfigurations(); $configs = $this->getConfigurations();
$retrieve_old_parameters = function(\SplFileInfo $configInc) { $retrieve_old_parameters = function(\SplFileInfo $configInc) {

View File

@@ -15,7 +15,6 @@ use Alchemy\Phrasea\Border;
use Alchemy\Phrasea\Core; use Alchemy\Phrasea\Core;
use Alchemy\Phrasea\Core\Service; use Alchemy\Phrasea\Core\Service;
use Alchemy\Phrasea\Core\Service\ServiceAbstract; use Alchemy\Phrasea\Core\Service\ServiceAbstract;
use Alchemy\Phrasea\Core\Service\ServiceInterface;
/** /**
* Define a Border Manager service which handles checks on files that comes in * Define a Border Manager service which handles checks on files that comes in
@@ -78,10 +77,10 @@ class BorderManager extends ServiceAbstract
try { try {
$checkerObj = new $className($options); $checkerObj = new $className($options);
if(isset($checker['databoxes'])) { if (isset($checker['databoxes'])) {
$databoxes = array(); $databoxes = array();
foreach($checker['databoxes'] as $sbas_id) { foreach ($checker['databoxes'] as $sbas_id) {
try { try {
$databoxes[] = \databox::get_instance($sbas_id); $databoxes[] = \databox::get_instance($sbas_id);
} catch (\Exception $e) { } catch (\Exception $e) {
@@ -91,10 +90,10 @@ class BorderManager extends ServiceAbstract
$checkerObj->restrictToDataboxes($databoxes); $checkerObj->restrictToDataboxes($databoxes);
} }
if(isset($checker['collections'])) { if (isset($checker['collections'])) {
$collections = array(); $collections = array();
foreach($checker['collections'] as $base_id) { foreach ($checker['collections'] as $base_id) {
try { try {
$collections[] = \collection::get_from_base_id($base_id); $collections[] = \collection::get_from_base_id($base_id);
} catch (\Exception $e) { } catch (\Exception $e) {

View File

@@ -50,7 +50,6 @@ 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();
@@ -58,7 +57,7 @@ class RedisCache extends ServiceAbstract
if ( ! $redis->setOption(\Redis::OPT_SERIALIZER, \Redis::SERIALIZER_IGBINARY)) { if ( ! $redis->setOption(\Redis::OPT_SERIALIZER, \Redis::SERIALIZER_IGBINARY)) {
$redis->setOption(\Redis::OPT_SERIALIZER, \Redis::SERIALIZER_PHP); $redis->setOption(\Redis::OPT_SERIALIZER, \Redis::SERIALIZER_PHP);
} }
$this->cache = new CacheDriver\RedisCache(); $this->cache = new CacheDriver\RedisCache();
$this->cache->setRedis($redis); $this->cache->setRedis($redis);
$this->cache->setNamespace(md5(realpath(__DIR__ . '/../../../../../../'))); $this->cache->setNamespace(md5(realpath(__DIR__ . '/../../../../../../')));

View File

@@ -11,7 +11,6 @@
namespace Alchemy\Phrasea\Helper; namespace Alchemy\Phrasea\Helper;
/** /**
* *
* @license http://opensource.org/licenses/gpl-3.0 GPLv3 * @license http://opensource.org/licenses/gpl-3.0 GPLv3

View File

@@ -211,7 +211,6 @@ class Edit extends RecordHelper
$twig = $this->getCore()->getTwig(); $twig = $this->getCore()->getTwig();
$databox = \databox::get_instance($this->get_sbas_id()); $databox = \databox::get_instance($this->get_sbas_id());
$databox_fields = array(); $databox_fields = array();
@@ -482,7 +481,6 @@ class Edit extends RecordHelper
continue; continue;
} }
$key = $record->get_serialize_key(); $key = $record->get_serialize_key();
if ( ! array_key_exists($key, $elements)) if ( ! array_key_exists($key, $elements))

View File

@@ -109,7 +109,6 @@ class MoveCollection extends RecordHelper
throw new \Exception_Unauthorized(sprintf("%s do not have the permission to move records to %s", $user->get_login())); throw new \Exception_Unauthorized(sprintf("%s do not have the permission to move records to %s", $user->get_login()));
} }
if ( ! $this->is_possible()) if ( ! $this->is_possible())
throw new Exception('This action is not possible'); throw new Exception('This action is not possible');
@@ -126,7 +125,6 @@ class MoveCollection extends RecordHelper
} }
} }
$collection = \collection::get_from_base_id($base_dest); $collection = \collection::get_from_base_id($base_dest);
foreach ($this->selection as $record) { foreach ($this->selection as $record) {

View File

@@ -230,7 +230,6 @@ class Edit extends \Alchemy\Phrasea\Helper\Helper
$rs = $stmt->fetchAll(\PDO::FETCH_ASSOC); $rs = $stmt->fetchAll(\PDO::FETCH_ASSOC);
$stmt->closeCursor(); $stmt->closeCursor();
$msk_and = null; $msk_and = null;
$msk_xor = null; $msk_xor = null;
$tbits_and = array(); $tbits_and = array();

View File

@@ -134,7 +134,6 @@ class Manage extends \Alchemy\Phrasea\Helper\Helper
$this->query_parms[$k] = false; $this->query_parms[$k] = false;
} }
$query = new \User_Query($appbox); $query = new \User_Query($appbox);
$templates = $query $templates = $query
->only_templates(true) ->only_templates(true)

View File

@@ -11,7 +11,6 @@
namespace Alchemy\Phrasea\Helper; namespace Alchemy\Phrasea\Helper;
/** /**
* *
* WorkZone provides methods for working with the working zone of Phraseanet * WorkZone provides methods for working with the working zone of Phraseanet

View File

@@ -11,7 +11,6 @@
namespace Alchemy\Phrasea\Media\Subdef; namespace Alchemy\Phrasea\Media\Subdef;
/** /**
* Audio Subdef * Audio Subdef
* *

View File

@@ -254,7 +254,6 @@ class ACL implements cache_cacheableInterface
if ( ! in_array($sbas_id, $sbas_ids)) if ( ! in_array($sbas_id, $sbas_ids))
continue; continue;
if ( ! $this->has_access_to_sbas($sbas_id)) { if ( ! $this->has_access_to_sbas($sbas_id)) {
$sbas_to_acces[] = $sbas_id; $sbas_to_acces[] = $sbas_id;
} }
@@ -316,7 +315,6 @@ class ACL implements cache_cacheableInterface
$mask_and = ctype_digit($mask_and) ? $mask_and : '0'; $mask_and = ctype_digit($mask_and) ? $mask_and : '0';
$mask_xor = ctype_digit($mask_xor) ? $mask_xor : '0'; $mask_xor = ctype_digit($mask_xor) ? $mask_xor : '0';
/** /**
* apply sb is substractive * apply sb is substractive
*/ */
@@ -844,7 +842,6 @@ class ACL implements cache_cacheableInterface
$this->_rights_bas = $this->_limited = array(); $this->_rights_bas = $this->_limited = array();
$this->_global_rights['manageusers'] = false; $this->_global_rights['manageusers'] = false;
$this->_global_rights['coll_manage'] = false; $this->_global_rights['coll_manage'] = false;
$this->_global_rights['coll_modify_struct'] = false; $this->_global_rights['coll_modify_struct'] = false;
@@ -861,7 +858,6 @@ class ACL implements cache_cacheableInterface
$this->_global_rights['candwnldhd'] = false; $this->_global_rights['candwnldhd'] = false;
$this->_global_rights['order_master'] = false; $this->_global_rights['order_master'] = false;
foreach ($rs as $row) { foreach ($rs as $row) {
$this->_rights_bas[$row['base_id']]['actif'] = ($row['actif'] == '1'); $this->_rights_bas[$row['base_id']]['actif'] = ($row['actif'] == '1');
@@ -1234,7 +1230,6 @@ class ACL implements cache_cacheableInterface
$stmt->execute(array(':usr_id' => $this->user->get_id())); $stmt->execute(array(':usr_id' => $this->user->get_id()));
$stmt->closeCursor(); $stmt->closeCursor();
$sql = "UPDATE basusr SET lastconn=now() $sql = "UPDATE basusr SET lastconn=now()
WHERE usr_id = :usr_id AND actif = 1"; WHERE usr_id = :usr_id AND actif = 1";
$stmt = $this->appbox->get_connection()->prepare($sql); $stmt = $this->appbox->get_connection()->prepare($sql);

View File

@@ -276,7 +276,6 @@ class API_OAuth2_Account
":application_id" => $application->get_id() ":application_id" => $application->get_id()
); );
$stmt = $appbox->get_connection()->prepare($sql); $stmt = $appbox->get_connection()->prepare($sql);
$stmt->execute($params); $stmt->execute($params);
$row = $stmt->fetch(PDO::FETCH_ASSOC); $row = $stmt->fetch(PDO::FETCH_ASSOC);

View File

@@ -398,7 +398,6 @@ class API_OAuth2_Adapter extends OAuth2
, 'redirect_uri' => $request->get('redirect_uri', false) , 'redirect_uri' => $request->get('redirect_uri', false)
); );
$scope = $request->get('scope', false); $scope = $request->get('scope', false);
$state = $request->get('state', false); $state = $request->get('state', false);
@@ -426,7 +425,6 @@ class API_OAuth2_Adapter extends OAuth2
, "scope" => array("flags" => FILTER_REQUIRE_SCALAR) , "scope" => array("flags" => FILTER_REQUIRE_SCALAR)
); );
$input = filter_var_array($datas, $filters); $input = filter_var_array($datas, $filters);
/** /**
@@ -484,7 +482,6 @@ class API_OAuth2_Adapter extends OAuth2
$input["redirect_uri"] = $redirect_uri; $input["redirect_uri"] = $redirect_uri;
} }
/** /**
* Check response_type * Check response_type
*/ */
@@ -492,21 +489,18 @@ class API_OAuth2_Adapter extends OAuth2
$this->errorDoRedirectUriCallback($input["redirect_uri"], OAUTH2_ERROR_INVALID_REQUEST, 'Invalid response type.', NULL, $input["state"]); $this->errorDoRedirectUriCallback($input["redirect_uri"], OAUTH2_ERROR_INVALID_REQUEST, 'Invalid response type.', NULL, $input["state"]);
} }
/** /**
* Check requested auth response type against the list of supported types * Check requested auth response type against the list of supported types
*/ */
if (array_search($input["response_type"], $this->getSupportedAuthResponseTypes()) === FALSE) if (array_search($input["response_type"], $this->getSupportedAuthResponseTypes()) === FALSE)
$this->errorDoRedirectUriCallback($input["redirect_uri"], OAUTH2_ERROR_UNSUPPORTED_RESPONSE_TYPE, NULL, NULL, $input["state"]); $this->errorDoRedirectUriCallback($input["redirect_uri"], OAUTH2_ERROR_UNSUPPORTED_RESPONSE_TYPE, NULL, NULL, $input["state"]);
/** /**
* Restrict clients to certain authorization response types * Restrict clients to certain authorization response types
*/ */
if ($this->checkRestrictedAuthResponseType($input["client_id"], $input["response_type"]) === FALSE) if ($this->checkRestrictedAuthResponseType($input["client_id"], $input["response_type"]) === FALSE)
$this->errorDoRedirectUriCallback($input["redirect_uri"], OAUTH2_ERROR_UNAUTHORIZED_CLIENT, NULL, NULL, $input["state"]); $this->errorDoRedirectUriCallback($input["redirect_uri"], OAUTH2_ERROR_UNAUTHORIZED_CLIENT, NULL, NULL, $input["state"]);
/** /**
* Validate that the requested scope is supported * Validate that the requested scope is supported
*/ */

View File

@@ -270,7 +270,7 @@ interface API_V1_Interface
public function get_publication(Request $request, $publication_id, User_Adapter &$user); public function get_publication(Request $request, $publication_id, User_Adapter &$user);
public function get_publications(Request $request, User_Adapter &$user); public function get_publications(Request $request, User_Adapter &$user);
public function get_feed_entry(Request $request, $entry, User_Adapter &$user); public function get_feed_entry(Request $request, $entry, User_Adapter &$user);
/** /**
* Route : /users/search/FORMAT/ * Route : /users/search/FORMAT/
@@ -294,7 +294,7 @@ interface API_V1_Interface
public function get_user_acces(Request $request, $usr_id); public function get_user_acces(Request $request, $usr_id);
public function add_record(Application $app, Request $request); public function add_record(Application $app, Request $request);
/** /**
* Route : /users/add/FORMAT/ * Route : /users/add/FORMAT/
* *

View File

@@ -205,8 +205,8 @@ class API_V1_adapter extends API_V1_Abstract
* - name * - name
* - autostart * - autostart
* *
* @param \Silex\Application $app Silex application * @param \Silex\Application $app Silex application
* @param integer $task_id the task id * @param integer $task_id the task id
* @return \API_V1_result * @return \API_V1_result
* @throws \API_V1_exception_badrequest * @throws \API_V1_exception_badrequest
*/ */
@@ -896,7 +896,6 @@ class API_V1_adapter extends API_V1_Abstract
$search_engine = new searchEngine_adapter($registry); $search_engine = new searchEngine_adapter($registry);
$search_engine->set_options($options); $search_engine->set_options($options);
/** /**
* @todo ameliorer this shit * @todo ameliorer this shit
*/ */
@@ -1253,7 +1252,6 @@ class API_V1_adapter extends API_V1_Abstract
$em = $this->core->getEntityManager(); $em = $this->core->getEntityManager();
$repository = $em->getRepository('\Entities\Basket'); $repository = $em->getRepository('\Entities\Basket');
/* @var $repository \Repositories\BasketRepository */ /* @var $repository \Repositories\BasketRepository */
$Basket = $repository->findUserBasket($basket_id, $this->core->getAuthenticatedUser(), true); $Basket = $repository->findUserBasket($basket_id, $this->core->getAuthenticatedUser(), true);
@@ -1372,7 +1370,6 @@ class API_V1_adapter extends API_V1_Abstract
$em = $this->core->getEntityManager(); $em = $this->core->getEntityManager();
$repository = $em->getRepository('\Entities\Basket'); $repository = $em->getRepository('\Entities\Basket');
/* @var $repository \Repositories\BasketRepository */ /* @var $repository \Repositories\BasketRepository */
$Basket = $repository->findUserBasket($basket_id, $this->core->getAuthenticatedUser(), true); $Basket = $repository->findUserBasket($basket_id, $this->core->getAuthenticatedUser(), true);
@@ -1408,7 +1405,6 @@ class API_V1_adapter extends API_V1_Abstract
$em = $this->core->getEntityManager(); $em = $this->core->getEntityManager();
$repository = $em->getRepository('\Entities\Basket'); $repository = $em->getRepository('\Entities\Basket');
/* @var $repository \Repositories\BasketRepository */ /* @var $repository \Repositories\BasketRepository */
$Basket = $repository->findUserBasket($basket_id, $this->core->getAuthenticatedUser(), true); $Basket = $repository->findUserBasket($basket_id, $this->core->getAuthenticatedUser(), true);
@@ -1459,7 +1455,7 @@ class API_V1_adapter extends API_V1_Abstract
*/ */
public function remove_publications(Request $request, $publication_id) public function remove_publications(Request $request, $publication_id)
{ {
} }
/** /**
@@ -1630,7 +1626,7 @@ class API_V1_adapter extends API_V1_Abstract
*/ */
public function search_users(Request $request) public function search_users(Request $request)
{ {
} }
/** /**
@@ -1640,7 +1636,7 @@ class API_V1_adapter extends API_V1_Abstract
*/ */
public function get_user_acces(Request $request, $usr_id) public function get_user_acces(Request $request, $usr_id)
{ {
} }
/** /**
@@ -1649,7 +1645,7 @@ class API_V1_adapter extends API_V1_Abstract
*/ */
public function add_user(Request $request) public function add_user(Request $request)
{ {
} }
/** /**

View File

@@ -327,7 +327,6 @@ class Bridge_Account
$results = array(); $results = array();
$apis = array(); $apis = array();
foreach ($rs as $row) { foreach ($rs as $row) {
$api_id = $row['api_id']; $api_id = $row['api_id'];
if ( ! isset($apis[$api_id])) { if ( ! isset($apis[$api_id])) {

View File

@@ -229,7 +229,6 @@ class Bridge_Api_Dailymotion extends Bridge_Api_Abstract implements Bridge_Api_I
switch ($object) { switch ($object) {
case self::ELEMENT_TYPE_VIDEO: case self::ELEMENT_TYPE_VIDEO:
$result = $this->_api->call('/me/videos', array('fields' => array( $result = $this->_api->call('/me/videos', array('fields' => array(
'created_time' 'created_time'
, 'description' , 'description'
@@ -795,7 +794,6 @@ class Bridge_Api_Dailymotion extends Bridge_Api_Abstract implements Bridge_Api_I
$length = (int) $field["length"]; $length = (int) $field["length"];
$length_min = (int) $field["length_min"]; $length_min = (int) $field["length_min"];
if ( ! isset($datas[$name]) || trim($datas[$name]) === '') { if ( ! isset($datas[$name]) || trim($datas[$name]) === '') {
if ($required) if ($required)
$errors[$name . '_' . $key] = _("Ce champ est obligatoire"); $errors[$name . '_' . $key] = _("Ce champ est obligatoire");
@@ -821,7 +819,6 @@ class Bridge_Api_Dailymotion extends Bridge_Api_Abstract implements Bridge_Api_I
$length = (int) $field["length"]; $length = (int) $field["length"];
$length_min = (int) $field["length_min"]; $length_min = (int) $field["length_min"];
if ( ! isset($datas[$name]) || trim($datas[$name]) === '') { if ( ! isset($datas[$name]) || trim($datas[$name]) === '') {
if ($required) if ($required)
$errors[$name] = _("Ce champ est obligatoire"); $errors[$name] = _("Ce champ est obligatoire");

View File

@@ -48,7 +48,6 @@ class Bridge_Api_Flickr_Element implements Bridge_Api_ElementInterface
else else
$this->init_from_single_entry($entry); $this->init_from_single_entry($entry);
$this->user_id = (string) $user_id; $this->user_id = (string) $user_id;
return $this; return $this;

View File

@@ -9,7 +9,6 @@
* file that was distributed with this source code. * file that was distributed with this source code.
*/ */
/** /**
* *
* @package Bridge * @package Bridge

View File

@@ -562,7 +562,6 @@ class Bridge_Api_Youtube extends Bridge_Api_Abstract implements Bridge_Api_Inter
break; break;
} }
if ($error = $this->parse_xml_error($response->getBody())) { if ($error = $this->parse_xml_error($response->getBody())) {
$type = $error['type']; $type = $error['type'];
$code = $error['code']; $code = $error['code'];

View File

@@ -333,7 +333,6 @@ class Bridge_Element
, ':update' => $this->updated_on->format(DATE_ISO8601) , ':update' => $this->updated_on->format(DATE_ISO8601)
); );
$stmt = $this->appbox->get_connection()->prepare($sql); $stmt = $this->appbox->get_connection()->prepare($sql);
$stmt->execute($params); $stmt->execute($params);
$stmt->closeCursor(); $stmt->closeCursor();
@@ -369,7 +368,6 @@ class Bridge_Element
, ':update' => $this->updated_on->format(DATE_ISO8601) , ':update' => $this->updated_on->format(DATE_ISO8601)
); );
$stmt = $this->appbox->get_connection()->prepare($sql); $stmt = $this->appbox->get_connection()->prepare($sql);
$stmt->execute($params); $stmt->execute($params);
$stmt->closeCursor(); $stmt->closeCursor();

View File

@@ -85,4 +85,3 @@ class DailymotionWithoutOauth2 extends Dailymotion
} }
} }
?>

View File

@@ -534,7 +534,6 @@ class Feed_Adapter extends Feed_Abstract implements Feed_Interface, cache_cachea
$stmt->execute(array(':feed_id' => $this->get_id())); $stmt->execute(array(':feed_id' => $this->get_id()));
$stmt->closeCursor(); $stmt->closeCursor();
$this->delete_data_from_cache(); $this->delete_data_from_cache();
$feed_coll = new Feed_Collection($this->appbox, array()); $feed_coll = new Feed_Collection($this->appbox, array());

View File

@@ -127,7 +127,7 @@ class Feed_Entry_Adapter implements Feed_Entry_Interface, cache_cacheableInterfa
return $this; return $this;
} catch (Exception $e) { } catch (Exception $e) {
} }
$sql = 'SELECT publisher, title, description, created_on, updated_on $sql = 'SELECT publisher, title, description, created_on, updated_on
@@ -218,8 +218,8 @@ class Feed_Entry_Adapter implements Feed_Entry_Interface, cache_cacheableInterfa
/** /**
* Change the parent feed of the entry * Change the parent feed of the entry
* *
* @param Feed_Adapter $feed * @param Feed_Adapter $feed
* @return \Feed_Entry_Adapter * @return \Feed_Entry_Adapter
*/ */
public function set_feed(Feed_Adapter $feed) public function set_feed(Feed_Adapter $feed)
{ {
@@ -441,7 +441,7 @@ class Feed_Entry_Adapter implements Feed_Entry_Interface, cache_cacheableInterfa
try { try {
$items[] = new Feed_Entry_Item($this->appbox, $this, $item_id); $items[] = new Feed_Entry_Item($this->appbox, $this, $item_id);
} catch (Exception_NotFound $e) { } catch (Exception_NotFound $e) {
} }
} }
@@ -455,7 +455,7 @@ class Feed_Entry_Adapter implements Feed_Entry_Interface, cache_cacheableInterfa
try { try {
return $this->get_data_from_cache(self::CACHE_ELEMENTS); return $this->get_data_from_cache(self::CACHE_ELEMENTS);
} catch (Exception $e) { } catch (Exception $e) {
} }
$sql = 'SELECT id FROM feed_entry_elements $sql = 'SELECT id FROM feed_entry_elements

View File

@@ -238,7 +238,7 @@ abstract class Feed_XML_Abstract
$group = $this->addTag($document, $item, 'media:group'); $group = $this->addTag($document, $item, 'media:group');
$caption = $content->get_record()->get_caption(); $caption = $content->get_record()->get_caption();
$title_field = $caption->get_dc_field(databox_Field_DCESAbstract::Title); $title_field = $caption->get_dc_field(databox_Field_DCESAbstract::Title);
if ($title_field) { if ($title_field) {
$str_title = $title_field->get_serialized_values(' '); $str_title = $title_field->get_serialized_values(' ');
@@ -319,7 +319,6 @@ abstract class Feed_XML_Abstract
if ($thumbnail_sd->get_height()) if ($thumbnail_sd->get_height())
$thumbnail->setAttribute('height', $thumbnail_sd->get_height()); $thumbnail->setAttribute('height', $thumbnail_sd->get_height());
$thumbnail = $this->addTag($document, $group, 'media:content'); $thumbnail = $this->addTag($document, $group, 'media:content');
$thumbnail->setAttribute('url', $thumbnail_permalink->get_url()); $thumbnail->setAttribute('url', $thumbnail_permalink->get_url());

View File

@@ -144,7 +144,6 @@ class Feed_XML_Atom extends Feed_XML_Abstract implements Feed_XML_Interface
$this->addTag($document, $entry_node, 'content', $entry->get_subtitle()); $this->addTag($document, $entry_node, 'content', $entry->get_subtitle());
foreach ($entry->get_content() as $content) { foreach ($entry->get_content() as $content) {
$this->addContent($document, $entry_node, $content); $this->addContent($document, $entry_node, $content);
} }

View File

@@ -242,7 +242,6 @@ class Feed_XML_Cooliris extends Feed_XML_Abstract implements Feed_XML_Interface
$doc->formatOutput = true; $doc->formatOutput = true;
$doc->standalone = true; $doc->standalone = true;
$root = $this->addTag($doc, $doc, 'rss'); $root = $this->addTag($doc, $doc, 'rss');
$root->setAttribute('version', self::VERSION); $root->setAttribute('version', self::VERSION);
@@ -367,7 +366,7 @@ class Feed_XML_Cooliris extends Feed_XML_Abstract implements Feed_XML_Interface
//add item node to channel node //add item node to channel node
$item = $this->addTag($document, $node, 'item'); $item = $this->addTag($document, $node, 'item');
$caption = $content->get_record()->get_caption(); $caption = $content->get_record()->get_caption();
$title_field = $caption->get_dc_field(databox_Field_DCESAbstract::Title); $title_field = $caption->get_dc_field(databox_Field_DCESAbstract::Title);
@@ -420,7 +419,6 @@ class Feed_XML_Cooliris extends Feed_XML_Abstract implements Feed_XML_Interface
if ($thumbnail_sd->get_height()) if ($thumbnail_sd->get_height())
$thumbnail->setAttribute('height', $thumbnail_sd->get_height()); $thumbnail->setAttribute('height', $thumbnail_sd->get_height());
$thumbnail = $this->addTag($document, $item, 'media:content'); $thumbnail = $this->addTag($document, $item, 'media:content');
$thumbnail->setAttribute('url', $thumbnail_permalink->get_url()); $thumbnail->setAttribute('url', $thumbnail_permalink->get_url());

View File

@@ -242,7 +242,6 @@ class Feed_XML_RSS extends Feed_XML_Abstract implements Feed_XML_Interface
$doc->formatOutput = true; $doc->formatOutput = true;
$doc->standalone = true; $doc->standalone = true;
$root = $this->addTag($doc, $doc, 'rss'); $root = $this->addTag($doc, $doc, 'rss');
$root->setAttribute('version', self::VERSION); $root->setAttribute('version', self::VERSION);

View File

@@ -106,7 +106,6 @@ class Session_Authentication_Native implements Session_Authentication_Interface
$browser = Browser::getInstance(); $browser = Browser::getInstance();
$this->check_and_revoke_badlogs($browser->getIP()); $this->check_and_revoke_badlogs($browser->getIP());
$this->check_bad_salinity() $this->check_bad_salinity()
->check_mail_locked() ->check_mail_locked()
->challenge_password($browser); ->challenge_password($browser);

View File

@@ -450,7 +450,6 @@ class Session_Handler
$stmt->execute(array(':old_usr_id' => $oldusr)); $stmt->execute(array(':old_usr_id' => $oldusr));
$stmt->closeCursor(); $stmt->closeCursor();
$sql = 'UPDATE dsel SET usr_id = :usr_id WHERE usr_id = :old_usr_id'; $sql = 'UPDATE dsel SET usr_id = :usr_id WHERE usr_id = :old_usr_id';
$stmt = $conn->prepare($sql); $stmt = $conn->prepare($sql);
$stmt->execute(array(':usr_id' => $this->get_usr_id(), ':old_usr_id' => $oldusr)); $stmt->execute(array(':usr_id' => $this->get_usr_id(), ':old_usr_id' => $oldusr));

View File

@@ -273,7 +273,6 @@ class User_Query implements User_QueryInterface
} }
} }
if (count($this->sbas_ids) == 0) { if (count($this->sbas_ids) == 0) {
if ($this->sbas_restrictions) if ($this->sbas_restrictions)
throw new Exception('No base available for you, not enough rights'); throw new Exception('No base available for you, not enough rights');
@@ -350,7 +349,6 @@ class User_Query implements User_QueryInterface
} }
} }
if (count($sql_like) > 0) if (count($sql_like) > 0)
$sql .= sprintf(' AND (%s) ', implode($this->like_match, $sql_like)); $sql .= sprintf(' AND (%s) ', implode($this->like_match, $sql_like));
@@ -552,7 +550,6 @@ class User_Query implements User_QueryInterface
$row = $stmt->fetch(PDO::FETCH_ASSOC); $row = $stmt->fetch(PDO::FETCH_ASSOC);
$stmt->closeCursor(); $stmt->closeCursor();
$this->total = $row['total']; $this->total = $row['total'];
$this->page = 1; $this->page = 1;

View File

@@ -287,7 +287,6 @@ class appbox extends base
$upgrader->add_steps_complete(1); $upgrader->add_steps_complete(1);
$upgrader->set_current_message(_('Creating new tables')); $upgrader->set_current_message(_('Creating new tables'));
$core = bootstrap::getCore(); $core = bootstrap::getCore();
$em = $core->getEntityManager(); $em = $core->getEntityManager();
@@ -350,7 +349,6 @@ class appbox extends base
$this->post_upgrade($upgrader); $this->post_upgrade($upgrader);
$upgrader->add_steps_complete(1); $upgrader->add_steps_complete(1);
/** /**
* Step 9 * Step 9
*/ */

View File

@@ -291,7 +291,6 @@ abstract class base implements cache_cacheableInterface
$rs = $stmt->fetchAll(PDO::FETCH_ASSOC); $rs = $stmt->fetchAll(PDO::FETCH_ASSOC);
$stmt->closeCursor(); $stmt->closeCursor();
$ORMTables = array( $ORMTables = array(
'BasketElements', 'BasketElements',
'Baskets', 'Baskets',
@@ -469,7 +468,6 @@ abstract class base implements cache_cacheableInterface
. $is_default . " " . $isnull . ""; . $is_default . " " . $isnull . "";
} }
if ($table->indexes) { if ($table->indexes) {
foreach ($table->indexes->index as $index) { foreach ($table->indexes->index as $index) {
switch ($index->type) { switch ($index->type) {
@@ -623,7 +621,6 @@ abstract class base implements cache_cacheableInterface
} }
} }
$sql = "SHOW FULL FIELDS FROM `" . $table['name'] . "`"; $sql = "SHOW FULL FIELDS FROM `" . $table['name'] . "`";
$stmt = $this->get_connection()->prepare($sql); $stmt = $this->get_connection()->prepare($sql);
$stmt->execute(); $stmt->execute();
@@ -663,7 +660,6 @@ abstract class base implements cache_cacheableInterface
$expr_found .= ' DEFAULT \'' . $_default . '\''; $expr_found .= ' DEFAULT \'' . $_default . '\'';
} }
if (isset($correct_table['fields'][$f_name])) { if (isset($correct_table['fields'][$f_name])) {
if (isset($correct_table['collation'][$f_name]) && $correct_table['collation'][$f_name] != $current_collation) { if (isset($correct_table['collation'][$f_name]) && $correct_table['collation'][$f_name] != $current_collation) {
$old_type = mb_strtolower(trim($row2['Type'])); $old_type = mb_strtolower(trim($row2['Type']));

View File

@@ -83,7 +83,7 @@ class caption_Field_Value implements cache_cacheableInterface
return $this; return $this;
} catch (\Exception $e) { } catch (\Exception $e) {
} }
$connbas = $this->databox_field->get_databox()->get_connection(); $connbas = $this->databox_field->get_databox()->get_connection();
@@ -102,9 +102,8 @@ class caption_Field_Value implements cache_cacheableInterface
$this->VocabularyType = $row['VocabularyType'] ? Vocabulary\Controller::get($row['VocabularyType']) : null; $this->VocabularyType = $row['VocabularyType'] ? Vocabulary\Controller::get($row['VocabularyType']) : null;
$this->VocabularyId = $row['VocabularyId']; $this->VocabularyId = $row['VocabularyId'];
} catch (\Exception $e) { } catch (\Exception $e) {
}
}
if ($this->VocabularyType) { if ($this->VocabularyType) {
/** /**
@@ -288,7 +287,7 @@ class caption_Field_Value implements cache_cacheableInterface
$sphinx_rt->delete(array("documents" . $sbas_crc, "documents" . $sbas_crc . "_stemmed_fr", "documents" . $sbas_crc . "_stemmed_en"), "", $this->record->get_record_id()); $sphinx_rt->delete(array("documents" . $sbas_crc, "documents" . $sbas_crc . "_stemmed_fr", "documents" . $sbas_crc . "_stemmed_en"), "", $this->record->get_record_id());
} }
} catch (Exception $e) { } catch (Exception $e) {
} }
$this->update_cache_value($value); $this->update_cache_value($value);
@@ -381,7 +380,7 @@ class caption_Field_Value implements cache_cacheableInterface
return $caption_field_value; return $caption_field_value;
} catch (\Exception $e) { } catch (\Exception $e) {
} }
} }
@@ -552,7 +551,7 @@ class caption_Field_Value implements cache_cacheableInterface
if (isset(self::$localCache[$this->get_cache_key($option)])) { if (isset(self::$localCache[$this->get_cache_key($option)])) {
return self::$localCache[$this->get_cache_key($option)]; return self::$localCache[$this->get_cache_key($option)];
} }
throw new Exception('no value'); throw new Exception('no value');
} }
@@ -584,9 +583,9 @@ class caption_Field_Value implements cache_cacheableInterface
try { try {
$this->record->get_caption()->get_field($this->databox_field->get_name())->delete_data_from_cache(); $this->record->get_caption()->get_field($this->databox_field->get_name())->delete_data_from_cache();
} catch (\Exception $e) { } catch (\Exception $e) {
} }
unset(self::$localCache[$this->get_cache_key($option)]); unset(self::$localCache[$this->get_cache_key($option)]);
} }
} }

View File

@@ -71,7 +71,7 @@ class caption_field implements cache_cacheableInterface
try { try {
return $this->get_data_from_cache(); return $this->get_data_from_cache();
} catch (\Exception $e) { } catch (\Exception $e) {
} }
$connbas = $this->databox_field->get_connection(); $connbas = $this->databox_field->get_connection();
@@ -327,7 +327,7 @@ class caption_field implements cache_cacheableInterface
$record->set_metadatas(array()); $record->set_metadatas(array());
unset($record); unset($record);
} catch (Exception $e) { } catch (Exception $e) {
} }
} }
@@ -377,7 +377,7 @@ class caption_field implements cache_cacheableInterface
unset($record); unset($record);
} catch (Exception $e) { } catch (Exception $e) {
} }
return; return;
@@ -447,7 +447,7 @@ class caption_field implements cache_cacheableInterface
unset($caption_field); unset($caption_field);
unset($record); unset($record);
} catch (Exception $e) { } catch (Exception $e) {
} }
} }
@@ -479,7 +479,7 @@ class caption_field implements cache_cacheableInterface
if (isset(self::$localCache[$this->get_cache_key($option)])) { if (isset(self::$localCache[$this->get_cache_key($option)])) {
return self::$localCache[$this->get_cache_key($option)]; return self::$localCache[$this->get_cache_key($option)];
} }
throw new Exception('no value'); throw new Exception('no value');
} }

View File

@@ -532,7 +532,6 @@ class collection implements cache_cacheableInterface
$appbox->delete_data_from_cache(appbox::CACHE_LIST_BASES); $appbox->delete_data_from_cache(appbox::CACHE_LIST_BASES);
cache_databox::update($sbas_id, 'structure'); cache_databox::update($sbas_id, 'structure');
phrasea::reset_baseDatas(); phrasea::reset_baseDatas();
self::set_admin($new_bas, $user); self::set_admin($new_bas, $user);

View File

@@ -81,8 +81,6 @@ class connection
file_put_contents($registry->get('GV_RootPath') . 'logs/mysql_log.log', $string, FILE_APPEND); file_put_contents($registry->get('GV_RootPath') . 'logs/mysql_log.log', $string, FILE_APPEND);
return; return;
} }

View File

@@ -297,7 +297,6 @@ class databox extends base
); );
} }
ksort($trows); ksort($trows);
foreach ($trows as $kgrp => $vgrp) foreach ($trows as $kgrp => $vgrp)
ksort($trows[$kgrp]); ksort($trows[$kgrp]);
@@ -615,7 +614,6 @@ class databox extends base
$n ++; $n ++;
} }
$core['file-system']->mkdir($pathout, 0750); $core['file-system']->mkdir($pathout, 0750);
return $pathout . DIRECTORY_SEPARATOR; return $pathout . DIRECTORY_SEPARATOR;
@@ -787,7 +785,6 @@ class databox extends base
$stmt->execute($params); $stmt->execute($params);
$stmt->closeCursor(); $stmt->closeCursor();
return $this; return $this;
} }
protected $thesaurus; protected $thesaurus;
@@ -844,7 +841,6 @@ class databox extends base
if ( ! is_null($meta_id)) if ( ! is_null($meta_id))
continue; continue;
$nodes = $xp_struct->query('/record/description/' . $fname); $nodes = $xp_struct->query('/record/description/' . $fname);
if ($nodes->length > 0) { if ($nodes->length > 0) {
$nodes->item(0)->parentNode->removeChild($nodes->item(0)); $nodes->item(0)->parentNode->removeChild($nodes->item(0));
@@ -903,7 +899,6 @@ class databox extends base
) )
); );
$sql = "SELECT * FROM coll"; $sql = "SELECT * FROM coll";
$stmt = $this->get_connection()->prepare($sql); $stmt = $this->get_connection()->prepare($sql);
$stmt->execute(); $stmt->execute();

View File

@@ -80,7 +80,6 @@ class databox_subdefsStructure implements IteratorAggregate
$subdefgroup = $sx_struct->subdefs[0]; $subdefgroup = $sx_struct->subdefs[0];
foreach ($subdefgroup as $k => $subdefs) { foreach ($subdefgroup as $k => $subdefs) {
$subdefgroup_name = strtolower($subdefs->attributes()->name); $subdefgroup_name = strtolower($subdefs->attributes()->name);

View File

@@ -358,7 +358,7 @@ function giveInscript($lng, $demandes = null)
//je check si ya des cgu pour la base //je check si ya des cgu pour la base
if ($baseInsc['CGU']) { if ($baseInsc['CGU']) {
$out .= '<tr><td colspan="3" style="text-align:center;">' . _('login::register: L\'acces aux bases ci-dessous implique l\'acceptation des Conditions Generales d\'Utilisation (CGU) suivantes') . '<br/><a class="inscriptlink" href="/include/cguUtils.php?action=PRINT&bas=' . $sbasId . '">' . _('login::register::CGU: ouvrir dans une nouvelle fenetre') . '</a></td></tr>'; $out .= '<tr><td colspan="3" style="text-align:center;">' . _('login::register: L\'acces aux bases ci-dessous implique l\'acceptation des Conditions Generales d\'Utilisation (CGU) suivantes') . '<br/><a class="inscriptlink" href="/include/cguUtils.php?action=PRINT&bas=' . $sbasId . '">' . _('login::register::CGU: ouvrir dans une nouvelle fenetre') . '</a></td></tr>';
//$out .= '<tr><td colspan="3" style="text-align:center;"><div id="CGUTXT'.$sbasId.'" style="width:90%;height:120px;text-align:left;overflow:auto;">'.(string)$baseInsc['CGU'].'</div></td></tr>'; //$out .= '<tr><td colspan="3" style="text-align:center;"><div id="CGUTXT'.$sbasId.'" style="width:90%;height:120px;text-align:left;overflow:auto;">'.(string) $baseInsc['CGU'].'</div></td></tr>';
} }
foreach ($baseInsc['Colls'] as $collId => $collName) { foreach ($baseInsc['Colls'] as $collId => $collName) {
@@ -389,7 +389,7 @@ function giveInscript($lng, $demandes = null)
'<br/><a class="inscriptlink" href="/include/cguUtils.php?action=PRINT&bas=' . $sbasId . '&col=' . $collId . '">' . _('login::register::CGU: ouvrir dans une nouvelle fenetre') . '</a></td></tr>' . '<br/><a class="inscriptlink" href="/include/cguUtils.php?action=PRINT&bas=' . $sbasId . '&col=' . $collId . '">' . _('login::register::CGU: ouvrir dans une nouvelle fenetre') . '</a></td></tr>' .
// '<tr >' . // '<tr >' .
// '<td colspan="3" style="text-align:center;"><div style="height:120px;text-align:left;overflow:auto;">' . // '<td colspan="3" style="text-align:center;"><div style="height:120px;text-align:left;overflow:auto;">' .
// ''.(string)$collDesc['CGU'].'' . // ''.(string) $collDesc['CGU'].'' .
// '</div></td>' . // '</div></td>' .
// '</tr>' . // '</tr>' .
'<tr >' . '<tr >' .
@@ -408,4 +408,3 @@ function giveInscript($lng, $demandes = null)
return $out; return $out;
} }
?>

View File

@@ -133,7 +133,6 @@ class eventsmanager_notify_autoregister extends eventsmanager_notifyAbstract
$mailed = true; $mailed = true;
} }
$this->broker->notify($usr_id, __CLASS__, $datas, $mailed); $this->broker->notify($usr_id, __CLASS__, $datas, $mailed);
} }

View File

@@ -167,7 +167,6 @@ class eventsmanager_notify_bridgeuploadfail extends eventsmanager_notifyAbstract
$reason = (string) $sx->reason; $reason = (string) $sx->reason;
$body = "reason : " . $reason; $body = "reason : " . $reason;
return mail::send_mail($subject, $body, $to, $from); return mail::send_mail($subject, $body, $to, $from);
} }

View File

@@ -91,7 +91,6 @@ class eventsmanager_notify_order extends eventsmanager_notifyAbstract
$order_id_dom->appendChild($dom_xml->createTextNode($order_id)); $order_id_dom->appendChild($dom_xml->createTextNode($order_id));
$root->appendChild($usr_id_dom); $root->appendChild($usr_id_dom);
$root->appendChild($order_id_dom); $root->appendChild($order_id_dom);
@@ -227,7 +226,6 @@ class eventsmanager_notify_order extends eventsmanager_notifyAbstract
. _('Retrouvez son bon de commande dans l\'interface') . _('Retrouvez son bon de commande dans l\'interface')
. "</div>\n"; . "</div>\n";
return mail::send_mail($subject, $body, $to, $from); return mail::send_mail($subject, $body, $to, $from);
} }

View File

@@ -96,7 +96,6 @@ class eventsmanager_notify_push extends eventsmanager_notifyAbstract
$mailed = true; $mailed = true;
} }
return $this->broker->notify($params['to'], __CLASS__, $datas, $mailed); return $this->broker->notify($params['to'], __CLASS__, $datas, $mailed);
} }

View File

@@ -99,7 +99,6 @@ class eventsmanager_notify_register extends eventsmanager_notifyAbstract
$base_ids->appendChild($base_id_node); $base_ids->appendChild($base_id_node);
} }
$root->appendChild($usr_id); $root->appendChild($usr_id);
$root->appendChild($base_ids); $root->appendChild($base_ids);
@@ -132,7 +131,6 @@ class eventsmanager_notify_register extends eventsmanager_notifyAbstract
$mailed = true; $mailed = true;
} }
$this->broker->notify($usr_id, __CLASS__, $datas, $mailed); $this->broker->notify($usr_id, __CLASS__, $datas, $mailed);
} }

View File

@@ -34,9 +34,9 @@ class eventsmanager_notify_uploadquarantine extends eventsmanager_notifyAbstract
/** /**
* *
* @param string $event * @param string $event
* @param Array $params * @param Array $params
* @param mixed content $object * @param mixed content $object
*/ */
public function fire($event, $params, &$object) public function fire($event, $params, &$object)
{ {
@@ -100,7 +100,7 @@ class eventsmanager_notify_uploadquarantine extends eventsmanager_notifyAbstract
* Notifiy an user using the specified datas * Notifiy an user using the specified datas
* *
* @param \User_Adapter $user * @param \User_Adapter $user
* @param string $datas * @param string $datas
*/ */
private function notifyUser(\User_Adapter $user, $datas) private function notifyUser(\User_Adapter $user, $datas)
{ {

View File

@@ -108,7 +108,6 @@ class eventsmanager_notify_validate extends eventsmanager_notifyAbstract
$mailed = true; $mailed = true;
} }
return $this->broker->notify($params['to'], __CLASS__, $datas, $mailed); return $this->broker->notify($params['to'], __CLASS__, $datas, $mailed);
} }

View File

@@ -161,7 +161,6 @@ class geonames
} }
$this->cache_ips[$ip] = $output; $this->cache_ips[$ip] = $output;
return $output; return $output;
} }
} }

View File

@@ -53,7 +53,6 @@ class mail
) )
. '</div>'; . '</div>';
if ($message != '') { if ($message != '') {
$body .= "<div>---------------------------------------------------</div>\n" . $message; $body .= "<div>---------------------------------------------------</div>\n" . $message;
} }
@@ -100,7 +99,6 @@ class mail
$registry = registry::get_instance(); $registry = registry::get_instance();
$subject = sprintf(_('login::register:email: Votre compte %s'), $registry->get('GV_homeTitle')); $subject = sprintf(_('login::register:email: Votre compte %s'), $registry->get('GV_homeTitle'));
$body = "<div>" . _('login::register:Votre inscription a ete prise en compte') . "</div>\n"; $body = "<div>" . _('login::register:Votre inscription a ete prise en compte') . "</div>\n";
if ($auto != '') { if ($auto != '') {

View File

@@ -601,7 +601,7 @@ class media_subdef extends media_abstract implements cache_cacheableInterface
if ( ! $this->is_physically_present()) { if ( ! $this->is_physically_present()) {
return array(); return array();
} }
$Core = \bootstrap::getCore(); $Core = \bootstrap::getCore();
$media = $Core['mediavorus']->guess(new \SplFileInfo($this->get_pathfile())); $media = $Core['mediavorus']->guess(new \SplFileInfo($this->get_pathfile()));

View File

@@ -70,7 +70,6 @@ class module_admin
, 'off_databoxes' => $off_databoxes , 'off_databoxes' => $off_databoxes
); );
$core = \bootstrap::getCore(); $core = \bootstrap::getCore();
$twig = $core->getTwig(); $twig = $core->getTwig();

View File

@@ -47,6 +47,7 @@ class module_console_checkExtension extends Command
if ( ! extension_loaded('phrasea2')) { if ( ! extension_loaded('phrasea2')) {
$output->writeln("<error>Missing Extension php-phrasea.</error>"); $output->writeln("<error>Missing Extension php-phrasea.</error>");
return 1; return 1;
} }
@@ -107,7 +108,6 @@ class module_console_checkExtension extends Command
$output->writeln("\t$key => $value"); $output->writeln("\t$key => $value");
} }
$output->writeln(""); $output->writeln("");
$output->writeln("\n-- phrasea_create_session --"); $output->writeln("\n-- phrasea_create_session --");
@@ -168,7 +168,6 @@ class module_console_checkExtension extends Command
} }
} }
$output->writeln("\n-- phrasea_query --"); $output->writeln("\n-- phrasea_query --");
$nbanswers = 0; $nbanswers = 0;
@@ -188,7 +187,6 @@ class module_console_checkExtension extends Command
, array() , array()
); );
if ($ret) { if ($ret) {
$output->writeln("<info>Succes ! </info> got result on sbas_id " . $base["sbas_id"]); $output->writeln("<info>Succes ! </info> got result on sbas_id " . $base["sbas_id"]);
} else { } else {
@@ -202,7 +200,6 @@ class module_console_checkExtension extends Command
$nbanswers += $tbases[$kb]["results"]["nbanswers"]; $nbanswers += $tbases[$kb]["results"]["nbanswers"];
} }
$output->writeln("Got a total of <info>$nbanswers</info> answers"); $output->writeln("Got a total of <info>$nbanswers</info> answers");
$output->writeln("\n-- phrasea_fetch_results --"); $output->writeln("\n-- phrasea_fetch_results --");

View File

@@ -60,7 +60,6 @@ class module_console_fieldsDelete extends Command
return 1; return 1;
} }
$dialog = $this->getHelperSet()->get('dialog'); $dialog = $this->getHelperSet()->get('dialog');
$continue = mb_strtolower( $continue = mb_strtolower(
$dialog->ask( $dialog->ask(

View File

@@ -63,7 +63,6 @@ class module_console_fieldsRename extends Command
return 1; return 1;
} }
$dialog = $this->getHelperSet()->get('dialog'); $dialog = $this->getHelperSet()->get('dialog');
$continue = mb_strtolower( $continue = mb_strtolower(
$dialog->ask( $dialog->ask(

View File

@@ -152,7 +152,6 @@ class module_console_fileEnsureDevSetting extends Command
{ {
$cache = $this->configuration->getCache(); $cache = $this->configuration->getCache();
if ($this->probeCacheService($output, $cache)) { if ($this->probeCacheService($output, $cache)) {
if ($this->recommendedCacheService($output, $cache, true)) { if ($this->recommendedCacheService($output, $cache, true)) {
$work_message = '<info>Works !</info>'; $work_message = '<info>Works !</info>';
@@ -167,7 +166,6 @@ class module_console_fileEnsureDevSetting extends Command
$verification = sprintf("\t--> Verify <info>%s</info> : %s", 'MainCache', $work_message); $verification = sprintf("\t--> Verify <info>%s</info> : %s", 'MainCache', $work_message);
$this->printConf($output, "\t" . 'service', $cache, false, $verification); $this->printConf($output, "\t" . 'service', $cache, false, $verification);
$this->verifyCacheOptions($output, $cache); $this->verifyCacheOptions($output, $cache);
} }
@@ -176,7 +174,6 @@ class module_console_fileEnsureDevSetting extends Command
{ {
$cache = $this->configuration->getOpcodeCache(); $cache = $this->configuration->getOpcodeCache();
if ($this->probeCacheService($output, $cache)) { if ($this->probeCacheService($output, $cache)) {
if ($this->recommendedCacheService($output, $cache, false)) { if ($this->recommendedCacheService($output, $cache, false)) {
$work_message = '<info>Works !</info>'; $work_message = '<info>Works !</info>';
@@ -191,7 +188,6 @@ class module_console_fileEnsureDevSetting extends Command
$verification = sprintf("\t--> Verify <info>%s</info> : %s", 'OpcodeCache', $work_message); $verification = sprintf("\t--> Verify <info>%s</info> : %s", 'OpcodeCache', $work_message);
$this->printConf($output, "\t" . 'service', $cache, false, $verification); $this->printConf($output, "\t" . 'service', $cache, false, $verification);
$this->verifyCacheOptions($output, $cache); $this->verifyCacheOptions($output, $cache);
} }
@@ -423,7 +419,7 @@ class module_console_fileEnsureDevSetting extends Command
return true; return true;
} catch (\Exception $e) { } catch (\Exception $e) {
} }
return false; return false;
@@ -454,8 +450,6 @@ class module_console_fileEnsureDevSetting extends Command
$this->errors ++; $this->errors ++;
} }
foreach ($configuration->all() as $conf => $value) { foreach ($configuration->all() as $conf => $value) {
switch ($conf) { switch ($conf) {
case 'type': case 'type':
@@ -552,8 +546,6 @@ class module_console_fileEnsureDevSetting extends Command
$output->writeln(sprintf("\t--> Verify ORM engine <info>%s</info> : %s", $ormName, $work_message)); $output->writeln(sprintf("\t--> Verify ORM engine <info>%s</info> : %s", $ormName, $work_message));
if ( ! $configuration->has('type')) { if ( ! $configuration->has('type')) {
$output->writeln("\n<error>Configuration has no type</error>"); $output->writeln("\n<error>Configuration has no type</error>");
$this->errors ++; $this->errors ++;
@@ -564,8 +556,6 @@ class module_console_fileEnsureDevSetting extends Command
$this->errors ++; $this->errors ++;
} }
foreach ($configuration->all() as $conf => $value) { foreach ($configuration->all() as $conf => $value) {
switch ($conf) { switch ($conf) {
case 'type': case 'type':
@@ -589,7 +579,6 @@ class module_console_fileEnsureDevSetting extends Command
} }
} }
foreach ($configuration->get('options') as $conf => $value) { foreach ($configuration->get('options') as $conf => $value) {
switch ($conf) { switch ($conf) {
case 'log': case 'log':
@@ -630,7 +619,6 @@ class module_console_fileEnsureDevSetting extends Command
$verification = sprintf("\t--> Verify <info>%s</info> : %s", $name, $work_message); $verification = sprintf("\t--> Verify <info>%s</info> : %s", $name, $work_message);
$this->printConf($output, "\t" . $key_cache, $value_cache, false, $verification); $this->printConf($output, "\t" . $key_cache, $value_cache, false, $verification);
$this->verifyCacheOptions($output, $value_cache); $this->verifyCacheOptions($output, $value_cache);
break; break;
@@ -764,7 +752,6 @@ class module_console_fileEnsureDevSetting extends Command
return false; return false;
} }
try { try {
$driver = $Service->getDriver(); $driver = $Service->getDriver();
} catch (\Exception $e) { } catch (\Exception $e) {
@@ -794,10 +781,11 @@ class module_console_fileEnsureDevSetting extends Command
$ret = true; $ret = true;
} catch (\Exception $e) { } catch (\Exception $e) {
} }
unset($memcached); unset($memcached);
return $ret; return $ret;
break; break;
case 'redis': case 'redis':
@@ -808,9 +796,10 @@ class module_console_fileEnsureDevSetting extends Command
$ret = true; $ret = true;
} }
} catch (\Exception $e) { } catch (\Exception $e) {
} }
unset($redis); unset($redis);
return $ret; return $ret;
break; break;
} }

View File

@@ -162,7 +162,6 @@ class module_console_fileEnsureProductionSetting extends Command
$verification = sprintf("\t--> Verify <info>%s</info> : %s", 'MainCache', $work_message); $verification = sprintf("\t--> Verify <info>%s</info> : %s", 'MainCache', $work_message);
$this->printConf($output, "\t" . 'service', $cache, false, $verification); $this->printConf($output, "\t" . 'service', $cache, false, $verification);
$this->verifyCacheOptions($output, $cache); $this->verifyCacheOptions($output, $cache);
} }
@@ -171,7 +170,6 @@ class module_console_fileEnsureProductionSetting extends Command
{ {
$cache = $this->configuration->getOpcodeCache(); $cache = $this->configuration->getOpcodeCache();
if ($this->probeCacheService($output, $cache)) { if ($this->probeCacheService($output, $cache)) {
if ($this->recommendedCacheService($output, $cache, false)) { if ($this->recommendedCacheService($output, $cache, false)) {
$work_message = '<info>Works !</info>'; $work_message = '<info>Works !</info>';
@@ -186,7 +184,6 @@ class module_console_fileEnsureProductionSetting extends Command
$verification = sprintf("\t--> Verify <info>%s</info> : %s", 'OpcodeCache', $work_message); $verification = sprintf("\t--> Verify <info>%s</info> : %s", 'OpcodeCache', $work_message);
$this->printConf($output, "\t" . 'service', $cache, false, $verification); $this->printConf($output, "\t" . 'service', $cache, false, $verification);
$this->verifyCacheOptions($output, $cache); $this->verifyCacheOptions($output, $cache);
} }
@@ -411,7 +408,7 @@ class module_console_fileEnsureProductionSetting extends Command
return true; return true;
} catch (\Exception $e) { } catch (\Exception $e) {
} }
return false; return false;
@@ -442,8 +439,6 @@ class module_console_fileEnsureProductionSetting extends Command
$this->errors ++; $this->errors ++;
} }
foreach ($configuration->all() as $conf => $value) { foreach ($configuration->all() as $conf => $value) {
switch ($conf) { switch ($conf) {
case 'type': case 'type':
@@ -540,8 +535,6 @@ class module_console_fileEnsureProductionSetting extends Command
$output->writeln(sprintf("\t--> Verify ORM engine <info>%s</info> : %s", $ormName, $work_message)); $output->writeln(sprintf("\t--> Verify ORM engine <info>%s</info> : %s", $ormName, $work_message));
if ( ! $configuration->has('type')) { if ( ! $configuration->has('type')) {
$output->writeln("\n<error>Configuration has no type</error>"); $output->writeln("\n<error>Configuration has no type</error>");
$this->errors ++; $this->errors ++;
@@ -552,8 +545,6 @@ class module_console_fileEnsureProductionSetting extends Command
$this->errors ++; $this->errors ++;
} }
foreach ($configuration->all() as $conf => $value) { foreach ($configuration->all() as $conf => $value) {
switch ($conf) { switch ($conf) {
case 'type': case 'type':
@@ -577,7 +568,6 @@ class module_console_fileEnsureProductionSetting extends Command
} }
} }
foreach ($configuration->get('options') as $conf => $value) { foreach ($configuration->get('options') as $conf => $value) {
switch ($conf) { switch ($conf) {
case 'log': case 'log':
@@ -627,7 +617,6 @@ class module_console_fileEnsureProductionSetting extends Command
$verification = sprintf("\t--> Verify <info>%s</info> : %s", $name, $work_message); $verification = sprintf("\t--> Verify <info>%s</info> : %s", $name, $work_message);
$this->printConf($output, "\t" . $key_cache, $value_cache, false, $verification); $this->printConf($output, "\t" . $key_cache, $value_cache, false, $verification);
$this->verifyCacheOptions($output, $value_cache); $this->verifyCacheOptions($output, $value_cache);
break; break;
@@ -790,10 +779,11 @@ class module_console_fileEnsureProductionSetting extends Command
$ret = true; $ret = true;
} catch (\Exception $e) { } catch (\Exception $e) {
} }
unset($memcached); unset($memcached);
return $ret; return $ret;
break; break;
case 'redis': case 'redis':
@@ -804,9 +794,10 @@ class module_console_fileEnsureProductionSetting extends Command
$ret = true; $ret = true;
} }
} catch (\Exception $e) { } catch (\Exception $e) {
} }
unset($redis); unset($redis);
return $ret; return $ret;
break; break;
} }

View File

@@ -56,9 +56,9 @@ class module_console_schedulerState extends Command
public function execute(InputInterface $input, OutputInterface $output) public function execute(InputInterface $input, OutputInterface $output)
{ {
try{ try {
$this->checkSetup(); $this->checkSetup();
} catch (\RuntimeException $e){ } catch (\RuntimeException $e) {
return self::EXITCODE_SETUP_ERROR; return self::EXITCODE_SETUP_ERROR;
} }

View File

@@ -28,7 +28,6 @@ class module_console_sphinxGenerateSuggestion extends Command
$this->setDescription('Generate suggestions for Sphinx Search Engine'); $this->setDescription('Generate suggestions for Sphinx Search Engine');
return $this; return $this;
} }

View File

@@ -188,7 +188,6 @@ class module_console_systemExport extends Command
$rs = $stmt->fetchAll(PDO::FETCH_ASSOC); $rs = $stmt->fetchAll(PDO::FETCH_ASSOC);
$stmt->closeCursor(); $stmt->closeCursor();
$done = 0; $done = 0;
$current_total = count($rs); $current_total = count($rs);
$total += $current_total; $total += $current_total;

View File

@@ -83,7 +83,6 @@ class module_console_systemMailCheck extends Command
$continue = mb_strtolower($dialog->ask($output, $question, 'C')); $continue = mb_strtolower($dialog->ask($output, $question, 'C'));
} while ( ! in_array($continue, array('c', 'd', 's'))); } while ( ! in_array($continue, array('c', 'd', 's')));
if ($continue == 's') { if ($continue == 's') {
return false; return false;
} elseif ($continue == 'c') { } elseif ($continue == 'c') {

View File

@@ -74,7 +74,6 @@ class module_console_systemUpgrade extends Command
$continue = mb_strtolower($dialog->ask($output, '<question>' . _('Continuer ?') . ' (Y/n)</question>', 'Y')); $continue = mb_strtolower($dialog->ask($output, '<question>' . _('Continuer ?') . ' (Y/n)</question>', 'Y'));
} while ( ! in_array($continue, array('y', 'n'))); } while ( ! in_array($continue, array('y', 'n')));
if ($continue == 'y') { if ($continue == 'y') {
try { try {
$Core = \bootstrap::getCore(); $Core = \bootstrap::getCore();

View File

@@ -64,9 +64,9 @@ class module_console_taskState extends Command
public function execute(InputInterface $input, OutputInterface $output) public function execute(InputInterface $input, OutputInterface $output)
{ {
try{ try {
$this->checkSetup(); $this->checkSetup();
} catch (\RuntimeException $e){ } catch (\RuntimeException $e) {
return self::EXITCODE_SETUP_ERROR; return self::EXITCODE_SETUP_ERROR;
} }

View File

@@ -39,9 +39,9 @@ class module_console_tasklist extends Command
public function execute(InputInterface $input, OutputInterface $output) public function execute(InputInterface $input, OutputInterface $output)
{ {
try{ try {
$this->checkSetup(); $this->checkSetup();
} catch (\RuntimeException $e){ } catch (\RuntimeException $e) {
return self::EXITCODE_SETUP_ERROR; return self::EXITCODE_SETUP_ERROR;
} }

Some files were not shown because too many files have changed in this diff Show More