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

Commit

Permalink
Fix some actions errors post-refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
cdujeu committed Jul 13, 2016
1 parent df96831 commit b81ba95
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 28 deletions.
6 changes: 3 additions & 3 deletions core/src/plugins/access.ajxp_conf/ajxp_confActions.xml
Expand Up @@ -539,17 +539,17 @@
</action>
<action name="list_all_plugins_actions">
<processing>
<serverCallback methodName="pluginsActions" restParams="/" developerComment="Returns a structured JSON object of all plugins and all their available actions"/>
<serverCallback methodName="pluginsAction" restParams="/" developerComment="Returns a structured JSON object of all plugins and all their available actions"/>
</processing>
</action>
<action name="list_all_plugins_parameters">
<processing>
<serverCallback methodName="pluginsActions" restParams="/" developerComment="Returns a structured JSON object of all plugins and all their available parameter"/>
<serverCallback methodName="pluginsAction" restParams="/" developerComment="Returns a structured JSON object of all plugins and all their available parameter"/>
</processing>
</action>
<action name="parameters_to_form_definitions">
<processing>
<serverCallback methodName="pluginsActions" restParams="/" developerComment="Takes in input a list of plugin parameters and builds the corresponding XML to create a standard form."/>
<serverCallback methodName="pluginsAction" restParams="/" developerComment="Takes in input a list of plugin parameters and builds the corresponding XML to create a standard form."/>
</processing>
</action>

Expand Down
2 changes: 1 addition & 1 deletion core/src/plugins/access.ajxp_conf/manifest.xml
Expand Up @@ -121,5 +121,5 @@
<external_file filename="plugins/access.ajxp_conf/ajxp_confActions.xml" include="actions/*"/>
<external_file filename="plugins/access.ajxp_conf/ajxp_confActions.xml" include="client_configs/*"/>
</registry_contributions>
<class_definition filename="plugins/access.ajxp_conf/ConfAccessDriver.php" classname="Pydio\Access\Driver\DataProvider\ConfAccessDriver"/>
<class_definition filename="plugins/access.ajxp_conf/src/ConfAccessDriver.php" classname="Pydio\Access\Driver\DataProvider\Provisioning\ConfAccessDriver"/>
</ajxpdriver>
Expand Up @@ -19,20 +19,14 @@
* The latest code can be found at <http://pyd.io/>.
*
*/
namespace Pydio\Access\Driver\DataProvider;
namespace Pydio\Access\Driver\DataProvider\Provisioning;

require_once(dirname(__FILE__)."/vendor/autoload.php");
require_once(dirname(__FILE__)."/../vendor/autoload.php");

use DOMXPath;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use Pydio\Access\Core\AbstractAccessDriver;
use Pydio\Access\Driver\DataProvider\Provisioning\DocumentationManager;
use Pydio\Access\Driver\DataProvider\Provisioning\PluginsManager;
use Pydio\Access\Driver\DataProvider\Provisioning\RepositoriesManager;
use Pydio\Access\Driver\DataProvider\Provisioning\RolesManager;
use Pydio\Access\Driver\DataProvider\Provisioning\TreeManager;
use Pydio\Access\Driver\DataProvider\Provisioning\UsersManager;
use Pydio\Core\Http\Response\SerializableResponseStream;
use Pydio\Core\Model\ContextInterface;
use Pydio\Core\Controller\Controller;
Expand Down Expand Up @@ -250,6 +244,7 @@ public function editAction(ServerRequestInterface $requestInterface, ResponseInt
case "user_set_lock":
case "change_admin_right":
case "user_add_role":
case "create_user":
case "user_delete_role":
case "user_reorder_roles":
case "user_bulk_update_roles":
Expand All @@ -258,6 +253,9 @@ public function editAction(ServerRequestInterface $requestInterface, ResponseInt
case "update_user_pwd":
$this->usersAction($requestInterface, $responseInterface);
break;
case "edit_repository":
case "create_repository":
case "edit_repository_label":
case "edit_repository_data":
case "get_drivers_definition":
case "get_templates_definition":
Expand All @@ -274,6 +272,7 @@ public function editAction(ServerRequestInterface $requestInterface, ResponseInt
*/
public function deleteAction(ServerRequestInterface $requestInterface, ResponseInterface &$responseInterface){

$httpVars = $requestInterface->getParsedBody();
// REST API mapping
if (isSet($httpVars["data_type"])) {
switch ($httpVars["data_type"]) {
Expand Down
5 changes: 3 additions & 2 deletions core/src/plugins/access.ajxp_conf/src/PluginsManager.php
Expand Up @@ -27,6 +27,7 @@
use Pydio\Core\Controller\XMLWriter;
use Pydio\Core\Http\Message\ReloadMessage;
use Pydio\Core\Http\Message\UserMessage;
use Pydio\Core\Http\Message\XMLDocMessage;
use Pydio\Core\Http\Message\XMLMessage;
use Pydio\Core\Http\Response\SerializableResponseStream;
use Pydio\Core\PluginFramework\Plugin;
Expand Down Expand Up @@ -305,8 +306,8 @@ public function pluginsActions(ServerRequestInterface $requestInterface, Respons
}
$buffer .= "</repoScope>";
}
$buffer = "</standard_form>";
$responseInterface = $responseInterface->withBody(new SerializableResponseStream(new XMLMessage($buffer)));
$buffer .= "</standard_form>";
$responseInterface = $responseInterface->withBody(new SerializableResponseStream(new XMLDocMessage($buffer)));
break;

default:
Expand Down
18 changes: 7 additions & 11 deletions core/src/plugins/access.ajxp_conf/src/RepositoriesManager.php
Expand Up @@ -29,7 +29,7 @@
use Pydio\Core\Exception\PydioException;
use Pydio\Core\Http\Message\ReloadMessage;
use Pydio\Core\Http\Message\UserMessage;
use Pydio\Core\Http\Message\XMLMessage;
use Pydio\Core\Http\Message\XMLDocMessage;
use Pydio\Core\Http\Response\SerializableResponseStream;
use Pydio\Core\Model\Context;
use Pydio\Core\Model\ContextInterface;
Expand Down Expand Up @@ -83,7 +83,7 @@ public function repositoriesActions(ServerRequestInterface $requestInterface, Re
$buffer = "<drivers allowed='".($this->currentUserIsGroupAdmin() ? "false" : "true")."'>";
$buffer .= XMLWriter::replaceAjxpXmlKeywords(self::availableDriversToXML("param", "", true));
$buffer .= "</drivers>";
$responseInterface = $responseInterface->withBody(new SerializableResponseStream(new XMLMessage($buffer)));
$responseInterface = $responseInterface->withBody(new SerializableResponseStream(new XMLDocMessage($buffer)));

break;

Expand All @@ -106,7 +106,7 @@ public function repositoriesActions(ServerRequestInterface $requestInterface, Re
$buffer .= "</template>";
}
$buffer .= "</repository_templates>";
$responseInterface = $responseInterface->withBody(new SerializableResponseStream(new XMLMessage($buffer)));
$responseInterface = $responseInterface->withBody(new SerializableResponseStream(new XMLDocMessage($buffer)));

break;

Expand Down Expand Up @@ -210,11 +210,7 @@ public function repositoriesActions(ServerRequestInterface $requestInterface, Re
$loggedUser->recomputeMergedRole();
$loggedUser->save("superuser");
AuthService::updateUser($loggedUser);

XMLWriter::sendMessage($mess["ajxp_conf.52"], null);
XMLWriter::reloadDataNode("", $newRep->getUniqueId());
XMLWriter::reloadRepositoryList();


$message = new UserMessage($mess["ajxp_conf.52"]);
$reload = new ReloadMessage("", $newRep->getUniqueId());
$responseInterface = $responseInterface->withBody(new SerializableResponseStream([$message, $reload]));
Expand Down Expand Up @@ -252,7 +248,7 @@ public function repositoriesActions(ServerRequestInterface $requestInterface, Re
}
$nested = array();
$definitions = $plug->getConfigsDefinitions();
$buffer = "<repository index=\"$repId\" securityScope=\"".$repository->securityScope()."\"";
$buffer .= "<repository index=\"$repId\" securityScope=\"".$repository->securityScope()."\"";
foreach ($repository as $name => $option) {
if(strstr($name, " ")>-1) continue;
if ($name == "driverInstance") continue;
Expand Down Expand Up @@ -348,7 +344,7 @@ public function repositoriesActions(ServerRequestInterface $requestInterface, Re
}
$buffer .= "</admin_data>";

$responseInterface = $responseInterface->withBody(new SerializableResponseStream(new XMLMessage($buffer)));
$responseInterface = $responseInterface->withBody(new SerializableResponseStream(new XMLDocMessage($buffer)));

break;

Expand Down Expand Up @@ -605,7 +601,7 @@ public function repositoriesActions(ServerRequestInterface $requestInterface, Re
}
$mess = LocaleService::getMessages();
$responseInterface = new JsonResponse(["LEGEND" => $mess["ajxp_conf.150"], "LIST" => $repoOut]);

break;

default:
Expand Down
6 changes: 3 additions & 3 deletions core/src/plugins/access.ajxp_conf/src/UsersManager.php
Expand Up @@ -30,6 +30,7 @@
use Pydio\Core\Exception\UserNotFoundException;
use Pydio\Core\Http\Message\ReloadMessage;
use Pydio\Core\Http\Message\UserMessage;
use Pydio\Core\Http\Message\XMLDocMessage;
use Pydio\Core\Http\Message\XMLMessage;
use Pydio\Core\Http\Response\SerializableResponseStream;
use Pydio\Core\Model\Context;
Expand Down Expand Up @@ -381,7 +382,7 @@ public function usersActions(ServerRequestInterface $requestInterface, ResponseI
$buffer .= "</ajxp_roles>";
$buffer .= "</admin_data>";

$responseInterface = $responseInterface->withBody(new SerializableResponseStream(new XMLMessage($buffer)));
$responseInterface = $responseInterface->withBody(new SerializableResponseStream(new XMLDocMessage($buffer)));
break;

case "save_custom_user_params" :
Expand Down Expand Up @@ -501,9 +502,8 @@ public function usersActions(ServerRequestInterface $requestInterface, ResponseI

break;

// Action for update all Pydio's user from ldap in CLI mode
case "cli_update_user_list":

// Action for updating all Pydio's user from ldap in CLI mode
if((php_sapi_name() == "cli")){
// TODO : UPGRADE THIS TO NEW CLI FORMAT
$progressBar = new ProgressBarCLI();
Expand Down

0 comments on commit b81ba95

Please sign in to comment.