Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion IONOS
Submodule IONOS updated 1 files
+18 −7 configure.sh
5 changes: 4 additions & 1 deletion apps/files/lib/Controller/ViewController.php
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,10 @@ public function index($dir = '', $view = '', $fileid = null) {
$this->eventDispatcher->dispatchTyped(new LoadViewer());
}

$this->initialState->provideInitialState('templates_enabled', true);
// IONOS: templates folder creation is disabled by setting both skeletondirectory
// and templatedirectory to an empty string. Defaults mirror TemplateManager so
// that both halves agree on what "unconfigured" means.
$this->initialState->provideInitialState('templates_enabled', ($this->config->getSystemValueString('skeletondirectory', \OC::$SERVERROOT . '/core/skeleton') !== '') || ($this->config->getSystemValueString('templatedirectory', \OC::$SERVERROOT . '/core/skeleton/Templates') !== ''));
$this->initialState->provideInitialState('templates_path', $this->templateManager->hasTemplateDirectory() ? $this->templateManager->getTemplatePath() : false);
$this->initialState->provideInitialState('templates', $this->templateManager->listCreators());

Expand Down
26 changes: 22 additions & 4 deletions apps/files/lib/Service/UserConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
namespace OCA\Files\Service;

use OCA\Files\AppInfo\Application;
use OCP\AppFramework\Services\IAppConfig;
use OCP\IConfig;
use OCP\IUser;
use OCP\IUserSession;
Expand Down Expand Up @@ -85,6 +86,7 @@ class UserConfig {
public function __construct(
protected IConfig $config,
IUserSession $userSession,
protected IAppConfig $appConfig,
) {
$this->user = $userSession->getUser();
}
Expand Down Expand Up @@ -146,7 +148,12 @@ public function setConfig(string $key, $value): void {
throw new \InvalidArgumentException('Unknown config key');
}

if (!in_array($value, $this->getAllowedConfigValues($key))) {
$isBoolValue = filter_var($value, FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE);
if ($isBoolValue !== null) {
$value = $isBoolValue;
}

if (!in_array($value, $this->getAllowedConfigValues($key), true)) {
throw new \InvalidArgumentException('Invalid config value');
}

Expand All @@ -169,9 +176,20 @@ public function getConfigs(): array {

$userId = $this->user->getUID();
$userConfigs = array_map(function (string $key) use ($userId) {
$value = $this->config->getUserValue($userId, Application::APP_ID, $key, $this->getDefaultConfigValue($key));
// If the default is expected to be a boolean, we need to cast the value
if (is_bool($this->getDefaultConfigValue($key)) && is_string($value)) {
$default = $this->getDefaultConfigValue($key);
$value = $this->config->getUserValue($userId, Application::APP_ID, $key, null);

// The user has no explicit preference, so fall back to the instance-wide
// default an admin can set with `occ config:app:set files <key>`, which in
// turn falls back to the shipped default
if ($value === null) {
$value = is_bool($default)
? $this->appConfig->getAppValueBool($key, $default)
: $this->appConfig->getAppValueString($key, (string)$default);
}

// If the default value is expected to be a boolean, we need to cast the value
if (is_bool($default) && is_string($value)) {
return $value === '1';
}
return $value;
Expand Down
13 changes: 13 additions & 0 deletions apps/files_sharing/src/files_views/shares.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,15 @@ export const deletedSharesViewId = 'deletedshares'
export const pendingSharesViewId = 'pendingshares'
export const fileRequestViewId = 'filerequest'

/**
* Checks if share accept approval required by nextcloud configuration.
*
* @return True if share accept approval is required, otherwise false.
*/
function isShareAcceptApprovalRequired(): boolean {
return loadState('files_sharing', 'accept_default', false)
}

export default () => {
const Navigation = getNavigation()
Navigation.register(new View({
Expand Down Expand Up @@ -137,6 +146,10 @@ export default () => {
getContents: () => getContents(false, false, false, true),
}))

if (!isShareAcceptApprovalRequired()) {
return
}

Navigation.register(new View({
id: pendingSharesViewId,
name: t('files_sharing', 'Pending shares'),
Expand Down
10 changes: 9 additions & 1 deletion apps/settings/src/views/AdminSettingsMailServer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,14 @@ const initialConfig = loadState<{
}>('settings', 'settingsAdminMailConfig')
const mailConfig = ref({ ...initialConfig })

/**
* Mail delivery is turned off instance-wide via `mail_smtpmode` = "null".
* Checked against the raw config value rather than `smtpMode`, because "null"
* is deliberately not offered in `smtpModeOptions` and so never resolves to an
* option.
*/
const isMailDeliveryDisabled = computed(() => mailConfig.value.mail_smtpmode === 'null')

const smtpMode = computed({
get() {
return settingsAdminMail.smtpModeOptions.find((option) => option.id === mailConfig.value.mail_smtpmode)
Expand Down Expand Up @@ -137,7 +145,7 @@ async function onSubmit() {
{{ t('settings', 'The server configuration is read-only so the mail settings cannot be changed using the web interface.') }}
</NcNoteCard>

<NcNoteCard v-if="smtpMode?.id === 'null'" type="info">
<NcNoteCard v-if="isMailDeliveryDisabled" type="info">
{{ t('settings', 'Mail delivery is disabled by instance config "{config}".', { config: 'mail_smtpmode' }) }}
</NcNoteCard>

Expand Down
4 changes: 2 additions & 2 deletions dist/files_sharing-init.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/files_sharing-init.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/settings-vue-settings-admin-mail.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/settings-vue-settings-admin-mail.js.map

Large diffs are not rendered by default.

13 changes: 13 additions & 0 deletions lib/private/Authentication/Exceptions/UserAgentForbidden.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

/**
* SPDX-FileCopyrightText: 2025 STRATO GmbH
* SPDX-License-Identifier: AGPL-3.0-or-later
*/

namespace OC\Authentication\Exceptions;

use Exception;

class UserAgentForbidden extends Exception {
}
Loading