Code Duplication    Length = 13-15 lines in 3 locations

settings/Controller/LegalSettingsController.php 2 locations

@@ 66-80 (lines=15) @@
63
	 *
64
	 * @return array
65
	 */
66
	public function setImprintUrl($imprintUrl) {
67
		$this->config->setAppValue(
68
			'core',
69
			'legal.imprint_url',
70
			$imprintUrl
71
		);
72
73
		return [
74
			'data' =>
75
				[
76
					'message' => (string) $this->l10n->t('Saved')
77
				],
78
			'status' => 'success'
79
		];
80
	}
81
82
	/**
83
	 * Store privacy policy URL
@@ 89-103 (lines=15) @@
86
	 *
87
	 * @return array
88
	 */
89
	public function setPrivacyPolicyUrl($privacyPolicy) {
90
		$this->config->setAppValue(
91
			'core',
92
			'legal.privacy_policy_url',
93
			$privacyPolicy
94
		);
95
96
		return [
97
			'data' =>
98
				[
99
					'message' => (string) $this->l10n->t('Saved')
100
				],
101
			'status' => 'success'
102
		];
103
	}
104
}
105

settings/Controller/MailSettingsController.php 1 location

@@ 137-149 (lines=13) @@
134
	 * @param string $mail_smtppassword
135
	 * @return array
136
	 */
137
	public function storeCredentials($mail_smtpname, $mail_smtppassword) {
138
		$this->config->setSystemValues([
139
			'mail_smtpname'		=> $mail_smtpname,
140
			'mail_smtppassword'	=> $mail_smtppassword,
141
		]);
142
143
		return ['data' =>
144
			['message' =>
145
				(string) $this->l10n->t('Saved')
146
			],
147
			'status' => 'success'
148
		];
149
	}
150
151
	/**
152
	 * Send a mail to test the settings