@@ -26,7 +26,7 @@ |
||
| 26 | 26 | namespace OC\Core\Command\Background; |
| 27 | 27 | |
| 28 | 28 | class WebCron extends Base { |
| 29 | - protected function getMode() { |
|
| 30 | - return 'webcron'; |
|
| 31 | - } |
|
| 29 | + protected function getMode() { |
|
| 30 | + return 'webcron'; |
|
| 31 | + } |
|
| 32 | 32 | } |
@@ -67,11 +67,11 @@ |
||
| 67 | 67 | */ |
| 68 | 68 | protected function writeModuleList(InputInterface $input, OutputInterface $output, $items) { |
| 69 | 69 | if ($input->getOption('output') === self::OUTPUT_FORMAT_PLAIN) { |
| 70 | - array_walk($items, function (&$item) { |
|
| 70 | + array_walk($items, function(&$item) { |
|
| 71 | 71 | if (!$item['default']) { |
| 72 | 72 | $item = $item['displayName']; |
| 73 | 73 | } else { |
| 74 | - $item = $item['displayName'] . ' [default*]'; |
|
| 74 | + $item = $item['displayName'].' [default*]'; |
|
| 75 | 75 | } |
| 76 | 76 | }); |
| 77 | 77 | } |
@@ -31,70 +31,70 @@ |
||
| 31 | 31 | use Symfony\Component\Console\Output\OutputInterface; |
| 32 | 32 | |
| 33 | 33 | class ListModules extends Base { |
| 34 | - /** @var IManager */ |
|
| 35 | - protected $encryptionManager; |
|
| 34 | + /** @var IManager */ |
|
| 35 | + protected $encryptionManager; |
|
| 36 | 36 | |
| 37 | - /** @var IConfig */ |
|
| 38 | - protected $config; |
|
| 37 | + /** @var IConfig */ |
|
| 38 | + protected $config; |
|
| 39 | 39 | |
| 40 | - /** |
|
| 41 | - * @param IManager $encryptionManager |
|
| 42 | - * @param IConfig $config |
|
| 43 | - */ |
|
| 44 | - public function __construct( |
|
| 45 | - IManager $encryptionManager, |
|
| 46 | - IConfig $config |
|
| 47 | - ) { |
|
| 48 | - parent::__construct(); |
|
| 49 | - $this->encryptionManager = $encryptionManager; |
|
| 50 | - $this->config = $config; |
|
| 51 | - } |
|
| 40 | + /** |
|
| 41 | + * @param IManager $encryptionManager |
|
| 42 | + * @param IConfig $config |
|
| 43 | + */ |
|
| 44 | + public function __construct( |
|
| 45 | + IManager $encryptionManager, |
|
| 46 | + IConfig $config |
|
| 47 | + ) { |
|
| 48 | + parent::__construct(); |
|
| 49 | + $this->encryptionManager = $encryptionManager; |
|
| 50 | + $this->config = $config; |
|
| 51 | + } |
|
| 52 | 52 | |
| 53 | - protected function configure() { |
|
| 54 | - parent::configure(); |
|
| 53 | + protected function configure() { |
|
| 54 | + parent::configure(); |
|
| 55 | 55 | |
| 56 | - $this |
|
| 57 | - ->setName('encryption:list-modules') |
|
| 58 | - ->setDescription('List all available encryption modules') |
|
| 59 | - ; |
|
| 60 | - } |
|
| 56 | + $this |
|
| 57 | + ->setName('encryption:list-modules') |
|
| 58 | + ->setDescription('List all available encryption modules') |
|
| 59 | + ; |
|
| 60 | + } |
|
| 61 | 61 | |
| 62 | - protected function execute(InputInterface $input, OutputInterface $output): int { |
|
| 63 | - $isMaintenanceModeEnabled = $this->config->getSystemValue('maintenance', false); |
|
| 64 | - if ($isMaintenanceModeEnabled) { |
|
| 65 | - $output->writeln("Maintenance mode must be disabled when listing modules"); |
|
| 66 | - $output->writeln("in order to list the relevant encryption modules correctly."); |
|
| 67 | - return 1; |
|
| 68 | - } |
|
| 62 | + protected function execute(InputInterface $input, OutputInterface $output): int { |
|
| 63 | + $isMaintenanceModeEnabled = $this->config->getSystemValue('maintenance', false); |
|
| 64 | + if ($isMaintenanceModeEnabled) { |
|
| 65 | + $output->writeln("Maintenance mode must be disabled when listing modules"); |
|
| 66 | + $output->writeln("in order to list the relevant encryption modules correctly."); |
|
| 67 | + return 1; |
|
| 68 | + } |
|
| 69 | 69 | |
| 70 | - $encryptionModules = $this->encryptionManager->getEncryptionModules(); |
|
| 71 | - $defaultEncryptionModuleId = $this->encryptionManager->getDefaultEncryptionModuleId(); |
|
| 70 | + $encryptionModules = $this->encryptionManager->getEncryptionModules(); |
|
| 71 | + $defaultEncryptionModuleId = $this->encryptionManager->getDefaultEncryptionModuleId(); |
|
| 72 | 72 | |
| 73 | - $encModules = []; |
|
| 74 | - foreach ($encryptionModules as $module) { |
|
| 75 | - $encModules[$module['id']]['displayName'] = $module['displayName']; |
|
| 76 | - $encModules[$module['id']]['default'] = $module['id'] === $defaultEncryptionModuleId; |
|
| 77 | - } |
|
| 78 | - $this->writeModuleList($input, $output, $encModules); |
|
| 79 | - return 0; |
|
| 80 | - } |
|
| 73 | + $encModules = []; |
|
| 74 | + foreach ($encryptionModules as $module) { |
|
| 75 | + $encModules[$module['id']]['displayName'] = $module['displayName']; |
|
| 76 | + $encModules[$module['id']]['default'] = $module['id'] === $defaultEncryptionModuleId; |
|
| 77 | + } |
|
| 78 | + $this->writeModuleList($input, $output, $encModules); |
|
| 79 | + return 0; |
|
| 80 | + } |
|
| 81 | 81 | |
| 82 | - /** |
|
| 83 | - * @param InputInterface $input |
|
| 84 | - * @param OutputInterface $output |
|
| 85 | - * @param array $items |
|
| 86 | - */ |
|
| 87 | - protected function writeModuleList(InputInterface $input, OutputInterface $output, $items) { |
|
| 88 | - if ($input->getOption('output') === self::OUTPUT_FORMAT_PLAIN) { |
|
| 89 | - array_walk($items, function (&$item) { |
|
| 90 | - if (!$item['default']) { |
|
| 91 | - $item = $item['displayName']; |
|
| 92 | - } else { |
|
| 93 | - $item = $item['displayName'] . ' [default*]'; |
|
| 94 | - } |
|
| 95 | - }); |
|
| 96 | - } |
|
| 82 | + /** |
|
| 83 | + * @param InputInterface $input |
|
| 84 | + * @param OutputInterface $output |
|
| 85 | + * @param array $items |
|
| 86 | + */ |
|
| 87 | + protected function writeModuleList(InputInterface $input, OutputInterface $output, $items) { |
|
| 88 | + if ($input->getOption('output') === self::OUTPUT_FORMAT_PLAIN) { |
|
| 89 | + array_walk($items, function (&$item) { |
|
| 90 | + if (!$item['default']) { |
|
| 91 | + $item = $item['displayName']; |
|
| 92 | + } else { |
|
| 93 | + $item = $item['displayName'] . ' [default*]'; |
|
| 94 | + } |
|
| 95 | + }); |
|
| 96 | + } |
|
| 97 | 97 | |
| 98 | - $this->writeArrayInOutputFormat($input, $output, $items); |
|
| 99 | - } |
|
| 98 | + $this->writeArrayInOutputFormat($input, $output, $items); |
|
| 99 | + } |
|
| 100 | 100 | } |
@@ -16,8 +16,11 @@ |
||
| 16 | 16 | <?php if ($error): ?> |
| 17 | 17 | <?php if ($error_message): ?> |
| 18 | 18 | <p><strong><?php p($error_message); ?></strong></p> |
| 19 | - <?php else: ?> |
|
| 20 | - <p><strong><?php p($l->t('Error while validating your second factor')); ?></strong></p> |
|
| 19 | + <?php else { |
|
| 20 | + : ?> |
|
| 21 | + <p><strong><?php p($l->t('Error while validating your second factor')); |
|
| 22 | +} |
|
| 23 | +?></strong></p> |
|
| 21 | 24 | <?php endif; ?> |
| 22 | 25 | <?php endif; ?> |
| 23 | 26 | <?php print_unescaped($template); ?> |
@@ -24,11 +24,11 @@ |
||
| 24 | 24 | <?php if (!is_null($_['backupProvider'])): ?> |
| 25 | 25 | <p> |
| 26 | 26 | <a class="two-factor-secondary" href="<?php p(\OC::$server->getURLGenerator()->linkToRoute('core.TwoFactorChallenge.showChallenge', |
| 27 | - [ |
|
| 28 | - 'challengeProviderId' => $_['backupProvider']->getId(), |
|
| 29 | - 'redirect_url' => $_['redirect_url'], |
|
| 30 | - ] |
|
| 31 | - )) ?>"> |
|
| 27 | + [ |
|
| 28 | + 'challengeProviderId' => $_['backupProvider']->getId(), |
|
| 29 | + 'redirect_url' => $_['redirect_url'], |
|
| 30 | + ] |
|
| 31 | + )) ?>"> |
|
| 32 | 32 | <?php p($l->t('Use backup code')) ?> |
| 33 | 33 | </a> |
| 34 | 34 | </p> |
@@ -29,7 +29,7 @@ |
||
| 29 | 29 | <?php p($theme->getName()); ?> |
| 30 | 30 | </h1> |
| 31 | 31 | <?php if (\OC::$server->getConfig()->getSystemValue('installed', false) |
| 32 | - && \OC::$server->getConfig()->getAppValue('theming', 'logoMime', false)): ?> |
|
| 32 | + && \OC::$server->getConfig()->getAppValue('theming', 'logoMime', false)): ?> |
|
| 33 | 33 | <img src="<?php p($theme->getLogo()); ?>"/> |
| 34 | 34 | <?php endif; ?> |
| 35 | 35 | </div> |
@@ -23,7 +23,7 @@ |
||
| 23 | 23 | <?php emit_script_loading_tags($_); ?> |
| 24 | 24 | <?php print_unescaped($_['headers']); ?> |
| 25 | 25 | </head> |
| 26 | - <body id="<?php p($_['bodyid']);?>"> |
|
| 26 | + <body id="<?php p($_['bodyid']); ?>"> |
|
| 27 | 27 | <?php include 'layout.noscript.warning.php'; ?> |
| 28 | 28 | <?php foreach ($_['initialStates'] as $app => $initialState) { ?> |
| 29 | 29 | <input type="hidden" id="initial-state-<?php p($app); ?>" value="<?php p(base64_encode($initialState)); ?>"> |
@@ -147,7 +147,7 @@ discard block |
||
| 147 | 147 | public function castColumn($column, $type) { |
| 148 | 148 | if ($type === IQueryBuilder::PARAM_STR) { |
| 149 | 149 | $column = $this->helper->quoteColumnName($column); |
| 150 | - return new QueryFunction('to_char(' . $column . ')'); |
|
| 150 | + return new QueryFunction('to_char('.$column.')'); |
|
| 151 | 151 | } |
| 152 | 152 | |
| 153 | 153 | return parent::castColumn($column, $type); |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | * @inheritdoc |
| 158 | 158 | */ |
| 159 | 159 | public function like($x, $y, $type = null) { |
| 160 | - return parent::like($x, $y, $type) . " ESCAPE '\\'"; |
|
| 160 | + return parent::like($x, $y, $type)." ESCAPE '\\'"; |
|
| 161 | 161 | } |
| 162 | 162 | |
| 163 | 163 | /** |
@@ -166,6 +166,6 @@ discard block |
||
| 166 | 166 | public function iLike($x, $y, $type = null) { |
| 167 | 167 | $x = $this->helper->quoteColumnName($x); |
| 168 | 168 | $y = $this->helper->quoteColumnName($y); |
| 169 | - return new QueryFunction('REGEXP_LIKE(' . $x . ', \'^\' || REPLACE(REPLACE(' . $y . ', \'%\', \'.*\'), \'_\', \'.\') || \'$\', \'i\')'); |
|
| 169 | + return new QueryFunction('REGEXP_LIKE('.$x.', \'^\' || REPLACE(REPLACE('.$y.', \'%\', \'.*\'), \'_\', \'.\') || \'$\', \'i\')'); |
|
| 170 | 170 | } |
| 171 | 171 | } |
@@ -33,161 +33,161 @@ |
||
| 33 | 33 | |
| 34 | 34 | class OCIExpressionBuilder extends ExpressionBuilder { |
| 35 | 35 | |
| 36 | - /** |
|
| 37 | - * @param mixed $column |
|
| 38 | - * @param mixed|null $type |
|
| 39 | - * @return array|IQueryFunction|string |
|
| 40 | - */ |
|
| 41 | - protected function prepareColumn($column, $type) { |
|
| 42 | - if ($type === IQueryBuilder::PARAM_STR && !is_array($column) && !($column instanceof IParameter) && !($column instanceof ILiteral)) { |
|
| 43 | - $column = $this->castColumn($column, $type); |
|
| 44 | - } else { |
|
| 45 | - $column = $this->helper->quoteColumnNames($column); |
|
| 46 | - } |
|
| 47 | - return $column; |
|
| 48 | - } |
|
| 49 | - |
|
| 50 | - /** |
|
| 51 | - * @inheritdoc |
|
| 52 | - */ |
|
| 53 | - public function comparison($x, $operator, $y, $type = null) { |
|
| 54 | - $x = $this->prepareColumn($x, $type); |
|
| 55 | - $y = $this->prepareColumn($y, $type); |
|
| 56 | - |
|
| 57 | - return $this->expressionBuilder->comparison($x, $operator, $y); |
|
| 58 | - } |
|
| 59 | - |
|
| 60 | - /** |
|
| 61 | - * @inheritdoc |
|
| 62 | - */ |
|
| 63 | - public function eq($x, $y, $type = null) { |
|
| 64 | - $x = $this->prepareColumn($x, $type); |
|
| 65 | - $y = $this->prepareColumn($y, $type); |
|
| 66 | - |
|
| 67 | - return $this->expressionBuilder->eq($x, $y); |
|
| 68 | - } |
|
| 69 | - |
|
| 70 | - /** |
|
| 71 | - * @inheritdoc |
|
| 72 | - */ |
|
| 73 | - public function neq($x, $y, $type = null) { |
|
| 74 | - $x = $this->prepareColumn($x, $type); |
|
| 75 | - $y = $this->prepareColumn($y, $type); |
|
| 76 | - |
|
| 77 | - return $this->expressionBuilder->neq($x, $y); |
|
| 78 | - } |
|
| 79 | - |
|
| 80 | - /** |
|
| 81 | - * @inheritdoc |
|
| 82 | - */ |
|
| 83 | - public function lt($x, $y, $type = null) { |
|
| 84 | - $x = $this->prepareColumn($x, $type); |
|
| 85 | - $y = $this->prepareColumn($y, $type); |
|
| 86 | - |
|
| 87 | - return $this->expressionBuilder->lt($x, $y); |
|
| 88 | - } |
|
| 89 | - |
|
| 90 | - /** |
|
| 91 | - * @inheritdoc |
|
| 92 | - */ |
|
| 93 | - public function lte($x, $y, $type = null) { |
|
| 94 | - $x = $this->prepareColumn($x, $type); |
|
| 95 | - $y = $this->prepareColumn($y, $type); |
|
| 96 | - |
|
| 97 | - return $this->expressionBuilder->lte($x, $y); |
|
| 98 | - } |
|
| 99 | - |
|
| 100 | - /** |
|
| 101 | - * @inheritdoc |
|
| 102 | - */ |
|
| 103 | - public function gt($x, $y, $type = null) { |
|
| 104 | - $x = $this->prepareColumn($x, $type); |
|
| 105 | - $y = $this->prepareColumn($y, $type); |
|
| 106 | - |
|
| 107 | - return $this->expressionBuilder->gt($x, $y); |
|
| 108 | - } |
|
| 109 | - |
|
| 110 | - /** |
|
| 111 | - * @inheritdoc |
|
| 112 | - */ |
|
| 113 | - public function gte($x, $y, $type = null) { |
|
| 114 | - $x = $this->prepareColumn($x, $type); |
|
| 115 | - $y = $this->prepareColumn($y, $type); |
|
| 116 | - |
|
| 117 | - return $this->expressionBuilder->gte($x, $y); |
|
| 118 | - } |
|
| 119 | - |
|
| 120 | - /** |
|
| 121 | - * @inheritdoc |
|
| 122 | - */ |
|
| 123 | - public function in($x, $y, $type = null) { |
|
| 124 | - $x = $this->prepareColumn($x, $type); |
|
| 125 | - $y = $this->prepareColumn($y, $type); |
|
| 126 | - |
|
| 127 | - return $this->expressionBuilder->in($x, $y); |
|
| 128 | - } |
|
| 129 | - |
|
| 130 | - /** |
|
| 131 | - * @inheritdoc |
|
| 132 | - */ |
|
| 133 | - public function notIn($x, $y, $type = null) { |
|
| 134 | - $x = $this->prepareColumn($x, $type); |
|
| 135 | - $y = $this->prepareColumn($y, $type); |
|
| 136 | - |
|
| 137 | - return $this->expressionBuilder->notIn($x, $y); |
|
| 138 | - } |
|
| 139 | - |
|
| 140 | - /** |
|
| 141 | - * Creates a $x = '' statement, because Oracle needs a different check |
|
| 142 | - * |
|
| 143 | - * @param string $x The field in string format to be inspected by the comparison. |
|
| 144 | - * @return string |
|
| 145 | - * @since 13.0.0 |
|
| 146 | - */ |
|
| 147 | - public function emptyString($x) { |
|
| 148 | - return $this->isNull($x); |
|
| 149 | - } |
|
| 150 | - |
|
| 151 | - /** |
|
| 152 | - * Creates a `$x <> ''` statement, because Oracle needs a different check |
|
| 153 | - * |
|
| 154 | - * @param string $x The field in string format to be inspected by the comparison. |
|
| 155 | - * @return string |
|
| 156 | - * @since 13.0.0 |
|
| 157 | - */ |
|
| 158 | - public function nonEmptyString($x) { |
|
| 159 | - return $this->isNotNull($x); |
|
| 160 | - } |
|
| 161 | - |
|
| 162 | - /** |
|
| 163 | - * Returns a IQueryFunction that casts the column to the given type |
|
| 164 | - * |
|
| 165 | - * @param string $column |
|
| 166 | - * @param mixed $type One of IQueryBuilder::PARAM_* |
|
| 167 | - * @return IQueryFunction |
|
| 168 | - */ |
|
| 169 | - public function castColumn($column, $type) { |
|
| 170 | - if ($type === IQueryBuilder::PARAM_STR) { |
|
| 171 | - $column = $this->helper->quoteColumnName($column); |
|
| 172 | - return new QueryFunction('to_char(' . $column . ')'); |
|
| 173 | - } |
|
| 174 | - |
|
| 175 | - return parent::castColumn($column, $type); |
|
| 176 | - } |
|
| 177 | - |
|
| 178 | - /** |
|
| 179 | - * @inheritdoc |
|
| 180 | - */ |
|
| 181 | - public function like($x, $y, $type = null) { |
|
| 182 | - return parent::like($x, $y, $type) . " ESCAPE '\\'"; |
|
| 183 | - } |
|
| 184 | - |
|
| 185 | - /** |
|
| 186 | - * @inheritdoc |
|
| 187 | - */ |
|
| 188 | - public function iLike($x, $y, $type = null) { |
|
| 189 | - $x = $this->helper->quoteColumnName($x); |
|
| 190 | - $y = $this->helper->quoteColumnName($y); |
|
| 191 | - return new QueryFunction('REGEXP_LIKE(' . $x . ', \'^\' || REPLACE(REPLACE(' . $y . ', \'%\', \'.*\'), \'_\', \'.\') || \'$\', \'i\')'); |
|
| 192 | - } |
|
| 36 | + /** |
|
| 37 | + * @param mixed $column |
|
| 38 | + * @param mixed|null $type |
|
| 39 | + * @return array|IQueryFunction|string |
|
| 40 | + */ |
|
| 41 | + protected function prepareColumn($column, $type) { |
|
| 42 | + if ($type === IQueryBuilder::PARAM_STR && !is_array($column) && !($column instanceof IParameter) && !($column instanceof ILiteral)) { |
|
| 43 | + $column = $this->castColumn($column, $type); |
|
| 44 | + } else { |
|
| 45 | + $column = $this->helper->quoteColumnNames($column); |
|
| 46 | + } |
|
| 47 | + return $column; |
|
| 48 | + } |
|
| 49 | + |
|
| 50 | + /** |
|
| 51 | + * @inheritdoc |
|
| 52 | + */ |
|
| 53 | + public function comparison($x, $operator, $y, $type = null) { |
|
| 54 | + $x = $this->prepareColumn($x, $type); |
|
| 55 | + $y = $this->prepareColumn($y, $type); |
|
| 56 | + |
|
| 57 | + return $this->expressionBuilder->comparison($x, $operator, $y); |
|
| 58 | + } |
|
| 59 | + |
|
| 60 | + /** |
|
| 61 | + * @inheritdoc |
|
| 62 | + */ |
|
| 63 | + public function eq($x, $y, $type = null) { |
|
| 64 | + $x = $this->prepareColumn($x, $type); |
|
| 65 | + $y = $this->prepareColumn($y, $type); |
|
| 66 | + |
|
| 67 | + return $this->expressionBuilder->eq($x, $y); |
|
| 68 | + } |
|
| 69 | + |
|
| 70 | + /** |
|
| 71 | + * @inheritdoc |
|
| 72 | + */ |
|
| 73 | + public function neq($x, $y, $type = null) { |
|
| 74 | + $x = $this->prepareColumn($x, $type); |
|
| 75 | + $y = $this->prepareColumn($y, $type); |
|
| 76 | + |
|
| 77 | + return $this->expressionBuilder->neq($x, $y); |
|
| 78 | + } |
|
| 79 | + |
|
| 80 | + /** |
|
| 81 | + * @inheritdoc |
|
| 82 | + */ |
|
| 83 | + public function lt($x, $y, $type = null) { |
|
| 84 | + $x = $this->prepareColumn($x, $type); |
|
| 85 | + $y = $this->prepareColumn($y, $type); |
|
| 86 | + |
|
| 87 | + return $this->expressionBuilder->lt($x, $y); |
|
| 88 | + } |
|
| 89 | + |
|
| 90 | + /** |
|
| 91 | + * @inheritdoc |
|
| 92 | + */ |
|
| 93 | + public function lte($x, $y, $type = null) { |
|
| 94 | + $x = $this->prepareColumn($x, $type); |
|
| 95 | + $y = $this->prepareColumn($y, $type); |
|
| 96 | + |
|
| 97 | + return $this->expressionBuilder->lte($x, $y); |
|
| 98 | + } |
|
| 99 | + |
|
| 100 | + /** |
|
| 101 | + * @inheritdoc |
|
| 102 | + */ |
|
| 103 | + public function gt($x, $y, $type = null) { |
|
| 104 | + $x = $this->prepareColumn($x, $type); |
|
| 105 | + $y = $this->prepareColumn($y, $type); |
|
| 106 | + |
|
| 107 | + return $this->expressionBuilder->gt($x, $y); |
|
| 108 | + } |
|
| 109 | + |
|
| 110 | + /** |
|
| 111 | + * @inheritdoc |
|
| 112 | + */ |
|
| 113 | + public function gte($x, $y, $type = null) { |
|
| 114 | + $x = $this->prepareColumn($x, $type); |
|
| 115 | + $y = $this->prepareColumn($y, $type); |
|
| 116 | + |
|
| 117 | + return $this->expressionBuilder->gte($x, $y); |
|
| 118 | + } |
|
| 119 | + |
|
| 120 | + /** |
|
| 121 | + * @inheritdoc |
|
| 122 | + */ |
|
| 123 | + public function in($x, $y, $type = null) { |
|
| 124 | + $x = $this->prepareColumn($x, $type); |
|
| 125 | + $y = $this->prepareColumn($y, $type); |
|
| 126 | + |
|
| 127 | + return $this->expressionBuilder->in($x, $y); |
|
| 128 | + } |
|
| 129 | + |
|
| 130 | + /** |
|
| 131 | + * @inheritdoc |
|
| 132 | + */ |
|
| 133 | + public function notIn($x, $y, $type = null) { |
|
| 134 | + $x = $this->prepareColumn($x, $type); |
|
| 135 | + $y = $this->prepareColumn($y, $type); |
|
| 136 | + |
|
| 137 | + return $this->expressionBuilder->notIn($x, $y); |
|
| 138 | + } |
|
| 139 | + |
|
| 140 | + /** |
|
| 141 | + * Creates a $x = '' statement, because Oracle needs a different check |
|
| 142 | + * |
|
| 143 | + * @param string $x The field in string format to be inspected by the comparison. |
|
| 144 | + * @return string |
|
| 145 | + * @since 13.0.0 |
|
| 146 | + */ |
|
| 147 | + public function emptyString($x) { |
|
| 148 | + return $this->isNull($x); |
|
| 149 | + } |
|
| 150 | + |
|
| 151 | + /** |
|
| 152 | + * Creates a `$x <> ''` statement, because Oracle needs a different check |
|
| 153 | + * |
|
| 154 | + * @param string $x The field in string format to be inspected by the comparison. |
|
| 155 | + * @return string |
|
| 156 | + * @since 13.0.0 |
|
| 157 | + */ |
|
| 158 | + public function nonEmptyString($x) { |
|
| 159 | + return $this->isNotNull($x); |
|
| 160 | + } |
|
| 161 | + |
|
| 162 | + /** |
|
| 163 | + * Returns a IQueryFunction that casts the column to the given type |
|
| 164 | + * |
|
| 165 | + * @param string $column |
|
| 166 | + * @param mixed $type One of IQueryBuilder::PARAM_* |
|
| 167 | + * @return IQueryFunction |
|
| 168 | + */ |
|
| 169 | + public function castColumn($column, $type) { |
|
| 170 | + if ($type === IQueryBuilder::PARAM_STR) { |
|
| 171 | + $column = $this->helper->quoteColumnName($column); |
|
| 172 | + return new QueryFunction('to_char(' . $column . ')'); |
|
| 173 | + } |
|
| 174 | + |
|
| 175 | + return parent::castColumn($column, $type); |
|
| 176 | + } |
|
| 177 | + |
|
| 178 | + /** |
|
| 179 | + * @inheritdoc |
|
| 180 | + */ |
|
| 181 | + public function like($x, $y, $type = null) { |
|
| 182 | + return parent::like($x, $y, $type) . " ESCAPE '\\'"; |
|
| 183 | + } |
|
| 184 | + |
|
| 185 | + /** |
|
| 186 | + * @inheritdoc |
|
| 187 | + */ |
|
| 188 | + public function iLike($x, $y, $type = null) { |
|
| 189 | + $x = $this->helper->quoteColumnName($x); |
|
| 190 | + $y = $this->helper->quoteColumnName($y); |
|
| 191 | + return new QueryFunction('REGEXP_LIKE(' . $x . ', \'^\' || REPLACE(REPLACE(' . $y . ', \'%\', \'.*\'), \'_\', \'.\') || \'$\', \'i\')'); |
|
| 192 | + } |
|
| 193 | 193 | } |
@@ -197,7 +197,7 @@ |
||
| 197 | 197 | } catch (NotFoundException $e) { |
| 198 | 198 | return new DataResponse( |
| 199 | 199 | [ |
| 200 | - 'message' => (string)$this->l10n->t('Storage with ID "%d" not found', [$id]) |
|
| 200 | + 'message' => (string) $this->l10n->t('Storage with ID "%d" not found', [$id]) |
|
| 201 | 201 | ], |
| 202 | 202 | Http::STATUS_NOT_FOUND |
| 203 | 203 | ); |
@@ -40,148 +40,148 @@ |
||
| 40 | 40 | * Global storages controller |
| 41 | 41 | */ |
| 42 | 42 | class GlobalStoragesController extends StoragesController { |
| 43 | - /** |
|
| 44 | - * Creates a new global storages controller. |
|
| 45 | - * |
|
| 46 | - * @param string $AppName application name |
|
| 47 | - * @param IRequest $request request object |
|
| 48 | - * @param IL10N $l10n l10n service |
|
| 49 | - * @param GlobalStoragesService $globalStoragesService storage service |
|
| 50 | - * @param ILogger $logger |
|
| 51 | - */ |
|
| 52 | - public function __construct( |
|
| 53 | - $AppName, |
|
| 54 | - IRequest $request, |
|
| 55 | - IL10N $l10n, |
|
| 56 | - GlobalStoragesService $globalStoragesService, |
|
| 57 | - ILogger $logger |
|
| 58 | - ) { |
|
| 59 | - parent::__construct( |
|
| 60 | - $AppName, |
|
| 61 | - $request, |
|
| 62 | - $l10n, |
|
| 63 | - $globalStoragesService, |
|
| 64 | - $logger |
|
| 65 | - ); |
|
| 66 | - } |
|
| 43 | + /** |
|
| 44 | + * Creates a new global storages controller. |
|
| 45 | + * |
|
| 46 | + * @param string $AppName application name |
|
| 47 | + * @param IRequest $request request object |
|
| 48 | + * @param IL10N $l10n l10n service |
|
| 49 | + * @param GlobalStoragesService $globalStoragesService storage service |
|
| 50 | + * @param ILogger $logger |
|
| 51 | + */ |
|
| 52 | + public function __construct( |
|
| 53 | + $AppName, |
|
| 54 | + IRequest $request, |
|
| 55 | + IL10N $l10n, |
|
| 56 | + GlobalStoragesService $globalStoragesService, |
|
| 57 | + ILogger $logger |
|
| 58 | + ) { |
|
| 59 | + parent::__construct( |
|
| 60 | + $AppName, |
|
| 61 | + $request, |
|
| 62 | + $l10n, |
|
| 63 | + $globalStoragesService, |
|
| 64 | + $logger |
|
| 65 | + ); |
|
| 66 | + } |
|
| 67 | 67 | |
| 68 | - /** |
|
| 69 | - * Create an external storage entry. |
|
| 70 | - * |
|
| 71 | - * @param string $mountPoint storage mount point |
|
| 72 | - * @param string $backend backend identifier |
|
| 73 | - * @param string $authMechanism authentication mechanism identifier |
|
| 74 | - * @param array $backendOptions backend-specific options |
|
| 75 | - * @param array $mountOptions mount-specific options |
|
| 76 | - * @param array $applicableUsers users for which to mount the storage |
|
| 77 | - * @param array $applicableGroups groups for which to mount the storage |
|
| 78 | - * @param int $priority priority |
|
| 79 | - * |
|
| 80 | - * @return DataResponse |
|
| 81 | - */ |
|
| 82 | - public function create( |
|
| 83 | - $mountPoint, |
|
| 84 | - $backend, |
|
| 85 | - $authMechanism, |
|
| 86 | - $backendOptions, |
|
| 87 | - $mountOptions, |
|
| 88 | - $applicableUsers, |
|
| 89 | - $applicableGroups, |
|
| 90 | - $priority |
|
| 91 | - ) { |
|
| 92 | - $newStorage = $this->createStorage( |
|
| 93 | - $mountPoint, |
|
| 94 | - $backend, |
|
| 95 | - $authMechanism, |
|
| 96 | - $backendOptions, |
|
| 97 | - $mountOptions, |
|
| 98 | - $applicableUsers, |
|
| 99 | - $applicableGroups, |
|
| 100 | - $priority |
|
| 101 | - ); |
|
| 102 | - if ($newStorage instanceof DataResponse) { |
|
| 103 | - return $newStorage; |
|
| 104 | - } |
|
| 68 | + /** |
|
| 69 | + * Create an external storage entry. |
|
| 70 | + * |
|
| 71 | + * @param string $mountPoint storage mount point |
|
| 72 | + * @param string $backend backend identifier |
|
| 73 | + * @param string $authMechanism authentication mechanism identifier |
|
| 74 | + * @param array $backendOptions backend-specific options |
|
| 75 | + * @param array $mountOptions mount-specific options |
|
| 76 | + * @param array $applicableUsers users for which to mount the storage |
|
| 77 | + * @param array $applicableGroups groups for which to mount the storage |
|
| 78 | + * @param int $priority priority |
|
| 79 | + * |
|
| 80 | + * @return DataResponse |
|
| 81 | + */ |
|
| 82 | + public function create( |
|
| 83 | + $mountPoint, |
|
| 84 | + $backend, |
|
| 85 | + $authMechanism, |
|
| 86 | + $backendOptions, |
|
| 87 | + $mountOptions, |
|
| 88 | + $applicableUsers, |
|
| 89 | + $applicableGroups, |
|
| 90 | + $priority |
|
| 91 | + ) { |
|
| 92 | + $newStorage = $this->createStorage( |
|
| 93 | + $mountPoint, |
|
| 94 | + $backend, |
|
| 95 | + $authMechanism, |
|
| 96 | + $backendOptions, |
|
| 97 | + $mountOptions, |
|
| 98 | + $applicableUsers, |
|
| 99 | + $applicableGroups, |
|
| 100 | + $priority |
|
| 101 | + ); |
|
| 102 | + if ($newStorage instanceof DataResponse) { |
|
| 103 | + return $newStorage; |
|
| 104 | + } |
|
| 105 | 105 | |
| 106 | - $response = $this->validate($newStorage); |
|
| 107 | - if (!empty($response)) { |
|
| 108 | - return $response; |
|
| 109 | - } |
|
| 106 | + $response = $this->validate($newStorage); |
|
| 107 | + if (!empty($response)) { |
|
| 108 | + return $response; |
|
| 109 | + } |
|
| 110 | 110 | |
| 111 | - $newStorage = $this->service->addStorage($newStorage); |
|
| 111 | + $newStorage = $this->service->addStorage($newStorage); |
|
| 112 | 112 | |
| 113 | - $this->updateStorageStatus($newStorage); |
|
| 113 | + $this->updateStorageStatus($newStorage); |
|
| 114 | 114 | |
| 115 | - return new DataResponse( |
|
| 116 | - $this->formatStorageForUI($newStorage), |
|
| 117 | - Http::STATUS_CREATED |
|
| 118 | - ); |
|
| 119 | - } |
|
| 115 | + return new DataResponse( |
|
| 116 | + $this->formatStorageForUI($newStorage), |
|
| 117 | + Http::STATUS_CREATED |
|
| 118 | + ); |
|
| 119 | + } |
|
| 120 | 120 | |
| 121 | - /** |
|
| 122 | - * Update an external storage entry. |
|
| 123 | - * |
|
| 124 | - * @param int $id storage id |
|
| 125 | - * @param string $mountPoint storage mount point |
|
| 126 | - * @param string $backend backend identifier |
|
| 127 | - * @param string $authMechanism authentication mechansim identifier |
|
| 128 | - * @param array $backendOptions backend-specific options |
|
| 129 | - * @param array $mountOptions mount-specific options |
|
| 130 | - * @param array $applicableUsers users for which to mount the storage |
|
| 131 | - * @param array $applicableGroups groups for which to mount the storage |
|
| 132 | - * @param int $priority priority |
|
| 133 | - * @param bool $testOnly whether to storage should only test the connection or do more things |
|
| 134 | - * |
|
| 135 | - * @return DataResponse |
|
| 136 | - */ |
|
| 137 | - public function update( |
|
| 138 | - $id, |
|
| 139 | - $mountPoint, |
|
| 140 | - $backend, |
|
| 141 | - $authMechanism, |
|
| 142 | - $backendOptions, |
|
| 143 | - $mountOptions, |
|
| 144 | - $applicableUsers, |
|
| 145 | - $applicableGroups, |
|
| 146 | - $priority, |
|
| 147 | - $testOnly = true |
|
| 148 | - ) { |
|
| 149 | - $storage = $this->createStorage( |
|
| 150 | - $mountPoint, |
|
| 151 | - $backend, |
|
| 152 | - $authMechanism, |
|
| 153 | - $backendOptions, |
|
| 154 | - $mountOptions, |
|
| 155 | - $applicableUsers, |
|
| 156 | - $applicableGroups, |
|
| 157 | - $priority |
|
| 158 | - ); |
|
| 159 | - if ($storage instanceof DataResponse) { |
|
| 160 | - return $storage; |
|
| 161 | - } |
|
| 162 | - $storage->setId($id); |
|
| 121 | + /** |
|
| 122 | + * Update an external storage entry. |
|
| 123 | + * |
|
| 124 | + * @param int $id storage id |
|
| 125 | + * @param string $mountPoint storage mount point |
|
| 126 | + * @param string $backend backend identifier |
|
| 127 | + * @param string $authMechanism authentication mechansim identifier |
|
| 128 | + * @param array $backendOptions backend-specific options |
|
| 129 | + * @param array $mountOptions mount-specific options |
|
| 130 | + * @param array $applicableUsers users for which to mount the storage |
|
| 131 | + * @param array $applicableGroups groups for which to mount the storage |
|
| 132 | + * @param int $priority priority |
|
| 133 | + * @param bool $testOnly whether to storage should only test the connection or do more things |
|
| 134 | + * |
|
| 135 | + * @return DataResponse |
|
| 136 | + */ |
|
| 137 | + public function update( |
|
| 138 | + $id, |
|
| 139 | + $mountPoint, |
|
| 140 | + $backend, |
|
| 141 | + $authMechanism, |
|
| 142 | + $backendOptions, |
|
| 143 | + $mountOptions, |
|
| 144 | + $applicableUsers, |
|
| 145 | + $applicableGroups, |
|
| 146 | + $priority, |
|
| 147 | + $testOnly = true |
|
| 148 | + ) { |
|
| 149 | + $storage = $this->createStorage( |
|
| 150 | + $mountPoint, |
|
| 151 | + $backend, |
|
| 152 | + $authMechanism, |
|
| 153 | + $backendOptions, |
|
| 154 | + $mountOptions, |
|
| 155 | + $applicableUsers, |
|
| 156 | + $applicableGroups, |
|
| 157 | + $priority |
|
| 158 | + ); |
|
| 159 | + if ($storage instanceof DataResponse) { |
|
| 160 | + return $storage; |
|
| 161 | + } |
|
| 162 | + $storage->setId($id); |
|
| 163 | 163 | |
| 164 | - $response = $this->validate($storage); |
|
| 165 | - if (!empty($response)) { |
|
| 166 | - return $response; |
|
| 167 | - } |
|
| 164 | + $response = $this->validate($storage); |
|
| 165 | + if (!empty($response)) { |
|
| 166 | + return $response; |
|
| 167 | + } |
|
| 168 | 168 | |
| 169 | - try { |
|
| 170 | - $storage = $this->service->updateStorage($storage); |
|
| 171 | - } catch (NotFoundException $e) { |
|
| 172 | - return new DataResponse( |
|
| 173 | - [ |
|
| 174 | - 'message' => (string)$this->l10n->t('Storage with ID "%d" not found', [$id]) |
|
| 175 | - ], |
|
| 176 | - Http::STATUS_NOT_FOUND |
|
| 177 | - ); |
|
| 178 | - } |
|
| 169 | + try { |
|
| 170 | + $storage = $this->service->updateStorage($storage); |
|
| 171 | + } catch (NotFoundException $e) { |
|
| 172 | + return new DataResponse( |
|
| 173 | + [ |
|
| 174 | + 'message' => (string)$this->l10n->t('Storage with ID "%d" not found', [$id]) |
|
| 175 | + ], |
|
| 176 | + Http::STATUS_NOT_FOUND |
|
| 177 | + ); |
|
| 178 | + } |
|
| 179 | 179 | |
| 180 | - $this->updateStorageStatus($storage, $testOnly); |
|
| 180 | + $this->updateStorageStatus($storage, $testOnly); |
|
| 181 | 181 | |
| 182 | - return new DataResponse( |
|
| 183 | - $this->formatStorageForUI($storage), |
|
| 184 | - Http::STATUS_OK |
|
| 185 | - ); |
|
| 186 | - } |
|
| 182 | + return new DataResponse( |
|
| 183 | + $this->formatStorageForUI($storage), |
|
| 184 | + Http::STATUS_OK |
|
| 185 | + ); |
|
| 186 | + } |
|
| 187 | 187 | } |
@@ -27,7 +27,7 @@ |
||
| 27 | 27 | * {@inheritDoc} |
| 28 | 28 | */ |
| 29 | 29 | public function getName() { |
| 30 | - return (string)$this->l10n->t('Education Edition'); |
|
| 30 | + return (string) $this->l10n->t('Education Edition'); |
|
| 31 | 31 | } |
| 32 | 32 | |
| 33 | 33 | /** |
@@ -25,24 +25,24 @@ |
||
| 25 | 25 | |
| 26 | 26 | class EducationBundle extends Bundle { |
| 27 | 27 | |
| 28 | - /** |
|
| 29 | - * {@inheritDoc} |
|
| 30 | - */ |
|
| 31 | - public function getName() { |
|
| 32 | - return (string)$this->l10n->t('Education Edition'); |
|
| 33 | - } |
|
| 28 | + /** |
|
| 29 | + * {@inheritDoc} |
|
| 30 | + */ |
|
| 31 | + public function getName() { |
|
| 32 | + return (string)$this->l10n->t('Education Edition'); |
|
| 33 | + } |
|
| 34 | 34 | |
| 35 | - /** |
|
| 36 | - * {@inheritDoc} |
|
| 37 | - */ |
|
| 38 | - public function getAppIdentifiers() { |
|
| 39 | - return [ |
|
| 40 | - 'dashboard', |
|
| 41 | - 'circles', |
|
| 42 | - 'groupfolders', |
|
| 43 | - 'announcementcenter', |
|
| 44 | - 'quota_warning', |
|
| 45 | - 'user_saml', |
|
| 46 | - ]; |
|
| 47 | - } |
|
| 35 | + /** |
|
| 36 | + * {@inheritDoc} |
|
| 37 | + */ |
|
| 38 | + public function getAppIdentifiers() { |
|
| 39 | + return [ |
|
| 40 | + 'dashboard', |
|
| 41 | + 'circles', |
|
| 42 | + 'groupfolders', |
|
| 43 | + 'announcementcenter', |
|
| 44 | + 'quota_warning', |
|
| 45 | + 'user_saml', |
|
| 46 | + ]; |
|
| 47 | + } |
|
| 48 | 48 | } |
@@ -24,7 +24,7 @@ |
||
| 24 | 24 | use OC\DB\QueryBuilder\QueryFunction; |
| 25 | 25 | |
| 26 | 26 | class PgSqlFunctionBuilder extends FunctionBuilder { |
| 27 | - public function concat($x, $y) { |
|
| 28 | - return new QueryFunction('(' . $this->helper->quoteColumnName($x) . ' || ' . $this->helper->quoteColumnName($y) . ')'); |
|
| 29 | - } |
|
| 27 | + public function concat($x, $y) { |
|
| 28 | + return new QueryFunction('(' . $this->helper->quoteColumnName($x) . ' || ' . $this->helper->quoteColumnName($y) . ')'); |
|
| 29 | + } |
|
| 30 | 30 | } |
@@ -25,6 +25,6 @@ |
||
| 25 | 25 | |
| 26 | 26 | class PgSqlFunctionBuilder extends FunctionBuilder { |
| 27 | 27 | public function concat($x, $y) { |
| 28 | - return new QueryFunction('(' . $this->helper->quoteColumnName($x) . ' || ' . $this->helper->quoteColumnName($y) . ')'); |
|
| 28 | + return new QueryFunction('('.$this->helper->quoteColumnName($x).' || '.$this->helper->quoteColumnName($y).')'); |
|
| 29 | 29 | } |
| 30 | 30 | } |
@@ -24,18 +24,18 @@ |
||
| 24 | 24 | use OCP\Files\ObjectStore\IObjectStore; |
| 25 | 25 | |
| 26 | 26 | class S3 implements IObjectStore { |
| 27 | - use S3ConnectionTrait; |
|
| 28 | - use S3ObjectTrait; |
|
| 27 | + use S3ConnectionTrait; |
|
| 28 | + use S3ObjectTrait; |
|
| 29 | 29 | |
| 30 | - public function __construct($parameters) { |
|
| 31 | - $this->parseParams($parameters); |
|
| 32 | - } |
|
| 30 | + public function __construct($parameters) { |
|
| 31 | + $this->parseParams($parameters); |
|
| 32 | + } |
|
| 33 | 33 | |
| 34 | - /** |
|
| 35 | - * @return string the container or bucket name where objects are stored |
|
| 36 | - * @since 7.0.0 |
|
| 37 | - */ |
|
| 38 | - public function getStorageId() { |
|
| 39 | - return $this->id; |
|
| 40 | - } |
|
| 34 | + /** |
|
| 35 | + * @return string the container or bucket name where objects are stored |
|
| 36 | + * @since 7.0.0 |
|
| 37 | + */ |
|
| 38 | + public function getStorageId() { |
|
| 39 | + return $this->id; |
|
| 40 | + } |
|
| 41 | 41 | } |