diff --git a/drupal/modules/casost/src/Controller/CASLogin.php b/drupal/modules/casost/src/Controller/CASLogin.php index d62f256c33b2d0a2985fc7afb3f10a1b8a9af930..e76d04848f747c8c020a77cc7a9ebe6e15ebad60 100644 --- a/drupal/modules/casost/src/Controller/CASLogin.php +++ b/drupal/modules/casost/src/Controller/CASLogin.php @@ -21,6 +21,7 @@ class CASLogin extends ControllerBase protected $serverHostname; protected $serverPort; protected $serverUri; + protected $redirectUrl; protected $changeSessionId; protected $CASServerCACert; protected $CASServerCNValidate; @@ -75,6 +76,7 @@ class CASLogin extends ControllerBase $this->serverHostname = $CASOSTConfig->serverhostname->value; $this->serverPort = $CASOSTConfig->serverport->value; $this->serverUri = $CASOSTConfig->serveruri->value === null ? '' : $CASOSTConfig->serveruri->value; + $this->redirectUrl = $CASOSTConfig->redirecturl->value; $this->changeSessionId = $CASOSTConfig->changesessionid->value; $this->CASServerCACert = $CASOSTConfig->casservercacert->value; $this->CASServerCNValidate = $CASOSTConfig->casservercnvalidate->value; @@ -175,8 +177,7 @@ class CASLogin extends ControllerBase // $this->logger->warning('cn=' . $filterAttribute('cn')); $epalToken = $this->authenticatePhase2($request, $CASUser, $filterAttribute('cn')); if ($epalToken) { - - return new RedirectResponse('/dist/#/school?auth_token=' . $epalToken.'&auth_role=director', 302, []); + return new RedirectResponse($this->redirectUrl . '?auth_token=' . $epalToken.'&auth_role=director', 302, []); } else { $response = new Response(); $response->setContent('forbidden'); diff --git a/drupal/modules/casost/src/Entity/CASOSTConfig.php b/drupal/modules/casost/src/Entity/CASOSTConfig.php index 93c5311765506c781f7b23495ad5a64ae4951de3..1bdb30b5a51d690d40aadd825eab707af28db53d 100644 --- a/drupal/modules/casost/src/Entity/CASOSTConfig.php +++ b/drupal/modules/casost/src/Entity/CASOSTConfig.php @@ -290,6 +290,26 @@ class CASOSTConfig extends ContentEntityBase implements CASOSTConfigInterface ->setDisplayConfigurable('form', true) ->setDisplayConfigurable('view', true); + $fields['redirecturl'] = BaseFieldDefinition::create('string') + ->setLabel(t('Redirect Url')) + ->setDescription(t('Redirect Url')) + ->setSettings(array( + 'max_length' => 200, + 'text_processing' => 0, + )) + ->setDefaultValue('/dist/#/school') + ->setDisplayOptions('view', array( + 'label' => 'above', + 'type' => 'string', + 'weight' => -4, + )) + ->setDisplayOptions('form', array( + 'type' => 'string_textfield', + 'weight' => -4, + )) + ->setDisplayConfigurable('form', true) + ->setDisplayConfigurable('view', true); + $fields['changesessionid'] = BaseFieldDefinition::create('boolean') ->setLabel(t('Change Session Id')) ->setDescription(t('A boolean indicating whether we change session id.'))