@@ -31,90 +31,90 @@ |
||
31 | 31 | |
32 | 32 | class BuildCalendarSearchIndexBackgroundJob extends QueuedJob { |
33 | 33 | |
34 | - /** @var IDBConnection */ |
|
35 | - private $db; |
|
36 | - |
|
37 | - /** @var CalDavBackend */ |
|
38 | - private $calDavBackend; |
|
39 | - |
|
40 | - /** @var ILogger */ |
|
41 | - private $logger; |
|
42 | - |
|
43 | - /** @var IJobList */ |
|
44 | - private $jobList; |
|
45 | - |
|
46 | - /** @var ITimeFactory */ |
|
47 | - private $timeFactory; |
|
48 | - |
|
49 | - /** |
|
50 | - * @param IDBConnection $db |
|
51 | - * @param CalDavBackend $calDavBackend |
|
52 | - * @param ILogger $logger |
|
53 | - * @param IJobList $jobList |
|
54 | - * @param ITimeFactory $timeFactory |
|
55 | - */ |
|
56 | - public function __construct(IDBConnection $db, |
|
57 | - CalDavBackend $calDavBackend, |
|
58 | - ILogger $logger, |
|
59 | - IJobList $jobList, |
|
60 | - ITimeFactory $timeFactory) { |
|
61 | - $this->db = $db; |
|
62 | - $this->calDavBackend = $calDavBackend; |
|
63 | - $this->logger = $logger; |
|
64 | - $this->jobList = $jobList; |
|
65 | - $this->timeFactory = $timeFactory; |
|
66 | - } |
|
67 | - |
|
68 | - public function run($arguments) { |
|
69 | - $offset = $arguments['offset']; |
|
70 | - $stopAt = $arguments['stopAt']; |
|
71 | - |
|
72 | - $this->logger->info('Building calendar index (' . $offset .'/' . $stopAt . ')'); |
|
73 | - |
|
74 | - $offset = $this->buildIndex($offset, $stopAt); |
|
75 | - |
|
76 | - if ($offset >= $stopAt) { |
|
77 | - $this->logger->info('Building calendar index done'); |
|
78 | - } else { |
|
79 | - $this->jobList->add(self::class, [ |
|
80 | - 'offset' => $offset, |
|
81 | - 'stopAt' => $stopAt |
|
82 | - ]); |
|
83 | - $this->logger->info('New building calendar index job scheduled with offset ' . $offset); |
|
84 | - } |
|
85 | - } |
|
86 | - |
|
87 | - /** |
|
88 | - * @param int $offset |
|
89 | - * @param int $stopAt |
|
90 | - * @return int |
|
91 | - */ |
|
92 | - private function buildIndex($offset, $stopAt) { |
|
93 | - $startTime = $this->timeFactory->getTime(); |
|
94 | - |
|
95 | - $query = $this->db->getQueryBuilder(); |
|
96 | - $query->select(['id', 'calendarid', 'uri', 'calendardata']) |
|
97 | - ->from('calendarobjects') |
|
98 | - ->where($query->expr()->lte('id', $query->createNamedParameter($stopAt))) |
|
99 | - ->andWhere($query->expr()->gt('id', $query->createNamedParameter($offset))) |
|
100 | - ->orderBy('id', 'ASC'); |
|
101 | - |
|
102 | - $stmt = $query->execute(); |
|
103 | - while($row = $stmt->fetch(\PDO::FETCH_ASSOC)) { |
|
104 | - $offset = $row['id']; |
|
105 | - |
|
106 | - $calendarData = $row['calendardata']; |
|
107 | - if (is_resource($calendarData)) { |
|
108 | - $calendarData = stream_get_contents($calendarData); |
|
109 | - } |
|
110 | - |
|
111 | - $this->calDavBackend->updateProperties($row['calendarid'], $row['uri'], $calendarData); |
|
112 | - |
|
113 | - if (($this->timeFactory->getTime() - $startTime) > 15) { |
|
114 | - return $offset; |
|
115 | - } |
|
116 | - } |
|
117 | - |
|
118 | - return $stopAt; |
|
119 | - } |
|
34 | + /** @var IDBConnection */ |
|
35 | + private $db; |
|
36 | + |
|
37 | + /** @var CalDavBackend */ |
|
38 | + private $calDavBackend; |
|
39 | + |
|
40 | + /** @var ILogger */ |
|
41 | + private $logger; |
|
42 | + |
|
43 | + /** @var IJobList */ |
|
44 | + private $jobList; |
|
45 | + |
|
46 | + /** @var ITimeFactory */ |
|
47 | + private $timeFactory; |
|
48 | + |
|
49 | + /** |
|
50 | + * @param IDBConnection $db |
|
51 | + * @param CalDavBackend $calDavBackend |
|
52 | + * @param ILogger $logger |
|
53 | + * @param IJobList $jobList |
|
54 | + * @param ITimeFactory $timeFactory |
|
55 | + */ |
|
56 | + public function __construct(IDBConnection $db, |
|
57 | + CalDavBackend $calDavBackend, |
|
58 | + ILogger $logger, |
|
59 | + IJobList $jobList, |
|
60 | + ITimeFactory $timeFactory) { |
|
61 | + $this->db = $db; |
|
62 | + $this->calDavBackend = $calDavBackend; |
|
63 | + $this->logger = $logger; |
|
64 | + $this->jobList = $jobList; |
|
65 | + $this->timeFactory = $timeFactory; |
|
66 | + } |
|
67 | + |
|
68 | + public function run($arguments) { |
|
69 | + $offset = $arguments['offset']; |
|
70 | + $stopAt = $arguments['stopAt']; |
|
71 | + |
|
72 | + $this->logger->info('Building calendar index (' . $offset .'/' . $stopAt . ')'); |
|
73 | + |
|
74 | + $offset = $this->buildIndex($offset, $stopAt); |
|
75 | + |
|
76 | + if ($offset >= $stopAt) { |
|
77 | + $this->logger->info('Building calendar index done'); |
|
78 | + } else { |
|
79 | + $this->jobList->add(self::class, [ |
|
80 | + 'offset' => $offset, |
|
81 | + 'stopAt' => $stopAt |
|
82 | + ]); |
|
83 | + $this->logger->info('New building calendar index job scheduled with offset ' . $offset); |
|
84 | + } |
|
85 | + } |
|
86 | + |
|
87 | + /** |
|
88 | + * @param int $offset |
|
89 | + * @param int $stopAt |
|
90 | + * @return int |
|
91 | + */ |
|
92 | + private function buildIndex($offset, $stopAt) { |
|
93 | + $startTime = $this->timeFactory->getTime(); |
|
94 | + |
|
95 | + $query = $this->db->getQueryBuilder(); |
|
96 | + $query->select(['id', 'calendarid', 'uri', 'calendardata']) |
|
97 | + ->from('calendarobjects') |
|
98 | + ->where($query->expr()->lte('id', $query->createNamedParameter($stopAt))) |
|
99 | + ->andWhere($query->expr()->gt('id', $query->createNamedParameter($offset))) |
|
100 | + ->orderBy('id', 'ASC'); |
|
101 | + |
|
102 | + $stmt = $query->execute(); |
|
103 | + while($row = $stmt->fetch(\PDO::FETCH_ASSOC)) { |
|
104 | + $offset = $row['id']; |
|
105 | + |
|
106 | + $calendarData = $row['calendardata']; |
|
107 | + if (is_resource($calendarData)) { |
|
108 | + $calendarData = stream_get_contents($calendarData); |
|
109 | + } |
|
110 | + |
|
111 | + $this->calDavBackend->updateProperties($row['calendarid'], $row['uri'], $calendarData); |
|
112 | + |
|
113 | + if (($this->timeFactory->getTime() - $startTime) > 15) { |
|
114 | + return $offset; |
|
115 | + } |
|
116 | + } |
|
117 | + |
|
118 | + return $stopAt; |
|
119 | + } |
|
120 | 120 | } |
@@ -32,85 +32,85 @@ |
||
32 | 32 | |
33 | 33 | class ImageExportPlugin extends ServerPlugin { |
34 | 34 | |
35 | - /** @var Server */ |
|
36 | - protected $server; |
|
37 | - /** @var PhotoCache */ |
|
38 | - private $cache; |
|
39 | - |
|
40 | - /** |
|
41 | - * ImageExportPlugin constructor. |
|
42 | - * |
|
43 | - * @param PhotoCache $cache |
|
44 | - */ |
|
45 | - public function __construct(PhotoCache $cache) { |
|
46 | - $this->cache = $cache; |
|
47 | - } |
|
48 | - |
|
49 | - /** |
|
50 | - * Initializes the plugin and registers event handlers |
|
51 | - * |
|
52 | - * @param Server $server |
|
53 | - * @return void |
|
54 | - */ |
|
55 | - public function initialize(Server $server) { |
|
56 | - $this->server = $server; |
|
57 | - $this->server->on('method:GET', [$this, 'httpGet'], 90); |
|
58 | - } |
|
59 | - |
|
60 | - /** |
|
61 | - * Intercepts GET requests on addressbook urls ending with ?photo. |
|
62 | - * |
|
63 | - * @param RequestInterface $request |
|
64 | - * @param ResponseInterface $response |
|
65 | - * @return bool |
|
66 | - */ |
|
67 | - public function httpGet(RequestInterface $request, ResponseInterface $response) { |
|
68 | - |
|
69 | - $queryParams = $request->getQueryParameters(); |
|
70 | - // TODO: in addition to photo we should also add logo some point in time |
|
71 | - if (!array_key_exists('photo', $queryParams)) { |
|
72 | - return true; |
|
73 | - } |
|
74 | - |
|
75 | - $size = isset($queryParams['size']) ? (int)$queryParams['size'] : -1; |
|
76 | - |
|
77 | - $path = $request->getPath(); |
|
78 | - $node = $this->server->tree->getNodeForPath($path); |
|
79 | - |
|
80 | - if (!($node instanceof Card)) { |
|
81 | - return true; |
|
82 | - } |
|
83 | - |
|
84 | - $this->server->transactionType = 'carddav-image-export'; |
|
85 | - |
|
86 | - // Checking ACL, if available. |
|
87 | - if ($aclPlugin = $this->server->getPlugin('acl')) { |
|
88 | - /** @var \Sabre\DAVACL\Plugin $aclPlugin */ |
|
89 | - $aclPlugin->checkPrivileges($path, '{DAV:}read'); |
|
90 | - } |
|
91 | - |
|
92 | - // Fetch addressbook |
|
93 | - $addressbookpath = explode('/', $path); |
|
94 | - array_pop($addressbookpath); |
|
95 | - $addressbookpath = implode('/', $addressbookpath); |
|
96 | - /** @var AddressBook $addressbook */ |
|
97 | - $addressbook = $this->server->tree->getNodeForPath($addressbookpath); |
|
98 | - |
|
99 | - $response->setHeader('Cache-Control', 'private, max-age=3600, must-revalidate'); |
|
100 | - $response->setHeader('Etag', $node->getETag() ); |
|
101 | - $response->setHeader('Pragma', 'public'); |
|
102 | - |
|
103 | - try { |
|
104 | - $file = $this->cache->get($addressbook->getResourceId(), $node->getName(), $size, $node); |
|
105 | - $response->setHeader('Content-Type', $file->getMimeType()); |
|
106 | - $response->setHeader('Content-Disposition', 'attachment'); |
|
107 | - $response->setStatus(200); |
|
108 | - |
|
109 | - $response->setBody($file->getContent()); |
|
110 | - } catch (NotFoundException $e) { |
|
111 | - $response->setStatus(404); |
|
112 | - } |
|
113 | - |
|
114 | - return false; |
|
115 | - } |
|
35 | + /** @var Server */ |
|
36 | + protected $server; |
|
37 | + /** @var PhotoCache */ |
|
38 | + private $cache; |
|
39 | + |
|
40 | + /** |
|
41 | + * ImageExportPlugin constructor. |
|
42 | + * |
|
43 | + * @param PhotoCache $cache |
|
44 | + */ |
|
45 | + public function __construct(PhotoCache $cache) { |
|
46 | + $this->cache = $cache; |
|
47 | + } |
|
48 | + |
|
49 | + /** |
|
50 | + * Initializes the plugin and registers event handlers |
|
51 | + * |
|
52 | + * @param Server $server |
|
53 | + * @return void |
|
54 | + */ |
|
55 | + public function initialize(Server $server) { |
|
56 | + $this->server = $server; |
|
57 | + $this->server->on('method:GET', [$this, 'httpGet'], 90); |
|
58 | + } |
|
59 | + |
|
60 | + /** |
|
61 | + * Intercepts GET requests on addressbook urls ending with ?photo. |
|
62 | + * |
|
63 | + * @param RequestInterface $request |
|
64 | + * @param ResponseInterface $response |
|
65 | + * @return bool |
|
66 | + */ |
|
67 | + public function httpGet(RequestInterface $request, ResponseInterface $response) { |
|
68 | + |
|
69 | + $queryParams = $request->getQueryParameters(); |
|
70 | + // TODO: in addition to photo we should also add logo some point in time |
|
71 | + if (!array_key_exists('photo', $queryParams)) { |
|
72 | + return true; |
|
73 | + } |
|
74 | + |
|
75 | + $size = isset($queryParams['size']) ? (int)$queryParams['size'] : -1; |
|
76 | + |
|
77 | + $path = $request->getPath(); |
|
78 | + $node = $this->server->tree->getNodeForPath($path); |
|
79 | + |
|
80 | + if (!($node instanceof Card)) { |
|
81 | + return true; |
|
82 | + } |
|
83 | + |
|
84 | + $this->server->transactionType = 'carddav-image-export'; |
|
85 | + |
|
86 | + // Checking ACL, if available. |
|
87 | + if ($aclPlugin = $this->server->getPlugin('acl')) { |
|
88 | + /** @var \Sabre\DAVACL\Plugin $aclPlugin */ |
|
89 | + $aclPlugin->checkPrivileges($path, '{DAV:}read'); |
|
90 | + } |
|
91 | + |
|
92 | + // Fetch addressbook |
|
93 | + $addressbookpath = explode('/', $path); |
|
94 | + array_pop($addressbookpath); |
|
95 | + $addressbookpath = implode('/', $addressbookpath); |
|
96 | + /** @var AddressBook $addressbook */ |
|
97 | + $addressbook = $this->server->tree->getNodeForPath($addressbookpath); |
|
98 | + |
|
99 | + $response->setHeader('Cache-Control', 'private, max-age=3600, must-revalidate'); |
|
100 | + $response->setHeader('Etag', $node->getETag() ); |
|
101 | + $response->setHeader('Pragma', 'public'); |
|
102 | + |
|
103 | + try { |
|
104 | + $file = $this->cache->get($addressbook->getResourceId(), $node->getName(), $size, $node); |
|
105 | + $response->setHeader('Content-Type', $file->getMimeType()); |
|
106 | + $response->setHeader('Content-Disposition', 'attachment'); |
|
107 | + $response->setStatus(200); |
|
108 | + |
|
109 | + $response->setBody($file->getContent()); |
|
110 | + } catch (NotFoundException $e) { |
|
111 | + $response->setStatus(404); |
|
112 | + } |
|
113 | + |
|
114 | + return false; |
|
115 | + } |
|
116 | 116 | } |
@@ -41,7 +41,7 @@ |
||
41 | 41 | <?php p($theme->getName()); ?> |
42 | 42 | </h1> |
43 | 43 | <?php if(\OC::$server->getConfig()->getSystemValue('installed', false) |
44 | - && \OC::$server->getConfig()->getAppValue('theming', 'logoMime', false)): ?> |
|
44 | + && \OC::$server->getConfig()->getAppValue('theming', 'logoMime', false)): ?> |
|
45 | 45 | <img src="<?php p($theme->getLogo()); ?>"/> |
46 | 46 | <?php endif; ?> |
47 | 47 | </div> |
@@ -25,36 +25,36 @@ |
||
25 | 25 | |
26 | 26 | class LanguageParseChecker { |
27 | 27 | |
28 | - /** |
|
29 | - * @param string $appId |
|
30 | - * @return array |
|
31 | - */ |
|
32 | - public function analyse($appId) { |
|
33 | - $appPath = \OC_App::getAppPath($appId); |
|
34 | - if ($appPath === false) { |
|
35 | - throw new \RuntimeException("No app with given id <$appId> known."); |
|
36 | - } |
|
37 | - |
|
38 | - if (!is_dir($appPath . '/l10n/')) { |
|
39 | - return []; |
|
40 | - } |
|
41 | - |
|
42 | - $errors = []; |
|
43 | - $directory = new \DirectoryIterator($appPath . '/l10n/'); |
|
44 | - |
|
45 | - foreach ($directory as $file) { |
|
46 | - if ($file->getExtension() !== 'json') { |
|
47 | - continue; |
|
48 | - } |
|
49 | - |
|
50 | - $content = file_get_contents($file->getPathname()); |
|
51 | - json_decode($content, true); |
|
52 | - |
|
53 | - if (json_last_error() !== JSON_ERROR_NONE) { |
|
54 | - $errors[] = 'Invalid language file found: l10n/' . $file->getFilename() . ': ' . json_last_error_msg(); |
|
55 | - } |
|
56 | - } |
|
57 | - |
|
58 | - return $errors; |
|
59 | - } |
|
28 | + /** |
|
29 | + * @param string $appId |
|
30 | + * @return array |
|
31 | + */ |
|
32 | + public function analyse($appId) { |
|
33 | + $appPath = \OC_App::getAppPath($appId); |
|
34 | + if ($appPath === false) { |
|
35 | + throw new \RuntimeException("No app with given id <$appId> known."); |
|
36 | + } |
|
37 | + |
|
38 | + if (!is_dir($appPath . '/l10n/')) { |
|
39 | + return []; |
|
40 | + } |
|
41 | + |
|
42 | + $errors = []; |
|
43 | + $directory = new \DirectoryIterator($appPath . '/l10n/'); |
|
44 | + |
|
45 | + foreach ($directory as $file) { |
|
46 | + if ($file->getExtension() !== 'json') { |
|
47 | + continue; |
|
48 | + } |
|
49 | + |
|
50 | + $content = file_get_contents($file->getPathname()); |
|
51 | + json_decode($content, true); |
|
52 | + |
|
53 | + if (json_last_error() !== JSON_ERROR_NONE) { |
|
54 | + $errors[] = 'Invalid language file found: l10n/' . $file->getFilename() . ': ' . json_last_error_msg(); |
|
55 | + } |
|
56 | + } |
|
57 | + |
|
58 | + return $errors; |
|
59 | + } |
|
60 | 60 | } |
@@ -36,62 +36,62 @@ |
||
36 | 36 | */ |
37 | 37 | class SetPasswordColumn implements IRepairStep { |
38 | 38 | |
39 | - /** @var IDBConnection */ |
|
40 | - private $connection; |
|
41 | - |
|
42 | - /** @var IConfig */ |
|
43 | - private $config; |
|
44 | - |
|
45 | - |
|
46 | - public function __construct(IDBConnection $connection, IConfig $config) { |
|
47 | - $this->connection = $connection; |
|
48 | - $this->config = $config; |
|
49 | - } |
|
50 | - |
|
51 | - /** |
|
52 | - * Returns the step's name |
|
53 | - * |
|
54 | - * @return string |
|
55 | - * @since 9.1.0 |
|
56 | - */ |
|
57 | - public function getName() { |
|
58 | - return 'Copy the share password into the dedicated column'; |
|
59 | - } |
|
60 | - |
|
61 | - /** |
|
62 | - * @param IOutput $output |
|
63 | - */ |
|
64 | - public function run(IOutput $output) { |
|
65 | - if (!$this->shouldRun()) { |
|
66 | - return; |
|
67 | - } |
|
68 | - |
|
69 | - $query = $this->connection->getQueryBuilder(); |
|
70 | - $query |
|
71 | - ->update('share') |
|
72 | - ->set('password', 'share_with') |
|
73 | - ->where($query->expr()->eq('share_type', $query->createNamedParameter(Share::SHARE_TYPE_LINK))) |
|
74 | - ->andWhere($query->expr()->isNotNull('share_with')); |
|
75 | - $result = $query->execute(); |
|
76 | - |
|
77 | - if ($result === 0) { |
|
78 | - // No link updated, no need to run the second query |
|
79 | - return; |
|
80 | - } |
|
81 | - |
|
82 | - $clearQuery = $this->connection->getQueryBuilder(); |
|
83 | - $clearQuery |
|
84 | - ->update('share') |
|
85 | - ->set('share_with', $clearQuery->createNamedParameter(null)) |
|
86 | - ->where($clearQuery->expr()->eq('share_type', $clearQuery->createNamedParameter(Share::SHARE_TYPE_LINK))); |
|
87 | - |
|
88 | - $clearQuery->execute(); |
|
89 | - |
|
90 | - } |
|
91 | - |
|
92 | - protected function shouldRun() { |
|
93 | - $appVersion = $this->config->getAppValue('files_sharing', 'installed_version', '0.0.0'); |
|
94 | - return version_compare($appVersion, '1.4.0', '<'); |
|
95 | - } |
|
39 | + /** @var IDBConnection */ |
|
40 | + private $connection; |
|
41 | + |
|
42 | + /** @var IConfig */ |
|
43 | + private $config; |
|
44 | + |
|
45 | + |
|
46 | + public function __construct(IDBConnection $connection, IConfig $config) { |
|
47 | + $this->connection = $connection; |
|
48 | + $this->config = $config; |
|
49 | + } |
|
50 | + |
|
51 | + /** |
|
52 | + * Returns the step's name |
|
53 | + * |
|
54 | + * @return string |
|
55 | + * @since 9.1.0 |
|
56 | + */ |
|
57 | + public function getName() { |
|
58 | + return 'Copy the share password into the dedicated column'; |
|
59 | + } |
|
60 | + |
|
61 | + /** |
|
62 | + * @param IOutput $output |
|
63 | + */ |
|
64 | + public function run(IOutput $output) { |
|
65 | + if (!$this->shouldRun()) { |
|
66 | + return; |
|
67 | + } |
|
68 | + |
|
69 | + $query = $this->connection->getQueryBuilder(); |
|
70 | + $query |
|
71 | + ->update('share') |
|
72 | + ->set('password', 'share_with') |
|
73 | + ->where($query->expr()->eq('share_type', $query->createNamedParameter(Share::SHARE_TYPE_LINK))) |
|
74 | + ->andWhere($query->expr()->isNotNull('share_with')); |
|
75 | + $result = $query->execute(); |
|
76 | + |
|
77 | + if ($result === 0) { |
|
78 | + // No link updated, no need to run the second query |
|
79 | + return; |
|
80 | + } |
|
81 | + |
|
82 | + $clearQuery = $this->connection->getQueryBuilder(); |
|
83 | + $clearQuery |
|
84 | + ->update('share') |
|
85 | + ->set('share_with', $clearQuery->createNamedParameter(null)) |
|
86 | + ->where($clearQuery->expr()->eq('share_type', $clearQuery->createNamedParameter(Share::SHARE_TYPE_LINK))); |
|
87 | + |
|
88 | + $clearQuery->execute(); |
|
89 | + |
|
90 | + } |
|
91 | + |
|
92 | + protected function shouldRun() { |
|
93 | + $appVersion = $this->config->getAppValue('files_sharing', 'installed_version', '0.0.0'); |
|
94 | + return version_compare($appVersion, '1.4.0', '<'); |
|
95 | + } |
|
96 | 96 | |
97 | 97 | } |
@@ -34,20 +34,20 @@ |
||
34 | 34 | * @method void setName(string $name) |
35 | 35 | */ |
36 | 36 | class Client extends Entity { |
37 | - /** @var string */ |
|
38 | - protected $name; |
|
39 | - /** @var string */ |
|
40 | - protected $redirectUri; |
|
41 | - /** @var string */ |
|
42 | - protected $clientIdentifier; |
|
43 | - /** @var string */ |
|
44 | - protected $secret; |
|
37 | + /** @var string */ |
|
38 | + protected $name; |
|
39 | + /** @var string */ |
|
40 | + protected $redirectUri; |
|
41 | + /** @var string */ |
|
42 | + protected $clientIdentifier; |
|
43 | + /** @var string */ |
|
44 | + protected $secret; |
|
45 | 45 | |
46 | - public function __construct() { |
|
47 | - $this->addType('id', 'int'); |
|
48 | - $this->addType('name', 'string'); |
|
49 | - $this->addType('redirect_uri', 'string'); |
|
50 | - $this->addType('client_identifier', 'string'); |
|
51 | - $this->addType('secret', 'string'); |
|
52 | - } |
|
46 | + public function __construct() { |
|
47 | + $this->addType('id', 'int'); |
|
48 | + $this->addType('name', 'string'); |
|
49 | + $this->addType('redirect_uri', 'string'); |
|
50 | + $this->addType('client_identifier', 'string'); |
|
51 | + $this->addType('secret', 'string'); |
|
52 | + } |
|
53 | 53 | } |
@@ -31,31 +31,31 @@ |
||
31 | 31 | */ |
32 | 32 | interface ICredentials { |
33 | 33 | |
34 | - /** |
|
35 | - * Get the user UID |
|
36 | - * |
|
37 | - * @since 12 |
|
38 | - * |
|
39 | - * @return string |
|
40 | - */ |
|
41 | - public function getUID(); |
|
34 | + /** |
|
35 | + * Get the user UID |
|
36 | + * |
|
37 | + * @since 12 |
|
38 | + * |
|
39 | + * @return string |
|
40 | + */ |
|
41 | + public function getUID(); |
|
42 | 42 | |
43 | - /** |
|
44 | - * Get the login name the users used to login |
|
45 | - * |
|
46 | - * @since 12 |
|
47 | - * |
|
48 | - * @return string |
|
49 | - */ |
|
50 | - public function getLoginName(); |
|
43 | + /** |
|
44 | + * Get the login name the users used to login |
|
45 | + * |
|
46 | + * @since 12 |
|
47 | + * |
|
48 | + * @return string |
|
49 | + */ |
|
50 | + public function getLoginName(); |
|
51 | 51 | |
52 | - /** |
|
53 | - * Get the password |
|
54 | - * |
|
55 | - * @since 12 |
|
56 | - * |
|
57 | - * @return string |
|
58 | - * @throws PasswordUnavailableException |
|
59 | - */ |
|
60 | - public function getPassword(); |
|
52 | + /** |
|
53 | + * Get the password |
|
54 | + * |
|
55 | + * @since 12 |
|
56 | + * |
|
57 | + * @return string |
|
58 | + * @throws PasswordUnavailableException |
|
59 | + */ |
|
60 | + public function getPassword(); |
|
61 | 61 | } |
@@ -24,25 +24,25 @@ |
||
24 | 24 | namespace OC\Files\Cache\Wrapper; |
25 | 25 | |
26 | 26 | class CachePermissionsMask extends CacheWrapper { |
27 | - /** |
|
28 | - * @var int |
|
29 | - */ |
|
30 | - protected $mask; |
|
27 | + /** |
|
28 | + * @var int |
|
29 | + */ |
|
30 | + protected $mask; |
|
31 | 31 | |
32 | - /** |
|
33 | - * @param \OCP\Files\Cache\ICache $cache |
|
34 | - * @param int $mask |
|
35 | - */ |
|
36 | - public function __construct($cache, $mask) { |
|
37 | - parent::__construct($cache); |
|
38 | - $this->mask = $mask; |
|
39 | - } |
|
32 | + /** |
|
33 | + * @param \OCP\Files\Cache\ICache $cache |
|
34 | + * @param int $mask |
|
35 | + */ |
|
36 | + public function __construct($cache, $mask) { |
|
37 | + parent::__construct($cache); |
|
38 | + $this->mask = $mask; |
|
39 | + } |
|
40 | 40 | |
41 | - protected function formatCacheEntry($entry) { |
|
42 | - if (isset($entry['permissions'])) { |
|
43 | - $entry['scan_permissions'] = $entry['permissions']; |
|
44 | - $entry['permissions'] &= $this->mask; |
|
45 | - } |
|
46 | - return $entry; |
|
47 | - } |
|
41 | + protected function formatCacheEntry($entry) { |
|
42 | + if (isset($entry['permissions'])) { |
|
43 | + $entry['scan_permissions'] = $entry['permissions']; |
|
44 | + $entry['permissions'] &= $this->mask; |
|
45 | + } |
|
46 | + return $entry; |
|
47 | + } |
|
48 | 48 | } |
@@ -27,45 +27,45 @@ |
||
27 | 27 | |
28 | 28 | class Config implements \OCP\GlobalScale\IConfig { |
29 | 29 | |
30 | - /** @var IConfig */ |
|
31 | - private $config; |
|
30 | + /** @var IConfig */ |
|
31 | + private $config; |
|
32 | 32 | |
33 | - /** |
|
34 | - * Config constructor. |
|
35 | - * |
|
36 | - * @param IConfig $config |
|
37 | - */ |
|
38 | - public function __construct(IConfig $config) { |
|
39 | - $this->config = $config; |
|
40 | - } |
|
33 | + /** |
|
34 | + * Config constructor. |
|
35 | + * |
|
36 | + * @param IConfig $config |
|
37 | + */ |
|
38 | + public function __construct(IConfig $config) { |
|
39 | + $this->config = $config; |
|
40 | + } |
|
41 | 41 | |
42 | - /** |
|
43 | - * check if global scale is enabled |
|
44 | - * |
|
45 | - * @since 12.0.1 |
|
46 | - * @return bool |
|
47 | - */ |
|
48 | - public function isGlobalScaleEnabled() { |
|
49 | - $enabled = $this->config->getSystemValue('gs.enabled', false); |
|
50 | - return $enabled !== false; |
|
51 | - } |
|
42 | + /** |
|
43 | + * check if global scale is enabled |
|
44 | + * |
|
45 | + * @since 12.0.1 |
|
46 | + * @return bool |
|
47 | + */ |
|
48 | + public function isGlobalScaleEnabled() { |
|
49 | + $enabled = $this->config->getSystemValue('gs.enabled', false); |
|
50 | + return $enabled !== false; |
|
51 | + } |
|
52 | 52 | |
53 | - /** |
|
54 | - * check if federation should only be used internally in a global scale setup |
|
55 | - * |
|
56 | - * @since 12.0.1 |
|
57 | - * @return bool |
|
58 | - */ |
|
59 | - public function onlyInternalFederation() { |
|
60 | - // if global scale is disabled federation works always globally |
|
61 | - $gsEnabled = $this->isGlobalScaleEnabled(); |
|
62 | - if ($gsEnabled === false) { |
|
63 | - return false; |
|
64 | - } |
|
53 | + /** |
|
54 | + * check if federation should only be used internally in a global scale setup |
|
55 | + * |
|
56 | + * @since 12.0.1 |
|
57 | + * @return bool |
|
58 | + */ |
|
59 | + public function onlyInternalFederation() { |
|
60 | + // if global scale is disabled federation works always globally |
|
61 | + $gsEnabled = $this->isGlobalScaleEnabled(); |
|
62 | + if ($gsEnabled === false) { |
|
63 | + return false; |
|
64 | + } |
|
65 | 65 | |
66 | - $enabled = $this->config->getSystemValue('gs.federation', 'internal'); |
|
66 | + $enabled = $this->config->getSystemValue('gs.federation', 'internal'); |
|
67 | 67 | |
68 | - return $enabled === 'internal'; |
|
69 | - } |
|
68 | + return $enabled === 'internal'; |
|
69 | + } |
|
70 | 70 | |
71 | 71 | } |