Code Duplication    Length = 7-7 lines in 2 locations

lib/Settings/Admin.php 1 location

@@ 100-106 (lines=7) @@
97
98
		$settingBatchTime = UserSettings::EMAIL_SEND_HOURLY;
99
		$currentSetting = (int) $this->userSettings->getConfigSetting('setting', 'batchtime');
100
		if ($currentSetting === 3600 * 24 * 7) {
101
			$settingBatchTime = UserSettings::EMAIL_SEND_WEEKLY;
102
		} else if ($currentSetting === 3600 * 24) {
103
			$settingBatchTime = UserSettings::EMAIL_SEND_DAILY;
104
		} else if ($currentSetting === 0) {
105
			$settingBatchTime = UserSettings::EMAIL_SEND_ASAP;
106
		}
107
108
		return new TemplateResponse('activity', 'settings/admin', [
109
			'setting'			=> 'admin',

lib/Settings/Personal.php 1 location

@@ 113-119 (lines=7) @@
110
111
		$settingBatchTime = UserSettings::EMAIL_SEND_HOURLY;
112
		$currentSetting = (int) $this->userSettings->getUserSetting($this->user, 'setting', 'batchtime');
113
		if ($currentSetting === 3600 * 24 * 7) {
114
			$settingBatchTime = UserSettings::EMAIL_SEND_WEEKLY;
115
		} else if ($currentSetting === 3600 * 24) {
116
			$settingBatchTime = UserSettings::EMAIL_SEND_DAILY;
117
		} else if ($currentSetting === 0) {
118
			$settingBatchTime = UserSettings::EMAIL_SEND_ASAP;
119
		}
120
121
		$emailEnabled = $this->config->getAppValue('activity', 'enable_email', 'yes') === 'yes';
122
		if ($emailEnabled) {