Skip to content
Snippets Groups Projects
Commit c7bde26c authored by Dorian Merz's avatar Dorian Merz
Browse files

refs #17496 [master] fixes last artifacts from #9700

* moves code bits for SSO redirection to correct module
parent 3a1f057c
No related merge requests found
......@@ -26,8 +26,9 @@
* @link https://vufind.org Main Site
*/
namespace finc\Controller;
use Zend\Log\LoggerAwareInterface as LoggerAwareInterface;
use Zend\Log\LoggerAwareInterface as LoggerAwareInterface,
Zend\Mvc\MvcEvent as MvcEvent;
use Zend\Mvc\Controller\Plugin\Url;
/**
* Controller for the user account area.
......@@ -45,4 +46,26 @@ class MyResearchController extends \VuFind\Controller\MyResearchController imple
use CustomTraits\AcquisitionTrait;
use CustomTraits\EmailProfileTrait;
use CustomTraits\ResetPasswordTrait;
/**
* Execute the request
*
* @param MvcEvent $e
* @return mixed
* @throws Exception\DomainException
*/
public function onDispatch(MvcEvent $e)
{
if ($redirect = $this->getRequest()->getQuery()->get('redirect')) {
//if we have a "redirect" param, the user should be lead to the given url,
//at least as long as his login is successful
//we achieve that by forcing the follow-up url to be the redirect
//but watch out, the redirect via followup will only work if the redirect url
//is schemed correctly
if (!is_string($redirect)) $this->flashMessenger()->addErrorMessage('Invalid data type for redirect');
elseif (!preg_match('/^https?\:\/\//',$redirect)) $this->flashMessenger()->addErrorMessage('Invalid Redirect: '.$redirect);
else $this->followup()->store(['finc-redirect' => $redirect]);
}
return parent::onDispatch($e);
}
}
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment