Skip to content
This repository has been archived by the owner on Nov 25, 2020. It is now read-only.

Commit

Permalink
Fix applyInstallerForm for packages
Browse files Browse the repository at this point in the history
  • Loading branch information
cdujeu committed Oct 19, 2016
1 parent efc2556 commit bdf5bdc
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions core/src/plugins/boot.conf/BootConfLoader.php
Expand Up @@ -24,6 +24,9 @@
use dibi;
use DOMXPath;
use Exception;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use Zend\Diactoros\Response\JsonResponse;
use Pydio\Access\Core\Model\Repository;
use Pydio\Core\Exception\PydioException;
use Pydio\Core\Model\Context;
Expand Down Expand Up @@ -180,7 +183,7 @@ public function printFormFromServerSettings($fullManifest)
* @param \Psr\Http\Message\ServerRequestInterface $requestInterface
* @param \Psr\Http\Message\ResponseInterface $responseInterface
*/
public function loadInstallerForm(\Psr\Http\Message\ServerRequestInterface $requestInterface, \Psr\Http\Message\ResponseInterface &$responseInterface)
public function loadInstallerForm(ServerRequestInterface $requestInterface, ResponseInterface &$responseInterface)
{
$httpVars = $requestInterface->getParsedBody();
if (isSet($httpVars["lang"])) {
Expand All @@ -195,14 +198,16 @@ public function loadInstallerForm(\Psr\Http\Message\ServerRequestInterface $requ

/**
* Transmit to the ajxp_conf load_plugin_manifest action
* @param $action
* @param $httpVars
* @param $fileVars
* @param ServerRequestInterface $requestInterface
* @param ResponseInterface $responseInterface
*/
public function applyInstallerForm($action, $httpVars, $fileVars, ContextInterface $ctx)
public function applyInstallerForm(ServerRequestInterface $requestInterface, ResponseInterface &$responseInterface)
{
$data = array();
OptionsHelper::parseStandardFormParameters($ctx, $httpVars, $data, "");
OptionsHelper::parseStandardFormParameters(
$requestInterface->getAttribute("ctx"),
$requestInterface->getParsedBody(),
$data, "");

list($newConfigPlugin, $newAuthPlugin, $newCachePlugin) = $this->createBootstrapConf($data);

Expand All @@ -214,27 +219,26 @@ public function applyInstallerForm($action, $httpVars, $fileVars, ContextInterfa
$this->setAdditionalData($data);
$htContent = null;
$htAccessToUpdate = $this->updateHtAccess($data, $htContent);
$this->sendInstallResult($htAccessToUpdate, $htContent);
$this->sendInstallResult($htAccessToUpdate, $htContent, $responseInterface);

}

/**
* Send output to the user.
* @param String $htAccessToUpdate file path
* @param String $htContent file content
* @param ResponseInterface $responseInterface
*/
public function sendInstallResult($htAccessToUpdate, $htContent)
public function sendInstallResult($htAccessToUpdate, $htContent, ResponseInterface &$responseInterface)
{
ConfService::clearAllCaches();
ApplicationState::setApplicationFirstRunPassed();

if ($htAccessToUpdate != null) {
HTMLWriter::charsetHeader("application/json");
echo json_encode(array('file' => $htAccessToUpdate, 'content' => $htContent));
$responseInterface = new JsonResponse(['file' => $htAccessToUpdate, 'content' => $htContent]);
} else {
session_destroy();
HTMLWriter::charsetHeader("text/plain");
echo 'OK';
$responseInterface->getBody()->write("OK");
}

}
Expand Down

0 comments on commit bdf5bdc

Please sign in to comment.