Code Duplication    Length = 4-4 lines in 2 locations

settings/Controller/UsersController.php 1 location

@@ 243-246 (lines=4) @@
240
		}
241
242
		$splittedToken = explode(':', $this->config->getUserValue($userId, 'owncloud', 'changeMail', null));
243
		if(count($splittedToken) !== 3) {
244
			$this->config->deleteUserValue($userId, 'owncloud', 'changeMail');
245
			throw new \Exception($this->l10n->t('Couldn\'t change the email address because the token is invalid'));
246
		}
247
248
		if ($splittedToken[0] < ($this->timeFactory->getTime() - 60*60*12)) {
249
			$this->config->deleteUserValue($userId, 'owncloud', 'changeMail');

core/Controller/LostController.php 1 location

@@ 166-169 (lines=4) @@
163
		$user = $this->userManager->get($userId);
164
165
		$splittedToken = explode(':', $this->config->getUserValue($userId, 'owncloud', 'lostpassword', null));
166
		if(count($splittedToken) !== 2) {
167
			$this->config->deleteUserValue($userId, 'owncloud', 'lostpassword');
168
			throw new \Exception($this->l10n->t('Could not reset password because the token is invalid'));
169
		}
170
171
		if ($splittedToken[0] < ($this->timeFactory->getTime() - 60*60*12) ||
172
			$user->getLastLogin() > $splittedToken[0]) {