Report previous patches

This commit is contained in:
Nicolas Le Goff
2015-02-09 13:42:26 +01:00
parent 32b6423cbe
commit 065f64bd47
7 changed files with 55 additions and 7 deletions

View File

@@ -11,14 +11,11 @@
namespace KonsoleKommander;
use Alchemy\Phrasea\Command\BuildSubdefs;
use Alchemy\Phrasea\Command\Plugin\ListPlugin;
use Alchemy\Phrasea\Command\Setup\H264ConfigurationDumper;
use Alchemy\Phrasea\Command\Setup\H264MappingGenerator;
use Alchemy\Phrasea\Command\Setup\StaticConfigurationDumper;
use Alchemy\Phrasea\Command\SearchEngine\IndexFull;
use Alchemy\Phrasea\Command\WebsocketServer;
use Alchemy\Phrasea\Core\Version;
use Alchemy\Phrasea\Command\BuildMissingSubdefs;
use Alchemy\Phrasea\Command\CreateCollection;

View File

@@ -40,7 +40,8 @@
"alchemy/geonames-api-consumer" : "~0.1.0",
"goodby/csv" : "~1.0",
"guzzle/guzzle" : "~3.0",
"imagine/imagine" : "dev-alchemy-0.6.2 as 0.6.2","igorw/get-in" : "~1.0",
"imagine/imagine" : "dev-alchemy-0.6.2 as 0.6.2",
"igorw/get-in" : "~1.0",
"ircmaxell/random-lib" : "~1.0",
"jms/serializer" : "~0.10",
"jms/translation-bundle" : "~1.1",

View File

@@ -555,7 +555,8 @@ class V1 implements ControllerProviderInterface
return $this->getBadRequest($app, $request, sprintf('Invalid forceBehavior value `%s`', $request->get('forceBehavior')));
}
$app['border-manager']->process($session, $Package, $callback, $behavior);
$nosubdef = $request->get('nosubdefs')==='' || \p4field::isyes($request->get('nosubdefs'));
$app['border-manager']->process($session, $Package, $callback, $behavior, $nosubdef);
$ret = ['entity' => null,];
@@ -1325,13 +1326,38 @@ class V1 implements ControllerProviderInterface
}
}
if($media->get_name() != 'document') {
$databox = $record->get_databox();
try {
$subDefDefinition = $databox->get_subdef_structure()->get_subdef($record->get_type(), $media->get_name());
} catch (\Exception_Databox_SubdefNotFound $e) {
return null;
}
}
if ($media->get_name() != 'document' && false === $subDefDefinition->is_downloadable()) {
return null;
}
if ($media->get_permalink() instanceof \media_Permalink_Adapter) {
$permalink = $this->list_permalink($media->get_permalink());
} else {
$permalink = null;
}
return ['name' => $media->get_name(), 'permalink' => $permalink, 'height' => $media->get_height(), 'width' => $media->get_width(), 'filesize' => $media->get_size(), 'devices' => $media->getDevices(), 'player_type' => $media->get_type(), 'mime_type' => $media->get_mime(),];
return [
'name' => $media->get_name(),
'permalink' => $permalink,
'height' => $media->get_height(),
'width' => $media->get_width(),
'filesize' => $media->get_size(),
'devices' => $media->getDevices(),
'player_type' => $media->get_type(),
'mime_type' => $media->get_mime(),
'substituted' => $media->is_substituted(),
'created_on' => $media->get_creation_date()->format(DATE_ATOM),
'updated_on' => $media->get_modification_date()->format(DATE_ATOM),
];
}
/**

View File

@@ -217,6 +217,7 @@ class UserManager
$this->cleanFtpExports($user);
$this->cleanAuthProvider($user);
$this->cleanUserSessions($user);
$this->cleanOauthApplication($user);
}
/**
@@ -235,4 +236,18 @@ class UserManager
$stmt->closeCursor();
}
}
private function cleanOauthApplication(User $user)
{
$accounts = $this->objectManager->getRepository('Phraseanet:ApiAccount')->findByUser($user);
foreach ($accounts as $account) {
$this->objectManager->remove($account);
}
$apps = $this->objectManager->getRepository('Phraseanet:ApiApplication')->findByCreator($user);
foreach ($apps as $app) {
$this->objectManager->remove($app);
}
}
}

View File

@@ -24,4 +24,13 @@ class ApiAccountRepository extends EntityRepository
return $qb->getQuery()->getOneOrNullResult();
}
public function findByUser(User $user)
{
$qb = $this->createQueryBuilder('acc');
$qb->where($qb->expr()->eq('acc.user', ':user'));
$qb->setParameter(':user', $user);
return $qb->getQuery()->getResult();
}
}

View File

@@ -118,6 +118,7 @@ class BridgeJob extends AbstractJob
try {
$dist_id = $account->get_api()->upload($element->get_record(), $element->get_datas());
$element->set_uploaded_on(new \DateTime());
$element->set_status(\Bridge_Element::STATUS_DONE);
} catch (\Exception $e) {
$this->log('debug', 'Error while uploading : ' . $e->getMessage());
$element->set_status(\Bridge_Element::STATUS_ERROR);

View File

@@ -89,7 +89,6 @@ class patch_320alpha4b extends patchAbstract
if (null === $user = $this->loadUser($app['EM'], $row['usr_id'])) {
continue;
}
$feed = $this->get_feed($appbox, $user, $row['pub_restrict'], $row['homelink'], $app);
$feed = $this->get_feed($app, $appbox, $user, $row['pub_restrict'], $row['homelink']);