Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8970e08b authored by Akhil's avatar Akhil 🙂
Browse files

Added appConfig

parent 4e1f4d4e
Loading
Loading
Loading
Loading
+21 −10
Original line number Diff line number Diff line
@@ -14,6 +14,9 @@ class UserService
    /** @var IUserManager */
    private $userManager;

    /** @var array */
    private $appConfig;

    /** @var IConfig */
    private $config;

@@ -25,12 +28,21 @@ class UserService
    {
        $this->userManager = $userManager;
        $this->config = $config;
        $this->appConfig = $this->config->getSystemValue($appName);
        $this->appName = $appName;
        $this->storage = $storage;
    }

    private function isShardingEnabled() : bool {
        $shardingEnabled = $this->config->getAppValue($this->appName, 'user_folder_sharding');
    private function getConfigValue(string $key) : string {
        if(array_key_exists($key, $this->appConfig)) {
            return $this->appConfig[$key];
        }
        return false;
    }

    private function isShardingEnabled(): bool
    {
        $shardingEnabled = $this->config->getSystemValue('user_folder_sharding', false);
        return $shardingEnabled;
    }

@@ -60,7 +72,7 @@ class UserService
            return true;
        }

        $realDataDir = $this->config->getAppValue($this->appName, 'realdatadirectory');
        $realDataDir = $this->getConfigValue('realdatadirectory');
        $ncDataDir = $this->config->getSystemValue('datadirectory');
        $ncUserFolder = $ncDataDir . '/' . $uid;

@@ -93,7 +105,6 @@ class UserService
                return false;
            }
            return true;
          
        } catch (Exception $e) {
            $this->logger->error("Error while creating user folder and linking for user: " . $uid);
            return false;