mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-18 15:33:15 +00:00
Fix hidden use of repositories
This commit is contained in:
@@ -103,8 +103,7 @@ class Lightbox implements ControllerProviderInterface
|
|||||||
return new Response('');
|
return new Response('');
|
||||||
}
|
}
|
||||||
|
|
||||||
$basketElement = $app['EM']
|
$basketElement = $app['repo.basket-elements']
|
||||||
->getRepository('Phraseanet:BasketElement')
|
|
||||||
->findUserElement($sselcont_id, $app['authentication']->getUser());
|
->findUserElement($sselcont_id, $app['authentication']->getUser());
|
||||||
|
|
||||||
$parameters = [
|
$parameters = [
|
||||||
|
@@ -305,8 +305,7 @@ class Login implements ControllerProviderInterface
|
|||||||
return $app->redirectPath('login_register');
|
return $app->redirectPath('login_register');
|
||||||
}
|
}
|
||||||
|
|
||||||
$userAuthProvider = $app['EM']
|
$userAuthProvider = $app['repo.usr-auth-providers']
|
||||||
->getRepository('Phraseanet:UsrAuthProvider')
|
|
||||||
->findWithProviderAndId($token->getProvider()->getId(), $token->getId());
|
->findWithProviderAndId($token->getProvider()->getId(), $token->getId());
|
||||||
|
|
||||||
if (null !== $userAuthProvider) {
|
if (null !== $userAuthProvider) {
|
||||||
@@ -827,8 +826,7 @@ class Login implements ControllerProviderInterface
|
|||||||
{
|
{
|
||||||
$date = new \DateTime('+' . (int) $app['conf']->get(['registry', 'actions', 'validation-reminder-days']) . ' days');
|
$date = new \DateTime('+' . (int) $app['conf']->get(['registry', 'actions', 'validation-reminder-days']) . ' days');
|
||||||
|
|
||||||
foreach ($app['EM']
|
foreach ($app['repo.validation-participants']
|
||||||
->getRepository('Phraseanet:ValidationParticipant')
|
|
||||||
->findNotConfirmedAndNotRemindedParticipantsByExpireDate($date) as $participant) {
|
->findNotConfirmedAndNotRemindedParticipantsByExpireDate($date) as $participant) {
|
||||||
|
|
||||||
/* @var $participant ValidationParticipant */
|
/* @var $participant ValidationParticipant */
|
||||||
@@ -900,8 +898,7 @@ class Login implements ControllerProviderInterface
|
|||||||
return $app->redirectPath('homepage');
|
return $app->redirectPath('homepage');
|
||||||
}
|
}
|
||||||
|
|
||||||
$userAuthProvider = $app['EM']
|
$userAuthProvider = $app['repo.usr-auth-providers']
|
||||||
->getRepository('Phraseanet:UsrAuthProvider')
|
|
||||||
->findWithProviderAndId($token->getProvider()->getId(), $token->getId());
|
->findWithProviderAndId($token->getProvider()->getId(), $token->getId());
|
||||||
|
|
||||||
if (null !== $userAuthProvider) {
|
if (null !== $userAuthProvider) {
|
||||||
|
@@ -199,6 +199,9 @@ class ORMServiceProvider implements ServiceProviderInterface
|
|||||||
$app['repo.basket-elements'] = $app->share(function (PhraseaApplication $app) {
|
$app['repo.basket-elements'] = $app->share(function (PhraseaApplication $app) {
|
||||||
return $app['EM']->getRepository('Phraseanet:BasketElement');
|
return $app['EM']->getRepository('Phraseanet:BasketElement');
|
||||||
});
|
});
|
||||||
|
$app['repo.validation-participants'] = $app->share(function (PhraseaApplication $app) {
|
||||||
|
return $app['EM']->getRepository('Phraseanet:ValidationParticipant');
|
||||||
|
});
|
||||||
$app['repo.story-wz'] = $app->share(function (PhraseaApplication $app) {
|
$app['repo.story-wz'] = $app->share(function (PhraseaApplication $app) {
|
||||||
return $app['EM']->getRepository('Phraseanet:StoryWZ');
|
return $app['EM']->getRepository('Phraseanet:StoryWZ');
|
||||||
});
|
});
|
||||||
@@ -235,6 +238,15 @@ class ORMServiceProvider implements ServiceProviderInterface
|
|||||||
$app['repo.lazaret-files'] = $app->share(function (PhraseaApplication $app) {
|
$app['repo.lazaret-files'] = $app->share(function (PhraseaApplication $app) {
|
||||||
return $app['EM']->getRepository('Phraseanet:LazaretFile');
|
return $app['EM']->getRepository('Phraseanet:LazaretFile');
|
||||||
});
|
});
|
||||||
|
$app['repo.usr-auth-providers'] = $app->share(function (PhraseaApplication $app) {
|
||||||
|
return $app['EM']->getRepository('Phraseanet:UsrAuthProvider');
|
||||||
|
});
|
||||||
|
$app['repo.ftp-exports'] = $app->share(function (PhraseaApplication $app) {
|
||||||
|
return $app['EM']->getRepository('Phraseanet:FtpExport');
|
||||||
|
});
|
||||||
|
$app['repo.user-queries'] = $app->share(function (PhraseaApplication $app) {
|
||||||
|
return $app['EM']->getRepository('Phraseanet:UserQuery');
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public function boot(Application $app)
|
public function boot(Application $app)
|
||||||
|
@@ -73,8 +73,7 @@ class FtpJob extends AbstractJob
|
|||||||
|
|
||||||
private function removeDeadExports(Application $app)
|
private function removeDeadExports(Application $app)
|
||||||
{
|
{
|
||||||
foreach ($app['EM']
|
foreach ($app['repo.ftp-exports']
|
||||||
->getRepository('Phraseanet:FtpExport')
|
|
||||||
->findCrashedExports(new \DateTime('-1 month')) as $export) {
|
->findCrashedExports(new \DateTime('-1 month')) as $export) {
|
||||||
$app['EM']->remove($export);
|
$app['EM']->remove($export);
|
||||||
}
|
}
|
||||||
@@ -83,8 +82,7 @@ class FtpJob extends AbstractJob
|
|||||||
|
|
||||||
private function retrieveExports(Application $app)
|
private function retrieveExports(Application $app)
|
||||||
{
|
{
|
||||||
return $app['EM']
|
return $app['repo.ftp-exports']
|
||||||
->getRepository('Phraseanet:FtpExport')
|
|
||||||
->findDoableExports();
|
->findDoableExports();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -96,8 +96,7 @@ class eventsmanager_notify_validate extends eventsmanager_notifyAbstract
|
|||||||
$user_from = $this->app['repo.users']->find($params['from']);
|
$user_from = $this->app['repo.users']->find($params['from']);
|
||||||
$user_to = $this->app['repo.users']->find($params['to']);
|
$user_to = $this->app['repo.users']->find($params['to']);
|
||||||
|
|
||||||
$basket = $this->app['EM']
|
$basket = $this->app['repo.baskets']
|
||||||
->getRepository('Phraseanet:Basket')
|
|
||||||
->find($params['ssel_id']);
|
->find($params['ssel_id']);
|
||||||
$title = $basket->getName();
|
$title = $basket->getName();
|
||||||
|
|
||||||
|
@@ -91,8 +91,7 @@ class eventsmanager_notify_validationdone extends eventsmanager_notifyAbstract
|
|||||||
$user_from = $this->app['repo.users']->find($params['from']);
|
$user_from = $this->app['repo.users']->find($params['from']);
|
||||||
$user_to = $this->app['repo.users']->find($params['to']);
|
$user_to = $this->app['repo.users']->find($params['to']);
|
||||||
|
|
||||||
$basket = $this->app['EM']
|
$basket = $this->app['repo.baskets']
|
||||||
->getRepository('Phraseanet:Basket')
|
|
||||||
->find($params['ssel_id']);
|
->find($params['ssel_id']);
|
||||||
$title = $basket->getName();
|
$title = $basket->getName();
|
||||||
|
|
||||||
|
@@ -97,8 +97,7 @@ class eventsmanager_notify_validationreminder extends eventsmanager_notifyAbstra
|
|||||||
|
|
||||||
$readyToSend = false;
|
$readyToSend = false;
|
||||||
try {
|
try {
|
||||||
$basket = $this->app['EM']
|
$basket = $this->app['repo.baskets']
|
||||||
->getRepository('Phraseanet:Basket')
|
|
||||||
->find($params['ssel_id']);
|
->find($params['ssel_id']);
|
||||||
$title = $basket->getName();
|
$title = $basket->getName();
|
||||||
|
|
||||||
|
@@ -188,9 +188,7 @@ class queries
|
|||||||
{
|
{
|
||||||
$history = '<ul>';
|
$history = '<ul>';
|
||||||
|
|
||||||
$queries = $app['EM']
|
$queries = $app['repo.user-queries']->findBy(['user' => $usrId], ['created' => 'ASC'], 25, 0);
|
||||||
->getRepository('Phraseanet:UserQuery')
|
|
||||||
->findBy(['user' => $usrId], ['created' => 'ASC'], 25, 0);
|
|
||||||
|
|
||||||
foreach ($queries as $query) {
|
foreach ($queries as $query) {
|
||||||
$history .= '<li onclick="doSpecialSearch(\'' . str_replace(["'", '"'], ["\'", '"'], $query->getQuery()) . '\')">' . $query->getQuery() . '</li>';
|
$history .= '<li onclick="doSpecialSearch(\'' . str_replace(["'", '"'], ["\'", '"'], $query->getQuery()) . '\')">' . $query->getQuery() . '</li>';
|
||||||
|
Reference in New Issue
Block a user