@@ -41,24 +41,24 @@ |
||
41 | 41 | interface IProviderService { |
42 | 42 | |
43 | 43 | |
44 | - /** |
|
45 | - * Check if the provider $providerId is already indexed. |
|
46 | - * |
|
47 | - * @since 15.0.0 |
|
48 | - * |
|
49 | - * @param string $providerId |
|
50 | - * |
|
51 | - * @return bool |
|
52 | - */ |
|
53 | - public function isProviderIndexed(string $providerId); |
|
44 | + /** |
|
45 | + * Check if the provider $providerId is already indexed. |
|
46 | + * |
|
47 | + * @since 15.0.0 |
|
48 | + * |
|
49 | + * @param string $providerId |
|
50 | + * |
|
51 | + * @return bool |
|
52 | + */ |
|
53 | + public function isProviderIndexed(string $providerId); |
|
54 | 54 | |
55 | 55 | |
56 | - /** |
|
57 | - * Add the Javascript API in the navigation page of an app. |
|
58 | - * |
|
59 | - * @since 15.0.0 |
|
60 | - */ |
|
61 | - public function addJavascriptAPI(); |
|
56 | + /** |
|
57 | + * Add the Javascript API in the navigation page of an app. |
|
58 | + * |
|
59 | + * @since 15.0.0 |
|
60 | + */ |
|
61 | + public function addJavascriptAPI(); |
|
62 | 62 | |
63 | 63 | |
64 | 64 | } |
@@ -46,41 +46,41 @@ |
||
46 | 46 | interface IIndexOptions { |
47 | 47 | |
48 | 48 | |
49 | - /** |
|
50 | - * Get the value (as a string) for an option. |
|
51 | - * |
|
52 | - * @since 15.0.0 |
|
53 | - * |
|
54 | - * @param string $option |
|
55 | - * @param string $default |
|
56 | - * |
|
57 | - * @return string |
|
58 | - */ |
|
59 | - public function getOption(string $option, string $default = ''): string; |
|
49 | + /** |
|
50 | + * Get the value (as a string) for an option. |
|
51 | + * |
|
52 | + * @since 15.0.0 |
|
53 | + * |
|
54 | + * @param string $option |
|
55 | + * @param string $default |
|
56 | + * |
|
57 | + * @return string |
|
58 | + */ |
|
59 | + public function getOption(string $option, string $default = ''): string; |
|
60 | 60 | |
61 | - /** |
|
62 | - * Get the value (as an array) for an option. |
|
63 | - * |
|
64 | - * @since 15.0.0 |
|
65 | - * |
|
66 | - * @param string $option |
|
67 | - * @param array $default |
|
68 | - * |
|
69 | - * @return array |
|
70 | - */ |
|
71 | - public function getOptionArray(string $option, array $default = []): array; |
|
61 | + /** |
|
62 | + * Get the value (as an array) for an option. |
|
63 | + * |
|
64 | + * @since 15.0.0 |
|
65 | + * |
|
66 | + * @param string $option |
|
67 | + * @param array $default |
|
68 | + * |
|
69 | + * @return array |
|
70 | + */ |
|
71 | + public function getOptionArray(string $option, array $default = []): array; |
|
72 | 72 | |
73 | - /** |
|
74 | - * Get the value (as an boolean) for an option. |
|
75 | - * |
|
76 | - * @since 15.0.0 |
|
77 | - * |
|
78 | - * @param string $option |
|
79 | - * @param bool $default |
|
80 | - * |
|
81 | - * @return bool |
|
82 | - */ |
|
83 | - public function getOptionBool(string $option, bool $default): bool; |
|
73 | + /** |
|
74 | + * Get the value (as an boolean) for an option. |
|
75 | + * |
|
76 | + * @since 15.0.0 |
|
77 | + * |
|
78 | + * @param string $option |
|
79 | + * @param bool $default |
|
80 | + * |
|
81 | + * @return bool |
|
82 | + */ |
|
83 | + public function getOptionBool(string $option, bool $default): bool; |
|
84 | 84 | |
85 | 85 | } |
86 | 86 |
@@ -26,16 +26,16 @@ |
||
26 | 26 | use OC\Authentication\Token\IToken; |
27 | 27 | |
28 | 28 | class ExpiredTokenException extends InvalidTokenException { |
29 | - /** @var IToken */ |
|
30 | - private $token; |
|
29 | + /** @var IToken */ |
|
30 | + private $token; |
|
31 | 31 | |
32 | - public function __construct(IToken $token) { |
|
33 | - parent::__construct(); |
|
32 | + public function __construct(IToken $token) { |
|
33 | + parent::__construct(); |
|
34 | 34 | |
35 | - $this->token = $token; |
|
36 | - } |
|
35 | + $this->token = $token; |
|
36 | + } |
|
37 | 37 | |
38 | - public function getToken(): IToken { |
|
39 | - return $this->token; |
|
40 | - } |
|
38 | + public function getToken(): IToken { |
|
39 | + return $this->token; |
|
40 | + } |
|
41 | 41 | } |
@@ -25,12 +25,12 @@ |
||
25 | 25 | * @since 15.0.0 |
26 | 26 | */ |
27 | 27 | interface IVersionManager extends IVersionBackend { |
28 | - /** |
|
29 | - * Register a new backend |
|
30 | - * |
|
31 | - * @param string $storageType |
|
32 | - * @param IVersionBackend $backend |
|
33 | - * @since 15.0.0 |
|
34 | - */ |
|
35 | - public function registerBackend(string $storageType, IVersionBackend $backend); |
|
28 | + /** |
|
29 | + * Register a new backend |
|
30 | + * |
|
31 | + * @param string $storageType |
|
32 | + * @param IVersionBackend $backend |
|
33 | + * @since 15.0.0 |
|
34 | + */ |
|
35 | + public function registerBackend(string $storageType, IVersionBackend $backend); |
|
36 | 36 | } |
@@ -31,23 +31,23 @@ |
||
31 | 31 | |
32 | 32 | class Version15000Date20181029084625 extends SimpleMigrationStep { |
33 | 33 | |
34 | - /** |
|
35 | - * @param IOutput $output |
|
36 | - * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` |
|
37 | - * @param array $options |
|
38 | - * @return null|ISchemaWrapper |
|
39 | - */ |
|
40 | - public function changeSchema(IOutput $output, Closure $schemaClosure, array $options) { |
|
41 | - /** @var ISchemaWrapper $schema */ |
|
42 | - $schema = $schemaClosure(); |
|
34 | + /** |
|
35 | + * @param IOutput $output |
|
36 | + * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` |
|
37 | + * @param array $options |
|
38 | + * @return null|ISchemaWrapper |
|
39 | + */ |
|
40 | + public function changeSchema(IOutput $output, Closure $schemaClosure, array $options) { |
|
41 | + /** @var ISchemaWrapper $schema */ |
|
42 | + $schema = $schemaClosure(); |
|
43 | 43 | |
44 | - $table = $schema->getTable('share'); |
|
45 | - $table->addColumn('label', 'string', [ |
|
46 | - 'notnull' => false, |
|
47 | - 'length' => 255, |
|
48 | - ]); |
|
44 | + $table = $schema->getTable('share'); |
|
45 | + $table->addColumn('label', 'string', [ |
|
46 | + 'notnull' => false, |
|
47 | + 'length' => 255, |
|
48 | + ]); |
|
49 | 49 | |
50 | - return $schema; |
|
51 | - } |
|
50 | + return $schema; |
|
51 | + } |
|
52 | 52 | |
53 | 53 | } |
@@ -32,60 +32,60 @@ |
||
32 | 32 | use OCP\User\Backend\IPasswordConfirmationBackend; |
33 | 33 | |
34 | 34 | class PasswordConfirmationMiddleware extends Middleware { |
35 | - /** @var ControllerMethodReflector */ |
|
36 | - private $reflector; |
|
37 | - /** @var ISession */ |
|
38 | - private $session; |
|
39 | - /** @var IUserSession */ |
|
40 | - private $userSession; |
|
41 | - /** @var ITimeFactory */ |
|
42 | - private $timeFactory; |
|
43 | - /** @var array */ |
|
44 | - private $excludedUserBackEnds = ['user_saml' => true, 'user_globalsiteselector' => true]; |
|
35 | + /** @var ControllerMethodReflector */ |
|
36 | + private $reflector; |
|
37 | + /** @var ISession */ |
|
38 | + private $session; |
|
39 | + /** @var IUserSession */ |
|
40 | + private $userSession; |
|
41 | + /** @var ITimeFactory */ |
|
42 | + private $timeFactory; |
|
43 | + /** @var array */ |
|
44 | + private $excludedUserBackEnds = ['user_saml' => true, 'user_globalsiteselector' => true]; |
|
45 | 45 | |
46 | - /** |
|
47 | - * PasswordConfirmationMiddleware constructor. |
|
48 | - * |
|
49 | - * @param ControllerMethodReflector $reflector |
|
50 | - * @param ISession $session |
|
51 | - * @param IUserSession $userSession |
|
52 | - * @param ITimeFactory $timeFactory |
|
53 | - */ |
|
54 | - public function __construct(ControllerMethodReflector $reflector, |
|
55 | - ISession $session, |
|
56 | - IUserSession $userSession, |
|
57 | - ITimeFactory $timeFactory) { |
|
58 | - $this->reflector = $reflector; |
|
59 | - $this->session = $session; |
|
60 | - $this->userSession = $userSession; |
|
61 | - $this->timeFactory = $timeFactory; |
|
62 | - } |
|
46 | + /** |
|
47 | + * PasswordConfirmationMiddleware constructor. |
|
48 | + * |
|
49 | + * @param ControllerMethodReflector $reflector |
|
50 | + * @param ISession $session |
|
51 | + * @param IUserSession $userSession |
|
52 | + * @param ITimeFactory $timeFactory |
|
53 | + */ |
|
54 | + public function __construct(ControllerMethodReflector $reflector, |
|
55 | + ISession $session, |
|
56 | + IUserSession $userSession, |
|
57 | + ITimeFactory $timeFactory) { |
|
58 | + $this->reflector = $reflector; |
|
59 | + $this->session = $session; |
|
60 | + $this->userSession = $userSession; |
|
61 | + $this->timeFactory = $timeFactory; |
|
62 | + } |
|
63 | 63 | |
64 | - /** |
|
65 | - * @param Controller $controller |
|
66 | - * @param string $methodName |
|
67 | - * @throws NotConfirmedException |
|
68 | - */ |
|
69 | - public function beforeController($controller, $methodName) { |
|
70 | - if ($this->reflector->hasAnnotation('PasswordConfirmationRequired')) { |
|
71 | - $user = $this->userSession->getUser(); |
|
72 | - $backendClassName = ''; |
|
73 | - if ($user !== null) { |
|
74 | - $backend = $user->getBackend(); |
|
75 | - if ($backend instanceof IPasswordConfirmationBackend) { |
|
76 | - if (!$backend->canConfirmPassword($user->getUID())) { |
|
77 | - return; |
|
78 | - } |
|
79 | - } |
|
64 | + /** |
|
65 | + * @param Controller $controller |
|
66 | + * @param string $methodName |
|
67 | + * @throws NotConfirmedException |
|
68 | + */ |
|
69 | + public function beforeController($controller, $methodName) { |
|
70 | + if ($this->reflector->hasAnnotation('PasswordConfirmationRequired')) { |
|
71 | + $user = $this->userSession->getUser(); |
|
72 | + $backendClassName = ''; |
|
73 | + if ($user !== null) { |
|
74 | + $backend = $user->getBackend(); |
|
75 | + if ($backend instanceof IPasswordConfirmationBackend) { |
|
76 | + if (!$backend->canConfirmPassword($user->getUID())) { |
|
77 | + return; |
|
78 | + } |
|
79 | + } |
|
80 | 80 | |
81 | - $backendClassName = $user->getBackendClassName(); |
|
82 | - } |
|
81 | + $backendClassName = $user->getBackendClassName(); |
|
82 | + } |
|
83 | 83 | |
84 | - $lastConfirm = (int) $this->session->get('last-password-confirm'); |
|
85 | - // we can't check the password against a SAML backend, so skip password confirmation in this case |
|
86 | - if (!isset($this->excludedUserBackEnds[$backendClassName]) && $lastConfirm < ($this->timeFactory->getTime() - (30 * 60 + 15))) { // allow 15 seconds delay |
|
87 | - throw new NotConfirmedException(); |
|
88 | - } |
|
89 | - } |
|
90 | - } |
|
84 | + $lastConfirm = (int) $this->session->get('last-password-confirm'); |
|
85 | + // we can't check the password against a SAML backend, so skip password confirmation in this case |
|
86 | + if (!isset($this->excludedUserBackEnds[$backendClassName]) && $lastConfirm < ($this->timeFactory->getTime() - (30 * 60 + 15))) { // allow 15 seconds delay |
|
87 | + throw new NotConfirmedException(); |
|
88 | + } |
|
89 | + } |
|
90 | + } |
|
91 | 91 | } |
@@ -29,8 +29,8 @@ |
||
29 | 29 | */ |
30 | 30 | interface IPasswordConfirmationBackend { |
31 | 31 | |
32 | - /** |
|
33 | - * @since 15.0.0 |
|
34 | - */ |
|
35 | - public function canConfirmPassword(string $uid): bool; |
|
32 | + /** |
|
33 | + * @since 15.0.0 |
|
34 | + */ |
|
35 | + public function canConfirmPassword(string $uid): bool; |
|
36 | 36 | } |
@@ -33,32 +33,32 @@ |
||
33 | 33 | */ |
34 | 34 | class CachedSubscriptionObject extends \Sabre\CalDAV\CalendarObject { |
35 | 35 | |
36 | - /** |
|
37 | - * @inheritdoc |
|
38 | - */ |
|
39 | - public function get() { |
|
40 | - // Pre-populating the 'calendardata' is optional, if we don't have it |
|
41 | - // already we fetch it from the backend. |
|
42 | - if (!isset($this->objectData['calendardata'])) { |
|
43 | - $this->objectData = $this->caldavBackend->getCalendarObject($this->calendarInfo['id'], $this->objectData['uri'], CalDavBackend::CALENDAR_TYPE_SUBSCRIPTION); |
|
44 | - } |
|
36 | + /** |
|
37 | + * @inheritdoc |
|
38 | + */ |
|
39 | + public function get() { |
|
40 | + // Pre-populating the 'calendardata' is optional, if we don't have it |
|
41 | + // already we fetch it from the backend. |
|
42 | + if (!isset($this->objectData['calendardata'])) { |
|
43 | + $this->objectData = $this->caldavBackend->getCalendarObject($this->calendarInfo['id'], $this->objectData['uri'], CalDavBackend::CALENDAR_TYPE_SUBSCRIPTION); |
|
44 | + } |
|
45 | 45 | |
46 | - return $this->objectData['calendardata']; |
|
47 | - } |
|
46 | + return $this->objectData['calendardata']; |
|
47 | + } |
|
48 | 48 | |
49 | - /** |
|
50 | - * @param resource|string $calendarData |
|
51 | - * @return string|void |
|
52 | - * @throws MethodNotAllowed |
|
53 | - */ |
|
54 | - public function put($calendarData) { |
|
55 | - throw new MethodNotAllowed('Creating objects in a cached subscription is not allowed'); |
|
56 | - } |
|
49 | + /** |
|
50 | + * @param resource|string $calendarData |
|
51 | + * @return string|void |
|
52 | + * @throws MethodNotAllowed |
|
53 | + */ |
|
54 | + public function put($calendarData) { |
|
55 | + throw new MethodNotAllowed('Creating objects in a cached subscription is not allowed'); |
|
56 | + } |
|
57 | 57 | |
58 | - /** |
|
59 | - * @throws MethodNotAllowed |
|
60 | - */ |
|
61 | - public function delete() { |
|
62 | - throw new MethodNotAllowed('Deleting objects in a cached subscription is not allowed'); |
|
63 | - } |
|
58 | + /** |
|
59 | + * @throws MethodNotAllowed |
|
60 | + */ |
|
61 | + public function delete() { |
|
62 | + throw new MethodNotAllowed('Deleting objects in a cached subscription is not allowed'); |
|
63 | + } |
|
64 | 64 | } |
@@ -32,18 +32,18 @@ |
||
32 | 32 | |
33 | 33 | class Version1008Date20181105112049 extends SimpleMigrationStep { |
34 | 34 | |
35 | - /** |
|
36 | - * @param IOutput $output |
|
37 | - * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` |
|
38 | - * @param array $options |
|
39 | - * @return null|ISchemaWrapper |
|
40 | - */ |
|
41 | - public function changeSchema(IOutput $output, Closure $schemaClosure, array $options) { |
|
42 | - /** @var ISchemaWrapper $schema */ |
|
43 | - $schema = $schemaClosure(); |
|
44 | - $table = $schema->getTable('calendarsubscriptions'); |
|
45 | - $table->dropColumn('source_copy'); |
|
35 | + /** |
|
36 | + * @param IOutput $output |
|
37 | + * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` |
|
38 | + * @param array $options |
|
39 | + * @return null|ISchemaWrapper |
|
40 | + */ |
|
41 | + public function changeSchema(IOutput $output, Closure $schemaClosure, array $options) { |
|
42 | + /** @var ISchemaWrapper $schema */ |
|
43 | + $schema = $schemaClosure(); |
|
44 | + $table = $schema->getTable('calendarsubscriptions'); |
|
45 | + $table->dropColumn('source_copy'); |
|
46 | 46 | |
47 | - return $schema; |
|
48 | - } |
|
47 | + return $schema; |
|
48 | + } |
|
49 | 49 | } |