Merge pull request #18558 from owncloud/ext-objectstore
Prevent objectstore being set from client side
This commit is contained in:
commit
e2bd026b2e
|
@ -138,6 +138,16 @@ abstract class StoragesController extends Controller {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($storage->getBackendOption('objectstore')) {
|
||||||
|
// objectstore must not be sent from client side
|
||||||
|
return new DataResponse(
|
||||||
|
array(
|
||||||
|
'message' => (string)$this->l10n->t('Objectstore forbidden')
|
||||||
|
),
|
||||||
|
Http::STATUS_UNPROCESSABLE_ENTITY
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
/** @var Backend */
|
/** @var Backend */
|
||||||
$backend = $storage->getBackend();
|
$backend = $storage->getBackend();
|
||||||
/** @var AuthMechanism */
|
/** @var AuthMechanism */
|
||||||
|
|
|
@ -472,10 +472,14 @@ abstract class StoragesService {
|
||||||
if (!isset($allStorages[$id])) {
|
if (!isset($allStorages[$id])) {
|
||||||
throw new NotFoundException('Storage with id "' . $id . '" not found');
|
throw new NotFoundException('Storage with id "' . $id . '" not found');
|
||||||
}
|
}
|
||||||
|
|
||||||
$oldStorage = $allStorages[$id];
|
$oldStorage = $allStorages[$id];
|
||||||
$allStorages[$id] = $updatedStorage;
|
|
||||||
|
|
||||||
|
// ensure objectstore is persistent
|
||||||
|
if ($objectstore = $oldStorage->getBackendOption('objectstore')) {
|
||||||
|
$updatedStorage->setBackendOption('objectstore', $objectstore);
|
||||||
|
}
|
||||||
|
|
||||||
|
$allStorages[$id] = $updatedStorage;
|
||||||
$this->writeConfig($allStorages);
|
$this->writeConfig($allStorages);
|
||||||
|
|
||||||
$this->triggerChangeHooks($oldStorage, $updatedStorage);
|
$this->triggerChangeHooks($oldStorage, $updatedStorage);
|
||||||
|
|
Loading…
Reference in New Issue