aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2023-10-23 12:31:51 +0200
committerJoas Schilling <coding@schilljs.com>2023-10-23 12:56:31 +0200
commitfd9f7a7188a9dd3f1d27001925336745c9d17bd4 (patch)
tree189fb72733a1b3bcbace29d8eb5ed3e94a262b7b
parent2353d3cd5c1bc01c7ae4da9cd1c341f795982686 (diff)
downloadnextcloud-server-fd9f7a7188a9dd3f1d27001925336745c9d17bd4.tar.gz
nextcloud-server-fd9f7a7188a9dd3f1d27001925336745c9d17bd4.zip
fix(profile): Directly migrate to OCP constants
Signed-off-by: Joas Schilling <coding@schilljs.com>
-rw-r--r--core/Db/ProfileConfig.php41
-rw-r--r--lib/private/Profile/ProfileManager.php8
2 files changed, 4 insertions, 45 deletions
diff --git a/core/Db/ProfileConfig.php b/core/Db/ProfileConfig.php
index ea0507df982..b399874adf4 100644
--- a/core/Db/ProfileConfig.php
+++ b/core/Db/ProfileConfig.php
@@ -26,7 +26,6 @@ declare(strict_types=1);
namespace OC\Core\Db;
-use OCP\Profile\IProfileManager;
use function Safe\json_decode;
use function Safe\json_encode;
use \JsonSerializable;
@@ -40,46 +39,6 @@ use OCP\Profile\ParameterDoesNotExistException;
* @method void setConfig(string $config)
*/
class ProfileConfig extends Entity implements JsonSerializable {
- /**
- * Visible to users, guests, and public access
- *
- * @since 23.0.0
- * @deprecated 28.0.0 Use {@see IProfileManager::VISIBILITY_SHOW} instead
- */
- public const VISIBILITY_SHOW = IProfileManager::VISIBILITY_SHOW;
-
- /**
- * Visible to users and guests
- *
- * @since 23.0.0
- * @deprecated 28.0.0 Use {@see IProfileManager::VISIBILITY_SHOW_USERS_ONLY} instead
- */
- public const VISIBILITY_SHOW_USERS_ONLY = IProfileManager::VISIBILITY_SHOW_USERS_ONLY;
-
- /**
- * Visible to nobody
- *
- * @since 23.0.0
- * @deprecated 28.0.0 Use {@see IProfileManager::VISIBILITY_HIDE} instead
- */
- public const VISIBILITY_HIDE = IProfileManager::VISIBILITY_HIDE;
-
- /**
- * Default account property visibility
- *
- * @since 23.0.0
- * @deprecated 28.0.0 Use {@see IProfileManager::DEFAULT_PROPERTY_VISIBILITY} instead
- */
- public const DEFAULT_PROPERTY_VISIBILITY = IProfileManager::DEFAULT_PROPERTY_VISIBILITY;
-
- /**
- * Default visibility
- *
- * @since 23.0.0
- * @deprecated 28.0.0 Use {@see IProfileManager::DEFAULT_VISIBILITY} instead
- */
- public const DEFAULT_VISIBILITY = IProfileManager::DEFAULT_VISIBILITY;
-
/** @var string */
protected $userId;
diff --git a/lib/private/Profile/ProfileManager.php b/lib/private/Profile/ProfileManager.php
index ed79b622a7c..39c51ea0e77 100644
--- a/lib/private/Profile/ProfileManager.php
+++ b/lib/private/Profile/ProfileManager.php
@@ -205,7 +205,7 @@ class ProfileManager implements IProfileManager {
$visibility = $this->getProfileConfig($targetUser, $visitingUser)[$profileField]['visibility'];
// Handle profile visibility and account property scope
- if ($visibility === ProfileConfig::VISIBILITY_SHOW_USERS_ONLY) {
+ if ($visibility === self::VISIBILITY_SHOW_USERS_ONLY) {
if (empty($scope)) {
return $visitingUser !== null;
}
@@ -219,7 +219,7 @@ class ProfileManager implements IProfileManager {
};
}
- if ($visibility === ProfileConfig::VISIBILITY_SHOW) {
+ if ($visibility === self::VISIBILITY_SHOW) {
if (empty($scope)) {
return true;
}
@@ -318,12 +318,12 @@ class ProfileManager implements IProfileManager {
// Construct the default config for actions
$actionsConfig = [];
foreach ($this->getActions($targetUser, $visitingUser) as $action) {
- $actionsConfig[$action->getId()] = ['visibility' => ProfileConfig::DEFAULT_VISIBILITY];
+ $actionsConfig[$action->getId()] = ['visibility' => self::DEFAULT_VISIBILITY];
}
// Construct the default config for account properties
$propertiesConfig = [];
- foreach (ProfileConfig::DEFAULT_PROPERTY_VISIBILITY as $property => $visibility) {
+ foreach (self::DEFAULT_PROPERTY_VISIBILITY as $property => $visibility) {
$propertiesConfig[$property] = ['visibility' => $visibility];
}