@@ -28,41 +28,41 @@ |
||
28 | 28 | use OCP\Preview\IProvider; |
29 | 29 | |
30 | 30 | abstract class Provider implements IProvider { |
31 | - private $options; |
|
31 | + private $options; |
|
32 | 32 | |
33 | - /** |
|
34 | - * Constructor |
|
35 | - * |
|
36 | - * @param array $options |
|
37 | - */ |
|
38 | - public function __construct(array $options = []) { |
|
39 | - $this->options = $options; |
|
40 | - } |
|
33 | + /** |
|
34 | + * Constructor |
|
35 | + * |
|
36 | + * @param array $options |
|
37 | + */ |
|
38 | + public function __construct(array $options = []) { |
|
39 | + $this->options = $options; |
|
40 | + } |
|
41 | 41 | |
42 | - /** |
|
43 | - * @return string Regex with the mimetypes that are supported by this provider |
|
44 | - */ |
|
45 | - abstract public function getMimeType(); |
|
42 | + /** |
|
43 | + * @return string Regex with the mimetypes that are supported by this provider |
|
44 | + */ |
|
45 | + abstract public function getMimeType(); |
|
46 | 46 | |
47 | - /** |
|
48 | - * Check if a preview can be generated for $path |
|
49 | - * |
|
50 | - * @param \OCP\Files\FileInfo $file |
|
51 | - * @return bool |
|
52 | - */ |
|
53 | - public function isAvailable(\OCP\Files\FileInfo $file) { |
|
54 | - return true; |
|
55 | - } |
|
47 | + /** |
|
48 | + * Check if a preview can be generated for $path |
|
49 | + * |
|
50 | + * @param \OCP\Files\FileInfo $file |
|
51 | + * @return bool |
|
52 | + */ |
|
53 | + public function isAvailable(\OCP\Files\FileInfo $file) { |
|
54 | + return true; |
|
55 | + } |
|
56 | 56 | |
57 | - /** |
|
58 | - * Generates thumbnail which fits in $maxX and $maxY and keeps the aspect ratio, for file at path $path |
|
59 | - * |
|
60 | - * @param string $path Path of file |
|
61 | - * @param int $maxX The maximum X size of the thumbnail. It can be smaller depending on the shape of the image |
|
62 | - * @param int $maxY The maximum Y size of the thumbnail. It can be smaller depending on the shape of the image |
|
63 | - * @param bool $scalingup Disable/Enable upscaling of previews |
|
64 | - * @param \OC\Files\View $fileview fileview object of user folder |
|
65 | - * @return bool|\OCP\IImage false if no preview was generated |
|
66 | - */ |
|
67 | - abstract public function getThumbnail($path, $maxX, $maxY, $scalingup, $fileview); |
|
57 | + /** |
|
58 | + * Generates thumbnail which fits in $maxX and $maxY and keeps the aspect ratio, for file at path $path |
|
59 | + * |
|
60 | + * @param string $path Path of file |
|
61 | + * @param int $maxX The maximum X size of the thumbnail. It can be smaller depending on the shape of the image |
|
62 | + * @param int $maxY The maximum Y size of the thumbnail. It can be smaller depending on the shape of the image |
|
63 | + * @param bool $scalingup Disable/Enable upscaling of previews |
|
64 | + * @param \OC\Files\View $fileview fileview object of user folder |
|
65 | + * @return bool|\OCP\IImage false if no preview was generated |
|
66 | + */ |
|
67 | + abstract public function getThumbnail($path, $maxX, $maxY, $scalingup, $fileview); |
|
68 | 68 | } |
@@ -26,8 +26,8 @@ |
||
26 | 26 | $server = \OC::$server; |
27 | 27 | |
28 | 28 | $controller = new \OC\OCS\Provider( |
29 | - 'ocs_provider', |
|
30 | - $server->getRequest(), |
|
31 | - $server->getAppManager() |
|
29 | + 'ocs_provider', |
|
30 | + $server->getRequest(), |
|
31 | + $server->getAppManager() |
|
32 | 32 | ); |
33 | 33 | echo $controller->buildProviderList()->render(); |
@@ -21,7 +21,7 @@ |
||
21 | 21 | */ |
22 | 22 | // no php execution timeout for webdav |
23 | 23 | if (strpos(@ini_get('disable_functions'), 'set_time_limit') === false) { |
24 | - @set_time_limit(0); |
|
24 | + @set_time_limit(0); |
|
25 | 25 | } |
26 | 26 | ignore_user_abort(true); |
27 | 27 |
@@ -7,23 +7,23 @@ |
||
7 | 7 | |
8 | 8 | class RootCollection extends AbstractPrincipalCollection { |
9 | 9 | |
10 | - /** |
|
11 | - * This method returns a node for a principal. |
|
12 | - * |
|
13 | - * The passed array contains principal information, and is guaranteed to |
|
14 | - * at least contain a uri item. Other properties may or may not be |
|
15 | - * supplied by the authentication backend. |
|
16 | - * |
|
17 | - * @param array $principalInfo |
|
18 | - * @return AvatarHome |
|
19 | - */ |
|
20 | - public function getChildForPrincipal(array $principalInfo) { |
|
21 | - $avatarManager = \OC::$server->getAvatarManager(); |
|
22 | - return new AvatarHome($principalInfo, $avatarManager); |
|
23 | - } |
|
10 | + /** |
|
11 | + * This method returns a node for a principal. |
|
12 | + * |
|
13 | + * The passed array contains principal information, and is guaranteed to |
|
14 | + * at least contain a uri item. Other properties may or may not be |
|
15 | + * supplied by the authentication backend. |
|
16 | + * |
|
17 | + * @param array $principalInfo |
|
18 | + * @return AvatarHome |
|
19 | + */ |
|
20 | + public function getChildForPrincipal(array $principalInfo) { |
|
21 | + $avatarManager = \OC::$server->getAvatarManager(); |
|
22 | + return new AvatarHome($principalInfo, $avatarManager); |
|
23 | + } |
|
24 | 24 | |
25 | - public function getName() { |
|
26 | - return 'avatars'; |
|
27 | - } |
|
25 | + public function getName() { |
|
26 | + return 'avatars'; |
|
27 | + } |
|
28 | 28 | |
29 | 29 | } |
@@ -24,56 +24,56 @@ |
||
24 | 24 | use OCP\Lockdown\ILockdownManager; |
25 | 25 | |
26 | 26 | class LockdownManager implements ILockdownManager { |
27 | - /** @var ISession */ |
|
28 | - private $sessionCallback; |
|
27 | + /** @var ISession */ |
|
28 | + private $sessionCallback; |
|
29 | 29 | |
30 | - private $enabled = false; |
|
30 | + private $enabled = false; |
|
31 | 31 | |
32 | - /** @var array|null */ |
|
33 | - private $scope; |
|
32 | + /** @var array|null */ |
|
33 | + private $scope; |
|
34 | 34 | |
35 | - /** |
|
36 | - * LockdownManager constructor. |
|
37 | - * |
|
38 | - * @param callable $sessionCallback we need to inject the session lazily to avoid dependency loops |
|
39 | - */ |
|
40 | - public function __construct(callable $sessionCallback) { |
|
41 | - $this->sessionCallback = $sessionCallback; |
|
42 | - } |
|
35 | + /** |
|
36 | + * LockdownManager constructor. |
|
37 | + * |
|
38 | + * @param callable $sessionCallback we need to inject the session lazily to avoid dependency loops |
|
39 | + */ |
|
40 | + public function __construct(callable $sessionCallback) { |
|
41 | + $this->sessionCallback = $sessionCallback; |
|
42 | + } |
|
43 | 43 | |
44 | 44 | |
45 | - public function enable() { |
|
46 | - $this->enabled = true; |
|
47 | - } |
|
45 | + public function enable() { |
|
46 | + $this->enabled = true; |
|
47 | + } |
|
48 | 48 | |
49 | - /** |
|
50 | - * @return ISession |
|
51 | - */ |
|
52 | - private function getSession() { |
|
53 | - $callback = $this->sessionCallback; |
|
54 | - return $callback(); |
|
55 | - } |
|
49 | + /** |
|
50 | + * @return ISession |
|
51 | + */ |
|
52 | + private function getSession() { |
|
53 | + $callback = $this->sessionCallback; |
|
54 | + return $callback(); |
|
55 | + } |
|
56 | 56 | |
57 | - private function getScopeAsArray() { |
|
58 | - if (!$this->scope) { |
|
59 | - $session = $this->getSession(); |
|
60 | - $sessionScope = $session->get('token_scope'); |
|
61 | - if ($sessionScope) { |
|
62 | - $this->scope = $sessionScope; |
|
63 | - } |
|
64 | - } |
|
65 | - return $this->scope; |
|
66 | - } |
|
57 | + private function getScopeAsArray() { |
|
58 | + if (!$this->scope) { |
|
59 | + $session = $this->getSession(); |
|
60 | + $sessionScope = $session->get('token_scope'); |
|
61 | + if ($sessionScope) { |
|
62 | + $this->scope = $sessionScope; |
|
63 | + } |
|
64 | + } |
|
65 | + return $this->scope; |
|
66 | + } |
|
67 | 67 | |
68 | - public function setToken(IToken $token) { |
|
69 | - $this->scope = $token->getScopeAsArray(); |
|
70 | - $session = $this->getSession(); |
|
71 | - $session->set('token_scope', $this->scope); |
|
72 | - $this->enable(); |
|
73 | - } |
|
68 | + public function setToken(IToken $token) { |
|
69 | + $this->scope = $token->getScopeAsArray(); |
|
70 | + $session = $this->getSession(); |
|
71 | + $session->set('token_scope', $this->scope); |
|
72 | + $this->enable(); |
|
73 | + } |
|
74 | 74 | |
75 | - public function canAccessFilesystem() { |
|
76 | - $scope = $this->getScopeAsArray(); |
|
77 | - return !$scope || $scope['filesystem']; |
|
78 | - } |
|
75 | + public function canAccessFilesystem() { |
|
76 | + $scope = $this->getScopeAsArray(); |
|
77 | + return !$scope || $scope['filesystem']; |
|
78 | + } |
|
79 | 79 | } |
@@ -29,19 +29,19 @@ |
||
29 | 29 | */ |
30 | 30 | class FilesystemHelper { |
31 | 31 | |
32 | - /** |
|
33 | - * @brief states whether the filesystem was loaded |
|
34 | - * @return bool |
|
35 | - */ |
|
36 | - public function isLoaded() { |
|
37 | - return \OC\Files\Filesystem::$loaded; |
|
38 | - } |
|
32 | + /** |
|
33 | + * @brief states whether the filesystem was loaded |
|
34 | + * @return bool |
|
35 | + */ |
|
36 | + public function isLoaded() { |
|
37 | + return \OC\Files\Filesystem::$loaded; |
|
38 | + } |
|
39 | 39 | |
40 | - /** |
|
41 | - * @brief initializes the filesystem for the given user |
|
42 | - * @param string $uid the Nextcloud username of the user |
|
43 | - */ |
|
44 | - public function setup($uid) { |
|
45 | - \OC_Util::setupFS($uid); |
|
46 | - } |
|
40 | + /** |
|
41 | + * @brief initializes the filesystem for the given user |
|
42 | + * @param string $uid the Nextcloud username of the user |
|
43 | + */ |
|
44 | + public function setup($uid) { |
|
45 | + \OC_Util::setupFS($uid); |
|
46 | + } |
|
47 | 47 | } |
@@ -25,28 +25,28 @@ |
||
25 | 25 | use OCP\AppFramework\Http\JSONResponse; |
26 | 26 | |
27 | 27 | class RateLimitTestController extends Controller { |
28 | - /** |
|
29 | - * @PublicPage |
|
30 | - * @NoCSRFRequired |
|
31 | - * |
|
32 | - * @UserRateThrottle(limit=5, period=100) |
|
33 | - * @AnonRateThrottle(limit=1, period=100) |
|
34 | - * |
|
35 | - * @return JSONResponse |
|
36 | - */ |
|
37 | - public function userAndAnonProtected() { |
|
38 | - return new JSONResponse(); |
|
39 | - } |
|
28 | + /** |
|
29 | + * @PublicPage |
|
30 | + * @NoCSRFRequired |
|
31 | + * |
|
32 | + * @UserRateThrottle(limit=5, period=100) |
|
33 | + * @AnonRateThrottle(limit=1, period=100) |
|
34 | + * |
|
35 | + * @return JSONResponse |
|
36 | + */ |
|
37 | + public function userAndAnonProtected() { |
|
38 | + return new JSONResponse(); |
|
39 | + } |
|
40 | 40 | |
41 | - /** |
|
42 | - * @PublicPage |
|
43 | - * @NoCSRFRequired |
|
44 | - * |
|
45 | - * @AnonRateThrottle(limit=1, period=10) |
|
46 | - * |
|
47 | - * @return JSONResponse |
|
48 | - */ |
|
49 | - public function onlyAnonProtected() { |
|
50 | - return new JSONResponse(); |
|
51 | - } |
|
41 | + /** |
|
42 | + * @PublicPage |
|
43 | + * @NoCSRFRequired |
|
44 | + * |
|
45 | + * @AnonRateThrottle(limit=1, period=10) |
|
46 | + * |
|
47 | + * @return JSONResponse |
|
48 | + */ |
|
49 | + public function onlyAnonProtected() { |
|
50 | + return new JSONResponse(); |
|
51 | + } |
|
52 | 52 | } |
@@ -25,7 +25,7 @@ |
||
25 | 25 | use OCP\AppFramework\Http; |
26 | 26 | |
27 | 27 | class RateLimitExceededException extends SecurityException { |
28 | - public function __construct() { |
|
29 | - parent::__construct('Rate limit exceeded', Http::STATUS_TOO_MANY_REQUESTS); |
|
30 | - } |
|
28 | + public function __construct() { |
|
29 | + parent::__construct('Rate limit exceeded', Http::STATUS_TOO_MANY_REQUESTS); |
|
30 | + } |
|
31 | 31 | } |
@@ -35,55 +35,55 @@ |
||
35 | 35 | * @since 8.0.0 |
36 | 36 | */ |
37 | 37 | interface IEventLogger { |
38 | - /** |
|
39 | - * Mark the start of an event setting its ID $id and providing event description $description. |
|
40 | - * |
|
41 | - * @param string $id |
|
42 | - * @param string $description |
|
43 | - * @since 8.0.0 |
|
44 | - */ |
|
45 | - public function start($id, $description); |
|
38 | + /** |
|
39 | + * Mark the start of an event setting its ID $id and providing event description $description. |
|
40 | + * |
|
41 | + * @param string $id |
|
42 | + * @param string $description |
|
43 | + * @since 8.0.0 |
|
44 | + */ |
|
45 | + public function start($id, $description); |
|
46 | 46 | |
47 | - /** |
|
48 | - * Mark the end of an event with specific ID $id, marked by start() method. |
|
49 | - * Ending event should store \OCP\Diagnostics\IEvent to |
|
50 | - * be returned with getEvents() method. |
|
51 | - * |
|
52 | - * @param string $id |
|
53 | - * @since 8.0.0 |
|
54 | - */ |
|
55 | - public function end($id); |
|
47 | + /** |
|
48 | + * Mark the end of an event with specific ID $id, marked by start() method. |
|
49 | + * Ending event should store \OCP\Diagnostics\IEvent to |
|
50 | + * be returned with getEvents() method. |
|
51 | + * |
|
52 | + * @param string $id |
|
53 | + * @since 8.0.0 |
|
54 | + */ |
|
55 | + public function end($id); |
|
56 | 56 | |
57 | - /** |
|
58 | - * Mark the start and the end of an event with specific ID $id and description $description, |
|
59 | - * explicitly marking start and end of the event, represented by $start and $end timestamps. |
|
60 | - * Logging event should store \OCP\Diagnostics\IEvent to |
|
61 | - * be returned with getEvents() method. |
|
62 | - * |
|
63 | - * @param string $id |
|
64 | - * @param string $description |
|
65 | - * @param float $start |
|
66 | - * @param float $end |
|
67 | - * @since 8.0.0 |
|
68 | - */ |
|
69 | - public function log($id, $description, $start, $end); |
|
57 | + /** |
|
58 | + * Mark the start and the end of an event with specific ID $id and description $description, |
|
59 | + * explicitly marking start and end of the event, represented by $start and $end timestamps. |
|
60 | + * Logging event should store \OCP\Diagnostics\IEvent to |
|
61 | + * be returned with getEvents() method. |
|
62 | + * |
|
63 | + * @param string $id |
|
64 | + * @param string $description |
|
65 | + * @param float $start |
|
66 | + * @param float $end |
|
67 | + * @since 8.0.0 |
|
68 | + */ |
|
69 | + public function log($id, $description, $start, $end); |
|
70 | 70 | |
71 | - /** |
|
72 | - * This method should return all \OCP\Diagnostics\IEvent objects stored using |
|
73 | - * start()/end() or log() methods |
|
74 | - * |
|
75 | - * @return \OCP\Diagnostics\IEvent[] |
|
76 | - * @since 8.0.0 |
|
77 | - */ |
|
78 | - public function getEvents(); |
|
71 | + /** |
|
72 | + * This method should return all \OCP\Diagnostics\IEvent objects stored using |
|
73 | + * start()/end() or log() methods |
|
74 | + * |
|
75 | + * @return \OCP\Diagnostics\IEvent[] |
|
76 | + * @since 8.0.0 |
|
77 | + */ |
|
78 | + public function getEvents(); |
|
79 | 79 | |
80 | - /** |
|
81 | - * Activate the module for the duration of the request. Deactivated module |
|
82 | - * does not create and store \OCP\Diagnostics\IEvent objects. |
|
83 | - * Only activated module should create and store objects to be |
|
84 | - * returned with getEvents() call. |
|
85 | - * |
|
86 | - * @since 12.0.0 |
|
87 | - */ |
|
88 | - public function activate(); |
|
80 | + /** |
|
81 | + * Activate the module for the duration of the request. Deactivated module |
|
82 | + * does not create and store \OCP\Diagnostics\IEvent objects. |
|
83 | + * Only activated module should create and store objects to be |
|
84 | + * returned with getEvents() call. |
|
85 | + * |
|
86 | + * @since 12.0.0 |
|
87 | + */ |
|
88 | + public function activate(); |
|
89 | 89 | } |