Permalink
Browse files

Start removing AuthService::getLoggedUser() and ConfService::getRepos…

…itory() in favor of contexts.
  • Loading branch information...
1 parent c702baf commit c4ff2e6c6d22550005cc4deabc779505fe2db3c4 @cdujeu cdujeu committed Jun 4, 2016
Showing with 651 additions and 561 deletions.
  1. +24 −5 core/src/core/src/pydio/Core/Controller/Controller.php
  2. +1 −1 core/src/core/src/pydio/Core/Http/SimpleRestResourceRouter.php
  3. +3 −3 core/src/core/src/pydio/Core/Model/RepositoryInterface.php
  4. +7 −1 core/src/core/src/pydio/Core/Model/UserInterface.php
  5. +2 −3 core/src/core/src/pydio/Core/Services/ConfService.php
  6. +73 −49 core/src/plugins/access.ajxp_conf/class.ajxp_confAccessDriver.php
  7. +12 −79 core/src/plugins/access.ajxp_user/class.UserDashboardDriver.php
  8. +2 −2 core/src/plugins/access.dropbox/class.dropboxWrapper.php
  9. +12 −6 core/src/plugins/access.fs/class.fsAccessDriver.php
  10. +18 −58 core/src/plugins/access.ftp/class.ftpAccessDriver.php
  11. +4 −2 core/src/plugins/access.ftp/class.ftpAccessWrapper.php
  12. +4 −4 core/src/plugins/action.compression/class.PluginCompression.php
  13. +5 −3 core/src/plugins/action.disclaimer/class.DisclaimerProvider.php
  14. +7 −3 core/src/plugins/action.powerfs/class.PowerFSController.php
  15. +4 −4 core/src/plugins/action.scheduler/class.AjxpScheduler.php
  16. +25 −22 core/src/plugins/action.share/src/ShareCenter.php
  17. +4 −4 core/src/plugins/action.share/src/View/MinisiteRenderer.php
  18. +2 −2 core/src/plugins/action.timestamp/class.TimestampCreator.php
  19. +6 −6 core/src/plugins/action.updater/class.UpdateController.php
  20. +1 −22 core/src/plugins/auth.multi/class.multiAuthDriver.php
  21. +5 −0 core/src/plugins/auth.remote/glueCode.php
  22. +7 −3 core/src/plugins/core.access/src/AbstractAccessDriver.php
  23. +5 −9 core/src/plugins/core.access/src/Model/Repository.php
  24. +57 −17 core/src/plugins/core.access/src/Model/UserSelection.php
  25. +12 −4 core/src/plugins/core.auth/class.AbstractAuthDriver.php
  26. +13 −1 core/src/plugins/core.conf/class.AbstractAjxpUser.php
  27. +85 −86 core/src/plugins/core.conf/class.AbstractConfDriver.php
  28. +16 −14 core/src/plugins/core.index/class.CoreIndexer.php
  29. +13 −6 core/src/plugins/core.mq/class.MqManager.php
  30. +25 −13 core/src/plugins/core.notifications/class.AJXP_NotificationCenter.php
  31. +4 −1 core/src/plugins/core.notifications/interface.AJXP_FeedStore.php
  32. +6 −4 core/src/plugins/core.tasks/src/ITasksProvider.php
  33. +23 −8 core/src/plugins/core.tasks/src/TaskController.php
  34. +5 −5 core/src/plugins/core.tasks/src/TaskService.php
  35. +12 −11 core/src/plugins/cypher.encfs/class.EncfsMounter.php
  36. +11 −5 core/src/plugins/editor.audio/class.AudioPreviewer.php
  37. +2 −2 core/src/plugins/editor.browser/class.FileMimeSender.php
  38. +3 −4 core/src/plugins/editor.diaporama/class.ImagePreviewer.php
  39. +9 −6 core/src/plugins/editor.eml/class.EmlParser.php
  40. +5 −4 core/src/plugins/editor.etherpad/class.EtherpadClient.php
  41. +5 −6 core/src/plugins/editor.imagick/class.IMagickPreviewer.php
  42. +3 −3 core/src/plugins/editor.pixlr/class.PixlrEditor.php
  43. +2 −3 core/src/plugins/editor.video/class.VideoReader.php
  44. +5 −4 core/src/plugins/editor.zoho/class.ZohoEditor.php
  45. +7 −4 core/src/plugins/feed.sql/class.AJXP_SqlFeedStore.php
  46. +13 −4 core/src/plugins/gui.ajax/class.AJXP_ClientDriver.php
  47. +7 −3 core/src/plugins/index.elasticsearch/class.AjxpElasticSearch.php
  48. +6 −2 core/src/plugins/index.lucene/class.AjxpLuceneIndexer.php
  49. +12 −10 core/src/plugins/meta.comments/class.CommentsMetaManager.php
  50. +6 −3 core/src/plugins/meta.simple_lock/class.SimpleLockManager.php
  51. +9 −9 core/src/plugins/meta.syncable/class.ChangesTracker.php
  52. +20 −14 core/src/plugins/meta.user/class.UserMetaManager.php
  53. +5 −1 core/src/plugins/meta.watch/class.MetaWatchRegister.php
  54. +1 −0 core/src/plugins/mq.sql/class.AJXP_SqlMessageExchanger.php
  55. +8 −3 core/src/plugins/uploader.flex/class.FlexUploadProcessor.php
  56. +2 −3 core/src/plugins/uploader.html/class.SimpleUploadProcessor.php
  57. +1 −2 core/src/plugins/uploader.http/class.HttpDownloader.php
  58. +2 −2 core/src/plugins/uploader.jumploader/class.JumploaderProcessor.php
  59. +3 −3 core/src/plugins/uploader.plupload/class.PluploadProcessor.php
@@ -27,6 +27,7 @@
use Pydio\Core\Exception\PydioException;
use Pydio\Auth\Core\AJXP_Safe;
use Pydio\Core\Model\Context;
+use Pydio\Core\Model\ContextInterface;
use Pydio\Core\Services;
use Pydio\Core\Services\AuthService;
use Pydio\Core\Services\ConfService;
@@ -36,6 +37,7 @@
use Pydio\Tasks\Task;
use Pydio\Tasks\TaskService;
use Zend\Diactoros\Response;
+use Zend\Diactoros\ServerRequestFactory;
defined('AJXP_EXEC') or die( 'Access not allowed');
/**
@@ -247,11 +249,31 @@ public static function run(ServerRequestInterface $request, &$actionNode = null)
return $response;
}
+ /**
+ * @param Task $task
+ */
public static function applyTaskInBackground(Task $task){
+
$parameters = $task->getParameters();
$task->setStatus(Task::STATUS_RUNNING);
TaskService::getInstance()->updateTask($task);
self::applyActionInBackground($task->getWsId(), $task->getAction(), $parameters, $task->getUserId(), "", $task->getId());
+
+ }
+
+ /**
+ * @param ContextInterface $context
+ * @param string $action
+ * @param array $parameters
+ * @return ServerRequestInterface
+ */
+ public static function executableRequest(ContextInterface $context, $action, $parameters = []){
+ $request = ServerRequestFactory::fromGlobals();
+ $request = $request
+ ->withAttribute("ctx", $context)
+ ->withAttribute("action", $action)
+ ->withParsedBody($parameters);
+ return $request;
}
/**
@@ -345,10 +367,7 @@ public static function applyActionInBackground($currentRepositoryId, $actionName
}
}
- $repoObject = ConfService::getRepository();
- if(empty($repoObject)){
- $repoObject = ConfService::getRepositoryById($currentRepositoryId);
- }
+ $repoObject = ConfService::getRepositoryById($currentRepositoryId);
$clearEnv = false;
if($repoObject->getOption("USE_SESSION_CREDENTIALS")){
$encodedCreds = AJXP_Safe::getEncodedCredentialString();
@@ -506,7 +525,7 @@ private static function handleRequest($callback, ServerRequestInterface &$reques
}else{
$httpVars = $request->getParsedBody();
- $result = $plugInstance->$methodName($request->getAttribute("action"), $httpVars, $_FILES);
+ $result = $plugInstance->$methodName($request->getAttribute("action"), $httpVars, $_FILES, $request->getAttribute("ctx"));
// May have been modified
$request = $request->withParsedBody($httpVars);
@@ -185,7 +185,7 @@ protected function bodyHandler($callback, ServerRequestInterface &$request, Resp
*
* @param string|object $destination
* @param object $sourceObject
- * @return object
+ * @return mixed
*/
public static function cast($destination, $sourceObject)
{
@@ -70,17 +70,17 @@ public function getContentFilter();
* @param string $uniqueUser
* @return RepositoryInterface
*/
- public function createSharedChild($newLabel, $newOptions, $parentId = null, $owner = null, $uniqueUser = null);
+ public function createSharedChild($newLabel, $newOptions, $parentId, $owner, $uniqueUser = null);
/**
* Create a child from this repository if it's a template
* @param string $newLabel
* @param array $newOptions
- * @param string $owner
+ * @param string $creator
* @param string $uniqueUser
* @return RepositoryInterface
*/
- public function createTemplateChild($newLabel, $newOptions, $owner = null, $uniqueUser = null);
+ public function createTemplateChild($newLabel, $newOptions, $creator = null, $uniqueUser = null);
/**
* Recompute uuid
@@ -23,13 +23,14 @@
defined('AJXP_EXEC') or die('Access not allowed');
use Pydio\Conf\Core\AJXP_Role;
+use Pydio\Conf\Core\AjxpGroupPathProvider;
/**
* @class AbstractAjxpUser
* @abstract
* User abstraction, the "conf" driver must provides its own implementation
*/
-interface UserInterface
+interface UserInterface extends AjxpGroupPathProvider
{
/**
* @param bool $hidden
@@ -235,6 +236,11 @@ public function recomputeMergedRole();
public function getMergedRole();
/**
+ * @return AJXP_Role
+ */
+ public function getPersonalRole();
+
+ /**
* @param bool $resolveAsParent
*/
public function setResolveAsParent($resolveAsParent);
@@ -29,11 +29,10 @@
use Pydio\Conf\Core\AbstractAjxpUser;
use Pydio\Conf\Core\AbstractConfDriver;
use Pydio\Core\Controller\Controller;
-use Pydio\Core\Exception\NoActiveWorkspaceException;
use Pydio\Core\Exception\PydioException;
-use Pydio\Core\Exception\PydioUserAlertException;
use Pydio\Core\Model\Context;
use Pydio\Core\Model\RepositoryInterface;
+use Pydio\Core\Model\UserInterface;
use Pydio\Core\PluginFramework\CoreInstanceProvider;
use Pydio\Core\Utils\Utils;
use Pydio\Core\Utils\VarsFilter;
@@ -350,7 +349,7 @@ public static function reloadServicesAndActivePlugins(){
/**
- * @param AbstractAjxpUser $loggedUser
+ * @param UserInterface $loggedUser
* @param String|int $parameterId
* @return bool
*/
Oops, something went wrong.

0 comments on commit c4ff2e6

Please sign in to comment.