diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2013-10-16 15:45:55 +0200 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2013-10-16 15:45:55 +0200 |
commit | fdeef5e874ae7a8e4a23a737e5a1e948804d768a (patch) | |
tree | 2cc093162b583210b8f878f5ab9d670c270cff2e /lib/public | |
parent | 60541358ac375652d74e4a5b5d8cad865833aa92 (diff) | |
parent | c3f7d22adc59949ad41c33d450b6d3e226cdefdb (diff) | |
download | nextcloud-server-fdeef5e874ae7a8e4a23a737e5a1e948804d768a.tar.gz nextcloud-server-fdeef5e874ae7a8e4a23a737e5a1e948804d768a.zip |
Merge branch 'master' into fixing-appframework-master
Conflicts:
lib/private/appframework/middleware/security/securitymiddleware.php
tests/lib/appframework/middleware/security/SecurityMiddlewareTest.php
Diffstat (limited to 'lib/public')
-rw-r--r-- | lib/public/appframework/app.php | 20 | ||||
-rw-r--r-- | lib/public/files/entitytoolargeexception.php | 11 | ||||
-rw-r--r-- | lib/public/files/invalidcontentexception.php | 11 | ||||
-rw-r--r-- | lib/public/files/invalidpathexception.php | 11 | ||||
-rw-r--r-- | lib/public/share.php | 8 |
5 files changed, 48 insertions, 13 deletions
diff --git a/lib/public/appframework/app.php b/lib/public/appframework/app.php index d97c5c81848..6ac48bf102a 100644 --- a/lib/public/appframework/app.php +++ b/lib/public/appframework/app.php @@ -31,8 +31,11 @@ namespace OCP\AppFramework; * to be registered using IContainer::registerService */ class App { - public function __construct($appName) { - $this->container = new \OC\AppFramework\DependencyInjection\DIContainer($appName); + /** + * @param array $urlParams an array with variables extracted from the routes + */ + public function __construct($appName, $urlParams = array()) { + $this->container = new \OC\AppFramework\DependencyInjection\DIContainer($appName, $urlParams); } private $container; @@ -50,8 +53,8 @@ class App { * Example code in routes.php of the task app: * $this->create('tasks_index', '/')->get()->action( * function($params){ - * $app = new TaskApp(); - * $app->dispatch('PageController', 'index', $params); + * $app = new TaskApp($params); + * $app->dispatch('PageController', 'index'); * } * ); * @@ -59,8 +62,8 @@ class App { * Example for for TaskApp implementation: * class TaskApp extends \OCP\AppFramework\App { * - * public function __construct(){ - * parent::__construct('tasks'); + * public function __construct($params){ + * parent::__construct('tasks', $params); * * $this->getContainer()->registerService('PageController', function(IAppContainer $c){ * $a = $c->query('API'); @@ -73,9 +76,8 @@ class App { * @param string $controllerName the name of the controller under which it is * stored in the DI container * @param string $methodName the method that you want to call - * @param array $urlParams an array with variables extracted from the routes */ - public function dispatch($controllerName, $methodName, array $urlParams) { - \OC\AppFramework\App::main($controllerName, $methodName, $urlParams, $this->container); + public function dispatch($controllerName, $methodName) { + \OC\AppFramework\App::main($controllerName, $methodName, $this->container); } } diff --git a/lib/public/files/entitytoolargeexception.php b/lib/public/files/entitytoolargeexception.php new file mode 100644 index 00000000000..3dff41bca02 --- /dev/null +++ b/lib/public/files/entitytoolargeexception.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright (c) 2013 Thomas Müller <thomas.mueller@owncloud.com> + * This file is licensed under the Affero General Public License version 3 or + * later. + * See the COPYING-README file. + */ + +namespace OCP\Files; + +class EntityTooLargeException extends \Exception {} diff --git a/lib/public/files/invalidcontentexception.php b/lib/public/files/invalidcontentexception.php new file mode 100644 index 00000000000..184ec4d06d6 --- /dev/null +++ b/lib/public/files/invalidcontentexception.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright (c) 2013 Thomas Müller <thomas.mueller@owncloud.com> + * This file is licensed under the Affero General Public License version 3 or + * later. + * See the COPYING-README file. + */ + +namespace OCP\Files; + +class InvalidContentException extends \Exception {} diff --git a/lib/public/files/invalidpathexception.php b/lib/public/files/invalidpathexception.php new file mode 100644 index 00000000000..36090ae5b48 --- /dev/null +++ b/lib/public/files/invalidpathexception.php @@ -0,0 +1,11 @@ +<?php +/** + * Copyright (c) 2013 Thomas Müller <thomas.mueller@owncloud.com> + * This file is licensed under the Affero General Public License version 3 or + * later. + * See the COPYING-README file. + */ + +namespace OCP\Files; + +class InvalidPathException extends \Exception {} diff --git a/lib/public/share.php b/lib/public/share.php index e6a74117aa2..66605dafee5 100644 --- a/lib/public/share.php +++ b/lib/public/share.php @@ -155,13 +155,13 @@ class Share { while ($source !== -1) { - // Fetch all shares of this file path from DB + // Fetch all shares with another user $query = \OC_DB::prepare( 'SELECT `share_with` FROM `*PREFIX*share` WHERE - `item_source` = ? AND `share_type` = ?' + `item_source` = ? AND `share_type` = ? AND `item_type` IN (\'file\', \'folder\')' ); $result = $query->execute(array($source, self::SHARE_TYPE_USER)); @@ -180,7 +180,7 @@ class Share { FROM `*PREFIX*share` WHERE - `item_source` = ? AND `share_type` = ?' + `item_source` = ? AND `share_type` = ? AND `item_type` IN (\'file\', \'folder\')' ); $result = $query->execute(array($source, self::SHARE_TYPE_GROUP)); @@ -201,7 +201,7 @@ class Share { FROM `*PREFIX*share` WHERE - `item_source` = ? AND `share_type` = ?' + `item_source` = ? AND `share_type` = ? AND `item_type` IN (\'file\', \'folder\')' ); $result = $query->execute(array($source, self::SHARE_TYPE_LINK)); |