Skip to content

Commit 8199cd2

Browse files
committed
comment merge methods for now
1 parent 013ad10 commit 8199cd2

File tree

1 file changed

+19
-12
lines changed

1 file changed

+19
-12
lines changed

app/Http/Requests/SettingsSamlRequest.php

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ public function rules()
4141
public function withValidator($validator)
4242
{
4343
$validator->after(function ($validator) {
44+
$setting = Setting::getSettings();
4445
if ($this->input('saml_enabled') == '1') {
4546
$idpMetadata = $this->input('saml_idp_metadata');
4647
if (! empty($idpMetadata)) {
@@ -56,7 +57,7 @@ public function withValidator($validator)
5657
}
5758
}
5859

59-
$was_custom_x509cert = strpos(Setting::getSettings()->saml_custom_settings, 'sp_x509cert') !== false;
60+
$was_custom_x509cert = strpos($setting->saml_custom_settings, 'sp_x509cert') !== false;
6061

6162
$custom_x509cert = '';
6263
$custom_privateKey = '';
@@ -126,14 +127,14 @@ public function withValidator($validator)
126127
}
127128

128129
if (! (empty($x509cert) && empty($privateKey))) {
129-
$this->merge([
130-
'saml_sp_x509cert' => $x509cert,
131-
'saml_sp_privatekey' => $privateKey,
132-
]);
133-
$setting = Setting::getSettings();
130+
// $this->merge([
131+
// 'saml_sp_x509cert' => $x509cert,
132+
// 'saml_sp_privatekey' => $privateKey,
133+
// ]);
134134
$setting->saml_sp_x509cert = $x509cert;
135135
$setting->saml_sp_privatekey = $privateKey;
136136
$setting->save();
137+
137138
}
138139
} else {
139140
$validator->errors()->add('saml_integration', 'openssl.cnf is missing/invalid');
@@ -149,15 +150,21 @@ public function withValidator($validator)
149150
}
150151

151152
if (! empty($x509certNew)) {
152-
$this->merge([
153-
'saml_sp_x509certNew' => $x509certNew,
154-
]);
153+
// $this->merge([
154+
// 'saml_sp_x509certNew' => $x509certNew,
155+
// ]);
156+
$setting->saml_sp_x509certNew = $x509certNew;
157+
$setting->save();
155158
}
156159
} else {
157-
$this->merge([
158-
'saml_sp_x509certNew' => '',
159-
]);
160+
// $this->merge([
161+
// 'saml_sp_x509certNew' => '',
162+
// ]);
163+
$setting->saml_sp_x509certNew = '';
164+
$setting->save();
160165
}
166+
167+
161168
});
162169
}
163170
}

0 commit comments

Comments
 (0)