Code Duplication    Length = 4-6 lines in 3 locations

apps/encryption/lib/KeyManager.php 3 locations

@@ 128-133 (lines=6) @@
125
126
		$this->recoveryKeyId = $this->config->getAppValue('encryption',
127
			'recoveryKeyId');
128
		if (empty($this->recoveryKeyId)) {
129
			$this->recoveryKeyId = 'recoveryKey_' . substr(md5(time()), 0, 8);
130
			$this->config->setAppValue('encryption',
131
				'recoveryKeyId',
132
				$this->recoveryKeyId);
133
		}
134
135
		$this->publicShareKeyId = $this->config->getAppValue('encryption',
136
			'publicShareKeyId');
@@ 137-140 (lines=4) @@
134
135
		$this->publicShareKeyId = $this->config->getAppValue('encryption',
136
			'publicShareKeyId');
137
		if (empty($this->publicShareKeyId)) {
138
			$this->publicShareKeyId = 'pubShare_' . substr(md5(time()), 0, 8);
139
			$this->config->setAppValue('encryption', 'publicShareKeyId', $this->publicShareKeyId);
140
		}
141
142
		$this->masterKeyId = $this->config->getAppValue('encryption',
143
			'masterKeyId');
@@ 144-147 (lines=4) @@
141
142
		$this->masterKeyId = $this->config->getAppValue('encryption',
143
			'masterKeyId');
144
		if (empty($this->masterKeyId)) {
145
			$this->masterKeyId = 'master_' . substr(md5(time()), 0, 8);
146
			$this->config->setAppValue('encryption', 'masterKeyId', $this->masterKeyId);
147
		}
148
149
		$this->keyId = $userSession && $userSession->isLoggedIn() ? $userSession->getUser()->getUID() : false;
150
		$this->log = $log;