2021-10-14 04:19:40 -04:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
|
|
/**
|
2024-05-23 03:26:56 -04:00
|
|
|
* SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors
|
|
|
|
|
* SPDX-License-Identifier: AGPL-3.0-or-later
|
2021-10-14 04:19:40 -04:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
namespace OC\Profile;
|
|
|
|
|
|
2022-03-17 14:06:38 -04:00
|
|
|
use OCP\IConfig;
|
2021-10-14 04:19:40 -04:00
|
|
|
|
|
|
|
|
trait TProfileHelper {
|
2022-03-17 14:06:38 -04:00
|
|
|
protected function isProfileEnabledByDefault(IConfig $config): ?bool {
|
2021-10-14 04:19:40 -04:00
|
|
|
return filter_var(
|
2022-03-17 14:06:38 -04:00
|
|
|
$config->getAppValue('settings', 'profile_enabled_by_default', '1'),
|
2021-10-14 04:19:40 -04:00
|
|
|
FILTER_VALIDATE_BOOLEAN,
|
|
|
|
|
FILTER_NULL_ON_FAILURE,
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|