@@ -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 | } |
@@ -65,8 +65,8 @@ discard block |
||
| 65 | 65 | |
| 66 | 66 | $output->startProgress(count($objects)); |
| 67 | 67 | foreach ($objects as $row) { |
| 68 | - $calObject = $this->calDavBackend->getCalendarObject((int)$row['calendarid'], $row['uri']); |
|
| 69 | - $data = preg_replace('/' . $pattern . '/', ':', $calObject['calendardata']); |
|
| 68 | + $calObject = $this->calDavBackend->getCalendarObject((int) $row['calendarid'], $row['uri']); |
|
| 69 | + $data = preg_replace('/'.$pattern.'/', ':', $calObject['calendardata']); |
|
| 70 | 70 | |
| 71 | 71 | if ($data !== $calObject['calendardata']) { |
| 72 | 72 | $output->advance(); |
@@ -76,14 +76,14 @@ discard block |
||
| 76 | 76 | } catch (InvalidDataException $e) { |
| 77 | 77 | $this->logger->info('Calendar object for calendar {cal} with uri {uri} still invalid', [ |
| 78 | 78 | 'app' => 'dav', |
| 79 | - 'cal' => (int)$row['calendarid'], |
|
| 79 | + 'cal' => (int) $row['calendarid'], |
|
| 80 | 80 | 'uri' => $row['uri'], |
| 81 | 81 | ]); |
| 82 | 82 | $warnings++; |
| 83 | 83 | continue; |
| 84 | 84 | } |
| 85 | 85 | |
| 86 | - $this->calDavBackend->updateCalendarObject((int)$row['calendarid'], $row['uri'], $data); |
|
| 86 | + $this->calDavBackend->updateCalendarObject((int) $row['calendarid'], $row['uri'], $data); |
|
| 87 | 87 | $count++; |
| 88 | 88 | } |
| 89 | 89 | } |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | ->where($query->expr()->like( |
| 105 | 105 | 'calendardata', |
| 106 | 106 | $query->createNamedParameter( |
| 107 | - '%' . $this->db->escapeLikeParameter($pattern) . '%', |
|
| 107 | + '%'.$this->db->escapeLikeParameter($pattern).'%', |
|
| 108 | 108 | IQueryBuilder::PARAM_STR |
| 109 | 109 | ), |
| 110 | 110 | IQueryBuilder::PARAM_STR |
@@ -35,118 +35,118 @@ |
||
| 35 | 35 | |
| 36 | 36 | class CalDAVRemoveEmptyValue implements IRepairStep { |
| 37 | 37 | |
| 38 | - /** @var IDBConnection */ |
|
| 39 | - private $db; |
|
| 40 | - |
|
| 41 | - /** @var CalDavBackend */ |
|
| 42 | - private $calDavBackend; |
|
| 43 | - |
|
| 44 | - /** @var ILogger */ |
|
| 45 | - private $logger; |
|
| 46 | - |
|
| 47 | - /** |
|
| 48 | - * @param IDBConnection $db |
|
| 49 | - * @param CalDavBackend $calDavBackend |
|
| 50 | - * @param ILogger $logger |
|
| 51 | - */ |
|
| 52 | - public function __construct(IDBConnection $db, CalDavBackend $calDavBackend, ILogger $logger) { |
|
| 53 | - $this->db = $db; |
|
| 54 | - $this->calDavBackend = $calDavBackend; |
|
| 55 | - $this->logger = $logger; |
|
| 56 | - } |
|
| 57 | - |
|
| 58 | - public function getName() { |
|
| 59 | - return 'Fix broken values of calendar objects'; |
|
| 60 | - } |
|
| 61 | - |
|
| 62 | - public function run(IOutput $output) { |
|
| 63 | - $pattern = ';VALUE=:'; |
|
| 64 | - $count = $warnings = 0; |
|
| 65 | - |
|
| 66 | - $objects = $this->getInvalidObjects($pattern); |
|
| 67 | - |
|
| 68 | - $output->startProgress(count($objects)); |
|
| 69 | - foreach ($objects as $row) { |
|
| 70 | - $calObject = $this->calDavBackend->getCalendarObject((int)$row['calendarid'], $row['uri']); |
|
| 71 | - $data = preg_replace('/' . $pattern . '/', ':', $calObject['calendardata']); |
|
| 72 | - |
|
| 73 | - if ($data !== $calObject['calendardata']) { |
|
| 74 | - $output->advance(); |
|
| 75 | - |
|
| 76 | - try { |
|
| 77 | - $this->calDavBackend->getDenormalizedData($data); |
|
| 78 | - } catch (InvalidDataException $e) { |
|
| 79 | - $this->logger->info('Calendar object for calendar {cal} with uri {uri} still invalid', [ |
|
| 80 | - 'app' => 'dav', |
|
| 81 | - 'cal' => (int)$row['calendarid'], |
|
| 82 | - 'uri' => $row['uri'], |
|
| 83 | - ]); |
|
| 84 | - $warnings++; |
|
| 85 | - continue; |
|
| 86 | - } |
|
| 87 | - |
|
| 88 | - $this->calDavBackend->updateCalendarObject((int)$row['calendarid'], $row['uri'], $data); |
|
| 89 | - $count++; |
|
| 90 | - } |
|
| 91 | - } |
|
| 92 | - $output->finishProgress(); |
|
| 93 | - |
|
| 94 | - if ($warnings > 0) { |
|
| 95 | - $output->warning(sprintf('%d events could not be updated, see log file for more information', $warnings)); |
|
| 96 | - } |
|
| 97 | - if ($count > 0) { |
|
| 98 | - $output->info(sprintf('Updated %d events', $count)); |
|
| 99 | - } |
|
| 100 | - } |
|
| 101 | - |
|
| 102 | - protected function getInvalidObjects($pattern) { |
|
| 103 | - if ($this->db->getDatabasePlatform() instanceof OraclePlatform) { |
|
| 104 | - $rows = []; |
|
| 105 | - $chunkSize = 500; |
|
| 106 | - $query = $this->db->getQueryBuilder(); |
|
| 107 | - $query->select($query->func()->count('*', 'num_entries')) |
|
| 108 | - ->from('calendarobjects'); |
|
| 109 | - $result = $query->execute(); |
|
| 110 | - $count = $result->fetchOne(); |
|
| 111 | - $result->closeCursor(); |
|
| 112 | - |
|
| 113 | - $numChunks = ceil($count / $chunkSize); |
|
| 114 | - |
|
| 115 | - $query = $this->db->getQueryBuilder(); |
|
| 116 | - $query->select(['calendarid', 'uri', 'calendardata']) |
|
| 117 | - ->from('calendarobjects') |
|
| 118 | - ->setMaxResults($chunkSize); |
|
| 119 | - for ($chunk = 0; $chunk < $numChunks; $chunk++) { |
|
| 120 | - $query->setFirstResult($chunk * $chunkSize); |
|
| 121 | - $result = $query->execute(); |
|
| 122 | - |
|
| 123 | - while ($row = $result->fetch()) { |
|
| 124 | - if (mb_strpos($row['calendardata'], $pattern) !== false) { |
|
| 125 | - unset($row['calendardata']); |
|
| 126 | - $rows[] = $row; |
|
| 127 | - } |
|
| 128 | - } |
|
| 129 | - $result->closeCursor(); |
|
| 130 | - } |
|
| 131 | - return $rows; |
|
| 132 | - } |
|
| 133 | - |
|
| 134 | - $query = $this->db->getQueryBuilder(); |
|
| 135 | - $query->select(['calendarid', 'uri']) |
|
| 136 | - ->from('calendarobjects') |
|
| 137 | - ->where($query->expr()->like( |
|
| 138 | - 'calendardata', |
|
| 139 | - $query->createNamedParameter( |
|
| 140 | - '%' . $this->db->escapeLikeParameter($pattern) . '%', |
|
| 141 | - IQueryBuilder::PARAM_STR |
|
| 142 | - ), |
|
| 143 | - IQueryBuilder::PARAM_STR |
|
| 144 | - )); |
|
| 145 | - |
|
| 146 | - $result = $query->execute(); |
|
| 147 | - $rows = $result->fetchAll(); |
|
| 148 | - $result->closeCursor(); |
|
| 149 | - |
|
| 150 | - return $rows; |
|
| 151 | - } |
|
| 38 | + /** @var IDBConnection */ |
|
| 39 | + private $db; |
|
| 40 | + |
|
| 41 | + /** @var CalDavBackend */ |
|
| 42 | + private $calDavBackend; |
|
| 43 | + |
|
| 44 | + /** @var ILogger */ |
|
| 45 | + private $logger; |
|
| 46 | + |
|
| 47 | + /** |
|
| 48 | + * @param IDBConnection $db |
|
| 49 | + * @param CalDavBackend $calDavBackend |
|
| 50 | + * @param ILogger $logger |
|
| 51 | + */ |
|
| 52 | + public function __construct(IDBConnection $db, CalDavBackend $calDavBackend, ILogger $logger) { |
|
| 53 | + $this->db = $db; |
|
| 54 | + $this->calDavBackend = $calDavBackend; |
|
| 55 | + $this->logger = $logger; |
|
| 56 | + } |
|
| 57 | + |
|
| 58 | + public function getName() { |
|
| 59 | + return 'Fix broken values of calendar objects'; |
|
| 60 | + } |
|
| 61 | + |
|
| 62 | + public function run(IOutput $output) { |
|
| 63 | + $pattern = ';VALUE=:'; |
|
| 64 | + $count = $warnings = 0; |
|
| 65 | + |
|
| 66 | + $objects = $this->getInvalidObjects($pattern); |
|
| 67 | + |
|
| 68 | + $output->startProgress(count($objects)); |
|
| 69 | + foreach ($objects as $row) { |
|
| 70 | + $calObject = $this->calDavBackend->getCalendarObject((int)$row['calendarid'], $row['uri']); |
|
| 71 | + $data = preg_replace('/' . $pattern . '/', ':', $calObject['calendardata']); |
|
| 72 | + |
|
| 73 | + if ($data !== $calObject['calendardata']) { |
|
| 74 | + $output->advance(); |
|
| 75 | + |
|
| 76 | + try { |
|
| 77 | + $this->calDavBackend->getDenormalizedData($data); |
|
| 78 | + } catch (InvalidDataException $e) { |
|
| 79 | + $this->logger->info('Calendar object for calendar {cal} with uri {uri} still invalid', [ |
|
| 80 | + 'app' => 'dav', |
|
| 81 | + 'cal' => (int)$row['calendarid'], |
|
| 82 | + 'uri' => $row['uri'], |
|
| 83 | + ]); |
|
| 84 | + $warnings++; |
|
| 85 | + continue; |
|
| 86 | + } |
|
| 87 | + |
|
| 88 | + $this->calDavBackend->updateCalendarObject((int)$row['calendarid'], $row['uri'], $data); |
|
| 89 | + $count++; |
|
| 90 | + } |
|
| 91 | + } |
|
| 92 | + $output->finishProgress(); |
|
| 93 | + |
|
| 94 | + if ($warnings > 0) { |
|
| 95 | + $output->warning(sprintf('%d events could not be updated, see log file for more information', $warnings)); |
|
| 96 | + } |
|
| 97 | + if ($count > 0) { |
|
| 98 | + $output->info(sprintf('Updated %d events', $count)); |
|
| 99 | + } |
|
| 100 | + } |
|
| 101 | + |
|
| 102 | + protected function getInvalidObjects($pattern) { |
|
| 103 | + if ($this->db->getDatabasePlatform() instanceof OraclePlatform) { |
|
| 104 | + $rows = []; |
|
| 105 | + $chunkSize = 500; |
|
| 106 | + $query = $this->db->getQueryBuilder(); |
|
| 107 | + $query->select($query->func()->count('*', 'num_entries')) |
|
| 108 | + ->from('calendarobjects'); |
|
| 109 | + $result = $query->execute(); |
|
| 110 | + $count = $result->fetchOne(); |
|
| 111 | + $result->closeCursor(); |
|
| 112 | + |
|
| 113 | + $numChunks = ceil($count / $chunkSize); |
|
| 114 | + |
|
| 115 | + $query = $this->db->getQueryBuilder(); |
|
| 116 | + $query->select(['calendarid', 'uri', 'calendardata']) |
|
| 117 | + ->from('calendarobjects') |
|
| 118 | + ->setMaxResults($chunkSize); |
|
| 119 | + for ($chunk = 0; $chunk < $numChunks; $chunk++) { |
|
| 120 | + $query->setFirstResult($chunk * $chunkSize); |
|
| 121 | + $result = $query->execute(); |
|
| 122 | + |
|
| 123 | + while ($row = $result->fetch()) { |
|
| 124 | + if (mb_strpos($row['calendardata'], $pattern) !== false) { |
|
| 125 | + unset($row['calendardata']); |
|
| 126 | + $rows[] = $row; |
|
| 127 | + } |
|
| 128 | + } |
|
| 129 | + $result->closeCursor(); |
|
| 130 | + } |
|
| 131 | + return $rows; |
|
| 132 | + } |
|
| 133 | + |
|
| 134 | + $query = $this->db->getQueryBuilder(); |
|
| 135 | + $query->select(['calendarid', 'uri']) |
|
| 136 | + ->from('calendarobjects') |
|
| 137 | + ->where($query->expr()->like( |
|
| 138 | + 'calendardata', |
|
| 139 | + $query->createNamedParameter( |
|
| 140 | + '%' . $this->db->escapeLikeParameter($pattern) . '%', |
|
| 141 | + IQueryBuilder::PARAM_STR |
|
| 142 | + ), |
|
| 143 | + IQueryBuilder::PARAM_STR |
|
| 144 | + )); |
|
| 145 | + |
|
| 146 | + $result = $query->execute(); |
|
| 147 | + $rows = $result->fetchAll(); |
|
| 148 | + $result->closeCursor(); |
|
| 149 | + |
|
| 150 | + return $rows; |
|
| 151 | + } |
|
| 152 | 152 | } |
@@ -39,7 +39,7 @@ |
||
| 39 | 39 | $reader->parseInnerTree(); |
| 40 | 40 | |
| 41 | 41 | if (!is_string($componentName)) { |
| 42 | - throw new BadRequest('The {' . SearchPlugin::NS_Nextcloud . '}comp-filter requires a valid name attribute'); |
|
| 42 | + throw new BadRequest('The {'.SearchPlugin::NS_Nextcloud.'}comp-filter requires a valid name attribute'); |
|
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | return $componentName; |
@@ -27,21 +27,21 @@ |
||
| 27 | 27 | |
| 28 | 28 | class CompFilter implements XmlDeserializable { |
| 29 | 29 | |
| 30 | - /** |
|
| 31 | - * @param Reader $reader |
|
| 32 | - * @throws BadRequest |
|
| 33 | - * @return string |
|
| 34 | - */ |
|
| 35 | - public static function xmlDeserialize(Reader $reader) { |
|
| 36 | - $att = $reader->parseAttributes(); |
|
| 37 | - $componentName = $att['name']; |
|
| 30 | + /** |
|
| 31 | + * @param Reader $reader |
|
| 32 | + * @throws BadRequest |
|
| 33 | + * @return string |
|
| 34 | + */ |
|
| 35 | + public static function xmlDeserialize(Reader $reader) { |
|
| 36 | + $att = $reader->parseAttributes(); |
|
| 37 | + $componentName = $att['name']; |
|
| 38 | 38 | |
| 39 | - $reader->parseInnerTree(); |
|
| 39 | + $reader->parseInnerTree(); |
|
| 40 | 40 | |
| 41 | - if (!is_string($componentName)) { |
|
| 42 | - throw new BadRequest('The {' . SearchPlugin::NS_Nextcloud . '}comp-filter requires a valid name attribute'); |
|
| 43 | - } |
|
| 41 | + if (!is_string($componentName)) { |
|
| 42 | + throw new BadRequest('The {' . SearchPlugin::NS_Nextcloud . '}comp-filter requires a valid name attribute'); |
|
| 43 | + } |
|
| 44 | 44 | |
| 45 | - return $componentName; |
|
| 46 | - } |
|
| 45 | + return $componentName; |
|
| 46 | + } |
|
| 47 | 47 | } |
@@ -39,7 +39,7 @@ |
||
| 39 | 39 | $reader->parseInnerTree(); |
| 40 | 40 | |
| 41 | 41 | if (!is_string($componentName)) { |
| 42 | - throw new BadRequest('The {' . SearchPlugin::NS_Nextcloud . '}prop-filter requires a valid name attribute'); |
|
| 42 | + throw new BadRequest('The {'.SearchPlugin::NS_Nextcloud.'}prop-filter requires a valid name attribute'); |
|
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | return $componentName; |
@@ -27,21 +27,21 @@ |
||
| 27 | 27 | |
| 28 | 28 | class PropFilter implements XmlDeserializable { |
| 29 | 29 | |
| 30 | - /** |
|
| 31 | - * @param Reader $reader |
|
| 32 | - * @throws BadRequest |
|
| 33 | - * @return string |
|
| 34 | - */ |
|
| 35 | - public static function xmlDeserialize(Reader $reader) { |
|
| 36 | - $att = $reader->parseAttributes(); |
|
| 37 | - $componentName = $att['name']; |
|
| 30 | + /** |
|
| 31 | + * @param Reader $reader |
|
| 32 | + * @throws BadRequest |
|
| 33 | + * @return string |
|
| 34 | + */ |
|
| 35 | + public static function xmlDeserialize(Reader $reader) { |
|
| 36 | + $att = $reader->parseAttributes(); |
|
| 37 | + $componentName = $att['name']; |
|
| 38 | 38 | |
| 39 | - $reader->parseInnerTree(); |
|
| 39 | + $reader->parseInnerTree(); |
|
| 40 | 40 | |
| 41 | - if (!is_string($componentName)) { |
|
| 42 | - throw new BadRequest('The {' . SearchPlugin::NS_Nextcloud . '}prop-filter requires a valid name attribute'); |
|
| 43 | - } |
|
| 41 | + if (!is_string($componentName)) { |
|
| 42 | + throw new BadRequest('The {' . SearchPlugin::NS_Nextcloud . '}prop-filter requires a valid name attribute'); |
|
| 43 | + } |
|
| 44 | 44 | |
| 45 | - return $componentName; |
|
| 46 | - } |
|
| 45 | + return $componentName; |
|
| 46 | + } |
|
| 47 | 47 | } |
@@ -40,11 +40,11 @@ |
||
| 40 | 40 | $reader->parseInnerTree(); |
| 41 | 41 | |
| 42 | 42 | if (!is_string($property)) { |
| 43 | - throw new BadRequest('The {' . SearchPlugin::NS_Nextcloud . '}param-filter requires a valid property attribute'); |
|
| 43 | + throw new BadRequest('The {'.SearchPlugin::NS_Nextcloud.'}param-filter requires a valid property attribute'); |
|
| 44 | 44 | |
| 45 | 45 | } |
| 46 | 46 | if (!is_string($parameter)) { |
| 47 | - throw new BadRequest('The {' . SearchPlugin::NS_Nextcloud . '}param-filter requires a valid parameter attribute'); |
|
| 47 | + throw new BadRequest('The {'.SearchPlugin::NS_Nextcloud.'}param-filter requires a valid parameter attribute'); |
|
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | return [ |
@@ -27,28 +27,28 @@ |
||
| 27 | 27 | |
| 28 | 28 | class ParamFilter implements XmlDeserializable { |
| 29 | 29 | |
| 30 | - /** |
|
| 31 | - * @param Reader $reader |
|
| 32 | - * @throws BadRequest |
|
| 33 | - * @return string |
|
| 34 | - */ |
|
| 35 | - public static function xmlDeserialize(Reader $reader) { |
|
| 36 | - $att = $reader->parseAttributes(); |
|
| 37 | - $property = $att['property']; |
|
| 38 | - $parameter = $att['name']; |
|
| 30 | + /** |
|
| 31 | + * @param Reader $reader |
|
| 32 | + * @throws BadRequest |
|
| 33 | + * @return string |
|
| 34 | + */ |
|
| 35 | + public static function xmlDeserialize(Reader $reader) { |
|
| 36 | + $att = $reader->parseAttributes(); |
|
| 37 | + $property = $att['property']; |
|
| 38 | + $parameter = $att['name']; |
|
| 39 | 39 | |
| 40 | - $reader->parseInnerTree(); |
|
| 40 | + $reader->parseInnerTree(); |
|
| 41 | 41 | |
| 42 | - if (!is_string($property)) { |
|
| 43 | - throw new BadRequest('The {' . SearchPlugin::NS_Nextcloud . '}param-filter requires a valid property attribute'); |
|
| 44 | - } |
|
| 45 | - if (!is_string($parameter)) { |
|
| 46 | - throw new BadRequest('The {' . SearchPlugin::NS_Nextcloud . '}param-filter requires a valid parameter attribute'); |
|
| 47 | - } |
|
| 42 | + if (!is_string($property)) { |
|
| 43 | + throw new BadRequest('The {' . SearchPlugin::NS_Nextcloud . '}param-filter requires a valid property attribute'); |
|
| 44 | + } |
|
| 45 | + if (!is_string($parameter)) { |
|
| 46 | + throw new BadRequest('The {' . SearchPlugin::NS_Nextcloud . '}param-filter requires a valid parameter attribute'); |
|
| 47 | + } |
|
| 48 | 48 | |
| 49 | - return [ |
|
| 50 | - 'property' => $property, |
|
| 51 | - 'parameter' => $parameter, |
|
| 52 | - ]; |
|
| 53 | - } |
|
| 49 | + return [ |
|
| 50 | + 'property' => $property, |
|
| 51 | + 'parameter' => $parameter, |
|
| 52 | + ]; |
|
| 53 | + } |
|
| 54 | 54 | } |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | <tr><td> |
| 28 | 28 | <table cellspacing="0" cellpadding="0" border="0" width="600px"> |
| 29 | 29 | <tr> |
| 30 | - <td colspan="2" bgcolor="<?php p($theme->getColorPrimary());?>"> |
|
| 30 | + <td colspan="2" bgcolor="<?php p($theme->getColorPrimary()); ?>"> |
|
| 31 | 31 | <img src="<?php p(\OC::$server->getURLGenerator()->getAbsoluteURL(image_path('', 'logo-mail.png'))); ?>" alt="<?php p($theme->getName()); ?>"/> |
| 32 | 32 | </td> |
| 33 | 33 | </tr> |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | <td style="font-weight:normal; font-size:0.8em; line-height:1.2em; font-family:verdana,'arial',sans;">--<br> |
| 53 | 53 | <?php p($theme->getName()); ?> - |
| 54 | 54 | <?php p($theme->getSlogan()); ?> |
| 55 | - <br><a href="<?php p($theme->getBaseUrl()); ?>"><?php p($theme->getBaseUrl());?></a> |
|
| 55 | + <br><a href="<?php p($theme->getBaseUrl()); ?>"><?php p($theme->getBaseUrl()); ?></a> |
|
| 56 | 56 | </td> |
| 57 | 57 | </tr> |
| 58 | 58 | <tr> |
@@ -15,10 +15,10 @@ |
||
| 15 | 15 | <td width="20px"> </td> |
| 16 | 16 | <td style="font-weight:normal; font-size:0.8em; line-height:1.2em; font-family:verdana,'arial',sans;"> |
| 17 | 17 | <?php |
| 18 | - print_unescaped($l->t('Hey there,<br><br>The administration enabled server-side-encryption. Your files were encrypted using the password <strong>%s</strong>.<br><br>Please login to the web interface, go to the section "Basic encryption module" of your personal settings and update your encryption password by entering this password into the "Old log-in password" field and your current login-password.<br><br>', [$_['password']])); |
|
| 19 | - // TRANSLATORS term at the end of a mail |
|
| 20 | - p($l->t('Cheers!')); |
|
| 21 | - ?> |
|
| 18 | + print_unescaped($l->t('Hey there,<br><br>The administration enabled server-side-encryption. Your files were encrypted using the password <strong>%s</strong>.<br><br>Please login to the web interface, go to the section "Basic encryption module" of your personal settings and update your encryption password by entering this password into the "Old log-in password" field and your current login-password.<br><br>', [$_['password']])); |
|
| 19 | + // TRANSLATORS term at the end of a mail |
|
| 20 | + p($l->t('Cheers!')); |
|
| 21 | + ?> |
|
| 22 | 22 | </td> |
| 23 | 23 | </tr> |
| 24 | 24 | <tr><td colspan="2"> </td></tr> |
@@ -171,14 +171,14 @@ |
||
| 171 | 171 | protected function deleteOrphanEntries(IOutput $output, $repairInfo, $deleteTable, $deleteId, $sourceTable, $sourceId, $sourceNullColumn) { |
| 172 | 172 | $qb = $this->connection->getQueryBuilder(); |
| 173 | 173 | |
| 174 | - $qb->select('d.' . $deleteId) |
|
| 174 | + $qb->select('d.'.$deleteId) |
|
| 175 | 175 | ->from($deleteTable, 'd') |
| 176 | - ->leftJoin('d', $sourceTable, 's', $qb->expr()->eq('d.' . $deleteId, 's.' . $sourceId)) |
|
| 176 | + ->leftJoin('d', $sourceTable, 's', $qb->expr()->eq('d.'.$deleteId, 's.'.$sourceId)) |
|
| 177 | 177 | ->where( |
| 178 | 178 | $qb->expr()->eq('d.type', $qb->expr()->literal('files')) |
| 179 | 179 | ) |
| 180 | 180 | ->andWhere( |
| 181 | - $qb->expr()->isNull('s.' . $sourceNullColumn) |
|
| 181 | + $qb->expr()->isNull('s.'.$sourceNullColumn) |
|
| 182 | 182 | ); |
| 183 | 183 | $result = $qb->execute(); |
| 184 | 184 | |
@@ -41,171 +41,171 @@ |
||
| 41 | 41 | */ |
| 42 | 42 | class CleanTags implements IRepairStep { |
| 43 | 43 | |
| 44 | - /** @var IDBConnection */ |
|
| 45 | - protected $connection; |
|
| 46 | - |
|
| 47 | - /** @var IUserManager */ |
|
| 48 | - protected $userManager; |
|
| 49 | - |
|
| 50 | - protected $deletedTags = 0; |
|
| 51 | - |
|
| 52 | - /** |
|
| 53 | - * @param IDBConnection $connection |
|
| 54 | - * @param IUserManager $userManager |
|
| 55 | - */ |
|
| 56 | - public function __construct(IDBConnection $connection, IUserManager $userManager) { |
|
| 57 | - $this->connection = $connection; |
|
| 58 | - $this->userManager = $userManager; |
|
| 59 | - } |
|
| 60 | - |
|
| 61 | - /** |
|
| 62 | - * @return string |
|
| 63 | - */ |
|
| 64 | - public function getName() { |
|
| 65 | - return 'Clean tags and favorites'; |
|
| 66 | - } |
|
| 67 | - |
|
| 68 | - /** |
|
| 69 | - * Updates the configuration after running an update |
|
| 70 | - */ |
|
| 71 | - public function run(IOutput $output) { |
|
| 72 | - $this->deleteOrphanTags($output); |
|
| 73 | - $this->deleteOrphanFileEntries($output); |
|
| 74 | - $this->deleteOrphanTagEntries($output); |
|
| 75 | - $this->deleteOrphanCategoryEntries($output); |
|
| 76 | - } |
|
| 77 | - |
|
| 78 | - /** |
|
| 79 | - * Delete tags for deleted users |
|
| 80 | - */ |
|
| 81 | - protected function deleteOrphanTags(IOutput $output) { |
|
| 82 | - $offset = 0; |
|
| 83 | - while ($this->checkTags($offset)) { |
|
| 84 | - $offset += 50; |
|
| 85 | - } |
|
| 86 | - |
|
| 87 | - $output->info(sprintf('%d tags of deleted users have been removed.', $this->deletedTags)); |
|
| 88 | - } |
|
| 89 | - |
|
| 90 | - protected function checkTags($offset) { |
|
| 91 | - $query = $this->connection->getQueryBuilder(); |
|
| 92 | - $query->select('uid') |
|
| 93 | - ->from('vcategory') |
|
| 94 | - ->groupBy('uid') |
|
| 95 | - ->orderBy('uid') |
|
| 96 | - ->setMaxResults(50) |
|
| 97 | - ->setFirstResult($offset); |
|
| 98 | - $result = $query->execute(); |
|
| 99 | - |
|
| 100 | - $users = []; |
|
| 101 | - $hadResults = false; |
|
| 102 | - while ($row = $result->fetch()) { |
|
| 103 | - $hadResults = true; |
|
| 104 | - if (!$this->userManager->userExists($row['uid'])) { |
|
| 105 | - $users[] = $row['uid']; |
|
| 106 | - } |
|
| 107 | - } |
|
| 108 | - $result->closeCursor(); |
|
| 109 | - |
|
| 110 | - if (!$hadResults) { |
|
| 111 | - // No more tags, stop looping |
|
| 112 | - return false; |
|
| 113 | - } |
|
| 114 | - |
|
| 115 | - if (!empty($users)) { |
|
| 116 | - $query = $this->connection->getQueryBuilder(); |
|
| 117 | - $query->delete('vcategory') |
|
| 118 | - ->where($query->expr()->in('uid', $query->createNamedParameter($users, IQueryBuilder::PARAM_STR_ARRAY))); |
|
| 119 | - $this->deletedTags += $query->execute(); |
|
| 120 | - } |
|
| 121 | - return true; |
|
| 122 | - } |
|
| 123 | - |
|
| 124 | - /** |
|
| 125 | - * Delete tag entries for deleted files |
|
| 126 | - */ |
|
| 127 | - protected function deleteOrphanFileEntries(IOutput $output) { |
|
| 128 | - $this->deleteOrphanEntries( |
|
| 129 | - $output, |
|
| 130 | - '%d tags for delete files have been removed.', |
|
| 131 | - 'vcategory_to_object', 'objid', |
|
| 132 | - 'filecache', 'fileid', 'path_hash' |
|
| 133 | - ); |
|
| 134 | - } |
|
| 135 | - |
|
| 136 | - /** |
|
| 137 | - * Delete tag entries for deleted tags |
|
| 138 | - */ |
|
| 139 | - protected function deleteOrphanTagEntries(IOutput $output) { |
|
| 140 | - $this->deleteOrphanEntries( |
|
| 141 | - $output, |
|
| 142 | - '%d tag entries for deleted tags have been removed.', |
|
| 143 | - 'vcategory_to_object', 'categoryid', |
|
| 144 | - 'vcategory', 'id', 'uid' |
|
| 145 | - ); |
|
| 146 | - } |
|
| 147 | - |
|
| 148 | - /** |
|
| 149 | - * Delete tags that have no entries |
|
| 150 | - */ |
|
| 151 | - protected function deleteOrphanCategoryEntries(IOutput $output) { |
|
| 152 | - $this->deleteOrphanEntries( |
|
| 153 | - $output, |
|
| 154 | - '%d tags with no entries have been removed.', |
|
| 155 | - 'vcategory', 'id', |
|
| 156 | - 'vcategory_to_object', 'categoryid', 'type' |
|
| 157 | - ); |
|
| 158 | - } |
|
| 159 | - |
|
| 160 | - /** |
|
| 161 | - * Deletes all entries from $deleteTable that do not have a matching entry in $sourceTable |
|
| 162 | - * |
|
| 163 | - * A query joins $deleteTable.$deleteId = $sourceTable.$sourceId and checks |
|
| 164 | - * whether $sourceNullColumn is null. If it is null, the entry in $deleteTable |
|
| 165 | - * is being deleted. |
|
| 166 | - * |
|
| 167 | - * @param string $repairInfo |
|
| 168 | - * @param string $deleteTable |
|
| 169 | - * @param string $deleteId |
|
| 170 | - * @param string $sourceTable |
|
| 171 | - * @param string $sourceId |
|
| 172 | - * @param string $sourceNullColumn If this column is null in the source table, |
|
| 173 | - * the entry is deleted in the $deleteTable |
|
| 174 | - */ |
|
| 175 | - protected function deleteOrphanEntries(IOutput $output, $repairInfo, $deleteTable, $deleteId, $sourceTable, $sourceId, $sourceNullColumn) { |
|
| 176 | - $qb = $this->connection->getQueryBuilder(); |
|
| 177 | - |
|
| 178 | - $qb->select('d.' . $deleteId) |
|
| 179 | - ->from($deleteTable, 'd') |
|
| 180 | - ->leftJoin('d', $sourceTable, 's', $qb->expr()->eq('d.' . $deleteId, 's.' . $sourceId)) |
|
| 181 | - ->where( |
|
| 182 | - $qb->expr()->eq('d.type', $qb->expr()->literal('files')) |
|
| 183 | - ) |
|
| 184 | - ->andWhere( |
|
| 185 | - $qb->expr()->isNull('s.' . $sourceNullColumn) |
|
| 186 | - ); |
|
| 187 | - $result = $qb->execute(); |
|
| 188 | - |
|
| 189 | - $orphanItems = []; |
|
| 190 | - while ($row = $result->fetch()) { |
|
| 191 | - $orphanItems[] = (int) $row[$deleteId]; |
|
| 192 | - } |
|
| 193 | - |
|
| 194 | - if (!empty($orphanItems)) { |
|
| 195 | - $orphanItemsBatch = array_chunk($orphanItems, 200); |
|
| 196 | - foreach ($orphanItemsBatch as $items) { |
|
| 197 | - $qb->delete($deleteTable) |
|
| 198 | - ->where( |
|
| 199 | - $qb->expr()->eq('type', $qb->expr()->literal('files')) |
|
| 200 | - ) |
|
| 201 | - ->andWhere($qb->expr()->in($deleteId, $qb->createParameter('ids'))); |
|
| 202 | - $qb->setParameter('ids', $items, IQueryBuilder::PARAM_INT_ARRAY); |
|
| 203 | - $qb->execute(); |
|
| 204 | - } |
|
| 205 | - } |
|
| 206 | - |
|
| 207 | - if ($repairInfo) { |
|
| 208 | - $output->info(sprintf($repairInfo, count($orphanItems))); |
|
| 209 | - } |
|
| 210 | - } |
|
| 44 | + /** @var IDBConnection */ |
|
| 45 | + protected $connection; |
|
| 46 | + |
|
| 47 | + /** @var IUserManager */ |
|
| 48 | + protected $userManager; |
|
| 49 | + |
|
| 50 | + protected $deletedTags = 0; |
|
| 51 | + |
|
| 52 | + /** |
|
| 53 | + * @param IDBConnection $connection |
|
| 54 | + * @param IUserManager $userManager |
|
| 55 | + */ |
|
| 56 | + public function __construct(IDBConnection $connection, IUserManager $userManager) { |
|
| 57 | + $this->connection = $connection; |
|
| 58 | + $this->userManager = $userManager; |
|
| 59 | + } |
|
| 60 | + |
|
| 61 | + /** |
|
| 62 | + * @return string |
|
| 63 | + */ |
|
| 64 | + public function getName() { |
|
| 65 | + return 'Clean tags and favorites'; |
|
| 66 | + } |
|
| 67 | + |
|
| 68 | + /** |
|
| 69 | + * Updates the configuration after running an update |
|
| 70 | + */ |
|
| 71 | + public function run(IOutput $output) { |
|
| 72 | + $this->deleteOrphanTags($output); |
|
| 73 | + $this->deleteOrphanFileEntries($output); |
|
| 74 | + $this->deleteOrphanTagEntries($output); |
|
| 75 | + $this->deleteOrphanCategoryEntries($output); |
|
| 76 | + } |
|
| 77 | + |
|
| 78 | + /** |
|
| 79 | + * Delete tags for deleted users |
|
| 80 | + */ |
|
| 81 | + protected function deleteOrphanTags(IOutput $output) { |
|
| 82 | + $offset = 0; |
|
| 83 | + while ($this->checkTags($offset)) { |
|
| 84 | + $offset += 50; |
|
| 85 | + } |
|
| 86 | + |
|
| 87 | + $output->info(sprintf('%d tags of deleted users have been removed.', $this->deletedTags)); |
|
| 88 | + } |
|
| 89 | + |
|
| 90 | + protected function checkTags($offset) { |
|
| 91 | + $query = $this->connection->getQueryBuilder(); |
|
| 92 | + $query->select('uid') |
|
| 93 | + ->from('vcategory') |
|
| 94 | + ->groupBy('uid') |
|
| 95 | + ->orderBy('uid') |
|
| 96 | + ->setMaxResults(50) |
|
| 97 | + ->setFirstResult($offset); |
|
| 98 | + $result = $query->execute(); |
|
| 99 | + |
|
| 100 | + $users = []; |
|
| 101 | + $hadResults = false; |
|
| 102 | + while ($row = $result->fetch()) { |
|
| 103 | + $hadResults = true; |
|
| 104 | + if (!$this->userManager->userExists($row['uid'])) { |
|
| 105 | + $users[] = $row['uid']; |
|
| 106 | + } |
|
| 107 | + } |
|
| 108 | + $result->closeCursor(); |
|
| 109 | + |
|
| 110 | + if (!$hadResults) { |
|
| 111 | + // No more tags, stop looping |
|
| 112 | + return false; |
|
| 113 | + } |
|
| 114 | + |
|
| 115 | + if (!empty($users)) { |
|
| 116 | + $query = $this->connection->getQueryBuilder(); |
|
| 117 | + $query->delete('vcategory') |
|
| 118 | + ->where($query->expr()->in('uid', $query->createNamedParameter($users, IQueryBuilder::PARAM_STR_ARRAY))); |
|
| 119 | + $this->deletedTags += $query->execute(); |
|
| 120 | + } |
|
| 121 | + return true; |
|
| 122 | + } |
|
| 123 | + |
|
| 124 | + /** |
|
| 125 | + * Delete tag entries for deleted files |
|
| 126 | + */ |
|
| 127 | + protected function deleteOrphanFileEntries(IOutput $output) { |
|
| 128 | + $this->deleteOrphanEntries( |
|
| 129 | + $output, |
|
| 130 | + '%d tags for delete files have been removed.', |
|
| 131 | + 'vcategory_to_object', 'objid', |
|
| 132 | + 'filecache', 'fileid', 'path_hash' |
|
| 133 | + ); |
|
| 134 | + } |
|
| 135 | + |
|
| 136 | + /** |
|
| 137 | + * Delete tag entries for deleted tags |
|
| 138 | + */ |
|
| 139 | + protected function deleteOrphanTagEntries(IOutput $output) { |
|
| 140 | + $this->deleteOrphanEntries( |
|
| 141 | + $output, |
|
| 142 | + '%d tag entries for deleted tags have been removed.', |
|
| 143 | + 'vcategory_to_object', 'categoryid', |
|
| 144 | + 'vcategory', 'id', 'uid' |
|
| 145 | + ); |
|
| 146 | + } |
|
| 147 | + |
|
| 148 | + /** |
|
| 149 | + * Delete tags that have no entries |
|
| 150 | + */ |
|
| 151 | + protected function deleteOrphanCategoryEntries(IOutput $output) { |
|
| 152 | + $this->deleteOrphanEntries( |
|
| 153 | + $output, |
|
| 154 | + '%d tags with no entries have been removed.', |
|
| 155 | + 'vcategory', 'id', |
|
| 156 | + 'vcategory_to_object', 'categoryid', 'type' |
|
| 157 | + ); |
|
| 158 | + } |
|
| 159 | + |
|
| 160 | + /** |
|
| 161 | + * Deletes all entries from $deleteTable that do not have a matching entry in $sourceTable |
|
| 162 | + * |
|
| 163 | + * A query joins $deleteTable.$deleteId = $sourceTable.$sourceId and checks |
|
| 164 | + * whether $sourceNullColumn is null. If it is null, the entry in $deleteTable |
|
| 165 | + * is being deleted. |
|
| 166 | + * |
|
| 167 | + * @param string $repairInfo |
|
| 168 | + * @param string $deleteTable |
|
| 169 | + * @param string $deleteId |
|
| 170 | + * @param string $sourceTable |
|
| 171 | + * @param string $sourceId |
|
| 172 | + * @param string $sourceNullColumn If this column is null in the source table, |
|
| 173 | + * the entry is deleted in the $deleteTable |
|
| 174 | + */ |
|
| 175 | + protected function deleteOrphanEntries(IOutput $output, $repairInfo, $deleteTable, $deleteId, $sourceTable, $sourceId, $sourceNullColumn) { |
|
| 176 | + $qb = $this->connection->getQueryBuilder(); |
|
| 177 | + |
|
| 178 | + $qb->select('d.' . $deleteId) |
|
| 179 | + ->from($deleteTable, 'd') |
|
| 180 | + ->leftJoin('d', $sourceTable, 's', $qb->expr()->eq('d.' . $deleteId, 's.' . $sourceId)) |
|
| 181 | + ->where( |
|
| 182 | + $qb->expr()->eq('d.type', $qb->expr()->literal('files')) |
|
| 183 | + ) |
|
| 184 | + ->andWhere( |
|
| 185 | + $qb->expr()->isNull('s.' . $sourceNullColumn) |
|
| 186 | + ); |
|
| 187 | + $result = $qb->execute(); |
|
| 188 | + |
|
| 189 | + $orphanItems = []; |
|
| 190 | + while ($row = $result->fetch()) { |
|
| 191 | + $orphanItems[] = (int) $row[$deleteId]; |
|
| 192 | + } |
|
| 193 | + |
|
| 194 | + if (!empty($orphanItems)) { |
|
| 195 | + $orphanItemsBatch = array_chunk($orphanItems, 200); |
|
| 196 | + foreach ($orphanItemsBatch as $items) { |
|
| 197 | + $qb->delete($deleteTable) |
|
| 198 | + ->where( |
|
| 199 | + $qb->expr()->eq('type', $qb->expr()->literal('files')) |
|
| 200 | + ) |
|
| 201 | + ->andWhere($qb->expr()->in($deleteId, $qb->createParameter('ids'))); |
|
| 202 | + $qb->setParameter('ids', $items, IQueryBuilder::PARAM_INT_ARRAY); |
|
| 203 | + $qb->execute(); |
|
| 204 | + } |
|
| 205 | + } |
|
| 206 | + |
|
| 207 | + if ($repairInfo) { |
|
| 208 | + $output->info(sprintf($repairInfo, count($orphanItems))); |
|
| 209 | + } |
|
| 210 | + } |
|
| 211 | 211 | } |
@@ -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,10 +29,10 @@ |
||
| 29 | 29 | */ |
| 30 | 30 | interface IProvider { |
| 31 | 31 | |
| 32 | - /** |
|
| 33 | - * @since 12.0 |
|
| 34 | - * @param IEntry $entry |
|
| 35 | - * @return void |
|
| 36 | - */ |
|
| 37 | - public function process(IEntry $entry); |
|
| 32 | + /** |
|
| 33 | + * @since 12.0 |
|
| 34 | + * @param IEntry $entry |
|
| 35 | + * @return void |
|
| 36 | + */ |
|
| 37 | + public function process(IEntry $entry); |
|
| 38 | 38 | } |