Permalink
Browse files

Fix some actions errors post-refactoring

  • Loading branch information...
1 parent df96831 commit b81ba95a1ea1579cc72f53e3cd81e5e279e68ffe @cdujeu cdujeu committed Jul 13, 2016
@@ -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>
@@ -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>
@@ -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;
@@ -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":
@@ -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":
@@ -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"]) {
@@ -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;
@@ -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:
@@ -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;
@@ -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;
@@ -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;
@@ -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]));
@@ -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;
@@ -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;
@@ -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:
@@ -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;
@@ -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" :
@@ -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();

0 comments on commit b81ba95

Please sign in to comment.