Skip to content
Snippets Groups Projects
Commit b0ebbfa2 authored by Kevin von Spiczak's avatar Kevin von Spiczak
Browse files

[BUGFIX] throw 404 whe calling unsolicited application form with a

parent bff19e09
No related branches found
No related tags found
1 merge request!54[BUGFIX] throw 404 whe calling unsolicited application form with a
......@@ -379,12 +379,22 @@ class JoblistController extends ActionController {
$this->request = $this->request->withArgument('error', NULL);
}
if ($jobId === NULL && $this->settings['disallowUnsolicitedApplication']) {
$uriBuilder = $this->uriBuilder;
$uri = $uriBuilder
->setTargetPageUid($this->settings['offersPage'])
->build();
$this->redirectToUri($uri, 0, 301);
// Check if this page is explicitly configured as an unsolicited application page.
if (($this->settings['isUnsolicitedApplicationPage'] ?? FALSE) && $jobId !== NULL) {
// For unsolicited pages, a job parameter is not allowed
throw new \TYPO3\CMS\Core\Error\Http\PageNotFoundException(
'Job parameter is not allowed on an unsolicited application page.'
);
} else {
// For regular application pages, if the disallow unsolicited setting is explicitly enabled and no job
// parameter is provided, redirect to the offers page.
if ($jobId === NULL && $this->settings['disallowUnsolicitedApplication']) {
$uriBuilder = $this->uriBuilder;
$uri = $uriBuilder
->setTargetPageUid($this->settings['offersPage'])
->build();
$this->redirectToUri($uri, 0, 301);
}
}
$folderName = NULL;
......
......@@ -49,6 +49,15 @@
</config>
</TCEforms>
</settings.privacyPolicyPage>
<settings.isUnsolicitedApplicationPage>
<TCEforms>
<label>LLL:EXT:sg_jobs/Resources/Private/Language/locallang_db.xlf:tx_sgjobs.application_isUnsolicitedApplicationPage</label>
<description>LLL:EXT:sg_jobs/Resources/Private/Language/locallang_db.xlf:tx_sgjobs.application_isUnsolicitedApplicationPage_description</description>
<config>
<type>check</type>
</config>
</TCEforms>
</settings.isUnsolicitedApplicationPage>
</el>
</ROOT>
</sDEF>
......
......@@ -37,6 +37,14 @@
<source><![CDATA[Privacy policy page]]></source>
<target><![CDATA[Datenschutzinformationsseite]]></target>
</trans-unit>
<trans-unit id="tx_sgjobs.application_isUnsolicitedApplicationPage" approved="yes">
<source><![CDATA[Is the page for unsolicited applications]]></source>
<target><![CDATA[Ist die Seite für Initiativbewerbungen]]></target>
</trans-unit>
<trans-unit id="tx_sgjobs.application_isUnsolicitedApplicationPage_description" approved="yes">
<source><![CDATA[If checked, a 404 error is thrown, when trying to call this plugin with a $job parameter.]]></source>
<target><![CDATA[Wenn diese Option aktiviert ist, wird ein 404-Fehler ausgegeben, wenn versucht wird, das Plugin mit einem $job-Parameter aufzurufen.]]></target>
</trans-unit>
<trans-unit id="tx_sgjobs.application_redirect_page" approved="yes">
<source><![CDATA[Page to redirect to after an application is submitted]]></source>
<target><![CDATA[Seite, auf die nach Abschicken der Bewerbung weitergeleitet wird]]></target>
......
......@@ -33,6 +33,12 @@
<trans-unit id="tx_sgjobs.application_privacyPolicyPage_formlabel">
<source><![CDATA[Privacy policy page]]></source>
</trans-unit>
<trans-unit id="tx_sgjobs.application_isUnsolicitedApplicationPage">
<source><![CDATA[Is the page for unsolicited applications]]></source>
</trans-unit>
<trans-unit id="tx_sgjobs.application_isUnsolicitedApplicationPage_description">
<source><![CDATA[If checked, a 404 error is thrown, when trying to call this plugin with a $job parameter.]]></source>
</trans-unit>
<trans-unit id="tx_sgjobs.application_redirect_page">
<source><![CDATA[Page to redirect to after an application is submitted]]></source>
</trans-unit>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment