aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
Diffstat (limited to 'apps')
-rw-r--r--apps/files/lib/Controller/ApiController.php5
-rw-r--r--apps/files_external/lib/Service/DBConfigService.php46
-rw-r--r--apps/files_sharing/css/mobile.scss2
-rw-r--r--apps/files_sharing/css/public.scss2
-rw-r--r--apps/twofactor_backupcodes/appinfo/info.xml4
5 files changed, 33 insertions, 26 deletions
diff --git a/apps/files/lib/Controller/ApiController.php b/apps/files/lib/Controller/ApiController.php
index 3085b72ac7a..a967c8bd7bb 100644
--- a/apps/files/lib/Controller/ApiController.php
+++ b/apps/files/lib/Controller/ApiController.php
@@ -320,8 +320,9 @@ class ApiController extends Controller {
*
* @NoAdminRequired
*
- * @param String
- * @return String
+ * @param string
+ * @return string
+ * @throws \OCP\Files\NotFoundException
*/
public function getNodeType($folderpath) {
$node = $this->userFolder->get($folderpath);
diff --git a/apps/files_external/lib/Service/DBConfigService.php b/apps/files_external/lib/Service/DBConfigService.php
index c986acbaa5d..65995b21cc4 100644
--- a/apps/files_external/lib/Service/DBConfigService.php
+++ b/apps/files_external/lib/Service/DBConfigService.php
@@ -25,6 +25,7 @@
namespace OCA\Files_External\Service;
+use Doctrine\DBAL\Exception\UniqueConstraintViolationException;
use OCP\DB\QueryBuilder\IQueryBuilder;
use OCP\IDBConnection;
use OCP\Security\ICrypto;
@@ -300,12 +301,15 @@ class DBConfigService {
if ($key === 'password') {
$value = $this->encryptValue($value);
}
- $count = $this->connection->insertIfNotExist('*PREFIX*external_config', [
- 'mount_id' => $mountId,
- 'key' => $key,
- 'value' => $value
- ], ['mount_id', 'key']);
- if ($count === 0) {
+
+ try {
+ $builder = $this->connection->getQueryBuilder();
+ $builder->insert('external_config')
+ ->setValue('mount_id', $builder->createNamedParameter($mountId, IQueryBuilder::PARAM_INT))
+ ->setValue('key', $builder->createNamedParameter($key, IQueryBuilder::PARAM_STR))
+ ->setValue('value', $builder->createNamedParameter($value, IQueryBuilder::PARAM_STR))
+ ->execute();
+ } catch(UniqueConstraintViolationException $e) {
$builder = $this->connection->getQueryBuilder();
$query = $builder->update('external_config')
->set('value', $builder->createNamedParameter($value, IQueryBuilder::PARAM_STR))
@@ -321,13 +325,14 @@ class DBConfigService {
* @param string $value
*/
public function setOption($mountId, $key, $value) {
-
- $count = $this->connection->insertIfNotExist('*PREFIX*external_options', [
- 'mount_id' => $mountId,
- 'key' => $key,
- 'value' => json_encode($value)
- ], ['mount_id', 'key']);
- if ($count === 0) {
+ try {
+ $builder = $this->connection->getQueryBuilder();
+ $builder->insert('external_options')
+ ->setValue('mount_id', $builder->createNamedParameter($mountId, IQueryBuilder::PARAM_INT))
+ ->setValue('key', $builder->createNamedParameter($key, IQueryBuilder::PARAM_STR))
+ ->setValue('value', $builder->createNamedParameter(json_encode($value), IQueryBuilder::PARAM_STR))
+ ->execute();
+ } catch(UniqueConstraintViolationException $e) {
$builder = $this->connection->getQueryBuilder();
$query = $builder->update('external_options')
->set('value', $builder->createNamedParameter(json_encode($value), IQueryBuilder::PARAM_STR))
@@ -338,11 +343,16 @@ class DBConfigService {
}
public function addApplicable($mountId, $type, $value) {
- $this->connection->insertIfNotExist('*PREFIX*external_applicable', [
- 'mount_id' => $mountId,
- 'type' => $type,
- 'value' => $value
- ], ['mount_id', 'type', 'value']);
+ try {
+ $builder = $this->connection->getQueryBuilder();
+ $builder->insert('external_applicable')
+ ->setValue('mount_id', $builder->createNamedParameter($mountId))
+ ->setValue('type', $builder->createNamedParameter($type))
+ ->setValue('value', $builder->createNamedParameter($value))
+ ->execute();
+ } catch(UniqueConstraintViolationException $e) {
+ // applicable exists already
+ }
}
public function removeApplicable($mountId, $type, $value) {
diff --git a/apps/files_sharing/css/mobile.scss b/apps/files_sharing/css/mobile.scss
index 3aaa5718cab..0202fdd08d1 100644
--- a/apps/files_sharing/css/mobile.scss
+++ b/apps/files_sharing/css/mobile.scss
@@ -1,4 +1,4 @@
-@media only screen and (max-width: 768px) {
+@media only screen and (max-width: $breakpoint-mobile) {
/* make header scroll up for single shares, more view of content on small screens */
#header.share-file {
diff --git a/apps/files_sharing/css/public.scss b/apps/files_sharing/css/public.scss
index c31b4f82bed..9d752115c59 100644
--- a/apps/files_sharing/css/public.scss
+++ b/apps/files_sharing/css/public.scss
@@ -207,7 +207,7 @@ thead {
}
// hide the primary on public share on mobile
-@media only screen and (max-width: 768px) {
+@media only screen and (max-width: $breakpoint-mobile) {
#body-public {
.header-right {
#header-primary-action {
diff --git a/apps/twofactor_backupcodes/appinfo/info.xml b/apps/twofactor_backupcodes/appinfo/info.xml
index fd575ec12bb..b28f75254b6 100644
--- a/apps/twofactor_backupcodes/appinfo/info.xml
+++ b/apps/twofactor_backupcodes/appinfo/info.xml
@@ -26,10 +26,6 @@
<provider>OCA\TwoFactorBackupCodes\Provider\BackupCodesProvider</provider>
</two-factor-providers>
- <settings>
- <personal>OCA\TwoFactorBackupCodes\Settings\Personal</personal>
- </settings>
-
<activity>
<providers>
<provider>OCA\TwoFactorBackupCodes\Activity\Provider</provider>